summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorharrisb <harrisb@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-11-26 15:20:25 +0000
committerharrisb <harrisb@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-11-26 15:20:25 +0000
commit8d33367e6c3934851f19b56f58a9572bf2b63788 (patch)
treed6c0d7834ca8ce860769b2920a140d8032436b20
parent71a59db6d16ce3ef63e36bf0a4fb3b67bd303db4 (diff)
downloadATCD-8d33367e6c3934851f19b56f58a9572bf2b63788.tar.gz
Create branch for Naming service object group persistence
-rw-r--r--ACE/ChangeLog419
-rw-r--r--ACE/NEWS16
-rw-r--r--ACE/OCI_RE_ChangeLog10
-rw-r--r--ACE/PROBLEM-REPORT-FORM2
-rw-r--r--ACE/THANKS2
-rw-r--r--ACE/VERSION2
-rw-r--r--ACE/ace/Auto_Event.cpp45
-rw-r--r--ACE/ace/Auto_Event.h55
-rw-r--r--ACE/ace/Auto_Event.inl3
-rw-r--r--ACE/ace/Condition_Attributes.cpp4
-rw-r--r--ACE/ace/Condition_Attributes.h6
-rw-r--r--ACE/ace/Condition_Attributes.inl1
-rw-r--r--ACE/ace/ETCL/ETCL_Constraint.inl1
-rw-r--r--ACE/ace/Event.cpp81
-rw-r--r--ACE/ace/Event.h118
-rw-r--r--ACE/ace/Event.inl14
-rw-r--r--ACE/ace/Event_Base.cpp76
-rw-r--r--ACE/ace/Event_Base.h141
-rw-r--r--ACE/ace/Event_Base.inl18
-rw-r--r--ACE/ace/Malloc.cpp4
-rw-r--r--ACE/ace/Manual_Event.cpp48
-rw-r--r--ACE/ace/Manual_Event.h54
-rw-r--r--ACE/ace/Manual_Event.inl3
-rw-r--r--ACE/ace/Message_Queue.h4
-rw-r--r--ACE/ace/Naming_Context.cpp3
-rw-r--r--ACE/ace/Naming_Context.h1
-rw-r--r--ACE/ace/OS_NS_Thread.cpp51
-rw-r--r--ACE/ace/OS_NS_Thread.h51
-rw-r--r--ACE/ace/OS_NS_Thread.inl140
-rw-r--r--ACE/ace/OS_NS_netdb.inl4
-rw-r--r--ACE/ace/Obchunk.h1
-rw-r--r--ACE/ace/Obstack_T.cpp8
-rw-r--r--ACE/ace/Obstack_T.h14
-rw-r--r--ACE/ace/Reactor.h15
-rw-r--r--ACE/ace/Read_Buffer.cpp11
-rw-r--r--ACE/ace/Recursive_Thread_Mutex.cpp4
-rw-r--r--ACE/ace/SSL/SSL_Context.cpp10
-rw-r--r--ACE/ace/SSL/SSL_Context.h4
-rw-r--r--ACE/ace/SV_Semaphore_Simple.cpp3
-rw-r--r--ACE/ace/Service_Config.h25
-rw-r--r--ACE/ace/Sig_Adapter.cpp11
-rw-r--r--ACE/ace/Signal.h2
-rw-r--r--ACE/ace/TSS_T.inl4
-rw-r--r--ACE/ace/Test_and_Set.h12
-rw-r--r--ACE/ace/Timer_Hash_T.h1
-rw-r--r--ACE/ace/Timer_Queue_Iterator.cpp4
-rw-r--r--ACE/ace/Timer_Queue_Iterator.h4
-rw-r--r--ACE/ace/Version.h4
-rw-r--r--ACE/ace/XML_Utils/ACE_XML_Utils.pc.in11
-rw-r--r--ACE/ace/XML_Utils/XML.mpc4
-rw-r--r--ACE/ace/ace.mpc8
-rw-r--r--ACE/ace/ace_for_tao.mpc8
-rw-r--r--ACE/ace/config-hpux-11.00.h7
-rw-r--r--ACE/ace/config-macosx-mountain-lion.h7
-rwxr-xr-xACE/bin/diff-builds-and-group-fixed-tests-only.sh2
-rwxr-xr-xACE/bin/fuzz.pl1
-rw-r--r--ACE/debian/ACE-DPKG.mwc34
-rw-r--r--ACE/debian/README.source8
-rw-r--r--ACE/debian/TAO-DPKG.mwc27
-rw-r--r--ACE/debian/ace.dsc6
-rw-r--r--ACE/debian/debian.control92
-rw-r--r--ACE/debian/default.features1
-rw-r--r--ACE/debian/libace-6.1.4.docs (renamed from ACE/debian/libace-6.1.6.docs)0
-rw-r--r--ACE/debian/libace-6.1.4.install (renamed from ACE/debian/libace-6.1.6.install)0
-rw-r--r--ACE/debian/libace-flreactor-6.1.4.install (renamed from ACE/debian/libace-flreactor-6.1.6.install)0
-rw-r--r--ACE/debian/libace-foxreactor-6.1.4.install (renamed from ACE/debian/libace-foxreactor-6.1.6.install)0
-rw-r--r--ACE/debian/libace-htbp-6.1.4.install (renamed from ACE/debian/libace-htbp-6.1.6.install)0
-rw-r--r--ACE/debian/libace-inet-6.1.4.install (renamed from ACE/debian/libace-inet-6.1.6.install)0
-rw-r--r--ACE/debian/libace-inet-ssl-6.1.4.install (renamed from ACE/debian/libace-inet-ssl-6.1.6.install)0
-rw-r--r--ACE/debian/libace-qtreactor-6.1.4.install (renamed from ACE/debian/libace-qtreactor-6.1.6.install)0
-rw-r--r--ACE/debian/libace-rmcast-6.1.4.install (renamed from ACE/debian/libace-rmcast-6.1.6.install)0
-rw-r--r--ACE/debian/libace-ssl-6.1.4.NEWS (renamed from ACE/debian/libace-ssl-6.1.6.NEWS)0
-rw-r--r--ACE/debian/libace-ssl-6.1.4.install (renamed from ACE/debian/libace-ssl-6.1.6.install)0
-rw-r--r--ACE/debian/libace-tkreactor-6.1.4.install (renamed from ACE/debian/libace-tkreactor-6.1.6.install)0
-rw-r--r--ACE/debian/libace-tmcast-6.1.4.install (renamed from ACE/debian/libace-tmcast-6.1.6.install)0
-rw-r--r--ACE/debian/libace-xml-utils-6.1.6.install1
-rw-r--r--ACE/debian/libace-xml-utils-dev.install3
-rw-r--r--ACE/debian/libace-xtreactor-6.1.4.install (renamed from ACE/debian/libace-xtreactor-6.1.6.install)0
-rw-r--r--ACE/debian/libacexml-6.1.4.docs (renamed from ACE/debian/libacexml-6.1.6.docs)0
-rw-r--r--ACE/debian/libacexml-6.1.4.install (renamed from ACE/debian/libacexml-6.1.6.install)0
-rw-r--r--ACE/debian/libkokyu-6.1.4.docs (renamed from ACE/debian/libkokyu-6.1.6.docs)0
-rw-r--r--ACE/debian/libkokyu-6.1.4.install (renamed from ACE/debian/libkokyu-6.1.6.install)0
-rw-r--r--ACE/debian/libnetsvcs-6.1.2.docs (renamed from ACE/debian/libnetsvcs-6.1.6.docs)0
-rw-r--r--ACE/debian/libnetsvcs-6.1.2.install (renamed from ACE/debian/libnetsvcs-6.1.6.install)0
-rw-r--r--ACE/debian/libtao-2.1.4.docs4
-rw-r--r--ACE/debian/libtao-2.1.4.install (renamed from ACE/debian/libtao-2.1.6.install)2
-rw-r--r--ACE/debian/libtao-2.1.6.docs4
-rw-r--r--ACE/debian/libtao-dev.docs6
-rw-r--r--ACE/debian/libtao-dev.install5
-rw-r--r--ACE/debian/libtao-doc.docs2
-rw-r--r--ACE/debian/libtao-flresource-2.1.4.install (renamed from ACE/debian/libtao-flresource-2.1.6.install)0
-rw-r--r--ACE/debian/libtao-foxresource-2.1.4.install (renamed from ACE/debian/libtao-foxresource-2.1.6.install)0
-rw-r--r--ACE/debian/libtao-orbsvcs-2.1.4.NEWS (renamed from ACE/debian/libtao-orbsvcs-2.1.6.NEWS)0
-rw-r--r--ACE/debian/libtao-orbsvcs-2.1.4.install (renamed from ACE/debian/libtao-orbsvcs-2.1.6.install)0
-rw-r--r--ACE/debian/libtao-qtresource-2.1.4.install (renamed from ACE/debian/libtao-qtresource-2.1.6.install)0
-rw-r--r--ACE/debian/libtao-tkresource-2.1.4.install (renamed from ACE/debian/libtao-tkresource-2.1.6.install)0
-rw-r--r--ACE/debian/libtao-xtresource-2.1.4.install (renamed from ACE/debian/libtao-xtresource-2.1.6.install)0
-rw-r--r--ACE/debian/mwc_workspace.txt26
-rw-r--r--ACE/debian/patches/15-fix-lzo-flags.diff22
-rw-r--r--ACE/debian/patches/20-versioned_libs.diff137
-rw-r--r--ACE/debian/patches/34-bts386713.diff389
-rw-r--r--ACE/debian/patches/35_disable_sslv2.diff114
-rw-r--r--ACE/debian/patches/series4
-rw-r--r--ACE/debian/platform_macros.GNU3
-rw-r--r--ACE/debian/platform_macros.GNU.in127
-rw-r--r--ACE/debian/tao-concurrency.docs2
-rw-r--r--ACE/debian/tao-cosconcurrency.docs2
-rw-r--r--ACE/debian/tao-cosevent.docs2
-rw-r--r--ACE/debian/tao-cosnaming.docs2
-rw-r--r--ACE/debian/tao-cosnotification.docs2
-rw-r--r--ACE/debian/tao-costime.docs2
-rw-r--r--ACE/debian/tao-costrading.docs2
-rw-r--r--ACE/debian/tao-event.docs2
-rw-r--r--ACE/debian/tao-ft.docs2
-rw-r--r--ACE/debian/tao-ifr.docs2
-rw-r--r--ACE/debian/tao-imr.docs2
-rw-r--r--ACE/debian/tao-load.docs2
-rw-r--r--ACE/debian/tao-log.docs2
-rw-r--r--ACE/debian/tao-log.install2
-rw-r--r--ACE/debian/tao-naming.docs2
-rw-r--r--ACE/debian/tao-notify.docs2
-rw-r--r--ACE/debian/tao-time.docs2
-rw-r--r--ACE/debian/tao-tls.docs2
-rw-r--r--ACE/debian/tao-trading.docs2
-rw-r--r--ACE/debian/tao-utils.docs6
-rw-r--r--ACE/docs/ACE-monotonic-timer.html63
-rw-r--r--ACE/docs/Download.html108
-rw-r--r--ACE/docs/bczar/bczar.html14
-rw-r--r--ACE/etc/index.html2
-rw-r--r--ACE/include/makeinclude/platform_g++_common.GNU6
-rw-r--r--ACE/include/makeinclude/platform_macosx_mountain_lion.GNU4
-rw-r--r--ACE/include/makeinclude/rules.lib.GNU32
-rw-r--r--ACE/include/makeinclude/rules.local.GNU18
-rw-r--r--ACE/include/makeinclude/wrapper_macros.GNU5
-rw-r--r--ACE/protocols/ace/INet/HTTP_Simple_exec.cpp14
-rw-r--r--ACE/rpmbuild/ace-tao.spec9
-rw-r--r--ACE/tests/Bug_4055_Regression_Test.cpp8
-rw-r--r--ACE/tests/Manual_Event_Test.cpp11
-rw-r--r--ACE/tests/Monotonic_Manual_Event_Test.cpp332
-rw-r--r--ACE/tests/Monotonic_Message_Queue_Test.cpp7
-rw-r--r--ACE/tests/Monotonic_Task_Test.cpp7
-rw-r--r--ACE/tests/Network_Adapters_Test.cpp11
-rw-r--r--ACE/tests/Network_Adapters_Test.h2
-rw-r--r--ACE/tests/Obstack_Test.cpp4
-rw-r--r--ACE/tests/run_test.lst3
-rw-r--r--ACE/tests/tests.mpc7
-rw-r--r--CIAO/ChangeLog69
-rw-r--r--CIAO/NEWS10
-rw-r--r--CIAO/PROBLEM-REPORT-FORM6
-rw-r--r--CIAO/VERSION2
-rw-r--r--CIAO/bin/ciao_tests.lst1
-rw-r--r--CIAO/ccm/CCM_Transaction.idl1
-rw-r--r--CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp6
-rw-r--r--CIAO/ciao/Version.h4
-rw-r--r--CIAO/connectors/dds4ccm/impl/DataReaderListener_T.cpp16
-rw-r--r--CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp20
-rw-r--r--CIAO/tests/Bug_3769_Regression/Foo.idl26
-rw-r--r--CIAO/tests/Bug_3769_Regression/Foo_exec.cpp37
-rw-r--r--CIAO/tests/Bug_3769_Regression/Foo_exec.h8
-rw-r--r--CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp77
-rwxr-xr-xCIAO/tests/Bug_3769_Regression/descriptors/run_test_cdr.pl251
-rw-r--r--DAnCE/ChangeLog28
-rw-r--r--DAnCE/NEWS10
-rw-r--r--DAnCE/PROBLEM-REPORT-FORM6
-rw-r--r--DAnCE/VERSION2
-rw-r--r--DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp18
-rw-r--r--DAnCE/dance/Plan_Launcher/EM_Launcher.cpp4
-rw-r--r--DAnCE/dance/Plan_Launcher/LM_Launcher.cpp3
-rw-r--r--DAnCE/dance/Plan_Launcher/NM_Launcher.cpp3
-rw-r--r--DAnCE/dance/Version.h4
-rw-r--r--TAO/ChangeLog220
-rw-r--r--TAO/MPC/config/dynamic_tp.mpb7
-rw-r--r--TAO/MPC/config/ft_naming_serv.mpb7
-rw-r--r--TAO/MPC/config/ftnaming.mpb8
-rw-r--r--TAO/NEWS14
-rw-r--r--TAO/OCI_RE_ChangeLog1440
-rw-r--r--TAO/PROBLEM-REPORT-FORM4
-rw-r--r--TAO/TAO_IDL/ast/ast_module.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp5
-rw-r--r--TAO/TAO_IDL/include/ast_module.h6
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp5
-rw-r--r--TAO/TAO_IDL/util/utl_scope.cpp12
-rw-r--r--TAO/VERSION2
-rw-r--r--TAO/bin/tao_orb_tests.lst3
-rw-r--r--TAO/bin/tao_other_tests.lst7
-rw-r--r--TAO/docs/Options.html379
-rw-r--r--TAO/examples/Simple/Simple_util.cpp2
-rw-r--r--TAO/examples/Simple/time/Time_Client_i.cpp3
-rw-r--r--TAO/examples/Simple/time/server.cpp10
-rw-r--r--TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc4
-rw-r--r--TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc4
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp272
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.h104
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp118
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h7
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc15
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp33
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Options.h1
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp547
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h50
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp50
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h33
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/README.txt (renamed from TAO/orbsvcs/ImplRepo_Service/README)2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.h2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp282
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.h63
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp187
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.h66
-rw-r--r--TAO/orbsvcs/Naming_Service/FT_Naming_Main.cpp66
-rw-r--r--TAO/orbsvcs/Naming_Service/FT_Naming_Service.cpp31
-rw-r--r--TAO/orbsvcs/Naming_Service/FT_Naming_Service.h52
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.cpp28
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.h16
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.mpc18
-rw-r--r--TAO/orbsvcs/Naming_Service/README86
-rw-r--r--TAO/orbsvcs/Notify_Service/Notify_Service.mpc8
-rw-r--r--TAO/orbsvcs/Time_Service/Time_Service.mpc8
-rw-r--r--TAO/orbsvcs/Trading_Service/Trading_Service.mpc4
-rw-r--r--TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc2
-rw-r--r--TAO/orbsvcs/orbsvcs/FT_NamingManager.idl66
-rw-r--r--TAO/orbsvcs/orbsvcs/FtNaming.mpc27
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp2
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp2
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp2
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Location_Index_Map.h43
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl78
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp689
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h300
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp60
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h72
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc42
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp776
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h113
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp116
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp39
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h55
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp88
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h83
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp269
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h102
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h64
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/ftnaming_export.h58
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp171
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h11
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp106
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.cpp22
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h69
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp36
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h15
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.cpp139
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h88
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp32
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h17
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp33
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h14
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp39
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h55
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable.h13
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp154
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h47
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h18
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp47
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h67
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp53
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h11
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp41
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h21
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb3
-rw-r--r--TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp61
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h59
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp225
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.h98
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc34
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README4
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/README8
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl27
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp149
-rwxr-xr-xTAO/orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl168
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp119
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/svc.conf3
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf3
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf.xml10
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/ReconnectServer/client.cpp6
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl18
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp81
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerServer.cpp117
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.cpp53
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.h43
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/README10
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/RestartServer.mpc37
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp39
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.h13
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/RestartServer/client.conf3
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl245
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp25
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h3
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/run_test.pl915
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp9
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp6
-rw-r--r--TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp9
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/client.cpp8
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl92
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test_ft.pl217
-rw-r--r--TAO/tao/AnyTypeCode/Alias_TypeCode.cpp3
-rw-r--r--TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp6
-rw-r--r--TAO/tao/AnyTypeCode/Objref_TypeCode.cpp3
-rw-r--r--TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp6
-rw-r--r--TAO/tao/Any_Insert_Policy_T.h6
-rw-r--r--TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp56
-rw-r--r--TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp3
-rw-r--r--TAO/tao/CSD_Framework/CSD_ORBInitializer.h2
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp175
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp4
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_TP_Task.h2
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_ThreadPool.cpp52
-rw-r--r--TAO/tao/CSD_ThreadPool/CSD_ThreadPool.h10
-rw-r--r--TAO/tao/Cache_Entries_T.h2
-rw-r--r--TAO/tao/Client_Strategy_Factory.h10
-rw-r--r--TAO/tao/Codeset/Codeset_Manager_i.cpp6
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP.mpc10
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_Config.cpp334
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_Config.h124
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp111
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h72
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp113
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h63
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp204
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.h64
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp278
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h210
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl50
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp80
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h161
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl128
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_Task.cpp86
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_Task.h155
-rw-r--r--TAO/tao/Dynamic_TP/Dynamic_TP_Task.inl20
-rw-r--r--TAO/tao/Dynamic_TP/dynamic_tp_export.h58
-rw-r--r--TAO/tao/IIOP_Transport.cpp3
-rw-r--r--TAO/tao/Invocation_Adapter.cpp6
-rw-r--r--TAO/tao/Invocation_Retry_Params.cpp20
-rw-r--r--TAO/tao/Invocation_Retry_Params.h61
-rw-r--r--TAO/tao/Invocation_Retry_State.cpp173
-rw-r--r--TAO/tao/Invocation_Retry_State.h99
-rw-r--r--TAO/tao/Invocation_Utils.h2
-rw-r--r--TAO/tao/LocateRequest_Invocation.cpp2
-rw-r--r--TAO/tao/Messaging/AMH_Response_Handler.h9
-rw-r--r--TAO/tao/ORBInitializer_Registry.cpp3
-rw-r--r--TAO/tao/ORB_Core.cpp77
-rw-r--r--TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h2
-rw-r--r--TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h2
-rw-r--r--TAO/tao/PI/ORBInitInfo.cpp3
-rw-r--r--TAO/tao/PortableServer/LifespanStrategyPersistent.cpp4
-rw-r--r--TAO/tao/PortableServer/Root_POA.cpp90
-rw-r--r--TAO/tao/PortableServer/Root_POA.h7
-rw-r--r--TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp28
-rw-r--r--TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h2
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.cpp3
-rw-r--r--TAO/tao/Seq_Var_T.h9
-rw-r--r--TAO/tao/Seq_Var_T.inl15
-rw-r--r--TAO/tao/Stub.cpp37
-rw-r--r--TAO/tao/Stub.h11
-rw-r--r--TAO/tao/Stub.inl51
-rw-r--r--TAO/tao/Synch_Invocation.cpp298
-rw-r--r--TAO/tao/TAO_Internal.cpp3
-rw-r--r--TAO/tao/Transport.cpp7
-rw-r--r--TAO/tao/Transport.h13
-rw-r--r--TAO/tao/Transport_Cache_Manager_T.cpp4
-rw-r--r--TAO/tao/Transport_Connector.cpp5
-rw-r--r--TAO/tao/Utils/PolicyList_Destroyer.cpp22
-rw-r--r--TAO/tao/VarOut_T.h4
-rw-r--r--TAO/tao/VarOut_T.inl16
-rw-r--r--TAO/tao/Version.h4
-rw-r--r--TAO/tao/default_client.cpp106
-rw-r--r--TAO/tao/default_client.h5
-rw-r--r--TAO/tao/params.cpp30
-rw-r--r--TAO/tao/params.h16
-rw-r--r--TAO/tao/tao.mpc2
-rw-r--r--TAO/tests/Bug_2677_Regression/server.cpp3
-rw-r--r--TAO/tests/Bug_2936_Regression/bug2936.cpp6
-rw-r--r--TAO/tests/Bug_3542_Regression/server.cpp3
-rwxr-xr-xTAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl2
-rw-r--r--TAO/tests/DLL_ORB/client.cpp3
-rw-r--r--TAO/tests/DLL_ORB/server.cpp4
-rw-r--r--TAO/tests/Dynamic_TP/Config_Loader/Config_Loader.mpc5
-rw-r--r--TAO/tests/Dynamic_TP/Config_Loader/Test.cpp80
-rw-r--r--TAO/tests/Dynamic_TP/Config_Loader/svc.conf16
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Dynamic_TP_POA_Test_Dynamic.mpc35
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp21
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.h31
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Test.idl20
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/client.cpp76
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp112
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/svc.conf4
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/POA_Loader.mpc5
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/Test.cpp102
-rw-r--r--TAO/tests/Dynamic_TP/POA_Loader/svc.conf15
-rw-r--r--TAO/tests/IDL_Test/IDL_Test.mpc10
-rw-r--r--TAO/tests/IDL_Test/PEMNaming.idl61
-rw-r--r--TAO/tests/IDL_Test/loader_const.idl17
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp26
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h33
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/README14
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Retry_On_Connection_Failure.mpc37
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl22
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp87
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl104
-rw-r--r--TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp115
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/README23
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/Retry_On_Reply_Failure.mpc35
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/client.cpp278
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl152
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/server.cpp121
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test.idl8
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp58
-rwxr-xr-xTAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.h46
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp3
-rw-r--r--TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp9
-rw-r--r--TAO/tests/POA/Non_Retain_System_Id/Non_Retain_System_Id.mpc6
-rwxr-xr-xTAO/tests/POA/Non_Retain_System_Id/run_test.pl22
-rw-r--r--TAO/tests/POA/Non_Retain_System_Id/test.cpp215
-rw-r--r--TAO/tests/POA/Non_Retain_System_Id/test.idl6
-rw-r--r--TAO/tests/TransportCurrent/Framework/simple.cpp3
-rw-r--r--TAO/tests/Var_Deref/README.txt8
-rw-r--r--TAO/tests/Var_Deref/Test.idl19
-rw-r--r--TAO/tests/Var_Deref/Var_Deref.mpc23
-rw-r--r--TAO/tests/Var_Deref/var_deref.cpp83
-rw-r--r--TAO/utils/catior/catior.mpc5
-rw-r--r--TAO/utils/logWalker/GIOP_Buffer.cpp595
-rw-r--r--TAO/utils/logWalker/GIOP_Buffer.h114
-rw-r--r--TAO/utils/logWalker/HostProcess.cpp115
-rw-r--r--TAO/utils/logWalker/HostProcess.h16
-rw-r--r--TAO/utils/logWalker/Invocation.cpp699
-rw-r--r--TAO/utils/logWalker/Invocation.h82
-rw-r--r--TAO/utils/logWalker/Log.cpp931
-rw-r--r--TAO/utils/logWalker/Log.h104
-rw-r--r--TAO/utils/logWalker/PeerObject.cpp7
-rw-r--r--TAO/utils/logWalker/PeerProcess.cpp54
-rw-r--r--TAO/utils/logWalker/PeerProcess.h9
-rw-r--r--TAO/utils/logWalker/Session.cpp20
-rw-r--r--TAO/utils/logWalker/Session.h4
-rw-r--r--TAO/utils/logWalker/Thread.cpp136
-rw-r--r--TAO/utils/logWalker/Thread.h32
-rw-r--r--TAO/utils/logWalker/logWalker.cpp44
-rw-r--r--TAO/utils/nsgroup/README.nsgroup155
-rw-r--r--TAO/utils/nsgroup/nsgroup.cpp98
-rw-r--r--TAO/utils/nsgroup/nsgroup.mpc12
-rw-r--r--TAO/utils/nsgroup/nsgroup_svc.cpp973
-rw-r--r--TAO/utils/nsgroup/nsgroup_svc.h140
-rwxr-xr-xTAO/utils/nsgroup/run_test.pl363
-rw-r--r--TAO/utils/nsgroup/windows.conf3
-rw-r--r--TAO/utils/nsgroup/windows.conf.xml10
-rw-r--r--TAO/utils/nslist/nslist.mpc4
-rw-r--r--TAO/utils/utils.mwc2
468 files changed, 20564 insertions, 6091 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 9398937a614..332700bbbc9 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,422 +1,3 @@
-Mon Nov 26 12:37:04 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/mwc_workspace.txt:
- Added netsvcs/servers
-
-Sun Nov 25 20:08:55 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * include/makeinclude/rules.local.GNU:
- Fixex AIX errors
-
-Sun Nov 25 20:05:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/mwc_workspace.txt:
- * debian/TAO_ACE.mwc:
- Renamed to .txt, resolves problems on windows builds
-
-Fri Nov 23 19:28:35 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
-
- * THANKS:
-
- Added Sergey Onuchin <sonuchin at parallels dot com>.
-
-Fri Nov 23 16:49:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/tao-imr.docs:
- * debian/tao-log.docs:
- * debian/tao-notify.docs:
- * debian/tao-trading.docs:
- Updated README locations
-
-Fri Nov 23 15:26:38 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/tao-concurrency.docs:
- * debian/tao-cosconcurrency.docs:
- * debian/tao-cosevent.docs:
- * debian/tao-cosnotification.docs:
- * debian/tao-costime.docs:
- * debian/tao-costrading.docs:
- * debian/tao-event.docs:
- * debian/tao-ft.docs:
- * debian/tao-ifr.docs:
- * debian/tao-imr.docs:
- * debian/tao-load.docs:
- * debian/tao-log.docs:
- * debian/tao-naming.docs:
- * debian/tao-notify.docs:
- * debian/tao-time.docs:
- * debian/tao-tls.docs:
- * debian/tao-utils.docs:
- We are going to install the README files also
-
-Fri Nov 23 14:21:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/tao-cosnaming.docs:
- Updated path
-
-Fri Nov 23 12:58:40 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/libtao-doc.docs:
- Install fix
-
-Fri Nov 23 12:33:16 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * include/makeinclude/rules.lib.GNU:
- Fix for AIX
-
-Fri Nov 23 12:28:20 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Service_Config.h:
- msvc fix
-
-Fri Nov 23 12:19:09 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/libace-dev.docs:
- * debian/libace-doc.docs:
- * debian/libnetsvcs-6.1.6.docs:
- * debian/libnetsvcs-6.1.6.install:
- * debian/libtao-2.1.6.docs:
- * debian/libtao-dev.docs:
- * debian/libnetsvcs-6.1.2.docs:
- * debian/libnetsvcs-6.1.2.install:
- Doc install fixes
-
-Fri Nov 23 09:51:01 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/README.source:
- Removed comment of patch that got integrated
-
- * debian/libtao-2.1.6.install:
- * debian/libtao-dev.install:
- Added missing libraries
-
-Fri Nov 23 09:39:17 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/TAO_ACE.mwc:
- * debian/libace-6.1.6.docs:
- * debian/libace-dev.docs:
- * debian/libace-dev.install:
- * debian/libace-doc.docs:
- * debian/libtao-2.1.6.docs:
- * debian/libtao-dev.docs:
- * debian/libtao-doc.docs:
- More install fixes
-
-Fri Nov 23 08:07:23 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/ETCL/ETCL_Constraint.inl:
- Fixed coverity error by initializing pointer value
-
- * ace/Message_Queue.h:
- * ace/Timer_Queue_Iterator.h:
- Doxygen improvements
-
- * ace/Timer_Queue_Iterator.cpp:
- Initialize all members in default constructor
-
-Thu Nov 22 13:31:20 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/tao-log.install:
- Fixed executable name
-
-Thu Nov 22 12:56:20 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/ACE-DPKG.mwc:
- * debian/TAO-DPKG.mwc:
- Removed these files.
-
-Thu Nov 22 12:55:05 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/default.features:
- * debian/libtao-2.1.6.install:
- * debian/libtao-dev.install:
- * debian/platform_macros.GNU:
- Remove lzo1 compressor
-
-Thu Nov 22 12:38:34 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Service_Config.h:
- Added new ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE which accepts
- an explicit version to be loaded. Needed for debian for example
-
- * debian/patches/series:
- * debian/patches/15-fix-lzo-flags.diff:
- * debian/patches/34-bts386713.diff:
- Cleanup
-
- * debian/platform_macros.GNU:
- Set versioned_so=2
-
- * include/makeinclude/platform_g++_common.GNU:
- When versioned_so=2 add ACE_VERSIONED_SO=2 as
- define
-
-Thu Nov 22 09:20:46 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * include/makeinclude/platform_g++_common.GNU:
- * include/makeinclude/rules.lib.GNU:
- * include/makeinclude/rules.local.GNU:
- * include/makeinclude/wrapper_macros.GNU:
- Added support for versioned_so=2, that will create
- for example libACE-6.1.6.so instead of libACE.so.6.1.6
-
- * debian/patches/20-versioned_libs.diff:
- Removed this file.
-
-Wed Nov 21 10:18:22 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * debian/libace-xml-utils-6.1.6.install:
- * debian/libace-xml-utils-dev.install:
- New files
-
- * debian/platform_macros.GNU.in:
- Removed this file.
-
-Tue Nov 20 23:55:57 UTC 2012 Steve Huston <shuston@riverace.com>
-
- * ace/config-hpux-11.00.h:
- * ace/OS_NS_netdb.inl: Although HP-UX 11 doesn't have the _r
- netdb calls, the regular ones are reentrant for multiple threads.
- Therefore, do not use the mutex-acquiring wrapper for HP-UX 11.
-
-Tue Nov 20 19:10:38 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/XML_Utils/ACE_XML_Utils.pc.in:
- * ace/XML_Utils/XML.mpc:
- Added missing pc.in file for ACE_XML_Utils
-
-Tue Nov 13 18:17:24 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tests/run_test.lst:
- Bug_4055_Regression_Test needs threads
-
-Tue Nov 13 13:29:28 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Condition_Attributes.h:
- * ace/Condition_Attributes.inl:
- * ace/Condition_Attributes.cpp:
- Now also needed in single threaded builds
-
-Mon Nov 12 19:26:41 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Malloc.cpp:
- * ace/Naming_Context.h:
- * ace/Naming_Context.cpp:
- * ace/Read_Buffer.cpp:
- * ace/Recursive_Thread_Mutex.cpp:
- * ace/SV_Semaphore_Simple.cpp:
- Coverity fixes
-
-Mon Nov 12 17:21:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/OS_NS_Thread.inl:
- Fixed win32 compile errors
-
-Mon Nov 12 13:34:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/Sig_Adapter.cpp:
- Fixed coverity errors
-
- * ace/Signal.h:
- Doxygen change
-
-Mon Nov 12 12:19:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/OS_NS_Thread.inl:
- Fixed missing ACE_INLINE
-
-Mon Nov 12 10:45:51 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/OS_NS_Thread.h:
- * ace/OS_NS_Thread.inl:
- Added constructor for ACE_event_t to initialize pointers
- explicitly to 0, fixes coverity #743165
-
- * tests/Bug_4055_Regression_Test.cpp:
- Check return value of clock_settime, fixes coverity #743164
-
-Mon Nov 12 10:06:57 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- * docs/Download.html:
- * docs/bczar/bczar.html:
- * etc/index.html:
- Updated for next release
-
-Mon Nov 12 09:34:14 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ACE version 6.1.6 released.
-
-Sun Nov 11 14:26:17 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * tests/Monotonic_Manual_Event_Test.cpp:
- * tests/Monotonic_Message_Queue_Test.cpp:
- * tests/Monotonic_Task_Test.cpp:
- Further narrowing of preprocessor test to prevent running
- test on unsupported platforms.
-
-Sat Nov 10 11:35:57 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * tests/Monotonic_Manual_Event_Test.cpp:
- * tests/Monotonic_Message_Queue_Test.cpp:
- * tests/Monotonic_Task_Test.cpp:
- Further narrowing of preprocessor test to prevent running
- test on unsupported platforms.
- Small logging changes.
-
-Fri Nov 9 10:29:37 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * tests/Monotonic_Manual_Event_Test.cpp:
- * tests/Monotonic_Message_Queue_Test.cpp:
- * tests/Monotonic_Task_Test.cpp:
- Narrowing down the selection test for supported platforms.
-
-Fri Nov 9 08:28:23 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * ace/OS_NS_Thread.inl:
- Fixed compile error resulting from previous change.
-
-Wed Nov 7 19:16:47 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * ace/OS_NS_Thread.inl:
- Fix for unused arg warnings.
-
-Wed Nov 7 13:51:14 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/SSL/SSL_Context.h:
- * ace/SSL/SSL_Context.cpp:
- * protocols/ace/INet/HTTP_Simple_exec.cpp:
- Resolve compile problems with OpenSSL on recent debian/ubuntu
- versions which don't ship SSLv2 anymore
-
- * debian/patches/series:
- * debian/patches/35_disable_sslv2.diff:
- Patch is not needed anymore
-
-Sat Oct 20 14:13:07 UTC 2012 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
-
- * ace/Timer_Hash_T.h: Added a forward declaration of
- ACE_Event_Handler to ensure ACE compiles properly on certain
- platforms. Thanks to Peng Xu <pengxu7 at gmail dot com> for
- reporting this.
-
-Tue Nov 6 18:59:48 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * ace/ace_for_tao.mpc:
- Reflect fact that Event classes are now templates.
- Added new Event base class.
-
-Tue Nov 6 14:44:38 UTC 2012 Steve Huston <shuston@riverace.com>
-
- * ace/OS_NS_Thread.cpp (ACE_TSS_Cleanup::thread_detach_key): If
- given a key which was never set, ignore it. Only throw an assertion
- if the key's table slot is used but does not match the key asked
- to free. The never-set case happens if a ACE_TSS object fails
- when setting its value; the later cleanup would cause an assert.
-
-Tue Nov 6 13:34:20 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * NEWS:
- Updated for new time policy support for ACE Events.
-
-Tue Nov 6 11:46:45 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * bin/fuzz.pl:
- Fixed missing 'next;' in check_for_ACE_Thread_Mutex()
- fuzzer.
-
-Tue Nov 6 11:42:26 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * tests/Monotonic_Manual_Event_Test.cpp:
- Fixed file comment.
-
-Tue Nov 6 10:55:47 UTC 2012 Martin Corino <mcorino@remedy.nl>
-
- * ace/OS_NS_Thread.h:
- * ace/OS_NS_Thread.inl:
- * ace/OS_NS_Thread.cpp:
- Extended OS wrappers for event and sema with
- variants excepting condition attributes.
-
- * ace/Event_Base.h:
- * ace/Event_Base.inl:
- * ace/Event_Base.cpp:
- Added non-template base class for events.
-
- * ace/Auto_Event.h:
- * ace/Auto_Event.inl:
- * ace/Auto_Event.cpp:
- * ace/Event.h:
- * ace/Event.inl:
- * ace/Event.cpp:
- * ace/Manual_Event.h:
- * ace/Manual_Event.inl:
- * ace/Manual_Event.cpp:
- Refactored into TIME_POLICY based templates.
- Added inlined derived classes of default
- template instantiations to satisfy old code.
-
- * ace/ace.mpc:
- Reflect fact that Event classes are now templates.
- Added new Event base class.
-
- * docs/ACE-monotonic-timer.html:
- Added documentation concerning Event changes.
-
- * tests/Manual_Event_Test.cpp:
- Removed dead code.
-
- * tests/Monotonic_Manual_Event_Test.cpp:
- * tests/run_test.lst:
- * tests/tests.mpc:
- Added new regression test for time policy
- support of events.
-
-Tue Oct 30 07:48:18 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * rpmbuild/ace-tao.spec:
- Fixes for OpenSuSE 12.2
-
-Sat Oct 27 18:59:36 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ace/TSS_T.inl:
- Use the word error in the ACE_ERROR messages in this file
-
-Tue Oct 23 20:09:07 UTC 2012 Abdullah Sowayan <sowayan@gmail.com>
-
- * ace/config-macosx-mountain-lion.h:
- * include/makeinclude/platform_macosx_mountain_lion.GNU:
-
- Adding Mountain Lion support
-
-Fri Oct 12 10:50:28 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- * bin/diff-builds-and-group-fixed-tests-only.sh:
- * docs/Download.html:
- * docs/bczar/bczar.html:
- * etc/index.html:
- Updated for x.1.5
-
-Fri Oct 12 11:20:25 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ACE version 6.1.5 released.
-
-Wed Oct 10 22:45:23 UTC 2012 Steve Huston <shuston@riverace.com>
-
- * ace/Reactor.h: Corrected the comments concerning removal of
- signal handler registrations - they DO call handle_close() now.
-
- * tests/Network_Adapters_Test.{cpp, h}: Corrected the call to remove
- signal handlers and added a check in Stop_Handler::handle_close()
- to ignore calls as a result of removing a signal handler.
-
-Wed Oct 10 18:47:12 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * docs/bczar/bczar.html:
- Package updates
-
Mon Oct 8 13:27:58 UTC 2012 Steve Huston <shuston@riverace.com>
* ace/Sig_Handler.{cpp, inl}: Reverted change from:
diff --git a/ACE/NEWS b/ACE/NEWS
index 8355b27fbe4..c6b2c2b7dad 100644
--- a/ACE/NEWS
+++ b/ACE/NEWS
@@ -1,19 +1,3 @@
-USER VISIBLE CHANGES BETWEEN ACE-6.1.6 and ACE-6.1.7
-====================================================
-
-USER VISIBLE CHANGES BETWEEN ACE-6.1.5 and ACE-6.1.6
-====================================================
-
-. Added new event and sema initialization methods to OS_NS_Thread
- to allow passing pre-initialized condition attributes providing
- basic support for using time policies in ACE Event classes.
-
-. Added TIME_POLICY support to ACE_Event classes to allow for
- monotonic timer support for ACE Events.
-
-. Added new regression test:
- Monotonic_Manual_Event_Test
-
USER VISIBLE CHANGES BETWEEN ACE-6.1.4 and ACE-6.1.5
====================================================
diff --git a/ACE/OCI_RE_ChangeLog b/ACE/OCI_RE_ChangeLog
new file mode 100644
index 00000000000..77d168b27c1
--- /dev/null
+++ b/ACE/OCI_RE_ChangeLog
@@ -0,0 +1,10 @@
+Mon Oct 15 18:26:57 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * OCI_RE_ChangeLog:
+ Created change log for the OCI Reliability Enhancements branch
+
+Local Variables:
+mode: change-log
+add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time))
+indent-tabs-mode: nil
+End:
diff --git a/ACE/PROBLEM-REPORT-FORM b/ACE/PROBLEM-REPORT-FORM
index 0377c5c70c4..5442db735b5 100644
--- a/ACE/PROBLEM-REPORT-FORM
+++ b/ACE/PROBLEM-REPORT-FORM
@@ -40,7 +40,7 @@
To: ace-bugs@list.isis.vanderbilt.edu
Subject: [area]: [synopsis]
- ACE VERSION: 6.1.6
+ ACE VERSION: 6.1.4
HOST MACHINE and OPERATING SYSTEM:
If on Windows based OS's, which version of WINSOCK do you
diff --git a/ACE/THANKS b/ACE/THANKS
index 680439ece39..a420f5a9cbe 100644
--- a/ACE/THANKS
+++ b/ACE/THANKS
@@ -2370,8 +2370,6 @@ Mohsin Zaidi <mohsinrzaidi at gmail dot com>
Milind Pangarkar <Milind dot Pangarkar at amdocs dot com>
Ali Akbar Zarezadeh <akzare at cs dot uni-potsdam dot de>
Andrés Senac González <andres at senac dot es>
-Peng Xu <pengxu7 at gmail dot com>
-Sergey Onuchin <sonuchin at parallels dot com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson in the early 1990's. Paul devised the recursive Makefile
diff --git a/ACE/VERSION b/ACE/VERSION
index 367c18dcc1e..144300e4267 100644
--- a/ACE/VERSION
+++ b/ACE/VERSION
@@ -1,4 +1,4 @@
-This is ACE version 6.1.6, released Mon Nov 12 09:34:14 CET 2012
+This is ACE version 6.1.4, released Wed Aug 29 08:16:04 CEST 2012
If you have any problems with or questions about ACE, please send
e-mail to the ACE mailing list (ace-bugs@list.isis.vanderbilt.edu),
diff --git a/ACE/ace/Auto_Event.cpp b/ACE/ace/Auto_Event.cpp
index 1e517696bc8..595e57142aa 100644
--- a/ACE/ace/Auto_Event.cpp
+++ b/ACE/ace/Auto_Event.cpp
@@ -8,42 +8,37 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
-ACE_Auto_Event_T<TIME_POLICY>::ACE_Auto_Event_T (
- int initial_state,
- int type,
- const char *name,
- void *arg)
- : ACE_Event_T<TIME_POLICY> (0,
- initial_state,
- type,
- ACE_TEXT_CHAR_TO_TCHAR (name),
- arg)
+ACE_Auto_Event::ACE_Auto_Event (int initial_state,
+ int type,
+ const char *name,
+ void *arg)
+ : ACE_Event (0,
+ initial_state,
+ type,
+ ACE_TEXT_CHAR_TO_TCHAR (name),
+ arg)
{
}
#if defined (ACE_HAS_WCHAR)
-template <class TIME_POLICY>
-ACE_Auto_Event_T<TIME_POLICY>::ACE_Auto_Event_T (
- int initial_state,
- int type,
- const wchar_t *name,
- void *arg)
- : ACE_Event_T<TIME_POLICY> (0,
- initial_state,
- type,
- ACE_TEXT_WCHAR_TO_TCHAR (name),
- arg)
+ACE_Auto_Event::ACE_Auto_Event (int initial_state,
+ int type,
+ const wchar_t *name,
+ void *arg)
+ : ACE_Event (0,
+ initial_state,
+ type,
+ ACE_TEXT_WCHAR_TO_TCHAR (name),
+ arg)
{
}
#endif /* ACE_HAS_WCHAR */
-template <class TIME_POLICY>
void
-ACE_Auto_Event_T<TIME_POLICY>::dump (void) const
+ACE_Auto_Event::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_Event_T<TIME_POLICY>::dump ();
+ ACE_Event::dump ();
#endif /* ACE_HAS_DUMP */
}
diff --git a/ACE/ace/Auto_Event.h b/ACE/ace/Auto_Event.h
index 3cf0aaf889d..64bc69e6d27 100644
--- a/ACE/ace/Auto_Event.h
+++ b/ACE/ace/Auto_Event.h
@@ -36,58 +36,31 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* support. However, only Win32 platforms support global naming and
* system-scope locking support.
*/
-template <class TIME_POLICY = ACE_System_Time_Policy>
-class ACE_Auto_Event_T : public ACE_Event_T<TIME_POLICY>
-{
-public:
- /// Constructor which will create auto event
- ACE_Auto_Event_T (int initial_state = 0,
- int type = USYNC_THREAD,
- const char *name = 0,
- void *arg = 0);
-
-#if defined (ACE_HAS_WCHAR)
- /// Constructor which will create auto event (wchar_t version)
- ACE_Auto_Event_T (int initial_state,
- int type,
- const wchar_t *name,
- void *arg = 0);
-#endif /* ACE_HAS_WCHAR */
-
- /// Default dtor.
- virtual ~ACE_Auto_Event_T (void);
-
- /// Dump the state of an object.
- void dump (void) const;
-
- /// Declare the dynamic allocation hooks
- ACE_ALLOC_HOOK_DECLARE;
-};
-
-class ACE_Auto_Event :
- public ACE_Auto_Event_T<ACE_System_Time_Policy>
+class ACE_Export ACE_Auto_Event : public ACE_Event
{
public:
/// Constructor which will create auto event
ACE_Auto_Event (int initial_state = 0,
int type = USYNC_THREAD,
const char *name = 0,
- void *arg = 0)
- : ACE_Auto_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
- {}
+ void *arg = 0);
#if defined (ACE_HAS_WCHAR)
/// Constructor which will create auto event (wchar_t version)
ACE_Auto_Event (int initial_state,
int type,
const wchar_t *name,
- void *arg = 0)
- : ACE_Auto_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
- {}
+ void *arg = 0);
#endif /* ACE_HAS_WCHAR */
/// Default dtor.
- virtual ~ACE_Auto_Event (void) {}
+ ~ACE_Auto_Event (void);
+
+ /// Dump the state of an object.
+ void dump (void) const;
+
+ /// Declare the dynamic allocation hooks
+ ACE_ALLOC_HOOK_DECLARE;
};
ACE_END_VERSIONED_NAMESPACE_DECL
@@ -96,13 +69,5 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#include "ace/Auto_Event.inl"
#endif /* __ACE_INLINE__ */
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "ace/Auto_Event.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Auto_Event.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
#include /**/ "ace/post.h"
#endif /* ACE_AUTO_EVENT_H */
diff --git a/ACE/ace/Auto_Event.inl b/ACE/ace/Auto_Event.inl
index 8f7d769dcfd..80048c29b99 100644
--- a/ACE/ace/Auto_Event.inl
+++ b/ACE/ace/Auto_Event.inl
@@ -4,9 +4,8 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
ACE_INLINE
-ACE_Auto_Event_T<TIME_POLICY>::~ACE_Auto_Event_T (void)
+ACE_Auto_Event::~ACE_Auto_Event (void)
{
}
diff --git a/ACE/ace/Condition_Attributes.cpp b/ACE/ace/Condition_Attributes.cpp
index 265a7432f41..45534e0a7c3 100644
--- a/ACE/ace/Condition_Attributes.cpp
+++ b/ACE/ace/Condition_Attributes.cpp
@@ -12,6 +12,10 @@
#include "ace/Condition_Thread_Mutex.h"
#include "ace/Condition_Attributes.h"
+#if defined (ACE_HAS_THREADS)
+
#if !defined (__ACE_INLINE__)
#include "ace/Condition_Attributes.inl"
#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_HAS_THREADS */
diff --git a/ACE/ace/Condition_Attributes.h b/ACE/ace/Condition_Attributes.h
index 11c37fbad49..fef2a52103e 100644
--- a/ACE/ace/Condition_Attributes.h
+++ b/ACE/ace/Condition_Attributes.h
@@ -24,6 +24,10 @@
#include "ace/OS_NS_Thread.h"
+#if defined (ACE_HAS_THREADS)
+
+// ACE platform supports some form of threading.
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_Condition_Attributes
@@ -91,5 +95,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#include "ace/Condition_Attributes.inl"
#endif /* __ACE_INLINE__ */
+#endif /* !ACE_HAS_THREADS */
+
#include /**/ "ace/post.h"
#endif /* ACE_CONDITION_ATTRIBUTES_H */
diff --git a/ACE/ace/Condition_Attributes.inl b/ACE/ace/Condition_Attributes.inl
index 48825e294d3..be524f7c06a 100644
--- a/ACE/ace/Condition_Attributes.inl
+++ b/ACE/ace/Condition_Attributes.inl
@@ -1,4 +1,5 @@
// -*- C++ -*-
+//
// $Id$
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/ETCL/ETCL_Constraint.inl b/ACE/ace/ETCL/ETCL_Constraint.inl
index 99878b78f2f..914a0ef640f 100644
--- a/ACE/ace/ETCL/ETCL_Constraint.inl
+++ b/ACE/ace/ETCL/ETCL_Constraint.inl
@@ -309,7 +309,6 @@ ETCL_Binary_Expr::lhs (void) const
ACE_INLINE
ETCL_Preference::ETCL_Preference (void)
- : subexpr_ (0)
{}
ACE_INLINE
diff --git a/ACE/ace/Event.cpp b/ACE/ace/Event.cpp
index 95ed88c0968..80a37043983 100644
--- a/ACE/ace/Event.cpp
+++ b/ACE/ace/Event.cpp
@@ -7,36 +7,87 @@
#endif /* __ACE_INLINE__ */
#include "ace/Log_Msg.h"
-#include "ace/Condition_Attributes.h"
+
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
-ACE_Event_T<TIME_POLICY>::ACE_Event_T (int manual_reset,
- int initial_state,
- int type,
- const ACE_TCHAR *name,
- void *arg,
- LPSECURITY_ATTRIBUTES sa)
- : ACE_Event_Base ()
+ACE_Event::ACE_Event (int manual_reset,
+ int initial_state,
+ int type,
+ const ACE_TCHAR *name,
+ void *arg,
+ LPSECURITY_ATTRIBUTES sa)
+ : removed_ (false)
{
- ACE_Condition_Attributes_T<TIME_POLICY> cond_attr (type);
if (ACE_OS::event_init (&this->handle_,
- type,
- &const_cast<ACE_condattr_t&> (cond_attr.attributes ()),
manual_reset,
initial_state,
+ type,
name,
arg,
sa) != 0)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("ACE_Event_T<TIME_POLICY>::ACE_Event_T")));
+ ACE_TEXT ("ACE_Event::ACE_Event")));
+}
+
+ACE_Event::~ACE_Event (void)
+{
+ this->remove ();
+}
+
+int
+ACE_Event::remove (void)
+{
+ int result = 0;
+ if (!this->removed_)
+ {
+ this->removed_ = true;
+ result = ACE_OS::event_destroy (&this->handle_);
+ }
+ return result;
+}
+
+int
+ACE_Event::wait (void)
+{
+ return ACE_OS::event_wait (&this->handle_);
+}
+
+int
+ACE_Event::wait (const ACE_Time_Value *abstime, int use_absolute_time)
+{
+ return ACE_OS::event_timedwait (&this->handle_,
+ const_cast <ACE_Time_Value *> (abstime),
+ use_absolute_time);
+}
+
+int
+ACE_Event::signal (void)
+{
+ return ACE_OS::event_signal (&this->handle_);
+}
+
+int
+ACE_Event::pulse (void)
+{
+ return ACE_OS::event_pulse (&this->handle_);
+}
+
+int
+ACE_Event::reset (void)
+{
+ return ACE_OS::event_reset (&this->handle_);
}
-template <class TIME_POLICY>
-ACE_Event_T<TIME_POLICY>::~ACE_Event_T (void)
+void
+ACE_Event::dump (void) const
{
+#if defined (ACE_HAS_DUMP)
+ ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
+ ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
+#endif /* ACE_HAS_DUMP */
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Event.h b/ACE/ace/Event.h
index de21752d334..177c0039df1 100644
--- a/ACE/ace/Event.h
+++ b/ACE/ace/Event.h
@@ -22,14 +22,12 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Event_Base.h"
-#include "ace/Time_Policy.h"
-#include "ace/Time_Value_T.h"
+#include "ace/OS_NS_Thread.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
- * @class ACE_Event_T
+ * @class ACE_Event
*
* @brief A wrapper around the Win32 event locking mechanism.
*
@@ -38,58 +36,108 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* process-scope locking support. However, only Win32 platforms
* support global naming and system-scope locking support.
*/
-template <class TIME_POLICY = ACE_System_Time_Policy>
-class ACE_Event_T : public ACE_Event_Base
+class ACE_Export ACE_Event
{
public:
/// Constructor that creates event.
- ACE_Event_T (int manual_reset = 0,
- int initial_state = 0,
- int type = USYNC_THREAD,
- const ACE_TCHAR *name = 0,
- void *arg = 0,
- LPSECURITY_ATTRIBUTES sa = 0);
+ ACE_Event (int manual_reset = 0,
+ int initial_state = 0,
+ int type = USYNC_THREAD,
+ const ACE_TCHAR *name = 0,
+ void *arg = 0,
+ LPSECURITY_ATTRIBUTES sa = 0);
/// Implicitly destroy the event variable.
- virtual ~ACE_Event_T (void);
-
- /// Get the current time of day according to the queue's TIME_POLICY.
- /// Allows users to initialize timeout values using correct time policy.
- ACE_Time_Value_T<TIME_POLICY> gettimeofday (void) const;
-
- /// Allows applications to control how the event gets the time
- /// of day.
- void set_time_policy (TIME_POLICY const & time_policy);
+ ~ACE_Event (void);
+
+ /**
+ * Explicitly destroy the event variable. Note that only one thread
+ * should call this method since it doesn't protect against race
+ * conditions.
+ */
+ int remove (void);
+
+ /// Underlying handle to event.
+ ACE_event_t handle (void) const;
+
+ /**
+ * Set the underlying handle to event. Note that this method assumes
+ * ownership of the <handle> and will close it down in <remove>. If
+ * you want the <handle> to stay open when <remove> is called make
+ * sure to call <dup> on the <handle> before closing it. You are
+ * responsible for the closing the existing <handle> before
+ * overwriting it.
+ */
+ void handle (ACE_event_t new_handle);
+
+ /**
+ * if MANUAL reset
+ * sleep till the event becomes signaled
+ * event remains signaled after wait() completes.
+ * else AUTO reset
+ * sleep till the event becomes signaled
+ * event resets wait() completes.
+ */
+ int wait (void);
+
+ /// Same as wait() above, but this one can be timed
+ /// @a abstime is absolute time-of-day if if @a use_absolute_time
+ /// is non-0, else it is relative time.
+ int wait (const ACE_Time_Value *abstime,
+ int use_absolute_time = 1);
+
+ /**
+ * if MANUAL reset
+ * wake up all waiting threads
+ * set to signaled state
+ * else AUTO reset
+ * if no thread is waiting, set to signaled state
+ * if thread(s) are waiting, wake up one waiting thread and
+ * reset event
+ */
+ int signal (void);
+
+ /**
+ * if MANUAL reset
+ * wakeup all waiting threads and
+ * reset event
+ * else AUTO reset
+ * wakeup one waiting thread (if present) and
+ * reset event
+ */
+ int pulse (void);
+
+ /// Set to nonsignaled state.
+ int reset (void);
+
+ /// Dump the state of an object.
+ void dump (void) const;
/// Declare the dynamic allocation hooks
ACE_ALLOC_HOOK_DECLARE;
protected:
+ /// The underlying handle.
+ ACE_event_t handle_;
- /// The policy to return the current time of day
- TIME_POLICY time_policy_;
+ /// Keeps track of whether <remove> has been called yet to avoid
+ /// multiple <remove> calls, e.g., explicitly and implicitly in the
+ /// destructor. This flag isn't protected by a lock, so make sure
+ /// that you don't have multiple threads simultaneously calling
+ /// <remove> on the same object, which is a bad idea anyway...
+ bool removed_;
private:
// = Prevent copying.
- ACE_Event_T (const ACE_Event_T<TIME_POLICY>& event);
- const ACE_Event_T &operator= (const ACE_Event_T<TIME_POLICY> &rhs);
+ ACE_Event (const ACE_Event& event);
+ const ACE_Event &operator= (const ACE_Event &rhs);
};
-typedef ACE_Event_T<ACE_System_Time_Policy> ACE_Event;
-
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Event.inl"
#endif /* __ACE_INLINE__ */
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "ace/Event.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Event.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
-
#include /**/ "ace/post.h"
#endif /* ACE_EVENT_H */
diff --git a/ACE/ace/Event.inl b/ACE/ace/Event.inl
index 79cc3da2e5e..188d7c202cf 100644
--- a/ACE/ace/Event.inl
+++ b/ACE/ace/Event.inl
@@ -3,18 +3,16 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
-ACE_Time_Value_T<TIME_POLICY>
-ACE_Event_T<TIME_POLICY>::gettimeofday (void) const
+ACE_INLINE ACE_event_t
+ACE_Event::handle (void) const
{
- return this->time_policy_ ();
+ return this->handle_;
}
-template <class TIME_POLICY>
-void
-ACE_Event_T<TIME_POLICY>::set_time_policy (TIME_POLICY const & rhs)
+ACE_INLINE void
+ACE_Event::handle (ACE_event_t new_handle)
{
- this->time_policy_ = rhs;
+ this->handle_ = new_handle;
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Event_Base.cpp b/ACE/ace/Event_Base.cpp
deleted file mode 100644
index 277427d46c2..00000000000
--- a/ACE/ace/Event_Base.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// $Id$
-
-#include "ace/Event_Base.h"
-
-#if !defined (__ACE_INLINE__)
-#include "ace/Event_Base.inl"
-#endif /* __ACE_INLINE__ */
-
-#include "ace/Log_Msg.h"
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_Event_Base::ACE_Event_Base ()
- : removed_ (false)
-{
-}
-
-ACE_Event_Base::~ACE_Event_Base (void)
-{
- this->remove ();
-}
-
-int
-ACE_Event_Base::remove (void)
-{
- int result = 0;
- if (!this->removed_)
- {
- this->removed_ = true;
- result = ACE_OS::event_destroy (&this->handle_);
- }
- return result;
-}
-
-int
-ACE_Event_Base::wait (void)
-{
- return ACE_OS::event_wait (&this->handle_);
-}
-
-int
-ACE_Event_Base::wait (const ACE_Time_Value *abstime, int use_absolute_time)
-{
- return ACE_OS::event_timedwait (&this->handle_,
- const_cast <ACE_Time_Value *> (abstime),
- use_absolute_time);
-}
-
-int
-ACE_Event_Base::signal (void)
-{
- return ACE_OS::event_signal (&this->handle_);
-}
-
-int
-ACE_Event_Base::pulse (void)
-{
- return ACE_OS::event_pulse (&this->handle_);
-}
-
-int
-ACE_Event_Base::reset (void)
-{
- return ACE_OS::event_reset (&this->handle_);
-}
-
-void
-ACE_Event_Base::dump (void) const
-{
-#if defined (ACE_HAS_DUMP)
- ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
-#endif /* ACE_HAS_DUMP */
-}
-
-ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Event_Base.h b/ACE/ace/Event_Base.h
deleted file mode 100644
index 2657ce6f5a0..00000000000
--- a/ACE/ace/Event_Base.h
+++ /dev/null
@@ -1,141 +0,0 @@
-// -*- C++ -*-
-
-//==========================================================================
-/**
- * @file Event_Base.h
- *
- * $Id$
- *
- * Moved from Synch.h.
- *
- * @author Martin Corino <mcorino@remedy.nl>
- */
-//==========================================================================
-
-#ifndef ACE_EVENT_BASE_H
-#define ACE_EVENT_BASE_H
-#include /**/ "ace/pre.h"
-
-#include /**/ "ace/ACE_export.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/OS_NS_Thread.h"
-#include "ace/Time_Value.h"
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-/**
- * @class ACE_Event_Base
- *
- * @brief A base class for wrappers around the Win32 event locking
- * mechanism.
- *
- * Portable implementation of an Event mechanism, which is native to
- * Win32, but must be emulated on UNIX. All platforms support
- * process-scope locking support. However, only Win32 platforms
- * support global naming and system-scope locking support.
- */
-class ACE_Export ACE_Event_Base
-{
-public:
- /// Implicitly destroy the event variable.
- virtual ~ACE_Event_Base (void);
-
- /**
- * Explicitly destroy the event variable. Note that only one thread
- * should call this method since it doesn't protect against race
- * conditions.
- */
- int remove (void);
-
- /// Underlying handle to event.
- ACE_event_t handle (void) const;
-
- /**
- * Set the underlying handle to event. Note that this method assumes
- * ownership of the <handle> and will close it down in <remove>. If
- * you want the <handle> to stay open when <remove> is called make
- * sure to call <dup> on the <handle> before closing it. You are
- * responsible for the closing the existing <handle> before
- * overwriting it.
- */
- void handle (ACE_event_t new_handle);
-
- /**
- * if MANUAL reset
- * sleep till the event becomes signaled
- * event remains signaled after wait() completes.
- * else AUTO reset
- * sleep till the event becomes signaled
- * event resets wait() completes.
- */
- int wait (void);
-
- /// Same as wait() above, but this one can be timed
- /// @a abstime is absolute time-of-day if if @a use_absolute_time
- /// is non-0, else it is relative time.
- int wait (const ACE_Time_Value *abstime,
- int use_absolute_time = 1);
-
- /**
- * if MANUAL reset
- * wake up all waiting threads
- * set to signaled state
- * else AUTO reset
- * if no thread is waiting, set to signaled state
- * if thread(s) are waiting, wake up one waiting thread and
- * reset event
- */
- int signal (void);
-
- /**
- * if MANUAL reset
- * wakeup all waiting threads and
- * reset event
- * else AUTO reset
- * wakeup one waiting thread (if present) and
- * reset event
- */
- int pulse (void);
-
- /// Set to nonsignaled state.
- int reset (void);
-
- /// Dump the state of an object.
- void dump (void) const;
-
- /// Declare the dynamic allocation hooks
- ACE_ALLOC_HOOK_DECLARE;
-
-protected:
- /// Only derived classes allowed to construct event.
- ACE_Event_Base ();
-
-
- /// The underlying handle.
- ACE_event_t handle_;
-
- /// Keeps track of whether <remove> has been called yet to avoid
- /// multiple <remove> calls, e.g., explicitly and implicitly in the
- /// destructor. This flag isn't protected by a lock, so make sure
- /// that you don't have multiple threads simultaneously calling
- /// <remove> on the same object, which is a bad idea anyway...
- bool removed_;
-
-private:
- // = Prevent copying.
- ACE_Event_Base (const ACE_Event_Base& event);
- const ACE_Event_Base &operator= (const ACE_Event_Base &rhs);
-};
-
-ACE_END_VERSIONED_NAMESPACE_DECL
-
-#if defined (__ACE_INLINE__)
-#include "ace/Event_Base.inl"
-#endif /* __ACE_INLINE__ */
-
-#include /**/ "ace/post.h"
-#endif /* ACE_EVENT_BASE_H */
diff --git a/ACE/ace/Event_Base.inl b/ACE/ace/Event_Base.inl
deleted file mode 100644
index fe6789194d7..00000000000
--- a/ACE/ace/Event_Base.inl
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- C++ -*-
-// $Id$
-
-ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
-ACE_INLINE ACE_event_t
-ACE_Event_Base::handle (void) const
-{
- return this->handle_;
-}
-
-ACE_INLINE void
-ACE_Event_Base::handle (ACE_event_t new_handle)
-{
- this->handle_ = new_handle;
-}
-
-ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Malloc.cpp b/ACE/ace/Malloc.cpp
index a31ff854f7e..4a7672b5041 100644
--- a/ACE/ace/Malloc.cpp
+++ b/ACE/ace/Malloc.cpp
@@ -98,10 +98,6 @@ ACE_Control_Block::dump (void) const
}
ACE_Control_Block::ACE_Name_Node::ACE_Name_Node (void)
- : name_ (0),
- pointer_ (0),
- next_ (0),
- prev_ (0)
{
ACE_TRACE ("ACE_Control_Block::ACE_Name_Node::ACE_Name_Node");
}
diff --git a/ACE/ace/Manual_Event.cpp b/ACE/ace/Manual_Event.cpp
index 5467ed6dae8..1ed621f54b6 100644
--- a/ACE/ace/Manual_Event.cpp
+++ b/ACE/ace/Manual_Event.cpp
@@ -6,44 +6,42 @@
#include "ace/Manual_Event.inl"
#endif /* __ACE_INLINE__ */
+
+
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
-ACE_Manual_Event_T<TIME_POLICY>::ACE_Manual_Event_T (
- int initial_state,
- int type,
- const char *name,
- void *arg)
- : ACE_Event_T<TIME_POLICY> (1,
- initial_state,
- type,
- ACE_TEXT_CHAR_TO_TCHAR (name),
- arg)
+ACE_Manual_Event::ACE_Manual_Event (int initial_state,
+ int type,
+ const char *name,
+ void *arg)
+ : ACE_Event (1,
+ initial_state,
+ type,
+ ACE_TEXT_CHAR_TO_TCHAR (name),
+ arg)
{
}
#if defined (ACE_HAS_WCHAR)
-template <class TIME_POLICY>
-ACE_Manual_Event_T<TIME_POLICY>::ACE_Manual_Event_T (
- int initial_state,
- int type,
- const wchar_t *name,
- void *arg)
- : ACE_Event_T<TIME_POLICY> (1,
- initial_state,
- type,
- ACE_TEXT_WCHAR_TO_TCHAR (name),
- arg)
+ACE_Manual_Event::ACE_Manual_Event (int initial_state,
+ int type,
+ const wchar_t *name,
+ void *arg)
+ : ACE_Event (1,
+ initial_state,
+ type,
+ ACE_TEXT_WCHAR_TO_TCHAR (name),
+ arg)
{
}
#endif /* ACE_HAS_WCHAR */
-template <class TIME_POLICY>
void
-ACE_Manual_Event_T<TIME_POLICY>::dump (void) const
+ACE_Manual_Event::dump (void) const
{
#if defined (ACE_HAS_DUMP)
- ACE_Event_T<TIME_POLICY>::dump ();
+ ACE_Event::dump ();
#endif /* ACE_HAS_DUMP */
}
diff --git a/ACE/ace/Manual_Event.h b/ACE/ace/Manual_Event.h
index e2873c09d74..e83fa04ee9c 100644
--- a/ACE/ace/Manual_Event.h
+++ b/ACE/ace/Manual_Event.h
@@ -36,26 +36,25 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
* support. However, only Win32 platforms support global naming and
* system-scope locking support.
*/
-template <class TIME_POLICY = ACE_System_Time_Policy>
-class ACE_Manual_Event_T : public ACE_Event_T<TIME_POLICY>
+class ACE_Export ACE_Manual_Event : public ACE_Event
{
public:
/// Constructor which will create manual event
- ACE_Manual_Event_T (int initial_state = 0,
- int type = USYNC_THREAD,
- const char *name = 0,
- void *arg = 0);
+ ACE_Manual_Event (int initial_state = 0,
+ int type = USYNC_THREAD,
+ const char *name = 0,
+ void *arg = 0);
#if defined (ACE_HAS_WCHAR)
/// Constructor which will create manual event (wchar_t version)
- ACE_Manual_Event_T (int initial_state,
- int type,
- const wchar_t *name,
- void *arg = 0);
+ ACE_Manual_Event (int initial_state,
+ int type,
+ const wchar_t *name,
+ void *arg = 0);
#endif /* ACE_HAS_WCHAR */
/// Default dtor.
- ~ACE_Manual_Event_T (void);
+ ~ACE_Manual_Event (void);
/// Dump the state of an object.
void dump (void) const;
@@ -64,45 +63,12 @@ public:
ACE_ALLOC_HOOK_DECLARE;
};
-class ACE_Manual_Event :
- public ACE_Manual_Event_T<ACE_System_Time_Policy>
-{
-public:
- /// Constructor which will create auto event
- ACE_Manual_Event (int initial_state = 0,
- int type = USYNC_THREAD,
- const char *name = 0,
- void *arg = 0)
- : ACE_Manual_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
- {}
-
-#if defined (ACE_HAS_WCHAR)
- /// Constructor which will create auto event (wchar_t version)
- ACE_Manual_Event (int initial_state,
- int type,
- const wchar_t *name,
- void *arg = 0)
- : ACE_Manual_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
- {}
-#endif /* ACE_HAS_WCHAR */
-
- /// Default dtor.
- virtual ~ACE_Manual_Event (void) {}
-};
-
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Manual_Event.inl"
#endif /* __ACE_INLINE__ */
-#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "ace/Manual_Event.cpp"
-#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
-
-#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Manual_Event.cpp")
-#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#include /**/ "ace/post.h"
#endif /* ACE_MANUAL_EVENT_H */
diff --git a/ACE/ace/Manual_Event.inl b/ACE/ace/Manual_Event.inl
index ccfd875e793..42bf94f6404 100644
--- a/ACE/ace/Manual_Event.inl
+++ b/ACE/ace/Manual_Event.inl
@@ -4,9 +4,8 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-template <class TIME_POLICY>
ACE_INLINE
-ACE_Manual_Event_T<TIME_POLICY>::~ACE_Manual_Event_T (void)
+ACE_Manual_Event::~ACE_Manual_Event (void)
{
}
diff --git a/ACE/ace/Message_Queue.h b/ACE/ace/Message_Queue.h
index 63f049b31a0..a3e9beca101 100644
--- a/ACE/ace/Message_Queue.h
+++ b/ACE/ace/Message_Queue.h
@@ -190,10 +190,10 @@ public:
/// and 0 if the queue's state is ACTIVATED or PULSED.
virtual int deactivated (void) = 0;
- /// Get the notification strategy for the Message_Queue
+ /// Get the notification strategy for the <Message_Queue>
virtual ACE_Notification_Strategy *notification_strategy (void) = 0;
- /// Set the notification strategy for the Message_Queue
+ /// Set the notification strategy for the <Message_Queue>
virtual void notification_strategy (ACE_Notification_Strategy *s) = 0;
// = Notification hook.
diff --git a/ACE/ace/Naming_Context.cpp b/ACE/ace/Naming_Context.cpp
index f45c355c59b..131abb65ebc 100644
--- a/ACE/ace/Naming_Context.cpp
+++ b/ACE/ace/Naming_Context.cpp
@@ -140,8 +140,7 @@ ACE_Naming_Context::close (void)
ACE_Naming_Context::ACE_Naming_Context (void)
: name_options_ (0),
- name_space_ (0),
- netnameserver_host_ (0)
+ name_space_ (0)
{
ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context");
diff --git a/ACE/ace/Naming_Context.h b/ACE/ace/Naming_Context.h
index d260fae0245..9d85b65b74f 100644
--- a/ACE/ace/Naming_Context.h
+++ b/ACE/ace/Naming_Context.h
@@ -269,6 +269,7 @@ private:
/// 1 if we're on the same local machine as the name server, else 0.
int local (void);
+
};
/**
diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp
index 9b8fedbd49a..9aec524ae8f 100644
--- a/ACE/ace/OS_NS_Thread.cpp
+++ b/ACE/ace/OS_NS_Thread.cpp
@@ -885,12 +885,8 @@ ACE_TSS_Cleanup::thread_detach_key (ACE_thread_key_t key)
ACE_TSS_CLEANUP_GUARD
u_int key_index = key;
- ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0]));
- // If this entry was never set, just bug out. If it is set, but is the
- // wrong key, assert.
- if (this->table_[key_index].key_ == 0)
- return 0;
- ACE_ASSERT (this->table_[key_index].key_ == key);
+ ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0])
+ && this->table_[key_index].key_ == key);
ACE_TSS_Info &info = this->table_ [key_index];
// sanity check
@@ -2500,17 +2496,15 @@ ACE_OS::event_destroy (ACE_event_t *event)
int
ACE_OS::event_init (ACE_event_t *event,
- int type,
- ACE_condattr_t *attributes,
int manual_reset,
int initial_state,
+ int type,
const char *name,
void *arg,
LPSECURITY_ATTRIBUTES sa)
{
#if defined (ACE_WIN32)
ACE_UNUSED_ARG (type);
- ACE_UNUSED_ARG (attributes);
ACE_UNUSED_ARG (arg);
SECURITY_ATTRIBUTES sa_buffer;
SECURITY_DESCRIPTOR sd_buffer;
@@ -2618,15 +2612,10 @@ ACE_OS::event_init (ACE_event_t *event,
# if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
(!defined (ACE_USES_FIFO_SEM) && \
(!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
- int result = attributes == 0 ?
- ACE_OS::cond_init (&event->eventdata_->condition_,
- type,
- name,
- arg) :
- ACE_OS::cond_init (&event->eventdata_->condition_,
- *attributes,
- name,
- arg);
+ int result = ACE_OS::cond_init (&event->eventdata_->condition_,
+ static_cast<short> (type),
+ name,
+ arg);
# else
char sem_name[128];
ACE_OS::strncpy (sem_name,
@@ -2636,7 +2625,6 @@ ACE_OS::event_init (ACE_event_t *event,
int result = ACE_OS::sema_init (&event->semaphore_,
0,
type,
- attributes,
sem_name,
arg);
# endif
@@ -2660,7 +2648,6 @@ ACE_OS::event_init (ACE_event_t *event,
result = ACE_OS::sema_init (&event->lock_,
0,
type,
- attributes,
lck_name,
arg);
if (result == 0)
@@ -2675,9 +2662,9 @@ ACE_OS::event_init (ACE_event_t *event,
event->name_ = 0;
event->eventdata_ = evtdata;
-# if (!defined (ACE_HAS_PTHREADS) || !defined (_POSIX_THREAD_PROCESS_SHARED) || defined (ACE_LACKS_CONDATTR_PSHARED)) && \
- (defined (ACE_USES_FIFO_SEM) || \
- (defined (ACE_HAS_POSIX_SEM) && defined (ACE_HAS_POSIX_SEM_TIMEOUT) && !defined (ACE_LACKS_NAMED_POSIX_SEM)))
+#if (!defined (ACE_HAS_PTHREADS) || !defined (_POSIX_THREAD_PROCESS_SHARED) || defined (ACE_LACKS_CONDATTR_PSHARED)) && \
+ (defined (ACE_USES_FIFO_SEM) || \
+ (defined (ACE_HAS_POSIX_SEM) && defined (ACE_HAS_POSIX_SEM_TIMEOUT) && !defined (ACE_LACKS_NAMED_POSIX_SEM)))
char sem_name[128];
ACE_OS::strncpy (sem_name,
name,
@@ -2686,7 +2673,6 @@ ACE_OS::event_init (ACE_event_t *event,
result = ACE_OS::sema_init(&event->semaphore_,
0,
type,
- attributes,
sem_name,
arg);
# endif
@@ -2706,7 +2692,6 @@ ACE_OS::event_init (ACE_event_t *event,
result = ACE_OS::sema_init (&event->lock_,
0,
type,
- attributes,
lck_name,
arg);
}
@@ -2729,20 +2714,14 @@ ACE_OS::event_init (ACE_event_t *event,
# if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
(!defined (ACE_USES_FIFO_SEM) && \
(!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
- int result = attributes == 0 ?
- ACE_OS::cond_init (&event->eventdata_->condition_,
- type,
- name,
- arg) :
- ACE_OS::cond_init (&event->eventdata_->condition_,
- *attributes,
- name,
- arg);
+ int result = ACE_OS::cond_init (&event->eventdata_->condition_,
+ static_cast<short> (type),
+ name,
+ arg);
# else
int result = ACE_OS::sema_init (&event->semaphore_,
0,
type,
- attributes,
name,
arg);
# endif
@@ -2759,7 +2738,6 @@ ACE_OS::event_init (ACE_event_t *event,
result = ACE_OS::sema_init (&event->lock_,
0,
type,
- attributes,
name,
arg);
if (result == 0)
@@ -2773,7 +2751,6 @@ ACE_OS::event_init (ACE_event_t *event,
ACE_UNUSED_ARG (manual_reset);
ACE_UNUSED_ARG (initial_state);
ACE_UNUSED_ARG (type);
- ACE_UNUSED_ARG (attributes);
ACE_UNUSED_ARG (name);
ACE_UNUSED_ARG (arg);
ACE_UNUSED_ARG (sa);
diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h
index 2cbe9679a77..e6aaee61bba 100644
--- a/ACE/ace/OS_NS_Thread.h
+++ b/ACE/ace/OS_NS_Thread.h
@@ -1086,9 +1086,6 @@ namespace ACE_OS {
int type = ACE_DEFAULT_SYNCH_TYPE);
ACE_NAMESPACE_INLINE_FUNCTION
- int condattr_synctype (ACE_condattr_t &attributes, int& type);
-
- ACE_NAMESPACE_INLINE_FUNCTION
int condattr_destroy (ACE_condattr_t &attributes);
ACE_NAMESPACE_INLINE_FUNCTION
@@ -1187,21 +1184,11 @@ namespace ACE_OS {
extern ACE_Export
int event_destroy (ACE_event_t *event);
- ACE_NAMESPACE_INLINE_FUNCTION
- int event_init (ACE_event_t *event,
- int manual_reset = 0,
- int initial_state = 0,
- int type = ACE_DEFAULT_SYNCH_TYPE,
- const char *name = 0,
- void *arg = 0,
- LPSECURITY_ATTRIBUTES sa = 0);
-
extern ACE_Export
int event_init (ACE_event_t *event,
- int type,
- ACE_condattr_t *attributes,
int manual_reset = 0,
int initial_state = 0,
+ int type = ACE_DEFAULT_SYNCH_TYPE,
const char *name = 0,
void *arg = 0,
LPSECURITY_ATTRIBUTES sa = 0);
@@ -1215,16 +1202,6 @@ namespace ACE_OS {
const wchar_t *name,
void *arg = 0,
LPSECURITY_ATTRIBUTES sa = 0);
-
- ACE_NAMESPACE_INLINE_FUNCTION
- int event_init (ACE_event_t *event,
- int type,
- ACE_condattr_t *attributes,
- int manual_reset,
- int initial_state,
- const wchar_t *name,
- void *arg = 0,
- LPSECURITY_ATTRIBUTES sa = 0);
# endif /* ACE_HAS_WCHAR */
extern ACE_Export
@@ -1444,16 +1421,6 @@ namespace ACE_OS {
int max = 0x7fffffff,
LPSECURITY_ATTRIBUTES sa = 0);
- ACE_NAMESPACE_INLINE_FUNCTION
- int sema_init (ACE_sema_t *s,
- u_int count,
- int type,
- ACE_condattr_t *attributes,
- const char *name = 0,
- void *arg = 0,
- int max = 0x7fffffff,
- LPSECURITY_ATTRIBUTES sa = 0);
-
# if defined (ACE_HAS_WCHAR)
ACE_NAMESPACE_INLINE_FUNCTION
int sema_init (ACE_sema_t *s,
@@ -1463,16 +1430,6 @@ namespace ACE_OS {
void *arg = 0,
int max = 0x7fffffff,
LPSECURITY_ATTRIBUTES sa = 0);
-
- ACE_NAMESPACE_INLINE_FUNCTION
- int sema_init (ACE_sema_t *s,
- u_int count,
- int type,
- ACE_condattr_t *attributes,
- const wchar_t *name,
- void *arg = 0,
- int max = 0x7fffffff,
- LPSECURITY_ATTRIBUTES sa = 0);
# endif /* ACE_HAS_WCHAR */
ACE_NAMESPACE_INLINE_FUNCTION
@@ -1876,18 +1833,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Export ACE_event_t
{
friend int ACE_OS::event_init(ACE_event_t*, int, int, int, const char*, void*,int);
- friend int ACE_OS::event_init(ACE_event_t*, int, ACE_condattr_t*, int, int, const char*, void*,int);
friend int ACE_OS::event_destroy(ACE_event_t*);
friend int ACE_OS::event_wait(ACE_event_t*);
friend int ACE_OS::event_timedwait(ACE_event_t*, ACE_Time_Value*, int);
friend int ACE_OS::event_signal(ACE_event_t*);
friend int ACE_OS::event_pulse(ACE_event_t*);
friend int ACE_OS::event_reset(ACE_event_t*);
-
-public:
- /// Constructor initializing all pointer fields to null
- ACE_event_t (void);
-
protected:
/// Event name if process shared.
diff --git a/ACE/ace/OS_NS_Thread.inl b/ACE/ace/OS_NS_Thread.inl
index ccae7cc5427..4ffc46a1920 100644
--- a/ACE/ace/OS_NS_Thread.inl
+++ b/ACE/ace/OS_NS_Thread.inl
@@ -184,40 +184,6 @@ ACE_OS::condattr_init (ACE_condattr_t &attributes, int type)
}
ACE_INLINE int
-ACE_OS::condattr_synctype (ACE_condattr_t &attributes, int& type)
-{
-# if defined (ACE_HAS_THREADS)
-# if defined (ACE_HAS_PTHREADS)
-# if !defined (ACE_LACKS_CONDATTR) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)
- int result = -1;
-
- if (
- ACE_ADAPT_RETVAL (pthread_condattr_getpshared (&attributes, &type),
- result) == 0
- )
- {
- result = 0;
- }
-# else
- ACE_UNUSED_ARG (attributes);
- int result = 0;
- type = USYNC_THREAD;
-# endif /* !ACE_LACKS_CONDATTR && _POSIX_THREAD_PROCESS_SHARED && ! ACE_LACKS_CONDATTR_PSHARED */
-
- return result;
-# else
- type = attributes.type;
- return 0;
-# endif /* ACE_HAS_PTHREADS */
-
-# else
- ACE_UNUSED_ARG (attributes);
- ACE_UNUSED_ARG (type);
- ACE_NOTSUP_RETURN (-1);
-# endif /* ACE_HAS_THREADS */
-}
-
-ACE_INLINE int
ACE_OS::condattr_setclock (ACE_condattr_t &attributes, clockid_t clock_id)
{
# if defined (ACE_HAS_THREADS)
@@ -487,19 +453,6 @@ ACE_OS::mutex_lock (ACE_mutex_t *m,
return timeout == 0 ? ACE_OS::mutex_lock (m) : ACE_OS::mutex_lock (m, *timeout);
}
-ACE_INLINE int
-ACE_OS::event_init (ACE_event_t *event,
- int manual_reset,
- int initial_state,
- int type,
- const char *name,
- void *arg,
- LPSECURITY_ATTRIBUTES sa)
-{
- ACE_condattr_t *pattr = 0;
- return ACE_OS::event_init (event, type, pattr, manual_reset, initial_state, name, arg, sa);
-}
-
#if defined (ACE_HAS_WCHAR)
ACE_INLINE int
ACE_OS::event_init (ACE_event_t *event,
@@ -536,45 +489,6 @@ ACE_OS::event_init (ACE_event_t *event,
sa);
#endif /* ACE_WIN32 */
}
-
-ACE_INLINE int
-ACE_OS::event_init (ACE_event_t *event,
- int type,
- ACE_condattr_t *attributes,
- int manual_reset,
- int initial_state,
- const wchar_t *name,
- void *arg,
- LPSECURITY_ATTRIBUTES sa)
-{
-#if defined (ACE_WIN32)
- ACE_UNUSED_ARG (type);
- ACE_UNUSED_ARG (attributes);
- ACE_UNUSED_ARG (arg);
- SECURITY_ATTRIBUTES sa_buffer;
- SECURITY_DESCRIPTOR sd_buffer;
- *event = ::CreateEventW (ACE_OS::default_win32_security_attributes_r
- (sa, &sa_buffer, &sd_buffer),
- manual_reset,
- initial_state,
- name);
- if (*event == 0)
- ACE_FAIL_RETURN (-1);
-
- // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary.
- ACE_OS::set_errno_to_last_error ();
- return 0;
-#else /* ACE_WIN32 */
- return ACE_OS::event_init (event,
- type,
- attributes,
- manual_reset,
- initial_state,
- ACE_Wide_To_Ascii (name).char_rep (),
- arg,
- sa);
-#endif /* ACE_WIN32 */
-}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE long
@@ -1513,20 +1427,6 @@ ACE_OS::sema_init (ACE_sema_t *s,
int max,
LPSECURITY_ATTRIBUTES sa)
{
- ACE_condattr_t *pattr = 0;
- return ACE_OS::sema_init (s, count, type, pattr, name, arg, max, sa);
-}
-
-ACE_INLINE int
-ACE_OS::sema_init (ACE_sema_t *s,
- u_int count,
- int type,
- ACE_condattr_t *attributes,
- const char *name,
- void *arg,
- int max,
- LPSECURITY_ATTRIBUTES sa)
-{
ACE_OS_TRACE ("ACE_OS::sema_init");
#if defined (ACE_HAS_POSIX_SEM)
ACE_UNUSED_ARG (max);
@@ -1535,15 +1435,12 @@ ACE_OS::sema_init (ACE_sema_t *s,
s->name_ = 0;
# if defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_DISABLE_POSIX_SEM_TIMEOUT_EMULATION)
ACE_UNUSED_ARG (arg);
- ACE_UNUSED_ARG (attributes);
# else
int result = -1;
if (ACE_OS::mutex_init (&s->lock_, type, name,
(ACE_mutexattr_t *) arg) == 0
- && (attributes == 0 ?
- ACE_OS::cond_init (&s->count_nonzero_, type, name, arg) :
- ACE_OS::cond_init (&s->count_nonzero_, *attributes, name, arg)) == 0
+ && ACE_OS::cond_init (&s->count_nonzero_, (short)type, name, arg) == 0
&& ACE_OS::mutex_lock (&s->lock_) == 0)
{
if (ACE_OS::mutex_unlock (&s->lock_) == 0)
@@ -1747,7 +1644,6 @@ ACE_OS::sema_init (ACE_sema_t *s,
ACE_UNUSED_ARG (name);
ACE_UNUSED_ARG (max);
ACE_UNUSED_ARG (sa);
- ACE_UNUSED_ARG (attributes);
int result;
ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sema_init (s, count, type, arg), result),
int, -1);
@@ -1758,9 +1654,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
if (ACE_OS::mutex_init (&s->lock_, type, name,
(ACE_mutexattr_t *) arg) == 0
- && (attributes == 0 ?
- ACE_OS::cond_init (&s->count_nonzero_, type, name, arg) :
- ACE_OS::cond_init (&s->count_nonzero_, *attributes, name, arg)) == 0
+ && ACE_OS::cond_init (&s->count_nonzero_, type, name, arg) == 0
&& ACE_OS::mutex_lock (&s->lock_) == 0)
{
s->count_ = count;
@@ -1777,7 +1671,6 @@ ACE_OS::sema_init (ACE_sema_t *s,
}
return result;
# elif defined (ACE_HAS_WTHREADS)
- ACE_UNUSED_ARG (attributes);
# if ! defined (ACE_USES_WINCE_SEMA_SIMULATION)
ACE_UNUSED_ARG (type);
ACE_UNUSED_ARG (arg);
@@ -1847,7 +1740,6 @@ ACE_OS::sema_init (ACE_sema_t *s,
ACE_UNUSED_ARG (s);
ACE_UNUSED_ARG (count);
ACE_UNUSED_ARG (type);
- ACE_UNUSED_ARG (attributes);
ACE_UNUSED_ARG (name);
ACE_UNUSED_ARG (arg);
ACE_UNUSED_ARG (max);
@@ -1866,22 +1758,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
int max,
LPSECURITY_ATTRIBUTES sa)
{
- ACE_condattr_t *pattr = 0;
- return ACE_OS::sema_init (s, count, type, pattr, name, arg, max, sa);
-}
-
-ACE_INLINE int
-ACE_OS::sema_init (ACE_sema_t *s,
- u_int count,
- int type,
- ACE_condattr_t *attributes,
- const wchar_t *name,
- void *arg,
- int max,
- LPSECURITY_ATTRIBUTES sa)
-{
# if defined (ACE_HAS_WTHREADS)
- ACE_UNUSED_ARG (attributes);
# if ! defined (ACE_USES_WINCE_SEMA_SIMULATION)
ACE_UNUSED_ARG (type);
ACE_UNUSED_ARG (arg);
@@ -1940,7 +1817,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
# endif /* ACE_USES_WINCE_SEMA_SIMULATION */
# else /* ACE_HAS_WTHREADS */
// Just call the normal char version.
- return ACE_OS::sema_init (s, count, type, attributes, ACE_Wide_To_Ascii (name).char_rep (), arg, max, sa);
+ return ACE_OS::sema_init (s, count, type, ACE_Wide_To_Ascii (name).char_rep (), arg, max, sa);
# endif /* ACE_HAS_WTHREADS */
}
#endif /* ACE_HAS_WCHAR */
@@ -3843,15 +3720,4 @@ ACE_Thread_ID::operator!= (const ACE_Thread_ID &rhs) const
return !(*this == rhs);
}
-#if !defined (ACE_WIN32)
-
-ACE_INLINE
-ACE_event_t::ACE_event_t (void) :
- name_ (0),
- eventdata_ (0)
-{
-}
-
-#endif /* !ACE_WIN32 */
-
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/OS_NS_netdb.inl b/ACE/ace/OS_NS_netdb.inl
index dc17a38d76a..4d574487f1a 100644
--- a/ACE/ace/OS_NS_netdb.inl
+++ b/ACE/ace/OS_NS_netdb.inl
@@ -7,7 +7,7 @@
#include "ace/OS_NS_errno.h"
#if defined (ACE_LACKS_NETDB_REENTRANT_FUNCTIONS)
-# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) && !defined (HPUX_11)
+# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
# define ACE_NETDBCALL_RETURN(OP,TYPE,FAILVALUE,TARGET,SIZE) \
do \
{ \
@@ -25,7 +25,7 @@
return ace_result_; \
} \
} while(0)
-# else /* ! (ACE_MT_SAFE && ACE_MT_SAFE != 0 && !HPUX_11) */
+# else /* ! (ACE_MT_SAFE && ACE_MT_SAFE != 0) */
# define ACE_NETDBCALL_RETURN(OP,TYPE,FAILVALUE,TARGET,SIZE) \
do \
{ \
diff --git a/ACE/ace/Obchunk.h b/ACE/ace/Obchunk.h
index cd1abb4369d..9690c39f9d1 100644
--- a/ACE/ace/Obchunk.h
+++ b/ACE/ace/Obchunk.h
@@ -10,6 +10,7 @@
*/
//=============================================================================
+
#ifndef ACE_OBCHUNK_H
#define ACE_OBCHUNK_H
#include /**/ "ace/pre.h"
diff --git a/ACE/ace/Obstack_T.cpp b/ACE/ace/Obstack_T.cpp
index 961f065213a..dc1d0acfc6c 100644
--- a/ACE/ace/Obstack_T.cpp
+++ b/ACE/ace/Obstack_T.cpp
@@ -54,8 +54,8 @@ ACE_Obstack_T<ACE_CHAR_T>::request (size_t len)
// chunk or will need a new one.
if (this->curr_->cur_ + len >= this->curr_->end_)
{
- // Need a new chunk. Save the current one so the current string
- // can be copied to the new chunk.
+ // Need a new chunk. Save the current one so the current string can be
+ // copied to the new chunk.
ACE_Obchunk *temp = this->curr_;
if (this->curr_->next_ == 0)
{
@@ -122,7 +122,7 @@ ACE_Obstack_T<ACE_CHAR_T>::new_chunk (void)
template <class ACE_CHAR_T>
ACE_Obstack_T<ACE_CHAR_T>::ACE_Obstack_T (size_t size,
- ACE_Allocator *allocator_strategy)
+ ACE_Allocator *allocator_strategy)
: allocator_strategy_ (allocator_strategy),
size_ (size),
head_ (0),
@@ -156,7 +156,7 @@ ACE_Obstack_T<ACE_CHAR_T>::~ACE_Obstack_T (void)
template <class ACE_CHAR_T> ACE_CHAR_T *
ACE_Obstack_T<ACE_CHAR_T>::copy (const ACE_CHAR_T *s,
- size_t len)
+ size_t len)
{
ACE_TRACE ("ACE_Obstack_T<ACE_CHAR_T>::copy");
diff --git a/ACE/ace/Obstack_T.h b/ACE/ace/Obstack_T.h
index b0ed606734b..bba7595771c 100644
--- a/ACE/ace/Obstack_T.h
+++ b/ACE/ace/Obstack_T.h
@@ -47,11 +47,11 @@ public:
/// a new string. Return -1 if fail, 0 if success.
int request (size_t len);
- /// Inserting a new ACE_CHAR_T \a c into the current building block
- /// without freezing (null terminating) the block. This function
- /// will create new chunk by checking the boundary of current
- /// Obchunk. Return the location \a c gets inserted to, or 0 if
- /// error.
+ /// Inserting a new ACE_CHAR_T \a c into the current building
+ /// block without freezing (null terminating) the block.
+ /// This function will create new chunk by checking the
+ /// boundary of current Obchunk. Return
+ /// the location \a c gets inserted to, or 0 if error.
ACE_CHAR_T *grow (ACE_CHAR_T c);
/// Inserting a new ACE_CHAR_T \a c into the current building
@@ -78,7 +78,7 @@ public:
/// in the stack is released. Otherwise, @a obj must be an address of an
/// object allocated in the stack. In this case, @a obj is released along
/// with everthing allocated in the Obstack since @a obj.
- void unwind (void *obj);
+ void unwind (void* obj);
/// "Release" the entire stack of Obchunks, putting it back on the free
/// list.
@@ -95,7 +95,7 @@ protected:
/// Search through the list of Obchunks and release them. Helper funtion
/// used by unwind.
- void unwind_i (void *obj);
+ void unwind_i (void* obj);
/// Pointer to the allocator used by this Obstack.
ACE_Allocator *allocator_strategy_;
diff --git a/ACE/ace/Reactor.h b/ACE/ace/Reactor.h
index 23d973c0c68..de3991f2800 100644
--- a/ACE/ace/Reactor.h
+++ b/ACE/ace/Reactor.h
@@ -462,12 +462,15 @@ public:
* Install the new disposition (if given) and return the previous
* disposition (if desired by the caller).
*
- * Note that the registered handler's ACE_Event_Handler::handle_close ()
- * callback will be called to indicate the signal handler has been removed.
- * Unlike with I/O handles, there is no way to prevent this callback. The
- * handle_close() callback can check the passed mask for the value
- * ACE_Event_Handler::SIGNAL_MASK to tell when the callback is the result
- * of a signal handler removal.
+ * Note that, unlike removing handler for I/O events,
+ * ACE_Event_Handler::handle_close() will not be called when the
+ * handler is removed. Neither will any reference-counting activity be
+ * involved.
+ *
+ * @note There's an existing enhancement request in Bugzilla,
+ * #2368, to change this behavior so that ACE_Event_Handler::handle_close()
+ * is called when the signal handler is removed. Thus, there's some chance
+ * this behavior will change in a future version of ACE.
*/
int remove_handler (int signum,
ACE_Sig_Action *new_disp,
diff --git a/ACE/ace/Read_Buffer.cpp b/ACE/ace/Read_Buffer.cpp
index 544b407f934..0c18bfe3ad0 100644
--- a/ACE/ace/Read_Buffer.cpp
+++ b/ACE/ace/Read_Buffer.cpp
@@ -13,6 +13,9 @@
#include "ace/Service_Config.h"
#include "ace/OS_NS_stdio.h"
+
+
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
void
@@ -32,9 +35,7 @@ ACE_Read_Buffer::dump (void) const
ACE_Read_Buffer::ACE_Read_Buffer (FILE *fp,
bool close_on_delete,
ACE_Allocator *alloc)
- : size_ (0),
- occurrences_ (0),
- stream_ (fp),
+ : stream_ (fp),
close_on_delete_ (close_on_delete),
allocator_ (alloc)
{
@@ -47,9 +48,7 @@ ACE_Read_Buffer::ACE_Read_Buffer (FILE *fp,
ACE_Read_Buffer::ACE_Read_Buffer (ACE_HANDLE handle,
bool close_on_delete,
ACE_Allocator *alloc)
- : size_ (0),
- occurrences_ (0),
- stream_ (ACE_OS::fdopen (handle, ACE_TEXT ("r"))),
+ : stream_ (ACE_OS::fdopen (handle, ACE_TEXT ("r"))),
close_on_delete_ (close_on_delete),
allocator_ (alloc)
{
diff --git a/ACE/ace/Recursive_Thread_Mutex.cpp b/ACE/ace/Recursive_Thread_Mutex.cpp
index 1b43bbb6e61..07603a9cc4e 100644
--- a/ACE/ace/Recursive_Thread_Mutex.cpp
+++ b/ACE/ace/Recursive_Thread_Mutex.cpp
@@ -103,6 +103,10 @@ ACE_Recursive_Thread_Mutex::get_nesting_level (void)
#endif /* !ACE_HAS_WINCE */
}
+ACE_Recursive_Thread_Mutex::ACE_Recursive_Thread_Mutex (const ACE_Recursive_Thread_Mutex &)
+{
+}
+
void
ACE_Recursive_Thread_Mutex::dump (void) const
{
diff --git a/ACE/ace/SSL/SSL_Context.cpp b/ACE/ace/SSL/SSL_Context.cpp
index 4da213484a7..cca47377cde 100644
--- a/ACE/ace/SSL/SSL_Context.cpp
+++ b/ACE/ace/SSL/SSL_Context.cpp
@@ -236,7 +236,6 @@ ACE_SSL_Context::set_mode (int mode)
switch (mode)
{
-#if !defined (OPENSSL_NO_SSL2)
case ACE_SSL_Context::SSLv2_client:
method = ::SSLv2_client_method ();
break;
@@ -246,7 +245,6 @@ ACE_SSL_Context::set_mode (int mode)
case ACE_SSL_Context::SSLv2:
method = ::SSLv2_method ();
break;
-#endif /* OPENSSL_NO_SSL2 */
case ACE_SSL_Context::SSLv3_client:
method = ::SSLv3_client_method ();
break;
@@ -341,12 +339,10 @@ ACE_SSL_Context::load_trusted_ca (const char* ca_file,
|| mode_ == SSLv23_server
|| mode_ == TLSv1
|| mode_ == TLSv1_server
-#if !defined (OPENSSL_NO_SSL2)
- || mode_ == SSLv2
- || mode_ == SSLv2_server
-#endif /* !OPENSSL_NO_SSL2 */
|| mode_ == SSLv3
- || mode_ == SSLv3_server)
+ || mode_ == SSLv3_server
+ || mode_ == SSLv2
+ || mode_ == SSLv2_server)
{
// Note: The STACK_OF(X509_NAME) pointer is a copy of the pointer in
// the CTX; any changes to it by way of these function calls will
diff --git a/ACE/ace/SSL/SSL_Context.h b/ACE/ace/SSL/SSL_Context.h
index 252613d389a..438fb19eb81 100644
--- a/ACE/ace/SSL/SSL_Context.h
+++ b/ACE/ace/SSL/SSL_Context.h
@@ -104,12 +104,10 @@ public:
enum {
INVALID_METHOD = -1,
-#if !defined (OPENSSL_NO_SSL2)
SSLv2_client = 1,
SSLv2_server,
SSLv2,
-#endif /* !OPENSSL_NO_SSL2 */
- SSLv3_client = 4,
+ SSLv3_client,
SSLv3_server,
SSLv3,
SSLv23_client,
diff --git a/ACE/ace/SV_Semaphore_Simple.cpp b/ACE/ace/SV_Semaphore_Simple.cpp
index bdf4531f4e1..dbc8f139580 100644
--- a/ACE/ace/SV_Semaphore_Simple.cpp
+++ b/ACE/ace/SV_Semaphore_Simple.cpp
@@ -211,8 +211,7 @@ ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple (void)
this->close ();
}
-ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (void) :
- sem_number_ (0)
+ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (void)
{
ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple");
this->init ();
diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h
index 4f31be9f7dd..d25e72ed280 100644
--- a/ACE/ace/Service_Config.h
+++ b/ACE/ace/Service_Config.h
@@ -57,31 +57,6 @@ class ACE_DLL;
ACE_TEXT ("() \"") \
ACE_TEXT (parameters) \
ACE_TEXT ("\"")
-#if defined (ACE_VERSIONED_SO) && (ACE_VERSIONED_SO == 2)
-#define ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(ident, libpathname, version, objectclass, parameters) \
- ACE_TEXT ("dynamic ") \
- ACE_TEXT (ident) \
- ACE_TEXT (" Service_Object * ") \
- ACE_TEXT (libpathname) \
- ACE_TEXT ("-") \
- ACE_TEXT (version) \
- ACE_TEXT (":") \
- ACE_TEXT (objectclass) \
- ACE_TEXT ("() \"") \
- ACE_TEXT (parameters) \
- ACE_TEXT ("\"")
-#else
-#define ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(ident, libpathname, version, objectclass, parameters) \
- ACE_TEXT ("dynamic ") \
- ACE_TEXT (ident) \
- ACE_TEXT (" Service_Object * ") \
- ACE_TEXT (libpathname) \
- ACE_TEXT (":") \
- ACE_TEXT (objectclass) \
- ACE_TEXT ("() \"") \
- ACE_TEXT (parameters) \
- ACE_TEXT ("\"")
-#endif /* ACE_VERSIONED_SO */
#define ACE_REMOVE_SERVICE_DIRECTIVE(ident) \
ACE_TEXT ("remove ") \
ACE_TEXT (ident)
diff --git a/ACE/ace/Sig_Adapter.cpp b/ACE/ace/Sig_Adapter.cpp
index 9de42c7f525..3fec1f5c2a3 100644
--- a/ACE/ace/Sig_Adapter.cpp
+++ b/ACE/ace/Sig_Adapter.cpp
@@ -2,12 +2,13 @@
#include "ace/Sig_Adapter.h"
+
+
+
ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Action &sa, int sigkey)
: sigkey_ (sigkey),
type_ (SIG_ACTION),
- sa_ (sa),
- eh_ (0),
- sig_func_ (0)
+ sa_ (sa)
{
// ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
}
@@ -16,8 +17,7 @@ ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Event_Handler *eh,
int sigkey)
: sigkey_ (sigkey),
type_ (ACE_HANDLER),
- eh_ (eh),
- sig_func_ (0)
+ eh_ (eh)
{
// ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
}
@@ -26,7 +26,6 @@ ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Handler_Ex sig_func,
int sigkey)
: sigkey_ (sigkey),
type_ (C_FUNCTION),
- eh_ (0),
sig_func_ (sig_func)
{
// ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
diff --git a/ACE/ace/Signal.h b/ACE/ace/Signal.h
index 15ab3d34519..406181d04df 100644
--- a/ACE/ace/Signal.h
+++ b/ACE/ace/Signal.h
@@ -28,7 +28,7 @@
#include "ace/OS_NS_signal.h"
-/// Type of the extended signal handler.
+// Type of the extended signal handler.
typedef void (*ACE_Sig_Handler_Ex) (int, siginfo_t *siginfo, ucontext_t *ucontext);
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/TSS_T.inl b/ACE/ace/TSS_T.inl
index a566320dde8..a6351ec6448 100644
--- a/ACE/ace/TSS_T.inl
+++ b/ACE/ace/TSS_T.inl
@@ -76,7 +76,7 @@ ACE_TSS<TYPE>::ts_value (ACE_TSS_Adapter *new_tss_adapter) const
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("Error: ACE_Thread::setspecific() failed!")));
+ ACE_TEXT ("ACE_Thread::setspecific() failed!")));
return -1;
}
@@ -90,7 +90,7 @@ ACE_TSS<TYPE>::ts_value (TYPE *new_ts_obj) const
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("Error: ACE_Thread::setspecific() failed!")));
+ ACE_TEXT ("ACE_Thread::setspecific() failed!")));
return -1;
}
diff --git a/ACE/ace/Test_and_Set.h b/ACE/ace/Test_and_Set.h
index c26836d139c..d72c3d474b0 100644
--- a/ACE/ace/Test_and_Set.h
+++ b/ACE/ace/Test_and_Set.h
@@ -26,11 +26,13 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*
* @brief Implements the classic ``test and set'' operation.
*
- * This class keeps track of the status of <is_set_>, which can be
- * set based on various events (such as receipt of a signal).
- * This class is derived from ACE_Event_Handler so that it can be
- * "signaled" by a Reactor when a signal occurs. We assume that
- * <TYPE> is a data type that can be assigned the value 0 or 1.
+ *
+ * This class keeps track of the status of <is_set_>, which can
+ * be set based on various events (such as receipt of a
+ * signal). This class is derived from ACE_Event_Handler so
+ * that it can be "signaled" by a Reactor when a signal occurs.
+ * We assume that <TYPE> is a data type that can be assigned the
+ * value 0 or 1.
*/
template <class ACE_LOCK, class TYPE>
class ACE_Test_and_Set : public ACE_Event_Handler
diff --git a/ACE/ace/Timer_Hash_T.h b/ACE/ace/Timer_Hash_T.h
index 75b0d1ee8fc..77200c943bc 100644
--- a/ACE/ace/Timer_Hash_T.h
+++ b/ACE/ace/Timer_Hash_T.h
@@ -29,7 +29,6 @@ template <class TYPE, class FUNCTOR, class ACE_LOCK, class BUCKET, typename TIME
class ACE_Timer_Hash_T;
template <typename TYPE>
class Hash_Token;
-class ACE_Event_Handler;
/**
* @class ACE_Timer_Hash_Upcall
diff --git a/ACE/ace/Timer_Queue_Iterator.cpp b/ACE/ace/Timer_Queue_Iterator.cpp
index 83d8d16f9b3..7a6b4b8d137 100644
--- a/ACE/ace/Timer_Queue_Iterator.cpp
+++ b/ACE/ace/Timer_Queue_Iterator.cpp
@@ -33,10 +33,6 @@ ACE_Timer_Node_T<TYPE>::dump (void) const
template <class TYPE>
ACE_Timer_Node_T<TYPE>::ACE_Timer_Node_T (void)
- : act_ (0),
- prev_ (0),
- next_ (0),
- timer_id_ (-1)
{
ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
}
diff --git a/ACE/ace/Timer_Queue_Iterator.h b/ACE/ace/Timer_Queue_Iterator.h
index b852df5f06e..66145fa2e33 100644
--- a/ACE/ace/Timer_Queue_Iterator.h
+++ b/ACE/ace/Timer_Queue_Iterator.h
@@ -115,9 +115,9 @@ public:
void set_timer_id (long timer_id);
/// Get the dispatch info. The dispatch information is got
- /// through @a info. This form helps us in preventing allocation and
+ /// through <info>. This form helps us in preventing allocation and
/// deleting data along the criticl path.
- /// @todo We may want to have a copying version too, so that our
+ /// @@TODO: We may want to have a copying version too, so that our
/// interface will be complete..
void get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T <TYPE> &info);
diff --git a/ACE/ace/Version.h b/ACE/ace/Version.h
index 5039321bb41..d87b6661a85 100644
--- a/ACE/ace/Version.h
+++ b/ACE/ace/Version.h
@@ -5,5 +5,5 @@
#define ACE_MAJOR_VERSION 6
#define ACE_MINOR_VERSION 1
-#define ACE_BETA_VERSION 6
-#define ACE_VERSION "6.1.6"
+#define ACE_BETA_VERSION 4
+#define ACE_VERSION "6.1.4"
diff --git a/ACE/ace/XML_Utils/ACE_XML_Utils.pc.in b/ACE/ace/XML_Utils/ACE_XML_Utils.pc.in
deleted file mode 100644
index 9b267ae548a..00000000000
--- a/ACE/ace/XML_Utils/ACE_XML_Utils.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: ACE_XML_Utils
-Description: ACE XML Utilities Library
-Requires: ACE
-Version: @VERSION@
-Libs: -L${libdir} -lACE_XML_Utils
-Cflags: -I${includedir}
diff --git a/ACE/ace/XML_Utils/XML.mpc b/ACE/ace/XML_Utils/XML.mpc
index a1ff434efbf..dc83dd836b8 100644
--- a/ACE/ace/XML_Utils/XML.mpc
+++ b/ACE/ace/XML_Utils/XML.mpc
@@ -37,8 +37,4 @@ project (ACE_XML_Utils) : install, acelib, xerces, ace_output {
XML_Schema_Resolver.cpp
XML_Typedefs.cpp
}
-
- Pkgconfig_Files {
- ACE_XML_Utils.pc.in
- }
}
diff --git a/ACE/ace/ace.mpc b/ACE/ace/ace.mpc
index 7dddd64d40d..454e3d461f4 100644
--- a/ACE/ace/ace.mpc
+++ b/ACE/ace/ace.mpc
@@ -27,6 +27,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
ATM_Stream.cpp
Atomic_Op.cpp
Atomic_Op_Sparc.c
+ Auto_Event.cpp
Barrier.cpp
Base_Thread_Adapter.cpp
Based_Pointer_Repository.cpp
@@ -60,7 +61,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
Dump.cpp
Dynamic.cpp
Dynamic_Message_Strategy.cpp
- Event_Base.cpp
+ Event.cpp
Event_Handler.cpp
Event_Handler_Handle_Timeout_Upcall.cpp
FIFO.cpp
@@ -108,6 +109,7 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
LSOCK_Stream.cpp
Malloc.cpp
Malloc_Allocator.cpp
+ Manual_Event.cpp
MEM_Acceptor.cpp
MEM_Addr.cpp
MEM_Connector.cpp
@@ -293,7 +295,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
Asynch_Connector.cpp
Atomic_Op_T.cpp
Atomic_Op_GCC_T.cpp
- Auto_Event.cpp
Auto_Functor.cpp
Auto_IncDec_T.cpp
Auto_Ptr.cpp
@@ -310,7 +311,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
Dump_T.cpp
Dynamic_Service.cpp
Env_Value_T.cpp
- Event.cpp
Event_Handler_T.cpp
Framework_Component_T.cpp
Free_List.cpp
@@ -331,7 +331,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
Lock_Adapter_T.cpp
Malloc_T.cpp
Managed_Object.cpp
- Manual_Event.cpp
Map_Manager.cpp
Map_T.cpp
Message_Block_T.cpp
@@ -404,7 +403,6 @@ project(ACE) : ace_output, acedefaults, install, other, codecs, token, svcconf,
Condition_T.h
Countdown_Time.h
Default_Constants.h
- Event_Base.h
Global_Macros.h
Guard_T.h
Hash_Map_Manager.h
diff --git a/ACE/ace/ace_for_tao.mpc b/ACE/ace/ace_for_tao.mpc
index 1ddad6ddd26..3b719ed8f6c 100644
--- a/ACE/ace/ace_for_tao.mpc
+++ b/ACE/ace/ace_for_tao.mpc
@@ -24,6 +24,7 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Argv_Type_Converter.cpp
Assert.cpp
Atomic_Op.cpp
+ Auto_Event.cpp
Barrier.cpp // Required by orbsvcs/tests/Notify/lib
Base_Thread_Adapter.cpp
Based_Pointer_Repository.cpp
@@ -47,7 +48,7 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Dump.cpp
Dynamic.cpp
Dynamic_Message_Strategy.cpp
- Event_Base.cpp
+ Event.cpp
Event_Handler.cpp
Event_Handler_Handle_Timeout_Upcall.cpp
FILE.cpp
@@ -80,6 +81,7 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Logging_Strategy.cpp
Malloc.cpp
Malloc_Allocator.cpp
+ Manual_Event.cpp
Mem_Map.cpp
Message_Block.cpp
Message_Queue.cpp
@@ -215,7 +217,6 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Arg_Shifter.cpp
ARGV.cpp
Atomic_Op_T.cpp
- Auto_Event.cpp
Auto_Functor.cpp
Auto_IncDec_T.cpp
Auto_Ptr.cpp
@@ -232,7 +233,6 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Dump_T.cpp
Dynamic_Service.cpp
Env_Value_T.cpp
- Event.cpp
Event_Handler_T.cpp
Framework_Component_T.cpp
Free_List.cpp
@@ -247,7 +247,6 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Lock_Adapter_T.cpp
Malloc_T.cpp
Managed_Object.cpp
- Manual_Event.cpp
Map_Manager.cpp
Map_T.cpp
Message_Block_T.cpp
@@ -313,7 +312,6 @@ project(ACE_FOR_TAO) : acedefaults, install, svcconf, uuid, versioned_namespace,
Condition_T.h
Countdown_Time.h
Default_Constants.h
- Event_Base.h
Exception_Macros.h
Global_Macros.h
Guard_T.h
diff --git a/ACE/ace/config-hpux-11.00.h b/ACE/ace/config-hpux-11.00.h
index 505f703434f..7df5bd584a3 100644
--- a/ACE/ace/config-hpux-11.00.h
+++ b/ACE/ace/config-hpux-11.00.h
@@ -231,9 +231,10 @@
// HP-UX 11 has reentrant netdb functions. The catch is that the old
// functions (gethostbyname, etc.) are thread-safe and the _r versions are
-// obsolescent. So, define things so the _r versions are not used.
-// OS_NS_netdb.inl ensures no funny lock games are played in the
-// ACE_NETDBCALL_RETURN macro.
+// not used and will be removed at some point. So, define things so
+// the _r versions are not used. This will slow things down a bit due to
+// the extra mutex lock in the ACE_NETDBCALL_RETURN macro, and will be fixed
+// in the future (problem ID P64).
#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS
/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */
diff --git a/ACE/ace/config-macosx-mountain-lion.h b/ACE/ace/config-macosx-mountain-lion.h
deleted file mode 100644
index 4173495276c..00000000000
--- a/ACE/ace/config-macosx-mountain-lion.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// $Id$
-#ifndef ACE_CONFIG_MACOSX_MOUNTAIN_LION_H
-#define ACE_CONFIG_MACOSX_MOUNTAIN_LION_H
-
-#include "ace/config-macosx-lion.h"
-
-#endif // ACE_CONFIG_MACOSX_MOUNTAIN_LION_H
diff --git a/ACE/bin/diff-builds-and-group-fixed-tests-only.sh b/ACE/bin/diff-builds-and-group-fixed-tests-only.sh
index e6bcf1a0665..5004090f340 100755
--- a/ACE/bin/diff-builds-and-group-fixed-tests-only.sh
+++ b/ACE/bin/diff-builds-and-group-fixed-tests-only.sh
@@ -3,7 +3,7 @@
if test -z $1; then newdate=`date -u +%Y_%m_%d`; else newdate=$1; fi
if test -z $2; then prefix=`date -u +%Y%m%d%a`; else prefix=$2; fi
-if test -z $3; then olddate=2012_11_12; else olddate=$3; fi
+if test -z $3; then olddate=2012_08_29; else olddate=$3; fi
if test -z $ACE_ROOT; then ACE_ROOT=..; fi
if test -z $TAO_ROOT; then TAO_ROOT=${ACE_ROOT}/TAO; fi
if test -z $CIAO_ROOT; then CIAO_ROOT=${TAO_ROOT}/CIAO; fi
diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl
index f916e9263c0..87bc223b140 100755
--- a/ACE/bin/fuzz.pl
+++ b/ACE/bin/fuzz.pl
@@ -472,7 +472,6 @@ sub check_for_ACE_Thread_Mutex ()
}
if (/FUZZ\: enable check_for_ACE_Thread_Mutex/) {
$disable = 0;
- next;
}
if ($disable == 0 and /ACE_Thread_Mutex/) {
# It is okay to use ACE_Thread_Mutex in ACE
diff --git a/ACE/debian/ACE-DPKG.mwc b/ACE/debian/ACE-DPKG.mwc
new file mode 100644
index 00000000000..1aaacf13c94
--- /dev/null
+++ b/ACE/debian/ACE-DPKG.mwc
@@ -0,0 +1,34 @@
+// $Id$
+
+workspace {
+ exclude {
+ .pc
+
+ TAO
+ performance-tests
+
+ examples
+ ACEXML/examples
+ ASNMP
+
+ tests
+ Kokyu/tests
+ ACEXML/tests
+ apps/gperf/tests
+ apps/drwho
+ apps/Gateway
+ apps/AWS
+ apps/JAWS
+ apps/JAWS2
+ apps/JAWS3
+ apps/mkcsregdb
+ apps/soreduce
+
+ websvcs
+ contrib
+ protocols/tests
+ protocols/examples
+
+ netsvcs/clients
+ }
+}
diff --git a/ACE/debian/README.source b/ACE/debian/README.source
index 33734bbdb11..f975b7c97c2 100644
--- a/ACE/debian/README.source
+++ b/ACE/debian/README.source
@@ -11,7 +11,9 @@
When preparing a new release, there are several things to remember:
-- Regenerate the list of include files for libace-inet-dev and
+ - Update patch 34-bts386713 (change soversions)
+
+ - Regenerate the list of include files for libace-inet-dev and
libace-inet-ssl-dev:
From debian/tmp:
@@ -19,14 +21,14 @@ When preparing a new release, there are several things to remember:
$ find . -type f | grep -vi https | grep -vi ssl --> These go to libace-inet-dev
The ones matching HTTPS or SSL go in libace-inet-ssl-dev.install:
-
+
usr/include/ace/INet/*SSL*
usr/include/ace/INet/*HTTPS*
But that might need updating if ACE_INet_SSL starts supporting FTPS or others
libace-inet-ssl-dev requires libace-inet-dev
-
+
Also, make sure none of the files in libace-inet-dev include anything from
libace-inet-ssl-dev. Test with:
diff --git a/ACE/debian/TAO-DPKG.mwc b/ACE/debian/TAO-DPKG.mwc
new file mode 100644
index 00000000000..4726bfa99ab
--- /dev/null
+++ b/ACE/debian/TAO-DPKG.mwc
@@ -0,0 +1,27 @@
+// $Id$
+
+workspace {
+ exclude {
+ .pc
+ examples
+ orbsvcs/examples
+
+ performance-tests
+ orbsvcs/tests/Notify/performance-tests
+ orbsvcs/performance-tests
+
+ interop-tests
+
+ tests
+ examples/PluggableUDP/tests
+ orbsvcs/tests
+ orbsvcs/examples/CosEC/RtEC_Based/tests
+
+ docs
+ DevGuideExamples
+ orbsvcs/DevGuideExamples
+ utils/logWalker
+ utils/monitor
+ }
+}
+
diff --git a/ACE/debian/ace.dsc b/ACE/debian/ace.dsc
index 5e663639204..bb734b56f06 100644
--- a/ACE/debian/ace.dsc
+++ b/ACE/debian/ace.dsc
@@ -1,10 +1,10 @@
Format: 1.0
-Source: ACE+TAO+CIAO-src-6.1.6
-Version: 2.1.6
+Source: ACE+TAO+CIAO-src-6.1.4
+Version: 2.1.4
Binary: ace
Maintainer: Johnny Willemsen <jwillemsen@remedy.nl>
Architecture: any
Build-Depends: gcc, make, g++, debhelper (>= 5), libssl-dev (>= 0.9.7d), dpatch (>= 2.0.10), libxt-dev (>= 4.3.0), libfltk1.1-dev (>= 1.1.4), libqt4-dev (>= 4.4~rc1-4), tk-dev (>= 8.4.7), zlib1g-dev, docbook-to-man, bzip2, autoconf, automake, libtool, autotools-dev, doxygen, graphviz
Files:
- 65b34001c9605f056713a7e146b052d1 46346654 ACE+TAO+CIAO-src-6.1.6.tar.gz
+ 65b34001c9605f056713a7e146b052d1 46346654 ACE+TAO+CIAO-src-6.1.4.tar.gz
diff --git a/ACE/debian/debian.control b/ACE/debian/debian.control
index 8dad8ae3ad4..aa36bdbf02c 100644
--- a/ACE/debian/debian.control
+++ b/ACE/debian/debian.control
@@ -28,7 +28,7 @@ Description: makefile, project, and workspace creator
* mpc-ace: generates project files for a single target
* mwc-ace: generates workspace files for a set of projects
-Package: libace-6.1.6
+Package: libace-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -46,7 +46,7 @@ Description: C++ network programming framework
Package: libace-dev
Architecture: any
Section: libdevel
-Depends: libace-6.1.6 (= ${binary:Version}), ${misc:Depends}
+Depends: libace-6.1.4 (= ${binary:Version}), ${misc:Depends}
Suggests: libace-doc, libtao-dev, pkg-config
Replaces: mpc-ace (<< 5.6.3-4)
Description: C++ network programming framework - development files
@@ -63,7 +63,7 @@ Description: C++ network programming framework - documentation
This package contains the ACE overview documentation, tutorials,
examples, and information regarding upstream development.
-Package: libace-ssl-6.1.6
+Package: libace-ssl-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -74,12 +74,12 @@ Description: ACE secure socket layer library
Package: libace-ssl-dev
Architecture: any
Section: libdevel
-Depends: libace-ssl-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libssl-dev (>= 6.1.6d), ${misc:Depends}
+Depends: libace-ssl-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libssl-dev (>= 6.1.4d), ${misc:Depends}
Description: ACE secure socket layer library - development files
This package contains the header files and static library for the ACE
SSL library.
-Package: libace-rmcast-6.1.6
+Package: libace-rmcast-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -93,12 +93,12 @@ Description: ACE reliable multicast library
Package: libace-rmcast-dev
Architecture: any
Section: libdevel
-Depends: libace-rmcast-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libace-rmcast-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE reliable multicast library - development files
This package contains the header files and static library for the ACE
reliable multicast library.
-Package: libace-tmcast-6.1.6
+Package: libace-tmcast-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -112,12 +112,12 @@ Description: ACE transactional multicast library
Package: libace-tmcast-dev
Architecture: any
Section: libdevel
-Depends: libace-tmcast-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libace-tmcast-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE transactional multicast library - development files
This package contains the header files and static library for the ACE
transactional multicast library.
-Package: libace-htbp-6.1.6
+Package: libace-htbp-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -131,12 +131,12 @@ Description: ACE protocol over HTTP tunneling library
Package: libace-htbp-dev
Architecture: any
Section: libdevel
-Depends: libace-htbp-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libace-htbp-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE protocol over HTTP tunneling library - development files
This package contains the header files and static library for the ACE
HTBP library.
-Package: libace-inet-6.1.6
+Package: libace-inet-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -147,15 +147,15 @@ Description: ACE Inet protocol library
Package: libace-inet-dev
Architecture: any
Section: libdevel
-Depends: libace-inet-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libace-inet-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE Inet protocol library - development files
This package contains the header files and static library for the ACE
Inet protocol library.
-Package: libace-inet-ssl-6.1.6
+Package: libace-inet-ssl-6.1.4
Architecture: any
Section: libs
-Depends: libace-inet-6.1.2, libace-ssl-6.1.6, ${shlibs:Depends}, ${misc:Depends}
+Depends: libace-inet-6.1.2, libace-ssl-6.1.4, ${shlibs:Depends}, ${misc:Depends}
Description: ACE SSL-enabled Inet protocol library
This package provides an ACE addon library for clients (and possibly
servers at some point) using Inet protocols which support SSL, such as
@@ -164,7 +164,7 @@ Description: ACE SSL-enabled Inet protocol library
Package: libace-inet-ssl-dev
Architecture: any
Section: libdevel
-Depends: libace-inet-ssl-6.1.6 (= ${binary:Version}), libace-inet-dev (= ${binary:Version}), libace-ssl-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libace-inet-ssl-6.1.4 (= ${binary:Version}), libace-inet-dev (= ${binary:Version}), libace-ssl-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE SSL-enabled Inet protocol library - development files
This package contains the header files and static library for the ACE
SSL-enabled Inet protocol library.
@@ -191,7 +191,7 @@ Description: ACE perfect hash function generator (transitional package)
.
It can be safely removed after installation.
-Package: libacexml-6.1.6
+Package: libacexml-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -207,16 +207,16 @@ Package: libacexml-dev
Architecture: any
Section: libdevel
Replaces: libace-dev (<< 5.7.7-4)
-Depends: libacexml-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libacexml-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE SAX based XML parsing library - development files
This package contains the header files and static library for the ACE
XML parsing library.
-Package: libkokyu-6.1.6
+Package: libkokyu-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: libtao-2.1.2, libtao-orbsvcs-2.1.6
+Suggests: libtao-2.1.2, libtao-orbsvcs-2.1.4
Description: ACE scheduling and dispatching library
Kokyu is a library designed to provide flexible scheduling and
dispatching services.
@@ -227,12 +227,12 @@ Description: ACE scheduling and dispatching library
Package: libkokyu-dev
Architecture: any
Section: libdevel
-Depends: libkokyu-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libkokyu-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Description: ACE scheduling and dispatching library - development files
This package contains the header files and static library for the ACE
scheduling and dispatching library.
-Package: libace-qtreactor-6.1.6
+Package: libace-qtreactor-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -251,12 +251,12 @@ Description: ACE-GUI reactor integration for Qt
Package: libace-qtreactor-dev
Architecture: any
Section: libdevel
-Depends: libace-qtreactor-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), libqt4-dev, ${misc:Depends}
+Depends: libace-qtreactor-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), libqt4-dev, ${misc:Depends}
Description: ACE-GUI reactor integration for Qt - development files
This package contains header files and static library for the ACE-Qt
reactor integration.
-Package: libace-xtreactor-6.1.6
+Package: libace-xtreactor-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -274,12 +274,12 @@ Description: ACE-GUI reactor integration for Xt
Package: libace-xtreactor-dev
Architecture: any
Section: libdevel
-Depends: libace-xtreactor-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libxt-dev (>= 6.1.6), ${misc:Depends}
+Depends: libace-xtreactor-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libxt-dev (>= 6.1.4), ${misc:Depends}
Description: ACE-GUI reactor integration for Xt - development files
This package contains header files and static library for the ACE-Xt
reactor integration.
-Package: libace-tkreactor-6.1.6
+Package: libace-tkreactor-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -298,12 +298,12 @@ Description: ACE-GUI reactor integration for Tk
Package: libace-tkreactor-dev
Architecture: any
Section: libdevel
-Depends: libace-tkreactor-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), tk-dev (>= 8.5), ${misc:Depends}
+Depends: libace-tkreactor-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), tk-dev (>= 8.5), ${misc:Depends}
Description: ACE-GUI reactor integration for Tk - development files
This package contains header files and static library for the ACE-Tk
reactor integration.
-Package: libace-flreactor-6.1.6
+Package: libace-flreactor-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -321,12 +321,12 @@ Description: ACE-GUI reactor integration for Fl
Package: libace-flreactor-dev
Architecture: any
Section: libdevel
-Depends: libace-flreactor-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libfltk1.1-dev (>= 6.1.6), ${misc:Depends}
+Depends: libace-flreactor-6.1.2 (= ${binary:Version}), libace-dev (= ${binary:Version}), libfltk1.1-dev (>= 6.1.4), ${misc:Depends}
Description: ACE-GUI reactor integration for Fl - development files
This package contains header files and static library for the ACE-Fl
reactor integration.
-Package: libace-foxreactor-6.1.6
+Package: libace-foxreactor-6.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -343,12 +343,12 @@ Description: ACE-GUI reactor integration for FOX
Package: libace-foxreactor-dev
Architecture: any
Section: libdevel
-Depends: libace-foxreactor-6.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), libfox-1.6-dev, ${misc:Depends}
+Depends: libace-foxreactor-6.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), libfox-1.6-dev, ${misc:Depends}
Description: ACE-GUI reactor integration for FOX - development files
This package contains header files and static library for the ACE-FOX
reactor integration.
-Package: libtao-2.1.6
+Package: libtao-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -363,7 +363,7 @@ Package: libtao-dev
Architecture: any
Section: libdevel
Replaces: libtao-orbsvcs-dev (<< 5.7.7-4)
-Depends: libtao-2.1.6 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-2.1.4 (= ${binary:Version}), libace-dev (= ${binary:Version}), ${misc:Depends}
Suggests: libtao-doc, libtao-orbsvcs-dev
Description: ACE based CORBA ORB core libraries - development files
This package contains the header files for TAO. Due to the size of
@@ -379,7 +379,7 @@ Description: ACE based CORBA ORB core libraries - documentation
This package contains the TAO overview documentation, tutorials,
examples, and information regarding upstream development.
-Package: libtao-orbsvcs-2.1.6
+Package: libtao-orbsvcs-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -390,14 +390,14 @@ Package: libtao-orbsvcs-dev
Architecture: any
Section: libdevel
Replaces: libtao-dev (<< 5.7.7-4)
-Depends: libtao-orbsvcs-2.1.6 (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-orbsvcs-2.1.4 (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO CORBA services - development files
This package contains the header files for the TAO CORBA services.
.
The examples and some documentation have been included as well, but the
static libraries have been left out due to their size (over 400MB).
-Package: libtao-qtresource-2.1.6
+Package: libtao-qtresource-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -408,12 +408,12 @@ Description: TAO-GUI reactor integration for Qt
Package: libtao-qtresource-dev
Architecture: any
Section: libdevel
-Depends: libtao-qtresource-2.1.6 (= ${binary:Version}), libace-qtreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-qtresource-2.1.4 (= ${binary:Version}), libace-qtreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO-GUI reactor integration for Qt - development files
This package contains header files and static library for the TAO-Qt
reactor integration.
-Package: libtao-xtresource-2.1.6
+Package: libtao-xtresource-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -424,12 +424,12 @@ Description: TAO-GUI reactor integration for Xt
Package: libtao-xtresource-dev
Architecture: any
Section: libdevel
-Depends: libtao-xtresource-2.1.6 (= ${binary:Version}), libace-xtreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-xtresource-2.1.4 (= ${binary:Version}), libace-xtreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO-GUI reactor integration for Xt - development files
This package contains header files and static library for the TAO-Xt
reactor integration.
-Package: libtao-flresource-2.1.6
+Package: libtao-flresource-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -440,12 +440,12 @@ Description: TAO-GUI reactor integration for Fl
Package: libtao-flresource-dev
Architecture: any
Section: libdevel
-Depends: libtao-flresource-2.1.6 (= ${binary:Version}), libace-flreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-flresource-2.1.4 (= ${binary:Version}), libace-flreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO-GUI reactor integration for Fl - development files
This package contains header files and static library for the TAO-Fl
reactor integration.
-Package: libtao-tkresource-2.1.6
+Package: libtao-tkresource-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -456,12 +456,12 @@ Description: TAO-GUI reactor integration for Tk
Package: libtao-tkresource-dev
Architecture: any
Section: libdevel
-Depends: libtao-tkresource-2.1.6 (= ${binary:Version}), libace-tkreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-tkresource-2.1.4 (= ${binary:Version}), libace-tkreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO-GUI reactor integration for Tk - development files
This package contains header files and static library for the TAO-Tk
reactor integration.
-Package: libtao-foxresource-2.1.6
+Package: libtao-foxresource-2.1.4
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -472,14 +472,14 @@ Description: TAO-GUI reactor integration for FOX
Package: libtao-foxresource-dev
Architecture: any
Section: libdevel
-Depends: libtao-foxresource-2.1.6 (= ${binary:Version}), libace-foxreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
+Depends: libtao-foxresource-2.1.4 (= ${binary:Version}), libace-foxreactor-dev (= ${binary:Version}), libtao-dev (= ${binary:Version}), ${misc:Depends}
Description: TAO-GUI reactor integration for FOX - development files
This package contains header files and static library for the TAO-FOX
reactor integration.
Package: tao-idl
Architecture: any
-Depends: g++, libtao-2.1.6 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: g++, libtao-2.1.4 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: TAO IDL to C++ compiler
This package provides an Interface Definition Language (IDL) to C++
compiler.
@@ -489,7 +489,7 @@ Description: TAO IDL to C++ compiler
Package: tao-ifr
Architecture: any
-Depends: g++, libtao-2.1.6 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: g++, libtao-2.1.4 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: TAO interface repository
CORBA-aware programs can contact an interface repository to get
objects' interfaces at run-time. Then they can use the Dynamic
diff --git a/ACE/debian/default.features b/ACE/debian/default.features
index 1af8d4036cf..8651c9baa7a 100644
--- a/ACE/debian/default.features
+++ b/ACE/debian/default.features
@@ -32,3 +32,4 @@ tao_foxresource = 1
zlib = 1
zzip = 1
bzip2 = 1
+lzo1 = 1
diff --git a/ACE/debian/libace-6.1.6.docs b/ACE/debian/libace-6.1.4.docs
index 3bdab5b0089..3bdab5b0089 100644
--- a/ACE/debian/libace-6.1.6.docs
+++ b/ACE/debian/libace-6.1.4.docs
diff --git a/ACE/debian/libace-6.1.6.install b/ACE/debian/libace-6.1.4.install
index d9afda38c12..d9afda38c12 100644
--- a/ACE/debian/libace-6.1.6.install
+++ b/ACE/debian/libace-6.1.4.install
diff --git a/ACE/debian/libace-flreactor-6.1.6.install b/ACE/debian/libace-flreactor-6.1.4.install
index 528836aacee..528836aacee 100644
--- a/ACE/debian/libace-flreactor-6.1.6.install
+++ b/ACE/debian/libace-flreactor-6.1.4.install
diff --git a/ACE/debian/libace-foxreactor-6.1.6.install b/ACE/debian/libace-foxreactor-6.1.4.install
index e360f29f5af..e360f29f5af 100644
--- a/ACE/debian/libace-foxreactor-6.1.6.install
+++ b/ACE/debian/libace-foxreactor-6.1.4.install
diff --git a/ACE/debian/libace-htbp-6.1.6.install b/ACE/debian/libace-htbp-6.1.4.install
index 08103fd5cad..08103fd5cad 100644
--- a/ACE/debian/libace-htbp-6.1.6.install
+++ b/ACE/debian/libace-htbp-6.1.4.install
diff --git a/ACE/debian/libace-inet-6.1.6.install b/ACE/debian/libace-inet-6.1.4.install
index 59a73a509d0..59a73a509d0 100644
--- a/ACE/debian/libace-inet-6.1.6.install
+++ b/ACE/debian/libace-inet-6.1.4.install
diff --git a/ACE/debian/libace-inet-ssl-6.1.6.install b/ACE/debian/libace-inet-ssl-6.1.4.install
index b9b8b9045f7..b9b8b9045f7 100644
--- a/ACE/debian/libace-inet-ssl-6.1.6.install
+++ b/ACE/debian/libace-inet-ssl-6.1.4.install
diff --git a/ACE/debian/libace-qtreactor-6.1.6.install b/ACE/debian/libace-qtreactor-6.1.4.install
index 1d371e1e571..1d371e1e571 100644
--- a/ACE/debian/libace-qtreactor-6.1.6.install
+++ b/ACE/debian/libace-qtreactor-6.1.4.install
diff --git a/ACE/debian/libace-rmcast-6.1.6.install b/ACE/debian/libace-rmcast-6.1.4.install
index 86e78259853..86e78259853 100644
--- a/ACE/debian/libace-rmcast-6.1.6.install
+++ b/ACE/debian/libace-rmcast-6.1.4.install
diff --git a/ACE/debian/libace-ssl-6.1.6.NEWS b/ACE/debian/libace-ssl-6.1.4.NEWS
index e5bd0e4aa10..e5bd0e4aa10 100644
--- a/ACE/debian/libace-ssl-6.1.6.NEWS
+++ b/ACE/debian/libace-ssl-6.1.4.NEWS
diff --git a/ACE/debian/libace-ssl-6.1.6.install b/ACE/debian/libace-ssl-6.1.4.install
index 8df45a6d55f..8df45a6d55f 100644
--- a/ACE/debian/libace-ssl-6.1.6.install
+++ b/ACE/debian/libace-ssl-6.1.4.install
diff --git a/ACE/debian/libace-tkreactor-6.1.6.install b/ACE/debian/libace-tkreactor-6.1.4.install
index 12ab35062d2..12ab35062d2 100644
--- a/ACE/debian/libace-tkreactor-6.1.6.install
+++ b/ACE/debian/libace-tkreactor-6.1.4.install
diff --git a/ACE/debian/libace-tmcast-6.1.6.install b/ACE/debian/libace-tmcast-6.1.4.install
index e066131dea0..e066131dea0 100644
--- a/ACE/debian/libace-tmcast-6.1.6.install
+++ b/ACE/debian/libace-tmcast-6.1.4.install
diff --git a/ACE/debian/libace-xml-utils-6.1.6.install b/ACE/debian/libace-xml-utils-6.1.6.install
deleted file mode 100644
index 2428ec9f109..00000000000
--- a/ACE/debian/libace-xml-utils-6.1.6.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/libACE_XML_Utils-*.so
diff --git a/ACE/debian/libace-xml-utils-dev.install b/ACE/debian/libace-xml-utils-dev.install
deleted file mode 100644
index b1539d17224..00000000000
--- a/ACE/debian/libace-xml-utils-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/libACE_XML_Utils.so
-usr/include/ace/XML_Utils/*
-usr/lib/pkgconfig/ACE_XML_Utils.pc
diff --git a/ACE/debian/libace-xtreactor-6.1.6.install b/ACE/debian/libace-xtreactor-6.1.4.install
index c53614c7208..c53614c7208 100644
--- a/ACE/debian/libace-xtreactor-6.1.6.install
+++ b/ACE/debian/libace-xtreactor-6.1.4.install
diff --git a/ACE/debian/libacexml-6.1.6.docs b/ACE/debian/libacexml-6.1.4.docs
index 002855d7915..002855d7915 100644
--- a/ACE/debian/libacexml-6.1.6.docs
+++ b/ACE/debian/libacexml-6.1.4.docs
diff --git a/ACE/debian/libacexml-6.1.6.install b/ACE/debian/libacexml-6.1.4.install
index d3e912ffa51..d3e912ffa51 100644
--- a/ACE/debian/libacexml-6.1.6.install
+++ b/ACE/debian/libacexml-6.1.4.install
diff --git a/ACE/debian/libkokyu-6.1.6.docs b/ACE/debian/libkokyu-6.1.4.docs
index e8869c513b2..e8869c513b2 100644
--- a/ACE/debian/libkokyu-6.1.6.docs
+++ b/ACE/debian/libkokyu-6.1.4.docs
diff --git a/ACE/debian/libkokyu-6.1.6.install b/ACE/debian/libkokyu-6.1.4.install
index 62854308f96..62854308f96 100644
--- a/ACE/debian/libkokyu-6.1.6.install
+++ b/ACE/debian/libkokyu-6.1.4.install
diff --git a/ACE/debian/libnetsvcs-6.1.6.docs b/ACE/debian/libnetsvcs-6.1.2.docs
index 0b03c55b91f..0b03c55b91f 100644
--- a/ACE/debian/libnetsvcs-6.1.6.docs
+++ b/ACE/debian/libnetsvcs-6.1.2.docs
diff --git a/ACE/debian/libnetsvcs-6.1.6.install b/ACE/debian/libnetsvcs-6.1.2.install
index c7a04b16213..c7a04b16213 100644
--- a/ACE/debian/libnetsvcs-6.1.6.install
+++ b/ACE/debian/libnetsvcs-6.1.2.install
diff --git a/ACE/debian/libtao-2.1.4.docs b/ACE/debian/libtao-2.1.4.docs
new file mode 100644
index 00000000000..6ed40bf21ea
--- /dev/null
+++ b/ACE/debian/libtao-2.1.4.docs
@@ -0,0 +1,4 @@
+TAO/README
+TAO/VERSION
+TAO/PROBLEM-REPORT-FORM
+TAO/NEWS
diff --git a/ACE/debian/libtao-2.1.6.install b/ACE/debian/libtao-2.1.4.install
index a80041c6986..65d040bd469 100644
--- a/ACE/debian/libtao-2.1.6.install
+++ b/ACE/debian/libtao-2.1.4.install
@@ -10,7 +10,6 @@ usr/lib/libTAO_DynamicAny-*.so
usr/lib/libTAO_DynamicInterface-*.so
usr/lib/libTAO_EndpointPolicy-*.so
usr/lib/libTAO_IFR_Client-*.so
-usr/lib/libTAO_IFR_Client_skel-*.so
usr/lib/libTAO_IORInterceptor-*.so
usr/lib/libTAO_IORManip-*.so
usr/lib/libTAO_IORTable-*.so
@@ -33,6 +32,7 @@ usr/lib/libTAO_ImR_Client-*.so
usr/lib/libTAO_DiffServPolicy-*.so
usr/lib/libTAO_ZlibCompressor-*.so
usr/lib/libTAO_Bzip2Compressor-*.so
+usr/lib/libTAO_LzoCompressor-*.so
usr/lib/libTAO_IFR_BE-*.so
usr/lib/libTAO_IDL_FE-*.so
usr/lib/libTAO_IDL_BE-*.so
diff --git a/ACE/debian/libtao-2.1.6.docs b/ACE/debian/libtao-2.1.6.docs
deleted file mode 100644
index 803353aba72..00000000000
--- a/ACE/debian/libtao-2.1.6.docs
+++ /dev/null
@@ -1,4 +0,0 @@
-README
-VERSION
-PROBLEM-REPORT-FORM
-NEWS
diff --git a/ACE/debian/libtao-dev.docs b/ACE/debian/libtao-dev.docs
index 25184a4bb03..1e1354684a1 100644
--- a/ACE/debian/libtao-dev.docs
+++ b/ACE/debian/libtao-dev.docs
@@ -1,3 +1,3 @@
-README
-VERSION
-PROBLEM-REPORT-FORM
+TAO/README
+TAO/VERSION
+TAO/PROBLEM-REPORT-FORM
diff --git a/ACE/debian/libtao-dev.install b/ACE/debian/libtao-dev.install
index 7b09d87f5cd..2ec4f80d1dc 100644
--- a/ACE/debian/libtao-dev.install
+++ b/ACE/debian/libtao-dev.install
@@ -25,7 +25,6 @@ usr/include/tao/EndpointPolicy
usr/lib/libTAO_EndpointPolicy.so
usr/include/tao/IFR_Client
usr/lib/libTAO_IFR_Client.so
-usr/lib/libTAO_IFR_Client_skel.so
usr/include/tao/ImR_Client
usr/lib/libTAO_ImR_Client.so
usr/include/tao/IORInterceptor
@@ -69,11 +68,12 @@ usr/include/tao/ZIOP
usr/lib/libTAO_ZIOP.so
usr/lib/libTAO_ZlibCompressor.so
usr/lib/libTAO_Bzip2Compressor.so
+usr/lib/libTAO_LzoCompressor.so
usr/include/tao/ETCL
usr/lib/libTAO_ETCL.so
usr/include/tao/Monitor
usr/lib/libTAO_Monitor.so
-usr/share/tao/MPC/config usr/lib/ace/TAO/MPC
+../../TAO/MPC/config usr/lib/ace/TAO/MPC
../../TAO/rules.tao.GNU usr/lib/ace/TAO
usr/lib/libTAO_IFR_BE.so
usr/lib/libTAO_IDL_FE.so
@@ -83,6 +83,7 @@ usr/lib/pkgconfig/TAO_DynamicInterface.pc
usr/lib/pkgconfig/TAO_ZlibCompressor.pc
usr/lib/pkgconfig/TAO_AnyTypeCode.pc
usr/lib/pkgconfig/TAO_Bzip2Compressor.pc
+usr/lib/pkgconfig/TAO_LzoCompressor.pc
usr/lib/pkgconfig/TAO_Valuetype.pc
usr/lib/pkgconfig/TAO_BiDirGIOP.pc
usr/lib/pkgconfig/TAO_IORInterceptor.pc
diff --git a/ACE/debian/libtao-doc.docs b/ACE/debian/libtao-doc.docs
index 23de2f58b00..8f1da4a785d 100644
--- a/ACE/debian/libtao-doc.docs
+++ b/ACE/debian/libtao-doc.docs
@@ -1,2 +1,2 @@
-docs
+TAO/docs
html/libtao-doc/*
diff --git a/ACE/debian/libtao-flresource-2.1.6.install b/ACE/debian/libtao-flresource-2.1.4.install
index 5d4ee6ce57a..5d4ee6ce57a 100644
--- a/ACE/debian/libtao-flresource-2.1.6.install
+++ b/ACE/debian/libtao-flresource-2.1.4.install
diff --git a/ACE/debian/libtao-foxresource-2.1.6.install b/ACE/debian/libtao-foxresource-2.1.4.install
index 6ceb47601aa..6ceb47601aa 100644
--- a/ACE/debian/libtao-foxresource-2.1.6.install
+++ b/ACE/debian/libtao-foxresource-2.1.4.install
diff --git a/ACE/debian/libtao-orbsvcs-2.1.6.NEWS b/ACE/debian/libtao-orbsvcs-2.1.4.NEWS
index ea0759e0ade..ea0759e0ade 100644
--- a/ACE/debian/libtao-orbsvcs-2.1.6.NEWS
+++ b/ACE/debian/libtao-orbsvcs-2.1.4.NEWS
diff --git a/ACE/debian/libtao-orbsvcs-2.1.6.install b/ACE/debian/libtao-orbsvcs-2.1.4.install
index e0e491e9095..e0e491e9095 100644
--- a/ACE/debian/libtao-orbsvcs-2.1.6.install
+++ b/ACE/debian/libtao-orbsvcs-2.1.4.install
diff --git a/ACE/debian/libtao-qtresource-2.1.6.install b/ACE/debian/libtao-qtresource-2.1.4.install
index 172f4c45db8..172f4c45db8 100644
--- a/ACE/debian/libtao-qtresource-2.1.6.install
+++ b/ACE/debian/libtao-qtresource-2.1.4.install
diff --git a/ACE/debian/libtao-tkresource-2.1.6.install b/ACE/debian/libtao-tkresource-2.1.4.install
index 7f543154b5b..7f543154b5b 100644
--- a/ACE/debian/libtao-tkresource-2.1.6.install
+++ b/ACE/debian/libtao-tkresource-2.1.4.install
diff --git a/ACE/debian/libtao-xtresource-2.1.6.install b/ACE/debian/libtao-xtresource-2.1.4.install
index ab5151ed073..ab5151ed073 100644
--- a/ACE/debian/libtao-xtresource-2.1.6.install
+++ b/ACE/debian/libtao-xtresource-2.1.4.install
diff --git a/ACE/debian/mwc_workspace.txt b/ACE/debian/mwc_workspace.txt
deleted file mode 100644
index 4e0716c86d4..00000000000
--- a/ACE/debian/mwc_workspace.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-// -*- MPC -*-
-// $Id$
-
-workspace {
- $(ACE_ROOT)/ace
- $(ACE_ROOT)/apps/gperf/src
- $(ACE_ROOT)/ACEXML/common
- $(ACE_ROOT)/ACEXML/parser/parser
- $(ACE_ROOT)/ACEXML/apps/svcconf
- $(ACE_ROOT)/Kokyu/Kokyu.mpc
- $(ACE_ROOT)/protocols
- $(ACE_ROOT)/netsvcs/lib
- $(ACE_ROOT)/netsvcs/servers
- tao
- TAO_IDL
- utils
- orbsvcs
- exclude {
- $(ACE_ROOT)/protocols/tests
- $(ACE_ROOT)/protocols/examples
- orbsvcs/tests
- orbsvcs/performance-tests
- orbsvcs/examples
- orbsvcs/DevGuideExamples
- }
-}
diff --git a/ACE/debian/patches/15-fix-lzo-flags.diff b/ACE/debian/patches/15-fix-lzo-flags.diff
new file mode 100644
index 00000000000..59d14458bc6
--- /dev/null
+++ b/ACE/debian/patches/15-fix-lzo-flags.diff
@@ -0,0 +1,22 @@
+Description: hardcode LZO headers location
+ Use LZO2 instead of LZO, and replace variable with Debian path
+Forwarded: not-needed
+Author: Thomas Girard <thomas.g.girard@free.fr>
+Last-Update: 2011-02-13
+
+--- a/MPC/config/lzo1.mpb
++++ b/MPC/config/lzo1.mpb
+@@ -8,11 +8,11 @@ feature(lzo1) {
+ LZO1_INCDIR
+ $(LZO1_ROOT)/include
+ }
+- includes += $(LZO1_INCDIR)
++ includes += /usr/include/lzo
+ libpaths += $(LZO1_ROOT)/lib
+ specific (prop:microsoft) {
+ lit_libs += liblzo
+ } else {
+- lit_libs += lzo
++ lit_libs += lzo2
+ }
+ }
diff --git a/ACE/debian/patches/20-versioned_libs.diff b/ACE/debian/patches/20-versioned_libs.diff
new file mode 100644
index 00000000000..bbb934a2688
--- /dev/null
+++ b/ACE/debian/patches/20-versioned_libs.diff
@@ -0,0 +1,137 @@
+Description: Change versioning from libACE.so.x.y.z to libACE-x.y.z.so
+ ACE+TAO library names (and SONAMEs) default to libfoo.so.x.y.z. Since no
+ ABI/API is guaranteed between ACE+TAO versions, this patch implements
+ recommended (e.g. libtool) naming in these cases, i.e. libfoo-x.y.z.so.
+Forwarded: submitted, more work needed before acceptance
+Author: Thomas Girard <thomas.g.girard@free.fr>
+Last-Update: 2010-12-26
+
+--- pkg-ace.orig/include/makeinclude/wrapper_macros.GNU
++++ pkg-ace/include/makeinclude/wrapper_macros.GNU
+@@ -78,7 +78,10 @@
+ # If versioned_so is 1 (enabled), the SOVERSION make
+ # variable can also be set to specify the version info
+ # to append to the name - it should have a leading '.' -
+-# else it defaults to .ACE_MAJOR.ACE_MINOR.ACE_BETA.
++# else it defaults to .ACE_MAJOR.ACE_MINOR.ACE_BETA. If 2,
++# the version will be appended to the name but *before* the
++# $(SOEXT) - it should have a lead '-' - else it defaults to
++# -ACE_MAJOR.ACE_MINOR.ACE_BETA.
+ # wfmo Build with wfmo support (Win32 only)
+ # winregistry Build with windows registry support (Win32 only)
+ # winnt Build WinNT-specific projects (Win32 only)
+--- pkg-ace.orig/MPC/prj_install.pl
++++ pkg-ace/MPC/prj_install.pl
+@@ -186,7 +186,7 @@
+ my $fh = new FileHandle();
+ if (opendir($fh, $odir)) {
+ foreach my $file (grep(!/^\.\.?$/, readdir($fh))) {
+- if ($file =~ /^lib$name\.(a|so|sl|dylib)/ ||
++ if ($file =~ /^lib$name(-[0-9]+(\.[0-9]+)*)?\.(a|so|sl|dylib)/ ||
+ $file =~ /^(lib)?$name.*\.(dll|lib)$/i) {
+ push(@libs, "$dir$insdir$binarydir$file");
+ }
+--- pkg-ace.orig/include/makeinclude/platform_g++_common.GNU
++++ pkg-ace/include/makeinclude/platform_g++_common.GNU
+@@ -102,7 +102,7 @@
+ # If the platform file didn't already set versioned_so, default to 1.
+ versioned_so ?= 1
+ with_ld ?=
+-ifeq ($(versioned_so),1)
++ifneq ($(versioned_so),0)
+ ifeq ($(with_ld),hpux)
+ SOFLAGS += -Wl,+h -Wl,$(SONAME)
+ else
+--- pkg-ace.orig/include/makeinclude/rules.lib.GNU
++++ pkg-ace/include/makeinclude/rules.lib.GNU
+@@ -11,7 +11,7 @@
+ # Library versioning
+ #---------------------------------------------------------------------------
+
+-ifeq ($(versioned_so),1)
++ifneq ($(versioned_so),0)
+ # Turn on symbol versioning. The scheme that we follow is to allow
+ # applications dependent on libraries, with same version numbers (major,
+ # minor and beta) to run, but applications with dependencies on libraries
+@@ -20,13 +20,23 @@
+ # Version number of the libraries
+ #
+ ifeq ($(SOVERSION),)
+- SOVERSION = .$(GNUACE_PROJECT_VERSION)
++ ifeq ($(versioned_so),1)
++ SOVERSION = .$(GNUACE_PROJECT_VERSION)
++ else ifeq ($(versioned_so),2)
++ SOVERSION = -$(GNUACE_PROJECT_VERSION)
++ else
++ $(error unknown value for versioned_so: $(versioned_so))
++ endif
+ endif # SOVERSION
+
+ # Name that will be written into the dynamic library
+ #
+ ifeq ($(SONAME),)
+- SONAME = $(SHLIB)$(SOVERSION)
++ ifeq ($(versioned_so),1)
++ SONAME = $(SHLIB)$(SOVERSION)
++ else ifeq ($(versioned_so),2)
++ SONAME = $(patsubst %.$(SOEXT),%,$(SHLIB))$(SOVERSION).$(SOEXT)
++ endif
+ endif # SONAME
+ endif # versioned_so
+
+@@ -47,9 +57,15 @@
+ # Setup shared library variables, including versions.
+ VSHLIB_NO_VER = $(ARCH_SHLIB:%.$(SOEXT)=%$(VAR).$(SOEXT))
+ CLEANUP_VSHLIB_NO_VER = $(CLEANUP_SHLIB:%.$(SOEXT)=%$(VAR).$(SOEXT))
+-VSHLIB = $(VSHLIB_NO_VER:%=%$(SOVERSION))
+-CLEANUP_VSHLIB = $(CLEANUP_VSHLIB_NO_VER:%=%$(SOVERSION))
+-SHLIB_WITH_VER = $(SHLIB:%=%$(SOVERSION))
++ifneq ($(versioned_so),2)
++ VSHLIB = $(VSHLIB_NO_VER:%=%$(SOVERSION))
++ CLEANUP_VSHLIB = $(CLEANUP_VSHLIB_NO_VER:%=%$(SOVERSION))
++ SHLIB_WITH_VER = $(SHLIB:%=%$(SOVERSION))
++else
++ VSHLIB = $(patsubst %.$(SOEXT),%,$(VSHLIB_NO_VER))$(SOVERSION).$(SOEXT)
++ CLEANUP_VSHLIB = $(patsubst %.$(SOEXT),%,$(CLEANUP_VSHLIB_NO_VER))$(SOVERSION).$(SOEXT)
++ SHLIB_WITH_VER = $(patsubst %.$(SOEXT),%,$(SHLIB))$(SOVERSION).$(SOEXT)
++endif
+
+ SHLIBA ?=
+ VSHLIBA = $(ARCH_SHLIBA:%.$(LIBEXT)=%$(VAR).$(LIBEXT))
+--- pkg-ace.orig/include/makeinclude/rules.local.GNU
++++ pkg-ace/include/makeinclude/rules.local.GNU
+@@ -312,13 +312,23 @@
+ fi
+ else #firstword of LN_S is not cp, so we're using real symlinks
+ ifneq ($(SOVERSION),)
+- @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
++ ifneq ($(versioned_so),2)
++ @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
+ if test ! -s $@ ; then \
+ $(RM) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
+ echo $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
+ $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
+ fi ; \
+- fi
++ fi
++ else
++ @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
++ if test ! -s $@ ; then \
++ $(RM) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
++ echo $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
++ $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
++ fi ; \
++ fi
++ endif #versioned_so
+ endif #SOVERSION
+ @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
+ if test ! -s $@ ; then \
+@@ -351,6 +361,8 @@
+ -$(RM) $(SHLIB_UNCHECKED)
+ ifeq ($(versioned_so),1)
+ -$(RM) $(SHLIB_UNCHECKED)$(SOVERSION)
++else ifeq ($(versioned_so),2)
++ -$(RM) $(SHLIB_UNCHECKED:.$(SOEXT)=$(SOVERSION).$(SOEXT))
+ endif
+ endif
+
diff --git a/ACE/debian/patches/34-bts386713.diff b/ACE/debian/patches/34-bts386713.diff
new file mode 100644
index 00000000000..5e75c7272ae
--- /dev/null
+++ b/ACE/debian/patches/34-bts386713.diff
@@ -0,0 +1,389 @@
+Description: Hardcode TAO library names so that dynamic loading works
+ ACE allows to dynamically load a library with ACE_DYNAMIC_SERVICE_DIRECTIVE
+ macro, and this mechanism is used to load some TAO libraries when needed. The
+ name used in macro invocations is the short library name, i.e. libfoo.so.
+ .
+ Debian usually ships libfoo.so symlinks in -dev packages. So to make the
+ dynamic loading work without the need for the -dev package being installed,
+ we use long names (libfoo-x.y.z.so) in the macro invocation.
+Forwarded: not-needed
+Author: Pau Garcia i Quiles <pgquiles@elpauer.org>
+Last-Update: 2011-06-26
+
+--- pkg-ace.orig/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
++++ pkg-ace/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
+@@ -10,7 +10,7 @@
+
+ static const char pg_poa_factory_name[] = "TAO_GOA";
+ static const ACE_TCHAR pg_poa_factory_directive[] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+- "TAO_GOA", "TAO_PortableGroup", "_make_TAO_PG_Object_Adapter_Factory", "");
++ "TAO_GOA", "libTAO_PortableGroup-2.1.2.so", "_make_TAO_PG_Object_Adapter_Factory", "");
+
+ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+--- pkg-ace.orig/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp
+@@ -18,7 +18,7 @@
+
+ ACE_TCHAR const * const scpc_loadNamingService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNamingService",
+- "TAO_CosNaming_Serv",
++ "libTAO_CosNaming_Serv-2.1.2.so",
+ "_make_TAO_Naming_Loader",
+ ""
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp
+@@ -20,7 +20,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_CosNotification_Serv",
++ "libTAO_CosNotification_Serv-2.1.2.so",
+ "_make_TAO_CosNotify_Service",
+ ""
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp
+@@ -23,7 +23,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_CosNotification_Serv",
++ "libTAO_CosNotification_Serv-2.1.2.so",
+ "_make_TAO_CosNotify_Service",
+ "-UseSeparateDispatchingORB 1"
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp
+@@ -20,7 +20,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_Notify_Service",
++ "libTAO_Notify_Service-2.1.2.so",
+ "_make_TAO_Notify_Service_Driver",
+ "-NoNameSvc -RunThreads 0"
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp
+@@ -23,7 +23,7 @@
+
+ ACE_TCHAR scpc_loadNotifyService[max_length] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_Notify_Service",
++ "libTAO_Notify_Service-2.1.2.so",
+ "_make_TAO_Notify_Service_Driver",
+ "-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 0 -ORBInitRef NameService=iioploc://%s:%s/NameService -IORoutput %s"
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp
+@@ -20,7 +20,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_Notify_Service",
++ "libTAO_Notify_Service-2.1.2.so",
+ "_make_TAO_Notify_Service_Driver",
+ "-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 10 -ORBInitRef NameService=file://naming.ior -IORoutput notify.ior"
+ );
+@@ -29,7 +29,7 @@
+
+ ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNamingService",
+- "TAO_CosNaming_Serv",
++ "libTAO_CosNaming_Serv-2.1.2.so",
+ "_make_TAO_Naming_Loader",
+ "testNameService testNameService -ORBId testDllOrb -m 0 -o naming.ior"
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp
+@@ -20,7 +20,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_Notify_Service",
++ "libTAO_Notify_Service-2.1.2.so",
+ "_make_TAO_Notify_Service_Driver_INCORRECT",
+ "-NoNameSvc -RunThreads 0"
+ );
+--- pkg-ace.orig/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp
++++ pkg-ace/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp
+@@ -24,7 +24,7 @@
+
+ ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNamingService",
+- "TAO_CosNaming_Serv",
++ "libTAO_CosNaming_Serv-2.1.2.so",
+ "_make_TAO_Naming_Loader",
+ "testNameService testNameService -ORBId testDllOrb -m 0 -o naming.ior"
+ );
+@@ -34,7 +34,7 @@
+
+ ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "testNotifyService",
+- "TAO_Notify_Service",
++ "libTAO_Notify_Service-2.1.2.so",
+ "_make_TAO_Notify_Service_Driver",
+ "-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 1 -ORBInitRef NameService=file://naming.ior -IORoutput notify.ior"
+ );
+--- pkg-ace.orig/TAO/tao/Codeset/Codeset_Manager_i.cpp
++++ pkg-ace/TAO/tao/Codeset/Codeset_Manager_i.cpp
+@@ -353,7 +353,7 @@
+ if (fact == 0)
+ ACE_Service_Config::process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE ("UTF8_Latin1_Factory",
+- "TAO_Codeset",
++ "libTAO_Codeset-2.1.2.so",
+ "_make_TAO_UTF8_Latin1_Factory",
+ ""));
+ else
+@@ -370,7 +370,7 @@
+ if (fact == 0)
+ ACE_Service_Config::process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE ("UTF16_BOM_Factory",
+- "TAO_Codeset",
++ "libTAO_Codeset-2.1.2.so",
+ "_make_TAO_UTF16_BOM_Factory",
+ ""));
+ else
+--- pkg-ace.orig/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
++++ pkg-ace/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
+@@ -10,7 +10,7 @@
+ static const ACE_TCHAR csd_poa_factory_directive[] =
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "TAO_CSD_Object_Adapter_Factory",
+- "TAO_CSD_Framework",
++ "libTAO_CSD_Framework-2.1.2.so",
+ "_make_TAO_CSD_Object_Adapter_Factory",
+ "");
+
+--- pkg-ace.orig/TAO/tao/ORB_Core.cpp
++++ pkg-ace/TAO/tao/ORB_Core.cpp
+@@ -1660,7 +1660,7 @@
+ {
+ this->configuration ()->process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("PolicyFactory_Loader",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_TAO_PolicyFactory_Loader",
+ ""));
+ loader =
+@@ -1712,7 +1712,7 @@
+ {
+ this->configuration ()->process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE ("ORBInitializer_Registry",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_ORBInitializer_Registry",
+ ""));
+ this->orbinitializer_registry_ =
+@@ -2467,7 +2467,7 @@
+ {
+ this->configuration ()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TypeCodeFactory",
+- "TAO_TypeCodeFactory",
++ "libTAO_TypeCodeFactory-2.1.2.so",
+ "_make_TAO_TypeCodeFactory_Loader",
+ ""));
+ loader =
+@@ -2500,7 +2500,7 @@
+ {
+ this->configuration()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
+- "TAO_CodecFactory",
++ "libTAO_CodecFactory-2.1.2.so",
+ "_make_TAO_CodecFactory_Loader",
+ ""));
+ loader =
+@@ -2527,7 +2527,7 @@
+ {
+ this->configuration()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("Compression",
+- "TAO_Compression",
++ "libTAO_Compression-2.1.2.so",
+ "_make_TAO_Compression_Loader",
+ ""));
+ loader =
+@@ -2553,7 +2553,7 @@
+ {
+ this->configuration()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_POA_Current_Factory",
+- "TAO_PortableServer",
++ "libTAO_PortableServer-2.1.2.so",
+ "_make_TAO_POA_Current_Factory",
+ ""));
+ loader =
+@@ -2582,7 +2582,7 @@
+ {
+ this->configuration ()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("PICurrent_Loader",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_TAO_PICurrent_Loader",
+ ""));
+ loader =
+@@ -2613,7 +2613,7 @@
+ {
+ this->configuration ()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("DynamicAny_Loader",
+- "TAO_DynamicAny",
++ "libTAO_DynamicAny-2.1.2.so",
+ "_make_TAO_DynamicAny_Loader",
+ ""));
+ loader =
+@@ -2640,7 +2640,7 @@
+ {
+ this->configuration()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("IORManip_Loader",
+- "TAO_IORManip",
++ "libTAO_IORManip-2.1.2.so",
+ "_make_TAO_IORManip_Loader",
+ ""));
+ loader =
+@@ -2666,7 +2666,7 @@
+ {
+ this->configuration ()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_IORTable",
+- "TAO_IORTable",
++ "libTAO_IORTable-2.1.2.so",
+ "_make_TAO_Table_Adapter_Factory",
+ ""));
+ factory =
+@@ -2701,7 +2701,7 @@
+ {
+ this->configuration ()->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("Monitor_Init",
+- "TAO_Monitor",
++ "libTAO_Monitor-2.1.2.so",
+ "_make_TAO_Monitor_Init",
+ ""));
+ loader =
+--- pkg-ace.orig/TAO/tao/ORBInitializer_Registry.cpp
++++ pkg-ace/TAO/tao/ORBInitializer_Registry.cpp
+@@ -48,7 +48,7 @@
+ {
+ ACE_Service_Config::process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("ORBInitializer_Registry",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_ORBInitializer_Registry",
+ ""));
+ orbinitializer_registry_ =
+--- pkg-ace.orig/TAO/tao/params.cpp
++++ pkg-ace/TAO/tao/params.cpp
+@@ -55,7 +55,7 @@
+ , poa_factory_name_ ("TAO_Object_Adapter_Factory")
+ , poa_factory_directive_
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Object_Adapter_Factory",
+- "TAO_PortableServer",
++ "libTAO_PortableServer-2.1.2.so",
+ "_make_TAO_Object_Adapter_Factory",
+ ""))
+ , forward_invocation_on_object_not_exist_ (false)
+--- pkg-ace.orig/TAO/tao/PI/ORBInitInfo.cpp
++++ pkg-ace/TAO/tao/PI/ORBInitInfo.cpp
+@@ -117,7 +117,7 @@
+ {
+ ACE_Service_Config::process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
+- "TAO_CodecFactory",
++ "libTAO_CodecFactory-2.1.2.so",
+ "_make_TAO_CodecFactory_Loader",
+ ""));
+ loader =
+--- pkg-ace.orig/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp
++++ pkg-ace/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp
+@@ -79,7 +79,7 @@
+ {
+ ACE_Service_Config::process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+- "ImR_Client_Adapter", "TAO_ImR_Client",
++ "ImR_Client_Adapter", "libTAO_ImR_Client-2.1.2.so",
+ "_make_ImR_Client_Adapter_Impl", ""));
+
+ adapter =
+--- pkg-ace.orig/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
++++ pkg-ace/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
+@@ -38,7 +38,7 @@
+ static const ACE_TCHAR rt_poa_factory_directive[] =
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "TAO_RT_Object_Adapter_Factory",
+- "TAO_RTPortableServer",
++ "libTAO_RTPortableServer-2.1.2.so",
+ "_make_TAO_RT_Object_Adapter_Factory",
+ "");
+
+--- pkg-ace.orig/TAO/tao/TAO_Internal.cpp
++++ pkg-ace/TAO/tao/TAO_Internal.cpp
+@@ -614,7 +614,7 @@
+ ACE_Service_Config::process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE (
+ "TAO_Codeset",
+- "TAO_Codeset",
++ "libTAO_Codeset-2.1.2.so",
+ "_make_TAO_Codeset_Manager_Factory",
+ ""));
+
+--- pkg-ace.orig/TAO/tests/DLL_ORB/client.cpp
++++ pkg-ace/TAO/tests/DLL_ORB/client.cpp
+@@ -30,7 +30,7 @@
+ if (ACE_Service_Config::process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "Client_Module",
+- "Test_Client_Module",
++ "libTest_Client_Module-2.1.2.so",
+ "_make_Test_Client_Module",
+ "-k file://test.ior")) != 0)
+ {
+--- pkg-ace.orig/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
++++ pkg-ace/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
+@@ -13,7 +13,7 @@
+ // each parameter CANNOT be split into multiple quoted strings "line1" "nextline" with the expectation that
+ // they will be join together. Hence the long parameter 4.
+ ACE_DYNAMIC_SERVICE_DIRECTIVE ("testDllOrb",
+- "DllOrb",
++ "DllOrb.so",
+ "_make_DllOrb",
+ "DllOrb -t 1 -ORBGestalt Local -ORBDebugLevel 3 -ORBId testORB -ORBInitRef NameService=file:///tmp/test-ns.ior -ORBDottedDecimalAddresses 1"
+ );
+--- pkg-ace.orig/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp
++++ pkg-ace/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp
+@@ -153,7 +153,7 @@
+ {
+ one->process_directive (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("ORBInitializer_Registry",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_ORBInitializer_Registry",
+ ""));
+ oir =
+@@ -252,7 +252,7 @@
+
+ one->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("PolicyFactory_Loader",
+- "TAO_PI",
++ "libTAO_PI-2.1.2.so",
+ "_make_TAO_PolicyFactory_Loader",
+ ""));
+
+@@ -292,7 +292,7 @@
+
+ int result = one->process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Codeset",
+- "TAO_Codeset",
++ "libTAO_Codeset-2.1.2.so",
+ "_make_TAO_Codeset_Manager_Factory",
+ ""));
+ if (result != 0)
+--- pkg-ace.orig/TAO/tests/TransportCurrent/Framework/simple.cpp
++++ pkg-ace/TAO/tests/TransportCurrent/Framework/simple.cpp
+@@ -56,7 +56,7 @@
+ #if !defined (TAO_AS_STATIC_LIBS)
+ int ret = ACE_Service_Config::process_directive
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Transport_Current_Loader",
+- "TAO_Transport_Current",
++ "libTAO_Transport_Current-2.1.2.so",
+ "_make_TAO_Transport_Current_Loader",
+ ""));
+ ACE_ASSERT (ret == 0);
diff --git a/ACE/debian/patches/35_disable_sslv2.diff b/ACE/debian/patches/35_disable_sslv2.diff
new file mode 100644
index 00000000000..efa0461cc6c
--- /dev/null
+++ b/ACE/debian/patches/35_disable_sslv2.diff
@@ -0,0 +1,114 @@
+Description: SSLv2 was disabled in Debian in OpenSSL 1.0.0d, remove it from ACE too
+Forwarded: yes
+Author: Pau Garcia i Quiles <pgquiles@elpauer.org>
+Last-Update: 2011-04-26
+
+--- a/ace/SSL/SSL_Context.cpp
++++ b/ace/SSL/SSL_Context.cpp
+@@ -236,15 +236,6 @@ ACE_SSL_Context::set_mode (int mode)
+
+ switch (mode)
+ {
+- case ACE_SSL_Context::SSLv2_client:
+- method = ::SSLv2_client_method ();
+- break;
+- case ACE_SSL_Context::SSLv2_server:
+- method = ::SSLv2_server_method ();
+- break;
+- case ACE_SSL_Context::SSLv2:
+- method = ::SSLv2_method ();
+- break;
+ case ACE_SSL_Context::SSLv3_client:
+ method = ::SSLv3_client_method ();
+ break;
+@@ -254,15 +245,6 @@ ACE_SSL_Context::set_mode (int mode)
+ case ACE_SSL_Context::SSLv3:
+ method = ::SSLv3_method ();
+ break;
+- case ACE_SSL_Context::SSLv23_client:
+- method = ::SSLv23_client_method ();
+- break;
+- case ACE_SSL_Context::SSLv23_server:
+- method = ::SSLv23_server_method ();
+- break;
+- case ACE_SSL_Context::SSLv23:
+- method = ::SSLv23_method ();
+- break;
+ case ACE_SSL_Context::TLSv1_client:
+ method = ::TLSv1_client_method ();
+ break;
+@@ -335,14 +317,10 @@ ACE_SSL_Context::load_trusted_ca (const
+
+ // For TLS/SSL servers scan all certificates in ca_file and ca_dir and
+ // list them as acceptable CAs when requesting a client certificate.
+- if (mode_ == SSLv23
+- || mode_ == SSLv23_server
+- || mode_ == TLSv1
++ if (mode_ == TLSv1
+ || mode_ == TLSv1_server
+ || mode_ == SSLv3
+- || mode_ == SSLv3_server
+- || mode_ == SSLv2
+- || mode_ == SSLv2_server)
++ || mode_ == SSLv3_server)
+ {
+ // Note: The STACK_OF(X509_NAME) pointer is a copy of the pointer in
+ // the CTX; any changes to it by way of these function calls will
+--- a/ace/SSL/SSL_Context.h
++++ b/ace/SSL/SSL_Context.h
+@@ -82,16 +82,16 @@ public:
+
+ enum {
+ INVALID_METHOD = -1,
+- SSLv2_client = 1,
++/* SSLv2_client = 1,
+ SSLv2_server,
+- SSLv2,
+- SSLv3_client,
++ SSLv2, */
++ SSLv3_client = 4,
+ SSLv3_server,
+ SSLv3,
+- SSLv23_client,
++/* SSLv23_client,
+ SSLv23_server,
+- SSLv23,
+- TLSv1_client,
++ SSLv23, */
++ TLSv1_client = 10,
+ TLSv1_server,
+ TLSv1
+ };
+@@ -114,7 +114,7 @@ public:
+ * If the mode is not set, then the class automatically initializes
+ * itself to the default mode.
+ */
+- int set_mode (int mode = ACE_SSL_Context::SSLv23);
++ int set_mode (int mode = ACE_SSL_Context::SSLv3);
+
+ int get_mode (void) const;
+
+--- a/protocols/ace/INet/HTTP_Simple_exec.cpp
++++ b/protocols/ace/INet/HTTP_Simple_exec.cpp
+@@ -35,7 +35,7 @@ usage (void)
+ std::cout << "\t-p <port> \t\tproxy port to connect to\n";
+ std::cout << "\t-o <filename> \t\tfile to write output to\n";
+ #if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1
+- std::cout << "\t-v <ssl version>\t\tSSL version to use: 2, 23, 3\n";
++ std::cout << "\t-v <ssl version>\t\tSSL version to use: '3' for SSLv3 or '1' for TLS 1.0\n";
+ std::cout << "\t-n \t\tno peer certificate verification\n";
+ std::cout << "\t-i \t\tignore peer certificate verification failures\n";
+ std::cout << "\t-c <filename> \t\tcertificate file (PEM format)\n";
+@@ -78,10 +78,8 @@ parse_args (int argc, ACE_TCHAR *argv []
+ case 'v':
+ {
+ ACE_CString ver = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ());
+- if (ver == "2")
+- ssl_mode = ACE_SSL_Context::SSLv2;
+- else if (ver == "23")
+- ssl_mode = ACE_SSL_Context::SSLv23;
++ if (ver == "1")
++ ssl_mode = ACE_SSL_Context::TLSv1;
+ else if (ver != "3") // default mode
+ {
+ std::cerr << "ERROR: Invalid SSL mode [" << ver << "] specfied!" << std::endl;
diff --git a/ACE/debian/patches/series b/ACE/debian/patches/series
index ab8b3888dc8..c64bad37c0d 100644
--- a/ACE/debian/patches/series
+++ b/ACE/debian/patches/series
@@ -1,4 +1,8 @@
reduce-doxygen-doc.diff
+15-fix-lzo-flags.diff
+20-versioned_libs.diff
+34-bts386713.diff
+35_disable_sslv2.diff
90-patch-mpc-basedir.diff
91-patch-dg-basedir.diff
92-default-ACE_ROOT.diff
diff --git a/ACE/debian/platform_macros.GNU b/ACE/debian/platform_macros.GNU
index 145e79a7cf1..76b032671f5 100644
--- a/ACE/debian/platform_macros.GNU
+++ b/ACE/debian/platform_macros.GNU
@@ -14,10 +14,9 @@ qt4 = 1
ace_qt4reactor = 1
bzip2 = 1
+lzo1 = 1
zlib = 1
-versioned_so = 2
-
# Work-around #593225
ARMEL_TARGET := $(shell echo '__ARMEL__' | $(CC) -E - | tail -n 1)
ifeq ($(ARMEL_TARGET),1)
diff --git a/ACE/debian/platform_macros.GNU.in b/ACE/debian/platform_macros.GNU.in
new file mode 100644
index 00000000000..4ab8f0aac88
--- /dev/null
+++ b/ACE/debian/platform_macros.GNU.in
@@ -0,0 +1,127 @@
+# -*- Makefile -*-
+ifeq (@BUILD_EXCEPTIONS_TRUE@,)
+ exceptions ?= 1
+else
+ exceptions ?= 0
+endif
+
+ifneq ($(findstring -g,@CXXFLAGS@),)
+ debug ?= 1
+else
+ debug ?= 0
+endif
+
+ifneq ($(filter -O2 -O3,@CXXFLAGS@),)
+ optimize ?= 1
+else
+ optimize ?= 0
+endif
+
+ifneq ($(findstring -pthread,@CXXFLAGS@),)
+ threads ?= 1
+else
+ threads ?= 0
+endif
+
+insure ?= 0
+
+PLATFORM_XT_CPPFLAGS = @ACE_XT_CPPFLAGS@
+PLATFORM_XT_LIBS = @ACE_XT_LIBS@
+PLATFORM_XT_LDFLAGS = @ACE_XT_LDFLAGS@
+
+PLATFORM_FL_CPPFLAGS = @ACE_FLTK_CPPFLAGS@
+PLATFORM_FL_LIBS = @ACE_FLTK_LIBS@
+
+PLATFORM_X11_CPPFLAGS = @ACE_X11_CPPFLAGS@
+PLATFORM_X11_LIBS = @ACE_X11_LIBS@
+PLATFORM_X11_LDFLAGS = @ACE_X11_LDFLAGS@
+
+PLATFORM_FOX_CPPFLAGS = @ACE_FOX_CPPFLAGS@
+PLATFORM_FOX_LIBS = @ACE_FOX_LIBS@
+
+PLATFORM_TCL_CPPFLAGS = @ACE_TCL_CPPFLAGS@
+PLATFORM_TCL_LIBS = @ACE_TCL_LIBS@
+
+PLATFORM_TK_CPPFLAGS = @ACE_TK_CPPFLAGS@
+PLATFORM_TK_LIBS = @ACE_TK_LIBS@
+
+PLATFORM_QT_CPPFLAGS = @ACE_QT_CPPFLAGS@
+PLATFORM_QT_LIBS = @ACE_QT_LIBS@
+
+ifeq (@BUILD_SSL_TRUE@,)
+ ssl ?= 1
+else
+ ssl ?= 0
+endif
+
+ifeq ($(insure),1)
+ CC = insure
+ CXX = insure
+endif
+
+PIC = -fPIC
+AR ?= @AR@
+ARFLAGS = rsuv
+RANLIB = @RANLIB@
+
+ifeq ($(insure),0)
+ CC ?= @CC@
+ CXX ?= @CXX@
+ CXX_FOR_VERSION_TEST ?= $(CXX)
+else
+ CXX_FOR_VERSION_TEST ?= @CXX@
+endif
+
+ifneq ($(findstring -pipe,@CXXFLAGS@),)
+ pipes ?= 1
+else
+ pipes ?= 0
+endif
+
+CXX_FULL_VERSION := $(shell $(CXX_FOR_VERSION_TEST) --version)
+
+FLAGS_C_CC += $(filter-out -g -O2 -O3 -pipe,@CXXFLAGS@)
+
+ifeq ($(buildbits),32)
+ FLAGS_C_CC += -m32
+ LDFLAGS += -m32
+endif
+ifeq ($(buildbits),64)
+ FLAGS_C_CC += -m64
+endif
+
+DCFLAGS += -g
+DCCFLAGS += -g
+DLD = $(CXX)
+LD = $(CXX)
+LIBS += @LIBS@
+
+ifeq ($(optimize),1)
+ SOFLAGS += -Wl,-O2
+endif
+
+SOFLAGS += $(CPPFLAGS) -shared
+SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $<; \
+ $(SOLINK.cc) -o $@ $(LDFLAGS) $(VSHDIR)$*.o
+PRELIB = @true
+
+# Test for template instantiation, add to SOFLAGS if SONAME set,
+# add -E to LDFLAGS if using GNU ld
+#
+include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
+
+OCFLAGS ?= -O2
+OCCFLAGS ?= -O2
+
+CFLAGS += $(FLAGS_C_CC)
+CCFLAGS += $(FLAGS_C_CC) $(TEMPLATES_FLAG)
+
+# Added line below to support "Executable Shared Object" files (as
+# needed by the service configurator).
+# Marius Kjeldahl <mariusk@sn.no, marius@funcom.com>
+ifeq ($(threads),1)
+ ESOBUILD = $(COMPILEESO.cc) $(PIC) -shared -o $(VSHDIR)$*.so $<
+ ifndef PRELIB
+ PRELIB = @true
+ endif # ! PRELIB
+endif
diff --git a/ACE/debian/tao-concurrency.docs b/ACE/debian/tao-concurrency.docs
index e845566c06f..27759070d95 100644
--- a/ACE/debian/tao-concurrency.docs
+++ b/ACE/debian/tao-concurrency.docs
@@ -1 +1 @@
-README
+ACE_wrappers/TAO/orbsvcs/Concurrency_Service/README
diff --git a/ACE/debian/tao-cosconcurrency.docs b/ACE/debian/tao-cosconcurrency.docs
index e845566c06f..b34db41e92e 100644
--- a/ACE/debian/tao-cosconcurrency.docs
+++ b/ACE/debian/tao-cosconcurrency.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Concurrency_Service/README
diff --git a/ACE/debian/tao-cosevent.docs b/ACE/debian/tao-cosevent.docs
index e845566c06f..dc5762182b9 100644
--- a/ACE/debian/tao-cosevent.docs
+++ b/ACE/debian/tao-cosevent.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/CosEvent_Service/README
diff --git a/ACE/debian/tao-cosnaming.docs b/ACE/debian/tao-cosnaming.docs
index e845566c06f..dc28f691e58 100644
--- a/ACE/debian/tao-cosnaming.docs
+++ b/ACE/debian/tao-cosnaming.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Naming_Service/README
diff --git a/ACE/debian/tao-cosnotification.docs b/ACE/debian/tao-cosnotification.docs
index e845566c06f..aa2625a27bf 100644
--- a/ACE/debian/tao-cosnotification.docs
+++ b/ACE/debian/tao-cosnotification.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Notify_Service/README
diff --git a/ACE/debian/tao-costime.docs b/ACE/debian/tao-costime.docs
index e845566c06f..74a3dc26c68 100644
--- a/ACE/debian/tao-costime.docs
+++ b/ACE/debian/tao-costime.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Time_Service/README
diff --git a/ACE/debian/tao-costrading.docs b/ACE/debian/tao-costrading.docs
index e845566c06f..3a6ce8b6215 100644
--- a/ACE/debian/tao-costrading.docs
+++ b/ACE/debian/tao-costrading.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Trading_Service/README
diff --git a/ACE/debian/tao-event.docs b/ACE/debian/tao-event.docs
index e845566c06f..323dd9c38cc 100644
--- a/ACE/debian/tao-event.docs
+++ b/ACE/debian/tao-event.docs
@@ -1 +1 @@
-README
+ACE_wrappers/TAO/orbsvcs/CosEvent_Service/README
diff --git a/ACE/debian/tao-ft.docs b/ACE/debian/tao-ft.docs
index e845566c06f..8230b9fe69c 100644
--- a/ACE/debian/tao-ft.docs
+++ b/ACE/debian/tao-ft.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/FT_ReplicationManager/README
diff --git a/ACE/debian/tao-ifr.docs b/ACE/debian/tao-ifr.docs
index e845566c06f..8354c00338e 100644
--- a/ACE/debian/tao-ifr.docs
+++ b/ACE/debian/tao-ifr.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/IFR_Service/README
diff --git a/ACE/debian/tao-imr.docs b/ACE/debian/tao-imr.docs
index 9fb9f077300..59142b41b2e 100644
--- a/ACE/debian/tao-imr.docs
+++ b/ACE/debian/tao-imr.docs
@@ -1 +1 @@
-ImplRepo_Service/README
+TAO/orbsvcs/ImplRepo_Service/README.txt
diff --git a/ACE/debian/tao-load.docs b/ACE/debian/tao-load.docs
index e845566c06f..0946c566d7d 100644
--- a/ACE/debian/tao-load.docs
+++ b/ACE/debian/tao-load.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/LoadBalancer/README
diff --git a/ACE/debian/tao-log.docs b/ACE/debian/tao-log.docs
index 76e960d9c77..8a75e5909f2 100644
--- a/ACE/debian/tao-log.docs
+++ b/ACE/debian/tao-log.docs
@@ -1 +1 @@
-Logging_Service/README
+ACE_wrappers/TAO/orbsvcs/Logging_Service/README
diff --git a/ACE/debian/tao-log.install b/ACE/debian/tao-log.install
index 130f25fd8eb..227add0d8c5 100644
--- a/ACE/debian/tao-log.install
+++ b/ACE/debian/tao-log.install
@@ -1,4 +1,4 @@
usr/bin/tao_tls_basic
usr/bin/tao_tls_event
usr/bin/tao_tls_notify
-usr/bin/tao_tls_event
+usr/bin/RTtao_tls_event
diff --git a/ACE/debian/tao-naming.docs b/ACE/debian/tao-naming.docs
index 6282f5b20c4..1f38248a647 100644
--- a/ACE/debian/tao-naming.docs
+++ b/ACE/debian/tao-naming.docs
@@ -1 +1 @@
-Naming_Service/README
+ACE_wrappers/TAO/orbsvcs/Naming_Service/README
diff --git a/ACE/debian/tao-notify.docs b/ACE/debian/tao-notify.docs
index 5c12846a35c..08af3d3f8fe 100644
--- a/ACE/debian/tao-notify.docs
+++ b/ACE/debian/tao-notify.docs
@@ -1 +1 @@
-Notify_Service/README
+ACE_wrappers/TAO/orbsvcs/Notify_Service/README
diff --git a/ACE/debian/tao-time.docs b/ACE/debian/tao-time.docs
index e845566c06f..d474eb065e6 100644
--- a/ACE/debian/tao-time.docs
+++ b/ACE/debian/tao-time.docs
@@ -1 +1 @@
-README
+ACE_wrappers/TAO/orbsvcs/Time_Service/README
diff --git a/ACE/debian/tao-tls.docs b/ACE/debian/tao-tls.docs
index e845566c06f..1fc456582d9 100644
--- a/ACE/debian/tao-tls.docs
+++ b/ACE/debian/tao-tls.docs
@@ -1 +1 @@
-README
+TAO/orbsvcs/Logging_Service/README
diff --git a/ACE/debian/tao-trading.docs b/ACE/debian/tao-trading.docs
index 75b9a27d77c..5c5869da934 100644
--- a/ACE/debian/tao-trading.docs
+++ b/ACE/debian/tao-trading.docs
@@ -1 +1 @@
-Trading_Service/README
+ACE_wrappers/TAO/orbsvcs/Trading_Service/README
diff --git a/ACE/debian/tao-utils.docs b/ACE/debian/tao-utils.docs
index e096658b255..08a71a77081 100644
--- a/ACE/debian/tao-utils.docs
+++ b/ACE/debian/tao-utils.docs
@@ -1,4 +1,4 @@
-README.nslist
-README.catior
-test
+TAO/utils/nslist/README.nslist
+TAO/utils/catior/README.catior
+TAO/utils/catior/test
diff --git a/ACE/docs/ACE-monotonic-timer.html b/ACE/docs/ACE-monotonic-timer.html
index 43edb33fefc..bb394b7ab05 100644
--- a/ACE/docs/ACE-monotonic-timer.html
+++ b/ACE/docs/ACE-monotonic-timer.html
@@ -34,22 +34,22 @@
<P STYLE="margin-bottom: 0in">Author: M.J.N. Corino Copyright <FONT FACE="Liberation Serif, serif">©</FONT><FONT FACE="Liberation Serif, serif">
2012, Remedy IT</FONT></P>
<P STYLE="margin-bottom: 0.2in"><FONT FACE="Liberation Serif, serif">Date:
- November 06, 2012 The Netherlands</FONT></P>
+ August 20, 2012 The Netherlands</FONT></P>
</DIV>
-<H1 CLASS="western">Monotonic timer support for ACE conditions and events</H1>
+<H1 CLASS="western">Monotonic timer support for ACE condition
+variables</H1>
<H2 CLASS="western">Introduction</H2>
<P>This document describes how to use the changes to the ACE API
-which provide support to use monotonic timers for condition and event
-variables to solve the problem of system timeshift vulnerability of
-the ACE Condition and Event variable timeout functionality.</P>
+which provide support to use monotonic timers for condition variables
+to solve the problem of system timeshift vulnerability of the ACE
+Condition variable timeout functionality.</P>
<H3 CLASS="western">Background</H3>
-<P>ACE Condition and Event variables implement an API to wait for the
-condition or event to be signalled with a maximum wait timeout value.
-This timeout value must be specified as <B>absolute time</B><SPAN STYLE="font-weight: normal">
+<P>ACE Condition variables implement an API to wait for a condition
+to be signalled with a maximum wait timeout value. This timeout value
+must be specified as <B>absolute time</B><SPAN STYLE="font-weight: normal">
(this API spec has been derived from the POSIX threading API,
pthread, the most widely available, standardized, threading API
-available) or, in the case of events, optionally as relative time
-(converted to absolute time by ACE on certain platforms).</SPAN></P>
+available).</SPAN></P>
<P><SPAN STYLE="font-weight: normal">Currently ACE expects the
timeout value to be based on the system time clock through the ACE
API support for that clock (</SPAN><I><SPAN STYLE="font-weight: normal">ACE_OS::gettimeofday
@@ -57,8 +57,8 @@ API support for that clock (</SPAN><I><SPAN STYLE="font-weight: normal">ACE_OS::
default for the POSIX API (originally POSIX did not support anything
else).</SPAN></P>
<P STYLE="font-weight: normal">This dependency on the system time
-clock however makes ACE Condition and Event variables vulnerable to
-system clock time shifts since a change in the system clock time setting
+clock however makes ACE Condition variables vulnerable to system
+clock time shifts since a change in the system clock time setting
after an absolute time value has been determined (based on the
unchanged system clock) will influence the outstanding wait
operations based on these time values.</P>
@@ -71,7 +71,7 @@ expects). Since this conversion is based on the system time clock
here also a vulnerability exists.</P>
<P STYLE="font-weight: normal">To resolve this vulnerability the
notion of MONOTONIC timer sources should be integrated into the ACE
-Condition and Event support. MONOTONIC timers are timer sources which are
+Condition support. MONOTONIC timers are timer sources which are
independent of the system time clock and will always return time
values which are correct relative to previously returned time values
(at least within the lifetime of a single running process).</P>
@@ -79,8 +79,7 @@ values which are correct relative to previously returned time values
while making use of the ACE_Message_Queue classes in the
implementation of their application. The enqueu/dequeue functionality
of the message queues makes heavy use of the ACE Condition variable
-timed wait support. The customer also used ACE_Event derived classes
-which suffer from the same vulnerability.</P>
+timed wait support.</P>
<H3 CLASS="western">Requirements</H3>
<P STYLE="font-weight: normal">Prerequisites for the solution are:</P>
<UL>
@@ -99,9 +98,9 @@ which suffer from the same vulnerability.</P>
<H2 CLASS="western"><B>Solution</B></H2>
<P STYLE="font-weight: normal">The implemented solution involves
adding support for the ACE Time_Policy traits in the ACE Condition
-and Event APIs and those classes directly related to the ACE Condition
-and Event timed wait functionality that are used by the customer (like
-ACE_Event, ACE_Message_Queue and ACE_Task). Also some classes tightly linked to
+API and those classes directly related to the ACE Condition timed
+wait functionality that are used by the customer (like
+ACE_Message_Queue and ACE_Task). Also some classes tightly linked to
those classes have been updated.</P>
<P STYLE="font-weight: normal">The newly added monotonic time policy,
ACE_Monotonic_Time_Policy, provides support for monotonic time values
@@ -187,31 +186,6 @@ msg_queue_.enqueue (msg_block, &amp;timeout_);
…</PRE><P STYLE="font-weight: normal">
<BR><BR>
</P>
-<P STYLE="font-weight: normal">Similar changes apply to the refactored ACE_Event classes. In
-addition to the added support for time policies also a new base class is introduced to allow
-for generic use of an Event variable after instantiation of a specific time policy based type.</P>
-<PRE CLASS="western" STYLE="font-weight: normal">
-…
-// declare an Event variable
-ACE_Event_Base &amp;evt;
-…
-// initialize Event variable
-ACE_Manual_Event_T&lt;ACE_Monotonic_Time_Policy&gt; mono_evt;
-evt = mono_evt;
-…
-// wait 5 sec for event to be signalled
-ACE_Time_Value_T&lt;ACE_Monotonic_Time_Policy&gt; timeout_;
-timeout_ = timeout_.now ();
-timeout_ += ACE_Time_Value (5,0);
-evt.wait (&amp;timeout_);
-…
-// OR (using relative timeout)
-…
-ACE_Time_Value_T&lt;ACE_Monotonic_Time_Policy&gt; timeout_ (5,0);
-evt.wait (&amp;timeout_, 0);
-</PRE><P STYLE="font-weight: normal">
-<BR><BR>
-</P>
<P><B>NOTE:</B><SPAN STYLE="font-weight: normal"> To function
properly the ACE_Time_Value pointer passed to the timed wait methods
</SPAN><B>MUST</B><SPAN STYLE="font-weight: normal"> be the address
@@ -221,7 +195,7 @@ layers now rely on the new time policy aware virtual methods of the
ACE_Time_Value classes to perform time calculations (to_relative_time
(), to_absolute_time (), now ()).<BR>Unfortunately due to backward
compatibility issues it was not possible to change the signatures of
-the timed wait methods to type safe versions accepting only correct
+the timed wait methods to type safe versions excepting only correct
time value instances.</SPAN></P>
<P><B>NOTE2:</B><SPAN STYLE="font-weight: normal"> Please be aware of
the differences in behaviour of the time calculation operations.</SPAN></P>
@@ -256,7 +230,6 @@ can be found in the following regression tests</P>
<LI><P STYLE="font-style: normal; font-weight: normal">$ACE_ROOT/tests/Bug_4055_Regression</P>
<LI><P STYLE="font-style: normal; font-weight: normal">$ACE_ROOT/tests/Monotonic_Task_Test</P>
<LI><P STYLE="font-style: normal; font-weight: normal">$ACE_ROOT/tests/Monotonic_Message_Queue_Test</P>
- <LI><P STYLE="font-style: normal; font-weight: normal">$ACE_ROOT/tests/Monotonic_Manual_Event_Test</P>
</UL>
<DIV TYPE=FOOTER>
<P STYLE="margin-top: 0.2in; margin-bottom: 0in"><BR>
diff --git a/ACE/docs/Download.html b/ACE/docs/Download.html
index d2a53e6379c..f217fe8a147 100644
--- a/ACE/docs/Download.html
+++ b/ACE/docs/Download.html
@@ -101,128 +101,128 @@ of the ACE, TAO, and CIAO micro release kit is available for
<TR><TH>Filename</TH><TH>Description</TH><TH>Full</TH><TH>Sources only</TH></TR>
<TR><TD>ACE+TAO+CIAO.tar.gz</TD>
<TD>ACE+TAO+CIAO (tar+gzip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.tar.gz">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.tar.gz">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO+CIAO.tar.bz2</TD>
<TD>ACE+TAO+CIAO (tar+bzip2 format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.tar.bz2">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.tar.bz2">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO+CIAO.zip</TD>
<TD>ACE+TAO+CIAO (zip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-6.1.4.zip">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+CIAO-src-6.1.4.zip">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO+DAnCE.tar.gz</TD>
<TD>ACE+TAO+DAnCE (tar+gzip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.tar.gz">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.tar.gz">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO+DAnCE.tar.bz2</TD>
<TD>ACE+TAO+DAnCE (tar+bzip2 format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.tar.bz2">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.tar.bz2">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO+DAnCE.zip</TD>
<TD>ACE+TAO+DAnCE (zip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-6.1.4.zip">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO+DAnCE-src-6.1.4.zip">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO.tar.gz</TD>
<TD>ACE+TAO (tar+gzip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.tar.gz">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.tar.gz">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO.tar.bz2</TD>
<TD>ACE+TAO (tar+bzip2 format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.tar.bz2">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.tar.bz2">FTP</A>]
</TD>
</TR>
<TR><TD>ACE+TAO.zip</TD>
<TD>ACE+TAO (zip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-6.1.4.zip">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE+TAO-src-6.1.4.zip">FTP</A>]
</TD>
</TR>
<TR><TD>ACE-html.tar.gz</TD>
<TD>Doxygen documentation for ACE+TAO+CIAO (tar+gzip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.tar.gz">FTP</A>]
</TD>
</TR>
<TR><TD>ACE-html.tar.bz2</TD>
<TD>Doxygen documentation for ACE+TAO+CIAO (tar+bzip2 format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.tar.bz2">FTP</A>]
</TD>
</TR>
<TR><TD>ACE-html.zip</TD>
<TD>Doxygen documentation for ACE+TAO+CIAO (zip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-html-6.1.4.zip">FTP</A>]
</TD>
</TR>
<TR><TD>ACE.tar.gz</TD>
<TD>ACE only (tar+gzip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.tar.gz">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.tar.gz">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.tar.gz">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.tar.gz">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.tar.gz">FTP</A>]
</TD>
</TR>
<TR><TD>ACE.tar.bz2</TD>
<TD>ACE only (tar+bzip2 format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.tar.bz2">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.tar.bz2">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.tar.bz2">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.tar.bz2">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.tar.bz2">FTP</A>]
</TD>
</TR>
<TR><TD>ACE.zip</TD>
<TD>ACE only (zip format)</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-6.1.4.zip">FTP</A>]
</TD>
- <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.zip">HTTP</A>]
- [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.6.zip">FTP</A>]
+ <TD>[<A HREF="http://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.zip">HTTP</A>]
+ [<A HREF="ftp://download.dre.vanderbilt.edu/previous_versions/ACE-src-6.1.4.zip">FTP</A>]
</TD>
</TR>
</TABLE>
diff --git a/ACE/docs/bczar/bczar.html b/ACE/docs/bczar/bczar.html
index b2e24a1c80d..45f0e441f1d 100644
--- a/ACE/docs/bczar/bczar.html
+++ b/ACE/docs/bczar/bczar.html
@@ -112,7 +112,7 @@
</ul>
If you want to perform a full build with qt support, than run:
<ul>
- <li><code>yum install make libcgroup-devel ant setuptool system-config-network-tui system-config-firewall-tui lcov gnuplot java-1.6.0-openjdk git-svn perl svn screen pysvn automake doxygen bzip2 tar gzip openssh graphviz zip libtool gcc-c++ boost-devel valgrind openssl-devel gcc qt4 fltk-devel bzip2-devel rsync openssl lzo-devel zziplib-devel acpid acpi nfs-utils java xerces-c xerces-c-devel mc qt qt-devel icecream ruby ruby-devel lksctp-tools-devel git glibc.i686 libstdc++.i686 ncurses-libs.i686 zlib.i686 telnet GitPython NetworkManager wget mailx</code></li>
+ <li><code>yum libcgroup-devel ant setuptool system-config-network-tui system-config-firewall-tui install lcov gnuplot java-1.6.0-openjdk git-svn perl svn screen pysvn automake doxygen bzip2 tar gzip openssh graphviz zip libtool gcc-c++ boost-devel valgrind openssl-devel gcc qt4 fltk-devel bzip2-devel rsync openssl lzo-devel zziplib-devel acpid acpi nfs-utils java xerces-c xerces-c-devel mc qt qt-devel icecream ruby ruby-devel lksctp-tools-devel git glibc.i686 libstdc++.i686 ncurses-libs.i686 zlib.i686 telnet GitPython NetworkManager wget mailx</code></li>
</ul>
</li>
<li>
@@ -231,7 +231,7 @@
export DOC_ROOT=$PWD/DOC_ROOT<br>
export SIGNATURE="Johnny Willemsen"<br>
export MAILID=jwillemsen@remedy.nl<br>
- wget https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/ACE/docs/svn/config?view=co -O $HOME/.subversion/config<br>
+ wget https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/ACE/docs/svn/config?view=co -O $HOME/.subversion/config<br>
svn co --username johnnyw https://svn.dre.vanderbilt.edu/DOC/Middleware/trunk DOC_ROOT<br>
svn co --username johnnyw https://svn.dre.vanderbilt.edu/DOC/MPC/trunk DOC_ROOT/ACE/MPC<br>
cd DOC_ROOT/<br>
@@ -315,11 +315,11 @@
rm -rf doxygen<br>
mkdir doxygen<br>
cd doxygen<br>
- wget https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/ACE/docs/svn/config?view=co -O $HOME/.subversion/config<br>
- svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_6/ACE ACE_wrappers<br>
- svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_6/TAO ACE_wrappers/TAO<br>
- svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_6/CIAO ACE_wrappers/TAO/CIAO<br>
- svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_6/DAnCE ACE_wrappers/TAO/DAnCE<br>
+ wget https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/ACE/docs/svn/config?view=co -O $HOME/.subversion/config<br>
+ svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_4/ACE ACE_wrappers<br>
+ svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_4/TAO ACE_wrappers/TAO<br>
+ svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_4/CIAO ACE_wrappers/TAO/CIAO<br>
+ svn co svn://svn.dre.vanderbilt.edu/DOC/Middleware/tags/ACE+TAO+CIAO-6_1_4/DAnCE ACE_wrappers/TAO/DAnCE<br>
cd ACE_wrappers<br>
export ACE_ROOT=$PWD<br>
export TAO_ROOT=$ACE_ROOT/TAO<br>
diff --git a/ACE/etc/index.html b/ACE/etc/index.html
index 32c00c332f0..b940a797f13 100644
--- a/ACE/etc/index.html
+++ b/ACE/etc/index.html
@@ -35,8 +35,6 @@
<hr>
We do have the documentation for previous releases
<ul>
- <LI><P><A HREF="6.1.6/html">6.1.6</A></P></LI>
- <LI><P><A HREF="6.1.5/html">6.1.5</A></P></LI>
<LI><P><A HREF="6.1.4/html">6.1.4</A></P></LI>
<LI><P><A HREF="6.1.3/html">6.1.3</A></P></LI>
<LI><P><A HREF="6.1.2/html">6.1.2</A></P></LI>
diff --git a/ACE/include/makeinclude/platform_g++_common.GNU b/ACE/include/makeinclude/platform_g++_common.GNU
index c3e945b8bcd..8dd0d9f7a55 100644
--- a/ACE/include/makeinclude/platform_g++_common.GNU
+++ b/ACE/include/makeinclude/platform_g++_common.GNU
@@ -105,7 +105,7 @@ templates ?= automatic
# If the platform file didn't already set versioned_so, default to 1.
versioned_so ?= 1
with_ld ?=
-ifneq ($(versioned_so),0)
+ifeq ($(versioned_so),1)
ifeq ($(with_ld),hpux)
SOFLAGS += -Wl,+h -Wl,$(SONAME)
else
@@ -117,10 +117,6 @@ ifneq ($(versioned_so),0)
endif
endif
-ifeq ($(versioned_so),2)
- FLAGS_C_CC += -DACE_VERSIONED_SO=2
-endif
-
static_libs_only ?=
CXX_FULL_VERSION := $(shell $(CXX_FOR_VERSION_TEST) --version)
diff --git a/ACE/include/makeinclude/platform_macosx_mountain_lion.GNU b/ACE/include/makeinclude/platform_macosx_mountain_lion.GNU
deleted file mode 100644
index 5899db19fa2..00000000000
--- a/ACE/include/makeinclude/platform_macosx_mountain_lion.GNU
+++ /dev/null
@@ -1,4 +0,0 @@
-# $Id$
-
-include $(ACE_ROOT)/include/makeinclude/platform_macosx_lion.GNU
-
diff --git a/ACE/include/makeinclude/rules.lib.GNU b/ACE/include/makeinclude/rules.lib.GNU
index f1269e63d52..5a93b35934f 100644
--- a/ACE/include/makeinclude/rules.lib.GNU
+++ b/ACE/include/makeinclude/rules.lib.GNU
@@ -11,7 +11,7 @@
# Library versioning
#---------------------------------------------------------------------------
-ifneq ($(versioned_so),0)
+ifeq ($(versioned_so),1)
# Turn on symbol versioning. The scheme that we follow is to allow
# applications dependent on libraries, with same version numbers (major,
# minor and beta) to run, but applications with dependencies on libraries
@@ -20,27 +20,13 @@ ifneq ($(versioned_so),0)
# Version number of the libraries
#
ifeq ($(SOVERSION),)
- ifeq ($(versioned_so),1)
- SOVERSION = .$(GNUACE_PROJECT_VERSION)
- else
- ifeq ($(versioned_so),2)
- SOVERSION = -$(GNUACE_PROJECT_VERSION)
- else
- $(error unknown value for versioned_so: $(versioned_so))
- endif
- endif
+ SOVERSION = .$(GNUACE_PROJECT_VERSION)
endif # SOVERSION
# Name that will be written into the dynamic library
#
ifeq ($(SONAME),)
- ifeq ($(versioned_so),1)
- SONAME = $(SHLIB)$(SOVERSION)
- else
- ifeq ($(versioned_so),2)
- SONAME = $(patsubst %.$(SOEXT),%,$(SHLIB))$(SOVERSION).$(SOEXT)
- endif
- endif
+ SONAME = $(SHLIB)$(SOVERSION)
endif # SONAME
endif # versioned_so
@@ -61,15 +47,9 @@ SHLIB ?=
# Setup shared library variables, including versions.
VSHLIB_NO_VER = $(ARCH_SHLIB:%.$(SOEXT)=%$(VAR).$(SOEXT))
CLEANUP_VSHLIB_NO_VER = $(CLEANUP_SHLIB:%.$(SOEXT)=%$(VAR).$(SOEXT))
-ifneq ($(versioned_so),2)
- VSHLIB = $(VSHLIB_NO_VER:%=%$(SOVERSION))
- CLEANUP_VSHLIB = $(CLEANUP_VSHLIB_NO_VER:%=%$(SOVERSION))
- SHLIB_WITH_VER = $(SHLIB:%=%$(SOVERSION))
-else
- VSHLIB = $(patsubst %.$(SOEXT),%,$(VSHLIB_NO_VER))$(SOVERSION).$(SOEXT)
- CLEANUP_VSHLIB = $(patsubst %.$(SOEXT),%,$(CLEANUP_VSHLIB_NO_VER))$(SOVERSION).$(SOEXT)
- SHLIB_WITH_VER = $(patsubst %.$(SOEXT),%,$(SHLIB))$(SOVERSION).$(SOEXT)
-endif
+VSHLIB = $(VSHLIB_NO_VER:%=%$(SOVERSION))
+CLEANUP_VSHLIB = $(CLEANUP_VSHLIB_NO_VER:%=%$(SOVERSION))
+SHLIB_WITH_VER = $(SHLIB:%=%$(SOVERSION))
SHLIBA ?=
VSHLIBA = $(ARCH_SHLIBA:%.$(LIBEXT)=%$(VAR).$(LIBEXT))
diff --git a/ACE/include/makeinclude/rules.local.GNU b/ACE/include/makeinclude/rules.local.GNU
index 16b06d2028e..ff9d3def7bd 100644
--- a/ACE/include/makeinclude/rules.local.GNU
+++ b/ACE/include/makeinclude/rules.local.GNU
@@ -312,23 +312,13 @@ else #not vxworks_ntbuild
fi
else #firstword of LN_S is not cp, so we're using real symlinks
ifneq ($(SOVERSION),)
- ifneq ($(versioned_so),2)
- @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
+ @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
if test ! -s $@ ; then \
$(RM) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
echo $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
$(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%.$(SOEXT)$(SOVERSION)=%.$(SOEXT)); \
fi ; \
- fi
- else
- @if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
- if test ! -s $@ ; then \
- $(RM) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
- echo $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
- $(LN_S) $(ARCH_SOURCE_DIR)/$(@F) $(@:%$(SOVERSION).$(SOEXT)=%.$(SOEXT)); \
- fi ; \
- fi
- endif #versioned_so
+ fi
endif #SOVERSION
@if test $(ARCH_SOURCE_DIR) != $(@D) ; then \
if test ! -s $@ ; then \
@@ -361,10 +351,6 @@ ifneq ($(SHLIB_UNCHECKED),)
-$(RM) $(SHLIB_UNCHECKED)
ifeq ($(versioned_so),1)
-$(RM) $(SHLIB_UNCHECKED)$(SOVERSION)
-else
- ifeq ($(versioned_so),2)
- -$(RM) $(SHLIB_UNCHECKED:.$(SOEXT)=$(SOVERSION).$(SOEXT))
- endif
endif
endif
diff --git a/ACE/include/makeinclude/wrapper_macros.GNU b/ACE/include/makeinclude/wrapper_macros.GNU
index 3a173884310..d4c888502f0 100644
--- a/ACE/include/makeinclude/wrapper_macros.GNU
+++ b/ACE/include/makeinclude/wrapper_macros.GNU
@@ -78,10 +78,7 @@
# If versioned_so is 1 (enabled), the SOVERSION make
# variable can also be set to specify the version info
# to append to the name - it should have a leading '.' -
-# else it defaults to .ACE_MAJOR.ACE_MINOR.ACE_BETA. If 2,
-# the version will be appended to the name but *before* the
-# $(SOEXT) - it should have a lead '-' - else it defaults to
-# -ACE_MAJOR.ACE_MINOR.ACE_BETA.
+# else it defaults to .ACE_MAJOR.ACE_MINOR.ACE_BETA.
# wfmo Build with wfmo support (Win32 only)
# winregistry Build with windows registry support (Win32 only)
# winnt Build WinNT-specific projects (Win32 only)
diff --git a/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp b/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp
index 9dda462b99a..65805c2c582 100644
--- a/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp
+++ b/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp
@@ -35,11 +35,7 @@ usage (void)
std::cout << "\t-p <port> \t\tproxy port to connect to\n";
std::cout << "\t-o <filename> \t\tfile to write output to\n";
#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1
- std::cout << "\t-v <ssl version>\t\tSSL version to use: ";
-#if !defined (OPENSSL_NO_SSL2)
- std::cout << "2, ";
-#endif /* OPENSSL_NO_SSL2 */
- std::cout << "23, 3\n";
+ std::cout << "\t-v <ssl version>\t\tSSL version to use: 2, 23, 3\n";
std::cout << "\t-n \t\tno peer certificate verification\n";
std::cout << "\t-i \t\tignore peer certificate verification failures\n";
std::cout << "\t-c <filename> \t\tcertificate file (PEM format)\n";
@@ -82,12 +78,10 @@ parse_args (int argc, ACE_TCHAR *argv [])
case 'v':
{
ACE_CString ver = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ());
- if (ver == "23")
- ssl_mode = ACE_SSL_Context::SSLv23;
-#if !defined (OPENSSL_NO_SSL2)
- else if (ver == "2")
+ if (ver == "2")
ssl_mode = ACE_SSL_Context::SSLv2;
-#endif /* ! OPENSSL_NO_SSL2*/
+ else if (ver == "23")
+ ssl_mode = ACE_SSL_Context::SSLv23;
else if (ver != "3") // default mode
{
std::cerr << "ERROR: Invalid SSL mode [" << ver << "] specfied!" << std::endl;
diff --git a/ACE/rpmbuild/ace-tao.spec b/ACE/rpmbuild/ace-tao.spec
index d91c7173a69..ce80eb3c791 100644
--- a/ACE/rpmbuild/ace-tao.spec
+++ b/ACE/rpmbuild/ace-tao.spec
@@ -1,7 +1,7 @@
# Set the version number here.
-%define ACEVER 6.1.6
-%define TAOVER 2.1.6
-%define CIAOVER 1.1.6
+%define ACEVER 6.1.4
+%define TAOVER 2.1.4
+%define CIAOVER 1.1.4
# Conditional build
# Default values are
@@ -1916,7 +1916,6 @@ fi
%exclude %{_includedir}/ace/XtReactor/XtReactor.h
%exclude %{_includedir}/ace/XtReactor/ACE_XtReactor_export.h
%endif
-%exclude %{_libdir}/libACEXML*.so
%doc AUTHORS
%doc COPYING
@@ -2166,8 +2165,6 @@ fi
%defattr(-,root,root,-)
%{_datadir}/tao
%exclude %{_datadir}/tao/MPC
-%exclude %{_datadir}/tao/tao
-%exclude %{_datadir}/tao/orbsvcs
%{_libdir}/libTAO*.so.%{TAOVERSO}
diff --git a/ACE/tests/Bug_4055_Regression_Test.cpp b/ACE/tests/Bug_4055_Regression_Test.cpp
index a0b788737da..13760e1e448 100644
--- a/ACE/tests/Bug_4055_Regression_Test.cpp
+++ b/ACE/tests/Bug_4055_Regression_Test.cpp
@@ -299,15 +299,11 @@ bool test_timer (ACE_Condition_Thread_Mutex& condition_, ACE_Time_Value& waittim
sys_time.wMinute = ACE_Utils::truncate_cast <WORD> (curdt.minute ());
sys_time.wSecond = ACE_Utils::truncate_cast <WORD> (curdt.second ());
sys_time.wMilliseconds = ACE_Utils::truncate_cast <WORD> (curdt.microsec () / 1000);
- if (!::SetLocalTime (&sys_time))
+ ::SetLocalTime (&sys_time);
# else
curts = curtime;
- if (ACE_OS::clock_settime (CLOCK_REALTIME, &curts) != 0)
+ ACE_OS::clock_settime (CLOCK_REALTIME, &curts);
# endif
- {
- ACE_DEBUG((LM_INFO,
- "(%P|%t) Unable to reset OS time. Insufficient privileges or not supported.\n"));
- }
}
ACE_DEBUG((LM_INFO,
diff --git a/ACE/tests/Manual_Event_Test.cpp b/ACE/tests/Manual_Event_Test.cpp
index 3344ff9feb2..7d736f69282 100644
--- a/ACE/tests/Manual_Event_Test.cpp
+++ b/ACE/tests/Manual_Event_Test.cpp
@@ -24,6 +24,17 @@
#include "ace/OS_NS_unistd.h"
#include "ace/Atomic_Op.h"
+
+
+// msec that times are allowed to differ before test fails.
+#if defined (ACE_HAS_HI_RES_TIMER) || defined (ACE_HAS_AIX_HI_RES_TIMER) || \
+ defined (ACE_HAS_PENTIUM) || defined (ACE_HAS_ALPHA_TIMER) || \
+ defined (ACE_HAS_POWERPC_TIMER)
+# define ACE_ALLOWED_SLACK 100
+#else /* don't have a high-res timer */
+# define ACE_ALLOWED_SLACK 1100
+#endif /* don't have a high-res timer */
+
// Test results, 'success' is 0
static int test_result = 0;
diff --git a/ACE/tests/Monotonic_Manual_Event_Test.cpp b/ACE/tests/Monotonic_Manual_Event_Test.cpp
deleted file mode 100644
index 1cc973850e9..00000000000
--- a/ACE/tests/Monotonic_Manual_Event_Test.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-
-//=============================================================================
-/**
- * @file Monotonic_Manual_Event_Test.cpp
- *
- * $Id$
- *
- * This test verifies the functionality of the time policy support
- * for the <ACE_Manual_Event> implementation.
- *
- *
- * @author Martin Corino <mcorino@remedy.nl>
- */
-//=============================================================================
-
-
-#include "test_config.h"
-#include "ace/Manual_Event.h"
-#include "ace/Thread.h"
-#include "ace/Thread_Manager.h"
-#include "ace/Get_Opt.h"
-#include "ace/OS_NS_sys_time.h"
-#include "ace/OS_NS_time.h"
-#include "ace/OS_NS_unistd.h"
-#include "ace/Atomic_Op.h"
-
-#if defined (ACE_WIN32) || \
- (defined (ACE_HAS_CLOCK_GETTIME) && \
- !defined (ACE_LACKS_MONOTONIC_TIME) && \
- !defined (ACE_LACKS_CONDATTR) && \
- (defined (_POSIX_MONOTONIC_CLOCK) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)) && \
- defined (_POSIX_CLOCK_SELECTION) && !defined (ACE_LACKS_CONDATTR_SETCLOCK))
-
-# include "ace/Monotonic_Time_Policy.h"
-# if defined (ACE_WIN32)
-# include "ace/Date_Time.h"
-# include "ace/Truncate.h"
-# endif
-
-// Test results, 'success' is 0
-static int test_result = 0;
-
-#if defined (ACE_HAS_THREADS)
-
-// Event used in the tests. Start it "unsignalled" (i.e., its initial
-// state is 0).
-static ACE_Event_Base *evt = 0;
-
-// use monotonic or system time policy
-static bool use_monotonic = true;
-
-// Number of worker threads.
-static long n_workers = 10;
-
-// Absolute timeout for initial wait of workers
-static ACE_Time_Value *initial_timeout;
-
-// Number of wakeups.
-#if defined (ACE_HAS_BUILTIN_ATOMIC_OP)
-static ACE_Atomic_Op<ACE_Thread_Mutex, long> n_awoken;
-static ACE_Atomic_Op<ACE_Thread_Mutex, long> n_awoken2;
-#else
-static long n_awoken;
-static long n_awoken2;
-#endif
-
-// Explain usage and exit.
-static void
-print_usage_and_die (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("usage: %n [-w n_workers] [-s]\n")));
- ACE_OS::exit (1);
-}
-
-static void
-parse_args (int argc, ACE_TCHAR *argv[])
-{
- ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("w:s"));
-
- int c;
-
- while ((c = get_opt ()) != -1)
- switch (c)
- {
- case 'w':
- n_workers = ACE_OS::atoi (get_opt.opt_arg ());
- break;
- case 's':
- use_monotonic = false;
- break;
- default:
- print_usage_and_die ();
- break;
- }
-}
-
-void set_system_time(const ACE_Time_Value& tv)
-{
-# if defined (ACE_WIN32)
- ACE_Date_Time curdt (tv);
- SYSTEMTIME sys_time;
- sys_time.wDay = ACE_Utils::truncate_cast <WORD> (curdt.day ());
- sys_time.wMonth = ACE_Utils::truncate_cast <WORD> (curdt.month ());
- sys_time.wYear = ACE_Utils::truncate_cast <WORD> (curdt.year ());
- sys_time.wHour = ACE_Utils::truncate_cast <WORD> (curdt.hour ());
- sys_time.wMinute = ACE_Utils::truncate_cast <WORD> (curdt.minute ());
- sys_time.wSecond = ACE_Utils::truncate_cast <WORD> (curdt.second ());
- sys_time.wMilliseconds = ACE_Utils::truncate_cast <WORD> (curdt.microsec () / 1000);
- if (!::SetLocalTime (&sys_time))
-# else
- timespec_t curts;
- curts = tv;
- if (ACE_OS::clock_settime (CLOCK_REALTIME, &curts) != 0)
-# endif
- {
- ACE_DEBUG((LM_INFO,
- "(%P|%t) Unable to reset OS time. Insufficient privileges or not supported.\n"));
- }
-}
-
-// Worker tries to acquire the semaphore, hold it for a while, and
-// then manually releases it.
-
-static void *
-worker (void *)
-{
- if (evt->wait (initial_timeout) == -1)
- {
- if (ACE_OS::last_error () == ETIME)
- {
- ACE_Time_Value tm_now = initial_timeout->now ();
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT (" (%P|%t) Timed out waiting for start pulse at %#T\n"),
- &tm_now),
- 0);
- }
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT (" (%P|%t) %p\n"),
- ACE_TEXT ("Failed waiting for pulse ()")),
- 0);
- }
-
- ACE_Time_Value tm_now = initial_timeout->now ();
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT (" (%P|%t) awake at %#T\n"), &tm_now));
-
- if (++n_awoken < n_workers)
- {
- ACE_Time_Value *tv;
- ACE_Time_Value_T<ACE_Monotonic_Time_Policy> tm_mono;
- ACE_Time_Value tm_sys;
-
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_Time_Value wait (1, 0); // Wait 1 sec
- //FUZZ: enable check_for_lack_ACE_OS
-
- if (use_monotonic)
- {
- tm_mono = tm_mono.now () + wait;
- tv = &tm_mono;
- }
- else
- {
- tm_sys = ACE_OS::gettimeofday () + wait;
- tv = &tm_sys;
- }
-
- if (evt->wait (tv) == -1)
- {
- // verify that we have ETIME
- if (ACE_OS::last_error () == ETIME)
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%P|%t) timeout\n")));
- else
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT (" (%P|%t) wait failed %p\n"),
- ACE_TEXT ("but not with ETIME")));
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT (" (%P|%t) awake in time\n")));
-
- if (++n_awoken2 >= (n_workers/2))
- evt->reset (); // reset signal (rest times out)
- }
-
- // Check to ensure that an "infinite timeout" will work.
- if (evt->wait (0) == -1)
- {
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT (" (%P|%t) %p\n"),
- ACE_TEXT ("Failed waiting for signal ()\n")));
- //FUZZ: enable check_for_lack_ACE_OS
- }
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT (" (%P|%t) last awake; send signal\n")));
- // last one wakes others
- if (evt->signal () == -1)
- ACE_ERROR ((LM_ERROR, ACE_TEXT (" (%P|%t) %p\n"), ACE_TEXT ("signal")));
-
- ACE_OS::sleep (ACE_Time_Value (0, 200 * 1000 * 100)); // 200 msec
- }
-
- if (evt->wait () == -1)
- {
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT (" (%P|%t) %p\n"),
- ACE_TEXT ("Failed waiting for signal ()\n")));
- //FUZZ: enable check_for_lack_ACE_OS
- }
-
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%P|%t) worker finished\n")));
-
- return 0;
-}
-
-#endif /* ACE_HAS_THREADS */
-
-// Test event functionality.
-
-int run_main (int argc, ACE_TCHAR *argv[])
-{
- ACE_START_TEST (ACE_TEXT ("Monotonic_Manual_Event_Test"));
-
-#if defined (ACE_HAS_THREADS)
- ACE_Manual_Event_T<ACE_Monotonic_Time_Policy> monotonic_event (0);
- ACE_Manual_Event systime_event (0);
- ACE_Time_Value_T<ACE_Monotonic_Time_Policy> tm_mono;
- ACE_Time_Value tm_sys;
-
- parse_args (argc, argv);
-
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_Time_Value wait (7, 0); // Wait 7 sec
- //FUZZ: enable check_for_lack_ACE_OS
-
- if (use_monotonic)
- {
- evt = &monotonic_event;
- tm_mono = tm_mono.now () + wait;
- initial_timeout = &tm_mono;
- }
- else
- {
- evt = &systime_event;
- tm_sys = ACE_OS::gettimeofday () + wait;
- initial_timeout = &tm_sys;
- }
-
- // shift forward in time 3 sec; this will mess up timeouts if
- // monotonic timer is not used
- ACE_Time_Value tv_shift (3, 0);
- set_system_time (ACE_OS::gettimeofday () + tv_shift);
-
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("spawning workers - initial timeout till %#T\n"), initial_timeout));
-
- if (ACE_Thread_Manager::instance ()->spawn_n
- (static_cast<size_t> (n_workers),
- ACE_THR_FUNC (worker),
- 0,
- THR_NEW_LWP) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("%p\n"),
- ACE_TEXT ("spawn_n")),
- 1);
-
- // gives all workers chance to start
- ACE_OS::sleep (5);
-
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("finished waiting for workers to start\n")));
-
- // restore time (workers will already have failed without monotonic timer)
- set_system_time (ACE_OS::gettimeofday () - tv_shift);
-
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("sending pulse ()\n")));
-
- // Release the all workers.
- if (evt->pulse () == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("%p\n"),
- ACE_TEXT ("pulse")),
- 1);
-
- // Wait 2 sec
- ACE_OS::sleep (2);
-
- //FUZZ: disable check_for_lack_ACE_OS
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("sending signal ()\n")));
- //FUZZ: enable check_for_lack_ACE_OS
-
- // Signal
- if (evt->signal () == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("%p\n"),
- ACE_TEXT ("signal")),
- 1);
-
- ACE_Thread_Manager::instance ()->wait ();
-#else
- ACE_UNUSED_ARG (argc);
- ACE_UNUSED_ARG (argv);
- ACE_ERROR ((LM_INFO,
- ACE_TEXT ("Threads not supported on this platform\n")));
-#endif /* ACE_HAS_THREADS */
- ACE_END_TEST;
- return test_result;
-}
-
-#else
-
-int
-run_main (int , ACE_TCHAR *[])
-{
- ACE_START_TEST (ACE_TEXT ("Monotonic_Manual_Event_Test"));
- ACE_DEBUG((LM_INFO,
- "(%P|%t) ACE not compiled with monotonic time.\n"));
- ACE_END_TEST;
- return 0;
-}
-
-#endif
diff --git a/ACE/tests/Monotonic_Message_Queue_Test.cpp b/ACE/tests/Monotonic_Message_Queue_Test.cpp
index 641cb5a0244..57e7841c053 100644
--- a/ACE/tests/Monotonic_Message_Queue_Test.cpp
+++ b/ACE/tests/Monotonic_Message_Queue_Test.cpp
@@ -35,11 +35,8 @@
#include "ace/OS_NS_unistd.h"
#if defined (ACE_WIN32) || \
- (defined (ACE_HAS_CLOCK_GETTIME) && \
- !defined (ACE_LACKS_MONOTONIC_TIME) && \
- !defined (ACE_LACKS_CONDATTR) && \
- (defined (_POSIX_MONOTONIC_CLOCK) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)) && \
- defined (_POSIX_CLOCK_SELECTION) && !defined (ACE_LACKS_CONDATTR_SETCLOCK))
+ (defined (_POSIX_MONOTONIC_CLOCK) && !defined (ACE_LACKS_MONOTONIC_TIME)) || \
+ defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
# if defined (ACE_WIN32)
# include "ace/Date_Time.h"
diff --git a/ACE/tests/Monotonic_Task_Test.cpp b/ACE/tests/Monotonic_Task_Test.cpp
index 584e254d0b7..2ad30da9a75 100644
--- a/ACE/tests/Monotonic_Task_Test.cpp
+++ b/ACE/tests/Monotonic_Task_Test.cpp
@@ -38,11 +38,8 @@
#include "ace/OS_NS_unistd.h"
#if defined (ACE_WIN32) || \
- (defined (ACE_HAS_CLOCK_GETTIME) && \
- !defined (ACE_LACKS_MONOTONIC_TIME) && \
- !defined (ACE_LACKS_CONDATTR) && \
- (defined (_POSIX_MONOTONIC_CLOCK) || defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)) && \
- defined (_POSIX_CLOCK_SELECTION) && !defined (ACE_LACKS_CONDATTR_SETCLOCK))
+ (defined (_POSIX_MONOTONIC_CLOCK) && !defined (ACE_LACKS_MONOTONIC_TIME)) || \
+ defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
# if defined (ACE_WIN32)
# include "ace/Date_Time.h"
diff --git a/ACE/tests/Network_Adapters_Test.cpp b/ACE/tests/Network_Adapters_Test.cpp
index 369a1c9d7a6..90c2fdb87af 100644
--- a/ACE/tests/Network_Adapters_Test.cpp
+++ b/ACE/tests/Network_Adapters_Test.cpp
@@ -563,7 +563,6 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGINT"), SIGINT),
-1);
- this->registered_signals_.sig_add (SIGINT);
#endif /* SIGINT != 0 */
#if (SIGTERM != 0)
@@ -572,7 +571,6 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGTERM"), SIGTERM),
-1);
- this->registered_signals_.sig_add (SIGTERM);
#endif /* SIGTERM != 0 */
#if (SIGQUIT != 0)
@@ -581,7 +579,6 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGQUIT"), SIGQUIT),
-1);
- this->registered_signals_.sig_add (SIGQUIT);
#endif /* SIGQUIT != 0 */
return 0;
}
@@ -644,7 +641,9 @@ Stop_Handler::handle_input (ACE_HANDLE handle)
}
}
- this->reactor ()->remove_handler (this->registered_signals_);
+ this->reactor ()->remove_handler (this,
+ ACE_Event_Handler::SIGNAL_MASK |
+ ACE_Event_Handler::DONT_CALL);
if (reactor ()->end_reactor_event_loop () == -1)
{
@@ -660,12 +659,10 @@ Stop_Handler::handle_input (ACE_HANDLE handle)
}
int
-Stop_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask m)
+Stop_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("(%P|%t) Stop_Handler::handle_close - entered.\n")));
- if (m == ACE_Event_Handler::SIGNAL_MASK)
- return 0;
this->reactor ()->remove_handler (this,
ACE_Event_Handler::SIGNAL_MASK |
ACE_Event_Handler::DONT_CALL);
diff --git a/ACE/tests/Network_Adapters_Test.h b/ACE/tests/Network_Adapters_Test.h
index 6cfeb9d02d2..f5c8e9121ed 100644
--- a/ACE/tests/Network_Adapters_Test.h
+++ b/ACE/tests/Network_Adapters_Test.h
@@ -214,8 +214,6 @@ private:
// Table to place here pointers to all tasks in the process.
ACE_Event_Handler * handlers_to_stop_[HANDLERS_TO_STOP_TABLE_SIZE];
-
- ACE_Sig_Set registered_signals_;
};
diff --git a/ACE/tests/Obstack_Test.cpp b/ACE/tests/Obstack_Test.cpp
index 673021a5c43..ee10ff8e86a 100644
--- a/ACE/tests/Obstack_Test.cpp
+++ b/ACE/tests/Obstack_Test.cpp
@@ -11,11 +11,15 @@
*/
//=============================================================================
+
#include "test_config.h"
#include "ace/OS_NS_string.h"
#include "ace/Obstack.h"
#include "ace/Log_Msg.h"
+
+
+
int run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Obstack_Test"));
diff --git a/ACE/tests/run_test.lst b/ACE/tests/run_test.lst
index 914b5699bb3..f00b3658f59 100644
--- a/ACE/tests/run_test.lst
+++ b/ACE/tests/run_test.lst
@@ -65,7 +65,7 @@ Bug_3911_Regression_Test: !FIXED_BUGS_ONLY !ACE_FOR_TAO
Bug_3912_Regression_Test: !STATIC
Bug_3943_Regression_Test: !ACE_FOR_TAO
Bug_3974_Regression_Test
-Bug_4055_Regression_Test: !ST
+Bug_4055_Regression_Test:
CDR_Array_Test: !ACE_FOR_TAO
CDR_File_Test: !ACE_FOR_TAO
CDR_Test
@@ -142,7 +142,6 @@ Message_Block_Test: !ACE_FOR_TAO
Message_Queue_Notifications_Test
Message_Queue_Test: !ACE_FOR_TAO
Message_Queue_Test_Ex: !ACE_FOR_TAO
-Monotonic_Manual_Event_Test
Monotonic_Message_Queue_Test: !ACE_FOR_TAO
Monotonic_Task_Test: !ACE_FOR_TAO
Multicast_Test: !ST !NO_MCAST !nsk !LynxOS !LabVIEW_RT
diff --git a/ACE/tests/tests.mpc b/ACE/tests/tests.mpc
index a5c13da5c2b..8b455440055 100644
--- a/ACE/tests/tests.mpc
+++ b/ACE/tests/tests.mpc
@@ -986,13 +986,6 @@ project(Message Queue Test) : acetest {
}
}
-project(Monotonic_Manual_Event Test) : acetest {
- exename = Monotonic_Manual_Event_Test
- Source_Files {
- Monotonic_Manual_Event_Test.cpp
- }
-}
-
project(Monotonic_Task Test) : acetest {
avoids += ace_for_tao
exename = Monotonic_Task_Test
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index 9aae7cf9a8e..e48977c0412 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,72 +1,3 @@
-Sat Nov 24 14:18:41 UTC 2012 Marcel Smit <msmit@remedy.nl>
-
- * tests/Bug_3769_Regression/Foo_exec.cpp:
- Fuzz : Trailing whitespaces
-
-Fri Nov 23 12:53:17 UTC 2012 Marcel Smit <msmit@remedy.nl>
-
- * tests/Bug_3769_Regression/Foo_exec.cpp:
- Fixed fuzz and test.
-
- * tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp:
- Fixed fuzz.
-
-Fri Nov 23 10:56:41 UTC 2012 Marcel Smit <msmit@remedy.nl>
-
- * tests/Bug_3769_Regression/Foo_exec.cpp:
- Minor layout change.
-
- * tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp:
- Added new attribute.
-
- * bin/ciao_tests.lst:
- * tests/Bug_3769_Regression/descriptors/run_test_cdr.pl:
- New test: using CDR as input for the plan launcher.
-
-Fri Nov 23 10:28:23 UTC 2012 Marcel Smit <msmit@remedy.nl>
-
- * tests/Bug_3769_Regression/Foo.idl:
- * tests/Bug_3769_Regression/Foo_exec.h:
- * tests/Bug_3769_Regression/Foo_exec.cpp:
- Expanded test. Added a struct within a struct which
- is placed in a separate module. checking whether the
- correct values are set.
-
-Mon Nov 19 18:15:16 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * connectors/dds4ccm/impl/DataReaderListener_T.cpp:
- Layout changes
-
- * connectors/dds4ccm/impl/DomainParticipantManager.cpp:
- Check for (un)registration of nil domain participants, log
- profile during unregistration
-
-Mon Nov 12 10:07:05 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for next release
-
-Mon Nov 12 09:34:14 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * CIAO version 1.1.6 released.
-
-Fri Oct 12 11:18:03 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * ccm/CCM_Transaction.idl:
- Removed old comment
-
- * ciao/Deployment/Interceptors/Deployment_Interceptors.cpp:
- Fixed some logging statements
-
-Fri Oct 12 10:53:23 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for x.1.5
-
-Fri Oct 12 11:20:25 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * CIAO version 1.1.5 released.
-
Mon Oct 8 08:02:52 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* ciao/Deployment/Handlers/Component_Handler.cpp:
diff --git a/CIAO/NEWS b/CIAO/NEWS
index b23868d166c..2264b297e90 100644
--- a/CIAO/NEWS
+++ b/CIAO/NEWS
@@ -1,16 +1,6 @@
-USER VISIBLE CHANGES BETWEEN CIAO-1.1.6 and CIAO-1.1.7
-=======================================================
-
-USER VISIBLE CHANGES BETWEEN CIAO-1.1.5 and CIAO-1.1.6
-=======================================================
-
-. None
-
USER VISIBLE CHANGES BETWEEN CIAO-1.1.4 and CIAO-1.1.5
=======================================================
-. Added basic hello world example
-
USER VISIBLE CHANGES BETWEEN CIAO-1.1.3 and CIAO-1.1.4
=======================================================
diff --git a/CIAO/PROBLEM-REPORT-FORM b/CIAO/PROBLEM-REPORT-FORM
index 78b5cac2c95..afa8c22ea5d 100644
--- a/CIAO/PROBLEM-REPORT-FORM
+++ b/CIAO/PROBLEM-REPORT-FORM
@@ -41,9 +41,9 @@
To: ciao-users@list.isis.vanderbilt.edu
Subject: [area]: [synopsis]
- CIAO VERSION: 1.1.6
- TAO VERSION : 2.1.6
- ACE VERSION : 6.1.6
+ CIAO VERSION: 1.1.4
+ TAO VERSION : 2.1.4
+ ACE VERSION : 6.1.4
HOST MACHINE and OPERATING SYSTEM:
If on Windows based OS's, which version of WINSOCK do you
diff --git a/CIAO/VERSION b/CIAO/VERSION
index 213c2a26e2c..a3ef6c0e8a3 100644
--- a/CIAO/VERSION
+++ b/CIAO/VERSION
@@ -1,4 +1,4 @@
-This is CIAO version 1.1.6, released Mon Nov 12 09:34:14 CET 2012
+This is CIAO version 1.1.4, released Wed Aug 29 08:16:04 CEST 2012
If you have any problems with or questions about CIAO, please send
e-mail to the CIAO mailing list (ciao-users@list.isis.vanderbilt.edu),
diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst
index 0fb2c5d210b..e70ac1e52b1 100644
--- a/CIAO/bin/ciao_tests.lst
+++ b/CIAO/bin/ciao_tests.lst
@@ -27,7 +27,6 @@ TAO/CIAO/tests/Bug_3834_Regression/descriptors/run_test.pl:
TAO/CIAO/tests/Bug_3834_Regression/descriptors/run_test_without_ns.pl:
TAO/CIAO/tests/IDL3/Events/Any/run_test.pl: !CCM_NOEVENT
TAO/CIAO/tests/Bug_3769_Regression/descriptors/run_test.pl:
-TAO/CIAO/tests/Bug_3769_Regression/descriptors/run_test_cdr.pl:
TAO/CIAO/tests/Thread/descriptors/run_test.pl: !CCM_NOEVENT
TAO/CIAO/tests/Thread/descriptors/run_test_cdd.pl: !CCM_NOEVENT
TAO/CIAO/tests/CIF/descriptors/run_test.pl: ATIC
diff --git a/CIAO/ccm/CCM_Transaction.idl b/CIAO/ccm/CCM_Transaction.idl
index 00170ff16a9..7e85f9614e7 100644
--- a/CIAO/ccm/CCM_Transaction.idl
+++ b/CIAO/ccm/CCM_Transaction.idl
@@ -10,6 +10,7 @@ module Components
{
typeprefix Components "omg.org";
+ // @@ Components::Transaction is still there.
module Transaction
{
diff --git a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
index a5f128de2d4..0946d292ebb 100644
--- a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
+++ b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
@@ -19,9 +19,9 @@ namespace CIAO
if (CORBA::is_nil (this->orb_))
{
CIAO_ERROR (1, (LM_ERROR, CLINFO
- "CIAO_StoreReferences_i::CIAO_StoreReferences_i -"
+ "Container_Handler_i::configure -"
"Unable to locate ORB.\n"));
- throw ::Deployment::StartError ("CIAO_StoreReferences_i",
+ throw ::Deployment::StartError ("CIAO Container Handler",
"Unable to locate ORB");
}
}
@@ -135,7 +135,7 @@ namespace CIAO
CIAO_ERROR (1, (LM_ERROR, CLINFO
"CIAO_ReferenceLookup_i::CIAO_ReferenceLookup_i -"
"Unable to locate ORB.\n"));
- throw ::Deployment::StartError ("CIAO_ReferenceLookup_i",
+ throw ::Deployment::StartError ("CIAO Container Handler",
"Unable to locate ORB");
}
}
diff --git a/CIAO/ciao/Version.h b/CIAO/ciao/Version.h
index 09b1fba3d5f..adf4ee98e05 100644
--- a/CIAO/ciao/Version.h
+++ b/CIAO/ciao/Version.h
@@ -5,5 +5,5 @@
#define CIAO_MAJOR_VERSION 1
#define CIAO_MINOR_VERSION 1
-#define CIAO_BETA_VERSION 6
-#define CIAO_VERSION "1.1.6"
+#define CIAO_BETA_VERSION 4
+#define CIAO_VERSION "1.1.4"
diff --git a/CIAO/connectors/dds4ccm/impl/DataReaderListener_T.cpp b/CIAO/connectors/dds4ccm/impl/DataReaderListener_T.cpp
index 24b30dfb4a3..a89e62d4db6 100644
--- a/CIAO/connectors/dds4ccm/impl/DataReaderListener_T.cpp
+++ b/CIAO/connectors/dds4ccm/impl/DataReaderListener_T.cpp
@@ -113,18 +113,18 @@ namespace CIAO
{
::DDS::ReadCondition_var rd = ::DDS::ReadCondition::_narrow (qc.in ());
result = reader->take_w_condition (data,
- sample_info,
- max_samples,
- rd.in ());
+ sample_info,
+ max_samples,
+ rd.in ());
}
else
{
result = reader->take (data,
- sample_info,
- max_samples,
- ::DDS::NOT_READ_SAMPLE_STATE,
- ::DDS::NEW_VIEW_STATE | ::DDS::NOT_NEW_VIEW_STATE,
- ::DDS::ANY_INSTANCE_STATE);
+ sample_info,
+ max_samples,
+ ::DDS::NOT_READ_SAMPLE_STATE,
+ ::DDS::NEW_VIEW_STATE | ::DDS::NOT_NEW_VIEW_STATE,
+ ::DDS::ANY_INSTANCE_STATE);
}
DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_DDS_STATUS, (LM_INFO, DDS4CCM_INFO
diff --git a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp b/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp
index 0fbf6d646da..e72d4b175ff 100644
--- a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp
+++ b/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp
@@ -151,11 +151,6 @@ namespace CIAO
ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard,
this->dps_mutex_, CORBA::INTERNAL ());
- if (::CORBA::is_nil (dp))
- {
- return false;
- }
-
std::string profile;
if (qos_profile)
{
@@ -185,7 +180,7 @@ namespace CIAO
DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO
"DomainParticipantManager::register_participant - "
"Added a new DomainParticipant "
- "for domain <%d> with profile <%C> handle "
+ "for domain <%d> with profile<%C> handle "
DDS_ENTITY_FORMAT_SPECIFIER ".\n",
domain_id, qos_profile,
DDS_ENTITY_LOG (dp)));
@@ -214,11 +209,6 @@ namespace CIAO
ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard,
this->dps_mutex_, CORBA::INTERNAL ());
- if (::CORBA::is_nil (dp))
- {
- return false;
- }
-
std::string profile;
if (qos_profile)
{
@@ -235,10 +225,9 @@ namespace CIAO
"DomainParticipantManager::unregister_participant - "
"Delete participant "
DDS_ENTITY_FORMAT_SPECIFIER
- " for domain <%d> with profile <%C> since ref_count is one.\n",
+ " for domain <%d> since ref_count is one.\n",
DDS_ENTITY_LOG (dp),
- domain_id,
- qos_profile));
+ domain_id));
delete iter->second;
// Save to remove from list
@@ -250,11 +239,10 @@ namespace CIAO
"DomainParticipantManager::unregister_participant - "
"Don't delete participant "
DDS_ENTITY_FORMAT_SPECIFIER
- " for domain <%d> with profile <%C> since "
+ " for domain <%d> since "
"it's still used - ref_count is <%d>\n",
DDS_ENTITY_LOG (dp),
domain_id,
- qos_profile,
iter->second->_ref_count ()));
iter->second->_dec_ref ();
return false;
diff --git a/CIAO/tests/Bug_3769_Regression/Foo.idl b/CIAO/tests/Bug_3769_Regression/Foo.idl
index dd4e9658e7a..f3eb1856985 100644
--- a/CIAO/tests/Bug_3769_Regression/Foo.idl
+++ b/CIAO/tests/Bug_3769_Regression/Foo.idl
@@ -61,31 +61,6 @@ interface FooSupport
attribute short supported_short;
};
-module StructModule
-{
- typedef unsigned long long Seconds;
- typedef unsigned long NanoSecs;
-
- struct Time
- {
- Seconds sec;
- NanoSecs nanosec;
- };
-
- enum EndTime
- {
- DLT_NONE,
- DLT_SOFT,
- DLT_HARD
- };
-
- struct StructStruct
- {
- Time struct_time;
- EndTime type;
- };
-};
-
component Foo supports FooSupport
{
attribute short my_short;
@@ -111,7 +86,6 @@ component Foo supports FooSupport
attribute Baz my_baz_struct;
attribute Data my_data_union;
attribute Data2 my_var_data_union;
- attribute StructModule::StructStruct my_struct_struct;
};
#endif /* FOO_IDL_ */
diff --git a/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp b/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp
index 8f835697dd5..e9776398808 100644
--- a/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp
+++ b/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp
@@ -24,8 +24,7 @@ namespace CIAO_Foo_Impl
my_string_sequence_ (false),
my_fixed_string_ (false),
my_variable_string_ (false),
- supported_short_ (false),
- my_struct_struct_ (false)
+ supported_short_ (false)
{
}
@@ -523,37 +522,6 @@ namespace CIAO_Foo_Impl
{
}
- StructModule::StructStruct Foo_exec_i::my_struct_struct (void)
- {
- return StructModule::StructStruct ();
- }
-
- void Foo_exec_i::my_struct_struct (const StructModule::StructStruct & my_struct_struct)
- {
- bool error_found = false;
-
- if (my_struct_struct.type != StructModule::DLT_HARD)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: my_struct_struct.deadline_type != 2, it is %d\n",
- my_struct_struct.type));
- error_found = true;
- }
- if (my_struct_struct.struct_time.sec != 15)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: my_struct_struct.struct_time.sec != 15, it is %d\n",
- my_struct_struct.struct_time.sec));
- error_found = true;
- }
- if (my_struct_struct.struct_time.nanosec != 20)
- {
- ACE_ERROR ((LM_ERROR, "ERROR: my_struct_struct.struct_time.nanosec != 20, it is %d\n",
- my_struct_struct.struct_time.nanosec));
- error_found = true;
- }
-
- my_struct_struct_ = !error_found;
- }
-
// Operations from Components::SessionComponent.
void
@@ -591,8 +559,7 @@ namespace CIAO_Foo_Impl
my_string_sequence_ &&
my_fixed_string_ &&
my_variable_string_ &&
- supported_short_ &&
- my_struct_struct_))
+ supported_short_))
{
ACE_ERROR ((LM_ERROR, "ERROR: Not all expected attributes were initialized\n"));
}
diff --git a/CIAO/tests/Bug_3769_Regression/Foo_exec.h b/CIAO/tests/Bug_3769_Regression/Foo_exec.h
index a7040cc9099..0b3bf4dccd9 100644
--- a/CIAO/tests/Bug_3769_Regression/Foo_exec.h
+++ b/CIAO/tests/Bug_3769_Regression/Foo_exec.h
@@ -196,11 +196,6 @@ namespace CIAO_Foo_Impl
virtual ::string_array_slice *my_string_array (void);
virtual void my_string_array (const ::string_array my_string_array);
-
- virtual StructModule::StructStruct my_struct_struct (void);
-
- virtual void my_struct_struct (const StructModule::StructStruct & my_struct_struct);
-
//@}
//@{
@@ -236,8 +231,7 @@ namespace CIAO_Foo_Impl
my_string_sequence_,
my_fixed_string_,
my_variable_string_,
- supported_short_,
- my_struct_struct_;
+ supported_short_;
};
diff --git a/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp b/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp
index 44b82e54a1b..ef8f777f3f6 100644
--- a/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp
+++ b/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp
@@ -542,83 +542,6 @@
</value>
</value>
</configProperty>
-
- <configProperty>
- <name>my_struct_struct</name>
- <value>
- <type>
- <kind>tk_struct</kind>
- <struct>
- <name>StructStruct</name>
- <typeId>IDL:StructModule/StructStruct:1.0</typeId>
- <member>
- <name>struct_time</name>
- <type>
- <kind>tk_struct</kind>
- <struct>
- <name>Time</name>
- <typeId>IDL:StructModule/Time:1.0</typeId>
- <member>
- <name>sec</name>
- <type>
- <kind>tk_ulonglong</kind>
- </type>
- </member>
- <member>
- <name>nanosec</name>
- <type>
- <kind>tk_ulong</kind>
- </type>
- </member>
- </struct>
- </type>
- </member>
-
- <member>
- <name>type</name>
- <type>
- <kind>tk_enum</kind>
- <enum>
- <name>EndTime</name>
- <typeId>IDL:StructModule/EndTime:1.0</typeId>
- <member>DLT_NONE</member>
- <member>DLT_SOFT</member>
- <member>DLT_HARD</member>
- </enum>
- </type>
- </member>
-
- </struct>
- </type>
- <value>
- <member>
- <name>struct_time</name>
- <value>
- <member>
- <name>sec</name>
- <value>
- <ulonglong>15</ulonglong>
- </value>
- </member>
- <member>
- <name>nanosec</name>
- <value>
- <ulong>20</ulong>
- </value>
- </member>
- </value>
- </member>
-
- <member>
- <name>type</name>
- <value>
- <enum>DLT_HARD</enum>
- </value>
- </member>
- </value>
-
- </value>
- </configProperty>
</instance>
<artifact xmi:id="_669DBD2E-E130-11DE-B472-00242C889DAA">
diff --git a/CIAO/tests/Bug_3769_Regression/descriptors/run_test_cdr.pl b/CIAO/tests/Bug_3769_Regression/descriptors/run_test_cdr.pl
deleted file mode 100755
index ead7a7c7e98..00000000000
--- a/CIAO/tests/Bug_3769_Regression/descriptors/run_test_cdr.pl
+++ /dev/null
@@ -1,251 +0,0 @@
-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::TestTarget;
-
-$CIAO_ROOT = "$ENV{'CIAO_ROOT'}";
-$TAO_ROOT = "$ENV{'TAO_ROOT'}";
-$DANCE_ROOT = "$ENV{'DANCE_ROOT'}";
-
-$daemons_running = 0;
-$em_running = 0;
-$ns_running = 0;
-
-$nr_daemon = 1;
-@ports = ( 60001 );
-@iorbases = ( "NodeApp2.ior" );
-@iorfiles = 0;
-@nodenames = ( "NodeOne" );
-
-# ior files other than daemon
-# ior files other than daemon
-$ior_nsbase = "ns.ior";
-$ior_nsfile = 0;
-$ior_embase = "EM.ior";
-$ior_emfile = 0;
-
-# Processes
-$E = 0;
-$EM = 0;
-$NS = 0;
-@DEAMONS = 0;
-
-# targets
-@tg_daemons = 0;
-$tg_naming = 0;
-$tg_exe_man = 0;
-$tg_executor = 0;
-
-$status = 0;
-$cdp_file = "DeploymentPlan.cdp";
-
-sub create_targets {
- # naming service
- $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n";
- $tg_naming->AddLibPath ('..');
- # daemon
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for daemon $i failed\n";
- $tg_daemons[$i]->AddLibPath ('..');
- }
- # execution manager
- $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n";
- $tg_exe_man->AddLibPath ('..');
- # executor (plan_launcher)
- $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n";
- $tg_executor->AddLibPath ('..');
-}
-
-sub init_ior_files {
- $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase);
- $ior_emfile = $tg_exe_man->LocalFile ($ior_embase);
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
- }
- delete_ior_files ();
-}
-
-# Delete if there are any .ior files.
-sub delete_ior_files {
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $tg_daemons[$i]->DeleteFile ($iorbases[$i]);
- }
- $tg_naming->DeleteFile ($ior_nsbase);
- $tg_exe_man->DeleteFile ($ior_embase);
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
- }
-}
-
-sub kill_node_daemon {
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
- }
-}
-
-sub kill_open_processes {
- if ($daemons_running == 1) {
- kill_node_daemon ();
- }
-
- if ($em_running == 1) {
- $EM->Kill (); $EM->TimedWait (1);
- }
-
- if ($ns_running == 1) {
- $NS->Kill (); $NS->TimedWait (1);
- }
- # in case shutdown did not perform as expected
- $tg_executor->KillAll ('dance_locality_manager');
-}
-
-sub run_node_daemons {
- for ($i = 0; $i < $nr_daemon; ++$i) {
- $iorbase = $iorbases[$i];
- $iorfile = $iorfiles[$i];
- $port = $ports[$i];
- $nodename = $nodenames[$i];
- $iiop = "iiop://localhost:$port";
- $node_app = $tg_daemons[$i]->GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager";
-
- $d_cmd = "$DANCE_ROOT/bin/dance_node_manager";
- $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService --instance-nc corbaloc:rir:/NameService";
-
- print "Run dance_node_manager with $d_param\n";
-
- $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param);
- $DEAMONS[$i]->Spawn ();
-
- if ($tg_daemons[$i]->WaitForFileTimed($iorbase,
- $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) {
- print STDERR
- "ERROR: The ior $iorfile file of node daemon $i could not be found\n";
- for (; $i >= 0; --$i) {
- $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
- }
- return -1;
- }
- }
- return 0;
-}
-
-create_targets ();
-init_ior_files ();
-
-# Invoke naming service
-
-$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile");
-
-$ns_status = $NS->Spawn ();
-
-if ($ns_status != 0) {
- print STDERR "ERROR: Unable to execute the naming service\n";
- kill_open_processes ();
- exit 1;
-}
-
-print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n";
-
-if ($tg_naming->WaitForFileTimed ($ior_nsbase,
- $tg_naming->ProcessStartWaitInterval ()) == -1) {
- print STDERR "ERROR: cannot find naming service IOR file\n";
- $NS->Kill (); $NS->TimedWait (1);
- exit 1;
-}
-
-$ns_running = 1;
-# Set up NamingService environment
-$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService";
-
-# Invoke node daemon.
-print "Invoking node daemon\n";
-$status = run_node_daemons ();
-
-if ($status != 0) {
- print STDERR "ERROR: Unable to execute the node daemon\n";
- kill_open_processes ();
- exit 1;
-}
-
-$cdr_file = $cdp_file;
-$cdr_file =~ s/cdp/cdr/;
-
-print "Converting $cdp_file to $cdr_file\n";
-
-$tg_executor->DeleteFile ($cdr_file);
-
-$CONVERT = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_convert_plan", "-x $cdp_file -o $cdr_file");
-
-$convert_status = $CONVERT->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
-
-if ($convert_status != 0) {
- print STDERR "ERROR: Can't convert $cdp_file to $cdr_file\n";
- kill_open_processes ();
- exit 1;
-}
-
-$daemons_running = 1;
-
-# Invoke execution manager.
-print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n";
-$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
- "-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
-$EM->Spawn ();
-
-if ($tg_exe_man->WaitForFileTimed ($ior_embase,
- $tg_exe_man->ProcessStartWaitInterval ()) == -1) {
- print STDERR
- "ERROR: The ior file of execution manager could not be found\n";
- kill_open_processes ();
- exit 1;
-}
-
-$em_running = 1;
-
-# Invoke executor - start the application -.
-print "Invoking executor - launch the application -\n";
-
-print "Start dance_plan_launcher.exe with -c $cdr_file -k file://$ior_emfile\n";
-$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
- "-c $cdr_file -k file://$ior_emfile");
-$E->SpawnWaitKill (2*$tg_executor->ProcessStartWaitInterval ());
-
-for ($i = 0; $i < $nr_daemon; ++$i) {
- if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i],
- $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) {
- print STDERR "ERROR: The ior file of daemon $i could not be found\n";
- kill_open_processes ();
- exit 1;
- }
-}
-
-print "Sleeping 5 seconds to allow task to complete\n";
-sleep (5);
-
-# Invoke executor - stop the application -.
-print "Invoking executor - stop the application -\n";
-print "by running dance_plan_launcher.exe with -k file://$ior_emfile -c $cdr_file\n";
-
-$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
- "-k file://$ior_emfile -c $cdr_file -s");
-
-$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
-
-if ($pl_status != 0) {
- print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
- kill_open_processes ();
- exit 1;
-}
-
-print "Executor returned.\n";
-print "Shutting down rest of the processes.\n";
-
-delete_ior_files ();
-kill_open_processes ();
-
-exit $status;
diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog
index 5013514263c..8b83c99b8a6 100644
--- a/DAnCE/ChangeLog
+++ b/DAnCE/ChangeLog
@@ -1,31 +1,3 @@
-Mon Nov 12 10:07:08 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for next release
-
-Mon Nov 12 09:34:14 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * DAnCE version 1.1.6 released.
-
-Fri Oct 12 11:18:36 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * dance/LocalityManager/Handler/Inst_Handler_Impl.cpp:
- Fixed incorrect else
-
- * dance/Plan_Launcher/EM_Launcher.cpp:
- * dance/Plan_Launcher/LM_Launcher.cpp:
- * dance/Plan_Launcher/NM_Launcher.cpp:
- Layout changes
-
-Fri Oct 12 10:52:52 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for x.1.5
-
-Fri Oct 12 11:20:25 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * DAnCE version 1.1.5 released.
-
Tue Sep 25 18:36:35 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* dance/LocalityManager/Handler/Config_Handler_Impl.h:
diff --git a/DAnCE/NEWS b/DAnCE/NEWS
index 4e32eb8d4d9..98a3621851f 100644
--- a/DAnCE/NEWS
+++ b/DAnCE/NEWS
@@ -1,16 +1,6 @@
-USER VISIBLE CHANGES BETWEEN DAnCE-1.1.6 and DAnCE-1.1.7
-=======================================================
-
-USER VISIBLE CHANGES BETWEEN DAnCE-1.1.5 and DAnCE-1.1.6
-=======================================================
-
-. None
-
USER VISIBLE CHANGES BETWEEN DAnCE-1.1.4 and DAnCE-1.1.5
=======================================================
-. None
-
USER VISIBLE CHANGES BETWEEN DAnCE-1.1.3 and DAnCE-1.1.4
=======================================================
diff --git a/DAnCE/PROBLEM-REPORT-FORM b/DAnCE/PROBLEM-REPORT-FORM
index 40aebbfd976..dbc1b857c1d 100644
--- a/DAnCE/PROBLEM-REPORT-FORM
+++ b/DAnCE/PROBLEM-REPORT-FORM
@@ -41,9 +41,9 @@
To: ciao-users@list.isis.vanderbilt.edu
Subject: [area]: [synopsis]
- DAnCE VERSION: 1.1.6
- TAO VERSION : 2.1.6
- ACE VERSION : 6.1.6
+ DAnCE VERSION: 1.1.4
+ TAO VERSION : 2.1.4
+ ACE VERSION : 6.1.4
HOST MACHINE and OPERATING SYSTEM:
If on Windows based OS's, which version of WINSOCK do you
diff --git a/DAnCE/VERSION b/DAnCE/VERSION
index 898eaaa99e4..08cc0ce6622 100644
--- a/DAnCE/VERSION
+++ b/DAnCE/VERSION
@@ -1,4 +1,4 @@
-This is DAnCE version 1.1.6, released Mon Nov 12 09:34:14 CET 2012
+This is DAnCE version 1.1.4, released Wed Aug 29 08:16:04 CEST 2012
If you have any problems with or questions about DAnCE, please send
e-mail to the CIAO mailing list (ciao-users@list.isis.vanderbilt.edu),
diff --git a/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp b/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp
index 396f8f38848..a18c321451a 100644
--- a/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp
+++ b/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp
@@ -153,15 +153,15 @@ namespace DAnCE
{
deps.insert (id);
}
- else
- {
- DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
- (LM_ERROR, DLINFO
- ACE_TEXT ("Inst_Handler_Impl::install_instance - ")
- ACE_TEXT ("Unable to extract dependency order from string")));
- throw ::Deployment::StartError (idd.name.in (),
- "Unable to extract dependency order from string");
- }
+ }
+ else
+ {
+ DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
+ (LM_ERROR, DLINFO
+ ACE_TEXT ("Inst_Handler_Impl::install_instance - ")
+ ACE_TEXT ("Unable to extract dependency order from string")));
+ throw ::Deployment::StartError (idd.name.in (),
+ "Unable to extract dependency order from string");
}
}
diff --git a/DAnCE/dance/Plan_Launcher/EM_Launcher.cpp b/DAnCE/dance/Plan_Launcher/EM_Launcher.cpp
index 1af0d78880c..68e6e91fc1a 100644
--- a/DAnCE/dance/Plan_Launcher/EM_Launcher.cpp
+++ b/DAnCE/dance/Plan_Launcher/EM_Launcher.cpp
@@ -10,8 +10,11 @@ namespace DAnCE
{
}
+
+
EM_Launcher::~EM_Launcher (void)
{
+
}
bool
@@ -64,4 +67,5 @@ namespace DAnCE
return false;
}
+
}
diff --git a/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp b/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp
index dce9f3a88be..de595a0672c 100644
--- a/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp
+++ b/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp
@@ -10,8 +10,11 @@ namespace DAnCE
{
}
+
+
LM_Launcher::~LM_Launcher (void)
{
+
}
/*
diff --git a/DAnCE/dance/Plan_Launcher/NM_Launcher.cpp b/DAnCE/dance/Plan_Launcher/NM_Launcher.cpp
index 05515a3e049..e13614250cc 100644
--- a/DAnCE/dance/Plan_Launcher/NM_Launcher.cpp
+++ b/DAnCE/dance/Plan_Launcher/NM_Launcher.cpp
@@ -10,7 +10,10 @@ namespace DAnCE
{
}
+
+
NM_Launcher::~NM_Launcher (void)
{
+
}
}
diff --git a/DAnCE/dance/Version.h b/DAnCE/dance/Version.h
index a96876dd29b..f5a2e84711a 100644
--- a/DAnCE/dance/Version.h
+++ b/DAnCE/dance/Version.h
@@ -5,5 +5,5 @@
#define DAnCE_MAJOR_VERSION 1
#define DAnCE_MINOR_VERSION 1
-#define DAnCE_BETA_VERSION 6
-#define DAnCE_VERSION "1.1.6"
+#define DAnCE_BETA_VERSION 4
+#define DAnCE_VERSION "1.1.4"
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 7f03bddf22f..34c440bde39 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,217 +1,23 @@
-Mon Nov 26 11:50:40 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+Tue Nov 20 22:41:56 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
- * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
- Added install back for imr
-
-Sat Nov 24 10:02:12 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
- No need to set explicit install
-
-Sat Nov 24 09:17:21 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp:
- Fixed compile error
-
-Fri Nov 23 19:15:15 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
-
- * TAO_IDL/ast/ast_module.cpp:
- * TAO_IDL/include/ast_module.h:
- * TAO_IDL/util/utl_global.cpp:
-
- Fixed bug caused by (1) processing multiple IDL files in one pass
- and (2) any IDL file except the last containing an include of
- orb.idl. This include causes reopenings of the CORBA module,
- in addition to the one created internally by tao_idl to contain
- the basic types. This last is a special module, but like other
- AST nodes, contains a reference to the most recent reopening
- in its parent scope. Since the reopened CORBA modules are
- destroyed after the included file is processed, this special
- module contained a garbage reference, since it is not destroyed
- until all IDL files are processed. Code was added to reset
- this reference to the module itself after each file is processed.
- Thanks to Sergey Onuchin <sonuchin at parallels dot com> for
- reporting the bug and for supplying example IDL files.
-
- * TAO_IDL/util/utl_scope.cpp:
-
- Cosmetic changes.
-
- * tests/IDL_Test/loader_const.idl:
- * tests/IDL_Test/PEMNaming.idl:
-
- New files that formerly reproduced the bug described above.
-
- * tests/IDL_Test/IDL_Test.mpc:
-
- Updated the MPC file to use the new IDL files above.
-
-Fri Nov 23 17:55:33 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
- Updated for rename of readme
-
-Fri Nov 23 16:48:56 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/ImplRepo_Service/README:
- * orbsvcs/ImplRepo_Service/README.txt:
- Renamed to README to be consistent with other orbsvcs
-
-Fri Nov 23 15:35:46 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
- Use install as base instead of install_bin
-
-Fri Nov 23 15:27:26 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/Concurrency_Service/Concurrency_Service.mpc:
- * orbsvcs/CosEvent_Service/CosEvent_Service.mpc:
- * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
- * orbsvcs/Naming_Service/Naming_Service.mpc:
- * orbsvcs/Notify_Service/Notify_Service.mpc:
- * orbsvcs/Time_Service/Time_Service.mpc:
- * orbsvcs/Trading_Service/Trading_Service.mpc:
- * utils/catior/catior.mpc:
- * utils/nslist/nslist.mpc:
- Install readme files also
-
-Fri Nov 23 13:31:09 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+ * MPC/config/ft_naming_serv.mpb:
* orbsvcs/Naming_Service/Naming_Service.mpc:
- Also install readme
-
-Fri Nov 23 08:08:57 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp:
- * orbsvcs/tests/Bug_3486_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp:
- * orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp:
- * tao/CSD_Framework/CSD_ORBInitializer.cpp:
- * tao/Codeset/Codeset_Manager_i.cpp:
- * tao/ORBInitializer_Registry.cpp:
- * tao/ORB_Core.cpp:
- * tao/PI/ORBInitInfo.cpp:
- * tao/PortableServer/LifespanStrategyPersistent.cpp:
- * tao/RTCORBA/RT_ORBInitializer.cpp:
- * tao/TAO_Internal.cpp:
- * tao/params.cpp:
- * tests/Bug_2677_Regression/server.cpp:
- * tests/Bug_2936_Regression/bug2936.cpp:
- * tests/Bug_3542_Regression/server.cpp:
- * tests/DLL_ORB/client.cpp:
- * tests/DLL_ORB/server.cpp:
- * tests/ORB_Local_Config/Bug_2612/Test.cpp:
- * tests/ORB_Local_Config/Service_Dependency/Test.cpp:
- * tests/TransportCurrent/Framework/simple.cpp:
- Use ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE with the TAO_VERSION
- so that with Debian/Ubuntu packaged distro's we try to load
- the correct library which for example are named libTAO-6.1.1.so
-
-Tue Nov 20 19:32:42 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/Utils/PolicyList_Destroyer.cpp:
- Call index also in the try/catch scope because it can also
- throw an exception
-
-Tue Nov 20 13:39:00 UTC 2012 Simon Massey <Simon dot massey at prismtech dot com>
-
- * TAO_IDL/be/be_util.cpp:
- Remove Help message concerning -si parameter that is no longer
- accepted. (As of Sun Nov 27 18:19:18 UTC 2011 Johnny Willemsen
- the S.inl files are not generated anymore.)
-
-Mon Nov 12 10:07:02 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
- * NEWS:
- Updated for next release
-
-Mon Nov 12 09:34:14 CET 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * TAO version 2.1.6 released.
-
-Fri Nov 9 12:06:03 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * examples/Simple/time/Time_Client_i.cpp:
- Don't shutdown the orb, the client template already does
- that
-
- * examples/Simple/time/server.cpp:
- Layout changes
-
- * examples/Simple/Simple_util.cpp:
- Fixed memory leak
-
-Tue Nov 6 14:06:48 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for ObjRefTemplate chnages
-
-Mon Nov 5 08:25:48 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/Cache_Entries_T.h:
- Use bool instead of CORBA::Boolean
-
- * tao/LocateRequest_Invocation.cpp:
- * tao/Transport.h:
- * tao/Transport_Cache_Manager_T.cpp:
- * tao/Transport_Connector.cpp:
- Const, layout, and doxygen changes
-
-Wed Oct 31 09:09:25 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+ * orbsvcs/orbsvcs/FtNaming.mpc:
- * tao/PortableServer/Root_POA.cpp:
- Updated if comparison
-
- * tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl:
- Increased wait time for slower targets
-
-Tue Oct 30 10:50:49 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/PortableServer/Root_POA.h:
- * tao/PortableServer/Root_POA.cpp:
- Cache ORT_Adapter_Factory in the POA at creation, prevents
- a lookup when (un)registering a servant which could trigger
- a possible deadlock when the registering of the servant is
- coming from the init of an ACE service
-
-Fri Oct 19 07:56:56 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/AnyTypeCode/Alias_TypeCode.cpp:
- * tao/AnyTypeCode/Alias_TypeCode_Static.cpp:
- * tao/AnyTypeCode/Objref_TypeCode.cpp:
- * tao/AnyTypeCode/Objref_TypeCode_Static.cpp:
- * tao/Any_Insert_Policy_T.h:
- Layout changes
-
-Wed Oct 17 12:31:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h:
- Doxygen change
-
- * tao/PortableServer/Root_POA.cpp:
- Layout change
-
-Mon Oct 15 13:26:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * tao/Messaging/AMH_Response_Handler.h:
- Use virtual inheritance
-
- * tao/PortableServer/Root_POA.h:
- Doxygen fix
-
-Fri Oct 12 10:51:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
-
- * NEWS:
- Updated for x.1.5
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp:
-Fri Oct 12 11:20:25 CEST 2012 Johnny Willemsen <jwillemsen@remedy.nl>
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp:
- * TAO version 2.1.5 released.
+ * utils/nsgroup/run_test.pl:
Wed Oct 3 08:25:41 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
diff --git a/TAO/MPC/config/dynamic_tp.mpb b/TAO/MPC/config/dynamic_tp.mpb
new file mode 100644
index 00000000000..8682db73c3f
--- /dev/null
+++ b/TAO/MPC/config/dynamic_tp.mpb
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project : taolib, pi {
+ after += Dynamic_TP
+ libs += TAO_Dynamic_TP
+}
diff --git a/TAO/MPC/config/ft_naming_serv.mpb b/TAO/MPC/config/ft_naming_serv.mpb
new file mode 100644
index 00000000000..8d54dab6727
--- /dev/null
+++ b/TAO/MPC/config/ft_naming_serv.mpb
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcslib, naming_skel, naming_serv, iortable, messaging_optional, svc_utils {
+ after += FT_Naming_Serv
+ libs += TAO_FT_Naming_Serv
+}
diff --git a/TAO/MPC/config/ftnaming.mpb b/TAO/MPC/config/ftnaming.mpb
new file mode 100644
index 00000000000..fbf20dfc312
--- /dev/null
+++ b/TAO/MPC/config/ftnaming.mpb
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project : ftorbutils, naming, portablegroup, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
+ after += FtNaming
+ libs += TAO_FtNaming
+ tagchecks += FtNaming
+}
diff --git a/TAO/NEWS b/TAO/NEWS
index 39f716bcf51..74637645be4 100644
--- a/TAO/NEWS
+++ b/TAO/NEWS
@@ -1,18 +1,6 @@
-USER VISIBLE CHANGES BETWEEN TAO-2.1.6 and TAO-2.1.7
-====================================================
-
-USER VISIBLE CHANGES BETWEEN TAO-2.1.5 and TAO-2.1.6
-====================================================
-
-. We only try to load the ObjRefTemplate library at POA
- creation instead of trying to load it at each servant
- activation
-
USER VISIBLE CHANGES BETWEEN TAO-2.1.4 and TAO-2.1.5
====================================================
-. None
-
USER VISIBLE CHANGES BETWEEN TAO-2.1.3 and TAO-2.1.4
====================================================
@@ -42,7 +30,7 @@ USER VISIBLE CHANGES BETWEEN TAO-2.1.3 and TAO-2.1.4
enabled interfaces on platforms that this is not the default. This has been
observed to be required for the UIPMCAcceptor to open on the most recent
Linux distribs.
-
+
NOTE that there is an obvious elephant in the room in testing this option,
we can't rely on any build/test machine having more than one (or any?)
interfaces so the test (TAO/orbsvcs/tests/Miop/McastPreferredInterfaces),
diff --git a/TAO/OCI_RE_ChangeLog b/TAO/OCI_RE_ChangeLog
new file mode 100644
index 00000000000..ba817806982
--- /dev/null
+++ b/TAO/OCI_RE_ChangeLog
@@ -0,0 +1,1440 @@
+Sun Nov 25 15:27:16 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/Naming_Service/Naming_Service.cpp:
+
+ Fixed initialization order of data members.
+
+ * orbsvcs/orbsvcs/Naming/Storable.h:
+
+ Added dll export for class.
+
+Sat Nov 24 21:48:11 UTC 2012 unknown <unknown@>
+
+ * MPC/config/ft_naming_serv.mpb:
+
+ Add additional component.
+
+ * orbsvcs/Naming_Service/Naming_Service.cpp:
+
+ Fixed initialization order of data members.
+
+Fri Nov 23 23:47:50 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/README.nsgroup:
+
+ Updated documentation for group_bind and group_unbind options
+
+ * utils/nsgroup/run_test.pl:
+
+ Tied output redirection to debug command line option
+
+Fri Nov 23 14:57:58 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/tests/Simple_Naming/client.cpp:
+ * orbsvcs/tests/Simple_Naming/run_test_ft.pl:
+
+ Fixed test to clean out state on each run. Cleaned up fuzz errors.
+
+Fri Nov 23 14:06:26 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * bin/tao_other_tests.lst:
+ * orbsvcs/tests/Simple_Naming/run_test_ft.pl:
+
+ Added simple naming tests for FT_Naming.
+
+ * orbsvcs/orbsvcs/FtNaming.mpc:
+
+ Removed unnecessary elements.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+
+ Removed printout to clean up error messages.
+
+Wed Nov 21 23:07:07 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/CSD_ThreadPool/CSD_TP_Task.h:
+ * tao/CSD_ThreadPool/CSD_TP_Task.cpp:
+
+ Rename the argument to open to reinforce the generic nature
+ of the single void * argument.
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl:
+
+ Minor scoreboard cleanup.
+
+ * tao/Dynamic_TP/Dynamic_TP_Task.h:
+ * tao/Dynamic_TP/Dynamic_TP_Task.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp:
+
+ Refactored the task open() signature to take a single void *
+ argument. This is important to avoid generating a new
+ signature. Since the argument is a void*, a struct is used to
+ pass multiple discrete values. This should probably just use the
+ TP_Definition struct, rather than define something new.
+
+ * tests/Dynamic_TP/Config_Loader/Test.cpp:
+ * tests/Dynamic_TP/POA_Loader/Test.cpp:
+
+ Minor scoreboard cleanup.
+
+Wed Nov 21 23:20:54 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/nsgroup.cpp:
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Updated header paths
+
+ * utils/nsgroup/run_test.pl:
+
+ Added support for showing output files upon error detection.
+
+Wed Nov 21 22:24:28 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/tests/Simple_Naming/run_test_ffp.pl:
+
+ Added tests for tao_ft_naming to the test suite.
+
+Wed Nov 21 20:46:58 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+
+ Added documentation to describe why release is required.
+
+ * orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h:
+
+ Added TAO_Naming_Serv_Export to support dll.
+
+Wed Nov 21 20:10:01 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * orbsvcs/orbsvcs/CosNaming_Serv.mpc:
+ * orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.cpp:
+
+ Added new class that's a more general version of
+ original File_Open_Lock_and_Check class so that
+ it can be used for other persistent data besides
+ contexts.
+
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp:
+
+ Changed File_Open_Lock_and_Check to derive from
+ Naming_Service_File_Guard and override pure virtual
+ functions as needed.
+
+ * orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h:
+ * orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable.h:
+
+ Added stream operator on strings in anticipation
+ of using these operators on some of the object
+ group elements. Udating existing stream operators
+ to use string operators.
+
+Wed Nov 21 20:03:03 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/run_test.pl:
+
+ Redirected output to files and more cleanup
+
+Wed Nov 21 18:19:17 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+
+ Fixed bug in release of Activator.
+
+Wed Nov 21 16:35:28 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/ImplRepo_Service/Config_Backing_Store.h:
+ * orbsvcs/ImplRepo_Service/Locator_Repository.h:
+ * orbsvcs/ImplRepo_Service/XML_Backing_Store.h:
+
+ * orbsvcs/Naming_Service/FT_Naming_Service.h:
+ * orbsvcs/Naming_Service/FT_Naming_Service.cpp:
+ * orbsvcs/Naming_Service/Naming_Service.h:
+ * orbsvcs/Naming_Service/Naming_Service.cpp:
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h:
+
+ * orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp:
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp:
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README:
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp:
+
+ * orbsvcs/tests/ImplRepo/RestartServer/README:
+ * orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp:
+
+ * orbsvcs/tests/ImplRepo/run_test.pl:
+
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp:
+
+ * tests/Dynamic_TP/POA_Loader/Test.cpp:
+
+ * tests/Var_Deref/README.txt:
+
+ More unfuzzing.
+
+Wed Nov 21 13:35:40 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+
+ Fixed compilation errors.
+
+Wed Nov 21 06:16:58 UTC 2012 Phil Mesnier <mesnier_p@local>
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_Task.h:
+ * tao/Dynamic_TP/Dynamic_TP_Task.inl:
+ * tao/Dynamic_TP/Dynamic_TP_Task.cpp:
+
+ Fuzz fixes.
+
+Wed Nov 21 04:42:24 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp:
+
+ Fixed to resolve fuzz issues.
+
+ * utils/nsgroup/run_test.pl:
+
+ Modified argument to tao_nslist, tao_nsadd passing in the IOR for
+ the naming service.
+
+Wed Nov 21 02:40:16 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/Storable.h:
+
+ Added TAO_Naming_Serv_Export to TAO_Naming_Service_Persistence_Factory.
+
+Wed Nov 21 02:30:08 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp:
+
+ Added files to implement the replication interface.
+
+Wed Nov 21 01:32:17 UTC 2012 "Marc Neeley" <neeleym@ociweb.com>
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.h:
+
+ created constructor in TAO_DTP_Definition struct
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.cpp:
+
+ removed conflicting constructor
+
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+
+ removed unnecessary include
+
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_Task.h:
+ * tao/Dynamic_TP/Dynamic_TP_Task.inl:
+ * tao/Dynamic_TP/Dynamic_TP_Task.cpp:
+
+ completed StrategyImpl initialization started the delegation
+ functions; this needs a lot of dependency removal from CSD_Task.
+
+Tue Nov 20 23:42:31 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/CSD_Framework/CSD_ORBInitializer.h:
+
+ added class visibility token.
+
+ * tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h:
+ * tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+
+ Fuzz and other clean up.
+
+Tue Nov 20 22:44:07 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/run_test.pl:
+
+ Corrected type_id string passed in test
+
+Tue Nov 20 22:42:06 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * ChangeLog:
+
+ * MPC/config/ft_naming_serv.mpb:
+ * orbsvcs/Naming_Service/Naming_Service.mpc:
+ * orbsvcs/orbsvcs/FtNaming.mpc:
+
+ Support building FT Naming Service with replication.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp:
+
+ Functionality to support Replication interface between naming
+ service instances.
+
+Tue Nov 20 19:32:12 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/nsgroup.mpc:
+
+ Added $ID
+
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Changed group_bind and group_unbind to use the NamingContextExt
+ interface to properly convert stringified names to compound names.
+
+ * utils/nsgroup/run_test.pl:
+
+ Add calls to tao_nslist, tao_nsadd and tao_nsdel to augment name
+ service verification.
+
+Tue Nov 20 15:05:32 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp:
+
+ While refactoring the lock utilization, I inadvertently removed
+ a critical section from the resolve() implementation. That's been
+ restored.
+
+Mon Nov 19 22:33:49 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/CSD_Framework/CSD_Framework_Loader.cpp:
+
+ The loader was incorrectly introducing a dependency on the
+ TAO_CSD_ThreadPool library. This is wrong because the latter
+ is but one possible implementation for the framework.
+
+ * tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp:
+ * tao/CSD_ThreadPool/CSD_ThreadPool.h:
+ * tao/CSD_ThreadPool/CSD_ThreadPool.cpp:
+
+ Have the CSD_Threadpool properly initialize the framework,
+ rather than vice versa. Also, cleaned up the parameter parsing to
+ be a little more efficient.
+
+ * tao/Dynamic_TP/Dynamic_TP.mpc:
+ * tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+
+ Sorted out the initialization of POAs with threadpools declared
+ via service configuration. The key was to actually initialize the
+ CSD_Strategy_Repository prior to inserting any strategy instances.
+
+ Also removed a dependency on RTCORBA. This dependency was causing
+ the RT POA factory name to be loaded after the CSD POA factory name
+ which in turn disabled the creation of CSD POAs.
+
+ * tests/Dynamic_TP/POA_Loader/Test.cpp:
+
+ The test seemed to have a typo.
+
+Mon Nov 19 22:27:44 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/Naming_Service/README:
+
+ Add documentation of the -n command line argument used for thread
+ pooling. Also, sort out the parmaters description so they are ordered
+ alphabetically.
+
+ * orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp:
+
+ Refactored the thread acquisition so that the context is locked
+ only when the local store is going to be modified, not if another
+ repository is to be upated.
+
+Mon Nov 19 18:00:27 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/CosNaming_Serv.mpc:
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb:
+
+ Added support for Abstract factory to create Storable Naming Contexts.
+ This enables the overriding of the resolve operation in support of
+ load balancing.
+
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp:
+
+ Updated test internals to return 0 on success.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/README:
+ Updated README to more correctly describe the test being performed.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/NameService:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README:
+ Created directory to store the NameService state when using the
+ -u option.
+
+Mon Nov 19 16:46:05 UTC 2012 Brian Johnson <johnsonb@ociweb.com>
+
+ * bin/tao_other_tests.lst:
+
+ Added ImR persistance tests for hash and shared backing stores.
+
+ * orbsvcs/ImplRepo_Service/Locator_Repository.h:
+ * orbsvcs/ImplRepo_Service/Locator_Repository.cpp:
+
+ Refactored xml, heap, and registry backing store code into a virtual
+ interface.
+
+ * orbsvcs/ImplRepo_Service/Config_Backing_Store.h:
+ * orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp:
+
+ Refactored out Locator_Repository REPO_HEAP and REPO_REGISTRY code.
+
+ * orbsvcs/ImplRepo_Service/XML_Backing_Store.h:
+ * orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp:
+
+ Refactored out Locator_Repository REPO_XML_FILE code.
+
+ * orbsvcs/ImplRepo_Service/Shared_Backing_Store.h:
+ * orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp:
+
+ Added handling for a shared xml files backing store.
+ (this will eventually have file locking)
+
+ * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc:
+
+ Added new xxx_Backin_Store.cpp files.
+
+ * orbsvcs/ImplRepo_Service/Locator_Options.h:
+ * orbsvcs/ImplRepo_Service/Locator_Options.cpp:
+
+ Added "-y" flag to select shared xml files backing store.
+
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.h:
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp:
+
+ * orbsvcs/ImplRepo_Service/Locator_XMLHandler.h:
+ * orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp:
+
+ Refactored Locator_Repository Server_Repo_XML_Callback into Locator_XMLHandler.
+
+ * orbsvcs/ImplRepo_Service/Server_Info.h:
+ * orbsvcs/ImplRepo_Service/Server_Info.cpp:
+
+ Made const correct.
+
+ * orbsvcs/tests/ImplRepo/airplane_server_i.h:
+ * orbsvcs/tests/ImplRepo/airplane_server_i.cpp:
+
+ Added flag to provide the name the server should be registered under.
+
+ * orbsvcs/tests/ImplRepo/run_test.pl:
+
+ Added testing for heap and shared backing store persistence tests and added testing with multiple servers.
+
+ * tao/PortableServer/ServantRetentionStrategyNonRetain.cpp:
+ * orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp:
+
+ Fixed vc9 (express?) compiler errors.
+
+Mon Nov 19 13:54:58 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp:
+
+ Add support for -u option to support fault tolerance using separate
+ files per context.
+
+Sun Nov 18 16:03:28 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+
+ Add support for -u option to support fault tolerance using separate
+ files per context. Simplified interface for object group creation.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+
+ Removed unnecessary data member.
+
+ * orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/Storable.h:
+ * orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h:
+
+ Suppport use from FT_Naming service.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp:
+
+ Simplify searching for object groups by name.
+
+
+Fri Nov 16 23:42:51 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/README.nsgroup:
+
+ Documents the nsgroup command line options
+
+ * utils/nsgroup/nsgroup.cpp:
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+ * utils/nsgroup/run_test.pl:
+
+ Changed some option names to avoid potential conflict.
+ Added group_unbind to complement the group_bind command option.
+
+Fri Nov 16 17:19:32 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/Invocation_Retry_Params.h:
+ * tao/Invocation_Retry_Params.cpp:
+ * tao/Invocation_Retry_State.h:
+ * tao/Invocation_Retry_State.cpp:
+ * tao/ORB_Core.cpp:
+ * tao/Synch_Invocation.cpp:
+ * tao/default_client.cpp:
+ * tao/params.h:
+
+ Fixed an incorrect assumption I had about not
+ forwarding profiles when connection closed during
+ reading of server reply.
+
+ * orbsvcs/tests/ImplRepo/RestartServer/README:
+ * orbsvcs/tests/ImplRepo/RestartServer/run_test.pl:
+
+ Updated test to reflect changed name of option
+ based on fix above.
+
+ * docs/Options.html:
+
+ Describes the invocation retry command-line and
+ Client_Strategy_Factory service options.
+
+Fri Nov 16 16:28:08 UTC 2012 "Marc Neeley" <neeleym@ociweb.com>
+
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_Task.h:
+ * tao/Dynamic_TP/Dynamic_TP_Task.inl:
+ * tao/Dynamic_TP/Dynamic_TP_Task.cpp:
+
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic:
+
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Dynamic_TP_POA_Test_Dynamic.mpc:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.h:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Test.idl:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/client.cpp:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp:
+ * tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/svc.conf:
+
+ Inclusion of Dynamic Threadpool strategy to leverage CSD Framework. Associated tests included.
+ WARNING: this is an interim check-in and the tests are not working.
+
+Fri Nov 16 02:48:45 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Fixed a spelling error in group_create error message.
+ Extended group_list description labels.
+
+Thu Nov 15 20:58:23 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/Stub.inl:
+ * tao/Stub.cpp:
+
+ There is a potential for a deadlock when a stub contains profiles
+ that are forwarded and also self-referencial. The use case which
+ exposed this involves the name service and the ImR. In this case,
+ the root context of a name service is registered with the ImR. This
+ is then added to a name service as a new context with a name and the
+ reference pointing to the ImR-ified context. When this new context
+ happens to be the local root context, a deadlock occurs.
+
+ The deadlock ie related to the Stub's profile_lock_, which is a simple
+ thread mutex. This patch addresses the deadlock by momentarily releasing
+ the lock before leaving the Stub code, then reaquiring upon return. This
+ works for my specific use case, but I have added temporary debugging in
+ case issues arise in nightly tests. I intend to remove the debugging
+ prior to formal integration with the main trunk.
+
+Thu Nov 15 23:15:33 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Fixed bug in groups operation.
+
+Thu Nov 15 22:30:52 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * bin/tao_other_tests.lst:
+
+ Added orbsvcs/tests/FT_Naming/Load_Balancing test
+ Added utils/nsgroup test
+
+Thu Nov 15 21:37:29 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Changed LoadBalancingStrategyValue ACTIVE to LEAST
+
+ * utils/nsgroup/README.nsgroup:
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+ * utils/nsgroup/run_test.pl:
+
+ Modified group_list to display groups by load strategy
+
+Thu Nov 15 19:16:32 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl:
+
+ Added test for the load balancing function of the FT_Naming_Service.
+
+Thu Nov 15 18:58:01 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Updates to groups operation to allow it to request groups
+ with matching strategies.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Implements the new groups operation. Fixes to object reference
+ duplication and leaks.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+
+ Fixed bug in all_groups which did not duplicate the stored object
+ reference.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp:
+
+ Modifications to support new signature for load balancing strategy
+ updates.
+
+Thu Nov 15 18:02:04 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/Invocation_Retry_State.h:
+ * tao/Invocation_Retry_State.cpp:
+
+ Added operations for getting next profile and
+ sleeping if at starting base profile.
+
+ * tao/Synch_Invocation.cpp:
+
+ Uses new Invocation_Retry_State operations. Beefed up
+ debug messages.
+
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp:
+
+ Extend test to include oneway invocation.
+
+ * bin/tao_orb_tests.lst:
+
+ Added test for retry on connection failure for oneway call.
+
+Thu Nov 15 17:16:12 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Cleaned up error messages
+
+ * utils/nsgroup/run_test.pl:
+
+ Added negative test for member_add
+
+Thu Nov 15 16:06:29 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/README.nsgroup:
+ * utils/nsgroup/nsgroup.cpp:
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Implement group_modify and group_bind operations
+
+ * utils/nsgroup/run_test.pl:
+
+ Add support to positive and negative tests
+
+Thu Nov 15 13:39:11 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Fix GNU C++ compile error.
+
+Thu Nov 15 13:25:54 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/Synch_Invocation.cpp:
+
+ Correct indentation for
+ Synch_Oneway_Invocation::remote_oneway().
+
+Wed Nov 14 22:46:39 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Added argument to create_object_group for the load balancing
+ strategy. Also added operation to change it dynamically without
+ having to use the property interface
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Support new constructor and manipulator for load balancing
+ strategy.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp:
+
+ Use new operations for load balancing strategy.
+
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+Wed Nov 14 21:47:28 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ NamingManager no longer inherits from the GenericFactory
+ interface, to ensure that names are provided for object
+ groups.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ If no load balancing strategy is provided, then default to
+ using ROUND_ROBIN. Prevent warning for group state
+ distribution.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp:
+
+ Prevent warning for group state distribution.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp:
+
+ Fixed bug in PG_Property_Set::set_property that
+ disallowed it from binding a new value when an existing
+ one was not present.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp:
+
+ Updated tests to set new strategy value, and remove a group
+ member while running.
+
+Wed Nov 14 20:24:41 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/Invocation_Retry_Params.h:
+ * tao/Invocation_Retry_Params.cpp:
+ * tao/Invocation_Retry_State.h:
+ * tao/Invocation_Retry_State.cpp:
+ * tao/ORB_Core.cpp:
+ * tao/Synch_Invocation.cpp:
+ * tao/default_client.cpp:
+ * tao/params.h:
+ * tao/params.cpp:
+
+ Added new invocation parameter to indicate max
+ retries on reply connection closed and not base
+ max retries on comm failure limit. This is done
+ to treat retries on reply connection close
+ special since it could violate "at most once"
+ rule.
+
+ * orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.h:
+ * orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.cpp:
+ * orbsvcs/tests/ImplRepo/RestartServer/README:
+ * orbsvcs/tests/ImplRepo/RestartServer/run_test.pl:
+
+ Update test to account for using max retries on reply
+ connection closed.
+
+Wed Nov 14 16:08:57 UTC 2012 Kevin Stanley <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp:
+
+ Simplified algorithm for Round Robin assuming mostly static
+ group members.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp:
+
+ Fixed bug in locations_of_members.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp:
+
+ Updates to tests to better match the load balancing approach.
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc:
+
+ Fix case of base project.
+
+Wed Nov 14 14:43:17 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/ORB_Core.cpp:
+ * tao/Synch_Invocation.cpp:
+ * tao/params.h:
+ * tao/params.inl:
+ * tao/params.cpp:
+
+ Removed flag I added indicating a forward-once-on-exception
+ parameter was set. It was used to short circuit a
+ large conditional but it always set and the conditional
+ is in error handling code so optimization isn't critical.
+
+Wed Nov 14 03:21:03 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/nsgroup_svc.cpp:
+ Changed output for member_show and member_list methods
+
+ * utils/nsgroup/run_test.pl:
+ Cleaned up tests
+
+Tue Nov 13 22:28:27 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h:
+
+ Fix initialization order to avoid warning. Make Round Robin strategy
+ destructor virtual.
+
+ * orbsvcs/tests/FT_Naming:
+ * orbsvcs/tests/FT_Naming/Load_Balancing:
+
+ Add new directories to hold tests for FT_NamingService
+
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.h:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/README:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/svc.conf:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf:
+ * orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf.xml:
+
+ Add tests for Load Balancing functionality of FT_Naming Service
+ * tao/Client_Strategy_Factory.h:
+
+ Change forward declaration type from class to struct to agree with definition.
+
+Tue Nov 13 22:11:17 UTC 2012 Phillip LaBanca <labancap@ociweb.com>
+
+ * utils/nsgroup/README.nsgroup:
+
+ Updated to reflect changes
+
+ * utils/nsgroup/nsgroup.cpp:
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Change signature for member_add, member_remove, and member_show to not use member string argument.
+
+ * utils/nsgroup/run_test.pl:
+
+ Updated tests
+
+ * utils/utils.mwc:
+ Added nsgroup
+
+Tue Nov 13 20:56:30 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * tao/Client_Strategy_Factory.h:
+ * tao/Invocation_Retry_Params.h:
+ * tao/Invocation_Retry_Params.cpp:
+ * tao/Invocation_Retry_State.h:
+ * tao/Invocation_Retry_State.cpp:
+ * tao/default_client.h:
+ * tao/default_client.cpp:
+ * tao/params.h:
+ * tao/params.cpp:
+ * tao/tao.mpc:
+
+ Allow invocation retry params to be specified
+ using Client_Strategy_Factory definition in
+ service config file in addition to -ORB
+ command line parameters.
+
+ * orbsvcs/tests/ImplRepo/RestartServer/client.conf:
+ * orbsvcs/tests/ImplRepo/RestartServer/run_test.pl:
+
+ Update test to read a retry parameter from a
+ service config file.
+
+Mon Nov 12 23:05:55 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Catch exception when an invalid IOR is passed in for adding a member
+ to an object group.
+
+ * tao/Invocation_Retry_State.cpp:
+
+ Add missing include file.
+
+Mon Nov 12 21:35:01 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * bin/tao_orb_tests.lst:
+ * bin/tao_other_tests.lst:
+
+ Added new invocation retry tests.
+
+ * orbsvcs/tests/ImplRepo/RestartServer/RestartServer.mpc:
+ * orbsvcs/tests/ImplRepo/RestartServer/Terminator.h:
+ * orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp:
+
+ Added missing files from test.
+
+ * tao/Synch_Invocation.cpp:
+
+ Added support for invocation reply if server sends
+ OBJECT_NOT_EXIST or INV_OBJREF exceptions.
+
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl:
+
+ Added configs for OBJECT_NOT_EXIST and INV_OBJREF exceptions.
+
+Mon Nov 12 20:43:25 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Add constants to support the creation of strategies.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Location_Index_Map.h:
+
+ Add new type to maintain the strategy state data.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp:
+
+ Implement functionality in support of load balancing strategies.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+
+ Fixed functionality for looking up object groups with matching property value.
+
+Mon Nov 12 18:19:10 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * orbsvcs/tests/ImplRepo/RestartServer:
+
+ Renamed test ServerBounce to RestartServer to
+ be better compare with ReconnectServer test.
+
+ * orbsvcs/tests/ImplRepo/ServerBounce:
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger.idl:
+ * orbsvcs/tests/ImplRepo/ServerBounce/MessengerClient.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/MessengerServer.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger_i.h:
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger_i.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/README:
+ * orbsvcs/tests/ImplRepo/ServerBounce/ServerBounce.mpc:
+ * orbsvcs/tests/ImplRepo/ServerBounce/run_test.pl:
+
+ Removed these files.
+
+Mon Nov 12 15:25:06 UTC 2012 Byron Harris <harrisb@ociweb.com>
+
+ * orbsvcs/tests/ImplRepo/ReconnectServer/client.cpp:
+
+ Removed unused POA variable.
+
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger.idl:
+ * orbsvcs/tests/ImplRepo/ServerBounce/MessengerClient.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/MessengerServer.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger_i.h:
+ * orbsvcs/tests/ImplRepo/ServerBounce/Messenger_i.cpp:
+ * orbsvcs/tests/ImplRepo/ServerBounce/README:
+ * orbsvcs/tests/ImplRepo/ServerBounce/ServerBounce.mpc:
+ * orbsvcs/tests/ImplRepo/ServerBounce/run_test.pl:
+
+ Test that shows client waiting for the ImR activator
+ to re-launch the server using new options
+ -ORBForwardOnCommFailureLimit and
+ -ORBForwardOnTransientLimit.
+
+ * tao/IIOP_Transport.cpp:
+ * tao/Invocation_Adapter.cpp:
+ * tao/Invocation_Retry_State.h:
+ * tao/Invocation_Retry_State.cpp:
+ * tao/Invocation_Utils.h:
+ * tao/ORB_Core.cpp:
+ * tao/Stub.h:
+ * tao/Stub.inl:
+ * tao/Stub.cpp:
+ * tao/Synch_Invocation.cpp:
+ * tao/Transport.h:
+ * tao/Transport.cpp:
+ * tao/params.h:
+ * tao/params.inl:
+ * tao/params.cpp:
+ * tao/tao.mpc:
+
+ Enhancements to TAO to support invocation retry during
+ initial connection to server, during reply from server,
+ and when the server reply contains exceptions.
+
+
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/README:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Retry_On_Connection_Failure.mpc:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl:
+ * tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp:
+
+ Test that shows client trying to connect to server
+ rather than throw a TRANSIENT exception when -ORBForwardOnTransientLimit
+ is used.
+
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/README:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/Retry_On_Reply_Failure.mpc:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/client.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/server.cpp:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test.idl:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.h:
+ * tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp:
+
+ Test that shows client trying invocation to server if
+ server replies with exception.
+
+Mon Nov 12 01:20:54 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * utils/nsgroup/nsgroup_svc.cpp:
+ * utils/nsgroup/run_test.pl:
+
+ Modify bind_group command to use the -n option and format output
+ of group_list command to be more readable.
+
+Sun Nov 11 21:34:42 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Add operation for querying for all registered object groups.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+
+ Implement operation for querying for all registered object groups.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+
+ Add utility to implement query for all registered object groups.
+
+ * utils/nsgroup/nsgroup_svc.h:
+ * utils/nsgroup/nsgroup_svc.cpp:
+ * utils/nsgroup/run_test.pl:
+
+ Change signature for group_list to not use Location. Update implementation
+ to use the new operation defined in the NamingManager idl.
+
+Sat Nov 10 20:45:07 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Add operations to create and destroy object groups as well
+ as find object groups by name.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+
+ Provide implementations for the new operations defined in the FT_NamingManager.idl
+ for object group creation, deletion and retrieval by name.
+
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h:
+ * orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp:
+
+ Add an operation to find an object group with a matching property.
+ Primarily used to lookup an object group with a TAO_FT_OBJECT_GROUP_NAME
+ property set to the object group name.
+
+ * utils/nsgroup/nsgroup_svc.cpp:
+
+ Update to use the new create, delete and find operations by name.
+
+ * utils/nsgroup/run_test.pl:
+
+ Modifications to tests use naming manager instead of load manager.
+
+Fri Nov 9 22:03:39 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/orbsvcs/Naming/Naming_Loader.cpp:
+
+ Fix incorrect capitalization for included file.
+
+ * tao/PortableServer/ServantRetentionStrategyNonRetain.cpp:
+
+ Fixed missing include and deal with mismatch in size expectations for time_t.
+
+Fri Nov 9 21:20:45 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * orbsvcs/Naming_Service/FT_Naming_Main.cpp:
+ * orbsvcs/Naming_Service/FT_Naming_Service.h:
+ * orbsvcs/Naming_Service/FT_Naming_Service.cpp:
+
+ Add main and server files to implement the FT_Naming_Service and provide
+ refined implementation of the factory method in the FT_Naming_Service.
+
+ * orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp:
+
+ Add new files to support the abstract factory pattern in the naming service.
+ Persistent_Naming_Context_Factory is the default used in the existing naming
+ service.
+
+Fri Nov 9 19:35:51 UTC 2012 "Kevin Stanley" <stanleyk@ociweb.com>
+
+ * MPC/config/ftnaming.mpb:
+
+ Add new base project to support use of the FtNaming library components.
+
+ * orbsvcs/Naming_Service/Naming_Service.h:
+ * orbsvcs/Naming_Service/Naming_Service.cpp:
+
+ Refactored to support the use of derived TAO_Naming_Service objects.
+ Added factory method operation to allow the derived object to be
+ constructed and used.
+
+ * orbsvcs/Naming_Service/Naming_Service.mpc:
+
+ Added FT_Naming_Service project.
+
+ * orbsvcs/orbsvcs/FT_NamingManager.idl:
+
+ Define IDL to be used in FT_Naming_Service to define an aggregated
+ interface for PropertyManager, ObjectGroupManager, GenericFactory to
+ support the management of ObjectGroups used in the naming service to
+ provide a load balancing resolve operation
+
+ * orbsvcs/orbsvcs/FtNaming.mpc:
+
+ Provide a base library for the fault tolerant and load balancing
+ features in the FT_Naming_Service.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant:
+
+ Directory to hold the new FT_Naming_Service base component implementation
+ source.
+
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp:
+ * orbsvcs/orbsvcs/Naming/FaultTolerant/ftnaming_export.h:
+
+ Implements the FT_Naming_Service base classes. Specializes the
+ Persistent_Naming_Context to implement the load balancing feature.
+ The FT_Naming_Manager provides functionality to create and otherwise
+ manage object groups.
+
+ * orbsvcs/orbsvcs/Naming/Naming_Loader.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Loader.cpp:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h:
+ * orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h:
+ * orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp:
+
+ Refactoring of the Naming service base components to allow specialization
+ as required by the FT_Naming_Service.
+
+ * orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb:
+
+ Added the Naming_Context_Factory as an abstract factory base class and
+ the Persistent_Naming_Context_Factory as a concrete implementation of
+ the abstract factory class.
+
+Thu Nov 8 22:03:59 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * utils/logWalker/PeerProcess.h:
+ * utils/logWalker/PeerProcess.cpp:
+
+ Fix a warning not caught in the TAO 2.0a build.
+
+Thu Nov 8 21:57:49 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * utils/logWalker/GIOP_Buffer.h:
+ * utils/logWalker/GIOP_Buffer.cpp:
+
+ Adding new files missed by the previous commit.
+
+Thu Nov 8 21:51:42 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * utils/logWalker/HostProcess.h:
+ * utils/logWalker/HostProcess.cpp:
+ * utils/logWalker/Invocation.h:
+ * utils/logWalker/Invocation.cpp:
+ * utils/logWalker/Log.h:
+ * utils/logWalker/Log.cpp:
+ * utils/logWalker/PeerObject.cpp:
+ * utils/logWalker/PeerProcess.h:
+ * utils/logWalker/PeerProcess.cpp:
+ * utils/logWalker/Session.h:
+ * utils/logWalker/Session.cpp:
+ * utils/logWalker/Thread.h:
+ * utils/logWalker/Thread.cpp:
+ * utils/logWalker/logWalker.cpp:
+
+ Bringing over changes from OCI TAO 2.0a aimed at improving the
+ ability to handle logs from heavily threaded processes and for
+ inspecting some request contents for common service operations.
+
+Wed Nov 7 18:04:55 UTC 2012 Brian Johnson <johnsonb@ociweb.com>
+
+ * tests/POA/Non_Retain_System_Id/Non_Retain_System_Id.mpc:
+
+ Changed project name to avoid collision (and to make sense).
+
+Mon Nov 5 22:58:02 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/PortableServer/ServantRetentionStrategyNonRetain.h:
+ * tao/PortableServer/ServantRetentionStrategyNonRetain.cpp:
+
+ Force the POA to generate a unique object ID in the case where the ID
+ assignment policy is SYSTEM_ID, and the servant retention policy is
+ NONRETAIN. Historically this situation was ignored since the ID was only
+ considered useful in resolving servants from the AOM or when UISER_ID
+ assignment was set. However it is a valid usecase for a servant manager
+ or default servant to be used with system generated IDs.
+
+ * tests/POA/Non_Retain_System_Id:
+
+ New test to verify the correctness of the above change.
+
+Fri Nov 2 21:10:42 UTC 2012 Marc Neeley <neeleym@ociweb.com>
+
+ * tests/Dynamic_TP:
+ * tests/Dynamic_TP/POA_Loader:
+ * tests/Dynamic_TP/POA_Loader/POA_Loader.mpc:
+ * tests/Dynamic_TP/POA_Loader/Test.cpp:
+ * tests/Dynamic_TP/POA_Loader/svc.conf:
+
+ Added first set of tests for POA loader.
+
+Fri Nov 2 20:27:56 UTC 2012 Marc Neeley <neeleym@ociweb.com>
+
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+
+ Implemented parsing of svc.conf files for mapping POA instances
+ to Thread Pool configs.
+
+Mon Oct 29 16:14:14 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tests/Dynamic_TP/Config_Loader/Config_Loader.mpc:
+
+ Fix the project name so it plays nice with other test projects.
+
+Fri Oct 26 21:53:26 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * MPC/Config/dynamic_tp.mpb:
+
+ A new base project used to simplify integration of the dynamic threadpool
+ library into application code.
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.h:
+ * tao/Dynamic_TP/Dynamic_TP_Config.cpp:
+
+ Completed the implementation to comply with written definition.
+
+ * tests/Dynamic_TP:
+ * tests/Dynamic_TP/Config_Loader:
+ * tests/Dynamic_TP/Config_Loader/Config_Loader.mpc:
+ * tests/Dynamic_TP/Config_Loader/Test.cpp:
+ * tests/Dynamic_TP/Config_Loader/svc.conf:
+
+ A test to validate the config loader.
+
+Thu Oct 25 22:31:31 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.h:
+ * tao/Dynamic_TP/Dynamic_TP_Config.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h:
+ * tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h:
+
+ Fixed build dependencies, added parsing of configuration parameters.
+ not complete, this is an intermediate commit.
+
+ * tao/Dynamic_TP/Dynamic_TP_ORB_ORBInitializer.h:
+
+ Removed this file.
+
+Wed Oct 24 22:37:11 UTC 2012 Marc Neeley <neeleym@ociweb.com>
+
+ * tao/Dynamic_TP/Dynamic_TP_Config.h:
+ * tao/Dynamic_TP/Dynamic_TP_Config.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp:
+
+ Added new class for managing Threadpool Configurations. Continued expanding new Dynamic Threadpool Strategy implementation.
+
+Tue Oct 23 13:07:15 UTC 2012 Marc Neeley <neeleym@ociweb.com>
+
+ * tao/Dynamic_TP:
+
+ * tao/Dynamic_TP/Dynamic_TP.mpc:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+
+ Added csd_threadpool to the mpc file. Began initialization of POA threadpool service.
+
+Mon Oct 22 14:40:47 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/Dynamic_TP:
+
+ * tao/Dynamic_TP/Dynamic_TP.mpc:
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.h:
+ * tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp:
+ * tao/Dynamic_TP/dynamic_tp_export.h:
+
+ New container library for Dynamic Thread Pools applied to either ORB or POA.
+
+Fri Oct 19 17:24:49 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tao/Seq_Var_T.h:
+ * tao/Seq_Var_T.inl:
+ * tao/VarOut_T.h:
+ * tao/VarOut_T.inl:
+
+ Move explicit point dereference operation from variable length
+ vars to base so it can be applied to vars for fixed length types
+ as well. This is intended to improve portability away from ORBs
+ that provided this operation. Caution should be exercised when
+ using the returned pointer as the var still owns the reference and
+ will clean it up when it goes out of scope.
+
+ * tests/Var_Deref:
+
+ Added a test for the above. The test will not compile unless
+ the explicit cast operation is available for fixed types.
+
+Mon Oct 15 18:26:57 UTC 2012 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * OCI_RE_ChangeLog:
+ Created change log for the OCI Reliability Enhancements branch
+
+Local Variables:
+mode: change-log
+add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time))
+indent-tabs-mode: nil
+End:
diff --git a/TAO/PROBLEM-REPORT-FORM b/TAO/PROBLEM-REPORT-FORM
index 23f13034f0f..35c531294f0 100644
--- a/TAO/PROBLEM-REPORT-FORM
+++ b/TAO/PROBLEM-REPORT-FORM
@@ -40,8 +40,8 @@
To: tao-bugs@list.isis.vanderbilt.edu
Subject: [area]: [synopsis]
- TAO VERSION: 2.1.6
- ACE VERSION: 6.1.6
+ TAO VERSION: 2.1.4
+ ACE VERSION: 6.1.4
HOST MACHINE and OPERATING SYSTEM:
If on Windows based OS's, which version of WINSOCK do you
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp
index 7594a0c71f7..910864ecd74 100644
--- a/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_module.cpp
@@ -637,9 +637,3 @@ AST_Module::fe_add_porttype (AST_PortType *t)
AST_PortType::narrow_from_decl (
this->fe_add_decl (t));
}
-
-void
-AST_Module::reset_last_in_same_parent_scope (void)
-{
- this->last_in_same_parent_scope_ = this;
-} \ No newline at end of file
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
index d55869c785d..afbcef1c159 100644
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ b/TAO/TAO_IDL/be/be_util.cpp
@@ -795,6 +795,11 @@ be_util::usage (void)
));
ACE_DEBUG ((
LM_DEBUG,
+ ACE_TEXT (" -si\t\t\tServer's inline file name ending.")
+ ACE_TEXT (" Default is S.inl\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
ACE_TEXT (" -ss\t\t\tServer's skeleton file name ending.")
ACE_TEXT (" Default is S.cpp\n")
));
diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h
index cf2dba748ca..12e2e23e434 100644
--- a/TAO/TAO_IDL/include/ast_module.h
+++ b/TAO/TAO_IDL/include/ast_module.h
@@ -231,12 +231,6 @@ public:
virtual
AST_PortType *fe_add_porttype (AST_PortType *pt);
- // Reset the last_in_same_parent_scope_ member to ourself
- // (called by AST_Root::destroy on the CORBA module containing
- // the basic types, since it isn't destroyed between processing
- // multiple IDL files.
- void reset_last_in_same_parent_scope (void);
-
private: // Data
bool pd_has_nested_valuetype_;
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 71a0527a3da..6ce41ce58a7 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -928,11 +928,6 @@ IDL_GlobalData::destroy (void)
ACE::strdelete (this->recursion_start_);
this->recursion_start_ = 0;
- // Reset the member of the CORBA module containing the basic types
- // to point to itself, since all the other CORBA modules (if any)
- // will be destroyed.
- this->corba_module_->reset_last_in_same_parent_scope ();
-
if (0 != this->pd_root)
{
this->pd_root->destroy ();
diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp
index b2120a33cf4..27e7290467f 100644
--- a/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/TAO/TAO_IDL/util/utl_scope.cpp
@@ -1127,7 +1127,7 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
return 0;
}
- bool in_corba = (ACE_OS::strcmp (e->get_string (), "CORBA") == 0);
+ bool in_corba = !ACE_OS::strcmp (e->get_string (), "CORBA");
// We search only the decls here, the local types are done
// below as a last resort.
@@ -1136,18 +1136,16 @@ UTL_Scope::lookup_by_name_local (Identifier *e,
i.next ())
{
d = i.item ()->adjust_found (true, full_def_only);
-
- if (d != 0)
+ if (d)
{
Identifier *item_name = d->local_name ();
-
- if (item_name != 0
+ if (item_name
// Right now we populate the global scope with all the CORBA basic
// types, so something like 'ULong' in an IDL file will find a
// match, unless we skip over these items. This is a workaround until
// there's time to fix the code generation for CORBA basic types.
- && (in_corba
- || (ACE_OS::strcmp (d->name ()->head ()->get_string (), "CORBA") != 0))
+ && (in_corba || ACE_OS::strcmp (
+ d->name ()->head ()->get_string (), "CORBA"))
&& e->case_compare (item_name))
{
return d; // We have found the one and only one we are looking for.
diff --git a/TAO/VERSION b/TAO/VERSION
index 9a6d47b9411..31b59deb00d 100644
--- a/TAO/VERSION
+++ b/TAO/VERSION
@@ -1,4 +1,4 @@
-This is TAO version 2.1.6, released Mon Nov 12 09:34:14 CET 2012
+This is TAO version 2.1.4, released Wed Aug 29 08:16:04 CEST 2012
If you have any problems with or questions about TAO, please send
e-mail to the TAO mailing list (tao-bugs@list.isis.vanderbilt.edu),
diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst
index 6df71cf2845..403af10e528 100644
--- a/TAO/bin/tao_orb_tests.lst
+++ b/TAO/bin/tao_orb_tests.lst
@@ -464,6 +464,9 @@ TAO/tests/ZIOP/run_test.pl: ZLIB BZIP2
TAO/tests/ForwardUponObjectNotExist/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO
TAO/tests/ForwardOnceUponException/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO !ST
TAO/tests/Bug_3853_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO
+TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl:
+TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl -oneway:
+TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl:
TAO/DevGuideExamples/BiDirectionalGIOP/run_test.pl: !MINIMUM !CORBA_E_MICRO
TAO/DevGuideExamples/GettingStarted/run_test.pl:
TAO/DevGuideExamples/LocalObjects/Messenger/run_test.pl:
diff --git a/TAO/bin/tao_other_tests.lst b/TAO/bin/tao_other_tests.lst
index eba1a575396..9377fed2345 100644
--- a/TAO/bin/tao_other_tests.lst
+++ b/TAO/bin/tao_other_tests.lst
@@ -80,6 +80,7 @@ TAO/orbsvcs/tests/HTIOP/AMI/run_test.pl: !NO_UUID !ST !STATIC !MINIMUM !CORBA_E_
TAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl: !NO_UUID !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LynxOS
TAO/orbsvcs/tests/Simple_Naming/run_test.pl: !ST !NO_MESSAGING !ACE_FOR_TAO !LynxOS !CORBA_E_MICRO !DISTRIBUTED
TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !DISTRIBUTED
+TAO/orbsvcs/tests/Simple_Naming/run_test_ft.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !DISTRIBUTED
TAO/orbsvcs/tests/Redundant_Naming/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISTRIBUTED
TAO/orbsvcs/tests/Trading/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
TAO/orbsvcs/tests/unit/Trading/Interpreter/run_test.pl: !CORBA_E_MICRO
@@ -115,6 +116,8 @@ TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir: !MINIMUM !CORBA_E_COMPACT
TAO/orbsvcs/tests/ImplRepo/run_test.pl nt_service_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR Win32 !ACE_FOR_TAO
TAO/orbsvcs/tests/ImplRepo/run_test.pl shutdown: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO
TAO/orbsvcs/tests/ImplRepo/run_test.pl perclient: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO
+TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir_hash: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO
+TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir_files: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO
TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO
TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !LynxOS !ACE_FOR_TAO
TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl -servers 5 -objects 5: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS
@@ -123,6 +126,7 @@ TAO/orbsvcs/tests/ImplRepo/Bug_2604_Regression/run_test.pl: !MINIMUM !CORBA_E_CO
TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS
TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl -forwardalways: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS
TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl -forwardonce: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS
+TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO !LynxOS
TAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ST !ACE_FOR_TAO !LynxOS
TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO !WCHAR
TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !NO_MESSAGING !ACE_FOR_TAO !LynxOS
@@ -258,3 +262,6 @@ TAO/orbsvcs/DevGuideExamples/NamingService/corbaname_Messenger/run_test.pl: !COR
TAO/orbsvcs/DevGuideExamples/ValueTypes/Notify/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LynxOS
TAO/orbsvcs/DevGuideExamples/InterfaceRepo/run_test.pl: !MINIMUM !NO_IFR !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !ACE_FOR_TAO
TAO/orbsvcs/DevGuideExamples/PortableInterceptors/PICurrent_NameService/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS !LynxOS !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO
+TAO/utils/nsgroup/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ACE_FOR_TAO !LynxOS !ST
+TAO/orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ACE_FOR_TAO !LynxOS !ST
+
diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html
index 7d2a42e754c..25229ec816d 100644
--- a/TAO/docs/Options.html
+++ b/TAO/docs/Options.html
@@ -23,6 +23,7 @@
<li><a href="#ORP">Optimizing Request Processing </a> </li>
<li><a href="#CMPS">Connection Management and Protocol
Selection </a> </li>
+ <li><a href="#IRO">Invocation Retry Options</a></li>
<li><a href="#MO">Miscellaneous Options </a></li>
</ol>
</li>
@@ -447,7 +448,7 @@ also removes the ability to interoperate with ORBs on systems using
alternative character or wide charater encodings. The default value may be set
at compile time by defining <CODE>TAO_NEGOTIATE_CODESETS 0</CODE> in
<CODE>orbconf.h</CODE>. Codeset negotiation support is enabled by default in
-TAO as shipped.<br> <bold>Note to static lib users</bold> In order to build
+TAO as shipped.<br> <b>Note to static lib users</b> In order to build
TAO statically and get the codeset negotiation feature, two additional steps
are needed to ensure the TAO_Codeset library is linked in and initalized. Add the MPC feature "negotiate_codesets=1" to the default.features file and regenerate your makefiles, and add <CODE>#include "tao/Codeset/Codeset.h"</CODE> somewhere in your application source, such as the cpp file containing your main.</td>
</tr>
@@ -886,7 +887,129 @@ is set. The default is true. </td>
</table>
</p>
</blockquote>
-<h4><a name="MO">5. Miscellaneous Options</a></h4>
+<h4><a name="IRO">5. Invocation Retry Options</a></h4>
+In cases such as connection timing issues or a load balancing server
+is temporarily not able to handle requests, it may be desirable to have
+the ORB transparently retry an invocation a maximum number of times
+until a successful invocation is made. To support this, a set of
+parameters can be used to cycle over base and location forwarded
+profiles until an invocation is successful. When cycling over
+profiles and the first base profile is to be used, a user-defined
+delay is made before retrying.
+<p></p>
+These parameters are used in the following situations:
+<p></p>
+<ul>
+ <li>Initial connection: If the connection to a server would result
+in a TRANSIENT exception being thrown, cycle over profiles no more than the value of
+the -ORBForwardOnTransientLimit option before throwing the exception.
+ <p></p>
+ </li>
+ <li>Waiting for a reply from the server: When using the IIOP protocol,
+on many platforms if zero bytes is read as the server's reply, this could
+indicate that the server may have had a disorderly shutdown or the
+connection to the server was abruptly terminated. In this case
+cycling through the profiles to retry the request will not exceeding the
+value of -ORBForwardOnReplyClosedLimit. If for example the Implementation
+Repository and Activator are used to start the server then this cycling could be
+used to give the server enough time to re-launch. When this option is
+used the -ORBForwardOnTransientLimit option should also be used to
+avoid exceptions being thrown when trying to reestablish a connection.
+<b>Note that because it is not known if the request was sent, this
+could result in the request being processed more than one by the
+server. Therefore this option should be used with care.</b>
+This is why, although a COMM_FAILURE exception is normally thrown in this case,
+this option is kept distinct from -ORBForwardOnCommFailureLimit
+discussed below.
+ <p></p>
+ <li>Server sends an exception as a reply: A reply is received
+and it is checked if it is an exception. If the exception is
+of type COMM_FAILURE with completion status of COMPLETED_NO, then
+the profiles will be cycled no more than the value of option
+-ORBForwardOnCommFailureLimit until a successful reply is
+received. Similar retries can be applied to TRANSIENT exceptions
+(-ORBForwardOnTransientLimit), OBJECT_NOT_EXIST exceptions
+(-ORBForwardOnObjectNotExistLimit), and INV_OBJREF exceptions
+(-ORBForwardOnInvObjrefLimit).
+ <p></p>
+ </li>
+</ul>
+
+The retry options are given in the table below. Note that for
+backward compatibility, the -ORBForward* options described in the
+<a href="#MO">Miscellaneous Options </a> section are retained.
+However, if any option in this section is used, then any
+-ORBForward* option given in the Miscellaneous Options
+section is ignored.
+ <p></p>
+
+These options can also be used in the list of
+ <a href="#TCSF">Client_Strategy_Factory</a> options
+in the service configurator file.
+Using the service configurator file can help insure these
+options are uniformly applied across multiple clients by
+having them use the same configurator file.
+
+<blockquote>
+ <p>
+ <table border="2" cellpadding="0" cellspacing="2">
+ <tbody>
+ <tr>
+ <th>Option</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardTransientLimit</code> <em>limit</em></td>
+ <td>Use this option to cycle through profiles when
+ establishing a connection with a server or when a
+ server replies to a request with a TRANSIENT
+ exception.
+ The number of retries will not exceed <em>limit</em>.</td>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardCommFailureLimit</code> <em>limit</em></td>
+ <td>Use this option to cycle through profiles when a
+ server replies to a request with a COMM_FAILURE
+ exception.
+ The number of retries will not exceed <em>limit</em>.</td>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardOnObjectNotExistLimit</code> <em>limit</em></td>
+ <td>Use this option to cycle through profiles when a
+ server replies to a request with a OBJECT_NOT_EXIST
+ exception.
+ The number of retries will not exceed <em>limit</em>.</td>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardOnInvObjrefLimit</code> <em>limit</em></td>
+ <td>Use this option to cycle through profiles when a
+ server replies to a request with a INV_OBJREF
+ exception.
+ The number of retries will not exceed <em>limit</em>.</td>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardOnReplyClosedLimit</code> <em>limit</em></td>
+ <td>Use this option to cycle through profiles when it has
+ been detected that a connection is closed when reading a server reply.
+ The number of retries will not exceed <em>limit</em>.
+ If this option is used then -ORBForwardTransientLimit should
+ also be used to avoid a TRANSIENT exception being thrown.
+ </td>
+ </tr>
+ <tr>
+ <td><code>-ORBForwardDelay</code> <em>int msecs</em></td>
+ <td>Defines the number of milliseconds to delay while
+ cycling through profiles when the first base profile
+ is to be tried. The default is 100,000 milliseconds
+ (0.1 seconds).</td>
+ </tr>
+ </tbody>
+ </table>
+ </p>
+</blockquote>
+
+
+<h4><a name="MO">6. Miscellaneous Options</a></h4>
Options in this category don't control the behavior of the ORB in
terms of resouces or strategies. Instead, they are helper options
provided for specific application requirements.
@@ -907,7 +1030,7 @@ coexisting ORBs (when there is more than one ORB).</td>
</tr>
<tr>
<td><code>-ORBServerId</code> <em>server_id</em></td>
- <td><a name="-ORBId"></a>This option allows setting a name/id
+ <td><a name="-ORBServerId"></a>This option allows setting a name/id
to a server to uniquely identify a server to TAO's <a href="implrepo">Implementation
Repository</a>. </td>
</tr>
@@ -1011,7 +1134,7 @@ use MIOP protocol.
<p></p>
</li>
<li> <a href="#TTSM">Time Policy Strategy Manager.</a> This factory
-manages the TIME_POLICY strategy used by the ORB for timers and
+manages the TIME_POLICY strategy used by the ORB for timers and
countdowns.
<p></p>
</li>
@@ -1663,63 +1786,73 @@ the protocols in TAO (such as SHMIOP and SSLIOP) can only use the <em>blocked</e
strategy.
</td>
</tr>
+ <tr>
+ <td>Invocation Retry options</td>
+ <td>Options of the same names as the command-line options
+ described in <a href="#IRO">Invocation Retry Options</a>
+ can also be applied client strategy factory service. Any
+ option provided on the command line will override the
+ corresponding option in the service configurator
+ file.
+ </td>
+ </tr>
</tbody>
</table>
</p>
</blockquote>
<h4><a name="TMSF">4. MIOP_Strategy_Factory</a></h4>
- This factory is located in the <code>TAO_PortableGroup</code> library and it
- accepts the options below. This factory can be loaded dynamically using a
+ This factory is located in the <code>TAO_PortableGroup</code> library and it
+ accepts the options below. This factory can be loaded dynamically using a
service configurator directive of the form (all on one line):
- <p><code>dynamic MIOP_Resource_Factory Service_Object *
+ <p><code>dynamic MIOP_Resource_Factory Service_Object *
TAO_PortableGroup:_make_TAO_MIOP_Resource_Factory () ""</code></p>
- Normally in order to setup the MIOP implementation correctly, the application
+ Normally in order to setup the MIOP implementation correctly, the application
will have to use other service configurator directives as well (for example):
- <p><code>dynamic UIPMC_Factory Service_Object *
+ <p><code>dynamic UIPMC_Factory Service_Object *
TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""<br>
- static Resource_Factory "&#8209;ORBProtocolFactory IIOP_Factory
+ static Resource_Factory "&#8209;ORBProtocolFactory IIOP_Factory
&#8209;ORBProtocolFactory UIPMC_Factory"<br>
- dynamic PortableGroup_Loader Service_Object *
+ dynamic PortableGroup_Loader Service_Object *
TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""<br>
- dynamic MIOP_Resource_Factory Service_Object *
+ dynamic MIOP_Resource_Factory Service_Object *
TAO_PortableGroup:_make_TAO_MIOP_Resource_Factory () ""</code></p>
- Any options required to be given to the MIOP_Resource_Factory should be
- specified between the two double-quotes shown above as a space seporated list;
- however none are required as all options take default values if not specified.
- Since MIOP uses UDP sockets (which is not a "reliable" transport unlike tcp/ip)
- it is easy to configure MIOP in such a way that messages will not actually
- reach the servant. The options below are intended to maximize MIOP reliability
- but they must be used with care, users of MIOP must understand that large
- messages are sent in fragments and they have to be reassembled by the server in
- their entirety to be useable by the servant. If even a single data
- fragment/packet is lost, the whole message cannot be reconstructed and will be
- unusable. There is no way for the servant to even know it has missed such a
- MIOP message, and being a one-way protocol, neither will the client be aware
- that the message has been lost. Fragments can be lost due to a variety of
+ Any options required to be given to the MIOP_Resource_Factory should be
+ specified between the two double-quotes shown above as a space seporated list;
+ however none are required as all options take default values if not specified.
+ Since MIOP uses UDP sockets (which is not a "reliable" transport unlike tcp/ip)
+ it is easy to configure MIOP in such a way that messages will not actually
+ reach the servant. The options below are intended to maximize MIOP reliability
+ but they must be used with care, users of MIOP must understand that large
+ messages are sent in fragments and they have to be reassembled by the server in
+ their entirety to be useable by the servant. If even a single data
+ fragment/packet is lost, the whole message cannot be reconstructed and will be
+ unusable. There is no way for the servant to even know it has missed such a
+ MIOP message, and being a one-way protocol, neither will the client be aware
+ that the message has been lost. Fragments can be lost due to a variety of
reasons:
<p></p>
<ul>
<li>
- The client sends too large a message fragment, or sends messages too fast,
- overwhelming the client socket's transmission buffer. (In which case the
- client-side OS simply ignores the excess send requests and some of the
+ The client sends too large a message fragment, or sends messages too fast,
+ overwhelming the client socket's transmission buffer. (In which case the
+ client-side OS simply ignores the excess send requests and some of the
fragments are not actually sent on the wire.)
<li>
- The server socket's receive buffer became too full to aquire the fragments off
- the wire. (In this case the client is again sending messages too fast, but this
- time it is the servant that is too slow to process the messages it has already
+ The server socket's receive buffer became too full to aquire the fragments off
+ the wire. (In this case the client is again sending messages too fast, but this
+ time it is the servant that is too slow to process the messages it has already
received.)
<li>
- Something happend to the network or routing and the packet was lost between the
- client and the server, or the server OS failed to react to the hardware network
+ Something happend to the network or routing and the packet was lost between the
+ client and the server, or the server OS failed to react to the hardware network
device in a timely manor so that network packets were lost.</li></ul>
<p></p>
- <p style="Z-INDEX: 0">In the first two cases above, the loss can be mitigated by
- the client adapting/throttling its sending rate so as to not overflow the
- capacity of the clients operating system sending buffer and the receiving
- buffer of the server socket. If there are multiple clients all sending to the
- same server, all of these clients must be configured to slow down their sending
- rate (as a software system design descision) as otherwise the server's receive
+ <p style="Z-INDEX: 0">In the first two cases above, the loss can be mitigated by
+ the client adapting/throttling its sending rate so as to not overflow the
+ capacity of the clients operating system sending buffer and the receiving
+ buffer of the server socket. If there are multiple clients all sending to the
+ same server, all of these clients must be configured to slow down their sending
+ rate (as a software system design descision) as otherwise the server's receive
buffer will become swamped and some messages will be lost.</p>
<blockquote>
<p>
@@ -1733,137 +1866,137 @@ strategy.
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBMaxFragments</code> <em>limit</em></td>
- <td ALIGN="left">This is a client-side option used to limit the maximum number of
- fragments that a client can break the outgoing message up into. The limit must
- be a positive number or zero (indicating an unlimited number). The default is
- normally <em>0 (i.e. unlimited)</em>, but this default can be overriden when
- the TAO libraries are built in the <code>ace/config.h</code>, by specifying the
+ <td ALIGN="left">This is a client-side option used to limit the maximum number of
+ fragments that a client can break the outgoing message up into. The limit must
+ be a positive number or zero (indicating an unlimited number). The default is
+ normally <em>0 (i.e. unlimited)</em>, but this default can be overriden when
+ the TAO libraries are built in the <code>ace/config.h</code>, by specifying the
new default limit such as <code>#define&nbsp;TAO_DEFAULT_MIOP_MAX_FRAGMENTS&nbsp;1</code>
- which in this case would turn off fragmentation by default (as only a single
- fragment would be allowed), unless a new limit is specified in the service
- file. Any messages that are too large and require more fragments than allowed
- by this setting are simply not transmitted by the client (the message is
- effectly lost without any error indication, other than possiably a debug
- message). This setting can be used as a safety setting to stop swamping the
- network and servants with abnormally large messages, or during testing to
+ which in this case would turn off fragmentation by default (as only a single
+ fragment would be allowed), unless a new limit is specified in the service
+ file. Any messages that are too large and require more fragments than allowed
+ by this setting are simply not transmitted by the client (the message is
+ effectly lost without any error indication, other than possiably a debug
+ message). This setting can be used as a safety setting to stop swamping the
+ network and servants with abnormally large messages, or during testing to
"lose" large messages for whatever reason.
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBMaxFragmentSize</code> <em>bytes</em></td>
- <td ALIGN="left">Another client-side option used to limit the number of bytes in
+ <td ALIGN="left">Another client-side option used to limit the number of bytes in
each individual MIOP fragment, which must be between <em>272</em> and <em><code>ACE_MAX_UDP_PACKET_SIZE</code>
- (normally 65507)</em> bytes inclusive. Smaller values increase (and larger
- values decrease) the number of fragments required to send the actual payload
- data. Each fragment requires the overhead of a new MIOP header (32 bytes)
- prefixing the actual data being sent, with the header reducing the actual
- usable payload data inside each fragment. Roughly this value can be considered
- as the MTU (Maximum Transmission Unit) set for the specific connection. The
- default takes the same value as the <code>ACE_MAX_UDP_PACKET_SIZE</code> for
- the system, but this can be overridden in the <code>ace/config.h</code> by
+ (normally 65507)</em> bytes inclusive. Smaller values increase (and larger
+ values decrease) the number of fragments required to send the actual payload
+ data. Each fragment requires the overhead of a new MIOP header (32 bytes)
+ prefixing the actual data being sent, with the header reducing the actual
+ usable payload data inside each fragment. Roughly this value can be considered
+ as the MTU (Maximum Transmission Unit) set for the specific connection. The
+ default takes the same value as the <code>ACE_MAX_UDP_PACKET_SIZE</code> for
+ the system, but this can be overridden in the <code>ace/config.h</code> by
giving a new value for <code>#define&nbsp;TAO_DEFAULT_MIOP_FRAGMENT_SIZE&nbsp;65507</code>
- when the TAO libraries are built. <b>Note: most gateways and routing networks
- define an MTU of around <em>1458-1500</em>, it is therefore advisable to
- specify the correct <code>&#8209;ORBMaxFragmentSize</code> value otherwise some
- fragments may be lost.</b> See also the <code>&#8209;ORBSndSock</code> option
+ when the TAO libraries are built. <b>Note: most gateways and routing networks
+ define an MTU of around <em>1458-1500</em>, it is therefore advisable to
+ specify the correct <code>&#8209;ORBMaxFragmentSize</code> value otherwise some
+ fragments may be lost.</b> See also the <code>&#8209;ORBSndSock</code> option
below. Note also if this value is changed (during development) and the <code>&#8209;ORBMaxFragmentRate</code>
- option below is also specified, you should change that value by the same
- factor, otherwise the speed of transmission will be effected as these two
+ option below is also specified, you should change that value by the same
+ factor, otherwise the speed of transmission will be effected as these two
options specify a working ratio.
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBMaxFragmentRate</code> <em>microseconds</em></td>
<td ALIGN="left">
- <P>This client-side option specifies a non-zero, positive amount of time (in
- uSec, i.e. microseconds) that it takes to transmit and process an individual
+ <P>This client-side option specifies a non-zero, positive amount of time (in
+ uSec, i.e. microseconds) that it takes to transmit and process an individual
message fragment of the maximum size; see the <code>&#8209;ORBMaxFragmentSize</code>
- option above. (This is the total of the
- client&#8209;&gt;server&#8209;&gt;servant processing time not just the average
- network transmission delay.) The client attempts to keep the rate at which it
- sends messages down to this speed by purposly delaying sending message
+ option above. (This is the total of the
+ client&#8209;&gt;server&#8209;&gt;servant processing time not just the average
+ network transmission delay.) The client attempts to keep the rate at which it
+ sends messages down to this speed by purposly delaying sending message
fragments, if it would exceeding this capacity (but also see the <code>&#8209;ORBSendHighWaterMark</code>
option below). The default is same value as specified, or is defaulted by, the <code>
- &#8209;ORBMaxFragmentSize</code> option above, but this time teated as
- microseconds not bytes. (This default delay value is approximatly the time
- required to transmit that number of bytes on a 10Base&#8209;T network.) Larger
- values will throttle back the clients transmittion rate, smaller values will
+ &#8209;ORBMaxFragmentSize</code> option above, but this time teated as
+ microseconds not bytes. (This default delay value is approximatly the time
+ required to transmit that number of bytes on a 10Base&#8209;T network.) Larger
+ values will throttle back the clients transmittion rate, smaller values will
speed it up; but note this value is used with the <code>&#8209;ORBMaxFragmentSize</code>
- option above&nbsp;to&nbsp;specify a working ratio&nbsp;so this value may need
+ option above&nbsp;to&nbsp;specify a working ratio&nbsp;so this value may need
to be altered if the size is changed.
</P>
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBSendHighWaterMark</code> <em>bytes</em></td>
- <td ALIGN="left">This client-side option is the usable size of the message
- buffer, i.e how much data can be sent without introducing delays into the
+ <td ALIGN="left">This client-side option is the usable size of the message
+ buffer, i.e how much data can be sent without introducing delays into the
transmition of individual MIOP fragments (due to the <code>&#8209;ORBMaxFragmentRate</code>
- option above). Its default value is the size of the buffer maintained by the
+ option above). <b>Its default value is the size of the buffer maintained by the
Operating System for the sending socket at the client side (see the <code>&#8209;ORBSndSock</code>
- option below) as although it should idealy be based on the server's receive
- socket buffer size, that information is not available to the client, and the
- two values normally default to the same size anyway.</B> If in doubt specify
+ option below) and although it should ideally be based on the server's receive
+ socket buffer size, that information is not available to the client, and the
+ two values normally default to the same size anyway.</b> If in doubt specify
this value and&nbsp;set it to a smaller value than the full size of the servers <CODE>
- &#8209;ORBRcvSock</CODE> option&nbsp;(especially if multiple clients are all
- broadcasting to the same server, when each client should only use a fraction of
+ &#8209;ORBRcvSock</CODE> option&nbsp;(especially if multiple clients are all
+ broadcasting to the same server, when each client should only use a fraction of
the full buffer size based upon the number of clients actually in use).
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBSndSock</code> <em>bytes</em></td>
- <td ALIGN="left">This client-side option is the size of the outgoing socket's
- message buffer. If specified in the service configuration file, this value will
- override (for MIOP only) the value specified by the corresponding ORB_init
- parameter. If NOT specified in either place, the default value for the system
- itself will be used. NOTE: the <code>&#8209;ORBSndSock</code> size normally
- limits the maximum size of an individual message fragment, larger fragments can
- be simply ignored (i.e. packet loss) by the client's socket without any error
- indication; this value and the <code>&#8209;ORBMaxFragmentSize</code> should be
- set with care. For a linux type OS, the systems SndSock is usually defaulted to
- about <b>65535</b> bytes, but whatever value is actually specified it is
- normally doubled internally to take account of the control structures required
+ <td ALIGN="left">This client-side option is the size of the outgoing socket's
+ message buffer. If specified in the service configuration file, this value will
+ override (for MIOP only) the value specified by the corresponding ORB_init
+ parameter. If NOT specified in either place, the default value for the system
+ itself will be used. NOTE: the <code>&#8209;ORBSndSock</code> size normally
+ limits the maximum size of an individual message fragment, larger fragments can
+ be simply ignored (i.e. packet loss) by the client's socket without any error
+ indication; this value and the <code>&#8209;ORBMaxFragmentSize</code> should be
+ set with care. For a linux type OS, the systems SndSock is usually defaulted to
+ about <b>65535</b> bytes, but whatever value is actually specified it is
+ normally doubled internally to take account of the control structures required
to track the messages themselves and so it is not a hard limit.
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBRcvSock</code> <em>bytes</em></td>
- <td ALIGN="left">This server-side option is the size of the incoming socket's
- message buffer, i.e how much data can be received directly off the wire by the
- server and queued for processing by the servant whilst it is busy. If specified
- in the service configuration file, this value will override (for MIOP only) the
- value specified by the corresponding ORB_init parameter. If NOT specified in
- either place, the default value for the system itself will be used. Again for a
- linux type OS, the systems RcvSock is usually about <b>65535</b> bytes, but
- whatever value is actually specified it is normally doubled internally to take
- account of the control structures required to track the messages themselves and
- so it is not a hard limit. Specifying as large a value as possible (i.e.
+ <td ALIGN="left">This server-side option is the size of the incoming socket's
+ message buffer, i.e how much data can be received directly off the wire by the
+ server and queued for processing by the servant whilst it is busy. If specified
+ in the service configuration file, this value will override (for MIOP only) the
+ value specified by the corresponding ORB_init parameter. If NOT specified in
+ either place, the default value for the system itself will be used. Again for a
+ linux type OS, the systems RcvSock is usually about <b>65535</b> bytes, but
+ whatever value is actually specified it is normally doubled internally to take
+ account of the control structures required to track the messages themselves and
+ so it is not a hard limit. Specifying as large a value as possible (i.e.
whatever upper limit the OS will allow) with the MIOP <code>&#8209;ORBRcvSock</code>
- option is advisable to maximize the available sockets receive buffer space, but
- obviosuly this is a trade off between available memory and other OS non-paged
+ option is advisable to maximize the available sockets receive buffer space, but
+ obviosuly this is a trade off between available memory and other OS non-paged
memory uses.
</td>
</tr>
<tr>
- <td ALIGN="left"><code>&#8209;ORBFragmentsCleanupStrategy</code> <em>DELAY | NUMBER
+ <td ALIGN="left"><code>&#8209;ORBFragmentsCleanupStrategy</code> <em>DELAY | NUMBER
| MEMORY</em></td>
- <td ALIGN="left">This option is used on the server to specify the incomplete
- fragments cleanup strategy. The default is <em>DELAY</em>, indicating that the
- fragments that cannot be reassembled after a certain delay should be removed
+ <td ALIGN="left">This option is used on the server to specify the incomplete
+ fragments cleanup strategy. The default is <em>DELAY</em>, indicating that the
+ fragments that cannot be reassembled after a certain delay should be removed
from the waiting queue (i.e. considered lost messages). The other options are <em>
- NUMBER</em> and <em>MEMORY</em>, which respectively mean the number of
- messages in the waiting queue will be limited, or the whole memory comsumed by
+ NUMBER</em> and <em>MEMORY</em>, which respectively mean the number of
+ messages in the waiting queue will be limited, or the whole memory comsumed by
the incomplete messages in the waiting queue will be limited.
</td>
</tr>
<tr>
<td ALIGN="left"><code>&#8209;ORBFragmentsCleanupBound</code> <em>limit</em></td>
<td ALIGN="left">This option specifies the numerical limit for the server's <code>&#8209;ORBFragmentsCleanupStrategy</code>
- option. If the strategy is <em>DELAY</em>, the value indicates the delay in
- milliseconds (defaulting to 1000 milliseconds i.e. 1 second). If the strategy
- is <em>NUMBER</em>, the limit indicates the number of non-reassembled messages
- in the queue (defaulting to 5 messages). If the strategy is <em>MEMORY</em>,
- the limit indicates the number of bytes reserved for the whole queue (with the
+ option. If the strategy is <em>DELAY</em>, the value indicates the delay in
+ milliseconds (defaulting to 1000 milliseconds i.e. 1 second). If the strategy
+ is <em>NUMBER</em>, the limit indicates the number of non-reassembled messages
+ in the queue (defaulting to 5 messages). If the strategy is <em>MEMORY</em>,
+ the limit indicates the number of bytes reserved for the whole queue (with the
default being 3000000 bytes).
</td>
</tr>
@@ -1881,7 +2014,7 @@ configurator
<code>svc.conf</code> file (all in one line)</p>
<p><code>static
Time_Policy_Manager "[option]"</code></p>
-<p> would load the option listed within "".
+<p> would load the option listed within "".
An <a href="../tests/Time_Policy/hr_time.conf">example</a>
is available that shows how to specify this option in the <code>svc.conf</code>
file.</p>
@@ -1896,9 +2029,9 @@ file.</p>
</tr>
<tr>
<td><code>-ORBTimePolicyStrategy</code> <em>strategy</em></td>
- <td><p><a name="-ORBTimePolicyStrategy"></a>The <em>strategy</em> argument
+ <td><p><a name="-ORBTimePolicyStrategy"></a>The <em>strategy</em> argument
defines the TIME_POLICY strategy to load. TAO provides two
-standard TIME_POLICY strategies:</p>
+standard TIME_POLICY strategies:</p>
<p><em>OS</em> denotes the system time policy strategy which uses the systems
equivalent of <code>gettimeofday</code> to return a current time value. This is the default for
TAO (unless <code>TAO_USE_HR_TIME_POLICY_STRATEGY</code> has been defined).</p>
@@ -1907,7 +2040,7 @@ equivalent of a <code>MONOTONIC</code> timer source to return a current time val
<code>TAO_USE_HR_TIME_POLICY_STRATEGY</code> has been defined this becomes the default for TAO).</p>
<p>Any other value is assumed to denote the exact name of a dynamically loadable
TIME_POLICY strategy. The <a href="../tests/Time_Policy_Custom">Time_Policy_Custom</a>
-test provides an example of this functionality.</p>
+test provides an example of this functionality.</p>
</td>
</tr>
</tbody>
diff --git a/TAO/examples/Simple/Simple_util.cpp b/TAO/examples/Simple/Simple_util.cpp
index 4ecda885ac7..56ceefb0546 100644
--- a/TAO/examples/Simple/Simple_util.cpp
+++ b/TAO/examples/Simple/Simple_util.cpp
@@ -273,7 +273,7 @@ Client<ServerInterface>::read_ior (ACE_TCHAR *filename)
ACE_TEXT ("open")),
-1);
- ACE_Read_Buffer ior_buffer (f_handle, true);
+ ACE_Read_Buffer ior_buffer (f_handle);
char *data = ior_buffer.read ();
if (data == 0)
diff --git a/TAO/examples/Simple/time/Time_Client_i.cpp b/TAO/examples/Simple/time/Time_Client_i.cpp
index fab114c2385..3702636e5a9 100644
--- a/TAO/examples/Simple/time/Time_Client_i.cpp
+++ b/TAO/examples/Simple/time/Time_Client_i.cpp
@@ -56,6 +56,9 @@ Time_Client_i::run (const char *name,
if (client_.do_shutdown () == 1)
client_->shutdown ();
+
+ CORBA::ORB_var orb = client_.orb ();
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/examples/Simple/time/server.cpp b/TAO/examples/Simple/time/server.cpp
index 37d0a64e62c..7a19abd727f 100644
--- a/TAO/examples/Simple/time/server.cpp
+++ b/TAO/examples/Simple/time/server.cpp
@@ -14,7 +14,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
try
{
- if (server.init ("Time", argc, argv) == -1)
+ if (server.init ("Time",
+ argc,
+ argv) == -1)
return 1;
else
{
@@ -24,14 +26,14 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
catch (const CORBA::UserException& userex)
{
userex._tao_print_exception ("User Exception in main");
- return 1;
+ return -1;
}
catch (const CORBA::SystemException& sysex)
{
sysex._tao_print_exception ("System Exception in main");
- return 1;
+ return -1;
}
- catch (const CORBA::Exception &e)
+ catch (const ::CORBA::Exception &e)
{
e._tao_print_exception ("CORBA exception in main");
return 1;
diff --git a/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc
index 61c0dbcbc1a..06bbc518488 100644
--- a/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc
+++ b/TAO/orbsvcs/Concurrency_Service/Concurrency_Service.mpc
@@ -3,8 +3,4 @@
project : orbsvcsexe, install, concurrency_serv, naming, utils, svc_utils {
exename = tao_cosconcurrency
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc
index c1d70b797be..3ddfdb0866b 100644
--- a/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc
+++ b/TAO/orbsvcs/CosEvent_Service/CosEvent_Service.mpc
@@ -3,8 +3,4 @@
project : orbsvcsexe, install, naming, event_serv, svc_utils, iortable, messaging_optional, portableserver {
exename = tao_cosevent
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
new file mode 100644
index 00000000000..8788cfb8081
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
@@ -0,0 +1,272 @@
+// $Id$
+
+#include "Config_Backing_Store.h"
+#include "Server_Info.h"
+#include "Activator_Info.h"
+#include "utils.h"
+#include "ace/OS_NS_unistd.h"
+
+static const ACE_TCHAR* STARTUP_COMMAND = ACE_TEXT("StartupCommand");
+static const ACE_TCHAR* WORKING_DIR = ACE_TEXT("WorkingDir");
+static const ACE_TCHAR* ENVIRONMENT = ACE_TEXT("Environment");
+static const ACE_TCHAR* ACTIVATION = ACE_TEXT("Activation");
+static const ACE_TCHAR* PARTIAL_IOR = ACE_TEXT("Location");
+static const ACE_TCHAR* IOR = ACE_TEXT("IOR");
+static const ACE_TCHAR* START_LIMIT = ACE_TEXT("StartLimit");
+static const ACE_TCHAR* ACTIVATOR = ACE_TEXT("Activator");
+static const ACE_TCHAR* SERVERS_ROOT_KEY = ACE_TEXT("Servers");
+static const ACE_TCHAR* ACTIVATORS_ROOT_KEY = ACE_TEXT("Activators");
+static const ACE_TCHAR* TOKEN = ACE_TEXT("Token");
+static const ACE_TCHAR* SERVER_ID = ACE_TEXT("ServerId");
+
+#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
+static const char* WIN32_REG_KEY = "Software\\TAO\\ImplementationRepository";
+#endif
+
+Config_Backing_Store::Config_Backing_Store(ACE_Configuration& config)
+: config_(config),
+ status_(-1)
+{
+}
+
+Config_Backing_Store::~Config_Backing_Store()
+{
+}
+
+void Config_Backing_Store::loadActivators ()
+{
+ 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_TString 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));
+ activators().bind (lcase (name), info);
+ index++;
+ }
+ }
+}
+
+void
+Config_Backing_Store::loadServers ()
+{
+ 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_TString name;
+ while (config_.enumerate_sections (root, index, name) == 0)
+ {
+ ACE_CString server_id, 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, SERVER_ID, server_id);
+ 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(server_id, name, aname, cmdline,
+ env_vars, dir, amode, start_limit, partial_ior, ior));
+ servers().bind (name, info);
+ index++;
+ }
+ }
+}
+
+int
+Config_Backing_Store::persistent_remove (const ACE_CString& name, bool activator)
+{
+ const ACE_TCHAR* const key = (activator ? ACTIVATORS_ROOT_KEY : SERVERS_ROOT_KEY);
+ if (activator)
+ {
+ }
+ else
+ {
+ }
+ return remove (name, key);
+}
+
+int
+Config_Backing_Store::remove (const ACE_CString& name, const ACE_TCHAR* key)
+{
+ ACE_Configuration_Section_Key root;
+ int err = config_.open_section (config_.root_section (), key, 0, root);
+ if (err != 0)
+ {
+ return 0; // Already gone.
+ }
+ return config_.remove_section (root, name.c_str (), 1);
+}
+
+static int get_key (ACE_Configuration& cfg, const ACE_CString& name,
+ const ACE_TCHAR* const sub_section, ACE_Configuration_Section_Key& key)
+{
+ ACE_Configuration_Section_Key root;
+ int err = cfg.open_section (cfg.root_section(), sub_section, 1, root);
+ if (err != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Unable to open config section:%s\n", sub_section));
+ return err;
+ }
+ err = cfg.open_section (root, name.c_str (), 1, key);
+ if (err != 0)
+ {
+ ACE_ERROR((LM_ERROR, "Unable to open config section:%s\n", name.c_str()));
+ }
+ return err;
+}
+
+int
+Config_Backing_Store::persistent_update(const Server_Info_Ptr& info)
+{
+ ACE_Configuration_Section_Key key;
+ int err = get_key(this->config_, info->name, SERVERS_ROOT_KEY, key);
+ if (err != 0)
+ {
+ return err;
+ }
+
+ ACE_CString envstr = ImR_Utils::envListToString(info->env_vars);
+
+ this->config_.set_string_value (key, SERVER_ID, info->server_id.c_str ());
+ this->config_.set_string_value (key, ACTIVATOR, info->activator.c_str ());
+ this->config_.set_string_value (key, STARTUP_COMMAND, info->cmdline.c_str ());
+ this->config_.set_string_value (key, WORKING_DIR, info->dir.c_str ());
+ this->config_.set_string_value (key, ENVIRONMENT, envstr);
+ this->config_.set_integer_value (key, ACTIVATION, info->activation_mode);
+ this->config_.set_integer_value (key, START_LIMIT, info->start_limit);
+ this->config_.set_string_value (key, PARTIAL_IOR, info->partial_ior.c_str ());
+ this->config_.set_string_value (key, IOR, info->ior.c_str());
+
+ return 0;
+}
+
+int
+Config_Backing_Store::persistent_update(const Activator_Info_Ptr& info)
+{
+ ACE_Configuration_Section_Key key;
+ int err = get_key(this->config_, info->name, ACTIVATORS_ROOT_KEY, key);
+ if (err != 0)
+ {
+ return err;
+ }
+
+ this->config_.set_integer_value (key, TOKEN, info->token);
+ this->config_.set_string_value (key, IOR, info->ior.c_str ());
+
+ return 0;
+}
+
+int
+Config_Backing_Store::persistent_load ()
+{
+ if (status_ != 0)
+ {
+ return status_;
+ }
+
+ loadActivators();
+ loadServers();
+
+ return 0;
+}
+
+Heap_Backing_Store::Heap_Backing_Store(const ACE_CString& filename, bool start_clean)
+: Config_Backing_Store(heap_),
+ filename_(filename)
+{
+ if (start_clean)
+ {
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "Heap start clean\n"));
+ }
+ ACE_OS::unlink ( this->filename_.c_str () );
+ }
+
+ status_ = heap_.open (this->filename_.c_str ());
+}
+
+Heap_Backing_Store::~Heap_Backing_Store()
+{
+}
+
+const char*
+Heap_Backing_Store::repo_mode() const
+{
+ return this->filename_.c_str();
+}
+
+#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
+static HKEY setup_registry(const bool start_clean)
+{
+ if (start_clean)
+ {
+ 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);
+ }
+
+ return ACE_Configuration_Win32Registry::
+ resolve_key (HKEY_LOCAL_MACHINE, WIN32_REG_KEY);
+}
+#endif
+
+Registry_Backing_Store::Registry_Backing_Store(const ACE_CString& filename, bool start_clean)
+#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
+: Config_Backing_Store(win32registry_),
+ win32registry_(setup_registry(start_clean))
+#else
+: Config_Backing_Store(invalid_config_)
+#endif
+{
+#if !defined (ACE_WIN32) || defined (ACE_LACKS_WIN32_REGISTRY)
+ ACE_ERROR ((LM_ERROR, "Registry persistence is only "
+ "supported on Windows\n"));
+ status_ = -1;
+#endif
+}
+
+Registry_Backing_Store::~Registry_Backing_Store()
+{
+}
+
+const char*
+Registry_Backing_Store::repo_mode() const
+{
+ return "Registry";
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.h b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.h
new file mode 100644
index 00000000000..e6a6d9b2b1b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+* @file Config_Backing_Store.h
+*
+* $Id$
+*
+* These classes define ACE_Configuration implementations of the backing store.
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+* @author Priyanka Gontla <gontla_p@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef CONFIG_BACKING_STORE_H
+#define CONFIG_BACKING_STORE_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Locator_Repository.h"
+
+class ACE_Configuration;
+
+/**
+* @class Config_Backing_Store
+*
+* @brief ACE_Configuration backing store interface containing all ImR persistent information.
+*
+*/
+class Config_Backing_Store : public Locator_Repository
+{
+public:
+ Config_Backing_Store(ACE_Configuration& config);
+
+ virtual ~Config_Backing_Store();
+
+ virtual int persistent_load();
+
+protected:
+ virtual int persistent_update(const Server_Info_Ptr& info);
+
+ virtual int persistent_update(const Activator_Info_Ptr& info);
+
+ virtual int persistent_remove(const ACE_CString& name, bool activator);
+
+ int remove(const ACE_CString& name, const ACE_TCHAR* key);
+
+ ACE_Configuration& config_;
+ int status_;
+
+private:
+ void loadServers();
+ void loadActivators();
+};
+
+/**
+* @class Heap_Backing_Store
+*
+* @brief Heap file backing store containing all ImR persistent information.
+*
+*/
+class Heap_Backing_Store : public Config_Backing_Store
+{
+public:
+ Heap_Backing_Store(const ACE_CString& filename, bool start_clean);
+
+ virtual ~Heap_Backing_Store();
+
+ virtual const char* repo_mode() const;
+
+private:
+ const ACE_CString filename_;
+ ACE_Configuration_Heap heap_;
+};
+
+/**
+* @class Registry_Backing_Store
+*
+* @brief Win32 registry backing store containing all ImR persistent information.
+*
+*/
+class Registry_Backing_Store : public Config_Backing_Store
+{
+public:
+ Registry_Backing_Store(const ACE_CString& filename, bool start_clean);
+
+ virtual ~Registry_Backing_Store();
+
+ virtual const char* repo_mode() const;
+
+private:
+#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
+ ACE_Configuration_Win32Registry win32registry_;
+#else
+ // invalid config to simplify #defines
+ ACE_Configuration_Heap invalid_config_;
+#endif
+};
+
+
+#endif /* CONFIG_BACKING_STORE_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
index b0f1d714109..ed95113d2ba 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
@@ -4,6 +4,10 @@
#include "utils.h"
#include "Iterator.h"
#include "INS_Locator.h"
+#include "Locator_Repository.h"
+#include "Config_Backing_Store.h"
+#include "Shared_Backing_Store.h"
+#include "XML_Backing_Store.h"
#include "orbsvcs/Time_Utilities.h"
@@ -138,17 +142,49 @@ ImR_Locator_i::init_with_orb (CORBA::ORB_ptr orb, Options& opts)
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)
+ // create the selected Locator_Repository with backing store
+ switch (opts.repository_mode())
{
- ACE_ERROR_RETURN ((LM_ERROR, "Repository failed to initialize\n"), -1);
+ case Options::REPO_REGISTRY:
+ {
+ repository_.reset(new Registry_Backing_Store(opts.persist_file_name(), opts.repository_erase()));
+ break;
+ }
+ case Options::REPO_HEAP_FILE:
+ {
+ repository_.reset(new Heap_Backing_Store(opts.persist_file_name(), opts.repository_erase()));
+ break;
+ }
+ case Options::REPO_XML_FILE:
+ {
+ repository_.reset(new XML_Backing_Store(opts.persist_file_name(), opts.repository_erase()));
+ break;
+ }
+ case Options::REPO_SHARED_FILES:
+ {
+ repository_.reset(new Shared_Backing_Store(opts.persist_file_name(), opts.repository_erase()));
+ break;
+ }
+ case Options::REPO_NONE:
+ {
+ repository_.reset(new No_Backing_Store);
+ break;
+ }
+ default:
+ {
+ bool invalid_rmode_specified = false;
+ ACE_ASSERT (invalid_rmode_specified);
+ ACE_UNUSED_ARG (invalid_rmode_specified);
+ ACE_ERROR_RETURN ((LM_ERROR, "Repository failed to initialize\n"), -1);
+ }
}
+ this->repository_->debug (opts.debug());
+
+ // Load from persistent storage. This will load any values that
+ // may have been persisted before.
+ this->repository_->persistent_load();
+
// Activate the two poa managers
PortableServer::POAManager_var poaman =
this->root_poa_->the_POAManager ();
@@ -204,7 +240,7 @@ ImR_Locator_i::run (void)
"\tMulticast : %C\n",
ping_interval_.msec (),
startup_timeout_.sec (),
- repository_.repo_mode (),
+ repository_->repo_mode (),
ior_multicast_.reactor () != 0 ? "Enabled" : "Disabled"));
ACE_DEBUG ((LM_DEBUG,
"\tDebug : %d\n"
@@ -221,16 +257,16 @@ ImR_Locator_i::run (void)
void
ImR_Locator_i::shutdown (CORBA::Boolean activators, CORBA::Boolean servers)
{
- if (servers != 0 && this->repository_.servers ().current_size () > 0)
+ 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)
+ 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 ());
+ Locator_Repository::AIMap::ITERATOR it (this->repository_->activators ());
for (;it.next (entry) != 0; it.advance ())
{
Activator_Info_Ptr info = entry->int_id_;
@@ -383,7 +419,7 @@ ImR_Locator_i::register_activator (const char* aname,
CORBA::Long token = ACE_OS::gettimeofday ().msec ();
- int err = this->repository_.add_activator (aname, token, ior.in (), activator);
+ int err = this->repository_->add_activator (aname, token, ior.in (), activator);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
@@ -424,7 +460,7 @@ void
ImR_Locator_i::unregister_activator_i (const char* aname)
{
ACE_ASSERT (aname != 0);
- int err = this->repository_.remove_activator (aname);
+ int err = this->repository_->remove_activator (aname);
ACE_UNUSED_ARG (err);
}
@@ -436,13 +472,13 @@ ImR_Locator_i::notify_child_death (const char* name)
if (this->debug_ > 1)
ACE_DEBUG ((LM_DEBUG, "ImR: Server has died <%C>.\n", name));
- Server_Info_Ptr info = this->repository_.get_server (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);
+ int err = this->repository_->update_server (info);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
}
@@ -475,7 +511,7 @@ ImR_Locator_i::activate_server_by_name (const char* name, bool manual_start)
// servers unless manual_start=true
ACE_ASSERT (name != 0);
- Server_Info_Ptr info = this->repository_.get_server (name);
+ Server_Info_Ptr info = this->repository_->get_server (name);
if (info.null ())
{
ACE_ERROR ((LM_ERROR, "ImR: Cannot find info for server <%C>\n", name));
@@ -550,7 +586,7 @@ ImR_Locator_i::activate_server_i (Server_Info& info, bool manual_start)
char*
ImR_Locator_i::activate_perclient_server_i (Server_Info info, bool manual_start)
{
- Server_Info_Ptr shared_info = this->repository_.get_server (info.name);
+ Server_Info_Ptr shared_info = this->repository_->get_server (info.name);
do
{
ImplementationRepository::StartupInfo* psi =
@@ -791,13 +827,13 @@ ImR_Locator_i::add_or_update_server (
limit = 1;
}
- Server_Info_Ptr info = this->repository_.get_server (server);
+ Server_Info_Ptr info = this->repository_->get_server (server);
if (info.null ())
{
if (this->debug_ > 1)
ACE_DEBUG ((LM_DEBUG, "ImR: Adding server <%C>.\n", server));
- this->repository_.add_server ("",
+ this->repository_->add_server ("",
server,
options.activator.in (),
options.command_line.in (),
@@ -818,7 +854,7 @@ ImR_Locator_i::add_or_update_server (
info->activation_mode = options.activation;
info->start_limit = limit;
info->start_count = 0;
- int err = this->repository_.update_server (*info);
+ int err = this->repository_->update_server (info);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
}
@@ -867,10 +903,10 @@ ImR_Locator_i::remove_server (const char* name)
// 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);
+ Server_Info_Ptr info = this->repository_->get_server (name);
if (! info.null ())
{
- if (this->repository_.remove_server (name) == 0)
+ if (this->repository_->remove_server (name) == 0)
{
if (this->debug_ > 1)
ACE_DEBUG ((LM_DEBUG, "ImR: Removing Server <%C>...\n", name));
@@ -916,7 +952,7 @@ ImR_Locator_i::shutdown_server (const char* server)
if (this->debug_ > 0)
ACE_DEBUG ((LM_DEBUG, "ImR: Shutting down server <%C>.\n", server));
- Server_Info_Ptr info = this->repository_.get_server (server);
+ Server_Info_Ptr info = this->repository_->get_server (server);
if (info.null ())
{
ACE_ERROR ((LM_ERROR,
@@ -943,7 +979,7 @@ ImR_Locator_i::shutdown_server (const char* server)
catch (const CORBA::TIMEOUT&)
{
info->reset ();
- int err = this->repository_.update_server (*info);
+ 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
@@ -966,7 +1002,7 @@ ImR_Locator_i::shutdown_server (const char* server)
// operation, but it doesn't hurt to update it again.
info->reset ();
- int err = this->repository_.update_server (*info);
+ int err = this->repository_->update_server (info);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
}
@@ -1007,16 +1043,16 @@ ImR_Locator_i::server_is_running (const char* id,
name.c_str (), ior.in ()));
if (this->unregister_if_address_reused_)
- this->repository_.unregister_if_address_reused (server_id, name, partial_ior);
+ this->repository_->unregister_if_address_reused (server_id, name, partial_ior);
- Server_Info_Ptr info = this->repository_.get_server (name);
+ 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 <%C>.\n", name.c_str ()));
ImplementationRepository::EnvironmentList env (0);
- this->repository_.add_server (server_id,
+ this->repository_->add_server (server_id,
name,
"", // no activator
"", // no cmdline
@@ -1046,7 +1082,7 @@ ImR_Locator_i::server_is_running (const char* id,
info->partial_ior = partial_ior;
info->server = ImplementationRepository::ServerObject::_nil (); // Will connect at first access
- int err = this->repository_.update_server (*info);
+ int err = this->repository_->update_server (info);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
@@ -1072,7 +1108,7 @@ void
ImR_Locator_i::server_is_shutting_down (const char* server)
{
ACE_ASSERT (server != 0);
- Server_Info_Ptr info = this->repository_.get_server (server);
+ Server_Info_Ptr info = this->repository_->get_server (server);
if (info.null ())
{
if (this->debug_ > 1)
@@ -1088,7 +1124,7 @@ ImR_Locator_i::server_is_shutting_down (const char* server)
info->reset ();
- int const err = this->repository_.update_server (*info);
+ int const err = this->repository_->update_server (info);
ACE_ASSERT (err == 0);
ACE_UNUSED_ARG (err);
}
@@ -1099,7 +1135,7 @@ ImR_Locator_i::find (const char* server,
{
ACE_ASSERT (server != 0);
- Server_Info_Ptr info = this->repository_.get_server (server);
+ Server_Info_Ptr info = this->repository_->get_server (server);
if (! info.null ())
{
imr_info = info->createImRServerInfo ();
@@ -1131,10 +1167,10 @@ ImR_Locator_i::list (CORBA::ULong how_many,
ImplementationRepository::ServerInformationList (0), CORBA::NO_MEMORY ());
Locator_Repository::SIMap::ENTRY* entry = 0;
- Locator_Repository::SIMap::ITERATOR it (this->repository_.servers ());
+ 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 ();
+ CORBA::ULong n = this->repository_->servers ().current_size ();
if (how_many > 0 && n > how_many)
{
n = how_many;
@@ -1157,7 +1193,7 @@ ImR_Locator_i::list (CORBA::ULong how_many,
server_list[i] = *imr_info;
}
- if (this->repository_.servers ().current_size () > n)
+ if (this->repository_->servers ().current_size () > n)
{
if (this->debug_ > 1)
ACE_DEBUG ((LM_DEBUG, "ImR_Locator_i::list: Creating ServerInformation Iterator\n"));
@@ -1165,7 +1201,7 @@ ImR_Locator_i::list (CORBA::ULong how_many,
ImR_Iterator* imr_iter = 0;
ACE_NEW_THROW_EX (imr_iter,
- ImR_Iterator (n, this->repository_, this->imr_poa_.in ()),
+ ImR_Iterator (n, *this->repository_, this->imr_poa_.in ()),
CORBA::NO_MEMORY ());
PortableServer::ServantBase_var tmp (imr_iter);
@@ -1188,7 +1224,7 @@ ImR_Locator_i::list (CORBA::ULong how_many,
Activator_Info_Ptr
ImR_Locator_i::get_activator (const ACE_CString& aname)
{
- Activator_Info_Ptr info = this->repository_.get_activator (aname);
+ Activator_Info_Ptr info = this->repository_->get_activator (aname);
if (! info.null ())
{
this->connect_activator (*info);
@@ -1239,11 +1275,11 @@ ImR_Locator_i::connect_activator (Activator_Info& info)
void
ImR_Locator_i::auto_start_servers (void)
{
- if (this->repository_.servers ().current_size () == 0)
+ if (this->repository_->servers ().current_size () == 0)
return;
Locator_Repository::SIMap::ENTRY* server_entry;
- Locator_Repository::SIMap::ITERATOR server_iter (this->repository_.servers ());
+ 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
@@ -1405,7 +1441,7 @@ ImR_Locator_i::is_alive_i (Server_Info& info)
// 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 (info.cmdline.length () == 0 || ! repository_->has_activator (info.activator))
{
if (debug_ > 1)
{
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
index fc26f46433e..130705560a0 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h
@@ -8,9 +8,11 @@
#include "locator_export.h"
#include "Adapter_Activator.h"
+#include "Activator_Info.h"
#include "Forwarder.h"
#include "Locator_Options.h"
-#include "Locator_Repository.h"
+#include "Server_Info.h"
+#include "ace/Auto_Ptr.h"
#include "AsyncStartupWaiter_i.h"
#include "tao/IORTable/IORTable.h"
@@ -28,6 +30,7 @@ class ACE_Reactor;
ACE_END_VERSIONED_NAMESPACE_DECL
class INS_Locator;
+class Locator_Repository;
/// Gets a request from a client and depending on the POA name,
/// requests an activator to take care of activating the
@@ -142,7 +145,7 @@ private:
TAO_IOR_Multicast ior_multicast_;
- Locator_Repository repository_;
+ auto_ptr<Locator_Repository> repository_;
AsyncStartupWaiter_i waiter_svt_;
ImplementationRepository::AsyncStartupWaiter_var waiter_;
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc
index 5b749fb5043..5c23467d34b 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc
+++ b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc
@@ -82,6 +82,9 @@ project(ImR_Locator) : orbsvcslib, orbsvcs_output, conv_lib, avoids_minimum_corb
Iterator.cpp
Server_Info.cpp
Locator_Repository.cpp
+ Config_Backing_Store.cpp
+ XML_Backing_Store.cpp
+ Shared_Backing_Store.cpp
}
header_files {
utils.h
@@ -91,7 +94,7 @@ project(ImR_Locator) : orbsvcslib, orbsvcs_output, conv_lib, avoids_minimum_corb
}
}
-project(ImR_Locator_Service) : orbsvcsexe, install, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, iortable, messaging, acexml ,svc_utils, pi_server, imr_client {
+project(ImR_Locator_Service) : orbsvcsexe, install_bin, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, iortable, messaging, acexml ,svc_utils, pi_server, imr_client {
exename = tao_imr_locator
after += ImR_Locator ImR_Activator_IDL ImR_Locator_IDL
libs += TAO_ImR_Locator TAO_ImR_Activator_IDL TAO_ImR_Locator_IDL
@@ -117,7 +120,7 @@ project(ImR_Locator_Service) : orbsvcsexe, install, avoids_minimum_corba, avoids
}
-project(ImR_Activator_Service) : orbsvcsexe, install, acexml, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, messaging, svc_utils, imr_client {
+project(ImR_Activator_Service) : orbsvcsexe, install_bin, acexml, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, messaging, svc_utils, imr_client {
exename = tao_imr_activator
after += ImR_Activator ImR_Activator_IDL ImR_Locator_IDL
libs += TAO_ImR_Activator TAO_ImR_Activator_IDL TAO_ImR_Locator_IDL
@@ -130,17 +133,13 @@ project(ImR_Activator_Service) : orbsvcsexe, install, acexml, avoids_minimum_cor
}
-project(tao_imr) : orbsvcsexe, install, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, portableserver, imr_client {
- install = $(ACE_ROOT)/bin
+project(tao_imr) : orbsvcsexe, install_bin, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, portableserver, imr_client {
exename = tao_imr
+ install = $(ACE_ROOT)/bin
Source_Files {
tao_imr.cpp
tao_imr_i.cpp
}
idl_files {
}
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp
index 8761db1bbaf..d30520ff5fa 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp
@@ -165,6 +165,27 @@ Options::parse_args (int &argc, ACE_TCHAR *argv[])
this->repo_mode_ = REPO_XML_FILE;
}
else if (ACE_OS::strcasecmp (shifter.get_current (),
+ ACE_TEXT ("-y")) == 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_SHARED_FILES;
+
+ if (this->persist_file_name_.length() &&
+ this->persist_file_name_[this->persist_file_name_.length() - 1] != '/')
+ {
+ this->persist_file_name_ += '/';
+ }
+ }
+ else if (ACE_OS::strcasecmp (shifter.get_current (),
ACE_TEXT ("-e")) == 0)
{
this->erase_repo_ = true;
@@ -241,18 +262,22 @@ Options::print_usage (void) const
ACE_ERROR ((LM_ERROR,
"Usage:\n"
"\n"
- "ImplRepo_Service [-c cmd] [-d 0|1|2] [-m] [-o file]\n"
- " [-r|-p file|-x file] [-s] [-t secs] [-v secs]\n"
+ "ImplRepo_Service [-c cmd] [-d 0|1|2] [-e] [-m] [-o file]\n"
+ " [-r|-p file|-x file|-y dir] [-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"
+ " -e Erase the persisted repository at startup\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"
+ " -x file Use XML file for storing/loading settings\n"
+ " -y dir Use shared XML files for storing/loading settings\n"
+ " in the provided directory\n"
" -r Use the registry for storing/loading settings\n"
+ " -s Run as a service\n"
" -t secs Server startup timeout.(Default=60s)\n"
- " -v msecs Server verification interval.(Default=10s)\n"
+ " -v msecs Server verification interval.(Default=10s)\n"
));
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
index 6f041cfdd71..e2fc9d53c7a 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
@@ -44,6 +44,7 @@ public:
enum RepoMode {
REPO_NONE,
REPO_XML_FILE,
+ REPO_SHARED_FILES,
REPO_HEAP_FILE,
REPO_REGISTRY
};
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
index 5833e0f4e98..1ebdadd4612 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
@@ -1,358 +1,29 @@
// $Id$
#include "Locator_Repository.h"
-#include "Locator_XMLHandler.h"
#include "utils.h"
#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_strings.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"
-
-static const ACE_TCHAR* STARTUP_COMMAND = ACE_TEXT("StartupCommand");
-static const ACE_TCHAR* WORKING_DIR = ACE_TEXT("WorkingDir");
-static const ACE_TCHAR* ENVIRONMENT = ACE_TEXT("Environment");
-static const ACE_TCHAR* ACTIVATION = ACE_TEXT("Activation");
-static const ACE_TCHAR* PARTIAL_IOR = ACE_TEXT("Location");
-static const ACE_TCHAR* IOR = ACE_TEXT("IOR");
-static const ACE_TCHAR* START_LIMIT = ACE_TEXT("StartLimit");
-static const ACE_TCHAR* ACTIVATOR = ACE_TEXT("Activator");
-static const ACE_TCHAR* SERVERS_ROOT_KEY = ACE_TEXT("Servers");
-static const ACE_TCHAR* ACTIVATORS_ROOT_KEY = ACE_TEXT("Activators");
-static const ACE_TCHAR* TOKEN = ACE_TEXT("Token");
-static const ACE_TCHAR* SERVER_ID = ACE_TEXT("ServerId");
-
-#if defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_REGISTRY)
-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_TString 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_TString name;
- while (config.enumerate_sections (root, index, name) == 0)
- {
- ACE_CString server_id, 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, SERVER_ID, server_id);
- 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(server_id, 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& server_id,
- 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 (server_id, 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);
-
- try
- {
- parser.parse (&input);
- }
- catch (const ACEXML_Exception& ex)
- {
- ACE_ERROR ((LM_ERROR, "Error during load of ImR persistence xml file."));
- ex.print ();
- return -1;
- }
- 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 %C\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 server_id = ACEXML_escape_string (info->server_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," server_id=\"%s\"", server_id.c_str ());
- 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);
-}
+#include "ace/Vector_T.h"
Locator_Repository::Locator_Repository ()
-: rmode_ (Options::REPO_NONE)
-, config_ (0)
-, debug_ (0)
+: debug_ (0)
{
}
-int
-Locator_Repository::init(const Options& opts)
+ACE_CString
+Locator_Repository::lcase (const ACE_CString& s)
{
- this->rmode_ = opts.repository_mode ();
- this->fname_ = opts.persist_file_name ();
- this->debug_ = opts.debug ();
-
- int err = 0;
- switch (this->rmode_)
+ ACE_CString ret(s);
+ for (size_t i = 0; i < ret.length (); ++i)
{
- 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) && !defined (ACE_LACKS_WIN32_REGISTRY)
- 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;
- }
+ ret[i] = static_cast<char>(ACE_OS::ace_tolower (s[i]));
}
- return err;
+ return ret;
}
-
int
Locator_Repository::unregister_if_address_reused (
const ACE_CString& server_id,
@@ -410,8 +81,6 @@ Locator_Repository::unregister_if_address_reused (
return err;
}
-
-
int
Locator_Repository::add_server (const ACE_CString& server_id,
const ACE_CString& name,
@@ -425,16 +94,22 @@ Locator_Repository::add_server (const ACE_CString& server_id,
const ACE_CString& ior,
ImplementationRepository::ServerObject_ptr svrobj)
{
+ int err = sync_load (name, SYNC_ADD, false);
+ if (err != 0)
+ {
+ return err;
+ }
+
int limit = start_limit < 1 ? 1 : start_limit;
Server_Info_Ptr info(new Server_Info (server_id, name, aname, startup_command,
env_vars, working_dir, activation, limit, partial_ior, ior, svrobj));
- int err = servers ().bind (name, info);
+ err = servers ().bind (name, info);
if (err != 0)
{
return err;
}
- this->update_server (*info);
+ this->persistent_update(info);
return 0;
}
@@ -444,92 +119,33 @@ Locator_Repository::add_activator (const ACE_CString& name,
const ACE_CString& ior,
ImplementationRepository::Activator_ptr act)
{
+ int err = sync_load (name, SYNC_ADD, true);
+ if (err != 0)
+ {
+ return err;
+ }
+
Activator_Info_Ptr info (new Activator_Info (name, token, ior, act));
- int err = activators ().bind (lcase (name), info);
+ err = activators ().bind (lcase (name), info);
if (err != 0)
{
return err;
}
- this->update_activator (*info);
+ this->persistent_update(info);
return 0;
}
int
-Locator_Repository::update_server (const Server_Info& info)
+Locator_Repository::update_server (const Server_Info_Ptr& 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, SERVER_ID, info.server_id.c_str ());
- 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;
+ return this->persistent_update(info);
}
int
-Locator_Repository::update_activator (const Activator_Info& info)
+Locator_Repository::update_activator (const Activator_Info_Ptr& 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;
+ return this->persistent_update(info);
}
Server_Info_Ptr
@@ -558,57 +174,37 @@ Locator_Repository::has_activator (const ACE_CString& name)
int
Locator_Repository::remove_server (const ACE_CString& name)
{
+ int err = sync_load (name, SYNC_REMOVE, false);
+ if (err != 0)
+ {
+ return err;
+ }
+
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;
+ return persistent_remove(name, false);
}
int
Locator_Repository::remove_activator (const ACE_CString& name)
{
+ int err = sync_load (name, SYNC_REMOVE, true);
+ if (err != 0)
+ {
+ return err;
+ }
+
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;
+ return persistent_remove(name, true);
}
Locator_Repository::SIMap&
@@ -623,18 +219,53 @@ Locator_Repository::activators (void)
return activator_infos_;
}
+void
+Locator_Repository::debug(int debug)
+{
+ this->debug_ = debug;
+}
+
+int
+Locator_Repository::persistent_load ()
+{
+ // nothing more to do for default load
+ return 0;
+}
+
+int
+Locator_Repository::sync_load (const ACE_CString& , SyncOp , bool )
+{
+ // nothing more to do for default server/activator load
+ return 0;
+}
+
+int
+Locator_Repository::persistent_update (const Server_Info_Ptr& )
+{
+ // nothing more to do for default update
+ return 0;
+}
+
+int
+Locator_Repository::persistent_update(const Activator_Info_Ptr& )
+{
+ // nothing more to do for default update
+ return 0;
+}
+
+int
+Locator_Repository::persistent_remove(const ACE_CString& , bool )
+{
+ // nothing more to do for default update
+ return 0;
+}
+
+No_Backing_Store::~No_Backing_Store()
+{
+}
+
const char*
-Locator_Repository::repo_mode ()
+No_Backing_Store::repo_mode() const
{
- 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
index 7d7092769bc..820e2c0e5ca 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
@@ -51,9 +51,6 @@ public:
Locator_Repository();
- /// Initializes the Server Repository
- int init (const Options& opts);
-
int unregister_if_address_reused (const ACE_CString& server_id,
const ACE_CString& name,
const char* partial_ior);
@@ -79,9 +76,9 @@ public:
);
/// Update the associated information.
- int update_server (const Server_Info& info);
+ int update_server (const Server_Info_Ptr& info);
/// Update the associated information.
- int update_activator (const Activator_Info& info);
+ int update_activator (const Activator_Info_Ptr& info);
/// Returns information related to startup.
Server_Info_Ptr get_server (const ACE_CString& name);
@@ -100,21 +97,48 @@ public:
/// Returns the internal hash map containing the activator information.
AIMap& activators(void);
- const char* repo_mode();
+ virtual const char* repo_mode() const = 0;
+
+ void debug(int debug);
+
+ static ACE_CString lcase (const ACE_CString& s);
+
+ virtual int persistent_load();
+
+protected:
+ enum SyncOp { SYNC_ADD, SYNC_REMOVE };
+ virtual int sync_load(const ACE_CString& name, SyncOp sync_op, bool activator);
+
+ virtual int persistent_update(const Server_Info_Ptr& info);
+
+ virtual int persistent_update(const Activator_Info_Ptr& info);
+
+ virtual int persistent_remove(const ACE_CString& name, bool activator);
+
+ unsigned int debug_;
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_;
+};
- unsigned int debug_;
+/**
+* @class XML_Backing_Store
+*
+* @brief XML backing store interface containing all ImR persistent information
+* in a single file
+*
+*/
+class No_Backing_Store : public Locator_Repository
+{
+public:
+ virtual ~No_Backing_Store();
+
+ virtual const char* repo_mode() const;
+
+private:
};
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
index cca3d951a82..24d50c3de6f 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
@@ -1,6 +1,8 @@
// $Id$
#include "Locator_XMLHandler.h"
+#include "Locator_Repository.h"
+#include "utils.h"
#include "ace/OS_NS_strings.h"
const ACE_TCHAR* Locator_XMLHandler::ROOT_TAG = ACE_TEXT("ImplementationRepository");
@@ -8,8 +10,8 @@ const ACE_TCHAR* Locator_XMLHandler::SERVER_INFO_TAG = ACE_TEXT("Servers");
const ACE_TCHAR* Locator_XMLHandler::ACTIVATOR_INFO_TAG = ACE_TEXT("Activators");
const ACE_TCHAR* Locator_XMLHandler::ENVIRONMENT_TAG = ACE_TEXT("EnvironmentVariables");
-Locator_XMLHandler::Locator_XMLHandler (Callback& cb)
-: callback_ (cb)
+Locator_XMLHandler::Locator_XMLHandler (Locator_Repository& repo)
+: repo_(repo)
{
}
@@ -49,7 +51,7 @@ Locator_XMLHandler::startElement (const ACEXML_Char*,
ACE_TString token_str = attrs->getValue ((size_t)1);
long token = ACE_OS::atoi (token_str.c_str ());
ACE_CString ior = ACE_TEXT_ALWAYS_CHAR(attrs->getValue ((size_t)2));
- this->callback_.next_activator (aname, token, ior);
+ this->next_activator (aname, token, ior);
}
}
else if (ACE_OS::strcasecmp (qName, ENVIRONMENT_TAG) == 0)
@@ -73,7 +75,7 @@ Locator_XMLHandler::endElement (const ACEXML_Char*,
if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0
&& this->server_name_.length () > 0)
{
- this->callback_.next_server (
+ this->next_server (
this->server_id_, this->server_name_,
this->activator_name_, this->command_line_,
this->env_vars_, this->working_dir_, this->activation_,
@@ -82,6 +84,46 @@ Locator_XMLHandler::endElement (const ACEXML_Char*,
// activator info is handled in the startElement
}
+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 ();
+ }
+}
+
+void
+Locator_XMLHandler::next_server (const ACE_CString& server_id,
+ 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 (server_id, name, aname, cmdline,
+ env_vars, dir, amode, limit, partial_ior, ior));
+
+ this->repo_.servers ().bind (name, si);
+}
+void
+Locator_XMLHandler::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 (Locator_Repository::lcase (aname), si);
+}
+
+
bool
Locator_XMLHandler::EnvVar::operator== (const EnvVar& rhs) const
{
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h
index 643ea3408f3..dedb109bad0 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.h
@@ -20,6 +20,7 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+class Locator_Repository;
/**
* Callback SAX XML Handler for parsing XML.
*/
@@ -42,22 +43,7 @@ public:
typedef ACE_Vector<EnvVar> EnvList;
- struct Callback {
- virtual ~Callback() {}
-
- virtual void next_server (const ACE_CString& server_id,
- 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);
+ Locator_XMLHandler (Locator_Repository& repo);
virtual void startElement (const ACEXML_Char* namespaceURI,
const ACEXML_Char* localName,
@@ -69,9 +55,18 @@ public:
const ACEXML_Char* qName);
private:
-
- // callback on completion of an element
- Callback& callback_;
+ virtual void next_server (const ACE_CString& server_id,
+ 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);
+
+ virtual void next_activator (const ACE_CString& activator_name,
+ long token,
+ const ACE_CString& ior);
+
+ Locator_Repository& repo_;
ACE_CString server_id_;
ACE_TString server_name_;
diff --git a/TAO/orbsvcs/ImplRepo_Service/README b/TAO/orbsvcs/ImplRepo_Service/README.txt
index 9579012f2d7..a83e9e5dbe6 100644
--- a/TAO/orbsvcs/ImplRepo_Service/README
+++ b/TAO/orbsvcs/ImplRepo_Service/README.txt
@@ -1,5 +1,7 @@
/** -*- HTML-Helper -*- $Id$
+$Id$
+
@mainpage Implementation Repository
@section intro Introduction
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
index d87476130f8..d6899f4794f 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
@@ -32,7 +32,7 @@ Server_Info::Server_Info
}
ImplementationRepository::ServerInformation*
-Server_Info::createImRServerInfo (void)
+Server_Info::createImRServerInfo (void) const
{
ImplementationRepository::ServerInformation* info;
ACE_NEW_THROW_EX (info, ImplementationRepository::ServerInformation, CORBA::NO_MEMORY ());
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
index 12403532beb..e9eb31b84b5 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
@@ -42,7 +42,7 @@ struct Server_Info
);
/// Convert to the corba type
- ImplementationRepository::ServerInformation* createImRServerInfo(void);
+ ImplementationRepository::ServerInformation* createImRServerInfo(void) const;
void reset();
diff --git a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp
new file mode 100644
index 00000000000..1a5b6654126
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp
@@ -0,0 +1,282 @@
+// $Id$
+
+#include "Shared_Backing_Store.h"
+#include "Server_Info.h"
+#include "Activator_Info.h"
+#include "utils.h"
+#include "Locator_XMLHandler.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_strings.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"
+
+Shared_Backing_Store::Shared_Backing_Store(const ACE_CString& filename, bool start_clean)
+: XML_Backing_Store(filename, false),
+ listing_file_(filename + "imr_listing.xml")
+{
+ if (start_clean)
+ {
+ ACE_Vector<ACE_CString> filenames;
+ get_listings(filenames);
+ CORBA::ULong sz = filenames.size ();
+ for (CORBA::ULong i = 0; i < sz; ++i)
+ {
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "Removing %s\n", filenames[i].c_str()));
+ }
+ ACE_OS::unlink ( filenames[i].c_str () );
+ }
+
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "Removing %s\n", this->listing_file_.c_str()));
+ }
+ ACE_OS::unlink ( this->listing_file_.c_str () );
+ }
+}
+
+Shared_Backing_Store::~Shared_Backing_Store()
+{
+}
+
+int
+Shared_Backing_Store::persistent_remove (const ACE_CString& name, bool activator)
+{
+ const ACE_CString fname = make_filename(name, activator);
+ ACE_OS::unlink ( fname.c_str () );
+ return 0;
+}
+
+ACE_CString
+Shared_Backing_Store::make_filename(const ACE_CString& name, const bool activator)
+{
+ const char* const prefix = (activator ? "a_" : "s_");
+ return this->filename_ + prefix + name + ".xml";
+}
+
+int
+Shared_Backing_Store::persistent_update(const Server_Info_Ptr& info)
+{
+ ACE_CString name = ACEXML_escape_string (info->name);
+
+ const ACE_CString fname = make_filename(name, false);
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "Persisting to %s(%s)\n", fname.c_str(), info->name.c_str()));
+ }
+ FILE* fp = ACE_OS::fopen (fname.c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Couldn't write to file %C\n", fname.c_str()));
+ return -1;
+ }
+ ACE_OS::fprintf (fp,"<?xml version=\"1.0\"?>\n");
+ persist(fp, *info, "");
+ ACE_OS::fclose (fp);
+ return 0;
+}
+
+
+int
+Shared_Backing_Store::persistent_update(const Activator_Info_Ptr& info)
+{
+ ACE_CString name = ACEXML_escape_string (info->name);
+
+ const ACE_CString fname = make_filename(name, true);
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "Persisting to %s(%s)\n", fname.c_str(), info->name.c_str()));
+ }
+ FILE* fp = ACE_OS::fopen (fname.c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Couldn't write to file %C\n", fname.c_str()));
+ return -1;
+ }
+ ACE_OS::fprintf (fp,"<?xml version=\"1.0\"?>\n");
+ persist(fp, *info, "");
+ ACE_OS::fclose (fp);
+ return 0;
+}
+
+int
+Shared_Backing_Store::persistent_load ()
+{
+ ACE_Vector<ACE_CString> filenames;
+ get_listings(filenames);
+
+ CORBA::ULong sz = filenames.size ();
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "persistent_load %d files\n", sz));
+ }
+ for (CORBA::ULong i = 0; i < sz; ++i)
+ {
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream; // xml input source will take ownership
+
+ int err = fstm->open (filenames[i].c_str());
+ if (err != 0)
+ {
+ delete fstm;
+ return err;
+ }
+
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "persistent_load %s\n", filenames[i].c_str()));
+ }
+ err = load(fstm, filenames[i]);
+ if (err != 0)
+ {
+ return err;
+ }
+ }
+ return 0;
+}
+
+struct LocatorListings_XMLHandler : public ACEXML_DefaultHandler
+{
+ LocatorListings_XMLHandler(const ACE_CString& dir, ACE_Vector<ACE_CString>& filenames)
+ : dir_(dir), filenames_(filenames) {}
+
+ virtual void startElement (const ACEXML_Char* namespaceURI,
+ const ACEXML_Char* localName,
+ const ACEXML_Char* qName,
+ ACEXML_Attributes* attrs)
+ {
+ const bool server = (ACE_OS::strcasecmp (qName, Locator_XMLHandler::SERVER_INFO_TAG) == 0);
+ if (!server && (ACE_OS::strcasecmp (qName, Locator_XMLHandler::ACTIVATOR_INFO_TAG) != 0))
+ {
+ return;
+ }
+
+ if (attrs != 0 && attrs->getLength () == 1)
+ {
+ ACE_CString aname = ACE_TEXT_ALWAYS_CHAR(attrs->getValue ((size_t)0));
+ filenames_.push_back(dir_ + aname);
+ }
+ else
+ ACE_DEBUG((LM_INFO, "startElement ERROR too few attrs\n"));
+
+ }
+
+ virtual void endElement (const ACEXML_Char* ,
+ const ACEXML_Char* ,
+ const ACEXML_Char* )
+ {
+ }
+
+ const ACE_CString& dir_;
+ ACE_Vector<ACE_CString>& filenames_;
+};
+
+int
+Shared_Backing_Store::get_listings(ACE_Vector<ACE_CString>& filenames) const
+{
+ LocatorListings_XMLHandler listings_handler(this->filename_, filenames);
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream; // xml input source will take ownership
+
+ if (fstm->open (this->listing_file_.c_str()) != 0)
+ {
+ // This is not a real error. The xml file may not exist yet.
+ delete fstm;
+ return 0;
+ }
+
+ ACEXML_Parser parser;
+
+ // InputSource takes ownership
+ ACEXML_InputSource input (fstm);
+
+ parser.setContentHandler (&listings_handler);
+ parser.setDTDHandler (&listings_handler);
+ parser.setErrorHandler (&listings_handler);
+ parser.setEntityResolver (&listings_handler);
+
+ try
+ {
+ parser.parse (&input);
+ }
+ catch (const ACEXML_Exception& ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Error during read of ImR persistence xml listings file at %s.", this->listing_file_.c_str()));
+ ex.print ();
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+Shared_Backing_Store::sync_load (const ACE_CString& name, SyncOp sync_op, bool activator)
+{
+ if (this->debug_ > 9)
+ {
+ ACE_DEBUG((LM_INFO, "sync_load name=%s\n", name.c_str()));
+ }
+ FILE* list = ACE_OS::fopen (this->listing_file_.c_str (), "w");
+ if (list == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Couldn't write to file %C\n", this->listing_file_.c_str()));
+ return -1;
+ }
+ ACE_OS::fprintf (list,"<?xml version=\"1.0\"?>\n");
+ ACE_OS::fprintf (list,"<ImRListing>\n");
+
+ // Save servers
+ Locator_Repository::SIMap::ENTRY* sientry = 0;
+ Locator_Repository::SIMap::ITERATOR siit (this->servers ());
+ for (; siit.next (sientry); siit.advance() )
+ {
+ Server_Info_Ptr& info = sientry->int_id_;
+ if (sync_op == SYNC_REMOVE && !activator && name == info->name)
+ {
+ // skip the removed server
+ continue;
+ }
+ ACE_CString listing_name = ACEXML_escape_string (info->name);
+
+ const ACE_CString fname = make_filename(listing_name, false);
+ ACE_OS::fprintf (list,"\t<%s", Locator_XMLHandler::SERVER_INFO_TAG);
+ ACE_OS::fprintf (list," fname=\"%s\"/>\n", fname.c_str ());
+ }
+
+ if (sync_op == SYNC_ADD && !activator)
+ {
+ const ACE_CString fname = make_filename(name, false);
+ ACE_OS::fprintf (list,"\t<%s", Locator_XMLHandler::SERVER_INFO_TAG);
+ ACE_OS::fprintf (list," fname=\"%s\"/>\n", fname.c_str ());
+ }
+
+ // Save Activators
+ Locator_Repository::AIMap::ENTRY* aientry = 0;
+ Locator_Repository::AIMap::ITERATOR aiit (this->activators ());
+ for (; aiit.next (aientry); aiit.advance ())
+ {
+ Activator_Info_Ptr& info = aientry->int_id_;
+ if (sync_op == SYNC_REMOVE && activator && lcase(name) == info->name)
+ {
+ // skip the removed activator
+ continue;
+ }
+ ACE_CString aname = aientry->ext_id_;
+ const ACE_CString fname = make_filename(aname, true);
+ ACE_OS::fprintf (list,"\t<%s", Locator_XMLHandler::ACTIVATOR_INFO_TAG);
+ ACE_OS::fprintf (list," fname=\"%s\"/>\n", fname.c_str ());
+ }
+
+ if (sync_op == SYNC_ADD && activator)
+ {
+ const ACE_CString fname = make_filename(name, false);
+ ACE_OS::fprintf (list,"\t<%s", Locator_XMLHandler::ACTIVATOR_INFO_TAG);
+ ACE_OS::fprintf (list," fname=\"%s\"/>\n", fname.c_str ());
+ }
+
+ ACE_OS::fprintf (list,"</ImRListing>\n");
+ ACE_OS::fclose (list);
+ return 0;
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.h b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.h
new file mode 100644
index 00000000000..23f3d8d99d5
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+* @file Shared_Backing_Store.h
+*
+* $Id$
+*
+* This class defines an implementation of the backing store as multiple XML files
+* shared between multiple Locators.
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+* @author Priyanka Gontla <gontla_p@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef SHARED_BACKING_STORE_H
+#define SHARED_BACKING_STORE_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "XML_Backing_Store.h"
+
+#include "ace/Vector_T.h"
+
+class ACE_Configuration;
+class ACEXML_FileCharStream;
+
+/**
+* @class Shared_Backing_Store
+*
+* @brief XML backing store containing all ImR persistent information in
+* multiple files shared between multiple Locators
+*
+*/
+class Shared_Backing_Store : public XML_Backing_Store
+{
+public:
+ Shared_Backing_Store(const ACE_CString& directory, bool start_clean);
+
+ virtual ~Shared_Backing_Store();
+
+ virtual int persistent_load();
+
+protected:
+ virtual int persistent_update(const Server_Info_Ptr& info);
+
+ virtual int persistent_update(const Activator_Info_Ptr& info);
+
+ virtual int persistent_remove(const ACE_CString& name, bool activator);
+
+ virtual int sync_load (const ACE_CString& name, SyncOp sync_op, bool activator);
+
+private:
+ ACE_CString make_filename(const ACE_CString& name, const bool activator);
+ int get_listings(ACE_Vector<ACE_CString>& filenames) const;
+
+ const ACE_CString listing_file_;
+};
+
+#endif /* SHARED_BACKING_STORE_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp
new file mode 100644
index 00000000000..e03bde588ba
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp
@@ -0,0 +1,187 @@
+// $Id$
+
+#include "XML_Backing_Store.h"
+#include "Server_Info.h"
+#include "Activator_Info.h"
+#include "utils.h"
+#include "Locator_XMLHandler.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_strings.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"
+
+XML_Backing_Store::XML_Backing_Store(const ACE_CString& filename, bool start_clean)
+: filename_(filename)
+{
+ if (start_clean)
+ {
+ ACE_OS::unlink ( this->filename_.c_str () );
+ }
+}
+
+XML_Backing_Store::~XML_Backing_Store()
+{
+}
+
+int
+XML_Backing_Store::persistent_remove (const ACE_CString& name, bool )
+{
+ // one big XML file, need to persist everything
+ return persist();
+}
+
+int
+XML_Backing_Store::persistent_update(const Server_Info_Ptr& )
+{
+ // one big XML file, need to persist everything
+ return persist();
+}
+
+int
+XML_Backing_Store::persistent_update(const Activator_Info_Ptr& )
+{
+ // one big XML file, need to persist everything
+ return persist();
+}
+
+int
+XML_Backing_Store::persist ()
+{
+ FILE* fp = ACE_OS::fopen (this->filename_.c_str (), "w");
+ if (fp == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Couldn't write to file %C\n", this->filename_.c_str()));
+ return -1;
+ }
+ 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 (this->servers ());
+ for (; siit.next (sientry); siit.advance() )
+ {
+ persist(fp, *sientry->int_id_, "\t");
+ }
+
+ // Save Activators
+ Locator_Repository::AIMap::ENTRY* aientry = 0;
+ Locator_Repository::AIMap::ITERATOR aiit (this->activators ());
+ for (; aiit.next (aientry); aiit.advance ())
+ {
+ ACE_CString aname = aientry->ext_id_;
+ Activator_Info_Ptr& info = aientry->int_id_;
+ persist(fp, *aientry->int_id_, "\t");
+ }
+
+ ACE_OS::fprintf (fp,"</%s>\n", Locator_XMLHandler::ROOT_TAG);
+ ACE_OS::fclose (fp);
+
+ return 0;
+}
+
+void
+XML_Backing_Store::persist (FILE* fp, const Server_Info& info, const char* tag_prepend)
+{
+ ACE_CString server_id = ACEXML_escape_string (info.server_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,"%s<%s", tag_prepend, Locator_XMLHandler::SERVER_INFO_TAG);
+ ACE_OS::fprintf (fp," server_id=\"%s\"", server_id.c_str ());
+ 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 ());
+
+ const CORBA::ULong length = info.env_vars.length ();
+ if (length > 0)
+ {
+ ACE_OS::fprintf (fp,">\n");
+ for (CORBA::ULong i = 0; i < info.env_vars.length (); ++i)
+ {
+ ACE_OS::fprintf (fp,"%s\t<%s", tag_prepend, 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,"%s</%s>\n", tag_prepend, Locator_XMLHandler::SERVER_INFO_TAG);
+ }
+ else
+ {
+ ACE_OS::fprintf (fp,"/>\n");
+ }
+}
+
+void
+XML_Backing_Store::persist (FILE* fp, const Activator_Info& info, const char* tag_prepend)
+{
+ ACE_OS::fprintf (fp,"%s<%s", tag_prepend, Locator_XMLHandler::ACTIVATOR_INFO_TAG);
+ ACE_OS::fprintf( fp," name=\"%s\"", info.name.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");
+}
+
+int
+XML_Backing_Store::persistent_load ()
+{
+ ACEXML_FileCharStream* fstm = new ACEXML_FileCharStream; // xml input source will take ownership
+
+ if (fstm->open (this->filename_.c_str()) != 0)
+ {
+ // This is not a real error. The xml file may not exist yet.
+ delete fstm;
+ return 0;
+ }
+ return load(fstm, this->filename_);
+}
+
+int
+XML_Backing_Store::load (ACEXML_FileCharStream* fstm, const ACE_CString& filename)
+{
+ Locator_XMLHandler handler (*this);
+
+ ACEXML_Parser parser;
+
+ // InputSource takes ownership
+ ACEXML_InputSource input (fstm);
+
+ parser.setContentHandler (&handler);
+ parser.setDTDHandler (&handler);
+ parser.setErrorHandler (&handler);
+ parser.setEntityResolver (&handler);
+
+ try
+ {
+ parser.parse (&input);
+ }
+ catch (const ACEXML_Exception& ex)
+ {
+ ACE_ERROR ((LM_ERROR, "Error during load of ImR persistence xml file (%s).", filename.c_str()));
+ ex.print ();
+ return -1;
+ }
+
+ return 0;
+}
+
+const char*
+XML_Backing_Store::repo_mode() const
+{
+ return this->filename_.c_str();
+}
diff --git a/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.h b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.h
new file mode 100644
index 00000000000..6ef1e7caa2b
--- /dev/null
+++ b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.h
@@ -0,0 +1,66 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+* @file XML_Backing_Store.h
+*
+* $Id$
+*
+* This class defines an implementation of the backing store as a single XML file.
+*
+* @author Darrell Brunsch <brunsch@cs.wustl.edu>
+* @author Priyanka Gontla <gontla_p@ociweb.com>
+*/
+//=============================================================================
+
+#ifndef XML_BACKING_STORE_H
+#define XML_BACKING_STORE_H
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Locator_Repository.h"
+
+class ACE_Configuration;
+class ACEXML_FileCharStream;
+
+/**
+* @class XML_Backing_Store
+*
+* @brief XML backing store interface containing all ImR persistent information
+* in a single file
+*
+*/
+class XML_Backing_Store : public Locator_Repository
+{
+public:
+ XML_Backing_Store(const ACE_CString& filename, bool start_clean);
+
+ virtual ~XML_Backing_Store();
+
+ virtual const char* repo_mode() const;
+
+ virtual int persistent_load();
+
+protected:
+ virtual int persistent_update(const Server_Info_Ptr& info);
+
+ virtual int persistent_update(const Activator_Info_Ptr& info);
+
+ virtual int persistent_remove(const ACE_CString& name, bool activator);
+
+ int load(ACEXML_FileCharStream* fstm, const ACE_CString& filename);
+
+ void persist(FILE* fp, const Server_Info& info, const char* tag_prepend);
+
+ void persist(FILE* fp, const Activator_Info& info, const char* tag_prepend);
+
+protected:
+ const ACE_CString filename_;
+
+private:
+ int persist();
+};
+
+#endif /* XML_BACKING_STORE_H */
diff --git a/TAO/orbsvcs/Naming_Service/FT_Naming_Main.cpp b/TAO/orbsvcs/Naming_Service/FT_Naming_Main.cpp
new file mode 100644
index 00000000000..f0d2f094c78
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/FT_Naming_Main.cpp
@@ -0,0 +1,66 @@
+// $Id$
+
+#include "FT_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,
+ "FT Name Service: shutting down on signal %d\n",
+ which_signal));
+ (void) this->ns_->shutdown ();
+}
+
+// Driver function for the TAO FT Naming Service.
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ // -m 1 and -f <pers_file_name> are two that are required
+ TAO_Naming_Service* naming_service = new TAO_FT_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);
+
+ try
+ {
+ naming_service->run ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("NamingService");
+ return 1;
+ }
+
+ naming_service->fini ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/Naming_Service/FT_Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/FT_Naming_Service.cpp
new file mode 100644
index 00000000000..913c39088f8
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/FT_Naming_Service.cpp
@@ -0,0 +1,31 @@
+// $Id$
+
+#include "FT_Naming_Service.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context_Factory.h"
+
+// Default Constructor.
+TAO_FT_Naming_Service::TAO_FT_Naming_Service (void)
+{
+}
+
+// Constructor taking command-line arguments.
+TAO_FT_Naming_Service::TAO_FT_Naming_Service (int argc, ACE_TCHAR* argv[])
+ : TAO_Naming_Service (argc, argv)
+{
+}
+
+
+
+/// Create a server object for the naming service
+TAO_Naming_Server*
+TAO_FT_Naming_Service::create_naming_server ()
+{
+ return new (ACE_nothrow) TAO_FT_Naming_Server ();
+}
+
+
+// Destructor.
+TAO_FT_Naming_Service::~TAO_FT_Naming_Service (void)
+{
+}
diff --git a/TAO/orbsvcs/Naming_Service/FT_Naming_Service.h b/TAO/orbsvcs/Naming_Service/FT_Naming_Service.h
new file mode 100644
index 00000000000..3b940d8657e
--- /dev/null
+++ b/TAO/orbsvcs/Naming_Service/FT_Naming_Service.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+//==========================================================================
+/**
+ * @file FT_Naming_Service.h
+ *
+ * $Id$
+ *
+ * This class provides an override for the Naming_Service class factory
+ * method: create_naming_server ()
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//==========================================================================
+
+
+#ifndef TAO_FT_NAMING_SERVICE_H
+#define TAO_FT_NAMING_SERVICE_H
+
+#include /**/ "Naming_Service.h"
+
+#include "tao/ORB.h"
+
+class TAO_Naming_Server;
+
+/**
+ * @class TAO_FT_Naming_Service
+ *
+ * @brief Defines a class that encapsulates the implementation of the
+ * COS Naming Service.
+ *
+ * This class overrides the create_naming_server factory method inherited
+ * from <TAO_Naming_Service>
+ */
+class TAO_FT_Naming_Service : public TAO_Naming_Service
+{
+public:
+ /// Default Constructor.
+ TAO_FT_Naming_Service (void);
+
+ /// Constructor taking the command-line arguments.
+ TAO_FT_Naming_Service (int argc, ACE_TCHAR* argv[]);
+
+ /// Factory method to create a server object for the naming service
+ virtual TAO_Naming_Server* create_naming_server ();
+
+ /// Destructor.
+ virtual ~TAO_FT_Naming_Service (void);
+
+};
+
+#endif /* TAO_FT_NAMING_SERVICE_H */
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
index bb1a7fe56d7..9d482aa66ac 100644
--- a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
@@ -2,6 +2,7 @@
#include "Naming_Service.h"
+#include "orbsvcs/Naming/Naming_Server.h"
#include "orbsvcs/Daemon_Utilities.h"
#include "ace/Get_Opt.h"
#include "ace/Argv_Type_Converter.h"
@@ -9,7 +10,8 @@
// Default Constructor.
TAO_Naming_Service::TAO_Naming_Service (void)
- : time_ (0),
+ : my_naming_server_ (0),
+ time_ (0),
num_threads_ (1)
{
}
@@ -17,7 +19,8 @@ TAO_Naming_Service::TAO_Naming_Service (void)
// Constructor taking command-line arguments.
TAO_Naming_Service::TAO_Naming_Service (int argc, ACE_TCHAR* argv[])
: time_ (0),
- num_threads_ (1)
+ num_threads_ (1),
+ my_naming_server_(0)
{
this->init (argc, argv);
}
@@ -41,14 +44,19 @@ TAO_Naming_Service::init (int argc, ACE_TCHAR* argv[])
// arguments.
this->parse_args (argc, argv);
+ // Factory method used to construct a naming server to be used in
+ // creation and initialization of the naming service components
+ this->my_naming_server_ = this->create_naming_server ();
+
// This function call initializes the naming service and returns
// '-1' in case of an exception.
- int const result = this->my_naming_server_.init_with_orb (argc,
+ int const result = this->my_naming_server_->init_with_orb (argc,
argv,
this->orb_.in ());
if (result == -1)
return result;
+
}
catch (const CORBA::Exception& ex)
{
@@ -172,7 +180,7 @@ TAO_Naming_Service::shutdown (void)
int
TAO_Naming_Service::fini (void)
{
- this->my_naming_server_.fini();
+ this->my_naming_server_->fini();
try
{
@@ -190,8 +198,18 @@ TAO_Naming_Service::fini (void)
return 0;
}
+/// Factory method used to create a server object for the naming service
+TAO_Naming_Server*
+TAO_Naming_Service::create_naming_server ()
+{
+ // Default behavior is to use the Naming_Server located in orbsvcs\orbsvcs\Naming
+ return new (ACE_nothrow) TAO_Naming_Server;
+}
+
+
// Destructor.
TAO_Naming_Service::~TAO_Naming_Service (void)
{
- // Destructor
+ // Invoke destructor of naming server which was created using the factory method
+ delete this->my_naming_server_;
}
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h
index 71a2eb6e211..abcf7df0516 100644
--- a/TAO/orbsvcs/Naming_Service/Naming_Service.h
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h
@@ -17,7 +17,10 @@
#ifndef TAO_NAMING_SERVICE_H
#define TAO_NAMING_SERVICE_H
-#include "orbsvcs/Naming/Naming_Server.h"
+#include /**/ "ace/pre.h"
+#include "tao/ORB.h"
+
+class TAO_Naming_Server;
/**
* @class TAO_Naming_Service
@@ -44,10 +47,13 @@ public:
virtual int fini (void);
/// Run the TAO_Naming_Service.
- int run (void);
+ virtual int run (void);
/// Shut down the TAO_Naming_Service; you must still call fini().
- void shutdown (void);
+ virtual void shutdown (void);
+
+ /// Factory method to create a server object for the naming service
+ virtual TAO_Naming_Server* create_naming_server ();
/// Destructor.
virtual ~TAO_Naming_Service (void);
@@ -62,7 +68,7 @@ protected:
CORBA::ORB_var orb_;
/// Naming Server instance.
- TAO_Naming_Server my_naming_server_;
+ TAO_Naming_Server* my_naming_server_;
/// After how long the server should stop listening to requests (in
/// seconds).
@@ -72,4 +78,6 @@ protected:
int num_threads_;
};
+#include /**/ "ace/post.h"
+
#endif /* TAO_NAMING_SERVICE_H */
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.mpc b/TAO/orbsvcs/Naming_Service/Naming_Service.mpc
index b7ce525f341..a0f850c5734 100644
--- a/TAO/orbsvcs/Naming_Service/Naming_Service.mpc
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.mpc
@@ -7,9 +7,17 @@ project : orbsvcsexe, install, naming_serv, imr_client, svc_utils {
Naming_Server.cpp
Naming_Service.cpp
}
- InstallData_Files {
- gendir = .
- README
+}
+
+project (FT_Naming_Service) : orbsvcsexe, install, ft_naming_serv, naming_serv, portablegroup, imr_client, svc_utils {
+ exename = tao_ft_naming
+ Header_Files {
+ FT_Naming_Service.h
+ }
+ Source_Files {
+ FT_Naming_Main.cpp
+ FT_Naming_Service.cpp
+ Naming_Service.cpp
}
}
@@ -21,9 +29,5 @@ project(NT_Naming_Service) : orbsvcsexe, install, naming_serv, svc_utils {
NT_Naming_Server.cpp
NT_Naming_Service.cpp
}
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/Naming_Service/README b/TAO/orbsvcs/Naming_Service/README
index c6f84e5ddf6..c95a9cbee02 100644
--- a/TAO/orbsvcs/Naming_Service/README
+++ b/TAO/orbsvcs/Naming_Service/README
@@ -13,17 +13,18 @@ The following describes how to run the TAO Naming Service.
1. Syntax
% Naming_Service [-ORBNameServicePort nsport]
+ [-b base_address]
+ [-d ]
+ [-f persistence_file_name]
+ [-m (1=enable multicast responses,0=disable(default)]
+ [-n number_of_threads]
[-o ior_output_file]
[-p pid_file_name]
+ [-r directory]
[-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]
+ [-z time]
2. Optional Command-line Arguments
@@ -34,23 +35,15 @@ The following describes how to run the TAO Naming Service.
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.
+ -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.
- -t time
- How long (in seconds) the server should listen for
- client requests before terminating.
+ -d
+ Provides Naming Service specific debug information. By default
+ no diagnostics are given.
-f persistence_file_name
The name of the file to use to store/retrieve
@@ -58,12 +51,6 @@ The following describes how to run the TAO Naming Service.
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
@@ -74,21 +61,27 @@ The following describes how to run the TAO Naming Service.
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.
+ -n number_of_threads
+ Specify a number of threads to be used to run the ORB.
+ Default is 1.
- -d
- Provides Naming Service specific debug information. By default
- no diagnostics are given.
+ -o ior_output_file
+ The name of the file, in which to store the IOR of the
+ root Naming Service context.
- -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.
+ -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.
-r directory
Use redundant flat-file persistnece; same as the -u option,
@@ -97,6 +90,17 @@ The following describes how to run the TAO Naming Service.
degree of fault tolerence (as long as directory is accessible
to both servers).
+ -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.
+
+ -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.
3. Environment Variables
diff --git a/TAO/orbsvcs/Notify_Service/Notify_Service.mpc b/TAO/orbsvcs/Notify_Service/Notify_Service.mpc
index 4c6ef56124e..ffa18ca3302 100644
--- a/TAO/orbsvcs/Notify_Service/Notify_Service.mpc
+++ b/TAO/orbsvcs/Notify_Service/Notify_Service.mpc
@@ -21,10 +21,6 @@ project(Notify_Service) : orbsvcsexe, install, tao_notify_service, notify_monito
Source_Files {
Notify_Server.cpp
}
- InstallData_Files {
- gendir = .
- README
- }
}
project(NT_Notify_Service) : orbsvcsexe, install, tao_notify_service, notify_monitor_control {
@@ -38,8 +34,4 @@ project(NT_Notify_Service) : orbsvcsexe, install, tao_notify_service, notify_mon
Header_Files {
NT_Notify_Service.h
}
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/Time_Service/Time_Service.mpc b/TAO/orbsvcs/Time_Service/Time_Service.mpc
index 5a984c18ae2..ec6d2297206 100644
--- a/TAO/orbsvcs/Time_Service/Time_Service.mpc
+++ b/TAO/orbsvcs/Time_Service/Time_Service.mpc
@@ -7,10 +7,6 @@ project(Time_Service_Server) : orbsvcsexe, install, time_serv, naming, utils, av
Server_i.cpp
Time_Service_Server.cpp
}
- InstallData_Files {
- gendir = .
- README
- }
}
project(Time_Service_Clerk) : orbsvcsexe, install, time_serv, naming, utils, avoids_corba_e_micro {
@@ -19,8 +15,4 @@ project(Time_Service_Clerk) : orbsvcsexe, install, time_serv, naming, utils, avo
Clerk_i.cpp
Time_Service_Clerk.cpp
}
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/Trading_Service/Trading_Service.mpc b/TAO/orbsvcs/Trading_Service/Trading_Service.mpc
index bd5cfba60f2..67ddcf202e2 100644
--- a/TAO/orbsvcs/Trading_Service/Trading_Service.mpc
+++ b/TAO/orbsvcs/Trading_Service/Trading_Service.mpc
@@ -3,9 +3,5 @@
project : orbsvcsexe, utils, install, naming, trading_serv {
exename = tao_costrading
- InstallData_Files {
- gendir = .
- README
- }
}
diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc
index 9e683abb6d9..c36637bfc23 100644
--- a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc
+++ b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc
@@ -17,6 +17,8 @@ project(CosNaming_Serv) : cosnaming_serv_persistence, orbsvcslib, orbsvcs_output
Naming/Naming_Context_Interface.cpp
Naming/Naming_Loader.cpp
Naming/Naming_Server.cpp
+ Naming/Naming_Service_File_Guard.cpp
+ Naming/Storable_Naming_Context_Factory.cpp
Naming/Transient_Naming_Context.cpp
}
}
diff --git a/TAO/orbsvcs/orbsvcs/FT_NamingManager.idl b/TAO/orbsvcs/orbsvcs/FT_NamingManager.idl
new file mode 100644
index 00000000000..99f2f8b36bd
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FT_NamingManager.idl
@@ -0,0 +1,66 @@
+/* -*- IDL -*- */
+//=============================================================================
+/**
+ * @file FT_NamingManager.idl
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant Naming Service.
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef _FT_NAMING_MANAGER_IDL_
+#define _FT_NAMING_MANAGER_IDL_
+
+#include "orbsvcs/PortableGroup.idl"
+
+// TODO: Rename the module to be FT_Naming. Should not be FT since it is
+// not an OMG standard
+module FT
+{
+ typedef PortableGroup::ObjectGroup ObjectGroup;
+
+ const string TAO_FT_OBJECT_GROUP_NAME = "TAO_FT_GroupName";
+ const string TAO_FT_LOAD_BALANCING_STRATEGY = "TAO_FT_LB_Strategy";
+
+ typedef long LoadBalancingStrategyValue;
+ const LoadBalancingStrategyValue ROUND_ROBIN = 0;
+ const LoadBalancingStrategyValue RANDOM = 1;
+ const LoadBalancingStrategyValue LEAST = 2;
+
+ typedef string GroupName;
+ typedef sequence<string> GroupNames;
+
+ // Specification of NamingManager Interface
+ interface NamingManager : PortableGroup::PropertyManager,
+ PortableGroup::ObjectGroupManager
+ {
+ ObjectGroup create_object_group (in GroupName group_name,
+ in LoadBalancingStrategyValue lb_strategy,
+ in PortableGroup::_TypeId type_id,
+ in PortableGroup::Criteria the_criteria)
+ raises (PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria);
+
+ void delete_object_group (in string group_name)
+ raises (PortableGroup::ObjectGroupNotFound);
+
+ PortableGroup::ObjectGroup get_object_group_ref_from_name (
+ in string group_name)
+ raises (PortableGroup::ObjectGroupNotFound);
+
+ void set_load_balancing_strategy (in string group_name,
+ in LoadBalancingStrategyValue lb_strategy);
+
+ // Return names of all groups defined in the NamingManager
+ GroupNames groups (in LoadBalancingStrategyValue target_stategy);
+
+ };
+};
+
+
+#endif // _FT_NAMING_MANAGER_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/FtNaming.mpc b/TAO/orbsvcs/orbsvcs/FtNaming.mpc
new file mode 100644
index 00000000000..e40f37f4a4a
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/FtNaming.mpc
@@ -0,0 +1,27 @@
+// -*- MPC -*-
+// $Id$
+
+project (FtNaming) : orbsvcslib, orbsvcs_output, install, naming, portablegroup, avoids_minimum_corba {
+ sharedname = TAO_FtNaming
+ idlflags += -Wb,export_macro=TAO_FtNaming_Export -Wb,export_include=orbsvcs/Naming/FaultTolerant/ftnaming_export.h
+ dynamicflags += TAO_FTNAMING_BUILD_DLL
+ tagchecks += FtNaming
+
+ IDL_Files {
+ idlflags += -GC
+ FT_NamingManager.idl
+ }
+
+ Source_Files (ORBSVCS_COMPONENTS) {
+ FT_NamingManagerC.cpp
+ FT_NamingManagerS.cpp
+ }
+
+ Header_Files {
+ FT_NamingManagerC.h
+ FT_NamingManagerS.h
+
+ }
+
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
index f6592820c0f..7740e7fd27b 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
@@ -242,7 +242,7 @@ void FTEC_Gateway::remove_observer (RtecEventChannelAdmin::Observer_Handle handl
void FTEC_Gateway::push(RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy_consumer,
const RtecEventComm::EventSet & data)
{
- PortableServer::ObjectId_var object_id =
+ const PortableServer::ObjectId_var object_id =
impl_->poa->reference_to_id(proxy_consumer);
FtRtecEventComm::ObjectId** result;
ACE_OS::memcpy(&result, &object_id[0], sizeof(FtRtecEventComm::ObjectId**));
@@ -317,7 +317,7 @@ get_remote_oid_ptr(CORBA::ORB_ptr orb)
resolve_init<PortableServer::Current>(orb,
"POACurrent");
- PortableServer::ObjectId_var object_id =
+ const PortableServer::ObjectId_var object_id =
current->get_object_id();
FtRtecEventComm::ObjectId** result;
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp
index b14c5612c23..1d41b3d4e62 100644
--- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LeastLoaded.cpp
@@ -155,7 +155,7 @@ TAO_LB_LeastLoaded::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
this->push_loads (the_location,
loads.in (),
- loads[0]);
+ loads.inout()[0]);
return loads._retn ();
}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp
index 56b5157d4a7..7f7199d2c61 100644
--- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAverage.cpp
@@ -153,7 +153,7 @@ TAO_LB_LoadAverage::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
this->push_loads (the_location,
loads.in (),
- loads[0]);
+ loads.inout()[0]);
return loads._retn ();
}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp
index 90dd6c015e4..3750c9ac632 100644
--- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadMinimum.cpp
@@ -154,7 +154,7 @@ TAO_LB_LoadMinimum::get_loads (CosLoadBalancing::LoadManager_ptr load_manager,
this->push_loads (the_location,
loads.in (),
- loads[0]);
+ loads.inout()[0]);
return loads._retn ();
}
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Location_Index_Map.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Location_Index_Map.h
new file mode 100644
index 00000000000..a680d95e4bf
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Location_Index_Map.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=======================================================================
+/**
+ * @file FT_Location_Index_Map.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=======================================================================
+
+
+#ifndef TAO_FT_LOCATION_INDEX_MAP_H
+#define TAO_FT_LOCATION_INDEX_MAP_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/FT_NamingManagerC.h"
+#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_FT_Location_Index_Map;
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_LOCATION_INDEX_MAP_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl
new file mode 100644
index 00000000000..d59cbb6d072
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_NamingReplication.idl
@@ -0,0 +1,78 @@
+/* -*- IDL -*- */
+//=============================================================================
+/**
+ * @file FT_NamingReplication.idl
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant Naming Service in support of
+ * replication between redundant servers.
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef _FT_NAMING_REPLICATION_IDL_
+#define _FT_NAMING_REPLICATION_IDL_
+
+#include <orbsvcs/CosNaming.idl>
+
+module FT_Naming
+{
+
+ typedef string GroupName;
+ enum ChangeType { NEW, UPDATED, DELETED };
+
+ exception NotAvailable
+ {
+ };
+
+ /*
+ * A structure that describes the updated element in a Naming Service
+ */
+ struct NamingContextUpdate
+ {
+ /// The type of change that is being reported
+ ChangeType change_type;
+ /// This is the compound name that is used to identify
+ /// object references.
+ CosNaming::Name name;
+ };
+
+ /*
+ * A structure that describes the updated element within
+ * an Object Group Manager
+ */
+ struct ObjectGroupUpdate
+ {
+
+ /// The type of change that is being reported
+ ChangeType change_type;
+
+ /// This is the name that is used to identify object group references.
+ GroupName name;
+
+ };
+
+ interface ReplicationManager
+ {
+ /*
+ * Register with a peer replica with an object reference for
+ * notification of updates. Recipient returns their notification
+ * interface in response. Each replica will maintain their state
+ * in a shared repository and the update notification indicates the
+ * element that was changed.
+ */
+ void register_replica (in ReplicationManager replica)
+ raises (NotAvailable); // If replica at this time
+
+ void notify_updated_object_group(in ObjectGroupUpdate group_info)
+ raises (NotAvailable);
+
+ void notify_updated_context(in NamingContextUpdate context_info)
+ raises (NotAvailable);
+ };
+};
+
+
+#endif // _FT_NAMING_REPLICATION_IDL_
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp
new file mode 100644
index 00000000000..dbc2f8b61fe
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp
@@ -0,0 +1,689 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Naming_Manager.cpp
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+#include "orbsvcs/FT_NamingManagerC.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+#include "orbsvcs/PortableGroup/PG_Object_Group.h"
+#include "orbsvcs/PortableGroup/PG_conf.h"
+#include <orbsvcs/PortableGroup/PG_Utils.h>
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+#include "ace/SString.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.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
+
+TAO_FT_Naming_Manager::TAO_FT_Naming_Manager (void)
+ : factory_registry_ ("NamingManager::FactoryRegistry"),
+ group_factory_ (),
+ built_in_balancing_strategy_name_ (1),
+ object_group_property_name_ (1)
+
+{
+ // The name for the property which contains the load balancing strategy value
+ this->built_in_balancing_strategy_name_.length (1);
+ this->built_in_balancing_strategy_name_[0].id =
+ CORBA::string_dup (FT::TAO_FT_LOAD_BALANCING_STRATEGY);
+
+ // The name for the property which contains the object group name
+ this->object_group_property_name_.length (1);
+ this->object_group_property_name_[0].id = CORBA::string_dup (FT::TAO_FT_OBJECT_GROUP_NAME);
+
+}
+
+TAO_FT_Naming_Manager::~TAO_FT_Naming_Manager (void)
+{
+}
+
+
+CORBA::Object_ptr
+TAO_FT_Naming_Manager::create_object_group (
+ const char * group_name,
+ FT::LoadBalancingStrategyValue lb_strategy,
+ const char * type_id,
+ const ::PortableGroup::Criteria & the_criteria)
+{
+ // Add the group name to the criteria and create the object
+ TAO::PG_Property_Set property_set (the_criteria);
+ PortableGroup::Value value;
+ value <<= group_name;
+ property_set.set_property (FT::TAO_FT_OBJECT_GROUP_NAME, value);
+
+ // Add the load balancing strategy to the properties
+ value <<= lb_strategy;
+ property_set.set_property (FT::TAO_FT_LOAD_BALANCING_STRATEGY, value);
+
+ PortableGroup::Criteria new_criteria;
+ property_set.export_properties (new_criteria);
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid;
+ return this->create_object (group_name, type_id, new_criteria, fcid.out());
+}
+
+void
+TAO_FT_Naming_Manager::delete_object_group (const char * group_name)
+{
+ // Find the object group with the specified name and delete the object
+ PortableGroup::ObjectGroup_var group =
+ this->get_object_group_ref_from_name (group_name);
+
+ if (!CORBA::is_nil (group.in()))
+ {
+ PortableGroup::ObjectGroupId group_id =
+ this->get_object_group_id (group);
+
+ // Delete the object group from the factory
+ this->group_factory_.delete_group (group_id);
+ }
+ else
+ {
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_FT_Naming_Manager::get_object_group_ref_from_name (const char * group_name)
+{
+ TAO::PG_Object_Group* group;
+ if (this->group_factory_.find_group_with_name (group_name, group))
+ {
+ return group->reference ();
+ }
+ else
+ {
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+}
+
+::FT::GroupNames *
+TAO_FT_Naming_Manager::groups (::FT::LoadBalancingStrategyValue target_strategy)
+{
+ PortableGroup::ObjectGroups_var all_groups = this->group_factory_.all_groups ();
+ int num_groups = all_groups->length ();
+
+ FT::GroupNames* group_names;
+ ACE_NEW_THROW_EX (
+ group_names,
+ FT::GroupNames (num_groups),
+ CORBA::NO_MEMORY());
+
+ int matching_groups = 0;
+ for (int i = 0; i < num_groups; ++i)
+ {
+ PortableGroup::ObjectGroup_var obj_group = (all_groups.in ())[i].in ();
+
+ // Extract the group's Load Balancing property
+ PortableGroup::Name lb_strat_property_name (1);
+ lb_strat_property_name.length (1);
+ lb_strat_property_name[0].id = CORBA::string_dup (::FT::TAO_FT_LOAD_BALANCING_STRATEGY);
+ PortableGroup::Properties_var props = this->get_properties (obj_group);
+ PortableGroup::Value value;
+ TAO_PG::get_property_value (lb_strat_property_name, props.in (), value);
+ ::FT::LoadBalancingStrategyValue lb_strategy_val;
+ value >>= lb_strategy_val;
+
+ if (lb_strategy_val == target_strategy)
+ { // Groups load balancing strategy matches the target
+ // Increment the count of matching groups
+ ++matching_groups;
+ char* name;
+
+ // Get the group name and add it to the list to return.
+ if (this->group_name (obj_group.in (), name))
+ { // Group does have a name
+ group_names->length (matching_groups);
+ (*group_names)[matching_groups-1] = name;
+ }
+ else
+ {
+ { // Group has no name
+ (*group_names)[i] = CORBA::string_dup ("<unnamed group>");
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::groups: no name property set on group.\n")
+ ));
+ }
+ }
+ }
+ }
+ // Set the length to the actual num added
+ group_names->length (matching_groups);
+ return group_names;
+}
+
+void
+TAO_FT_Naming_Manager::set_load_balancing_strategy (
+ const char * group_name,
+ ::FT::LoadBalancingStrategyValue lb_strategy)
+{
+ CORBA::Object_var group = this->get_object_group_ref_from_name (group_name);
+
+ TAO::PG_Property_Set property_set;
+ PortableGroup::Value value;
+ // Add the load balancing strategy to the properties
+ value <<= lb_strategy;
+ property_set.set_property (FT::TAO_FT_LOAD_BALANCING_STRATEGY, value);
+ PortableGroup::Properties properties;
+ property_set.export_properties (properties);
+ this->set_properties_dynamically (group, properties);
+}
+
+
+bool
+TAO_FT_Naming_Manager::group_name (PortableGroup::ObjectGroup_ptr group, char*& name)
+{
+ if (CORBA::is_nil (group))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::group_name: cannot get name for a null object.\n")
+ ));
+ return false;
+ }
+
+ TAO::PG_Object_Group* pg_group;
+ if (this->group_factory_.find_group (group, pg_group))
+ { // Found the object group in the factory
+ const char* grp_name = pg_group->get_name ();
+ if (grp_name != 0)
+ { // Valid group name defined
+ name = CORBA::string_dup (grp_name);
+ return true;
+ }
+ else
+ { // The group has no name
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "TAO_FT_Naming_Manager::group_name - object group does not have a name"),
+ false);
+ }
+ }
+ else
+ { // The factory does not know about the group
+ return false;
+ }
+}
+
+void
+TAO_FT_Naming_Manager::set_default_properties (
+ const PortableGroup::Properties & props)
+{
+
+ this->properties_support_.set_default_properties (props);
+ //@@ validate properties?
+}
+
+PortableGroup::Properties *
+TAO_FT_Naming_Manager::get_default_properties ()
+{
+ return this->properties_support_.get_default_properties ();
+}
+
+void
+TAO_FT_Naming_Manager::remove_default_properties (
+ const PortableGroup::Properties & props)
+{
+ this->properties_support_.remove_default_properties (props);
+}
+
+void
+TAO_FT_Naming_Manager::set_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & overrides)
+{
+ this->properties_support_.set_type_properties (
+ type_id,
+ overrides);
+}
+
+PortableGroup::Properties *
+TAO_FT_Naming_Manager::get_type_properties (
+ const char *type_id)
+{
+ return this->properties_support_.get_type_properties (type_id);
+}
+
+void
+TAO_FT_Naming_Manager::remove_type_properties (
+ const char *type_id,
+ const PortableGroup::Properties & props)
+{
+ this->properties_support_.remove_type_properties (
+ type_id,
+ props);
+}
+
+void
+TAO_FT_Naming_Manager::set_properties_dynamically (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Properties & overrides)
+{
+
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->set_properties_dynamically (overrides);
+ }
+ else
+ {
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+}
+
+PortableGroup::Properties *
+TAO_FT_Naming_Manager::get_properties (
+ PortableGroup::ObjectGroup_ptr object_group)
+{
+ 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
+ {
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn();
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_FT_Naming_Manager::create_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria)
+{
+ 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);
+ result = group->reference ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::create_member: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn();
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_FT_Naming_Manager::add_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location,
+ CORBA::Object_ptr member)
+{
+ METHOD_ENTRY (TAO::FT_Naming_Manager::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))
+ {
+ try {
+ group->add_member (the_location,
+ member);
+ }
+ catch (...)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_FT_Naming_Manager::add_member - Issue with IOR of group or member"));
+ throw PortableGroup::ObjectNotAdded ();
+ }
+
+ result = group->reference ();
+
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::add_member to unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ METHOD_RETURN (TAO::FT_Naming_Manager::add_member) result._retn ();
+}
+
+
+PortableGroup::ObjectGroup_ptr
+TAO_FT_Naming_Manager::remove_member (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location)
+{
+ 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);
+
+ group->minimum_populate ();
+ //@@ 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
+ {
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn ();
+}
+
+
+PortableGroup::Locations *
+TAO_FT_Naming_Manager::locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group)
+{
+ PortableGroup::Locations_var 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 ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::locations_of_members: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn ();
+}
+
+PortableGroup::ObjectGroups *
+TAO_FT_Naming_Manager::groups_at_location (
+ const PortableGroup::Location & the_location)
+{
+ return this->group_factory_.groups_at_location (the_location);
+}
+
+PortableGroup::ObjectGroupId
+TAO_FT_Naming_Manager::get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group)
+{
+ PortableGroup::ObjectGroupId result = 0;
+ TAO::PG_Object_Group * group = 0;
+ if (this->group_factory_.find_group (object_group, group))
+ {
+ group->get_object_group_id ();
+ result = group->get_object_group_id ();
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::get_object_group_id: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result;
+}
+
+PortableGroup::ObjectGroup_ptr
+TAO_FT_Naming_Manager::get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group)
+{
+ 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_Naming_Manager::get_object_group_ref: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn();
+}
+
+PortableGroup::ObjectGroup_ptr TAO_FT_Naming_Manager::get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id)
+{
+ 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_Naming_Manager::get_object_group_ref_from_id: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn();
+}
+
+CORBA::Object_ptr
+TAO_FT_Naming_Manager::get_member_ref (
+ PortableGroup::ObjectGroup_ptr object_group,
+ const PortableGroup::Location & the_location)
+{
+ 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);
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - FT_Naming_Manager::get_member_ref: unknown group\n")
+ ));
+ }
+ throw PortableGroup::ObjectGroupNotFound ();
+ }
+ return result._retn();
+}
+
+CORBA::Object_ptr
+TAO_FT_Naming_Manager::create_object (
+ const char * object_name,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out
+ factory_creation_id)
+{
+ METHOD_ENTRY (TAO::FT_Naming_Manager::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);
+
+ TAO::PG_Object_Group * group
+ = this->group_factory_.create_group (
+ type_id,
+ the_criteria,
+ typeid_properties);
+
+ group->set_name (object_name);
+
+ // Dont distribute the object group for its usage in the FT_Naming_Manager
+ group->distribute (0);
+
+ group->initial_populate ();
+ //@@ 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));
+ 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_Naming_Manager::create_object) group->reference ();
+}
+
+void
+TAO_FT_Naming_Manager::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id)
+{
+
+ PortableGroup::ObjectGroupId group_id = 0;
+ if (factory_creation_id >>= group_id)
+ {
+ this->group_factory_.delete_group (
+ group_id);
+ }
+ else
+ {
+ throw PortableGroup::ObjectNotFound ();
+ }
+}
+
+void
+TAO_FT_Naming_Manager::initialize (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr naming_mgr_poa)
+{
+ // Initialize the components used to implement the PortableGroup interfaces
+ this->factory_registry_.init (orb);
+ this->group_factory_.init (orb, naming_mgr_poa, factory_registry_.reference());
+}
+
+bool
+TAO_FT_Naming_Manager::next_location (PortableGroup::ObjectGroup_ptr object_group,
+ PortableGroup::Location& loc)
+{
+ bool result = false;
+
+ PortableGroup::Properties* props = this->get_properties (object_group);
+ PortableGroup::Value value;
+ CORBA::Boolean found = TAO_PG::get_property_value (built_in_balancing_strategy_name_,
+ *props,
+ value);
+
+ // If there is no TAO_FT_LOAD_BALANCING_STRATEGY property in the object group
+ // return failure
+ if (!found)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - TAO_FT_Naming_Manager::next_location: object group has no TAO_FT_LOAD_BALANCING_STRATEGY property.\n")
+ ));
+ return false;
+ }
+
+ // Extract the load balancing strategy value
+ FT::LoadBalancingStrategyValue load_bal_strategy;
+ value >>= load_bal_strategy;
+
+ switch (load_bal_strategy)
+ {
+ case FT::ROUND_ROBIN:
+ result = this->round_robin_.next_location (object_group, this, loc);
+ break;
+ default:
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%T %n (%P|%t) - TAO_FT_Naming_Manager::next_location: unsupported load balancing strategy requested.\n")
+ ));
+
+ result = false;
+ break;
+ }
+
+ return result;
+}
+
+void
+TAO_FT_Naming_Manager::preprocess_properties (PortableGroup::Properties &)
+{
+
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h
new file mode 100644
index 00000000000..31952e8565f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h
@@ -0,0 +1,300 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Naming_Manager.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_NAMING_MANAGER_H
+#define TAO_FT_NAMING_MANAGER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+
+#include "orbsvcs/FT_NamingManagerS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/FT_NamingManagerC.h"
+
+#include "orbsvcs/PortableGroup/PG_Group_Factory.h"
+#include "orbsvcs/PortableGroup/PG_FactoryRegistry.h"
+#include <orbsvcs/PortableGroup/PG_Properties_Support.h>
+#include <orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h>
+
+#include "ace/Task.h"
+#include "tao/Condition.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_FtNaming_Export TAO_FT_Naming_Manager
+ : public virtual POA_FT::NamingManager,
+ public ACE_Task_Base
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Naming_Manager (void);
+
+ /**
+ * @name FT::NamingManager Methods
+ *
+ *
+ */
+
+ virtual ::FT::ObjectGroup_ptr create_object_group (
+ const char * group_name,
+ FT::LoadBalancingStrategyValue lb_strategy,
+ const char * type_id,
+ const ::PortableGroup::Criteria & the_criteria);
+
+ virtual void delete_object_group (
+ const char * group_name);
+
+ virtual ::PortableGroup::ObjectGroup_ptr get_object_group_ref_from_name (
+ const char * group_name);
+
+ virtual void set_load_balancing_strategy (
+ const char * group_name,
+ ::FT::LoadBalancingStrategyValue lb_strategy);
+
+
+ virtual ::FT::GroupNames * groups (::FT::LoadBalancingStrategyValue target_strategy);
+ /**
+ * @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);
+
+ /// Get the default properties used by all object groups.
+ virtual PortableGroup::Properties * get_default_properties ();
+
+ /// Remove default properties.
+ virtual void remove_default_properties (
+ const PortableGroup::Properties & props);
+
+ /// 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);
+
+ /**
+ * 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);
+
+ /// Remove the given properties associated with the Replica type ID.
+ virtual void remove_type_properties (
+ const char * type_id,
+ const PortableGroup::Properties & props);
+
+ /**
+ * 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);
+
+ /**
+ * 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);
+
+ //@}
+
+ /**
+ * @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);
+
+ /// 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);
+
+ /**
+ * 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);
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::Locations * locations_of_members (
+ PortableGroup::ObjectGroup_ptr object_group);
+
+ /// Return the locations of the members in the given ObjectGroup.
+ virtual PortableGroup::ObjectGroups * groups_at_location (
+ const PortableGroup::Location & the_location);
+
+ /// Return the ObjectGroupId for the given ObjectGroup.
+ virtual PortableGroup::ObjectGroupId get_object_group_id (
+ PortableGroup::ObjectGroup_ptr object_group);
+
+ /// @note Does this method make sense for load balanced objects?
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref (
+ PortableGroup::ObjectGroup_ptr object_group);
+
+ /// TAO specific method
+ virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id (
+ PortableGroup::ObjectGroupId group_id);
+
+ /// 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);
+
+ //@}
+
+ /**
+ * @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. This signature is modified from
+ * the generic factory operation to support the use of an object
+ * name in addition to the factory_creation_id.
+ */
+ virtual CORBA::Object_ptr create_object (
+ const char * object_name,
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out
+ factory_creation_id);
+
+ /**
+ * 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);
+
+ //@}
+
+ /// Initialize the naming manager. This will provide the poa to
+ /// the naming manager and underlying components for use in
+ /// managing the object groups.
+ void initialize (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa);
+
+ /// Utilizing the load balancing strategy identified by the object
+ /// group property, return the next location which should be used
+ /// to service the next CORBA request
+ bool
+ next_location (PortableGroup::ObjectGroup_ptr object_group,
+ PortableGroup::Location& loc);
+
+ /// Destructor.
+ ~TAO_FT_Naming_Manager (void);
+
+private:
+ /// 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);
+
+ /// Utility for accessing the object group name. Returns true if a
+ /// name is found and allocates a string with the name assigned to
+ /// the name parameter.
+ bool group_name (PortableGroup::ObjectGroup_ptr group, char*& name);
+
+ /// Mutex that provides synchronization for the TAO_FT_Naming_Manager's
+ /// state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// an object that manages default and type_id related properties
+ TAO::PG_Properties_Support properties_support_;
+
+ /// Registry used by the PG_Group_Factory
+ TAO::PG_FactoryRegistry factory_registry_;
+
+ /// The group factory responsible for creating object groups
+ TAO::PG_Group_Factory group_factory_;
+
+ /**
+ * @name Built-in load balancing strategy implementations
+ *
+ * "Built-in" load balancing strategies. Currently only RoundRobin
+ * is supported.
+ */
+ //@{
+
+ /// The "RoundRobin" load balancing strategy.
+ TAO_FT_Round_Robin round_robin_;
+ //@}
+
+ /// Cached instance of the Property name
+ /// "org.omg.CosLoadBalancing.Strategy".
+ PortableGroup::Name built_in_balancing_strategy_name_;
+
+ PortableGroup::Name object_group_property_name_;
+
+ TAO_SYNCH_MUTEX validate_lock_;
+ TAO_Condition<TAO_SYNCH_MUTEX> validate_condition_;
+
+ bool shutdown_;
+
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_NAMING_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp
new file mode 100644
index 00000000000..68e32be063b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp
@@ -0,0 +1,60 @@
+/* $Id$ */
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_NamingReplicationC.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h"
+#include "tao/corba.h"
+
+
+FT_Naming::ReplicationManager_var TAO_FT_Naming_Replication_Manager::peer_replica_;
+
+TAO_FT_Naming_Replication_Manager::TAO_FT_Naming_Replication_Manager(TAO_FT_Naming_Server *naming_svr)
+ : naming_svr_ (naming_svr)
+{
+}
+
+
+TAO_FT_Naming_Replication_Manager::~TAO_FT_Naming_Replication_Manager(void)
+{
+}
+
+void
+TAO_FT_Naming_Replication_Manager::initialize (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa)
+{
+ // Nothing to do now
+ ACE_UNUSED_ARG (orb);
+ ACE_UNUSED_ARG (root_poa);
+}
+
+
+void
+TAO_FT_Naming_Replication_Manager::register_replica (
+ ::FT_Naming::ReplicationManager_ptr replica)
+{
+ // Store the provided reference
+ peer_replica_ = replica;
+}
+
+void
+TAO_FT_Naming_Replication_Manager::notify_updated_object_group (
+ const FT_Naming::ObjectGroupUpdate & group_info)
+{
+ // Make sure that we have a valid naming server
+ ACE_ASSERT (naming_svr_);
+ int result = this->naming_svr_->update_object_group (group_info);
+
+}
+
+void
+TAO_FT_Naming_Replication_Manager::notify_updated_context (
+ const FT_Naming::NamingContextUpdate & context_info)
+{
+ ACE_ASSERT (naming_svr_);
+ int result = this->naming_svr_->update_naming_context (context_info);
+}
+
+FT_Naming::ReplicationManager_ptr
+TAO_FT_Naming_Replication_Manager::peer_replica (void)
+{
+ return peer_replica_._retn ();
+}
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h
new file mode 100644
index 00000000000..41ebccd2dee
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Naming_Replication_Manager.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_NAMING_REPLICATION_MANAGER_H
+#define TAO_FT_NAMING_REPLICATION_MANAGER_H
+
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+
+#include "orbsvcs/Naming/FaultTolerant/FT_NamingReplicationS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "FT_NamingReplicationC.h"
+
+class TAO_FT_Naming_Server;
+
+class TAO_FtNaming_Export TAO_FT_Naming_Replication_Manager
+ : public virtual POA_FT_Naming::ReplicationManager
+{
+public:
+
+ /*
+ * Create a Replication Manager and provide it with the naming server
+ * to be updated whenever notified by the peer replica
+ */
+ TAO_FT_Naming_Replication_Manager(TAO_FT_Naming_Server *naming_svr);
+ virtual ~TAO_FT_Naming_Replication_Manager(void);
+
+ /// Initialize the naming manager. This will provide the poa to
+ /// the naming manager and underlying components for use in
+ /// managing the object groups.
+ void initialize (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa);
+
+ virtual void register_replica (
+ FT_Naming::ReplicationManager_ptr replica);
+
+ virtual void notify_updated_object_group (
+ const FT_Naming::ObjectGroupUpdate & group_info);
+
+ virtual void notify_updated_context (
+ const FT_Naming::NamingContextUpdate & group_info);
+
+ FT_Naming::ReplicationManager_ptr peer_replica (void);
+
+protected:
+
+ // The object which implements the naming service and the object manager
+ TAO_FT_Naming_Server *naming_svr_;
+
+ // Store the reference to the replica object reference
+ // For now only a single replica is supported.
+ static FT_Naming::ReplicationManager_var peer_replica_;
+
+};
+#include /**/ "ace/post.h"
+
+#endif /* TAO_FT_NAMING_REPLICATION_MANAGER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc
new file mode 100644
index 00000000000..c24fb7f91d5
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Serv.mpc
@@ -0,0 +1,42 @@
+// -*- MPC -*-
+// $Id$
+
+project (FT_Naming_Serv) : orbsvcslib, orbsvcs_output, ftnaming, install, naming_serv, naming, portablegroup, avoids_minimum_corba {
+ sharedname = TAO_FT_Naming_Serv
+ idlflags += -Wb,export_macro=TAO_FtNaming_Export -Wb,export_include=orbsvcs/Naming/FaultTolerant/ftnaming_export.h
+ dynamicflags += TAO_FTNAMING_BUILD_DLL
+ tagchecks += FaultTolerantNaming
+
+ IDL_Files {
+ idlflags += -GC
+ FT_NamingReplication.idl
+ }
+
+ Source_Files (ORBSVCS_COMPONENTS) {
+ FT_Naming_Manager.cpp
+ FT_Naming_Replication_Manager.cpp
+ FT_Naming_Server.cpp
+ FT_Persistent_Naming_Context.cpp
+ FT_Persistent_Naming_Context_Factory.cpp
+ FT_Round_Robin.cpp
+ FT_NamingReplicationC.cpp
+ FT_NamingReplicationS.cpp
+ FT_Storable_Naming_Context.cpp
+ FT_Storable_Naming_Context_Factory.cpp
+ }
+
+ Header_Files {
+ FT_Naming_Manager.h
+ FT_Naming_Replication_Manager.h
+ FT_Naming_Server.h
+ FT_Persistent_Naming_Context.h
+ FT_Persistent_Naming_Context_Factory.h
+ FT_Round_Robin.h
+ FT_NamingReplicationC.h
+ FT_NamingReplicationS.h
+ FT_Storable_Naming_Context.h
+ FT_Storable_Naming_Context_Factory.h
+ }
+
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp
new file mode 100644
index 00000000000..2691014271b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp
@@ -0,0 +1,776 @@
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+
+#include "orbsvcs/Naming/Flat_File_Persistence.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+#include "orbsvcs/Naming/Storable.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/Storable_Naming_Context_Activator.h"
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/ORB_Core.h"
+
+#include "tao/debug.h"
+#include "tao/default_ports.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"
+
+
+/// Default Constructor.
+TAO_FT_Naming_Server::TAO_FT_Naming_Server (void)
+ : replica_id_(0),
+ naming_manager_ (),
+ replication_manager_ (this),
+ naming_manager_ior_file_name_(0),
+ replication_manager_ior_file_name_(0),
+ naming_manager_persistence_file_name_(0)
+{
+}
+
+int
+TAO_FT_Naming_Server::init_with_orb (int argc,
+ ACE_TCHAR *argv [],
+ CORBA::ORB_ptr orb)
+{
+ // Invoke the base class initialization to setup the naming service
+ // What follows after that are the initialization steps to support
+ // fault tolerance and load balancing with the FT_Naming_Manager
+ int result = TAO_Naming_Server::init_with_orb (argc, argv, orb);
+
+ // Check the result to make sure it executed Ok.
+ if (result != 0)
+ return result;
+
+ result = this->init_naming_manager_with_orb (argc, argv, orb);
+ if (result != 0)
+ return result;
+
+ try {
+
+ // Initialize the replication manager
+ result = init_replication_manager_with_orb(argc, argv, orb);
+ if (result != 0)
+ return result;
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_FT_Naming_Server::init_with_orb");
+ return -1;
+ }
+ return 0;
+}
+
+
+int
+TAO_FT_Naming_Server::init_naming_manager_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb)
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+
+ int result = 0;
+
+ try {
+
+ // Get the POA from the ORB.
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT(" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+ }
+
+ if (result != 0)
+ return result;
+
+ // Get the POA object.
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ());
+
+ // Get the POA_Manager.
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager ();
+
+ int numPolicies = 2;
+
+ CORBA::PolicyList policies (numPolicies);
+ policies.length (numPolicies);
+
+ // Id Assignment policy
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID);
+
+ // Lifespan policy
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT);
+
+ /* Register the naming manager with a POA
+ * TODO: 1) Error checking
+ * 2) Write IOR to file
+ * 3) Persistence for Object Group Manager
+ */
+
+ // We use a different POA, otherwise the user would have to change
+ // the object key each time it invokes the server.
+ this->naming_manager_poa_ = this->root_poa_->create_POA ("NamingManager",
+ poa_manager.in (),
+ policies);
+ // Warning! If create_POA fails, then the policies won't be
+ // destroyed and there will be hell to pay in memory leaks!
+
+ // 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 ();
+ }
+
+ poa_manager->activate ();
+
+ // Register with the POA.
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("NamingManager");
+
+ this->naming_manager_poa_->activate_object_with_id (id.in (),
+ &this->naming_manager_);
+
+ this->naming_manager_ior_ =
+ orb->object_to_string (naming_manager_._this());
+
+ this->naming_manager_.initialize (this->orb_,
+ this->naming_manager_poa_);
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_FT_Naming_Server::init_naming_manager_with_orb");
+ return -1;
+ }
+
+ if (this->naming_manager_ior_file_name_ != 0)
+ {
+ FILE *iorf = ACE_OS::fopen (this->naming_manager_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->naming_manager_ior_file_name_,
+ ACE_ERRNO_GET,
+ ACE_TEXT("TAO_FT_Naming_Server::init_naming_manager_with_orb")),
+ -1);
+ }
+ CORBA::String_var str = this->naming_manager_ior ();
+ ACE_OS::fprintf (iorf, "%s\n", str.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ // Make the Object Group Manager easily accessible using Interoperable Naming Service IORs
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable");
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "TAO_FT_Naming_Server::init_naming_manager_with_orb - Nil IORTable\n"));
+ }
+ else
+ {
+ CORBA::String_var ior = this->naming_manager_ior ();
+ adapter->bind ("ObjectGroupManager", ior.in ());
+ }
+ return 0;
+}
+
+int
+TAO_FT_Naming_Server::init_replication_manager_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb)
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+
+ int result = 0;
+
+ try {
+
+ // Get the POA from the ORB.
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT(" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+ }
+
+ if (result != 0)
+ return result;
+
+ // Get the POA object.
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ());
+
+ // Get the POA_Manager.
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager ();
+
+ int numPolicies = 2;
+
+ CORBA::PolicyList policies (numPolicies);
+ policies.length (numPolicies);
+
+ // Id Assignment policy
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID);
+
+ // Lifespan policy
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT);
+
+ /* Register the naming manager with a POA
+ * TODO: 1) Error checking
+ * 2) Write IOR to file
+ * 3) Persistence for Object Group Manager
+ */
+
+ // We use a different POA, otherwise the user would have to change
+ // the object key each time it invokes the server.
+ this->replication_manager_poa_ = this->root_poa_->create_POA ("NamingReplication",
+ poa_manager.in (),
+ policies);
+ // Warning! If create_POA fails, then the policies won't be
+ // destroyed and there will be hell to pay in memory leaks!
+
+ // 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 ();
+ }
+
+ poa_manager->activate ();
+
+ if (this->replica_id_ == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("")), // TODO: Add an error message and return failure
+ 0);
+ }
+ // Register with the POA.
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId (this->replica_id_);
+
+ this->replication_manager_poa_->activate_object_with_id (id.in (),
+ &this->replication_manager_);
+
+ this->naming_manager_ior_ =
+ orb->object_to_string (replication_manager_._this());
+
+ this->replication_manager_.initialize (this->orb_,
+ this->replication_manager_poa_);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_FT_Naming_Server::init_replication_manager_with_orb.\n");
+ return -1;
+ }
+
+ if (this->replication_manager_ior_ != 0)
+ {
+ FILE *iorf = ACE_OS::fopen (this->replication_manager_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->replication_manager_ior_file_name_,
+ ACE_ERRNO_GET,
+ ACE_TEXT("TAO_FT_Naming_Server::init_replication_manager_with_orb")),
+ -1);
+ }
+
+ CORBA::String_var str = this->naming_manager_ior ();
+
+ ACE_OS::fprintf (iorf, "%s\n", str.in ());
+ ACE_OS::fclose (iorf);
+ }
+
+ return 0;
+}
+
+
+int
+TAO_FT_Naming_Server::parse_args (int argc,
+ ACE_TCHAR *argv[])
+{
+#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("b:do:p:s:f:m:z:u:g:i:"));
+#else
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("b:do:p:s:f:m:z:"));
+#endif /* TAO_HAS_MINIMUM_POA */
+
+ int c;
+ int size;
+#if !defined (CORBA_E_MICRO)
+ int 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 */
+#endif /* CORBA_E_MICRO */
+
+ // Make sure only one persistence option is specified
+ int f_opt_used = 0;
+ int u_opt_used = 0;
+
+ // TODO: remove unsupported options with FT Naming Server
+ 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 'g': // outputs the object group manager ior to a file
+ this->naming_manager_ior_file_name_ = get_opts.opt_arg ();
+ break;
+ case 'p':
+ this->pid_file_name_ = get_opts.opt_arg ();
+ break;
+ case 'i':
+ this->replica_id_ = get_opts.opt_arg ();
+ break;
+ case 's':
+ size = ACE_OS::atoi (get_opts.opt_arg ());
+ if (size >= 0)
+ this->context_size_ = size;
+ break;
+ case 'm':
+ this->multicast_ = ACE_OS::atoi(get_opts.opt_arg ());
+ break;
+#if !defined (CORBA_E_MICRO)
+ 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_ASCII,
+#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 'f':
+ this->persistence_file_name_ = get_opts.opt_arg ();
+ f_opt_used = 1;
+ break;
+ case 'u':
+ this->use_storable_context_ = 1;
+ this->persistence_file_name_ = get_opts.opt_arg ();
+ u_opt_used = 1;
+ break;
+
+#endif /* !CORBA_E_MICRO */
+ case 'z':
+ this->use_round_trip_timeout_ = 1;
+ this->round_trip_timeout_ = (int)1.0e7 * ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'n': // the file name to same the object group persistence info
+ this->pid_file_name_ = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+#if !defined (ACE_NLOGGING)
+ const ACE_TCHAR *reqNonMinCorba=
+#if !defined (CORBA_E_MICRO)
+ ACE_TEXT ("-f <persistence_file_name> ")
+#endif /* CORBA_E_MICRO */
+#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO)
+ ACE_TEXT ("-u <storable_persistence_directory (not used with -f)> ")
+ ACE_TEXT ("-r <redundant_persistence_directory> ");
+#else
+ ACE_TEXT ("");
+#endif /* TAO_HAS_MINIMUM_POA && !CORBA_E_MICRO */
+#endif /* !ACE_NLOGGING */
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("usage: %s ")
+ ACE_TEXT ("-d ")
+ ACE_TEXT ("-o <name_svc_ior_output_file> ")
+ ACE_TEXT ("-g <naming_mgr_ior_output_file> ")
+ ACE_TEXT ("-i <replica_id> ")
+ 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 ("%s")
+ ACE_TEXT ("-z <relative round trip timeout> ")
+ ACE_TEXT ("\n"),
+ argv [0], reqNonMinCorba),
+ -1);
+ }
+
+
+ if (f_opt_used + u_opt_used > 1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Only one of -u or -f option can be used")
+ ACE_TEXT ("\n")),
+ -1);
+
+ return 0;
+}
+
+
+int
+TAO_FT_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)
+{
+
+ try
+ {
+#if defined (CORBA_E_MICRO)
+ ACE_UNUSED_ARG (persistence_location);
+ ACE_UNUSED_ARG (base_addr);
+ ACE_UNUSED_ARG (use_storable_context);
+#else
+ 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);
+
+ // Provide the naming manager reference for use in
+ // TAO_FT_Persistent_Naming_Contexts for load balancing functionality
+ TAO_FT_Storable_Naming_Context::set_naming_manager (&naming_manager_);
+
+ // 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_RETURN ((LM_ERROR, "Invalid persistence directory\n"), -1);
+ }
+
+#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)
+ if (this->use_servant_activator_)
+ {
+ // Use an auto_ptr to ensure that we clean up the factory in the case
+ // of a failure in creating and registering the Activator
+ TAO_FT_Storable_Naming_Context_Factory* cf = 0;
+ ACE_NEW_RETURN (cf, TAO_FT_Storable_Naming_Context_Factory (context_size), -1);
+ auto_ptr<TAO_FT_Storable_Naming_Context_Factory> contextFactory (cf);
+
+ ACE_NEW_THROW_EX (this->servant_activator_,
+ TAO_Storable_Naming_Context_Activator (orb,
+ persFactory.get (),
+ contextFactory.get (),
+ persistence_location),
+ CORBA::NO_MEMORY ());
+ this->ns_poa_->set_servant_manager(this->servant_activator_);
+ // We have successfull turned over the context factory to the activator so
+ // we can now release it.
+ contextFactory.release ();
+ }
+#endif /* TAO_HAS_MINIMUM_POA */
+
+ this->naming_context_ =
+ TAO_FT_Storable_Naming_Context::recreate_all (orb,
+ poa,
+ TAO_ROOT_NAMING_CONTEXT,
+ context_size,
+ 0,
+ persFactory.get(),
+ persistence_location,
+ use_redundancy_);
+
+ if (this->use_servant_activator_)
+ persFactory.release();
+ }
+ else if (persistence_location != 0)
+ //
+ // Initialize Persistent Naming Service.
+ //
+ {
+ // Create a factory for Fault Tolerant / Persistent Naming Contexts and use it
+ TAO_Naming_Context_Factory *naming_context_factory = 0;
+ ACE_NEW_RETURN (naming_context_factory, TAO_FT_Persistent_Naming_Context_Factory, -1);
+
+ // Provide the naming manager reference for use in
+ // TAO_FT_Persistent_Naming_Contexts for load balancing functionality
+ TAO_FT_Persistent_Naming_Context::set_naming_manager_impl (&naming_manager_);
+
+ // Allocate and initialize Persistent Context Index.
+ ACE_NEW_RETURN (this->context_index_,
+ TAO_Persistent_Context_Index (orb, poa, naming_context_factory),
+ -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
+#endif /* CORBA_E_MICRO */
+ {
+ // This option is not supported by the FT_Naming_Server at this time.
+ // Should return an error.
+ ACE_ERROR ((LM_ERROR, "Options not supported with FT_Naming Service.\n"));
+ return -1;
+
+ }
+
+#if !defined (CORBA_E_MICRO)
+ // 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 ());
+#endif /* CORBA_E_MICRO */
+
+ // Set the ior of the root Naming Context.
+ this->naming_service_ior_=
+ orb->object_to_string (this->naming_context_.in ());
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable");
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in ());
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ CORBA::String_var ior =
+ orb->object_to_string (this->naming_context_.in ());
+ adapter->bind ("NameService", ior.in ());
+ }
+
+#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,
+#if defined (ACE_HAS_IPV6)
+ ACE_DEFAULT_MULTICASTV6_ADDR,
+#else
+ ACE_DEFAULT_MULTICAST_ADDR,
+#endif /* ACE_HAS_IPV6 */
+ 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);
+
+ // set a timeout on the orb
+ //
+ CORBA::Object_var orbPolicyManagerObj =
+ orb->resolve_initial_references ("ORBPolicyManager");
+
+ CORBA::PolicyManager_var orbPolicyManager =
+ CORBA::PolicyManager::_narrow (orbPolicyManagerObj.in ());
+ orbPolicyManager->set_policy_overrides (polList, CORBA::SET_OVERRIDE);
+
+ polList[0]->destroy ();
+ polList[0] = CORBA::Policy::_nil ();
+ }
+#else
+ ACE_UNUSED_ARG (use_round_trip_timeout);
+ ACE_UNUSED_ARG (round_trip_timeout);
+#endif /* TAO_HAS_CORBA_MESSAGING */
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_Naming_Server::init_new_naming");
+ return -1;
+ }
+
+ return 0;
+}
+
+/// Shut down the TAO_FT_Naming_Service; you must still call fini().
+void
+TAO_FT_Naming_Server::shutdown (void)
+{
+
+}
+
+/// Return the IOR for the registered object group manager
+char*
+TAO_FT_Naming_Server::naming_manager_ior (void)
+{
+ return CORBA::string_dup (this->naming_manager_ior_.in ());
+}
+
+int
+TAO_FT_Naming_Server::update_object_group (
+ const FT_Naming::ObjectGroupUpdate & group_info)
+{
+ return -1;
+}
+
+int
+TAO_FT_Naming_Server::update_naming_context (
+ const FT_Naming::NamingContextUpdate & context_info)
+{
+ return -1;
+}
+
+
+/// Destructor.
+TAO_FT_Naming_Server::~TAO_FT_Naming_Server (void)
+{
+ // Clear out the static naming manager from the persistent naming context
+ TAO_FT_Persistent_Naming_Context::set_naming_manager_impl (0);
+}
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h
new file mode 100644
index 00000000000..19dbd00c155
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h
@@ -0,0 +1,113 @@
+// $Id$
+
+#ifndef TAO_FT_NAMING_SERVER_H
+#define TAO_FT_NAMING_SERVER_H
+
+#include "orbsvcs/Naming/Naming_Server.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+
+/**
+ * @class TAO_FT_Naming_Server
+ *
+ * @brief Defines a class derived from the TAO_Naming_Server to extend
+ the functionality to support an ObjectGroupManager interface and a
+ load balancing capability for objects that are bound within an object
+ group within the naming service. The Naming Service will extend the
+ resolve and resolve_str operations to perform load balancing on the
+ objects within the object group using a specified load balancing
+ strategy.
+ */
+class TAO_FtNaming_Export TAO_FT_Naming_Server : public TAO_Naming_Server
+{
+public:
+ /// Default Constructor.
+ TAO_FT_Naming_Server (void);
+
+ /**
+ * Helper method: Derived from TAO_Naming Server to
+ * Should create & initialize Naming Service components
+ * 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.
+ */
+ virtual 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);
+
+ /// Initialize the Naming Service and Object Group Manager with the command line
+ /// arguments and the ORB. Overrridden from TAO_Naming_Server
+ virtual int init_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb);
+
+ /// Initialize the naming manager with the ORB.
+ int init_naming_manager_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb);
+
+ /// Initialize the replication manager with the ORB.
+ int init_replication_manager_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb);
+
+ /// Overridden parse operation. Only allows options supported by the FT_Naming_Server
+ /// and adds options for the object group manager
+ virtual int parse_args (int argc,
+ ACE_TCHAR *argv[]);
+
+ /// Shut down the TAO_Naming_Service; you must still call fini().
+ void shutdown (void);
+
+ /// Returns the IOR of the naming manager.
+ char * naming_manager_ior (void);
+
+ virtual int update_object_group (
+ const FT_Naming::ObjectGroupUpdate & group_info);
+
+ virtual int update_naming_context (
+ const FT_Naming::NamingContextUpdate & naming_context);
+
+ /// Destructor.
+ virtual ~TAO_FT_Naming_Server (void);
+
+protected:
+ const ACE_TCHAR * replica_id_;
+
+ /// The object that implements the ObjectGroupManager, PropertyManager,
+ /// and GenericFactory interfaces.
+ TAO_FT_Naming_Manager naming_manager_;
+
+ /// The object that implements the FT_Naming::Replication_Manager
+ /// interface
+ TAO_FT_Naming_Replication_Manager replication_manager_;
+
+ /// File to output the Object Group Manager IOR.
+ const ACE_TCHAR *naming_manager_ior_file_name_;
+
+ /// File to output the Object Group Manager IOR.
+ const ACE_TCHAR *replication_manager_ior_file_name_;
+
+ /// Path to the file to be used to store/read in Object Group Manager
+ /// persistent state.
+ const ACE_TCHAR *naming_manager_persistence_file_name_;
+
+ /// The IOR string of the object group manager.
+ CORBA::String_var naming_manager_ior_;
+
+ /// The IOR string of the object group manager.
+ CORBA::String_var replication_manager_ior_;
+
+ /// The Object Group Manager POA.
+ PortableServer::POA_var naming_manager_poa_;
+
+ PortableServer::POA_var replication_manager_poa_;
+
+};
+
+#endif /* TAO_FT_NAMING_SERVER_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp
new file mode 100644
index 00000000000..d8f22513b3b
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp
@@ -0,0 +1,116 @@
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+#include "orbsvcs/FT_NamingManagerC.h"
+#include "orbsvcs/PortableGroup/PG_Utils.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Initialize the static naming manager
+TAO_FT_Naming_Manager *TAO_FT_Persistent_Naming_Context::naming_manager_impl_ = 0;
+
+TAO_FT_Persistent_Naming_Context::TAO_FT_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP *map,
+ ACE_UINT32 *counter)
+ : TAO_Persistent_Naming_Context (poa,
+ poa_id,
+ context_index,
+ map,
+ counter)
+{
+
+}
+
+
+TAO_FT_Persistent_Naming_Context::~TAO_FT_Persistent_Naming_Context (void)
+{
+ // Perform appropriate cleanup based on the destruction level specified.
+}
+
+
+CORBA::Boolean
+TAO_FT_Persistent_Naming_Context::is_object_group (CORBA::Object_ptr obj) const
+{
+ // If there is a tagged component with tag = IOP::TAG_FT_GROUP in the object reference
+ // then it is an object group
+ PortableGroup::TagGroupTaggedComponent tagged_component;
+ return TAO::PG_Utils::get_tagged_component (obj, tagged_component);
+}
+
+CORBA::Object_ptr
+TAO_FT_Persistent_Naming_Context::resolve (const CosNaming::Name& n)
+{
+ // Invoke the base class resolve operation to acquire the object at the specified
+ // compound name. Any exceptions should flow back to client.
+ CORBA::Object_var resolved_ref =
+ TAO_Persistent_Naming_Context::resolve(n);
+
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
+ // Get the locations of the object group members and we will use them to
+ // do the load balancing
+ try {
+
+ // Make sure object is an object group.
+ // We will return the object reference all the way back out to the client if not
+ if (!this->is_object_group (resolved_ref.in ()))
+ return resolved_ref._retn ();
+
+ // If there is no naming manager, we will fail and report an error.
+ if ( this->naming_manager_impl_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_FT_Persistent_Naming_Context::resolve - No NamingManager defined.\n"));
+
+ throw CORBA::INTERNAL ();
+ }
+
+ // Get the next location selected by the associated strategy
+ PortableGroup::Location next_location;
+ if (this->naming_manager_impl_->next_location (resolved_ref.in(), next_location))
+ { // Found the location
+ // Access the object from the naming service manager by passing in
+ // the next_location value and assign it to the resolved_ref
+ resolved_ref =
+ this->naming_manager_impl_->get_member_ref (resolved_ref.in (), next_location);
+ }
+ else
+ { // No locations defined for the object group, so we will return a null object reference
+ return CORBA::Object::_nil ();
+ }
+
+ }
+ catch (const PortableGroup::ObjectGroupNotFound&)
+ {
+ // This is apparently not an object group, so we should return the
+ // object reference itself
+ // No action required
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_FT_Persistent_Naming_Context::resolve - Some unhandled error occurred\n");
+ return CORBA::Object::_nil ();
+ }
+
+ return resolved_ref._retn ();
+}
+
+void
+TAO_FT_Persistent_Naming_Context::set_naming_manager_impl (TAO_FT_Naming_Manager *mgr_impl)
+{
+ naming_manager_impl_ = (mgr_impl);
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h
new file mode 100644
index 00000000000..e6a978c358f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Persistent_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_PERSISTENT_NAMING_CONTEXT_H
+#define TAO_FT_PERSISTENT_NAMING_CONTEXT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+#include "orbsvcs/orbsvcs/PortableGroupC.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FT_Persistent_Naming_Context
+ *
+ * @brief This class specializes the TAO_Persistent_Naming_Context
+ * 'ConcreteImplementor' in the Bridge pattern architecture of the
+ * CosNaming::NamingContext implementation.
+ *
+ */
+class TAO_FtNaming_Export TAO_FT_Persistent_Naming_Context : public TAO_Persistent_Naming_Context
+{
+public:
+ /// Underlying data structure - typedef for ease of use.
+ typedef TAO_Persistent_Naming_Context::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /**
+ * Constructor that takes in preallocated data structure and takes
+ * ownership of it. Derived class from TAO_Persistent_Naming_Context
+ * provides specialization of the resolve operation to support
+ * load balancing.
+ */
+ TAO_FT_Persistent_Naming_Context (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map = 0,
+ ACE_UINT32 *counter = 0);
+
+ /// Destructor.
+ virtual ~TAO_FT_Persistent_Naming_Context (void);
+
+
+ /**
+ * Override the resolve operation to support load balancing using
+ * the object group manager and associated strategy.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n);
+
+ static void set_naming_manager_impl (TAO_FT_Naming_Manager *mgr_impl);
+
+ bool is_object_group (const CORBA::Object_ptr obj) const;
+
+protected:
+ static TAO_FT_Naming_Manager *naming_manager_impl_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_PERSISTENT_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp
new file mode 100644
index 00000000000..65ecd1040aa
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ /// Constructor.
+TAO_FT_Persistent_Naming_Context_Factory::TAO_FT_Persistent_Naming_Context_Factory (size_t context_size)
+: TAO_Naming_Context_Factory(context_size)
+{
+
+}
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+TAO_FT_Persistent_Naming_Context_Factory::~TAO_FT_Persistent_Naming_Context_Factory (void)
+{
+}
+
+
+/// Factory method for creating an implementation object for naming contexts
+TAO_Persistent_Naming_Context*
+TAO_FT_Persistent_Naming_Context_Factory::create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map,
+ ACE_UINT32 *counter)
+{
+ // Construct the naming context, forwarding the map and counter even if they
+ // are defaulted
+ return new (ACE_nothrow) TAO_FT_Persistent_Naming_Context (poa,
+ poa_id,
+ context_index,
+ map,
+ counter);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h
new file mode 100644
index 00000000000..37ee5af4e55
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.h
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Persistent_Naming_Context_Factory.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_PERSISTENT_NAMING_CONTEXT_FACTORY_H
+#define TAO_FT_PERSISTENT_NAMING_CONTEXT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Naming_Context_Factory.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_FT_Persistent_Naming_Context_Factory
+ *
+ * @brief An implementation of the TAO_Naming_Context_Factory that creates
+ * TAO_FT_Persistent_Naming_Context to implement the COS Naming Service
+ * NamingContext interface.
+ */
+class TAO_FtNaming_Export TAO_FT_Persistent_Naming_Context_Factory
+ : public TAO_Naming_Context_Factory
+{
+public:
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_FT_Persistent_Naming_Context_Factory (size_t context_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// 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_FT_Persistent_Naming_Context_Factory (void);
+
+ /// Factory method for creating an implementation object for naming contexts
+ virtual TAO_Persistent_Naming_Context* create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map = 0,
+ ACE_UINT32 *counter = 0);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_PERSISTENT_NAMING_CONTEXT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp
new file mode 100644
index 00000000000..ad03b42708c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.cpp
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+
+#include "orbsvcs/PortableGroup/PG_conf.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_FT_Round_Robin::TAO_FT_Round_Robin (void)
+ : lock_ (),
+ location_index_map_ (TAO_PG_MAX_OBJECT_GROUPS)
+{
+}
+
+TAO_FT_Round_Robin::~TAO_FT_Round_Robin (void)
+{
+}
+
+
+bool
+TAO_FT_Round_Robin::next_location (
+ PortableGroup::ObjectGroup_ptr object_group,
+ TAO_FT_Naming_Manager *naming_manager,
+ PortableGroup::Location& location)
+{
+ // TODO: Simplify the algorithm to store a map of object
+ // group id to last location index. We will round robin
+ // over this list assuming the list will not change that often.
+ const PortableGroup::ObjectGroupId id =
+ naming_manager->get_object_group_id (object_group);
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ monitor,
+ this->lock_,
+ 0);
+
+ // If entry is already in the map for this id
+ // Get the index
+ // increment the index
+ // if the index is past the length set it to the first element
+ // Else
+ // Set the index to 0
+ // Add the entry in the map
+
+ //
+ PortableGroup::Locations_var locations =
+ naming_manager->locations_of_members (object_group);
+
+ const CORBA::ULong len = locations->length ();
+
+ // No locations exist, so we cant get the next one
+ if (len == 0)
+ return false;
+
+ TAO_FT_Location_Index_Map::ENTRY * entry;
+ if (this->location_index_map_.find (id, entry) == 0)
+ {
+ CORBA::ULong & i = entry->int_id_;
+
+ // Increment index to point to next location.
+ i++;
+
+ if (len <= i)
+ i = 0; // Reset, i.e. wrap around
+
+ location = locations[i];
+
+ return true;
+ }
+
+ // Could not find an entry
+ // Create an entry at location 0
+ const CORBA::ULong start = 0;
+ location = locations[start];
+ if (this->location_index_map_.bind (id, start) != 0)
+ { // The location was already bound or some failure occured. Should not happen.
+ throw CORBA::INTERNAL ();
+ }
+ return true;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h
new file mode 100644
index 00000000000..fc18e3123c0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Round_Robin.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Round_Robin.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef FT_ROUND_ROBIN_H
+#define FT_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/Naming/FaultTolerant/FT_Location_Index_Map.h"
+
+
+#include "orbsvcs/CosLoadBalancingS.h"
+#include "ace/Vector_T.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+
+class TAO_FT_Naming_Manager;
+
+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_FtNaming_Export TAO_FT_Round_Robin
+{
+public:
+
+ /// Constructor.
+ TAO_FT_Round_Robin (void);
+
+ virtual bool next_location (
+ PortableGroup::ObjectGroup_ptr object_group,
+ TAO_FT_Naming_Manager *naming_manager,
+ PortableGroup::Location& location);
+
+ /// Destructor
+ virtual ~TAO_FT_Round_Robin (void);
+
+private:
+
+ /// 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_FT_Location_Index_Map location_index_map_;
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_ROUND_ROBIN_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp
new file mode 100644
index 00000000000..fae0562d98e
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp
@@ -0,0 +1,269 @@
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+#include "orbsvcs/FT_NamingManagerC.h"
+#include "orbsvcs/PortableGroup/PG_Utils.h"
+#include "orbsvcs/PortableGroup/PG_Property_Utils.h"
+
+#include "orbsvcs/Naming/Persistent_Context_Index.h"
+#include "ace/OS_NS_stdio.h"
+
+#include "ace/Auto_Ptr.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Initialize the static naming manager
+TAO_FT_Naming_Manager *TAO_FT_Storable_Naming_Context::naming_manager_ = 0;
+
+TAO_FT_Storable_Naming_Context::TAO_FT_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_Storable_Naming_Context (orb,
+ poa,
+ poa_id,
+ factory,
+ persistence_directory,
+ hash_table_size)
+{
+
+}
+
+
+TAO_FT_Storable_Naming_Context::~TAO_FT_Storable_Naming_Context (void)
+{
+ // Perform appropriate cleanup based on the destruction level specified.
+}
+
+
+CORBA::Boolean
+TAO_FT_Storable_Naming_Context::is_object_group (CORBA::Object_ptr obj) const
+{
+ // If there is a tagged component with tag = IOP::TAG_FT_GROUP in the object reference
+ // then it is an object group
+ PortableGroup::TagGroupTaggedComponent tagged_component;
+ return TAO::PG_Utils::get_tagged_component (obj, tagged_component);
+}
+
+CORBA::Object_ptr
+TAO_FT_Storable_Naming_Context::resolve (const CosNaming::Name& n)
+{
+ // Invoke the base class resolve operation to acquire the object at the specified
+ // compound name. Any exceptions should flow back to client.
+ CORBA::Object_var resolved_ref =
+ TAO_Storable_Naming_Context::resolve(n);
+
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
+ // Get the locations of the object group members and we will use them to
+ // do the load balancing
+ try {
+
+ // Make sure object is an object group.
+ // We will return the object reference all the way back out to the client if not
+ if (!this->is_object_group (resolved_ref.in ()))
+ return resolved_ref._retn ();
+
+ // If there is no naming manager, we will fail and report an error.
+ if ( this->naming_manager_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "TAO_FT_Persistent_Naming_Context::resolve - No NamingManager defined.\n"));
+
+ throw CORBA::INTERNAL ();
+ }
+
+ // Get the next location selected by the associated strategy
+ PortableGroup::Location next_location;
+ if (this->naming_manager_->next_location (resolved_ref.in(), next_location))
+ { // Found the location
+ // Access the object from the naming service manager by passing in
+ // the next_location value and assign it to the resolved_ref
+ resolved_ref =
+ this->naming_manager_->get_member_ref (resolved_ref.in (), next_location);
+ }
+ else
+ { // No locations defined for the object group, so we will return a null object reference
+ return CORBA::Object::_nil ();
+ }
+
+ }
+ catch (const PortableGroup::ObjectGroupNotFound&)
+ {
+ // This is apparently not an object group, so we should return the
+ // object reference itself
+ // No action required
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "TAO_FT_Storable_Naming_Context::resolve - Some unhandled error occurred\n");
+ return CORBA::Object::_nil ();
+ }
+
+ return resolved_ref._retn ();
+}
+
+void
+TAO_FT_Storable_Naming_Context::set_naming_manager (TAO_FT_Naming_Manager *mgr_impl)
+{
+ naming_manager_ = mgr_impl;
+}
+
+
+CosNaming::NamingContext_ptr
+TAO_FT_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_FT_Storable_Naming_Context **new_context)
+{
+ 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_FT_Storable_Naming_Context *context_impl = 0;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_FT_Storable_Naming_Context (orb,
+ poa,
+ poa_id,
+ factory,
+ persistence_directory,
+ context_size),
+ CORBA::NO_MEMORY ());
+
+ // Put <context_impl> into the auto pointer temporarily, in case next
+ // allocation fails.
+ ACE_Auto_Basic_Ptr<TAO_FT_Storable_Naming_Context> temp (context_impl);
+
+ TAO_Naming_Context *context = 0;
+ ACE_NEW_THROW_EX (context,
+ TAO_Naming_Context (context_impl),
+ CORBA::NO_MEMORY ());
+
+ // 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.
+ try
+ {
+ poa->activate_object_with_id (id.in (), context);
+ }
+ catch (const PortableServer::POA::ObjectAlreadyActive&)
+ {
+ throw CosNaming::NamingContext::AlreadyBound();
+ }
+
+
+ result = context->_this ();
+
+ // return the address of the new context object so that caller can finish
+ *new_context = context_impl;
+
+ return result._retn ();
+}
+
+
+CosNaming::NamingContext_ptr
+TAO_FT_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_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_FT_Storable_Naming_Context *new_context = 0;
+ CosNaming::NamingContext_var result =
+ make_new_context (orb,
+ poa,
+ poa_id,
+ context_size,
+ factory,
+ persistence_directory,
+ &new_context);
+
+ // 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");
+ }
+ 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 ());
+ new_context->context_ = new_context->storable_context_;
+ File_Open_Lock_and_Check flck (new_context, "wc");
+ 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 ();
+ throw CORBA::PERSIST_STORE ();
+ }
+
+ // 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 ();
+ throw CORBA::INTERNAL ();
+ }
+ gcounter_ = global.counter ();
+ if(redundant_) gfl_->close ();
+
+ return result._retn ();
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h
new file mode 100644
index 00000000000..0da8e24c5b4
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Storable_Naming_Context.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley <stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_STORABLE_NAMING_CONTEXT_H
+#define TAO_FT_STORABLE_NAMING_CONTEXT_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+#include "orbsvcs/orbsvcs/PortableGroupC.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class FT_TAO_Storable_Naming_Context
+ *
+ * @brief This class specializes the TAO_Storable_Naming_Context
+ * 'ConcreteImplementor' in the Bridge pattern architecture of the
+ * CosNaming::NamingContext implementation.
+ *
+ */
+class TAO_FtNaming_Export TAO_FT_Storable_Naming_Context : public TAO_Storable_Naming_Context
+{
+public:
+ // = Initialization and termination methods.
+
+ /**
+ * Constructor that takes in preallocated data structure and takes
+ * ownership of it. Derived class from TAO_Persistent_Naming_Context
+ * provides specialization of the resolve operation to support
+ * load balancing.
+ */
+ TAO_FT_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_FT_Storable_Naming_Context (void);
+
+ /**
+ * Override the resolve operation to support load balancing using
+ * the object group manager and associated strategy.
+ */
+ virtual CORBA::Object_ptr resolve (const CosNaming::Name &n);
+
+ // = 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_FT_Storable_Naming_Context **new_context);
+
+ // = 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);
+
+ // Set the Naming Manager as a static so that it is available for all
+ // naming context implementations.
+ static void set_naming_manager (TAO_FT_Naming_Manager *mgr_impl);
+
+ bool is_object_group (const CORBA::Object_ptr obj) const;
+
+protected:
+ static TAO_FT_Naming_Manager *naming_manager_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_STORABLE_NAMING_CONTEXT_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp
new file mode 100644
index 00000000000..91276b97b6c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ /// Constructor.
+TAO_FT_Storable_Naming_Context_Factory::TAO_FT_Storable_Naming_Context_Factory (size_t hash_table_size)
+ : TAO_Storable_Naming_Context_Factory (hash_table_size)
+{
+
+}
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+TAO_FT_Storable_Naming_Context_Factory::~TAO_FT_Storable_Naming_Context_Factory (void)
+{
+
+}
+
+
+TAO_Storable_Naming_Context*
+TAO_FT_Storable_Naming_Context_Factory::create_naming_context_impl (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *persistence_factory,
+ const ACE_TCHAR *persistence_directory
+ )
+{
+ // Construct the naming context, forwarding the map and counter even if they
+ // are defaulted
+ TAO_FT_Storable_Naming_Context *context_impl;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_FT_Storable_Naming_Context (orb,
+ poa,
+ poa_id,
+ persistence_factory,
+ persistence_directory,
+ this->context_size_),
+ CORBA::NO_MEMORY ());
+
+ return context_impl;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h
new file mode 100644
index 00000000000..9aa1e6eeee1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context_Factory.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file FT_Storable_Naming_Context_Factory.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_FT_STORABLE_NAMING_CONTEXT_FACTORY_H
+#define TAO_FT_STORABLE_NAMING_CONTEXT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Storable_Naming_Context_Factory.h"
+#include "tao/ORB.h"
+#include "orbsvcs/Naming/nsconf.h"
+#include "orbsvcs/Naming/FaultTolerant/ftnaming_export.h"
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Naming_Context_Factory
+ *
+ * @brief
+ */
+class TAO_FtNaming_Export TAO_FT_Storable_Naming_Context_Factory :
+ public TAO_Storable_Naming_Context_Factory
+{
+public:
+
+ /// Data structure used by TAO_Persistent_Context_Index - typedef for ease of use.
+ typedef TAO_Storable_Naming_Context_Factory::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_FT_Storable_Naming_Context_Factory (size_t hash_table_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// 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_FT_Storable_Naming_Context_Factory (void);
+
+ /// Factory method for creating an implementation object for naming contexts.
+ /// If an existing naming context implementation is being rebuilt, the map and counter parameters
+ /// should be provided to the underlying HASH_MAP implementation
+ virtual TAO_Storable_Naming_Context* create_naming_context_impl (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory);
+
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FT_STORABLE_NAMING_CONTEXT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/ftnaming_export.h b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/ftnaming_export.h
new file mode 100644
index 00000000000..e8a204363c9
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/ftnaming_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_FtNaming
+// ------------------------------
+#ifndef TAO_FTNAMING_EXPORT_H
+#define TAO_FTNAMING_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_FTNAMING_HAS_DLL)
+# define TAO_FTNAMING_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_FTNAMING_HAS_DLL */
+
+#if !defined (TAO_FTNAMING_HAS_DLL)
+# define TAO_FTNAMING_HAS_DLL 1
+#endif /* ! TAO_FTNAMING_HAS_DLL */
+
+#if defined (TAO_FTNAMING_HAS_DLL) && (TAO_FTNAMING_HAS_DLL == 1)
+# if defined (TAO_FTNAMING_BUILD_DLL)
+# define TAO_FtNaming_Export ACE_Proper_Export_Flag
+# define TAO_FTNAMING_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTNAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_FTNAMING_BUILD_DLL */
+# define TAO_FtNaming_Export ACE_Proper_Import_Flag
+# define TAO_FTNAMING_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_FTNAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_FTNAMING_BUILD_DLL */
+#else /* TAO_FTNAMING_HAS_DLL == 1 */
+# define TAO_FtNaming_Export
+# define TAO_FTNAMING_SINGLETON_DECLARATION(T)
+# define TAO_FTNAMING_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_FTNAMING_HAS_DLL == 1 */
+
+// Set TAO_FTNAMING_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_FTNAMING_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_FTNAMING_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_FTNAMING_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_FTNAMING_NTRACE */
+
+#if (TAO_FTNAMING_NTRACE == 1)
+# define TAO_FTNAMING_TRACE(X)
+#else /* (TAO_FTNAMING_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_FTNAMING_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_FTNAMING_NTRACE == 1) */
+
+#endif /* TAO_FTNAMING_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
index 072951cd015..5b3172467c9 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp
@@ -196,17 +196,9 @@ 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());
+ *this << record.id();
+ *this << record.kind();
+ *this << record.ref();
ACE_OS::fflush(this->fl_);
@@ -232,107 +224,19 @@ TAO_NS_FlatFileStream::operator >>(TAO_NS_Persistence_Record &record)
(TAO_NS_Persistence_Record::Record_Type) temp_type_in;
record.type (type);
- int bufSize = 0;
- ACE_CString::size_type const max_buf_len =
- ACE_Numeric_Limits<ACE_CString::size_type>::max ();
+ ACE_CString record_id;
+ *this >> record_id;
+ record.id (record_id);
- //id
- switch (fscanf(fl_, "%d\n", &bufSize))
- {
- case 0:
- this->setstate (badbit);
- return *this;
- case EOF:
- this->setstate (eofbit);
- return *this;
- }
+ ACE_CString record_kind;
+ *this >> record_kind;
+ record.kind (record_kind);
- if (bufSize < 0
- || static_cast<ACE_CString::size_type> (bufSize) >= max_buf_len)
- {
- this->setstate (badbit);
- return *this;
- }
- {
- ACE_Auto_Basic_Array_Ptr<char> the_id (new char[bufSize + 1]);
- the_id[0] = '\0';
- if (ACE_OS::fgets (ACE_TEXT_CHAR_TO_TCHAR (the_id.get ()),
- bufSize + 1,
- fl_) == 0
- && bufSize != 0)
- {
- this->setstate (badbit);
- return *this;
- }
- record.id (ACE_CString (the_id.get (), 0, false));
- }
-
- //kind
- switch (fscanf(fl_, "%d\n", &bufSize))
- {
- case 0:
- this->setstate (badbit);
- return *this;
- case EOF:
- this->setstate (eofbit);
- return *this;
- }
-
- if (bufSize < 0
- || static_cast<ACE_CString::size_type> (bufSize) >= max_buf_len)
- {
- this->setstate (badbit);
- return *this;
- }
-
- {
- ACE_Auto_Basic_Array_Ptr<char> the_kind (new char[bufSize + 1]);
- the_kind[0] = '\0';
- if (ACE_OS::fgets (ACE_TEXT_CHAR_TO_TCHAR (the_kind.get ()),
- bufSize + 1,
- fl_) == 0
- && bufSize != 0)
- {
- this->setstate (badbit);
- return *this;
- }
- record.kind (ACE_CString (the_kind.get (), 0, false));
- }
-
- //ref
- switch (fscanf(fl_, "%d\n", &bufSize))
- {
- case 0:
- this->setstate (badbit);
- return *this;
- case EOF:
- this->setstate (eofbit);
- return *this;
- }
-
- if (bufSize < 0
- || static_cast<ACE_CString::size_type> (bufSize) >= max_buf_len)
- {
- this->setstate (badbit);
- return *this;
- }
-
- {
- ACE_Auto_Basic_Array_Ptr<char> the_ref (new char[bufSize + 1]);
- the_ref[0] = '\0';
- if (ACE_OS::fgets (ACE_TEXT_CHAR_TO_TCHAR (the_ref.get ()),
- bufSize + 1,
- fl_) == 0
- && bufSize != 0)
- {
- this->setstate (badbit);
- return *this;
- }
- record.ref (ACE_CString (the_ref.get (), 0, false));
- }
+ ACE_CString record_ref;
+ *this >> record_ref;
+ record.ref (record_ref);
return *this;
-
}
TAO_Storable_Base &
@@ -369,6 +273,57 @@ TAO_NS_FlatFileStream::operator >>(
return *this;
}
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator <<(
+ const ACE_CString& str)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator <<");
+ ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_TEXT("\n%s\n"),
+ str.length(), str.c_str());
+
+ return *this;
+}
+
+TAO_Storable_Base &
+TAO_NS_FlatFileStream::operator >>(
+ ACE_CString& str)
+{
+ ACE_TRACE("TAO_NS_FlatFileStream::operator >>");
+ int bufSize = 0;
+ ACE_CString::size_type const max_buf_len =
+ ACE_Numeric_Limits<ACE_CString::size_type>::max ();
+ switch (fscanf(fl_, "%d\n", &bufSize))
+ {
+ case 0:
+ this->setstate (badbit);
+ return *this;
+ case EOF:
+ this->setstate (eofbit);
+ return *this;
+ }
+
+ if (bufSize < 0
+ || static_cast<ACE_CString::size_type> (bufSize) >= max_buf_len)
+ {
+ this->setstate (badbit);
+ return *this;
+ }
+ {
+ ACE_Auto_Basic_Array_Ptr<char> str_array (new char[bufSize + 1]);
+ str_array[0] = '\0';
+ if (ACE_OS::fgets (ACE_TEXT_CHAR_TO_TCHAR (str_array.get ()),
+ bufSize + 1,
+ this->fl_) == 0
+ && bufSize != 0)
+ {
+ this->setstate (badbit);
+ return *this;
+ }
+ str = ACE_CString (str_array.get (), 0, false);
+ }
+
+ return *this;
+}
TAO_Storable_Base *
TAO_NS_FlatFileFactory::create_stream (const ACE_CString & file,
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h
index 7b03ba75b03..02518a3badb 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.h
@@ -15,13 +15,14 @@
#include "orbsvcs/Naming/Storable.h"
#include "ace/OS_NS_stdio.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
//------------------------------------------------------------------------
// The Flat File concrete classes
//------------------------------------------------------------------------
-class TAO_NS_FlatFileStream : public TAO_Storable_Base
+class TAO_Naming_Serv_Export TAO_NS_FlatFileStream : public TAO_Storable_Base
{
public:
@@ -73,6 +74,12 @@ public:
virtual TAO_Storable_Base& operator >> (
TAO_NS_Persistence_Global& global);
+ virtual TAO_Storable_Base& operator << (
+ const ACE_CString& str);
+
+ virtual TAO_Storable_Base& operator >> (
+ ACE_CString& str);
+
private:
ACE_OS::ace_flock_t filelock_;
FILE* fl_;
@@ -80,7 +87,7 @@ private:
ACE_CString mode_;
};
-class TAO_NS_FlatFileFactory : public TAO_Naming_Service_Persistence_Factory
+class TAO_Naming_Serv_Export TAO_NS_FlatFileFactory : public TAO_Naming_Service_Persistence_Factory
{
public:
// Factory Methods
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp
index f3b6182e33e..de3c6d1c4f5 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp
@@ -97,10 +97,6 @@ TAO_Hash_Naming_Context::get_context (const CosNaming::Name &name)
void
TAO_Hash_Naming_Context::bind (const CosNaming::Name& n, CORBA::Object_ptr obj)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
- ace_mon, this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -136,6 +132,10 @@ TAO_Hash_Naming_Context::bind (const CosNaming::Name& n, CORBA::Object_ptr obj)
// If we received a simple name, we need to bind it in this context.
else
{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
+ ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+
// Try binding the name.
int result = this->context_->bind (n[0].id,
n[0].kind,
@@ -154,10 +154,6 @@ void
TAO_Hash_Naming_Context::rebind (const CosNaming::Name& n,
CORBA::Object_ptr obj)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -194,6 +190,10 @@ TAO_Hash_Naming_Context::rebind (const CosNaming::Name& n,
// If we received a simple name, we need to rebind it in this
// context.
{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+
int result = this->context_->rebind (n[0].id,
n[0].kind,
obj,
@@ -212,10 +212,6 @@ void
TAO_Hash_Naming_Context::bind_context (const CosNaming::Name &n,
CosNaming::NamingContext_ptr nc)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -255,6 +251,10 @@ TAO_Hash_Naming_Context::bind_context (const CosNaming::Name &n,
// If we received a simple name, we need to bind it in this context.
else
{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+
// Try binding the name.
int result = this->context_->bind (n[0].id,
n[0].kind,
@@ -273,10 +273,6 @@ void
TAO_Hash_Naming_Context::rebind_context (const CosNaming::Name &n,
CosNaming::NamingContext_ptr nc)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -314,6 +310,10 @@ TAO_Hash_Naming_Context::rebind_context (const CosNaming::Name &n,
// If we received a simple name, we need to rebind it in this
// context.
{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+
int result = this->context_->rebind (n[0].id,
n[0].kind,
nc,
@@ -332,9 +332,6 @@ TAO_Hash_Naming_Context::rebind_context (const CosNaming::Name &n,
CORBA::Object_ptr
TAO_Hash_Naming_Context::resolve (const CosNaming::Name& n)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -355,14 +352,16 @@ TAO_Hash_Naming_Context::resolve (const CosNaming::Name& n)
// 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)
- throw CosNaming::NamingContext::NotFound(
- CosNaming::NamingContext::missing_node,
- n);
-
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ if (this->context_->find (n[0].id,
+ n[0].kind,
+ result.out (),
+ type) == -1)
+ throw CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node, n);
+ }
// If the name we have to resolve is a compound name, we need to
// resolve it recursively.
if (name_len > 1)
@@ -410,11 +409,25 @@ TAO_Hash_Naming_Context::resolve (const CosNaming::Name& n)
}
catch (const CORBA::SystemException&)
{
- throw CosNaming::NamingContext::CannotProceed(
- context.in (), rest_of_name);
+ throw CosNaming::NamingContext::CannotProceed
+ (context.in (), rest_of_name);
}
}
}
+ else
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+
+ if (this->context_->find (n[0].id,
+ n[0].kind,
+ result.out (),
+ type) == -1)
+ throw CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node, n);
+ }
+
// If the name we had to resolve was simple, we just need to return
// the result.
return result._retn ();
@@ -423,10 +436,6 @@ TAO_Hash_Naming_Context::resolve (const CosNaming::Name& n)
void
TAO_Hash_Naming_Context::unbind (const CosNaming::Name& n)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -463,20 +472,21 @@ TAO_Hash_Naming_Context::unbind (const CosNaming::Name& n)
// 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)
- throw CosNaming::NamingContext::NotFound(
- CosNaming::NamingContext::missing_node, n);
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX, ace_mon,
+ this->lock_,
+ CORBA::INTERNAL ());
+
+ if (this->context_->unbind (n[0].id,
+ n[0].kind) == -1)
+ throw CosNaming::NamingContext::NotFound
+ (CosNaming::NamingContext::missing_node, n);
+ }
}
CosNaming::NamingContext_ptr
TAO_Hash_Naming_Context::bind_new_context (const CosNaming::Name& n)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
- ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
@@ -506,16 +516,15 @@ TAO_Hash_Naming_Context::bind_new_context (const CosNaming::Name& n)
// 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 ();
+ CosNaming::NamingContext_var result = CosNaming::NamingContext::_nil ();
// Create new context.
- result = new_context ();
+ result = this->new_context ();
// Bind the new context to the name.
try
{
- bind_context (n, result.in ());
+ this->bind_context (n, result.in ());
}
catch (const CORBA::Exception&)
{
@@ -540,11 +549,6 @@ TAO_Hash_Naming_Context::bind_new_context (const CosNaming::Name& n)
void
TAO_Hash_Naming_Context::destroy (void)
{
- ACE_GUARD_THROW_EX (TAO_SYNCH_RECURSIVE_MUTEX,
- ace_mon,
- this->lock_,
- CORBA::INTERNAL ());
-
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.cpp
new file mode 100644
index 00000000000..913843a86f6
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "orbsvcs/Naming/Naming_Context_Factory.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ /// Constructor.
+TAO_Naming_Context_Factory::TAO_Naming_Context_Factory (size_t context_size)
+: context_size_(context_size)
+{
+
+}
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+TAO_Naming_Context_Factory::~TAO_Naming_Context_Factory (void)
+{
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h
new file mode 100644
index 00000000000..60c6d595359
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Context_Factory.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Naming_Context_Factory.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_NAMING_CONTEXT_FACTORY_H
+#define TAO_NAMING_CONTEXT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "tao/ORB.h"
+#include "orbsvcs/Naming/nsconf.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Entries.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+
+
+class TAO_Persistent_Naming_Context;
+class TAO_Persistent_Context_Index;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Naming_Context_Factory
+ *
+ * @brief
+ */
+class TAO_Naming_Serv_Export TAO_Naming_Context_Factory
+{
+public:
+
+ /// Data structure used by TAO_Persistent_Context_Index - typedef for ease of use.
+ typedef TAO_Persistent_Naming_Context::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Naming_Context_Factory (size_t context_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// 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_Naming_Context_Factory (void);
+
+ /// Factory method for creating an implementation object for naming contexts.
+ /// If an existing naming context implementation is being rebuilt, the map and counter parameters
+ /// should be provided to the underlying HASH_MAP implementation
+ virtual TAO_Persistent_Naming_Context* create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map = 0,
+ ACE_UINT32 *counter = 0) = 0;
+
+protected:
+ /// The size for persisted naming context objects in hash map
+ size_t context_size_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NAMING_CONTEXT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp
index 44736086700..62865ac07fe 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.cpp
@@ -17,19 +17,21 @@
#include "ace/Dynamic_Service.h"
#include "ace/Argv_Type_Converter.h"
-
-
+#include "orbsvcs/Naming/Naming_Server.h"
+#include "orbsvcs/Naming/Naming_Context_Factory.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Naming_Loader::TAO_Naming_Loader (void)
+: naming_server_(0)
{
// Constructor
}
TAO_Naming_Loader::~TAO_Naming_Loader (void)
{
- // Destructor
+ // Destroy the naming server that was created
+ delete naming_server_;
}
int
@@ -63,7 +65,7 @@ int
TAO_Naming_Loader::fini (void)
{
// Remove the Naming Service.
- return this->naming_server_.fini ();
+ return this->naming_server_->fini ();
}
CORBA::Object_ptr
@@ -73,7 +75,7 @@ TAO_Naming_Loader::create_object (CORBA::ORB_ptr orb,
{
// Initializes the Naming Service. Returns -1
// on an error.
- if (this->naming_server_.init_with_orb (argc, argv, orb) == -1)
+ if (this->naming_server_->init_with_orb (argc, argv, orb) == -1)
return CORBA::Object::_nil ();
return CORBA::Object::_nil ();
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h
index 7365fa103e7..5815b54a389 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Loader.h
@@ -26,6 +26,8 @@
#include "orbsvcs/Naming/Naming_Server.h"
+class TAO_Naming_Context_Factory;
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_Naming_Serv_Export TAO_Naming_Loader : public TAO_Object_Loader
@@ -53,8 +55,9 @@ public:
ACE_TCHAR *argv[]);
protected:
+ /// TODO: Need to set up service configurator to initialize the naming server
/// Instance of the TAO_Naming_Server
- TAO_Naming_Server naming_server_;
+ TAO_Naming_Server* naming_server_;
private:
TAO_Naming_Loader (const TAO_Naming_Loader &);
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp
index 1a021f655ff..275e372be0a 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp
@@ -2,6 +2,9 @@
#include "orbsvcs/Naming/Naming_Server.h"
#include "orbsvcs/Naming/Transient_Naming_Context.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/Storable_Naming_Context_Factory.h"
+
#if !defined (CORBA_E_MICRO)
#include "orbsvcs/Naming/Persistent_Context_Index.h"
@@ -269,6 +272,7 @@ TAO_Naming_Server::parse_args (int argc,
ACE_TEXT ("-p <pid_file_name> ")
ACE_TEXT ("-s <context_size> ")
ACE_TEXT ("-b <base_address> ")
+ ACE_TEXT ("-u <persistence dir name> ")
ACE_TEXT ("-m <1=enable multicast, 0=disable multicast(default) ")
ACE_TEXT ("%s")
ACE_TEXT ("-z <relative round trip timeout> ")
@@ -477,8 +481,9 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
// 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);
+ 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.
@@ -487,7 +492,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
if (persistence_location == 0)
{
// No, assign the default location "NameService"
- persistence_location = ACE_TEXT("NameService");
+ persistence_location = ACE_TEXT ("NameService");
}
// Now make sure this directory exists
@@ -499,13 +504,22 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)
if (this->use_servant_activator_)
{
+ // Use an auto_ptr to ensure that we clean up the factory in the case
+ // of a failure in creating and registering the Activator
+ TAO_Storable_Naming_Context_Factory* cf = 0;
+ ACE_NEW_RETURN (cf, TAO_Storable_Naming_Context_Factory (context_size), -1);
+ auto_ptr<TAO_Storable_Naming_Context_Factory> contextFactory (cf);
+
ACE_NEW_THROW_EX (this->servant_activator_,
TAO_Storable_Naming_Context_Activator (orb,
persFactory.get(),
- persistence_location,
- context_size),
+ contextFactory.get (),
+ persistence_location),
CORBA::NO_MEMORY ());
this->ns_poa_->set_servant_manager(this->servant_activator_);
+ // We have successfull turned over the context factory to the activator so
+ // we can now release it.
+ contextFactory.release ();
}
#endif /* TAO_HAS_MINIMUM_POA */
@@ -520,16 +534,26 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb,
use_redundancy_);
if (this->use_servant_activator_)
- persFactory.release();
+ {
+ // If using a servant activator, the activator now owns the
+ // factory, so we should release it
+ persFactory.release ();
+ }
}
else if (persistence_location != 0)
//
// Initialize Persistent Naming Service.
//
{
+
+ // Create Naming Context Implementation Factory to be used for the creation of
+ // naming contexts by the TAO_Persistent_Context_Index
+ TAO_Naming_Context_Factory *naming_context_factory = 0;
+ ACE_NEW_RETURN (naming_context_factory, TAO_Persistent_Naming_Context_Factory, -1);
+
// Allocate and initialize Persistent Context Index.
ACE_NEW_RETURN (this->context_index_,
- TAO_Persistent_Context_Index (orb, poa),
+ TAO_Persistent_Context_Index (orb, poa, naming_context_factory),
-1);
if (this->context_index_->open (persistence_location,
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h
index dd609ec461a..37fa9cc773d 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h
@@ -34,6 +34,8 @@ class TAO_Persistent_Context_Index;
class TAO_Storable_Naming_Context_Activator;
#endif /* !CORBA_E_MICRO */
+class TAO_Naming_Context_Factory;
+
/**
* @class TAO_Naming_Server
*
@@ -121,13 +123,13 @@ public:
/// 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);
+ virtual int init_with_orb (int argc, ACE_TCHAR *argv [], CORBA::ORB_ptr orb);
/// Destroy the child POA created in @c init_with_orb
- int fini (void);
+ virtual int fini (void);
/// Destructor.
- ~TAO_Naming_Server (void);
+ virtual ~TAO_Naming_Server (void);
/// Returns the IOR of the naming service.
char * naming_service_ior (void);
@@ -137,7 +139,8 @@ public:
protected:
/**
- * Helper method: create Naming Service locally.
+ * Helper method: create Naming Service locally. Can be specialized to
+ * refine how Naming Service components are created and initialized
* 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.
@@ -146,7 +149,7 @@ protected:
* If <enable_multicast> is not zero then the service will respond
* to multicast location queries.
*/
- int init_new_naming (CORBA::ORB_ptr orb,
+ virtual int init_new_naming (CORBA::ORB_ptr orb,
PortableServer::POA_ptr root_poa,
const ACE_TCHAR *persistence_location,
void *base_addr,
@@ -157,7 +160,7 @@ protected:
int use_round_trip_timeout = 0);
/// parses the arguments.
- int parse_args (int argc, ACE_TCHAR *argv[]);
+ virtual int parse_args (int argc, ACE_TCHAR *argv[]);
/// Root NamingContext_ptr.
CosNaming::NamingContext_var naming_context_;
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.cpp
new file mode 100644
index 00000000000..80ecb1b2ced
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.cpp
@@ -0,0 +1,139 @@
+//=============================================================================
+/**
+ * @file Naming_Service_File_Guard.cpp
+ *
+ * $Id$
+ *
+ * @author Rich Seibel (seibelr@ociweb.com)
+ * @author Byron Harris (harrisb@ociweb.com)
+ */
+//=============================================================================
+
+#include "orbsvcs/Naming/Naming_Service_File_Guard.h"
+#include "orbsvcs/Naming/Storable.h"
+
+#include "tao/SystemException.h"
+
+Naming_Service_File_Guard::
+Naming_Service_File_Guard (bool redundant)
+ : redundant_(redundant)
+ , closed_(1)
+{
+ ACE_TRACE("Naming_Service_File_Guard::Naming_Service_File_Guard");
+}
+
+void
+Naming_Service_File_Guard::init(const char * mode)
+{
+ ACE_TRACE("Naming_Service_File_Guard::init");
+
+ // 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;
+ throw CORBA::PERSIST_STORE();
+ }
+
+ // Create the stream
+ fl_ = this->create_stream(mode);
+ if (redundant_)
+ {
+ if (fl_->open() != 0)
+ {
+ delete fl_;
+ throw CORBA::PERSIST_STORE();
+ }
+
+ // acquire a lock on it
+ if (fl_ -> flock(0, 0, 0) != 0)
+ {
+ fl_->close();
+ delete fl_;
+ 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 > this->get_parent_last_changed ())
+ {
+ this->set_parent_last_changed (new_last_changed);
+ this->create_child ();
+ }
+ }
+ }
+ else if ( ! this->is_child_created () || (rwflags_ & mode_write) )
+ {
+ if (fl_->open() != 0)
+ {
+ delete fl_;
+ throw CORBA::PERSIST_STORE();
+ }
+
+ // now that the file is successfully opened
+ // unlocked/closed before we leave this class
+ closed_ = 0;
+
+ if(! this->is_child_created ())
+ {
+ this->create_child ();
+ }
+ }
+ else
+ {
+ // Need to insure that fl_ gets deleted
+ delete fl_;
+ }
+}
+
+void
+Naming_Service_File_Guard::release (void)
+{
+ ACE_TRACE("Naming_Service_File_Guard::release");
+ if ( ! closed_ )
+ {
+ // If we updated the disk, save the time stamp
+ if(redundant_)
+ {
+ if( rwflags_ & mode_write )
+ this->set_parent_last_changed (fl_->last_changed());
+ fl_->funlock(0, 0, 0);
+ }
+ fl_->close();
+ delete fl_;
+ closed_ = 1;
+ }
+}
+
+Naming_Service_File_Guard::
+~Naming_Service_File_Guard ()
+{
+ ACE_TRACE("Naming_Service_File_Guard::~Naming_Service_File_Guard");
+ this->release ();
+}
+
+TAO_Storable_Base &
+Naming_Service_File_Guard::peer ()
+{
+ ACE_TRACE("Naming_Service_File_Guard::peer");
+ return *fl_;
+}
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h
new file mode 100644
index 00000000000..ff1fc521e28
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Service_File_Guard.h
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Naming_Service_File_Guard.h
+ *
+ * $Id$
+ *
+ * @author Rich Seibel (seibelr@ociweb.com)
+ * @author Byron Harris (harrisb@ociweb.com)
+ */
+//=============================================================================
+
+#ifndef TAO_NAMING_SERVICE_FILE_GUARD_H
+#define TAO_NAMING_SERVICE_FILE_GUARD_H
+
+#include "tao/orbconf.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_Storable_Base;
+
+/**
+ * @class Naming_Service_File_Guard
+ * @brief Bridge abstract class for TAO_Storable_Naming_Context that performs locking.
+ *
+ * A guard for TAO_Storable_Naming_Context that 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 releases the lock.
+ */
+class TAO_Naming_Serv_Export Naming_Service_File_Guard
+{
+public:
+
+ Naming_Service_File_Guard (bool redundant);
+
+ virtual ~Naming_Service_File_Guard ();
+
+ /// 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);
+
+protected:
+
+ /// Should be called by constructors of derived classes
+ /// since can't call virtual functions below in constructor
+ /// of this class.
+ void init (const char * mode);
+
+ virtual void set_parent_last_changed (const time_t & time) = 0;
+
+ virtual time_t get_parent_last_changed () = 0;
+
+ virtual void create_child () = 0;
+
+ virtual bool is_child_created () = 0;
+
+ virtual TAO_Storable_Base * create_stream (const char * mode) = 0;
+
+ /// The pointer to the actual file I/O (bridge pattern)
+ TAO_Storable_Base *fl_;
+
+private:
+
+ bool redundant_;
+
+ /// Default constructor
+ Naming_Service_File_Guard ();
+
+ /// A flag to keep us from trying to close things more than once.
+ int closed_;
+
+ /// 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 };
+
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp
index 34b74c6b5de..a1ef8813579 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp
@@ -2,6 +2,7 @@
#include "orbsvcs/Naming/Persistent_Context_Index.h"
#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+#include "orbsvcs/Naming/Naming_Context_Factory.h"
#include "tao/debug.h"
@@ -80,19 +81,22 @@ TAO_Persistent_Context_Index::bind (const char *poa_id,
TAO_Persistent_Context_Index::TAO_Persistent_Context_Index
(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa)
+ PortableServer::POA_ptr poa,
+ TAO_Naming_Context_Factory * context_impl_factory)
: allocator_ (0),
index_ (0),
index_file_ (0),
base_address_ (0),
orb_ (CORBA::ORB::_duplicate (orb)),
- poa_ (PortableServer::POA::_duplicate (poa))
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ context_impl_factory_ (context_impl_factory)
{
}
TAO_Persistent_Context_Index::~TAO_Persistent_Context_Index (void)
{
delete allocator_;
+ delete context_impl_factory_;
ACE_OS::free (reinterpret_cast<void *> (const_cast<ACE_TCHAR *> (index_file_)));
}
@@ -181,17 +185,22 @@ TAO_Persistent_Context_Index::recreate_all (void)
{
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,
+ // Put together a servant for the new Naming Context
+ // Using the naming context factory to create a naming context of the appropriate type
+ TAO_Persistent_Naming_Context *context_impl =
+ this->context_impl_factory_->create_naming_context_impl (poa_.in (),
+ entry->ext_id_.poa_id_,
+ this,
+ entry->int_id_.hash_map_,
+ entry->int_id_.counter_);
+/* 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.
@@ -228,6 +237,15 @@ TAO_Persistent_Context_Index::recreate_all (void)
return 0;
}
+TAO_Persistent_Naming_Context*
+TAO_Persistent_Context_Index::create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id)
+{
+ return this->context_impl_factory_->create_naming_context_impl(poa,
+ poa_id,
+ this);
+}
+
int
TAO_Persistent_Context_Index::create_index (void)
{
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h
index fe807eae71b..1ce240f9d44 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.h
@@ -23,6 +23,9 @@
#include "ace/Malloc_T.h"
#include "ace/MMAP_Memory_Pool.h"
+class TAO_Naming_Context_Factory;
+class TAO_Persistent_Naming_Context;
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
/**
@@ -65,7 +68,8 @@ public:
/// Constructor.
TAO_Persistent_Context_Index (CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa);
+ PortableServer::POA_ptr poa,
+ TAO_Naming_Context_Factory *context_impl_factory);
/**
* Create ACE_Allocator, open/create memory-mapped file with the
@@ -86,6 +90,14 @@ public:
int init (size_t context_size);
/**
+ * Create a naming context implementation to be used for this index
+ * using the naming context factory that was provided in the ctor
+ * for the index.
+ */
+ TAO_Persistent_Naming_Context *create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id);
+
+ /**
* 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.
@@ -161,6 +173,9 @@ private:
/// The reference to the root Naming Context.
CosNaming::NamingContext_var root_context_;
+
+ /// The factory for constructing naming contexts within the index
+ TAO_Naming_Context_Factory *context_impl_factory_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp
index caa29847f7b..2974fd56879 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp
@@ -235,23 +235,6 @@ TAO_Persistent_Bindings_Map::shared_bind (const char * id,
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)
@@ -267,7 +250,9 @@ TAO_Persistent_Naming_Context::TAO_Persistent_Naming_Context (PortableServer::PO
// Set the superclass pointer.
context_ = persistent_context_;
- persistent_context_->set (map, index_->allocator ());
+ // If a map was provided (i.e., not defaulted) then set it in the persistent_context_
+ if (map != 0)
+ persistent_context_->set (map, index_->allocator ());
}
int
@@ -309,12 +294,12 @@ TAO_Persistent_Naming_Context::make_new_context (PortableServer::POA_ptr poa,
// 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 ());
+ TAO_Persistent_Naming_Context *context_impl = ind->create_naming_context_impl(poa,
+ poa_id);
+
+ // Verify that a context implementation was created. If not, throw an exception
+ if (context_impl == 0)
+ throw CORBA::NO_MEMORY ();
// Put <context_impl> into the auto pointer temporarily, in case next
// allocation fails.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h
index 8659c497466..56e7a886c1f 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.h
@@ -169,12 +169,6 @@ public:
// = 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);
@@ -182,13 +176,15 @@ public:
/**
* Constructor that takes in preallocated data structure and takes
* ownership of it. This constructor is for 'recreating' servants
- * from persistent state.
+ * from persistent state. If no map is provided, it 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,
- HASH_MAP * map,
- ACE_UINT32 *counter);
+ HASH_MAP * map = 0,
+ ACE_UINT32 *counter = 0);
/// Destructor.
virtual ~TAO_Persistent_Naming_Context (void);
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp
new file mode 100644
index 00000000000..501972600e2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "orbsvcs/Naming/Persistent_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/Persistent_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ /// Constructor.
+TAO_Persistent_Naming_Context_Factory::TAO_Persistent_Naming_Context_Factory (size_t context_size)
+: TAO_Naming_Context_Factory(context_size)
+{
+
+}
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+TAO_Persistent_Naming_Context_Factory::~TAO_Persistent_Naming_Context_Factory (void)
+{
+}
+
+
+/// Factory method for creating an implementation object for naming contexts
+TAO_Persistent_Naming_Context*
+TAO_Persistent_Naming_Context_Factory::create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map,
+ ACE_UINT32 *counter)
+{
+ // Construct the naming context, forwarding the map and counter even if they
+ // are defaulted
+ return new (ACE_nothrow) TAO_Persistent_Naming_Context (poa,
+ poa_id,
+ context_index,
+ map,
+ counter);
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h
new file mode 100644
index 00000000000..e5b0b309fc1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.h
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Persistent_Naming_Context_Factory.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PERSISTENT_NAMING_CONTEXT_FACTORY_H
+#define TAO_PERSISTENT_NAMING_CONTEXT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/Naming/Naming_Context_Factory.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Persistent_Naming_Context_Factory
+ *
+ * @brief An implementation of the TAO_Naming_Context_Factory that creates
+ * TAO_Persistent_Naming_Context to implement the COS Naming Service
+ * NamingContext interface.
+ */
+class TAO_Naming_Serv_Export TAO_Persistent_Naming_Context_Factory
+ : public TAO_Naming_Context_Factory
+{
+public:
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Persistent_Naming_Context_Factory (size_t context_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// 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_Naming_Context_Factory (void);
+
+ /// Factory method for creating an implementation object for naming contexts
+ virtual TAO_Persistent_Naming_Context* create_naming_context_impl (PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Persistent_Context_Index *context_index,
+ HASH_MAP * map = 0,
+ ACE_UINT32 *counter = 0);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_PERSISTENT_NAMING_CONTEXT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable.h b/TAO/orbsvcs/orbsvcs/Naming/Storable.h
index 394a1863447..2dc14e4398e 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Storable.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable.h
@@ -23,6 +23,7 @@
#include "tao/Versioned_Namespace.h"
#include "ace/SString.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -68,7 +69,7 @@ class TAO_NS_Persistence_Record
ACE_CString ref_;
};
-class TAO_NS_Persistence_Global
+class TAO_Naming_Serv_Export TAO_NS_Persistence_Global
{
public:
void counter (unsigned int counter);
@@ -78,7 +79,7 @@ class TAO_NS_Persistence_Global
unsigned int counter_;
};
-class TAO_Storable_Base
+class TAO_Naming_Serv_Export TAO_Storable_Base
{
public:
TAO_Storable_Base();
@@ -139,11 +140,17 @@ public:
virtual TAO_Storable_Base& operator >> (
TAO_NS_Persistence_Global& global) = 0;
+ virtual TAO_Storable_Base& operator << (
+ const ACE_CString& str) = 0;
+
+ virtual TAO_Storable_Base& operator >> (
+ ACE_CString& str) = 0;
+
private:
Storable_State state_;
};
-class TAO_Naming_Service_Persistence_Factory
+class TAO_Naming_Serv_Export TAO_Naming_Service_Persistence_Factory
{
public:
TAO_Naming_Service_Persistence_Factory();
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp
index e37f995cce6..8c7a9c98fb6 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp
@@ -334,7 +334,7 @@ void TAO_Storable_Naming_Context::Write(TAO_Storable_Base& wrtr)
// Helper function to load a new context into the binding_map
int
-TAO_Storable_Naming_Context::load_map(File_Open_Lock_and_Check *flck)
+TAO_Storable_Naming_Context::load_map(TAO_Storable_Base& storable)
{
ACE_TRACE("load_map");
// assume file already open for reading
@@ -351,10 +351,10 @@ TAO_Storable_Naming_Context::load_map(File_Open_Lock_and_Check *flck)
TAO_NS_Persistence_Record record;
// we are only using the size from this header
- flck->peer() >> header;
- if (!flck->peer ().good ())
+ storable >> header;
+ if (!storable.good ())
{
- flck->peer ().clear ();
+ storable.clear ();
throw CORBA::INTERNAL ();
}
@@ -364,10 +364,10 @@ TAO_Storable_Naming_Context::load_map(File_Open_Lock_and_Check *flck)
// read in the data for the map
for (unsigned int i= 0u; i<header.size(); ++i)
{
- flck->peer() >> record;
- if (!flck->peer ().good ())
+ storable >> record;
+ if (!storable.good ())
{
- flck->peer ().clear ();
+ storable.clear ();
throw CORBA::INTERNAL ();
}
@@ -405,131 +405,57 @@ TAO_Storable_Naming_Context::
File_Open_Lock_and_Check::File_Open_Lock_and_Check(
TAO_Storable_Naming_Context * context,
const char * mode)
-:closed_(1),
+: Naming_Service_File_Guard(TAO_Storable_Naming_Context::redundant_),
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;
- 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_;
- throw CORBA::PERSIST_STORE();
- }
-
- // acquire a lock on it
- if (fl_ -> flock(0, 0, 0) != 0)
- {
- fl_->close();
- delete fl_;
- 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);
- }
- }
- }
- else if ( ! context->storable_context_ || (rwflags_ & mode_write) )
- {
- if (fl_->open() != 0)
- {
- delete fl_;
- throw CORBA::PERSIST_STORE();
- }
+ init(mode);
+}
- // now that the file is successfully opened
- // unlocked/closed before we leave this class
- closed_ = 0;
+void
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::set_parent_last_changed (const time_t & time)
+{
+ context_->last_changed_ = time;
+}
- if(!context->storable_context_)
- {
- // Load the map from disk
- context->load_map(this);
- }
- }
- else
- {
- // Need to insure that fl_ gets deleted
- delete fl_;
- }
+time_t
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::get_parent_last_changed ()
+{
+ return context_->last_changed_;
}
void
TAO_Storable_Naming_Context::
-File_Open_Lock_and_Check::release(void)
+File_Open_Lock_and_Check::create_child ()
{
- 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;
- }
+ // Throw our map away
+ delete context_->storable_context_;
+ // and build a new one from disk
+ context_->load_map (this->peer());
}
+bool
TAO_Storable_Naming_Context::
-File_Open_Lock_and_Check::~File_Open_Lock_and_Check(void)
+File_Open_Lock_and_Check::is_child_created ()
{
- ACE_TRACE("~File_Open_Lock_and_Check");
- this->release();
+ return context_->storable_context_ != 0;
}
-TAO_Storable_Base &
-TAO_Storable_Naming_Context::File_Open_Lock_and_Check::peer(void)
+TAO_Storable_Base *
+TAO_Storable_Naming_Context::
+File_Open_Lock_and_Check::create_stream (const char * mode)
{
- ACE_TRACE("peer");
- return *fl_;
+ // Build the file name
+ ACE_CString file_name(context_->persistence_directory_);
+ file_name += "/";
+ file_name += context_->name_;
+
+ // Create the stream
+ return context_->factory_->create_stream(file_name, ACE_TEXT_CHAR_TO_TCHAR(mode));
}
+
TAO_Storable_Naming_Context::TAO_Storable_Naming_Context (
CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h
index fe4d33ae149..3f743c44a17 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h
@@ -15,6 +15,7 @@
#include /**/ "ace/pre.h"
#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Naming_Service_File_Guard.h"
#include "ace/Hash_Map_Manager.h"
#include "ace/Auto_Ptr.h"
@@ -397,59 +398,41 @@ protected:
/**
* @class File_Open_Lock_and_Check
*
- * @brief Helper class for the TAO_Storable_Naming_Context.
+ * @brief File guard specific for storable naming contexts.
*
- * 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");
- * </pre>
*/
-class File_Open_Lock_and_Check
+class TAO_Naming_Serv_Export File_Open_Lock_and_Check :
+ public Naming_Service_File_Guard
{
public:
/// Constructor - we always need the object which we guard.
File_Open_Lock_and_Check(TAO_Storable_Naming_Context * context,
- const char * mode);
+ const char * mode);
+
+protected:
+
+ virtual void set_parent_last_changed (const time_t & time);
- /// Destructor
- ~File_Open_Lock_and_Check(void);
+ virtual time_t get_parent_last_changed ();
- /// Releases the lock, closes the file, and deletes the I/O stream.
- void release(void);
+ virtual void create_child ();
- /// Returns the stream to read/write on
- TAO_Storable_Base & peer(void);
+ virtual bool is_child_created ();
+
+ virtual TAO_Storable_Base * create_stream (const char * mode);
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);
+ int load_map(TAO_Storable_Base& storable);
void Write(TAO_Storable_Base& wrtr);
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp
index 5f5f31a4530..bbd43975745 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp
@@ -14,6 +14,7 @@
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
#include "orbsvcs/Naming/Naming_Context_Interface.h"
#include "orbsvcs/Naming/Storable_Naming_Context.h"
+#include "orbsvcs/Naming/Storable_Naming_Context_Factory.h"
#include "orbsvcs/Naming/Storable.h"
#include "ace/Auto_Ptr.h"
@@ -21,19 +22,19 @@ 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)
+ TAO_Naming_Service_Persistence_Factory *persistence_factory,
+ TAO_Storable_Naming_Context_Factory *context_impl_factory,
+ const ACE_TCHAR *persistence_directory)
: orb_(orb),
- factory_(factory),
- persistence_directory_(persistence_directory),
- context_size_(context_size)
+ persistence_factory_(persistence_factory),
+ context_impl_factory_(context_impl_factory),
+ persistence_directory_(persistence_directory)
{
}
TAO_Storable_Naming_Context_Activator::~TAO_Storable_Naming_Context_Activator ()
{
- delete factory_;
+ delete persistence_factory_;
}
PortableServer::Servant
@@ -43,7 +44,10 @@ TAO_Storable_Naming_Context_Activator::incarnate (
{
// Make sure complete initialization has been done
- ACE_ASSERT (factory_ != 0);
+ ACE_ASSERT (persistence_factory_ != 0);
+
+ // Make sure complete initialization has been done
+ ACE_ASSERT (context_impl_factory_ != 0);
CORBA::String_var poa_id = PortableServer::ObjectId_to_string (oid);
@@ -57,7 +61,9 @@ TAO_Storable_Naming_Context_Activator::incarnate (
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"));
+ TAO_Storable_Base * fl =
+ persistence_factory_->create_stream (ACE_TEXT_ALWAYS_CHAR(file_name.c_str()),
+ ACE_TEXT("rw"));
if (!fl->exists()) {
throw CORBA::OBJECT_NOT_EXIST ();
}
@@ -66,16 +72,13 @@ TAO_Storable_Naming_Context_Activator::incarnate (
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 ());
+ // Will throw NO_MEMORY exception if unable to construct one
+ TAO_Storable_Naming_Context *context_impl =
+ this->context_impl_factory_->create_naming_context_impl (orb_,
+ poa,
+ poa_id.in (),
+ persistence_factory_,
+ persistence_directory_);
// Put <context_impl> into the auto pointer temporarily, in case next
// allocation fails.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
index d4770ed1c60..86c615449ff 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.h
@@ -27,6 +27,7 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_Naming_Service_Persistence_Factory;
+class TAO_Storable_Naming_Context_Factory;
/**
* A servant activator to be use with a TAO_Storable_Naming_Context.
@@ -43,10 +44,10 @@ 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);
+ TAO_Storable_Naming_Context_Activator (CORBA::ORB_ptr orb,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ TAO_Storable_Naming_Context_Factory *context_impl_factory,
+ const ACE_TCHAR *persistence_directory);
virtual ~TAO_Storable_Naming_Context_Activator();
@@ -70,9 +71,14 @@ public:
private:
CORBA::ORB_ptr orb_;
- TAO_Naming_Service_Persistence_Factory *factory_;
+
+ /// The factory for constructing the persistence mechanism for the contexts
+ TAO_Naming_Service_Persistence_Factory *persistence_factory_;
+
+ /// The factory for constructing naming contexts within the index
+ TAO_Storable_Naming_Context_Factory *context_impl_factory_;
+
const ACE_TCHAR *persistence_directory_;
- size_t context_size_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp
new file mode 100644
index 00000000000..8a60dcfee2c
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+#include "orbsvcs/Naming/Storable_Naming_Context_Factory.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ /// Constructor.
+TAO_Storable_Naming_Context_Factory::TAO_Storable_Naming_Context_Factory (size_t hash_table_size)
+: context_size_(hash_table_size)
+{
+
+}
+
+ /// Destructor. Does not deallocate the hash map: if an instance of
+ /// this class goes out of scope, its hash_map remains in persistent storage.
+TAO_Storable_Naming_Context_Factory::~TAO_Storable_Naming_Context_Factory (void)
+{
+
+}
+
+
+TAO_Storable_Naming_Context*
+TAO_Storable_Naming_Context_Factory::create_naming_context_impl (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *persistence_factory,
+ const ACE_TCHAR *persistence_directory
+ )
+{
+ // Construct the naming context, forwarding the map and counter even if they
+ // are defaulted
+ TAO_Storable_Naming_Context *context_impl;
+ ACE_NEW_THROW_EX (context_impl,
+ TAO_Storable_Naming_Context (orb,
+ poa,
+ poa_id,
+ persistence_factory,
+ persistence_directory,
+ this->context_size_),
+ CORBA::NO_MEMORY ());
+
+ return context_impl;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h
new file mode 100644
index 00000000000..233e3043d50
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Storable_Naming_Context_Factory.h
+ *
+ * $Id$
+ *
+ * @author Kevin Stanley stanleyk@ociweb.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_STORABLE_NAMING_CONTEXT_FACTORY_H
+#define TAO_STORABLE_NAMING_CONTEXT_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "tao/ORB.h"
+#include "orbsvcs/Naming/nsconf.h"
+#include "orbsvcs/Naming/naming_serv_export.h"
+#include "orbsvcs/Naming/Hash_Naming_Context.h"
+#include "orbsvcs/Naming/Storable_Naming_Context.h"
+
+
+class TAO_Persistent_Naming_Context;
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Naming_Context_Factory
+ *
+ * @brief
+ */
+class TAO_Naming_Serv_Export TAO_Storable_Naming_Context_Factory
+{
+public:
+
+ /// Data structure used by TAO_Persistent_Context_Index - typedef for ease of use.
+ typedef TAO_Storable_Naming_Context::HASH_MAP HASH_MAP;
+
+ // = Initialization and termination methods.
+
+ /// Constructor.
+ TAO_Storable_Naming_Context_Factory (size_t hash_table_size = ACE_DEFAULT_MAP_SIZE);
+
+ /// 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_Storable_Naming_Context_Factory (void);
+
+ /// Factory method for creating an implementation object for naming contexts.
+ /// If an existing naming context implementation is being rebuilt, the map and counter parameters
+ /// should be provided to the underlying HASH_MAP implementation
+ virtual TAO_Storable_Naming_Context* create_naming_context_impl (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ const char *poa_id,
+ TAO_Naming_Service_Persistence_Factory *factory,
+ const ACE_TCHAR *persistence_directory);
+
+protected:
+ /// The size for persisted naming context objects in hash map
+ size_t context_size_;
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_STORABLE_NAMING_CONTEXT_FACTORY_H */
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
index fc10e0bb552..9b1e8d070d3 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.cpp
@@ -16,6 +16,7 @@
#include "orbsvcs/PortableGroupC.h"
#include "orbsvcs/PortableGroup/PG_Object_Group.h"
#include <orbsvcs/PortableGroup/PG_Utils.h>
+#include <ace/SString.h>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -155,6 +156,32 @@ int TAO::PG_Group_Factory::find_group (PortableGroup::ObjectGroup_ptr object_gro
return result;
}
+int TAO::PG_Group_Factory::find_group_with_name (const char* target_group_name,
+ TAO::PG_Object_Group *& group_target)
+{
+ int result = 0;
+
+ // Search through the group map for the group with that property
+ for (Group_Map_Iterator it = this->group_map_.begin ();
+ it != this->group_map_.end ();
+ ++it)
+ {
+ TAO::PG_Object_Group * a_group = (*it).int_id_;
+ // If the group has the group name in the property
+ //
+ const char* a_group_name = a_group->get_name ();
+ if (a_group_name != 0 &&
+ ACE_OS::strcmp (target_group_name,
+ a_group_name) == 0)
+ { // This is the group we were looking for
+ group_target = a_group;
+ result = 1;
+ break;
+ }
+ }
+ return result;
+}
+
int TAO::PG_Group_Factory::destroy_group (PortableGroup::ObjectGroupId group_id)
{
::TAO::PG_Object_Group * group = 0;
@@ -204,4 +231,30 @@ TAO::PG_Group_Factory::groups_at_location (
return result;
}
+PortableGroup::ObjectGroups *
+TAO::PG_Group_Factory::all_groups (void)
+{
+
+ 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());
+
+ 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_;
+ (*result)[group_count] = CORBA::Object::_duplicate(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
index 950513257e7..15813a69b4f 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_Factory.h
@@ -98,6 +98,11 @@ namespace TAO
groups_at_location (
const PortableGroup::Location & the_location);
+ /**
+ * return all groups in the factory
+ */
+ PortableGroup::ObjectGroups *
+ all_groups (void);
/**
@@ -127,6 +132,12 @@ namespace TAO
int find_group (PortableGroup::ObjectGroup_ptr object_group, ::TAO::PG_Object_Group *& group) const;
/**
+ * find group with the property with the designated value
+ * @return bool true if found
+ */
+ int find_group_with_name (const char* group_name, ::TAO::PG_Object_Group *& group);
+
+ /**
* remove group from map and delete it.
* @return bool true if found
*/
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
index f0ab31d5342..4896494fe40 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.cpp
@@ -62,10 +62,12 @@ TAO::PG_Object_Group::PG_Object_Group (
, factory_registry_ (PortableGroup::FactoryRegistry::_duplicate (factory_registry))
, manipulator_ (manipulator)
, empty_ (1)
+ , distribute_ (1)
, role_ (type_id)
, type_id_ (CORBA::string_dup (type_id))
, tagged_component_ (tagged_component)
, reference_ (CORBA::Object::_duplicate(empty_group))
+ , group_name_ (0)
, members_ ()
, primary_location_(0)
, properties_ (the_criteria, type_properties)
@@ -77,6 +79,8 @@ TAO::PG_Object_Group::PG_Object_Group (
TAO::PG_Object_Group::~PG_Object_Group (void)
{
+ delete group_name_;
+
for (MemberMap_Iterator it = this->members_.begin();
it != this->members_.end();
++it)
@@ -216,20 +220,21 @@ TAO::PG_Object_Group::add_member (const PortableGroup::Location & the_location,
this->reference_ = new_reference; // note var-to-var assignment does
// a duplicate
+
if (this->increment_version ())
{
this->distribute_iogr ();
}
else
- {
+ { // Issue with incrementing the version
throw PortableGroup::ObjectNotAdded ();
}
if (TAO_debug_level > 6)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT("PG (%P|%t) exit Object_Group add_member\n")));
- }
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("PG (%P|%t) exit Object_Group add_member\n")));
+ }
}
int
@@ -425,6 +430,10 @@ TAO::PG_Object_Group::increment_version (void)
void
TAO::PG_Object_Group::distribute_iogr (void)
{
+ // Check if the object group is configured to distribute
+ if (!this->distribute_)
+ return;
+
// assume internals is locked
CORBA::String_var iogr =
this->orb_->object_to_string (this->reference_.in());
@@ -509,6 +518,7 @@ TAO::PG_Object_Group::locations_of_members (void)
const PortableGroup::Location & location = (*it).ext_id_;
PortableGroup::Location & out = (*result)[pos];
out = location;
+ ++pos;
}
return result;
}
@@ -795,5 +805,26 @@ TAO::PG_Object_Group::has_member_at (const PortableGroup::Location & location)
return (0 == this->members_.find (location));
}
+void
+TAO::PG_Object_Group::distribute (int value)
+{
+ this->distribute_ = value;
+}
+
+void
+TAO::PG_Object_Group::set_name (const char* group_name)
+{
+ if (group_name_ != 0)
+ CORBA::string_free (group_name_);
+
+ group_name_ = CORBA::string_dup (group_name);
+}
+
+const char*
+TAO::PG_Object_Group::get_name (void)
+{
+ return group_name_;
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
index f5b5328b68e..d11f2ffb93a 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group.h
@@ -73,7 +73,6 @@ namespace TAO
/// Location where this member exists
PortableGroup::Location location_;
-
/// TRUE if this is primary member
CORBA::Boolean is_primary_;
@@ -251,6 +250,17 @@ namespace TAO
*/
int has_member_at (const PortableGroup::Location & location );
+
+ /**
+ * Tell the object group that it should distribute updates to the object
+ * group state.
+ */
+ void distribute (int value);
+
+ void set_name (const char* group_name);
+
+ const char* get_name (void);
+
/////////////////////////
// Implementation methods
private:
@@ -302,6 +312,9 @@ namespace TAO
/// boolean true if empty group
int empty_;
+ /// boolean true if updates should be distributed
+ int distribute_;
+
ACE_CString role_;
PortableGroup::TypeId_var type_id_;
@@ -325,6 +338,12 @@ namespace TAO
*/
PortableServer::ObjectId_var object_id_;
+ /**
+ * an optional attribute of the object group which is a string
+ * name that is assigned to the object group by the creator.
+ */
+ char* group_name_;
+
// group members
MemberMap members_;
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
index 07739231579..2b7236818a3 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Property_Set.cpp
@@ -149,15 +149,13 @@ void TAO::PG_Property_Set::set_property (
CORBA::NO_MEMORY ());
const PortableGroup::Value * replaced_value = 0;
- if (0 == this->values_.rebind (name, value_copy, replaced_value))
- {
- if (0 != replaced_value)
- {
- delete replaced_value;
- }
+ int rebind_result = this->values_.rebind (name, value_copy, replaced_value);
+ if (1 == rebind_result)
+ { // Existing value was replaced
+ delete replaced_value;
}
- else
- {
+ else if (-1 == rebind_result)
+ { // An
if (TAO_debug_level > 3)
{
ACE_ERROR ( (LM_ERROR,
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
index fb2b02000fe..8d134432c58 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_ORBInitializer.cpp
@@ -9,8 +9,8 @@
#include "tao/debug.h"
static const char pg_poa_factory_name[] = "TAO_GOA";
-static const ACE_TCHAR pg_poa_factory_directive[] = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
- "TAO_GOA", "TAO_PortableGroup", TAO_VERSION , "_make_TAO_PG_Object_Adapter_Factory", "");
+static const ACE_TCHAR pg_poa_factory_directive[] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "TAO_GOA", "TAO_PortableGroup", "_make_TAO_PG_Object_Adapter_Factory", "");
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb b/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb
index 1caf3ca3f1f..47391744a85 100644
--- a/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb
+++ b/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb
@@ -12,6 +12,9 @@ feature(!corba_e_micro) {
Naming/Storable.cpp
Naming/Storable_Naming_Context.cpp
Naming/Storable_Naming_Context_Activator.cpp
+ Naming/Naming_Context_Factory.cpp
+ Naming/Persistent_Naming_Context_Factory.cpp
+ Naming/Storable_Naming_Context_Factory.cpp
}
}
}
diff --git a/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp
index 6da6a2ea136..3360f87fe7e 100644
--- a/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Bug_3486_Regression/server.cpp
@@ -7,20 +7,18 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3486",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNamingService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNamingService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNamingService",
"TAO_CosNaming_Serv",
- TAO_VERSION,
"_make_TAO_Naming_Loader",
""
);
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp
new file mode 100644
index 00000000000..b850af5e4a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "Basic.h"
+#include "LB_server.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+
+Basic::Basic (CORBA::Object_ptr object_group,
+ FT::NamingManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ const char *loc)
+ : object_group_name_ ("Basic Group"), orb_ (CORBA::ORB::_duplicate (orb))
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->nm_ = FT::NamingManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+char *
+Basic::get_string (void)
+{
+ return CORBA::string_dup (this->location_.in ());
+}
+
+void
+Basic::remove_member (void)
+{
+ try
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_.in ());
+ this->nm_->remove_member (this->object_group_.in (),
+ location);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_.in ()));
+
+ }
+ catch (const PortableGroup::ObjectNotFound& ex)
+ {
+ ex._tao_print_exception ("Caught exception in remove_member");
+ throw CORBA::INTERNAL ();
+ }
+ catch (const PortableGroup::MemberNotFound& ex)
+ {
+ ex._tao_print_exception ("Caught exception in remove_member");
+ throw CORBA::INTERNAL ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught while destroying member\n");
+ }
+
+}
+
+
+void
+Basic::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h
new file mode 100644
index 00000000000..0c2526680ef
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef BASIC_H
+#define BASIC_H
+
+#include "TestS.h"
+#include "orbsvcs/FT_NamingManagerC.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,
+ FT::NamingManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ const char *loc);
+
+ virtual char * get_string (void);
+
+ virtual void shutdown (void);
+
+ virtual void remove_member (void);
+
+private:
+
+ const char* object_group_name_;
+
+ /// 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.
+ FT::NamingManager_var nm_;
+
+ /// location of the servant
+ CORBA::String_var 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/FT_Naming/Load_Balancing/LB_server.cpp b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp
new file mode 100644
index 00000000000..4c96e978f4a
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+#include "LB_server.h"
+#include "Basic.h"
+
+#include "TestC.h"
+#include "ace/OS_NS_stdio.h"
+
+LB_server::LB_server (int argc, ACE_TCHAR **argv)
+ : argc_ (argc)
+ , argv_ (argv)
+ , ior_output_file_(ACE_TEXT("obj.ior"))
+{
+}
+
+int
+LB_server::destroy (void)
+{
+ try
+ {
+ this->naming_manager_->delete_object_group ("Basic Group");
+
+ //TODO: Does the FT_NamingManager need a destroy method?
+// this->naming_manager_->destroy (1, 1);
+
+ this->orb_->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "Exception caught while destroying LB_server\n");
+ return -1;
+ }
+ return 0;
+
+}
+
+CORBA::ORB_ptr
+LB_server::orb (void)
+{
+ return this->orb_.in ();
+}
+
+CORBA::Object_ptr
+LB_server::object_group (void)
+{
+ return this->object_group_.in ();
+}
+
+FT::NamingManager_ptr
+LB_server::naming_manager (void)
+{
+ return this->naming_manager_.in ();
+}
+
+int
+LB_server::write_ior_to_file (const char *ior)
+{
+ FILE *output_file =
+ ACE_OS::fopen (this->ior_output_file_, "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::parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+LB_server::start_orb_and_poa (void)
+{
+ try
+ {
+ // Initialise the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_, this->argv_);
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA");
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ -1);
+
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager ();
+
+ poa_manager->activate ();
+
+ ACE_Time_Value timeout (10); // Wait up to 10 seconds for the naming service
+ if (name_svc_.init (this->orb_, &timeout) != 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "LB_server: Could not connect to naming service.\n"),
+ -1);
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("NamingManager");
+
+ this->naming_manager_ =
+ FT::NamingManager::_narrow (obj.in ());
+
+ if (CORBA::is_nil (this->naming_manager_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Naming Manager Reference\n"),
+ -1);
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception raised initialising ORB or POA");
+ return -1;
+ }
+
+ return 0;
+
+}
+
+int
+LB_server::create_object_group (void)
+{
+ try
+ {
+ const char *repository_id = "IDL:Test/Basic:1.0";
+
+ if (this->parse_args (argc_, argv_) != 0)
+ return -1;
+
+ PortableGroup::Criteria criteria (2);
+ criteria.length (1);
+
+ PortableGroup::Property &mem_style = criteria[0];
+ mem_style.nam.length (1);
+
+ // Set the membership style property
+ mem_style.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ mem_style.val <<= msv;
+
+ this->object_group_ = this->naming_manager_->create_object_group (
+ "Basic Group",
+ FT::ROUND_ROBIN,
+ repository_id,
+ criteria);
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->object_group_.in ());
+
+ this->write_ior_to_file (ior.in ());
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "Exception raised while creating object group");
+ return -1;
+ }
+
+ return 0;
+
+}
+
+int
+LB_server::register_servant (Basic *servant, const char *loc)
+{
+ try
+ {
+ Test::Basic_var basic =
+ servant->_this ();
+
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup (loc);
+
+ this->naming_manager_->add_member (this->object_group_.in (),
+ location,
+ basic.in ());
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception raised while registering servant");
+ return -1;
+ }
+
+ return 0;
+}
+
+TAO_Naming_Client&
+LB_server::name_svc ()
+{
+ return name_svc_;
+}
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.h b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.h
new file mode 100644
index 00000000000..34a7c30ea21
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/LB_server.h
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_server.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#include "orbsvcs/FT_NamingManagerC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Naming/Naming_Client.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.
+ *
+ * TODO: Fix description
+ * This is a class used to retrieve the NamingManager 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 NamingManager
+ * itself. At this point the Load Balancing cycle starts.
+ */
+class LB_server
+{
+public:
+
+ /// Constructor
+ LB_server (int argc, ACE_TCHAR **argv);
+
+ /// destroys NamingManager, ORB and POA.
+ int destroy (void);
+
+ /// start the ORB.
+ int start_orb_and_poa (void);
+
+ /// Get the NamingManager Interface.
+ int init (int argc, ACE_TCHAR **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);
+
+ /// obtain the name service facade
+ TAO_Naming_Client& name_svc ();
+
+ /// 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.
+ FT::NamingManager_ptr naming_manager (void);
+
+private:
+
+ int parse_args (int, ACE_TCHAR **);
+
+private:
+
+ /// Load Manager
+ FT::NamingManager_var naming_manager_;
+
+ /// 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_;
+ ACE_TCHAR **argv_;
+ PortableServer::POA_var root_poa_;
+ const ACE_TCHAR *ior_output_file_;
+ TAO_Naming_Client name_svc_;
+};
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc
new file mode 100644
index 00000000000..b6d362250a3
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Load_Balancing_Name_Service.mpc
@@ -0,0 +1,34 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*server): orbsvcsexe, portablegroup, ftnaming, naming, svc_utils {
+ after += *idl
+ exename = server
+ Source_Files {
+ TestC.cpp
+ TestS.cpp
+ server.cpp
+ LB_server.cpp
+ Basic.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): orbsvcsexe, portablegroup, ftnaming, naming, svc_utils {
+ after += *idl
+ exename = client
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README
new file mode 100644
index 00000000000..f503771ea2b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/NameService/README
@@ -0,0 +1,4 @@
+$Id$
+
+This directory is used to store the persistent state for the
+FT_Naming_Service tests. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/README b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/README
new file mode 100644
index 00000000000..44197dfb409
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/README
@@ -0,0 +1,8 @@
+$Id$
+
+This program tests the application controlled membership support
+of the FT_Naming_Service. The aim is to allow the application
+to create object groups and add them to the naming service. When
+the client resolves an object group from the naming service, the
+load balancing strategy is applied. Currently the test only supports
+the RoundRobin load balancing strategy.
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl
new file mode 100644
index 00000000000..889f8967e18
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Test.idl
@@ -0,0 +1,27 @@
+//
+// $Id$
+
+#include "orbsvcs/FT_NamingManager.idl"
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ typedef FT::LoadBalancingStrategyValue LoadBalancingStrategyValue;
+
+ /// 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 NamingManager Object Group.
+ oneway void remove_member ();
+ };
+};
+
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp
new file mode 100644
index 00000000000..b1727fe62e3
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/client.cpp
@@ -0,0 +1,149 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "ace/Time_Value.h"
+
+const ACE_TCHAR *ior = ACE_TEXT("file://obj.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.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
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Acquiring Name Service\n"));
+
+ TAO_Naming_Client name_svc;
+ try {
+
+ ACE_Time_Value timeout (10); // Wait up to 10 seconds for the naming service
+ if (name_svc.init (orb.in (), &timeout) != 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "client: Could not connect to naming service.\n"),
+ 1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught while initializing name service facade:");
+ return 1;
+ }
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("basic_name");
+
+ CORBA::Object_var tmp;
+ Test::Basic_var basic;
+
+ // Iterate enough so we get a few wraparrounds
+ for (int i = 0; i < 15; i++)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Resolving service\n"));
+ try {
+
+ // Each time we invoke resolve, we get a different member
+ tmp =
+ name_svc->resolve (name);
+
+ // Narrow it to a Basic object
+ basic =
+ Test::Basic::_narrow (tmp.in ());
+
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Error resolving name.\n");
+ }
+
+ if (CORBA::is_nil (basic.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Server obj ref not obtained from Load Balancing Name Service\n",
+ ior),
+ 1);
+ }
+
+ try {
+ CORBA::String_var the_string =
+ basic->get_string ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Client request handled by object at <%s>\n",
+ the_string.in ()));
+
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Error invoking get_string on Basic object.\n");
+ return 1;
+ }
+
+ // Remove one member after we wrapped around to make sure naming manager can
+ // handle it successufully
+ if (i == 7)
+ {
+ try {
+ // Try removing a member
+ basic->remove_member ();
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Error invoking get_string on Basic object.\n");
+ return 1;
+ }
+ }
+ }
+
+ try {
+
+ basic->shutdown ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Shutting down server\n"));
+ }
+ catch (CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Error invoking get_string on Basic object.\n");
+ return 1;
+ }
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught in client.cpp:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl
new file mode 100755
index 00000000000..24360296520
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/run_test.pl
@@ -0,0 +1,168 @@
+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::TestTarget;
+
+$status = 0;
+$debug_level = '0';
+
+## The NamingManager 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 = "windows" . $PerlACE::svcconf_ext;
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $naming_manager = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $server2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $client = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+
+my $nm_iorfile = "lm.ior";
+my $ns_iorfile = "ns.ior";
+my $server_obj_group_iorfile = "obj.ior";
+
+#Files used by the FT Naming Manager
+my $naming_mgr_nm_iorfile = $naming_manager->LocalFile ($nm_iorfile);
+my $naming_mgr_ns_iorfile = $naming_manager->LocalFile ($ns_iorfile);
+$naming_manager->DeleteFile($nm_iorfile);
+$naming_manager->DeleteFile($ns_iorfile);
+
+#Files used by the server2
+my $server2_nm_iorfile = $server2->LocalFile ($nm_iorfile);
+$server2->DeleteFile($server2_nm_iorfile);
+my $server2_ns_iorfile = $server2->LocalFile ($ns_iorfile);
+$server2->DeleteFile($server2_ns_iorfile);
+my $server2_obj_group_iorfile = $server2->LocalFile ($server_obj_group_iorfile);
+$server2->DeleteFile($server_obj_group_iorfile);
+
+#Files which used by client
+my $client_ns_iorfile = $client->LocalFile ($ns_iorfile);
+$client->DeleteFile($client_ns_iorfile);
+
+
+$SV1 = $naming_manager->CreateProcess ("../../../../orbsvcs/Naming_Service/tao_ft_naming",
+ "-ORBdebuglevel $debug_level " .
+ "-f FT_Naming.dat " .
+ "-o $ns_iorfile " .
+ "-g $nm_iorfile " .
+ ($^O eq 'MSWin32' ?
+ " -ORBSvcConf $lm_conf" : ''));
+
+$SV2 = $server2->CreateProcess ("server",
+ "-ORBdebuglevel $debug_level " .
+ "-ORBInitRef NameService=file://$server2_ns_iorfile " .
+ "-ORBInitRef NamingManager=file://$server2_nm_iorfile " .
+ "-o $server2_obj_group_iorfile");
+
+$CL = $client->CreateProcess ("client",
+ "-ORBInitRef NameService=file://$client_ns_iorfile");
+
+print STDERR "\n\n======== Running Application Controlled Membership Test================\n";
+print STDERR "\n";
+
+print STDERR "This test uses the RoundRobin Load Balancing strategy \n";
+
+print STDERR "6 servers are created and added into a Object Group\n";
+
+print STDERR "When the client accesses an object group through the naming service, the";
+print STDERR "FT_Naming_Service will apply the RoundRobin load balancing strategy\n";
+print STDERR "selects one of the servers and then the client makes an invocations on\n";
+print STDERR "the server. This is done 15 times to ensure we support the wraparround\n";
+print STDERR "condition. 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";
+
+$server_status = $SV1->Spawn ();
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ exit 1;
+}
+
+if ($naming_manager->WaitForFileTimed ($nm_iorfile,
+ $naming_manager->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$naming_mgr_nm_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
+
+if ($naming_manager->GetFile ($nm_iorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$naming_mgr_nm_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
+
+if ($server2->PutFile ($server_obj_group_iorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$server2_obj_group_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
+
+$server_status = $SV2->Spawn ();
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ exit 1;
+}
+
+sub KillServers{
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+}
+
+if ($server2->WaitForFileTimed ($server_obj_group_iorfile,
+ $server2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server2_obj_group_iorfile>\n";
+ KillServers ();
+ exit 1;
+}
+
+if ($server2->GetFile ($server_obj_group_iorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server2_obj_group_iorfile>\n";
+ KillServers ();
+ exit 1;
+}
+
+if ($client->PutFile ($server_obj_group_iorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$client_ns_iorfile>\n";
+ KillServers ();
+ exit 1;
+}
+
+$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 85);
+
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+}
+
+$server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $status = 1;
+}
+
+$server_status = $SV1->TerminateWaitKill ($naming_manager->ProcessStopWaitInterval());
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $status = 1;
+}
+
+$naming_manager->DeleteFile($nm_iorfile);
+$server2->DeleteFile($nm_iorfile);
+$server2->DeleteFile($server_obj_group_iorfile);
+$client->DeleteFile($server_obj_group_iorfile);
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp
new file mode 100644
index 00000000000..258cddbe1de
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/server.cpp
@@ -0,0 +1,119 @@
+// $Id$
+
+#include "LB_server.h"
+#include "Basic.h"
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ 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 () != 0)
+ return 1;
+
+ if (lb_server.create_object_group () != 0)
+ return 1;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("basic_name");
+ try {
+ (lb_server.name_svc ())->rebind (name, lb_server.object_group ());
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Unable to bind object group in name service.\n");
+ 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.naming_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.naming_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.naming_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.naming_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.naming_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.naming_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_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ if (lb_server.destroy () == -1)
+ return 1;
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("lb_server exception");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/svc.conf b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/svc.conf
new file mode 100644
index 00000000000..b6856698e51
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/svc.conf
@@ -0,0 +1,3 @@
+# $Id$
+
+static Resource_Factory "-ORBDropRepliesDuringShutdown 0"
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf
new file mode 100644
index 00000000000..e02d5089fce
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/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/FT_Naming/Load_Balancing/windows.conf.xml b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf.xml
new file mode 100644
index 00000000000..37af1733d3b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/windows.conf.xml
@@ -0,0 +1,10 @@
+<?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/ImplRepo/ReconnectServer/client.cpp b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/client.cpp
index bc61035a1b9..114f0be51cc 100755
--- a/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/client.cpp
+++ b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/client.cpp
@@ -118,10 +118,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
CORBA::Object_var object = orb->resolve_initial_references ("RootPOA");
- PortableServer::POA_var rootPOA = PortableServer::POA::_narrow (object.in ());
-
- PortableServer::POAManager_var poa_manager = rootPOA->the_POAManager ();
- poa_manager->activate ();
object = orb->string_to_object(ior_input_file);
@@ -142,8 +138,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
task.wait ();
- // Destroy the POA, waiting until the destruction terminates
- rootPOA->destroy (1, 1);
orb->destroy ();
if (task.test_passed ())
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl
new file mode 100644
index 00000000000..880e7790199
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger.idl
@@ -0,0 +1,18 @@
+// $Id$
+
+// messenger.idl
+
+interface Messenger
+{
+ boolean send_message ( in string user_name,
+ in string subject,
+ inout string message );
+
+ // After replying, abort process in
+ // delay_secs seconds.
+ void abort ( in short delay_secs );
+
+ // Perform a graceful shutdown.
+ oneway void shutdown ();
+};
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp
new file mode 100644
index 00000000000..68b78eea2df
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerClient.cpp
@@ -0,0 +1,81 @@
+// $Id$
+
+#include "MessengerC.h"
+#include <iostream>
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior = ACE_TEXT("file://Messenger.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.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
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Destringify ior
+ CORBA::Object_var obj = orb->string_to_object( ior );
+ if (CORBA::is_nil(obj.in())) {
+ std::cerr << "Nil Messenger reference" << std::endl;
+ return 1;
+ }
+
+ // Narrow
+ Messenger_var messenger = Messenger::_narrow( obj.in() );
+ if (CORBA::is_nil(messenger.in())) {
+ std::cerr << "Argument is not a Messenger reference" << std::endl;
+ return 1;
+ }
+
+ CORBA::String_var message = CORBA::string_dup( "Hello!" );
+
+ messenger->send_message( "TAO User", "Test 1", message.inout() );
+
+ // Force server to abort to verify it will be brought
+ // back up when send_message() is called.
+ messenger->abort(2);
+ ACE_OS::sleep(4);
+
+ ACE_DEBUG ((LM_INFO,
+ "(%P|%t) - Sending another message after abort of server\n"));
+
+ messenger->send_message( "TAO User", "Test 2", message.inout() );
+
+ std::cout << "messages were sent" << std::endl;
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Client main() Caught CORBA::Exception: " << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerServer.cpp b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerServer.cpp
new file mode 100644
index 00000000000..370144b98d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/MessengerServer.cpp
@@ -0,0 +1,117 @@
+// $Id$
+
+// MessengerServer.cpp
+// This version uses the Implementation Repository.
+
+#include "Messenger_i.h"
+#include "Terminator.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include <iostream>
+
+PortableServer::POA_ptr
+createPOA(PortableServer::POA_ptr root_poa, const char* poa_name)
+{
+ PortableServer::LifespanPolicy_var life =
+ root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
+
+ PortableServer::IdAssignmentPolicy_var assign =
+ root_poa->create_id_assignment_policy(PortableServer::USER_ID);
+
+ CORBA::PolicyList pols;
+ pols.length(2);
+ pols[0] = PortableServer::LifespanPolicy::_duplicate(life.in());
+ pols[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+ PortableServer::POA_var poa =
+ root_poa->create_POA(poa_name, mgr.in(), pols);
+
+ life->destroy();
+ assign->destroy();
+
+ return poa._retn();
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
+
+ PortableServer::POAManager_var mgr = root_poa->the_POAManager();
+
+ const char* poa_name = "MessengerService";
+
+ PortableServer::POA_var messenger_poa = createPOA(root_poa.in(), poa_name);
+
+ Terminator terminator;
+ if (terminator.open (0) == -1)
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT ("main Error opening terminator\n")),-1);
+
+ PortableServer::Servant_var<Messenger_i> messenger_servant =
+ new Messenger_i(orb.in(), terminator);
+
+ PortableServer::ObjectId_var object_id =
+ PortableServer::string_to_ObjectId("messenger_object");
+
+ //
+ // Activate the servant with the messenger POA,
+ // obtain its object reference, and get a
+ // stringified IOR.
+ //
+ messenger_poa->activate_object_with_id(object_id.in(), messenger_servant.in());
+
+ //
+ // Create binding between "MessengerService" and
+ // the messenger object reference in the IOR Table.
+ // Use a TAO extension to get the non imrified poa
+ // to avoid forwarding requests back to the ImR.
+
+ TAO_Root_POA* tpoa = dynamic_cast<TAO_Root_POA*>(messenger_poa.in());
+ obj = tpoa->id_to_reference_i(object_id.in(), false);
+ CORBA::String_var messenger_ior = orb->object_to_string(obj.in());
+ obj = orb->resolve_initial_references("IORTable");
+ IORTable::Table_var table = IORTable::Table::_narrow(obj.in());
+ table->bind(poa_name, messenger_ior.in());
+
+ //
+ // This server is now ready to run.
+ // This version does not create an IOR
+ // file as demonstrated in the
+ // Developer's Guide. It assumes that
+ // users create IORs for the client using
+ // the tao_imr utility.
+ //
+ //
+ // Stop discarding requests.
+ //
+ mgr->activate();
+
+ std::cout << "Messenger server ready." << std::endl;
+
+ orb->run();
+
+ std::cout << "Messenger server shutting down." << std::endl;
+
+ root_poa->destroy(1,1);
+ orb->destroy();
+
+ ACE_Message_Block *mb;
+ ACE_NEW_RETURN(mb, ACE_Message_Block(0, ACE_Message_Block::MB_HANGUP), -1);
+ terminator.putq(mb);
+ terminator.wait();
+ }
+ catch(const CORBA::Exception& ex) {
+ std::cerr << "Server main() Caught CORBA::Exception" << ex << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.cpp b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.cpp
new file mode 100644
index 00000000000..a701f84a1f5
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.cpp
@@ -0,0 +1,53 @@
+/* -*- C++ -*- $Id$ */
+
+// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
+// TAO and the TAO IDL Compiler have been developed by the Center for
+// Distributed Object Computing at Washington University, St. Louis.
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+#include "Messenger_i.h"
+#include "Terminator.h"
+
+#include <iostream>
+
+// Implementation skeleton constructor
+Messenger_i::Messenger_i (CORBA::ORB_ptr orb, Terminator &terminator)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , message_count_ (0)
+ , terminator_ (terminator)
+{
+}
+
+// Implementation skeleton destructor
+Messenger_i::~Messenger_i (void)
+{
+}
+
+CORBA::Boolean Messenger_i::send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message)
+{
+ std::cout << "Message count: " << message_count_++ << std::endl;
+ std::cout << "Message from: " << user_name << std::endl
+ << "Subject: " << subject << std::endl
+ << "Message: " << message << std::endl;
+ return 1;
+}
+
+void
+Messenger_i::abort (CORBA::Short delay_secs)
+{
+ ACE_Message_Block *mb = 0;
+ ACE_NEW(mb, ACE_Message_Block(2));
+ ACE_OS::sprintf(mb->wr_ptr (), "%d", delay_secs);
+ terminator_.putq(mb);
+}
+
+void
+Messenger_i::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.h b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.h
new file mode 100644
index 00000000000..45e7389c8df
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Messenger_i.h
@@ -0,0 +1,43 @@
+/* -*- 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 Terminator;
+
+//Class Messenger_i
+class Messenger_i : public virtual POA_Messenger
+{
+public:
+ //Constructor
+ Messenger_i (CORBA::ORB_ptr orb, Terminator &terminator);
+
+ //Destructor
+ virtual ~Messenger_i (void);
+
+ virtual CORBA::Boolean send_message (
+ const char * user_name,
+ const char * subject,
+ char *& message);
+
+ virtual void abort (CORBA::Short delay_secs);
+
+ virtual void shutdown (void);
+
+private:
+ /// Use an ORB reference to shutdown the application.
+ CORBA::ORB_var orb_;
+
+ int message_count_;
+
+ Terminator& terminator_;
+};
+
+
+#endif /* MESSENGERI_H_ */
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/README b/TAO/orbsvcs/tests/ImplRepo/RestartServer/README
new file mode 100644
index 00000000000..f69485fb4c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/README
@@ -0,0 +1,10 @@
+$Id$
+
+This test verifies that if a server launched by the ImR activator is terminated,
+then it will be relaunched transparently by the ORB if the client makes another
+request if -ORBForwardOnTransientLimit and -ORBForwardOnReplyClosedLimit options
+are used.
+
+Note that TAO does not have a way of knowing if server actually processed the
+request, so that the CORBA "at most once" guarantee may be violated if
+-ORBForwardOnReplyClosedLimit is used.
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/RestartServer.mpc b/TAO/orbsvcs/tests/ImplRepo/RestartServer/RestartServer.mpc
new file mode 100644
index 00000000000..c619da302e2
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/RestartServer.mpc
@@ -0,0 +1,37 @@
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Messenger.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoserver, iortable, avoids_minimum_corba, avoids_corba_e_micro {
+ exename = MessengerServer
+ after += *idl
+ Source_Files {
+ Messenger_i.cpp
+ MessengerServer.cpp
+ Terminator.cpp
+ }
+ Source_Files {
+ MessengerC.cpp
+ MessengerS.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, anytypecode, avoids_minimum_corba {
+ exename = MessengerClient
+ after += *idl
+ Source_Files {
+ MessengerClient.cpp
+ }
+ Source_Files {
+ MessengerC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp
new file mode 100644
index 00000000000..17db0d510b5
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.cpp
@@ -0,0 +1,39 @@
+/* -*- C++ -*- $Id$ */
+
+#include "Terminator.h"
+#include "ace/Log_Msg.h"
+
+int
+Terminator::open(void*)
+{
+ if(this->activate (THR_NEW_LWP | THR_JOINABLE,
+ 1) == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT("Terminator::open Error spawning thread %p\n"),
+ "err="),
+ -1);
+ }
+ return 0;
+}
+
+int
+Terminator::svc()
+{
+ while (1)
+ {
+ ACE_Message_Block* mb;
+ ACE_ASSERT(this->getq(mb) != -1);
+ if (mb->msg_type () == ACE_Message_Block::MB_HANGUP)
+ {
+ mb->release ();
+ break;
+ }
+ int delay_secs = ACE_OS::atoi(mb->rd_ptr());
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t|%T) Terminator::svc() Sleeping %d seconds before aborting\n", delay_secs));
+ ACE_OS::sleep(delay_secs);
+ ACE_OS::abort();
+ }
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.h b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.h
new file mode 100644
index 00000000000..29be200f03e
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/Terminator.h
@@ -0,0 +1,13 @@
+/* -*- C++ -*- $Id$ */
+
+#include "ace/Task_T.h"
+
+class Terminator : public ACE_Task<ACE_MT_SYNCH>
+{
+ public:
+
+ virtual int open(void*);
+
+ virtual int svc();
+};
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/client.conf b/TAO/orbsvcs/tests/ImplRepo/RestartServer/client.conf
new file mode 100644
index 00000000000..409ad4afe86
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/client.conf
@@ -0,0 +1,3 @@
+# $Id$
+
+static Client_Strategy_Factory "-ORBForwardOnTransientLimit 20"
diff --git a/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl
new file mode 100755
index 00000000000..cc398aa4f03
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/RestartServer/run_test.pl
@@ -0,0 +1,245 @@
+# $Id$
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $extra_timeout = 45;
+
+my $c1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $imr = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $act = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $ti = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+my $si = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
+my $sdn = PerlACE::TestTarget::create_target (7) || die "Create target 7 failed\n";
+
+my $implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_locator";
+my $imr_activator = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_activator";
+my $tao_imr = "$ENV{ACE_ROOT}/bin/tao_imr";
+
+$implrepo_ior = "implrepo.ior";
+$activator_ior = "activator.ior";
+$messenger_ior = "Messenger.ior";
+
+# Use client strategy factory for one of retry parameters.
+$c1_conf = "client.conf";
+
+my $imr_imriorfile = $imr->LocalFile ($implrepo_ior);
+my $act_imriorfile = $act->LocalFile ($implrepo_ior);
+my $ti_imriorfile = $ti->LocalFile ($implrepo_ior);
+my $si_imriorfile = $si->LocalFile ($implrepo_ior);
+my $sdn_imriorfile = $sdn->LocalFile ($implrepo_ior);
+my $act_actiorfile = $act->LocalFile ($activator_ior);
+my $imr_srviorfile = $imr->LocalFile ($messenger_ior);
+my $c1_srviorfile = $c1->LocalFile ($messenger_ior);
+my $c1_conffile = $c1->LocalFile ($c1_conf);
+my $si_srviorfile = $si->LocalFile ($messenger_ior);
+
+# Make sure the files are gone, so we can wait on them.
+$imr->DeleteFile ($implrepo_ior);
+$act->DeleteFile ($implrepo_ior);
+$ti->DeleteFile ($implrepo_ior);
+$si->DeleteFile ($implrepo_ior);
+$sdn->DeleteFile ($implrepo_ior);
+$act->DeleteFile ($activator_ior);
+$imr->DeleteFile ($messenger_ior);
+$c1->DeleteFile ($messenger_ior);
+$si->DeleteFile ($messenger_ior);
+
+# Note : We don't actually use SVR, but we need a way to get the
+# path to the -ExeSubDir
+$SVR = $imr->CreateProcess ("MessengerServer", "-ORBdebuglevel $debug_level");
+my $server = $SVR->Executable ();
+my $srv_server = $imr->LocalFile ($server);
+
+$IR = $imr->CreateProcess ($implrepo_server, "-d 1 ".
+ "orbobjrefstyle url ".
+ "-t 5 ".
+ "-o $imr_imriorfile");
+print ">>> " . $IR->CommandLine() . "\n";
+
+$ACT = $act->CreateProcess ($imr_activator, "-d 1 ".
+ "orbobjrefstyle url ".
+ "-o $act_actiorfile ".
+ "-ORBInitRef ImplRepoService=file://$act_imriorfile");
+
+$TI = $ti->CreateProcess ($tao_imr, "-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "add MessengerService ".
+ "-c \"$srv_server -orbobjrefstyle url -ORBUseIMR 1 -ORBInitRef ImplRepoService=file://$imr_imriorfile\" ");
+
+
+
+$SI = $si->CreateProcess ($tao_imr, "-ORBInitRef ImplRepoService=file://$si_imriorfile ".
+ "ior MessengerService ".
+ "-f $si_srviorfile ");
+
+$C1 = $c1->CreateProcess ("MessengerClient", "-k file://$c1_srviorfile ".
+ "-ORBForwardOnReplyClosedLimit 20 -ORBForwardDelay 500 ".
+ "-ORBSvcConf $c1_conffile -ORBdebuglevel $debug_level");
+
+$SDN = $sdn->CreateProcess ("$tao_imr", "-ORBInitRef ImplRepoService=file://$sdn_imriorfile ".
+ "shutdown MessengerService");
+
+
+$IR_status = $IR->Spawn ();
+
+if ($IR_status != 0) {
+ print STDERR "ERROR: ImplRepo Service returned $IR_status\n";
+ exit 1;
+}
+
+if ($imr->WaitForFileTimed ($implrepo_ior,$imr->ProcessStartWaitInterval() + $extra_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$imr_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+
+if ($imr->GetFile ($implrepo_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$imr_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+if ($act->PutFile ($implrepo_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$act_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+if ($ti->PutFile ($implrepo_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$ti_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+if ($si->PutFile ($implrepo_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$si_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+if ($sdn->PutFile ($implrepo_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$sdn_imriorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ exit 1;
+}
+
+print ">>> " . $ACT->CommandLine() . "\n";
+$ACT_status = $ACT->Spawn ();
+
+if ($ACT_status != 0) {
+ print STDERR "ERROR: ImR_Activator returned $ACT_status\n";
+ exit 1;
+}
+
+if ($act->WaitForFileTimed ($activator_ior,$act->ProcessStartWaitInterval() + $extra_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$act_actiorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+print ">>> " . $TI->CommandLine() . "\n";
+# We want the tao_imr executable to be found exactly in the path
+# given, without being modified by the value of -ExeSubDir.
+# So, we tell its Process object to ignore the setting of -ExeSubDir.
+
+$TI->IgnoreExeSubDir (1);
+
+$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval() + $extra_timeout);
+
+if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr returned $TI_status\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+print ">>> " . $SI->CommandLine() . "\n";
+$SI->IgnoreExeSubDir (1);
+
+
+$SI_status = $SI->SpawnWaitKill ($si->ProcessStartWaitInterval() + $extra_timeout);
+
+if ($SI_status != 0) {
+ print STDERR "ERROR: tao_imr returned $SI_status\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+if ($si->WaitForFileTimed ($messenger_ior,$si->ProcessStartWaitInterval() + $extra_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$si_srviorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+if ($si->GetFile ($messenger_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$si_srviorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+if ($c1->PutFile ($messenger_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$c1_srviorfile>\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+
+print ">>> " . $C1->CommandLine() . "\n";
+$C1_status = $C1->SpawnWaitKill ($c1->ProcessStartWaitInterval() + $extra_timeout);
+
+if ($C1_status != 0) {
+ print STDERR "ERROR: Client1 returned $C1_status\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+$SDN->IgnoreExeSubDir (1);
+$SDN_status = $SDN->SpawnWaitKill ($sdn->ProcessStartWaitInterval() + $extra_timeout);
+
+if ($SDN_status != 0) {
+ print STDERR "ERROR: Shutdown returned $SDN_status\n";
+ $IR->Kill (); $IR->TimedWait (1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ exit 1;
+}
+
+
+$IR_status = $IR->TerminateWaitKill ($imr->ProcessStopWaitInterval() + $extra_timeout);
+
+if ($IR_status != 0) {
+ print STDERR "ERROR: ImplRepo Server returned $IR_status\n";
+ $status = 1;
+}
+
+$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval() + $extra_timeout);
+
+if ($ACT_status != 0) {
+ print STDERR "ERROR: ImR_Activator returned $ACT_status\n";
+ $status = 1;
+}
+
+$imr->DeleteFile ($implrepo_ior);
+$act->DeleteFile ($implrepo_ior);
+$ti->DeleteFile ($implrepo_ior);
+$si->DeleteFile ($implrepo_ior);
+$sdn->DeleteFile ($implrepo_ior);
+$act->DeleteFile ($activator_ior);
+$imr->DeleteFile ($messenger_ior);
+$c1->DeleteFile ($messenger_ior);
+$si->DeleteFile ($messenger_ior);
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp
index 58dd5d3959e..873ec9dde5e 100644
--- a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp
@@ -17,7 +17,8 @@ const char SERVER_NAME[] = "airplane_server";
Airplane_Server_i::Airplane_Server_i (void)
: server_impl_ (0),
- ior_output_file_ (0)
+ ior_output_file_ (0),
+ server_name_(SERVER_NAME)
{
// Nothing
}
@@ -25,7 +26,7 @@ Airplane_Server_i::Airplane_Server_i (void)
int
Airplane_Server_i::parse_args (void)
{
- ACE_Get_Opt get_opts (this->argc_, this->argv_, ACE_TEXT("do:"));
+ ACE_Get_Opt get_opts (this->argc_, this->argv_, ACE_TEXT("do:s:"));
int c;
while ((c = get_opts ()) != -1)
@@ -41,12 +42,16 @@ Airplane_Server_i::parse_args (void)
"Unable to open %s for writing: %p\n",
get_opts.opt_arg ()), -1);
break;
+ case 's': // extension to the server name.
+ this->server_name_ = get_opts.opt_arg ();
+ break;
case '?': // display help for use of the server.
default:
ACE_ERROR_RETURN ((LM_ERROR,
"usage: %s"
" [-d]"
- " [-o] <ior_output_file>"
+ " [-o <ior_output_file>]"
+ " [-s <the server name>]"
"\n",
argv_ [0]),
1);
@@ -59,10 +64,6 @@ Airplane_Server_i::parse_args (void)
int
Airplane_Server_i::init (int argc, ACE_TCHAR** argv)
{
- // 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;
-
try
{
// Initialize the ORB
@@ -101,10 +102,12 @@ Airplane_Server_i::init (int argc, ACE_TCHAR** argv)
policies[1] =
this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT);
+ // Since the Implementation Repository keys off of the POA name, we need
+ // to use the server_name_ as the POA's name.
this->airplane_poa_ =
- this->root_poa_->create_POA (poa_name,
- this->poa_manager_.in (),
- policies);
+ this->root_poa_->create_POA (this->server_name_.c_str(),
+ this->poa_manager_.in (),
+ policies);
// Creation of the new POA is over, so destroy the Policy_ptr's.
for (CORBA::ULong i = 0; i < policies.length (); ++i)
@@ -142,7 +145,7 @@ Airplane_Server_i::init (int argc, ACE_TCHAR** argv)
IORTable::Table_var adapter =
IORTable::Table::_narrow (obj.in ());
ACE_ASSERT(! CORBA::is_nil (adapter.in ()));
- adapter->bind (poa_name, plain_ior.in ());
+ adapter->bind (this->server_name_.c_str(), plain_ior.in ());
this->poa_manager_->activate ();
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h
index c3ffc51f973..1be339107b6 100644
--- a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h
@@ -70,6 +70,9 @@ private:
/// File where the IOR of the server object is stored.
FILE *ior_output_file_;
+
+ /// the server name
+ ACE_CString server_name_;
};
#endif /* AIRPLANE_SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
index 318943a5fc9..ba8b88d9d83 100755
--- a/TAO/orbsvcs/tests/ImplRepo/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
@@ -13,34 +13,46 @@ use PerlACE::TestTarget;
use File::Copy;
$debug_level = '0';
+my $num_srvr = 1;
+my $all_tests = 0;
foreach $i (@ARGV) {
if ($i eq '-debug') {
$debug_level = '10';
}
+ elsif ($i eq '-servers') {
+ $num_srvr = 3;
+ }
+ elsif ($i eq '-all') {
+ $all_tests = 1;
+ }
}
-my $imr = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
-my $act = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
-my $ti = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
-my $a_srv = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
-my $a_cli = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
-my $n_srv = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
-my $n_cli = PerlACE::TestTarget::create_target (7) || die "Create target 7 failed\n";
-my $p_srv = PerlACE::TestTarget::create_target (8) || die "Create target 8 failed\n";
-my $bin_imr = PerlACE::TestTarget::create_target (9) || die "Create target 9 failed\n";
-my $bin_act = PerlACE::TestTarget::create_target (10) || die "Create target 10 failed\n";
+my $tgt_num = 0;
+my $imr = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $act = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $ti = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $n_srv = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $n_cli = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $bin_imr = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my $bin_act = PerlACE::TestTarget::create_target (++$tgt_num) || die "Create target $tgt_num failed\n";
+my @a_cli;
+my @a_srv;
+my @p_srv;
+my $index;
+for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@a_cli, PerlACE::TestTarget::create_target (++$tgt_num)) || die "Create a_cli target $tgt_num failed\n";
+ push(@a_srv, PerlACE::TestTarget::create_target (++$tgt_num)) || die "Create a_srv target $tgt_num failed\n";
+ push(@p_srv, PerlACE::TestTarget::create_target (++$tgt_num)) || die "Create p_srv target $tgt_num failed\n";
+}
$imr->AddLibPath ("$ENV{ACE_ROOT}/lib");
my $imriorfile = "imr_locator.ior";
my $actiorfile = "imr_activator.ior";
-my $airplaneiorfile = "airplane.ior";
my $nesteaiorfile = "nestea.ior";
-my $backing_store = "imr_backing_store.xml";
my $nestea_dat = "nestea.dat";
-my $a_cli_airplaneiorfile = $a_cli->LocalFile ($airplaneiorfile);
my $n_cli_nesteaiorfile = $n_cli->LocalFile ($nesteaiorfile);
my $refstyle = " -ORBObjRefStyle URL";
@@ -59,79 +71,119 @@ $TI = $ti->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_imr");
$TI->IgnoreExeSubDir (1);
+my @airplaneiorfile;
+my @a_cli_airplaneiorfile;
+for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@airplaneiorfile, "airplane$index.ior");
+ push(@a_cli_airplaneiorfile, $a_cli[$index]->LocalFile ($airplaneiorfile[$index]));
+}
+
sub create_acli {
- return $a_cli->CreateProcess ("airplane_client", " -k file://$a_cli_airplaneiorfile ");
+ my $select = shift;
+ return $a_cli[$select]->CreateProcess ("airplane_client", " -k file://$a_cli_airplaneiorfile[$select] ");
}
sub create_ncli {
return $n_cli->CreateProcess ("nestea_client", " -k file://$n_cli_nesteaiorfile ");
}
-my $A_SRV = $a_srv->CreateProcess ("airplane_server");
-my $A_CLI = create_acli();
-my $N_SRV = $a_cli->CreateProcess ("nestea_server");
-my $N_CLI = create_ncli();
-my $P_SRV = $p_srv->CreateProcess ("persist server");
+my @A_SRV;
+my @a_srv_name;
+my @A_SRV_cmd;
+my @imr_A_SRV_cmd;
+my @P_SRV;
+my @P_SRV_cmd;
+my @imr_P_SRV_cmd;
+for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@a_srv_name, "airplane_server$index");
+ push(@A_SRV, $a_srv[$index]->CreateProcess ("airplane_server"));
+ my $p_srv_name = "persist server$index";
+ push(@P_SRV, $p_srv[$index]->CreateProcess ($p_srv_name));
+
+ push(@A_SRV_cmd, $A_SRV[$index]->Executable());
+ push(@imr_A_SRV_cmd, $imr->LocalFile ($A_SRV_cmd[$index]));
+ push(@P_SRV_cmd, $P_SRV[$index]->Executable());
+ push(@imr_P_SRV_cmd, $imr->LocalFile ($P_SRV_cmd[$index]));
+}
-my $A_SRV_cmd = $A_SRV->Executable();
-my $imr_A_SRV_cmd = $imr->LocalFile ($A_SRV_cmd);
+my @A_CLI;
+for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@A_CLI, create_acli($index));
+}
+my $N_SRV = $a_cli[0]->CreateProcess ("nestea_server");
+my $N_CLI = create_ncli();
my $N_SRV_cmd = $N_SRV->Executable();
my $imr_N_SRV_cmd = $imr->LocalFile ($N_SRV_cmd);
-my $P_SRV_cmd = $P_SRV->Executable();
-my $imr_P_SRV_cmd = $imr->LocalFile ($P_SRV_cmd);
-
# The Tests
###############################################################################
+sub kill_then_timed_wait
+{
+ my $srvrs = shift;
+ my $time = shift;
+ my $length = scalar(@{$srvrs});
+ for ($index = 0; $index < $length; ++$index) {
+ $srvrs->[$index]->Kill (); $srvrs->[$index]->TimedWait (1);
+ }
+}
+
sub airplane_test
{
my $status = 0;
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
-
- $A_SRV->Arguments ("-o $a_srv_airplaneiorfile $refstyle -ORBDebugLevel $debug_level");
- $A_SRV_status = $A_SRV->Spawn ();
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- return 1;
- }
- if ($a_srv->WaitForFileTimed ($airplaneiorfile,$a_srv->ProcessStartWaitInterval()) == -1) {
- print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- return 1;
- }
- if ($a_srv->GetFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- return 1;
- }
- if ($a_cli->PutFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- return 1;
- }
-
-#$A_CLI = $a_cli->CreateProcess ("airplane_client", " -k file://$a_cli_airplaneiorfile");
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval());
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client returned $A_CLI_status\n";
- $status = 1;
+ my @a_srv_airplaneiorfile;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@a_srv_airplaneiorfile, $a_srv[$index]->LocalFile ($airplaneiorfile[$index]));
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
+
+ $A_SRV[$index]->Arguments ("-o $a_srv_airplaneiorfile[$index] $refstyle -ORBDebugLevel $debug_level -s $a_srv_name[$index]");
+ $A_SRV_status = $A_SRV[$index]->Spawn ();
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->WaitForFileTimed ($airplaneiorfile[$index],$a_srv[$index]->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ return 1;
+ }
+ if ($a_srv[$index]->GetFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ return 1;
+ }
+ if ($a_cli[$index]->PutFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_CLI_status = $A_CLI[$index]->SpawnWaitKill ($a_cli[$index]->ProcessStartWaitInterval());
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client returned $A_CLI_status\n";
+ $status = 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_SRV_status = $A_SRV[$index]->TerminateWaitKill ($a_srv[$index]->ProcessStopWaitInterval());
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ $status = 1;
+ }
+
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
}
-
- $A_SRV_status = $A_SRV->TerminateWaitKill ($a_srv->ProcessStopWaitInterval());
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- $status = 1;
- }
-
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
-
return $status;
}
@@ -189,7 +241,7 @@ sub nt_service_test_i
{
my ($imr_initref, $BIN_ACT, $BIN_IMR) = @_;
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
+ my $a_srv_airplaneiorfile = $a_srv[0]->LocalFile ($airplaneiorfile[0]);
print "Installing TAO ImR Services\n";
$BIN_ACT->Arguments ("-c install $imr_initref -d 0 -ORBDebugLevel $debug_level");
@@ -214,11 +266,11 @@ sub nt_service_test_i
system("net start taoimractivator 2>&1");
# No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
- $TI->Arguments ("$imr_initref add airplane_server -c \"$imr_A_SRV_cmd\" ".
+ $TI->Arguments ("$imr_initref add $a_srv_name[0] -c \"$imr_A_SRV_cmd[0] -s $a_srv_name[0]\" ".
"-w \"$ENV{ACE_ROOT}/lib\"");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr add airplane_server returned $TI_status\n";
+ print STDERR "ERROR: tao_imr add $a_srv_name[0] returned $TI_status\n";
return 1;
}
@@ -229,40 +281,40 @@ sub nt_service_test_i
return 1;
}
- $TI->Arguments ("$imr_initref ior airplane_server -f $a_srv_airplaneiorfile");
+ $TI->Arguments ("$imr_initref ior $a_srv_name[0] -f $a_srv_airplaneiorfile");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr ior airplane_server returned $TI_status\n";
+ print STDERR "ERROR: tao_imr ior $a_srv_name[0] returned $TI_status\n";
return 1;
}
- if ($a_srv->WaitForFileTimed ($airplaneiorfile,$a_srv->ProcessStartWaitInterval()) == -1) {
+ if ($a_srv[0]->WaitForFileTimed ($airplaneiorfile[0],$a_srv[0]->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
return 1;
}
- if ($a_srv->GetFile ($airplaneiorfile) == -1) {
+ if ($a_srv[0]->GetFile ($airplaneiorfile[0]) == -1) {
print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
return 1;
}
- if ($a_cli->PutFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ if ($a_cli[0]->PutFile ($airplaneiorfile[0]) == -1) {
+ print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
return 1;
}
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval()+5);
+ $A_CLI_status = $A_CLI[0]->SpawnWaitKill ($a_cli[0]->ProcessStartWaitInterval()+5);
if ($A_CLI_status != 0) {
print STDERR "ERROR: airplane client returned $A_CLI_status\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
return 1;
}
- $TI->Arguments ("$imr_initref shutdown airplane_server");
+ $TI->Arguments ("$imr_initref shutdown $a_srv_name[0]");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval()+5);
if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr shutdown airplane_server returned $TI_status\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ print STDERR "ERROR: tao_imr shutdown $a_srv_name[0] returned $TI_status\n";
+ kill_then_timed_wait(\@A_SRV, 1);
return 1;
}
@@ -273,9 +325,9 @@ sub nt_service_test
{
my $result = 0;
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
+ my $a_srv_airplaneiorfile = $a_srv[0]->LocalFile ($airplaneiorfile[0]);
+ $a_srv[0]->DeleteFile ($airplaneiorfile[0]);
+ $a_cli[0]->DeleteFile ($airplaneiorfile[0]);
my $bin_imr_host = $bin_imr->HostName ();
@@ -335,8 +387,8 @@ sub nt_service_test
$bin_imr->DeleteFile ($BIN_IMR->Executable ());
$bin_act->DeleteFile ($BIN_ACT->Executable ());
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
+ $a_srv[0]->DeleteFile ($airplaneiorfile[0]);
+ $a_cli[0]->DeleteFile ($airplaneiorfile[0]);
return $result;
}
@@ -350,18 +402,24 @@ sub airplane_ir_test
my $imr_imriorfile = $imr->LocalFile ($imriorfile);
my $act_imriorfile = $act->LocalFile ($imriorfile);
my $ti_imriorfile = $ti->LocalFile ($imriorfile);
- my $a_srv_imriorfile = $a_srv->LocalFile ($imriorfile);
my $act_actiorfile = $act->LocalFile ($actiorfile);
- my $imr_airplaneiorfile = $imr->LocalFile ($airplaneiorfile);
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
+
+ my @a_srv_imriorfile;
+ my @imr_airplaneiorfile;
+ my @a_srv_airplaneiorfile;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@a_srv_imriorfile, $a_srv[$index]->LocalFile ($imriorfile));
+ push(@imr_airplaneiorfile, $imr->LocalFile ($airplaneiorfile[$index]));
+ push(@a_srv_airplaneiorfile, $a_srv[$index]->LocalFile ($airplaneiorfile[$index]));
+ $a_srv[$index]->DeleteFile ($imriorfile);
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $imr->DeleteFile ($airplaneiorfile[$index]);
+ }
$imr->DeleteFile ($imriorfile);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $imr->DeleteFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
$IMR->Arguments ("-d 2 -o $imr_imriorfile $refstyle");
$IMR_status = $IMR->Spawn ();
@@ -389,10 +447,12 @@ sub airplane_ir_test
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->PutFile ($imriorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_srv_imriorfile>\n";
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->PutFile ($imriorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$a_srv_imriorfile[$index]>\n";
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
}
$ACT->Arguments ("-d 2 -o $act_actiorfile -ORBInitRef ImplRepoService=file://$act_imriorfile");
@@ -410,77 +470,108 @@ sub airplane_ir_test
# No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
# Can use update to add servers.
- $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
- "update airplane_server -c \"$imr_A_SRV_cmd -o $imr_airplaneiorfile\"");
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr returned $TI_status\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $A_SRV->Arguments ("-ORBUseIMR 1 -o $a_srv_airplaneiorfile ".
- "-ORBInitRef ImplRepoService=file://$a_srv_imriorfile ".
- "-ORBDebugLevel $debug_level");
- $A_SRV_status = $A_SRV->Spawn ();
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- return 1;
- }
- if ($a_srv->WaitForFileTimed ($airplaneiorfile,$a_srv->ProcessStartWaitInterval()) == -1) {
- print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
- if ($a_srv->GetFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
- if ($a_cli->PutFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval());
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client 1 returned $A_CLI_status\n";
- $status = 1;
- }
-
- $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile shutdown airplane_server");
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "update $a_srv_name[$index] -c \"$imr_A_SRV_cmd[$index] -o $imr_airplaneiorfile[$index] -s $a_srv_name[$index]\"");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr returned $TI_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+
+ $A_SRV[$index]->Arguments ("-ORBUseIMR 1 -o $a_srv_airplaneiorfile[$index] ".
+ "-ORBInitRef ImplRepoService=file://$a_srv_imriorfile[$index] ".
+ "-ORBDebugLevel $debug_level -s $a_srv_name[$index] ");
+ $A_SRV_status = $A_SRV[$index]->Spawn ();
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->WaitForFileTimed ($airplaneiorfile[$index],$a_srv[$index]->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ if ($a_srv[$index]->GetFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ if ($a_cli[$index]->PutFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_CLI_status = $A_CLI[$index]->Spawn ();
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client $index failed to spawn returning $A_CLI_status\n";
+ $status = 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_CLI_status = $A_CLI[$index]->WaitKill ($a_cli[$index]->ProcessStartWaitInterval());
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client $index returned $A_CLI_status\n";
+ $status = 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile shutdown $a_srv_name[$index]");
+
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr 1 ($index) returned $TI_status\n";
+ $status = 1;
+ }
+ }
+
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile list");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr 1 returned $TI_status\n";
+ print STDERR "ERROR: tao_imr list returned $TI_status\n";
$status = 1;
}
- # This client should force a new airplane_server to be started
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval());
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client 2 returned $A_CLI_status\n";
- $status = 1;
- }
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # This client should force a new airplane_server to be started
+ $A_CLI_status = $A_CLI[$index]->SpawnWaitKill ($a_cli[$index]->ProcessStartWaitInterval());
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: restarted Airplane Client $index returned $A_CLI_status\n";
+ $status = 1;
+ }
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr 2 returned $TI_status\n";
- $status = 1;
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile shutdown $a_srv_name[$index]");
+
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr 2 ($index) returned $TI_status\n";
+ $status = 1;
+ }
}
- $A_SRV_status = $A_SRV->WaitKill ($a_srv->ProcessStopWaitInterval());
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- $status = 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_SRV_status = $A_SRV[$index]->WaitKill ($a_srv[$index]->ProcessStopWaitInterval());
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ $status = 1;
+ }
}
$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval());
@@ -498,12 +589,13 @@ sub airplane_ir_test
$imr->DeleteFile ($imriorfile);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $imr->DeleteFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
-
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $imr->DeleteFile ($airplaneiorfile[$index]);
+ $a_srv[$index]->DeleteFile ($imriorfile);
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
+ }
return $status;
}
@@ -805,14 +897,14 @@ sub perclient
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($n_cli->WaitForFileTimed ($nesteaiorfile,$a_cli->ProcessStartWaitInterval()) == -1) {
+ if ($n_cli->WaitForFileTimed ($nesteaiorfile,$a_cli[0]->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$a_cli_nesteaiorfile>\n";
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- $a_cli->DeleteFile ($nesteaiorfile);
+ $a_cli[0]->DeleteFile ($nesteaiorfile);
$N_CLI->Arguments("-s -k corbaloc::$imr_host:8888/nestea_server");
@@ -824,7 +916,7 @@ sub perclient
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($n_cli->WaitForFileTimed ($nesteaiorfile,$a_cli->ProcessStartWaitInterval()) == -1) {
+ if ($n_cli->WaitForFileTimed ($nesteaiorfile,$a_cli[0]->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$a_cli_nesteaiorfile>\n";
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
@@ -993,29 +1085,47 @@ sub shutdown_repo
sub persistent_ir_test
{
+ my $backing_store_flag = shift;
my $status = 0;
+ my $backing_store;
+ if ($backing_store_flag eq "-p") {
+ $backing_store = "test.repo";
+ } elsif ($backing_store_flag eq "-y") {
+ $backing_store = ".";
+ } elsif ($backing_store_flag eq "-x") {
+ $backing_store = "imr_backing_store.xml";
+ }
+
my $imr_imriorfile = $imr->LocalFile ($imriorfile);
my $imr_storefile = $imr->LocalFile ($backing_store);
my $act_imriorfile = $act->LocalFile ($imriorfile);
my $ti_imriorfile = $ti->LocalFile ($imriorfile);
- my $a_srv_imriorfile = $a_srv->LocalFile ($imriorfile);
my $act_actiorfile = $act->LocalFile ($actiorfile);
- my $imr_airplaneiorfile = $imr->LocalFile ($airplaneiorfile);
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
+
+ my @a_srv_imriorfile;
+ my @imr_airplaneiorfile;
+ my @a_srv_airplaneiorfile;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ push(@a_srv_imriorfile, $a_srv[$index]->LocalFile ($imriorfile));
+ push(@imr_airplaneiorfile, $imr->LocalFile ($airplaneiorfile[$index]));
+ push(@a_srv_airplaneiorfile, $a_srv[$index]->LocalFile ($airplaneiorfile[$index]));
+ $a_srv[$index]->DeleteFile ($imriorfile);
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $imr->DeleteFile ($airplaneiorfile[$index]);
+ }
$imr->DeleteFile ($imriorfile);
- $imr->DeleteFile ($backing_store);
+ # passing "-e" flag to clear persistent storage on startup
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $imr->DeleteFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
## Be sure to start the ImR on a consistent endpoint, so that any created IORs
## remain valid even if the ImR restarts.
- $IMR->Arguments ("-orbendpoint iiop://:8888 -x $imr_storefile -d 2 -o $imr_imriorfile $refstyle");
+ my $imr_arguments = "-orbendpoint iiop://:8888 $backing_store_flag $backing_store -d 2 -o $imr_imriorfile $refstyle ";
+ $IMR->Arguments ("$imr_arguments -e ");
+ print STDERR "" . $IMR->CommandLine() . "\n";
$IMR_status = $IMR->Spawn ();
if ($IMR_status != 0) {
print STDERR "ERROR: ImR Service returned $IMR_status\n";
@@ -1041,10 +1151,13 @@ sub persistent_ir_test
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->PutFile ($imriorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_srv_imriorfile>\n";
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->PutFile ($imriorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$a_srv_imriorfile[$index]>\n";
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
}
$ACT->Arguments ("-d 2 -o $act_actiorfile -ORBInitRef ImplRepoService=file://$act_imriorfile");
@@ -1053,6 +1166,7 @@ sub persistent_ir_test
print STDERR "ERROR: ImR Activator returned $ACT_status\n";
return 1;
}
+
if ($act->WaitForFileTimed ($actiorfile,$act->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$act_actiorfile>\n";
$ACT->Kill (); $ACT->TimedWait (1);
@@ -1066,117 +1180,168 @@ sub persistent_ir_test
return 1;
}
- $p_srv->DeleteFile ($P_SRV_cmd);
- # Copy the server to a path with spaces to ensure that these
- # work corrrectly.
- copy ($A_SRV_cmd, $P_SRV_cmd);
- chmod(0755, $P_SRV_cmd);
-
- # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
- $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
- "add airplane_server -c \"\\\"$imr_P_SRV_cmd\\\" $refstyle\"");
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr returned $TI_status\n";
- $p_srv->DeleteFile ($P_SRV_cmd);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- ## 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_SRV->Arguments ("-o $a_srv_airplaneiorfile -ORBUseIMR 1 $refstyle ".
- "-ORBInitRef ImplRepoService=file://$a_srv_imriorfile ".
- "-ORBDebugLevel $debug_level");
- $A_SRV_status = $A_SRV->Spawn ();
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- return 1;
- }
- if ($a_srv->WaitForFileTimed ($airplaneiorfile,$a_srv->ProcessStartWaitInterval()) == -1) {
- print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
- if ($a_srv->GetFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
- if ($a_cli->PutFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval());
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client returned $A_CLI_status\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
- "shutdown airplane_server");
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr shutdown returned $TI_status\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $A_SRV_status = $A_SRV->WaitKill ($a_srv->ProcessStartWaitInterval());
- if ($A_SRV_status != 0) {
- print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- # Should cause the activator to spawn another server.
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval());
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client 2 returned $A_CLI_status\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- # Shutdown airplane_server
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr shutdown 2 returned $TI_status\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
- }
-
- $IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
- if ($IMR_status != 0) {
- print STDERR "ERROR: ImR returned $IMR_status\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- return 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $p_srv[$index]->DeleteFile ($P_SRV_cmd[$index]);
+ # Copy the server to a path with spaces to ensure that these
+ # work corrrectly.
+ copy ($A_SRV_cmd[$index], $P_SRV_cmd[$index]);
+ chmod(0755, $P_SRV_cmd[$index]);
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "add $a_srv_name[$index] -c \"\\\"$imr_P_SRV_cmd[$index]\\\" $refstyle -s $a_srv_name[$index]\"");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr ($index) returned $TI_status\n";
+ $p_srv[$index]->DeleteFile ($P_SRV_cmd[$index]);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ ## 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_SRV[$index]->Arguments ("-o $a_srv_airplaneiorfile[$index] -ORBUseIMR 1 $refstyle ".
+ "-ORBInitRef ImplRepoService=file://$a_srv_imriorfile[$index] ".
+ "-ORBDebugLevel $debug_level -s $a_srv_name[$index]");
+ $A_SRV_status = $A_SRV[$index]->Spawn ();
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->WaitForFileTimed ($airplaneiorfile[$index],$a_srv[$index]->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ if ($a_srv[$index]->GetFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ if ($a_cli[$index]->PutFile ($airplaneiorfile[$index]) == -1) {
+ print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_CLI_status = $A_CLI[$index]->Spawn ();
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client ($index) failed to spawn returning $A_CLI_status\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_CLI_status = $A_CLI[$index]->WaitKill ($a_cli[$index]->ProcessStartWaitInterval());
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client ($index) returned $A_CLI_status\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "shutdown $a_srv_name[$index]");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr shutdown returned $TI_status\n";
+ kill_then_timed_wait(\@A_SRV, 1);
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $A_SRV_status = $A_SRV[$index]->WaitKill ($a_srv[$index]->ProcessStartWaitInterval());
+ if ($A_SRV_status != 0) {
+ print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Should cause the activator to spawn another server.
+ $A_CLI_status = $A_CLI[$index]->Spawn ();
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client 2 ($index) failed to spawn returning $A_CLI_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Should cause the activator to spawn another server.
+ $A_CLI_status = $A_CLI[$index]->WaitKill ($a_cli[$index]->ProcessStartWaitInterval());
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client 2 ($index) returned $A_CLI_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Shutdown airplane_server
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "shutdown $a_srv_name[$index]");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr shutdown 2 ($index) returned $TI_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
+ if ($IMR_status != 0) {
+ print STDERR "ERROR: ImR returned $IMR_status\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ return 1;
+ }
}
# Unlink so that we can wait on them again to know the server started.
$imr->DeleteFile ($imriorfile);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $a_srv[$index]->DeleteFile ($imriorfile);
+ }
+
print "Restarting Implementation Repository.\n";
+ $IMR->Arguments ("$imr_arguments ");
+ print STDERR "" . $IMR->CommandLine() . "\n";
$IMR_status = $IMR->Spawn ();
if ($IMR_status != 0) {
print STDERR "ERROR: ImR Service returned $IMR_status\n";
@@ -1207,31 +1372,51 @@ sub persistent_ir_test
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->PutFile ($imriorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_srv_imriorfile>\n";
- $ACT->Kill (); $ACT->TimedWait (1);
- $IMR->Kill (); $IMR->TimedWait (1);
- return 1;
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ if ($a_srv[$index]->PutFile ($imriorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$a_srv_imriorfile[$index]>\n";
+ $ACT->Kill (); $ACT->TimedWait (1);
+ $IMR->Kill (); $IMR->TimedWait (1);
+ return 1;
+ }
}
- # Should cause the activator to spawn another server.
- $A_CLI_status = $A_CLI->SpawnWaitKill ($a_cli->ProcessStartWaitInterval()+5);
- if ($A_CLI_status != 0) {
- print STDERR "ERROR: Airplane Client 3 returned $A_CLI_status\n";
- $status = 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Should cause the activator to spawn another server.
+ $A_CLI_status = $A_CLI[$index]->Spawn ();
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client 3 ($index) failed to spawn returning $A_CLI_status\n";
+ $status = 1;
+ }
}
- # Shutdown airplane_server
- $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
- if ($TI_status != 0) {
- print STDERR "ERROR: tao_imr shutdown 3 returned $TI_status\n";
- $status = 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Should cause the activator to spawn another server.
+ $A_CLI_status = $A_CLI[$index]->WaitKill ($a_cli[$index]->ProcessStartWaitInterval()+5);
+ if ($A_CLI_status != 0) {
+ print STDERR "ERROR: Airplane Client 3 ($index) returned $A_CLI_status\n";
+ $status = 1;
+ }
}
- $ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval());
- if ($ACT_status != 0) {
- print STDERR "ERROR: Activator returned $ACT_status\n";
- $status = 1;
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ # Shutdown airplane_server
+ $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
+ "shutdown $a_srv_name[$index]");
+ $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
+ if ($TI_status != 0) {
+ print STDERR "ERROR: tao_imr shutdown 3 returned $TI_status\n";
+ $status = 1;
+ }
+ }
+
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval());
+ if ($ACT_status != 0) {
+ print STDERR "ERROR: Activator returned $ACT_status\n";
+ $status = 1;
+ }
}
$IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
@@ -1240,16 +1425,31 @@ sub persistent_ir_test
$status = 1;
}
+ if ($backing_store =~ /\.xml$/) {
+ $imr->DeleteFile ($backing_store);
+ }
+ else {
+ my @backing_store_files;
+ push(@backing_store_files, "imr_listing.xml");
+ if (open FILE, "<imr_listing.xml") {
+ while (<FILE>) {
+ $imr->DeleteFile ($1) if ($_ =~ /fname="([^"]+)"?/);
+ }
+ close FILE;
+ }
+ $imr->DeleteFile ("./imr_listing.xml");
+ }
$imr->DeleteFile ($imriorfile);
- $imr->DeleteFile ($backing_store);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $imr->DeleteFile ($airplaneiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
- $p_srv->DeleteFile ($P_SRV_cmd);
+ for ($index = 0; $index < $num_srvr; ++$index) {
+ $imr->DeleteFile ($airplaneiorfile[$index]);
+ $a_srv[$index]->DeleteFile ($imriorfile);
+ $a_srv[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $a_cli[$index]->DeleteFile ($airplaneiorfile[$index]);
+ $p_srv[$index]->DeleteFile ($P_SRV_cmd[$index]);
+ }
return $status;
}
@@ -1263,20 +1463,20 @@ sub both_ir_test
my $imr_imriorfile = $imr->LocalFile ($imriorfile);
my $act_imriorfile = $act->LocalFile ($imriorfile);
my $ti_imriorfile = $ti->LocalFile ($imriorfile);
- my $a_srv_imriorfile = $a_srv->LocalFile ($imriorfile);
+ my $a_srv_imriorfile = $a_srv[0]->LocalFile ($imriorfile);
my $n_srv_imriorfile = $n_srv->LocalFile ($imriorfile);
my $act_actiorfile = $act->LocalFile ($actiorfile);
- my $a_srv_airplaneiorfile = $a_srv->LocalFile ($airplaneiorfile);
+ my $a_srv_airplaneiorfile = $a_srv[0]->LocalFile ($airplaneiorfile[0]);
my $n_srv_nesteaiorfile = $n_srv->LocalFile ($nesteaiorfile);
my $n_cli_nesteaiorfile = $n_cli->LocalFile ($nesteaiorfile);
$imr->DeleteFile ($imriorfile);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
+ $a_srv[0]->DeleteFile ($imriorfile);
$n_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
+ $a_srv[0]->DeleteFile ($airplaneiorfile[0]);
+ $a_cli[0]->DeleteFile ($airplaneiorfile[0]);
$n_srv->DeleteFile ($nesteaiorfile);
$n_cli->DeleteFile ($nesteaiorfile);
@@ -1306,7 +1506,7 @@ sub both_ir_test
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->PutFile ($imriorfile) == -1) {
+ if ($a_srv[0]->PutFile ($imriorfile) == -1) {
print STDERR "ERROR: cannot set file <$a_srv_imriorfile>\n";
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
@@ -1349,7 +1549,7 @@ sub both_ir_test
# No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
$TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
- "add airplane_server -c \"$imr_A_SRV_cmd $refstyle\"");
+ "add $a_srv_name[0] -c \"$imr_A_SRV_cmd[0] $refstyle -s $a_srv_name[0]\"");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
print STDERR "ERROR: tao_imr returned $TI_status\n";
@@ -1392,38 +1592,38 @@ sub both_ir_test
return 1;
}
- $A_SRV->Arguments (" -o $a_srv_airplaneiorfile -ORBUseIMR 1 ".
+ $A_SRV[0]->Arguments (" -o $a_srv_airplaneiorfile -ORBUseIMR 1 ".
"-ORBInitRef ImplRepoService=file://$n_srv_imriorfile ".
"$refstyle ".
- "-ORBDebugLevel $debug_level");
- $A_SRV_status = $A_SRV->Spawn ();
+ "-ORBDebugLevel $debug_level -s $a_srv_name[0]");
+ $A_SRV_status = $A_SRV[0]->Spawn ();
if ($A_SRV_status != 0) {
print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
$N_SRV->Kill (); $N_SRV->TimedWait (1);
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->WaitForFileTimed ($airplaneiorfile,$a_srv->ProcessStartWaitInterval()) == -1) {
+ if ($a_srv[0]->WaitForFileTimed ($airplaneiorfile[0],$a_srv[0]->ProcessStartWaitInterval()) == -1) {
print STDERR "ERROR: cannot find file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
$N_SRV->Kill (); $N_SRV->TimedWait (1);
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_srv->GetFile ($airplaneiorfile) == -1) {
+ if ($a_srv[0]->GetFile ($airplaneiorfile[0]) == -1) {
print STDERR "ERROR: cannot retrieve file <$a_srv_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ kill_then_timed_wait(\@A_SRV, 1);
$N_SRV->Kill (); $N_SRV->TimedWait (1);
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
return 1;
}
- if ($a_cli->PutFile ($airplaneiorfile) == -1) {
- print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile>\n";
- $A_SRV->Kill (); $A_SRV->TimedWait (1);
+ if ($a_cli[0]->PutFile ($airplaneiorfile[0]) == -1) {
+ print STDERR "ERROR: cannot set file <$a_cli_airplaneiorfile[$index]>\n";
+ kill_then_timed_wait(\@A_SRV, 1);
$N_SRV->Kill (); $N_SRV->TimedWait (1);
$ACT->Kill (); $ACT->TimedWait (1);
$IMR->Kill (); $IMR->TimedWait (1);
@@ -1441,7 +1641,7 @@ sub both_ir_test
print "\n## Spawning multiple simultaneous clients with both servers running.\n";
map $_->Spawn(), @a_clients;
map $_->Spawn(), @n_clients;
- map $_->WaitKill($a_cli->ProcessStopWaitInterval()), @a_clients;
+ map $_->WaitKill($a_cli[0]->ProcessStopWaitInterval()), @a_clients;
map $_->WaitKill($n_cli->ProcessStopWaitInterval()), @n_clients;
$TI->Arguments ("-ORBInitRef ImplRepoService=file://$n_srv_imriorfile ".
@@ -1453,14 +1653,14 @@ sub both_ir_test
}
$TI->Arguments ("-ORBInitRef ImplRepoService=file://$n_srv_imriorfile ".
- "shutdown airplane_server");
+ "shutdown $a_srv_name[0]");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
print STDERR "ERROR: tao_imr returned $TI_status\n";
$status = 1;
}
- $A_SRV_status = $A_SRV->WaitKill ($a_srv->ProcessStopWaitInterval());
+ $A_SRV_status = $A_SRV[0]->WaitKill ($a_srv[0]->ProcessStopWaitInterval());
if ($A_SRV_status != 0) {
print STDERR "ERROR: Airplane Server returned $A_SRV_status\n";
$status = 1;
@@ -1475,7 +1675,7 @@ sub both_ir_test
map $_->Spawn(), @a_clients;
map $_->Spawn(), @n_clients;
- map $_->WaitKill($a_cli->ProcessStopWaitInterval()), @a_clients;
+ map $_->WaitKill($a_cli[0]->ProcessStopWaitInterval()), @a_clients;
map $_->WaitKill($n_cli->ProcessStopWaitInterval()), @n_clients;
$TI->Arguments ("-ORBInitRef ImplRepoService=file://$n_srv_imriorfile ".
@@ -1487,7 +1687,7 @@ sub both_ir_test
}
$TI->Arguments ("-ORBInitRef ImplRepoService=file://$n_srv_imriorfile ".
- "shutdown airplane_server");
+ "shutdown $a_srv_name[0]");
$TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
if ($TI_status != 0) {
print STDERR "ERROR: tao_imr returned $TI_status\n";
@@ -1509,11 +1709,11 @@ sub both_ir_test
$imr->DeleteFile ($imriorfile);
$act->DeleteFile ($imriorfile);
$ti->DeleteFile ($imriorfile);
- $a_srv->DeleteFile ($imriorfile);
+ $a_srv[0]->DeleteFile ($imriorfile);
$n_srv->DeleteFile ($imriorfile);
$act->DeleteFile ($actiorfile);
- $a_srv->DeleteFile ($airplaneiorfile);
- $a_cli->DeleteFile ($airplaneiorfile);
+ $a_srv[0]->DeleteFile ($airplaneiorfile[0]);
+ $a_cli[0]->DeleteFile ($airplaneiorfile[0]);
$n_srv->DeleteFile ($nesteaiorfile);
$n_cli->DeleteFile ($nesteaiorfile);
@@ -1526,16 +1726,39 @@ sub both_ir_test
# Parse the arguments
my $ret = 0;
+my $test_num = 0;
+
+my @tests = ("airplane", "airplane_ir", "nt_service_ir", "nestea", "nestea_ir",
+ "both_ir", "persistent_ir", "persistent_ir_hash", "persistent_ir_shared");
+
+my $i;
+if ($all_tests) {
+ push(@ARGV, @tests);
+}
if ($#ARGV >= 0) {
-for (my $i = 0; $i <= $#ARGV; $i++) {
+for ($i = 0; $i <= $#ARGV; $i++) {
if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
- print "run_test test\n";
+ print "run_test [options] test\n";
print "\n";
+ print "options \n";
+ print " -debug -- set debug_level to 10\n";
+ print " -all -- causes all tests to run\n";
+ print " -servers -- run tests with more than 1 server and client\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";
+ my $indent = " ";
+ print "$indent";
+ my $count = 0;
+ foreach my $test (@tests) {
+ if (++$count > 1) {
+ print ",";
+ }
+ if ($count % 4 == 0) {
+ print "\n$indent";
+ }
+ print "$test"
+ }
+ print "\n";
exit 1;
}
elsif ($ARGV[$i] eq "airplane") {
@@ -1557,7 +1780,13 @@ for (my $i = 0; $i <= $#ARGV; $i++) {
$ret = both_ir_test ();
}
elsif ($ARGV[$i] eq "persistent_ir") {
- $ret = persistent_ir_test ();
+ $ret = persistent_ir_test ("-x");
+ }
+ elsif ($ARGV[$i] eq "persistent_ir_hash") {
+ $ret = persistent_ir_test ("-p");
+ }
+ elsif ($ARGV[$i] eq "persistent_ir_shared") {
+ $ret = persistent_ir_test ("-y");
}
elsif ($ARGV[$i] eq "perclient") {
$ret = perclient();
@@ -1565,7 +1794,7 @@ for (my $i = 0; $i <= $#ARGV; $i++) {
elsif ($ARGV[$i] eq "shutdown") {
$ret = shutdown_repo();
}
- else {
+ elsif ($ARGV[$i] !~ /^-/) {
print "run_test: Unknown Option: ".$ARGV[$i]."\n";
}
}
diff --git a/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp
index 6f590f1bdef..5fc7d89a1f8 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_2926_Regression/server.cpp
@@ -9,20 +9,18 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug2926",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_CosNotification_Serv",
- TAO_VERSION,
"_make_TAO_CosNotify_Service",
""
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp
index 452fe3b43b7..7d3320078be 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3252_Regression/server.cpp
@@ -12,20 +12,18 @@
#include "DllOrb.h"
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"Bug_3252",
- TAO_VERSION,
"_make_DllOrb",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -NumThreads 2 -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_CosNotification_Serv",
- TAO_VERSION,
"_make_TAO_CosNotify_Service",
"-UseSeparateDispatchingORB 1"
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp
index 2f5932b870c..d25ac609f5a 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp
@@ -9,20 +9,18 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3646b",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_Notify_Service",
- TAO_VERSION,
"_make_TAO_Notify_Service_Driver",
"-NoNameSvc -RunThreads 0"
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp
index faf35b8fc10..e1f8cf2af79 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp
@@ -12,20 +12,18 @@ char const * const scpc_orbId = "testDllOrb";
const int max_length = 1000;
-ACE_TCHAR scpc_loadOrb[max_length] = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR scpc_loadOrb[max_length] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3646c",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1 -ORBInitRef NameService=iioploc://%s:%s/NameService"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR scpc_loadNotifyService[max_length] = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR scpc_loadNotifyService[max_length] = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_Notify_Service",
- TAO_VERSION,
"_make_TAO_Notify_Service_Driver",
"-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 0 -ORBInitRef NameService=iioploc://%s:%s/NameService -IORoutput %s"
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp
index 92c0813c661..8a922af1a48 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp
@@ -9,30 +9,27 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3646d",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1 -ORBInitRef NameService=file://naming.ior"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_Notify_Service",
- TAO_VERSION,
"_make_TAO_Notify_Service_Driver",
"-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 10 -ORBInitRef NameService=file://naming.ior -IORoutput notify.ior"
);
ACE_TCHAR const * const scpc_unloadNotifyService = ACE_REMOVE_SERVICE_DIRECTIVE("testNotifyService");
-ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNamingService",
"TAO_CosNaming_Serv",
- TAO_VERSION,
"_make_TAO_Naming_Loader",
"testNameService testNameService -ORBId testDllOrb -m 0 -o naming.ior"
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp
index 209cdb31747..6434be8a632 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp
@@ -9,20 +9,18 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3663",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_Notify_Service",
- TAO_VERSION,
"_make_TAO_Notify_Service_Driver_INCORRECT",
"-NoNameSvc -RunThreads 0"
);
diff --git a/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp b/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp
index e5bc65f9de8..e0e602895c2 100644
--- a/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp
@@ -13,20 +13,18 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug3688",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1 -ORBInitRef NameService=file://naming.ior"
);
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNamingService",
"TAO_CosNaming_Serv",
- TAO_VERSION,
"_make_TAO_Naming_Loader",
"testNameService testNameService -ORBId testDllOrb -m 0 -o naming.ior"
);
@@ -34,10 +32,9 @@ ACE_TCHAR const * const scpc_loadNameService = ACE_DYNAMIC_VERSIONED_SERVICE_DIR
ACE_TCHAR const * const scpc_unloadNameService = ACE_REMOVE_SERVICE_DIRECTIVE("testNamingService");
-ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadNotifyService = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testNotifyService",
"TAO_Notify_Service",
- TAO_VERSION,
"_make_TAO_Notify_Service_Driver",
"-Channel -ChannelName Channel1 -ChannelName Channel2 -RunThreads 1 -ORBInitRef NameService=file://naming.ior -IORoutput notify.ior"
);
diff --git a/TAO/orbsvcs/tests/Simple_Naming/client.cpp b/TAO/orbsvcs/tests/Simple_Naming/client.cpp
index d8996e15ceb..4f73d86fe94 100644
--- a/TAO/orbsvcs/tests/Simple_Naming/client.cpp
+++ b/TAO/orbsvcs/tests/Simple_Naming/client.cpp
@@ -915,7 +915,9 @@ Iterator_Test::execute (TAO_Naming_Client &root_context)
|| bindings_list->length () != 1
|| bindings_list[0u].binding_type != CosNaming::nobject)
ACE_ERROR_RETURN ((LM_ERROR,
- "CosNaming::list does not function properly\n"),
+ "Iterator_Test -> CosNaming::list does not function properly. \
+Should have returned one CosNaming::nobject element in bindings_list. Length = %d, \
+Binding Type = %d\n", bindings_list->length (), bindings_list[0u].binding_type),
-1);
ACE_DEBUG ((LM_DEBUG,
"First binding: %C\n",
@@ -1214,7 +1216,7 @@ Persistent_List_Test::execute (TAO_Naming_Client &root_context)
if (CORBA::is_nil (iter.in ())
|| bindings_list->length () != 0)
ACE_ERROR_RETURN ((LM_ERROR,
- "CosNaming::list does not function properly\n"),
+ "Persistent_List_Test -> CosNaming::list does not function properly. Should have returned an iterator.\n"),
-1);
while (iter->next_one (binding.out ()))
@@ -1270,7 +1272,7 @@ Persistent_List_Test::execute (TAO_Naming_Client &root_context)
if (CORBA::is_nil (iter.in ())
|| bindings_list->length () != 0)
ACE_ERROR_RETURN ((LM_ERROR,
- "CosNaming::list does not function properly\n"),
+ "Persistent_List_Test -> CosNaming::list does not function properly. Should have returned an iterator.\n"),
-1);
while (iter->next_one (binding.out ()))
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
index 5ef2c750ed4..df18c6ccee3 100755
--- a/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
@@ -37,6 +37,7 @@ $persistent_ior_file = "pns.ior";
my $test_iorfile = $test->LocalFile ($iorfile);
my $test_persistent_ior_file = $test->LocalFile ($persistent_ior_file);
+my $prog = "../../Naming_Service/tao_cosnaming";
$test->DeleteFile($iorfile);
$test->DeleteFile($persistent_ior_file);
@@ -44,7 +45,7 @@ $test->DeleteFile($persistent_ior_file);
sub name_server
{
my $args = "-ORBNameServicePort $ns_multicast_port -o $test_iorfile -m 1 @_";
- my $prog = "../../Naming_Service/tao_cosnaming";
+
$SV = $test->CreateProcess ("$prog", "$args");
@@ -95,14 +96,50 @@ $hostname = $test->HostName ();
"Flat File Persistent Test (Part 2): \n",
"Flat File Persistent Test (Part 3): \n");
-$test_number = 0;
-$test->DeleteFile($test_persistent_ior_file);
+sub run_test
+{
+ $prog = "@_";
+
+ $test_number = 0;
+
+ $test->DeleteFile($test_persistent_ior_file);
+
+ if ( ! -d "NameService" ) {
+ mkdir (NameService, 0777);
+ }
+ else {
+ chdir "NameService";
+ opendir(THISDIR, ".");
+ @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+ closedir(THISDIR);
+ foreach $tmp (@allfiles){
+ $test->DeleteFile ($tmp);
+ }
+ 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);
+
+ $SV->Kill ();
+
+ ## For some reason, only on Windows XP, we need to
+ ## wait before starting another tao_cosnaming when
+ ## the mmap persistence option is used
+ if ($^O eq "MSWin32") {
+ sleep(1);
+ }
+
+ $test_number++;
+ }
-if ( ! -d "NameService" ) {
- mkdir (NameService, 0777);
-}
-else {
chdir "NameService";
opendir(THISDIR, ".");
@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
@@ -111,40 +148,19 @@ else {
$test->DeleteFile ($tmp);
}
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];
+ rmdir "NameService";
- client ($o);
-
- $SV->Kill ();
-
- ## For some reason, only on Windows XP, we need to
- ## wait before starting another tao_cosnaming when
- ## the mmap persistence option is used
- if ($^O eq "MSWin32") {
- sleep(1);
- }
-
- $test_number++;
+ $test->DeleteFile($persistent_ior_file);
+ $test->DeleteFile($iorfile);
}
-chdir "NameService";
-opendir(THISDIR, ".");
-@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
-closedir(THISDIR);
-foreach $tmp (@allfiles){
- $test->DeleteFile ($tmp);
-}
-chdir "..";
-rmdir "NameService";
+@server_exes = ("../../Naming_Service/tao_cosnaming",
+ "../../Naming_Service/tao_ft_naming");
-$test->DeleteFile($persistent_ior_file);
-$test->DeleteFile($iorfile);
+foreach $e (@server_exes) {
+ print STDERR "Testing Naming Service Executable: $e\n";
+ run_test($e);
+ print STDERR "======================================\n";
+}
exit $status;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test_ft.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test_ft.pl
new file mode 100755
index 00000000000..37d6ec95f46
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test_ft.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 -*-
+
+# This is a Perl script that runs some Naming Service tests
+# for the FT_Naming_Service.
+# It runs all the tests that will run with min CORBA.
+# It starts all the servers and clients as necessary.
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+use Cwd;
+
+## Save the starting directory
+$status = 0;
+$multicast = '224.9.9.2';
+$startdir = getcwd();
+
+$quiet = 0;
+
+# check for -q flag
+if ($ARGV[0] eq '-q') {
+ $quiet = 1;
+}
+
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_multicast_port = 10001 + $test->RandomPort(); # Can not be 10000 on Chorus 4.0
+
+$iorfile = "ns.ior";
+$persistent_ior_file = "pns.ior";
+$persistent_log_file = "test_log";
+
+$data_file = "test_run.data";
+
+## 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;
+ }
+ }
+}
+
+$test_log = $test->LocalFile ($data_file);
+$test->DeleteFile ($data_file);
+
+#Files which used by test
+my $test_iorfile = $test->LocalFile ($iorfile);
+my $test_persistent_log_file = $test->LocalFile ($persistent_log_file);
+my $test_persistent_ior_file = $test->LocalFile ($persistent_ior_file);
+
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($iorfile);
+$test->DeleteFile($persistent_log_file);
+
+sub name_server
+{
+ my $args = "-u NameService -ORBMulticastDiscoveryEndpoint $multicast:$ns_multicast_port -o $test_iorfile -m 1 @_";
+ my $prog = "$startdir/../../Naming_Service/tao_ft_naming";
+
+ $SV = $test->CreateProcess ("$prog", "$args");
+
+ $test->DeleteFile($iorfile);
+
+ $SV->Spawn ();
+
+ if ($test->WaitForFileTimed ($iorfile,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ sleep(10);
+}
+
+sub client
+{
+ my $args = "@_"." ";
+ my $prog = "$startdir/client";
+
+ $CL = $test->CreateProcess ("$prog", "$args");
+
+ $client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
+
+ if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+ }
+
+}
+
+sub make_or_clean_state
+{
+ # Create a directory to hold the persistent state
+ if ( ! -d "NameService" ) {
+ mkdir (NameService, 0777);
+ }
+ else {
+ chdir "NameService";
+ opendir(THISDIR, ".");
+ @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+ closedir(THISDIR);
+ foreach $tmp (@allfiles){
+ $test->DeleteFile ($tmp);
+ }
+ chdir "..";
+ }
+}
+
+## 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://$test_iorfile",
+ "-s -ORBInitRef NameService=mcast://$multicast:$ns_multicast_port\::/NameService",
+ "-t -ORBInitRef NameService=file://$test_iorfile",
+ "-i -ORBInitRef NameService=file://$test_iorfile",
+ "-e -ORBInitRef NameService=file://$test_iorfile",
+ "-y -ORBInitRef NameService=file://$test_iorfile"
+ );
+
+@server_opts = ("-t 30",
+ "",
+ "",
+ "",
+ "",
+ ""
+ );
+
+@comments = ("Simple Test: \n",
+ "Simple Test (using multicast to locate the server): \n",
+ "Tree Test: \n",
+ "Iterator Test: \n",
+ "Exceptions Test: \n",
+ "Destroy Test: \n"
+ );
+
+$test_number = 0;
+
+print "INFO: Running the test in ", getcwd(), "\n";
+
+# Run server and client for each of the tests. Client uses ior in a
+# file to bootstrap to the server.
+foreach $o (@opts) {
+
+ # Ensure that the name service is starting clean each time
+ make_or_clean_state;
+
+ print STDERR "Running Test: $comments[$test_number]\n";
+
+ name_server ($server_opts[$test_number]);
+
+ client ($o);
+
+ $SV->Kill ();
+
+ ## For some reason, only on Windows XP, we need to
+ ## wait before starting another tao_cosnaming when
+ ## the mmap persistence option is used
+ if ($^O eq "MSWin32") {
+ sleep(1);
+ }
+ $test_number++;
+}
+
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($persistent_log_file);
+$test->DeleteFile($iorfile);
+
+# Now run the multithreaded test, sending output to the file.
+print STDERR "\n Multithreaded Test:\n";
+$test->DeleteFile ($data_file);
+
+name_server ();
+client ("-ORBInitRef NameService=file://$test_iorfile -ORBLogFile $test_log", "-m15");
+
+$SV->Kill ();
+
+$errors = system ("perl $startdir/process-m-output.pl $test_log 15") >> 8;
+
+if ($errors > 0) {
+ $status = 1;
+
+ if (!$quiet) {
+ print STDERR "Errors Detected, printing output\n";
+ if (open (DATA, "<$test_log")) {
+ print STDERR "================================= Begin\n";
+ print STDERR <DATA>;
+ print STDERR "================================= End\n";
+ close (DATA);
+ }
+ else {
+ print STDERR "ERROR: Could not open $test_log\n";
+ }
+ $test->DeleteFile ($data_file);
+ }
+}
+
+$test->DeleteFile($iorfile);
+# Remove the persistence directory
+rmdir "NameService";
+
+
+exit $status;
diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
index 4022a2dab9d..52fecbd4e45 100644
--- a/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp
@@ -120,7 +120,8 @@ TAO::TypeCode::Alias<StringType,
{
TAO_TypeCodeFactory_Adapter * const adapter =
ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
- TAO_ORB_Core::typecodefactory_adapter_name ());
+ TAO_ORB_Core::typecodefactory_adapter_name ()
+ );
if (adapter == 0)
{
diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
index cb2787562b7..931e668c137 100644
--- a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp
@@ -99,11 +99,13 @@ TAO::TypeCode::Alias<char const *,
CORBA::TypeCode_ptr
TAO::TypeCode::Alias<char const *,
CORBA::TypeCode_ptr const *,
- TAO::Null_RefCount_Policy>::get_compact_typecode_i (void) const
+ TAO::Null_RefCount_Policy>::get_compact_typecode_i (
+ void) const
{
TAO_TypeCodeFactory_Adapter * const adapter =
ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
- TAO_ORB_Core::typecodefactory_adapter_name ());
+ TAO_ORB_Core::typecodefactory_adapter_name ()
+ );
if (adapter == 0)
{
diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp b/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp
index d38ad4e2cbd..3860c6fb999 100644
--- a/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp
+++ b/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp
@@ -82,7 +82,8 @@ TAO::TypeCode::Objref<StringType,
{
TAO_TypeCodeFactory_Adapter * const adapter =
ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
- TAO_ORB_Core::typecodefactory_adapter_name ());
+ TAO_ORB_Core::typecodefactory_adapter_name ()
+ );
if (adapter == 0)
{
diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp
index 87b3398b374..d716a0d4f2e 100644
--- a/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp
+++ b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp
@@ -72,11 +72,13 @@ TAO::TypeCode::Objref<char const *, TAO::Null_RefCount_Policy>::equivalent_i (
CORBA::TypeCode_ptr
TAO::TypeCode::Objref<char const *,
- TAO::Null_RefCount_Policy>::get_compact_typecode_i (void) const
+ TAO::Null_RefCount_Policy>::get_compact_typecode_i (
+ void) const
{
TAO_TypeCodeFactory_Adapter * const adapter =
ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
- TAO_ORB_Core::typecodefactory_adapter_name ());
+ TAO_ORB_Core::typecodefactory_adapter_name ()
+ );
if (adapter == 0)
{
diff --git a/TAO/tao/Any_Insert_Policy_T.h b/TAO/tao/Any_Insert_Policy_T.h
index 393e50ede71..0745821d7cb 100644
--- a/TAO/tao/Any_Insert_Policy_T.h
+++ b/TAO/tao/Any_Insert_Policy_T.h
@@ -54,7 +54,8 @@ namespace TAO
{
TAO_AnyTypeCode_Adapter *adapter =
ACE_Dynamic_Service<TAO_AnyTypeCode_Adapter>::instance (
- "AnyTypeCode_Adapter");
+ "AnyTypeCode_Adapter"
+ );
if (adapter)
{
@@ -78,7 +79,8 @@ namespace TAO
{
TAO_IFR_Client_Adapter *adapter =
ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
- "Concrete_IFR_Client_Adapter");
+ "Concrete_IFR_Client_Adapter"
+ );
adapter->interfacedef_any_insert (p, x);
}
diff --git a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
index 62f9d46786c..46e6b8d1d65 100644
--- a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
+++ b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
@@ -4,10 +4,6 @@
#include "tao/CSD_Framework/CSD_Framework_Loader.h"
#include "tao/CSD_Framework/CSD_Object_Adapter_Factory.h"
#include "tao/CSD_Framework/CSD_Strategy_Repository.h"
-#include "tao/CSD_Framework/CSD_ORBInitializer.h"
-#include "tao/PI/DLL_Resident_ORB_Initializer.h"
-#include "tao/ORBInitializer_Registry.h"
-#include "tao/ORB_Core.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -24,12 +20,8 @@ TAO_CSD_Framework_Loader::~TAO_CSD_Framework_Loader (void)
int
TAO_CSD_Framework_Loader::static_init (void)
{
- ACE_Service_Config::process_directive
- (ace_svc_desc_TAO_CSD_Object_Adapter_Factory);
-
- ACE_Service_Config::process_directive
- (ace_svc_desc_TAO_CSD_Strategy_Repository);
-
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_CSD_Object_Adapter_Factory);
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_CSD_Strategy_Repository);
ACE_Service_Config::process_directive (ace_svc_desc_TAO_CSD_Framework_Loader);
return 0;
@@ -46,50 +38,6 @@ TAO_CSD_Framework_Loader::init (int, ACE_TCHAR* [])
this->initialized_ = true;
- // Register the ORB initializer.
- try
- {
- PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
- PortableInterceptor::ORBInitializer::_nil ();
-
- /// Register the CSD ORBInitializer.
- ACE_NEW_THROW_EX (temp_orb_initializer,
- TAO_CSD_ORBInitializer,
- CORBA::NO_MEMORY (
- CORBA::SystemException::_tao_minor_code (
- TAO::VMCID,
- ENOMEM),
- CORBA::COMPLETED_NO));
-
- PortableInterceptor::ORBInitializer_var orb_initializer;
- orb_initializer = temp_orb_initializer;
-
- PortableInterceptor::ORBInitializer_ptr temp_dll_initializer =
- PortableInterceptor::ORBInitializer::_nil ();
-
- ACE_NEW_THROW_EX (temp_dll_initializer,
- PortableInterceptor::DLL_Resident_ORB_Initializer(
- orb_initializer.in (),
- ACE_TEXT ("TAO_CSD_ThreadPool")),
- CORBA::NO_MEMORY (
- CORBA::SystemException::_tao_minor_code (
- TAO::VMCID,
- ENOMEM),
- CORBA::COMPLETED_NO));
-
- PortableInterceptor::ORBInitializer_var dll_initializer;
- dll_initializer = temp_dll_initializer;
-
- PortableInterceptor::register_orb_initializer (dll_initializer.in ());
- }
- catch (const ::CORBA::Exception& ex)
- {
- ex._tao_print_exception (
- "Unexpected exception caught while "
- "initializing the CSD Framework");
- return 1;
- }
-
return 0;
}
diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
index 142da69b110..bd92317f7ed 100644
--- a/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
+++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
@@ -8,10 +8,9 @@
#include "tao/debug.h"
static const ACE_TCHAR csd_poa_factory_directive[] =
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
"TAO_CSD_Object_Adapter_Factory",
"TAO_CSD_Framework",
- TAO_VERSION,
"_make_TAO_CSD_Object_Adapter_Factory",
"");
diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.h b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h
index 1b8570ca311..d82a8c5d8c6 100644
--- a/TAO/tao/CSD_Framework/CSD_ORBInitializer.h
+++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h
@@ -36,7 +36,7 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-class TAO_CSD_ORBInitializer
+class TAO_CSD_FW_Export TAO_CSD_ORBInitializer
: public virtual PortableInterceptor::ORBInitializer
, public virtual ::CORBA::LocalObject
{
diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp
index a1e7be7af59..21ddd602ef6 100644
--- a/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp
+++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.cpp
@@ -34,103 +34,90 @@ TAO::CSD::TP_Strategy_Factory::init (int argc,
initialized = 1;
TAO_CSD_Strategy_Repository *repo =
- ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance ("TAO_CSD_Strategy_Repository");
-
- if (repo != 0)
- repo->init(0,0);
+ ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
+ ("TAO_CSD_Strategy_Repository");
+
+ if (repo == 0)
+ {
+ TAO_CSD_ThreadPool::init ();
+ repo = ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
+ ("TAO_CSD_Strategy_Repository");
+ }
+
+ if (repo == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - TP_Strategy_Factory - ")
+ ACE_TEXT ("cannot initialize strategy repo\n")));
+ }
+ return -1;
+ }
+
+ repo->init(0,0);
// Parse any service configurator parameters.
for (int curarg = 0; curarg < argc; curarg++)
- if (ACE_OS::strcasecmp (argv[curarg],
- ACE_TEXT("-CSDtp")) == 0)
- {
- ACE_CString poa_name;
- unsigned long num_threads = 1;
- bool serialize_servants = true;
-
- curarg++;
- if (curarg < argc)
- {
- // Parse the parameter
- ACE_CString arg ((const char *)argv[curarg]);
- ACE_CString::size_type pos = arg.find (':');
-
- if (pos == ACE_CString::npos)
- {
- poa_name = arg;
- }
- else
- {
- poa_name = arg.substr (0, pos);
-
- ACE_CString arg_remainder =
- arg.substr (pos + 1, arg.length () - pos);
-
- ACE_CString num_thread_str;
-
- pos = arg_remainder.find (':');
-
- if (pos == ACE_CString::npos)
- {
- num_thread_str = arg_remainder;
- }
- else
- {
- num_thread_str = arg_remainder.substr (0, pos);
-
- ACE_CString off_str =
- arg_remainder.substr (pos + 1, arg.length () - pos);
-
- // Case-insensitive string comparison.
- if (ACE_OS::strcasecmp (off_str.c_str(), "OFF") == 0)
- {
- serialize_servants = false;
- }
- }
-
- num_threads = ACE_OS::strtoul (num_thread_str.c_str (), 0, 10);
-
- if (num_threads == 0)
- {
- // Minimum of 1 thread required.
- num_threads = 1;
- }
- }
-
- // Create the ThreadPool strategy for each named poa.
- TP_Strategy* strategy = 0;
- ACE_NEW_RETURN (strategy,
- TP_Strategy (num_threads, serialize_servants),
- -1);
- CSD_Framework::Strategy_var objref = strategy;
-
- TAO_CSD_Strategy_Repository *repo =
- ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
- ("TAO_CSD_Strategy_Repository");
-
- if (repo == 0)
- {
- TAO_CSD_ThreadPool::init ();
- repo = ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance (
- "TAO_CSD_Strategy_Repository"
- );
- }
-
-
- repo->add_strategy (poa_name, strategy);
- }
- }
- else
- {
- if (TAO_debug_level > 0)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT("CSD_ORB_Loader: Unknown option ")
- ACE_TEXT("<%s>.\n"),
- argv[curarg]));
- }
- }
-
+ {
+ if (ACE_OS::strcasecmp (argv[curarg],
+ ACE_TEXT("-CSDtp")) == 0)
+ {
+ ACE_CString poa_name;
+ unsigned long num_threads = 1;
+ bool serialize_servants = true;
+
+ curarg++;
+ if (curarg >= argc)
+ {
+ return -1;
+ }
+
+ // Parse the parameter
+ ACE_TCHAR *sep = ACE_OS::strchr (argv[curarg],':');
+ if (sep == 0)
+ {
+ poa_name = ACE_TEXT_ALWAYS_CHAR (argv[curarg]);
+ }
+ else
+ {
+ *sep = 0;
+ poa_name = ACE_TEXT_ALWAYS_CHAR (argv[curarg]);
+ num_threads = ACE_OS::strtol (sep + 1, &sep, 10);
+ if (*sep != 0 && *sep != ':')
+ {
+ return -1;
+ }
+ if (*sep == ':')
+ {
+ if (ACE_OS::strcasecmp (sep + 1, "OFF") == 0)
+ {
+ serialize_servants = false;
+ }
+ }
+ }
+
+ // Create the ThreadPool strategy for each named poa.
+ TP_Strategy* strategy = 0;
+ ACE_NEW_RETURN (strategy,
+ TP_Strategy (num_threads, serialize_servants),
+ -1);
+ CSD_Framework::Strategy_var objref = strategy;
+ repo->add_strategy (poa_name, strategy);
+
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("CSD_ORB_Loader: Unknown option ")
+ ACE_TEXT("<%s>.\n"),
+ argv[curarg]));
+ }
+ return -1;
+ }
+ }
return 0;
}
diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp
index c96a65eccb6..a64feb59e52 100644
--- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp
+++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.cpp
@@ -45,11 +45,11 @@ TAO::CSD::TP_Task::add_request(TP_Request* request)
int
-TAO::CSD::TP_Task::open(void* num_threads_ptr)
+TAO::CSD::TP_Task::open(void* args)
{
Thread_Counter num = 1;
- Thread_Counter* tmp = static_cast<Thread_Counter*> (num_threads_ptr);
+ Thread_Counter* tmp = static_cast<Thread_Counter*> (args);
if (tmp == 0)
{
diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h
index fea7b2ecc4e..ce5c4b705c6 100644
--- a/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h
+++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Task.h
@@ -89,7 +89,7 @@ namespace TAO
bool add_request(TP_Request* request);
/// Activate the worker threads
- virtual int open(void* num_threads_ptr = 0);
+ virtual int open(void* args = 0);
/// The "mainline" executed by each worker thread.
virtual int svc();
diff --git a/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.cpp b/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.cpp
index 6b83baebc12..a4356408f4b 100644
--- a/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.cpp
+++ b/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.cpp
@@ -6,6 +6,12 @@
#include "tao/debug.h"
#include "ace/Dynamic_Service.h"
+#include "tao/CSD_Framework/CSD_ORBInitializer.h"
+#include "tao/PI/DLL_Resident_ORB_Initializer.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "tao/ORB_Core.h"
+
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
int
@@ -17,6 +23,52 @@ TAO_CSD_ThreadPool::init (void)
initialized = 1;
TAO_CSD_Framework_Loader::static_init();
+
+ // Register the ORB initializer.
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ /// Register the CSD ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ TAO_CSD_ORBInitializer,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::ORBInitializer_ptr temp_dll_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ ACE_NEW_THROW_EX (temp_dll_initializer,
+ PortableInterceptor::DLL_Resident_ORB_Initializer(
+ orb_initializer.in (),
+ ACE_TEXT ("TAO_CSD_ThreadPool")),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ PortableInterceptor::ORBInitializer_var dll_initializer;
+ dll_initializer = temp_dll_initializer;
+
+ PortableInterceptor::register_orb_initializer (dll_initializer.in ());
+ }
+ catch (const ::CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "Unexpected exception caught while "
+ "initializing the CSD Framework");
+ return 1;
+ }
+
+
return ACE_Service_Config::process_directive (ace_svc_desc_TAO_CSD_TP_Strategy_Factory);
}
diff --git a/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.h b/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.h
index 82a5f082ee4..8b22f1a1b2c 100644
--- a/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.h
+++ b/TAO/tao/CSD_ThreadPool/CSD_ThreadPool.h
@@ -17,8 +17,6 @@
#include "tao/CSD_ThreadPool/CSD_TP_Export.h"
#include "tao/Versioned_Namespace.h"
-#include "ace/Service_Object.h"
-#include "ace/Service_Config.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
@@ -28,11 +26,13 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
/**
- * @class TP_Strategy_Factory
+ * @class TAO_CSD_ThreadPool
*
- * @brief An ACE_Service_Object capable of creating TP_Strategy objects.
+ * @brief the static initializer for the CSD Thread Pool library
*
- * TBD - Explain in more detail.
+ * The loader appears to be born of the CSD_TP_Factory, which is the
+ * real service object. This separation seems to be necesary to ensure
+ * the CSD_Framework gets loaded prior to initializing the TP Factory.
*
*/
class TAO_CSD_TP_Export TAO_CSD_ThreadPool
diff --git a/TAO/tao/Cache_Entries_T.h b/TAO/tao/Cache_Entries_T.h
index 76d41160432..7ff66c64f85 100644
--- a/TAO/tao/Cache_Entries_T.h
+++ b/TAO/tao/Cache_Entries_T.h
@@ -194,7 +194,7 @@ namespace TAO
transport_descriptor_type *transport_property_;
/// Do we need to delete transport_property?
- bool is_delete_;
+ CORBA::Boolean is_delete_;
/**
* This is a supplementary index. Would be set to zero by
diff --git a/TAO/tao/Client_Strategy_Factory.h b/TAO/tao/Client_Strategy_Factory.h
index ece676673ea..4ccdc1543f6 100644
--- a/TAO/tao/Client_Strategy_Factory.h
+++ b/TAO/tao/Client_Strategy_Factory.h
@@ -32,6 +32,11 @@ ACE_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace TAO
+{
+ struct Invocation_Retry_Params;
+}
+
class TAO_Transport_Mux_Strategy;
class TAO_Wait_Strategy;
class TAO_Transport;
@@ -84,6 +89,11 @@ public:
* Only applicable to RW wait strategy
*/
virtual bool use_cleanup_options (void) const = 0;
+
+ /// Return the parameters used to optionally retry invocation
+ /// after an exception occurs.
+ virtual const TAO::Invocation_Retry_Params &invocation_retry_params (void) const = 0;
+
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Codeset/Codeset_Manager_i.cpp b/TAO/tao/Codeset/Codeset_Manager_i.cpp
index 1264a62973e..a7be918442f 100644
--- a/TAO/tao/Codeset/Codeset_Manager_i.cpp
+++ b/TAO/tao/Codeset/Codeset_Manager_i.cpp
@@ -352,9 +352,8 @@ TAO_Codeset_Manager_i::open(TAO_ORB_Core& core)
instance ("UTF8_Latin1_Factory");
if (fact == 0)
ACE_Service_Config::process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE ("UTF8_Latin1_Factory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE ("UTF8_Latin1_Factory",
"TAO_Codeset",
- TAO_VERSION,
"_make_TAO_UTF8_Latin1_Factory",
""));
else
@@ -370,9 +369,8 @@ TAO_Codeset_Manager_i::open(TAO_ORB_Core& core)
instance ("UTF16_BOM_Factory");
if (fact == 0)
ACE_Service_Config::process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE ("UTF16_BOM_Factory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE ("UTF16_BOM_Factory",
"TAO_Codeset",
- TAO_VERSION,
"_make_TAO_UTF16_BOM_Factory",
""));
else
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP.mpc b/TAO/tao/Dynamic_TP/Dynamic_TP.mpc
new file mode 100644
index 00000000000..764cc76884b
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP.mpc
@@ -0,0 +1,10 @@
+//$Id$
+
+project(Dynamic_TP) : taolib, tao_output, install, pi, csd_framework, csd_threadpool {
+ sharedname = TAO_Dynamic_TP
+ dynamicflags += TAO_DYNAMIC_TP_BUILD_DLL
+
+ specific {
+ install_dir = tao/Dynamic_TP
+ }
+}
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_Config.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_Config.cpp
new file mode 100644
index 00000000000..cb81781d411
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_Config.cpp
@@ -0,0 +1,334 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h"
+
+#include "tao/debug.h"
+//#include "tao/ORB_Constants.h"
+//#include "tao/ORBInitializer_Registry.h"
+//#include "tao/SystemException.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/OS_NS_strings.h"
+//#include "ace/Arg_Shifter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_Config_Registry_Installer::TAO_Dynamic_TP_Config_Registry_Installer (void)
+{
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_Dynamic_TP_Config_Registry);
+}
+
+
+TAO_Dynamic_TP_Config_Registry::TAO_Dynamic_TP_Config_Registry (void)
+{
+}
+
+TAO_Dynamic_TP_Config_Registry::~TAO_Dynamic_TP_Config_Registry (void)
+{
+}
+
+int
+TAO_Dynamic_TP_Config_Registry::init (int , ACE_TCHAR* [] )
+{
+ return 0;
+}
+
+bool
+TAO_Dynamic_TP_Config_Registry::find (const ACE_CString& name, TAO_DTP_Definition &entry)
+{
+ return registry_.find (name, entry) == 0;
+}
+
+int
+TAO_Dynamic_TP_Config_Registry::bind (const ACE_CString& name, TAO_DTP_Definition &entry)
+{
+ return registry_.bind (name, entry);
+}
+
+int
+TAO_Dynamic_TP_Config_Registry::rebind (const ACE_CString& name, TAO_DTP_Definition &entry)
+{
+ return registry_.rebind (name, entry);
+}
+
+//--------------------------------------------------------------------------------------
+
+TAO_Dynamic_TP_Config::TAO_Dynamic_TP_Config (void)
+{
+}
+
+TAO_Dynamic_TP_Config::~TAO_Dynamic_TP_Config (void)
+{
+}
+
+int
+TAO_Dynamic_TP_Config::init (int argc, ACE_TCHAR* argv[])
+{
+// TAO_DTP_Definition entry = {-1,5,-1,0,60,0};
+ TAO_DTP_Definition entry;
+ bool min_threads_set = false;
+ bool init_threads_set = false;
+ bool max_threads_set = false;
+ bool timeout_set = false;
+
+ ACE_TCHAR *name = 0;
+ bool overwrite = false;
+
+ int curarg = 0;
+ int r = 0;
+
+ for (curarg = 0; curarg < argc; ++curarg)
+ {
+ long val = 0;
+ if ((r = this->parse_string (curarg, argc, argv, ACE_TEXT("-DTPName"),name )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ }
+ else if ((r = this->parse_bool (curarg, argc, argv, ACE_TEXT("-DTPOverwrite"), overwrite )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPMin"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ min_threads_set = true;
+ entry.min_threads_ = val;
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPInit"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ init_threads_set = true;
+ entry.init_threads_ = val;
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPMax"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ max_threads_set = true;
+ entry.max_threads_ = val;
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPStack"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ entry.stack_size_ = val;
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPTImeout"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ timeout_set = true;
+ entry.timeout_ = val;
+ }
+ else if ((r = this->parse_long (curarg, argc, argv, ACE_TEXT("-DTPQueue"), val )) != 0)
+ {
+ if (r < 0)
+ {
+ return -1;
+ }
+ entry.queue_depth_ = val;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_Config - Unrecognized argv[%d], %C\n"),
+ curarg, argv[curarg]));
+ }
+ return -1;
+ }
+ }
+
+ ACE_CString name_str = name;
+
+ bool valid = true;
+ if (min_threads_set)
+ {
+ timeout_set = true;
+ valid = (entry.min_threads_ > 0);
+ if (valid)
+ {
+ if (init_threads_set)
+ {
+ valid = entry.init_threads_ >= entry.min_threads_;
+ }
+ else
+ {
+ entry.init_threads_ = entry.min_threads_;
+ }
+ }
+ }
+ else if (timeout_set)
+ {
+ entry.min_threads_ = 1;
+ }
+
+ if (valid)
+ {
+ if (max_threads_set)
+ {
+ valid = (entry.max_threads_ == -1) || (entry.max_threads_ > entry.init_threads_);
+ }
+ else
+ {
+ entry.max_threads_ = timeout_set ? -1 : entry.init_threads_;
+ }
+ }
+
+ if (!valid)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_Config - bad thread limits min = %d ")
+ ACE_TEXT ("initial = %d max = %d\n"),
+ entry.min_threads_, entry.init_threads_, entry.max_threads_));
+ }
+ return -1;
+ }
+
+ ACE_Service_Gestalt *current = ACE_Service_Config::current();
+ TAO_Dynamic_TP_Config_Registry* registry =
+ ACE_Dynamic_Service<TAO_Dynamic_TP_Config_Registry>::instance
+ (current, "Dynamic_TP_Config_Registry", true);
+
+ if (registry == 0)
+ {
+ current->process_directive (ace_svc_desc_TAO_Dynamic_TP_Config_Registry);
+ registry = ACE_Dynamic_Service<TAO_Dynamic_TP_Config_Registry>::instance
+ (current, "Dynamic_TP_Config_Registry", true);
+ if (registry == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_Config - cannot initialize registry\n")));
+ }
+ return -1;
+ }
+ }
+
+ if (!overwrite)
+ {
+ return registry->bind(name_str, entry);
+ }
+ else
+ {
+ return registry->rebind(name_str, entry);
+ }
+ return 0;
+}
+
+int
+TAO_Dynamic_TP_Config::parse_long (int &curarg,
+ int argc, ACE_TCHAR *argv[],
+ const ACE_TCHAR *match, long &value)
+{
+ ACE_TCHAR *str;
+ int result = this->parse_string (curarg, argc, argv, match, str);
+ if (result < 1)
+ return result;
+
+ ACE_TCHAR *err = 0;
+ value = ACE_OS::strtol (str, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (match, str);
+ return -1;
+ }
+ return 1;
+}
+
+int
+TAO_Dynamic_TP_Config::parse_bool (int &curarg,
+ int argc, ACE_TCHAR *argv[],
+ const ACE_TCHAR *match, bool &value)
+{
+ long num;
+ int result = this->parse_long (curarg, argc, argv, match, num);
+ if (result < 1)
+ return result;
+
+ value = num != 0;
+
+ return 1;
+}
+
+int
+TAO_Dynamic_TP_Config::parse_string (int &curarg,
+ int argc, ACE_TCHAR *argv[],
+ const ACE_TCHAR *match, ACE_TCHAR *&value)
+{
+ if (ACE_OS::strcasecmp (argv[curarg], match) != 0)
+ return 0;
+
+ ++curarg;
+ if (curarg >= argc)
+ {
+ this->report_option_value_error (match, ACE_TEXT("<missing>"));
+ return -1;
+ }
+
+ value = argv[curarg];
+ return 1;
+}
+
+
+void
+TAO_Dynamic_TP_Config::report_option_value_error (const ACE_TCHAR* option_name,
+ const ACE_TCHAR* option_value)
+{
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_Config - unknown ")
+ ACE_TEXT ("argument <%s> for <%s>\n"),
+ option_value, option_name));
+ }
+}
+
+
+/////////////////////////////////////////////////////////////////////
+
+ACE_FACTORY_DEFINE (TAO_Dynamic_TP, TAO_Dynamic_TP_Config_Registry)
+ACE_STATIC_SVC_DEFINE (TAO_Dynamic_TP_Config_Registry,
+ ACE_TEXT ("Dynamic_TP_Config_Registry"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Dynamic_TP_Config_Registry),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO_Dynamic_TP, TAO_Dynamic_TP_Config)
+ACE_STATIC_SVC_DEFINE (TAO_Dynamic_TP_Config,
+ ACE_TEXT ("Dynamic_TP_Config"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Dynamic_TP_Config),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 */
+
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_Config.h b/TAO/tao/Dynamic_TP/Dynamic_TP_Config.h
new file mode 100644
index 00000000000..eb1e005c09a
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_Config.h
@@ -0,0 +1,124 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file
+ *
+ * $Id$
+ *
+ * Header file for Loading DynamicTP Configurations.
+ *
+ *
+ * @author
+ */
+//=============================================================================
+
+#ifndef TAO_DYNAMIC_TP_CONFIG_H
+#define TAO_DYNAMIC_TP_CONFIG_H
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/Dynamic_TP/dynamic_tp_export.h"
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "ace/RB_Tree.h"
+#include "ace/Synch.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+struct TAO_Dynamic_TP_Export TAO_DTP_Definition
+{
+ int min_threads_; // a default of -1 implies Lifespan of INFINITE, > 0 implies IDLE
+ int init_threads_; // default to 5
+ int max_threads_; // a default of -1 implies no limit.
+ size_t stack_size_;
+ ACE_Time_Value timeout_; // default to 60 seconds
+ size_t queue_depth_;
+
+ // Create explicit constructor to eliminate issues with non-initialized struct values.
+ TAO_DTP_Definition() :
+ min_threads_(-1),
+ init_threads_(5),
+ max_threads_(-1),
+ stack_size_(ACE_DEFAULT_THREAD_STACKSIZE),
+ timeout_(60,0),
+ queue_depth_(-1){}
+
+};
+
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_Config_Registry_Installer
+{
+ public:
+ TAO_Dynamic_TP_Config_Registry_Installer (void);
+};
+
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_Config_Registry : public ACE_Service_Object
+{
+public:
+ TAO_Dynamic_TP_Config_Registry (void);
+ virtual ~TAO_Dynamic_TP_Config_Registry (void);
+
+ virtual int init (int argc, ACE_TCHAR* []);
+
+ /// initializes the supplied set value with the configuration associated with the name, or returns false.
+ bool find (const ACE_CString& name, TAO_DTP_Definition &entry);
+
+ int bind (const ACE_CString& name, TAO_DTP_Definition &entry);
+ int rebind (const ACE_CString& name, TAO_DTP_Definition &entry);
+
+ private:
+ typedef ACE_RB_Tree<ACE_CString, TAO_DTP_Definition, ACE_Less_Than<ACE_CString>, ACE_Null_Mutex> Registry;
+ Registry registry_;
+};
+
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_Config : public ACE_Service_Object
+{
+public:
+ /// Constructor.
+ TAO_Dynamic_TP_Config (void);
+
+ /// Destructor.
+ virtual ~TAO_Dynamic_TP_Config (void);
+
+ /// Read a definition parameter set from the supplied args.
+ /// There must be a -TPName argument, which, if replicated will cause the set to be ignored, unless -TPOverwrite is also set
+ /// constriants: min threads <= initial threads <= max_threads.
+ /// defaults: min threads = initial = max = 5
+ /// default lifespan = infinite
+ /// idle timeout is in secondes, default = 60
+ /// default stack size = 0, system defined default used.
+ /// queue depth is in number of messages, default is infinite
+ /// Init can be called multiple times,
+ virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ int parse_long (int &curarg, int argc, ACE_TCHAR* argv[], const ACE_TCHAR *match, long &value);
+ int parse_bool (int &curarg, int argc, ACE_TCHAR* argv[], const ACE_TCHAR *match, bool &value);
+ int parse_string (int &curarg, int argc, ACE_TCHAR* argv[], const ACE_TCHAR *match, ACE_TCHAR *&value);
+ void report_option_value_error (const ACE_TCHAR* option_name,
+ const ACE_TCHAR* option_value);
+
+};
+
+static TAO_Dynamic_TP_Config_Registry_Installer config_installer;
+
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Dynamic_TP, TAO_Dynamic_TP_Config_Registry)
+ACE_FACTORY_DECLARE (TAO_Dynamic_TP, TAO_Dynamic_TP_Config_Registry)
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Dynamic_TP, TAO_Dynamic_TP_Config)
+ACE_FACTORY_DECLARE (TAO_Dynamic_TP, TAO_Dynamic_TP_Config)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_DYNAMIC_TP_CONFIG_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp
new file mode 100644
index 00000000000..97918ad46c9
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.cpp
@@ -0,0 +1,111 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#if 0
+#define TAO_RTCORBA_SAFE_INCLUDE
+#include "tao/RTCORBA/RTCORBAC.h"
+#undef TAO_RTCORBA_SAFE_INCLUDE
+
+#include "tao/RTCORBA/RT_Policy_i.h"
+#include "tao/RTCORBA/RT_PolicyFactory.h"
+#include "tao/RTCORBA/RT_Protocols_Hooks.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+#include "tao/RTCORBA/Network_Priority_Mapping_Manager.h"
+#include "tao/RTCORBA/RT_ORB_Loader.h"
+#include "tao/RTCORBA/RT_Stub_Factory.h"
+#include "tao/RTCORBA/RT_Endpoint_Selector_Factory.h"
+#include "tao/RTCORBA/Continuous_Priority_Mapping.h"
+#include "tao/RTCORBA/Linear_Priority_Mapping.h"
+#include "tao/RTCORBA/Direct_Priority_Mapping.h"
+#include "tao/RTCORBA/Linear_Network_Priority_Mapping.h"
+#include "tao/RTCORBA/RT_ORB.h"
+#include "tao/RTCORBA/RT_Current.h"
+#include "tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h"
+#include "tao/RTCORBA/RT_Service_Context_Handler.h"
+#endif
+
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "tao/Exception.h"
+#include "tao/ORB_Core.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/debug.h"
+
+#include "ace/Service_Repository.h"
+#include "ace/Svc_Conf.h"
+#include "ace/Sched_Params.h"
+
+#if 0
+static const char rt_poa_factory_name[] = "TAO_Dynamic_TP_Object_Adapter_Factory";
+static const ACE_TCHAR rt_poa_factory_directive[] =
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "TAO_Dynamic_TP_Object_Adapter_Factory",
+ "TAO_RTPortableServer",
+ "_make_TAO_Dynamic_TP_Object_Adapter_Factory",
+ "");
+#endif
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_ORBInitializer::TAO_Dynamic_TP_ORBInitializer (/*const ACE_CString &tplist*/)
+{
+
+}
+
+void
+TAO_Dynamic_TP_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+{
+ // Narrow to a TAO_ORBInitInfo object to get access to the
+ // orb_core() TAO extension.
+ TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info);
+
+ if (CORBA::is_nil (tao_info.in ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) TAO_Dynamic_TP_ORBInitializer::pre_init:\n"
+ "(%P|%t) Unable to narrow "
+ "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
+ "(%P|%t) \"TAO_ORBInitInfo *.\"\n"));
+
+ throw ::CORBA::INTERNAL ();
+ }
+
+
+ ACE_Service_Gestalt *gestalt = ACE_Service_Config::current ();
+
+ ACE_Service_Object * const config_obj =
+ ACE_Dynamic_Service<ACE_Service_Object>::instance (
+ gestalt,
+ "Dynamic_TP_Config",
+ true);
+ if (config_obj == 0)
+ {
+ // no config manager object loaded
+ return;
+ }
+
+ TAO_Dynamic_TP_Config *config_mgr = dynamic_cast<TAO_Dynamic_TP_Config *>(config_obj);
+ if (config_mgr == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TAO_Dynamic_TP_ORBInitializer::pre_init:\n")
+ ACE_TEXT ("(%P|%t) Unable to resolve Dynamic_TP_Config object\n")));
+
+ throw ::CORBA::INTERNAL ();
+ }
+}
+
+void
+TAO_Dynamic_TP_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr )
+{
+ // this->register_policy_factories (info);
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h b/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h
new file mode 100644
index 00000000000..c362b418ead
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h
@@ -0,0 +1,72 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_TP_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_DYNAMIC_TP_ORB_INITIALIZER_H
+#define TAO_DYNAMIC_TP_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/Dynamic_TP/dynamic_tp_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
+
+/// Dynamic_TP ORB initializer.
+class TAO_Dynamic_TP_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer
+ , public virtual ::CORBA::LocalObject
+{
+public:
+
+ TAO_Dynamic_TP_ORBInitializer (void);
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+private:
+
+ /// Register Dynamic_TP policy factories.
+ void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info);
+
+private:
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_DYNAMIC_TP_ORB_INITIALIZER_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp
new file mode 100644
index 00000000000..89cc8f63309
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.cpp
@@ -0,0 +1,113 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/Dynamic_TP/Dynamic_TP_ORBInitializer.h"
+
+#include "tao/debug.h"
+#include "tao/ORB_Constants.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "tao/SystemException.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Arg_Shifter.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_ORB_Loader::TAO_Dynamic_TP_ORB_Loader (void)
+ : initialized_ (false)
+{
+}
+
+TAO_Dynamic_TP_ORB_Loader::~TAO_Dynamic_TP_ORB_Loader (void)
+{
+}
+
+int
+TAO_Dynamic_TP_ORB_Loader::init (int argc, ACE_TCHAR* argv[])
+{
+ ACE_TRACE ("TAO_Dynamic_TP_ORB_Loader::init");
+
+ // Only allow initialization once.
+ if (this->initialized_)
+ return 0;
+ this->initialized_ = true;
+
+ int curarg = 0;
+ for (curarg = 0; curarg < argc; ++curarg)
+ {
+ if (ACE_OS::strcasecmp (argv[curarg], ACE_TEXT ("-DTPORB")) == 0)
+ {
+ ++curarg;
+ if (curarg >= argc)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_ORB_Loader - ")
+ ACE_TEXT ("DTPORB arbument missing value\n")));
+ }
+ return -1;
+ }
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_ORB_Loader -")
+ ACE_TEXT (" Unrecognized argv[%d], %C\n"),
+ curarg, argv[curarg]));
+ }
+ return -1;
+ }
+ }
+
+ // Register the ORB initializer.
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ /// Register the DynamicTP ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ TAO_Dynamic_TP_ORBInitializer (),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+ }
+ catch (const ::CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "Unexpected exception caught while "
+ "initializing the RTORB");
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/////////////////////////////////////////////////////////////////////
+
+ACE_FACTORY_DEFINE (TAO_Dynamic_TP, TAO_Dynamic_TP_ORB_Loader)
+ACE_STATIC_SVC_DEFINE (TAO_Dynamic_TP_ORB_Loader,
+ ACE_TEXT ("Dynamic_TP_ORB_Loader"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Dynamic_TP_ORB_Loader),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 */
+
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h b/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h
new file mode 100644
index 00000000000..476c7e2b156
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_ORB_Loader.h
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_TP_ORB_Loader.h
+ *
+ * $Id$
+ *
+ * Header file for Loading DynamicTP.
+ *
+ *
+ * @author Phil Mesnier <mesnier_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_DYNAMIC_TP_ORB_LOADER_H
+#define TAO_DYNAMIC_TP_ORB_LOADER_H
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/Dynamic_TP/dynamic_tp_export.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;
+
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_ORB_Loader : public ACE_Service_Object
+{
+public:
+
+ /// Constructor.
+ TAO_Dynamic_TP_ORB_Loader (void);
+
+ /// Destructor.
+ virtual ~TAO_Dynamic_TP_ORB_Loader (void);
+
+ /// Initialize the DynamicTP loader hooks.
+ virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ bool initialized_;
+};
+
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Dynamic_TP, TAO_Dynamic_TP_ORB_Loader)
+ACE_FACTORY_DECLARE (TAO_Dynamic_TP, TAO_Dynamic_TP_ORB_Loader)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_DYNAMIC_TP_ORB_LOADER_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp
new file mode 100644
index 00000000000..7035bff7cc4
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.cpp
@@ -0,0 +1,204 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Loader.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+#include "tao/debug.h"
+
+#include "tao/CSD_Framework/CSD_Framework_Loader.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h"
+//#include "tao/ORB_Constants.h"
+//#include "tao/SystemException.h"
+
+#include "ace/OS_NS_strings.h"
+
+
+#include "tao/CSD_Framework/CSD_ORBInitializer.h"
+#include "tao/PI/DLL_Resident_ORB_Initializer.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "tao/ORB_Core.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_POA_Loader::TAO_Dynamic_TP_POA_Loader (void)
+{
+}
+
+TAO_Dynamic_TP_POA_Loader::~TAO_Dynamic_TP_POA_Loader (void)
+{
+}
+
+int
+TAO_Dynamic_TP_POA_Loader::init (int argc, ACE_TCHAR* argv[])
+{
+ TAO_debug_level = 5;
+
+ ACE_TRACE ("TAO_Dynamic_TP_POA_Loader::init");
+
+ // Only allow initialization once.
+ static bool initialized = false;
+ if (initialized)
+ return 0;
+ initialized = true;
+
+ TAO_CSD_Strategy_Repository * repo =
+ ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
+ ("TAO_CSD_Strategy_Repository");
+
+
+ /* Now create a POA Configuration Map Registry to look up what
+ thread pool settings are associated with each POA
+ */
+
+ if (repo == 0)
+ {
+ ACE_Service_Config::process_directive(ace_svc_desc_TAO_CSD_Strategy_Repository);
+ repo = ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
+ ("TAO_CSD_Strategy_Repository");
+ }
+
+ if (repo == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_POA_Loader - ")
+ ACE_TEXT ("cannot initialize strategy repo\n")));
+ }
+ return -1;
+ }
+
+ repo->init(0,0);
+
+ for (int curarg = 0; curarg < argc; curarg++)
+ {
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_POA_Loader - parsing args\n")));
+ }
+
+ if (ACE_OS::strcasecmp (argv[curarg], ACE_TEXT ("-DTPPOAConfigMap")) == 0)
+ {
+ ++curarg;
+ if (curarg >= argc)
+ {
+ this->report_option_value_error (ACE_TEXT ("-DTPPOAConfigMap"),
+ ACE_TEXT("<missing>"));
+ return -1;
+ }
+ if ((this->load_poa_map (argv[curarg], repo)) < 0)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+
+ /*
+ If we get here then we have another map set to process and
+ add to the map registry.
+ */
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Dynamic_TP_POA_Loader: Missing option\n")
+ ACE_TEXT ("Usage: -DTPPOAConfigMap <comma-separated ")
+ ACE_TEXT ("list of POAs>:<POA Config Name>\n")
+ ACE_TEXT ("<%s>.\n"),
+ argv[curarg]));
+ }
+ }
+
+ }
+
+ return 0;
+}
+
+
+int
+TAO_Dynamic_TP_POA_Loader::load_poa_map (ACE_TCHAR *map,
+ TAO_CSD_Strategy_Repository *repo)
+{
+
+ ACE_CString poa_name;
+ ACE_CString config_name;
+ TAO_Dynamic_TP_POA_Strategy * strategy_container = 0;
+ TAO_Dynamic_TP_POA_StrategyImpl * empty_strategy_impl = 0;
+
+ ACE_TCHAR *sep = ACE_OS::strchr (map, ':');
+
+ if (sep == 0)
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Dynamic_TP_POA_Loader: Missing option\n")
+ ACE_TEXT ("Usage: -DTPPOAConfigMap <comma-separated ")
+ ACE_TEXT ("list of POAs>:<POA Config Name>\n<%s>.\n"),
+ map));
+ }
+ return -1;
+ }
+
+ config_name = ACE_TEXT_ALWAYS_CHAR (sep + 1);
+ *sep = 0;
+
+ // Now that we have a config name and a null strategy
+ // implementation class we can allocate a new instance of a
+ // strategy configuration container.
+
+ ACE_NEW_RETURN(strategy_container,
+ TAO_Dynamic_TP_POA_Strategy(config_name,
+ empty_strategy_impl,
+ true), -1);
+
+ sep = ACE_OS::strchr (map, ',');
+ while (sep != 0)
+ {
+ *sep = 0;
+ poa_name = ACE_TEXT_ALWAYS_CHAR (map);
+ repo->add_strategy (poa_name, strategy_container);
+ map = sep + 1;
+ sep = ACE_OS::strchr (map, ',');
+ }
+ poa_name = ACE_TEXT_ALWAYS_CHAR (map);
+ repo->add_strategy(poa_name, strategy_container);
+
+ return 0;
+}
+
+void
+TAO_Dynamic_TP_POA_Loader::report_option_value_error (const ACE_TCHAR* name,
+ const ACE_TCHAR* value)
+{
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_POA_Loader - unknown ")
+ ACE_TEXT ("argument <%s> for <%s>\n"),
+ value, name));
+ }
+}
+
+
+/////////////////////////////////////////////////////////////////////
+
+
+ACE_FACTORY_DEFINE (TAO_Dynamic_TP, TAO_Dynamic_TP_POA_Loader)
+ACE_STATIC_SVC_DEFINE (TAO_Dynamic_TP_POA_Loader,
+ ACE_TEXT ("Dynamic_TP_POA_Loader"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Dynamic_TP_POA_Loader),
+ ACE_Service_Type::DELETE_THIS
+ | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.h b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.h
new file mode 100644
index 00000000000..567370f8675
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Loader.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_TP_POA_Loader.h
+ *
+ * $Id$
+ *
+ * Header file for Loading DynamicTP.
+ *
+ *
+ * @author Phil Mesnier <mesnier_p@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_DYNAMIC_TP_POA_LOADER_H
+#define TAO_DYNAMIC_TP_POA_LOADER_H
+#include /**/ "ace/pre.h"
+#include "tao/orbconf.h"
+#include "tao/Dynamic_TP/dynamic_tp_export.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "tao/CSD_Framework/CSD_Strategy_Repository.h"
+#include "ace/Synch.h"
+#include "ace/Service_Object.h"
+#include "ace/Service_Config.h"
+#include "ace/RB_Tree.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_POA_Core; //TODO: Do we still need this?
+
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_POA_Loader : public ACE_Service_Object
+{
+public:
+
+ /// Constructor.
+ TAO_Dynamic_TP_POA_Loader (void);
+
+ /// Destructor.
+ virtual ~TAO_Dynamic_TP_POA_Loader (void);
+
+ /// Initialize the DynamicTP loader hooks.
+ virtual int init (int argc, ACE_TCHAR* []);
+
+private:
+ /// Set to true after init is called.
+ int load_poa_map (ACE_TCHAR *map_str,
+ TAO_CSD_Strategy_Repository * reg);
+
+ void report_option_value_error (const ACE_TCHAR* option_name,
+ const ACE_TCHAR* option_value);
+};
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Dynamic_TP, TAO_Dynamic_TP_POA_Loader)
+ACE_FACTORY_DECLARE (TAO_Dynamic_TP, TAO_Dynamic_TP_POA_Loader)
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#include /**/ "ace/post.h"
+#endif /* TAO_DYNAMIC_TP_POA_LOADER_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp
new file mode 100644
index 00000000000..ad9b016cc42
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.cpp
@@ -0,0 +1,278 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Remote_Request.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Asynch_Request.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Custom_Synch_Request.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Custom_Asynch_Request.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_With_Server_Request.h"
+#include "tao/ORB_Core.h"
+
+#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
+
+
+#if !defined (__ACE_INLINE__)
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl"
+#endif /* ! __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+TAO_Dynamic_TP_POA_Strategy::~TAO_Dynamic_TP_POA_Strategy()
+{
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+TAO_Dynamic_TP_POA_Strategy::CustomRequestOutcome
+TAO_Dynamic_TP_POA_Strategy::custom_synch_request(TAO::CSD::TP_Custom_Request_Operation* op)
+{
+
+ TAO::CSD::TP_Servant_State::HandleType servant_state =
+ this->get_servant_state(op->servant());
+
+ TAO::CSD::TP_Custom_Synch_Request_Handle request = new
+ TAO::CSD::TP_Custom_Synch_Request(op, servant_state.in());
+
+ if (!this->dtp_strategy_impl_->get_Task().add_request(request.in()))
+ {
+ // The request was rejected by the task.
+ return REQUEST_REJECTED;
+ }
+
+ // Now we wait until the request is handled (executed or cancelled).
+ return (request->wait()) ? REQUEST_EXECUTED : REQUEST_CANCELLED;
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+TAO_Dynamic_TP_POA_Strategy::CustomRequestOutcome
+TAO_Dynamic_TP_POA_Strategy::custom_asynch_request(TAO::CSD::TP_Custom_Request_Operation* op)
+{
+
+ TAO::CSD::TP_Servant_State::HandleType servant_state =
+ this->get_servant_state(op->servant());
+
+ TAO::CSD::TP_Custom_Asynch_Request_Handle request = new
+ TAO::CSD::TP_Custom_Asynch_Request(op, servant_state.in());
+
+ return (this->dtp_strategy_impl_->get_Task().add_request(request.in()))
+ ? REQUEST_DISPATCHED : REQUEST_REJECTED;
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+bool
+TAO_Dynamic_TP_POA_Strategy::poa_activated_event_i(TAO_ORB_Core& orb_core)
+{
+
+ TAO_Dynamic_TP_Task::Open_Args args;
+ args.num_threads = this->dtp_strategy_impl_->get_initial_pool_threads();
+ this->dtp_strategy_impl_->get_Task().thr_mgr(orb_core.thr_mgr());
+
+ // Activates the worker threads, and waits until all have been started.
+
+ return (this->dtp_strategy_impl_->get_Task().open(&args) == 0);
+
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+void
+TAO_Dynamic_TP_POA_Strategy::poa_deactivated_event_i()
+{
+ // Passing in a value of 1 means that we want to shutdown the task, which
+ // equates to causing all worker threads to shutdown. The worker threads
+ // themselves will also invoke the close() method, but the passed-in value
+ // will be 0. So, a 1 means "shutdown", and a 0 means "a single worker
+ // thread is going away".
+ this->dtp_strategy_impl_->get_Task().close(1);
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+TAO::CSD::Strategy_Base::DispatchResult
+TAO_Dynamic_TP_POA_Strategy::dispatch_remote_request_i
+ (TAO_ServerRequest& server_request,
+ const PortableServer::ObjectId& object_id,
+ PortableServer::POA_ptr poa,
+ const char* operation,
+ PortableServer::Servant servant)
+{
+
+ TAO::CSD::TP_Servant_State::HandleType servant_state =
+ this->get_servant_state(servant);
+
+ // Now we can create the TP_Remote_Request object, and then add it to our
+ // task_'s "request queue".
+ //
+ // TBD-CSD: Need to use a Cached Allocator to "create" the
+ // TP_Remote_Request objects. For now, use the heap.
+ TAO::CSD::TP_Remote_Request_Handle request =
+ new TAO::CSD::TP_Remote_Request(server_request,
+ object_id,
+ poa,
+ operation,
+ servant,
+ servant_state.in());
+
+ // Hand the request object to our task so that it can add the request
+ // to its "request queue".
+ if (!this->dtp_strategy_impl_->get_Task().add_request(request.in()))
+ {
+ // Return the DISPATCH_REJECTED return code so that the caller (our
+ // base class' dispatch_request() method) knows that we did
+ // not handle the request, and that it should be rejected.
+ return TAO::CSD::Strategy_Base::DISPATCH_REJECTED;
+ }
+
+ return TAO::CSD::Strategy_Base::DISPATCH_HANDLED;
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+TAO::CSD::Strategy_Base::DispatchResult
+TAO_Dynamic_TP_POA_Strategy::dispatch_collocated_request_i
+ (TAO_ServerRequest& server_request,
+ const PortableServer::ObjectId& object_id,
+ PortableServer::POA_ptr poa,
+ const char* operation,
+ PortableServer::Servant servant)
+{
+
+
+ TAO::CSD::TP_Servant_State::HandleType servant_state =
+ this->get_servant_state(servant);
+
+ bool is_sync_with_server = server_request.sync_with_server();
+ bool is_synchronous = server_request.response_expected();
+
+ TAO::CSD::TP_Collocated_Synch_Request_Handle synch_request;
+ TAO::CSD::TP_Collocated_Synch_With_Server_Request_Handle synch_with_server_request;
+ TAO::CSD::TP_Request_Handle request;
+
+ // Create the request object using the appropriate concrete type.
+ if (is_sync_with_server)
+ {
+ synch_with_server_request =
+ new TAO::CSD::TP_Collocated_Synch_With_Server_Request
+ (server_request,
+ object_id,
+ poa,
+ operation,
+ servant,
+ servant_state.in());
+
+ // Give the request handle its own "copy".
+ synch_with_server_request->_add_ref();
+ request = synch_with_server_request.in();
+ }
+ else if (is_synchronous)
+ {
+ synch_request = new TAO::CSD::TP_Collocated_Synch_Request(server_request,
+ object_id,
+ poa,
+ operation,
+ servant,
+ servant_state.in());
+
+ // Give the request handle its own "copy".
+ synch_request->_add_ref();
+ request = synch_request.in();
+ }
+ else
+ {
+ // Just use the (base) request handle to hold the request object.
+ request = new TAO::CSD::TP_Collocated_Asynch_Request(server_request,
+ object_id,
+ poa,
+ operation,
+ servant,
+ servant_state.in());
+ }
+
+ // Hand the request object to our task so that it can add the request
+ // to its "request queue".
+ if (!this->dtp_strategy_impl_->get_Task().add_request(request.in()))
+ {
+ // Return the DISPATCH_REJECTED return code so that the caller (our
+ // base class' dispatch_request() method) knows that we did
+ // not handle the request, and that it should be rejected.
+ return DISPATCH_REJECTED;
+ }
+
+ // We need to wait on the request object if the request type is a
+ // synchronous request.
+ if (!synch_request.is_nil())
+ {
+ int srw = synch_request->wait();
+ if (srw == false)
+ {
+ // Raise exception when request was cancelled.
+ throw ::CORBA::NO_IMPLEMENT();
+ }
+ }
+ else if (!synch_with_server_request.is_nil())
+ {
+ bool swsr = synch_with_server_request->wait();
+ if (swsr == false)
+ {
+ // Raise exception when request was cancelled.
+ throw ::CORBA::NO_IMPLEMENT();
+ }
+ }
+
+ return DISPATCH_HANDLED;
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+void
+TAO_Dynamic_TP_POA_Strategy::servant_activated_event_i
+ (PortableServer::Servant servant,
+ const PortableServer::ObjectId&)
+{
+ if (this->serialize_servants_)
+ {
+ // Add the servant to the servant state map.
+ this->servant_state_map_.insert(servant);
+ }
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+void
+TAO_Dynamic_TP_POA_Strategy::servant_deactivated_event_i
+ (PortableServer::Servant servant,
+ const PortableServer::ObjectId&)
+{
+ // Cancel all requests stuck in the queue for the specified servant.
+ this->dtp_strategy_impl_->get_Task().cancel_servant(servant);
+
+ if (this->serialize_servants_)
+ {
+ // Remove the servant from the servant state map.
+ this->servant_state_map_.remove(servant);
+ }
+}
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+void
+TAO_Dynamic_TP_POA_Strategy::cancel_requests(PortableServer::Servant servant)
+{
+ // Cancel all requests stuck in the queue for the specified servant.
+ this->dtp_strategy_impl_->get_Task().cancel_servant(servant);
+}
+
+
+//TODO: This needs to be delegated to Dynamic_TP_POA_StrategyImpl.cpp
+TAO::CSD::TP_Servant_State::HandleType
+TAO_Dynamic_TP_POA_Strategy::get_servant_state(PortableServer::Servant servant)
+{
+ TAO::CSD::TP_Servant_State::HandleType servant_state;
+
+ if (this->serialize_servants_)
+ {
+ servant_state = this->servant_state_map_.find(servant);
+ }
+
+ return servant_state;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+
+#endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h
new file mode 100644
index 00000000000..886c6798d92
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h
@@ -0,0 +1,210 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_TP_POA_Strategy.h
+ *
+ * $Id$
+ *
+ * @author Marc Neeley <neeleym@ociweb.com>
+ */
+//=============================================================================
+
+
+
+#ifndef TAO_DYNAMIC_TP_POA_STRATEGY_H
+#define TAO_DYNAMIC_TP_POA_STRATEGY_H
+
+#include /**/ "ace/pre.h"
+#include "tao/Dynamic_TP/dynamic_tp_export.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Task.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h"
+#include "tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Custom_Request_Operation.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/CSD_Framework/CSD_Strategy_Base.h"
+#include "tao/Intrusive_Ref_Count_Handle_T.h"
+#include "ace/OS_NS_strings.h"
+
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+class TAO_Dynamic_TP_POA_Strategy;
+typedef TAO_Intrusive_Ref_Count_Handle<TAO_Dynamic_TP_POA_Strategy> TAO_Dynamic_TP_POA_Strategy_Handle;
+
+class TAO::CSD::TP_Custom_Request_Operation;
+
+/**
+ * @class TAO_Dynamic_TP_POA_Strategy
+ *
+ * @brief
+ *
+ */
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_POA_Strategy: public TAO::CSD::Strategy_Base
+{
+ public:
+
+ /// Constructor.
+ TAO_Dynamic_TP_POA_Strategy(ACE_CString tp_config_name,
+ TAO_Dynamic_TP_POA_StrategyImpl * dynamic_strategy,
+ bool serialize_servants = true);
+
+ TAO_Dynamic_TP_POA_Strategy(TAO_DTP_Definition * tp_config_name,
+ bool serialize_servants = true);
+
+ /// Virtual Destructor.
+ virtual ~TAO_Dynamic_TP_POA_Strategy();
+
+ /// Set the number of threads in the pool (must be > 0).
+ void set_num_threads(Thread_Counter num_threads);
+
+ /// Turn on/off serialization of servants.
+ void set_servant_serialization(bool serialize_servants);
+
+ /// Return codes for the custom dispatch_request() methods.
+ enum CustomRequestOutcome
+ {
+ /// The request was successfully put on the request queue.
+ REQUEST_DISPATCHED,
+ /// The request has been executed/completed by a worker thread.
+ REQUEST_EXECUTED,
+ /// The request was removed from the queue and cancelled.
+ REQUEST_CANCELLED,
+ /// The request queue rejected the request
+ REQUEST_REJECTED
+ };
+
+ /// Inject a synchronous, custom request into the request queue.
+ /// This will block the calling thread until the request is handled
+ /// (dispatched or cancelled) or rejected.
+ /// Will return REQUEST_EXECUTED, REQUEST_CANCELLED, or REQUEST_REJECTED.
+ CustomRequestOutcome custom_synch_request
+ (TAO::CSD::TP_Custom_Request_Operation* op);
+
+ /// Inject an asynchronous, custom request into the request queue.
+ /// This will return control to the calling thread once the request
+ /// has been placed into the queue (or rejected).
+ /// Will return REQUEST_DISPATCHED or REQUEST_REJECTED.
+ CustomRequestOutcome custom_asynch_request
+ (TAO::CSD::TP_Custom_Request_Operation* op);
+
+ /// Cancel all requests that are targeted for the provided servant.
+ /// This is requested on the user application level.
+ void cancel_requests(PortableServer::Servant servant);
+
+ ACE_CString get_tp_config();
+
+ protected:
+
+ /// Handle the dispatching of a remote request.
+ ///
+ /// This will cause a new "request" object to be created and pushed
+ /// on to a "request queue". The worker threads are responsible for
+ /// servicing the queue, and performing the actual dispatch logic.
+ virtual Strategy_Base::DispatchResult dispatch_remote_request_i
+ (TAO_ServerRequest& server_request,
+ const PortableServer::ObjectId& object_id,
+ PortableServer::POA_ptr poa,
+ const char* operation,
+ PortableServer::Servant servant);
+
+ /// Handle the dispatching of a collocated request.
+ ///
+ /// This will cause a new "request" object to be created and pushed
+ /// on to a "request queue". The worker threads are responsible for
+ /// servicing the queue, and performing the actual dispatch logic.
+ virtual Strategy_Base::DispatchResult dispatch_collocated_request_i
+ (TAO_ServerRequest& server_request,
+ const PortableServer::ObjectId& object_id,
+ PortableServer::POA_ptr poa,
+ const char* operation,
+ PortableServer::Servant servant);
+
+ /// Event - The POA has been activated.
+ /// This will activate the worker thread(s).
+ /// Returns true if the worker threads were activated successfully.
+ /// Otherwise, returns false.
+ virtual bool poa_activated_event_i(TAO_ORB_Core& orb_core);
+
+ /// Event - The POA has been deactivated.
+ /// This will shutdown the worker thread(s).
+ virtual void poa_deactivated_event_i();
+
+ /// Event - A servant has been activated
+ virtual void servant_activated_event_i
+ (PortableServer::Servant servant,
+ const PortableServer::ObjectId& oid);
+
+ /// Event - A servant has been deactivated
+ virtual void servant_deactivated_event_i
+ (PortableServer::Servant servant,
+ const PortableServer::ObjectId& oid);
+
+ private:
+
+
+ /**
+ * Helper method that is responsible for looking up the servant
+ * state object in the servant state map *if* the "serialize
+ * servants" flag is set to true. In the case where the
+ * "serialize servants" flag is set to false, then a "nil"
+ * servant state handle object is returned.
+ *
+ * @param servant - input - a pointer to the servant object.
+ *
+ * @returns a handle to a servant state object.
+ *
+ * @throw PortableServer::POA::ServantNotActive if the servant
+ * state cannot be determined.
+ */
+ TAO::CSD::TP_Servant_State::HandleType get_servant_state
+ (PortableServer::Servant servant);
+
+ /// This is the active object used by the worker threads.
+ /// The request queue is owned/managed by the task object.
+ /// The strategy object puts requests into the task's request
+ /// queue, and the worker threads service the queued requests
+ /// by performing the actual servant request dispatching logic.
+ //TAO_Dynamic_TP_Task task_;
+
+ /// The number of worker threads to use for the task.
+ TAO::CSD::Thread_Counter num_threads_;
+
+ /// The "serialize servants" flag.
+ bool serialize_servants_;
+
+ /// The map of servant state objects - only used when the
+ /// "serialize servants" flag is set to true.
+ TAO::CSD::TP_Servant_State_Map servant_state_map_;
+
+ /// This holds the name of a configuration that have been loaded
+ /// into a Dynamic_TP_Config_Registry. This is the key to the RB
+ /// Tree entry.
+
+ ACE_CString dynamic_tp_config_name_;
+
+ /// Pointer to the delagated implementation of the strategy
+ /// This will be initialized to null with the expectation that this will
+ /// allow for lazy loading of a strategy instance when an apply_to method is called
+ /// or dynamically when the POA is activated.
+
+ TAO_Dynamic_TP_POA_StrategyImpl * dtp_strategy_impl_;
+};
+
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_DYNAMIC_TP_POA_STRATEGY_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl
new file mode 100644
index 00000000000..2dc4f6c1f5c
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_Strategy.inl
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+/// Constructor.
+TAO_Dynamic_TP_POA_Strategy::TAO_Dynamic_TP_POA_Strategy(ACE_CString tp_config_name,
+ TAO_Dynamic_TP_POA_StrategyImpl * dynamic_strategy,
+ bool /*serialize_servants */)
+{
+ this->dynamic_tp_config_name_ = tp_config_name;
+ this->dtp_strategy_impl_ = dynamic_strategy;
+}
+
+ACE_INLINE
+TAO_Dynamic_TP_POA_Strategy::TAO_Dynamic_TP_POA_Strategy(TAO_DTP_Definition * tp_config_name,
+ bool serialize_servants)
+{
+ ACE_NEW(this->dtp_strategy_impl_,
+ TAO_Dynamic_TP_POA_StrategyImpl(tp_config_name,serialize_servants));
+}
+
+ACE_INLINE
+void
+TAO_Dynamic_TP_POA_Strategy::set_num_threads(Thread_Counter num_threads)
+{
+ // Simple Mutator. Assumes that num_threads > 0.
+ this->num_threads_ = num_threads;
+}
+
+ACE_INLINE
+ACE_CString
+TAO_Dynamic_TP_POA_Strategy::get_tp_config()
+{
+ return this->dynamic_tp_config_name_;
+}
+
+
+ACE_INLINE
+void
+TAO_Dynamic_TP_POA_Strategy::set_servant_serialization(bool serialize_servants)
+{
+ // Simple Mutator.
+ this->serialize_servants_ = serialize_servants;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp
new file mode 100644
index 00000000000..75dfcebd179
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.cpp
@@ -0,0 +1,80 @@
+// $Id$
+
+//#include "tao/CSD_Threadpool/CSD_TP_Strategy.h"
+#include "tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Remote_Request.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Asynch_Request.h"
+//
+//#include "tao/CSD_ThreadPool/CSD_TP_Custom_Synch_Request.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Custom_Asynch_Request.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_With_Server_Request.h"
+#include "ace/Trace.h"
+#include "tao/ORB_Core.h"
+
+#if !defined (__ACE_INLINE__)
+#include "tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl"
+#endif /* ! __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_POA_StrategyImpl::~TAO_Dynamic_TP_POA_StrategyImpl()
+{
+}
+
+int
+TAO_Dynamic_TP_POA_StrategyImpl::get_initial_pool_threads()
+{
+ return this->initial_pool_threads_;
+}
+
+int
+TAO_Dynamic_TP_POA_StrategyImpl::get_max_pool_threads()
+{
+ return this->max_pool_threads_;
+}
+
+size_t
+TAO_Dynamic_TP_POA_StrategyImpl::get_max_request_queue_depth()
+{
+ return this->max_request_queue_depth_;
+}
+
+int
+TAO_Dynamic_TP_POA_StrategyImpl::get_min_pool_threads()
+{
+ return this->min_pool_threads_;
+}
+
+TAO::CSD::TP_Servant_State::HandleType
+TAO_Dynamic_TP_POA_StrategyImpl::get_servant_state(PortableServer::Servant servant)
+{
+ TAO::CSD::TP_Servant_State::HandleType servant_state;
+
+ if (this->serialize_servants_)
+ {
+ servant_state = this->servant_state_map_.find(servant);
+ }
+
+ return servant_state;
+}
+
+TAO_Dynamic_TP_Task &
+ TAO_Dynamic_TP_POA_StrategyImpl::get_Task()
+{
+ return this->task_;
+}
+
+ACE_Time_Value
+TAO_Dynamic_TP_POA_StrategyImpl::get_thread_idle_time()
+{
+ return this->thread_idle_time_;
+}
+
+size_t
+TAO_Dynamic_TP_POA_StrategyImpl::get_thread_stack_size()
+{
+ return this->thread_stack_size_;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h
new file mode 100644
index 00000000000..5e2cf582053
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h
@@ -0,0 +1,161 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file
+ *
+ * $Id$
+ *
+ * @author
+ */
+//=============================================================================
+
+#ifndef TAO_DYNAMIC_TP_POA_STRATEGYIMPL_H
+#define TAO_DYNAMIC_TP_POA_STRATEGYIMPL_H
+
+#include /**/ "ace/pre.h"
+#include "tao/Dynamic_TP/dynamic_tp_export.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "tao/Dynamic_TP/Dynamic_TP_Task.h"
+
+#include "tao/CSD_ThreadPool/CSD_TP_Servant_State_Map.h"
+//#include "tao/CSD_ThreadPool/CSD_TP_Strategy.h"
+//#include "tao/CSD_Framework/CSD_Strategy_Base.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/Intrusive_Ref_Count_Handle_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+class TAO_Dynamic_TP_POA_StrategyImpl;
+typedef TAO_Intrusive_Ref_Count_Handle<TAO_Dynamic_TP_POA_StrategyImpl> TAO_Dynamic_TP_POA_StrategyImpl_Handle;
+
+// class TP_Custom_Request_Operation;
+
+/**
+ * @class TAO_Dynamic_TP_POA_Strategy
+ *
+ * @brief A custom Dynamc Thread-Pool servant dispatching strategy class.
+ *
+ * This class represents an extension implementation of a "Custom
+ * Servant Dispatching Strategy" called Dynamic_TP_POA_Strategy.
+ *
+ * A custom servant dispatching strategy object can be applied to a
+ * POA object in order to carry out the servant dispatching duties
+ * for that POA.
+ *
+ */
+class TAO_Dynamic_TP_Export TAO_Dynamic_TP_POA_StrategyImpl
+{
+ public:
+
+ /// Constructor for dynamic thread control
+ TAO_Dynamic_TP_POA_StrategyImpl(TAO_DTP_Definition * dynamic_tp_config,
+ bool serialize_servants);
+
+ // Virtual Destructor.
+ virtual ~TAO_Dynamic_TP_POA_StrategyImpl();
+
+ // This returns the number of static pool threads to create up front.
+ int get_initial_pool_threads();
+
+ // This returns the low water mark for dynamic threads to settle to.
+ int get_min_pool_threads();
+
+ // This returns the high water mark for dynamic threads to be limited to.
+ int get_max_pool_threads();
+
+ // If the max_pool_threads_ value has been met, then ORB requests coming in can be queued.
+ // This returns the maximum number that will be allowed.
+ size_t get_max_request_queue_depth();
+
+ TAO_Dynamic_TP_Task& get_Task();
+
+ // This returns the maximum amount of time in seconds that an idle thread
+ // can stay alive before being taken out of the pool.
+ ACE_Time_Value get_thread_idle_time();
+
+ // This returns the memory stack size allowable for each thread.
+ size_t get_thread_stack_size();
+
+
+
+ // Set the number of threads in the pool (must be > 0).
+ void set_num_threads(TAO::CSD::Thread_Counter num_threads);
+
+ /// Turn on/off serialization of servants.
+ void set_servant_serialization(bool serialize_servants);
+
+
+ private:
+
+ /**
+ * Helper method that is responsible for looking up the servant
+ * state object in the servant state map *if* the "serialize
+ * servants" flag is set to true. In the case where the
+ * "serialize servants" flag is set to false, then a "nil"
+ * servant state handle object is returned.
+ *
+ * @param servant - input - a pointer to the servant object.
+ *
+ * @returns a handle to a servant state object.
+ *
+ * @throw PortableServer::POA::ServantNotActive if the servant
+ * state cannot be determined.
+ */
+ TAO::CSD::TP_Servant_State::HandleType get_servant_state
+ (PortableServer::Servant servant);
+
+
+
+ // The number of static pool threads to create up front.
+ int initial_pool_threads_;
+
+ // The low water mark for dynamic threads to settle to.
+ int min_pool_threads_;
+
+ // The high water mark for dynamic threads to be limited to.
+ int max_pool_threads_;
+
+ // If the max_pool_threads_ value has been met, then ORB requests coming in can be queued.
+ // This is the maximum number that will be allowed.
+ size_t max_request_queue_depth_;
+
+ // This is the memory stack size allowable for each thread.
+ size_t thread_stack_size_;
+
+ // This is the maximum amount of time in seconds that an idle thread can
+ // stay alive before being taken out of the pool.
+ ACE_Time_Value thread_idle_time_;
+
+ // This is the active object used by the worker threads.
+ // The request queue is owned/managed by the task object.
+ // The strategy object puts requests into the task's request
+ // queue, and the worker threads service the queued requests
+ // by performing the actual servant request dispatching logic.
+ TAO_Dynamic_TP_Task task_;
+
+ // The "serialize servants" flag.
+ bool serialize_servants_;
+
+
+ /// The map of servant state objects - only used when the
+ /// "serialize servants" flag is set to true.
+ TAO::CSD::TP_Servant_State_Map servant_state_map_;
+};
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_DYNAMIC_TP_POA_STRATEGYIMPL_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl
new file mode 100644
index 00000000000..8e62bc83a49
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.inl
@@ -0,0 +1,128 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_Dynamic_TP_POA_StrategyImpl::TAO_Dynamic_TP_POA_StrategyImpl
+(TAO_DTP_Definition * dynamic_tp_config,
+ bool serialize_servants)
+ : serialize_servants_(serialize_servants)
+{
+ //Need to govern the rules of the parameters coming in and set the
+ //appropriate values.
+
+ // Check to see if a null config got sent in.
+ if (dynamic_tp_config != 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_POA_StrategyImpl: ")
+ ACE_TEXT ("Initialized with:\n")
+ ACE_TEXT (" initial_pool_threads_=[%d]\n")
+ ACE_TEXT (" min_pool_threads_=[%d]\n")
+ ACE_TEXT (" max_pool_threads_=[%d]\n")
+ ACE_TEXT (" max_request_queue_depth_=[%d]\n")
+ ACE_TEXT (" thread_stack_size_=[%d]\n")
+ ACE_TEXT (" thread_idle_time_=[%d]\n"),
+ this->initial_pool_threads_,
+ this->min_pool_threads_,
+ this->max_pool_threads_,
+ this->max_request_queue_depth_,
+ this->thread_stack_size_,
+ this->thread_idle_time_.sec()));
+
+ // initial_pool_threads_
+ if (dynamic_tp_config->init_threads_ > 0)
+ {
+ this->initial_pool_threads_ = dynamic_tp_config->init_threads_;
+ }
+ else
+ {
+ this->initial_pool_threads_ = 5; // set to default
+ }
+
+ // min_pool_threads_
+
+ if ( dynamic_tp_config->min_threads_ < this->initial_pool_threads_)
+ {
+ this->min_pool_threads_ = this->initial_pool_threads_;
+
+ }
+ else
+ {
+ this->min_pool_threads_ = dynamic_tp_config->min_threads_;
+ }
+
+ // max_pool_threads_
+
+ if ( dynamic_tp_config->max_threads_ < this->min_pool_threads_)
+ {
+ this->max_pool_threads_ = -1; // Set to -1 so that max is unbounded.
+ }
+ else
+ {
+ this->max_pool_threads_ = dynamic_tp_config->max_threads_;
+ }
+
+ // thread_stack_size_
+
+ if ( dynamic_tp_config->stack_size_ <= 0 )
+ {
+ this->thread_stack_size_ = ACE_DEFAULT_THREAD_STACKSIZE;
+ }
+ else
+ {
+ this->thread_stack_size_ = dynamic_tp_config->stack_size_;
+ }
+
+ // max_request_queue_depth_
+
+ if ( dynamic_tp_config->queue_depth_ <= 0 )
+ {
+ this->max_request_queue_depth_ = -1;
+ }
+ else
+ {
+ this->max_request_queue_depth_ = dynamic_tp_config->queue_depth_;
+ }
+
+ // thread_idle_time_
+ // TODO: Need functionality to trap for invalid ACE_Time_Value values
+
+ this->thread_idle_time_ = dynamic_tp_config->timeout_;
+ }
+ else
+ {
+ // Configuration was sent in null, so leave constructor defaults in place
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Dynamic_TP_POA_StrategyImpl: ")
+ ACE_TEXT ("Null configuration provided, setting to defaults:\n")
+ ACE_TEXT (" initial_pool_threads_=[%d]\n")
+ ACE_TEXT (" min_pool_threads_=[%d]\n")
+ ACE_TEXT (" max_pool_threads_=[%d]\n")
+ ACE_TEXT (" max_request_queue_depth_=[%d]\n")
+ ACE_TEXT (" thread_stack_size_=[%d]\n")
+ ACE_TEXT (" thread_idle_time_=[%d]\n"),
+ this->initial_pool_threads_,
+ this->min_pool_threads_,
+ this->max_pool_threads_,
+ this->max_request_queue_depth_,
+ this->thread_stack_size_,
+ this->thread_idle_time_.sec ()));
+ }
+
+
+}
+
+
+ACE_INLINE
+void
+TAO_Dynamic_TP_POA_StrategyImpl::set_servant_serialization(bool serialize_servants)
+{
+ // Simple Mutator.
+ this->serialize_servants_ = serialize_servants;
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_Task.cpp b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.cpp
new file mode 100644
index 00000000000..f0505807a2b
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.cpp
@@ -0,0 +1,86 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_Task.h"
+
+#if !defined (__ACE_INLINE__)
+# include "tao/Dynamic_TP/Dynamic_TP_Task.inl"
+#endif /* ! __ACE_INLINE__ */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO_Dynamic_TP_Task::~TAO_Dynamic_TP_Task()
+{
+}
+
+int
+TAO_Dynamic_TP_Task::open(void* args)
+{
+ Thread_Counter num = 1;
+
+ Open_Args* tmp = static_cast<Open_Args *> (args);
+
+ if (tmp == 0)
+ {
+ //FUZZ: disable check_for_lack_ACE_OS
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TP_Task failed to open. ")
+ ACE_TEXT ("Invalid argument type passed to open().\n")),
+ -1);
+ //FUZZ: enable check_for_lack_ACE_OS
+ }
+
+ num = tmp->num_threads;
+
+ // We can't activate 0 threads. Make sure this isn't the case.
+ if (num < 1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TP_Task failed to open. ")
+ ACE_TEXT ("num_threads (%u) is less-than 1.\n"),
+ num),
+ -1);
+ }
+
+ // We need the lock acquired from here on out.
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->lock_, -1);
+
+ // We can assume that we are in the proper state to handle this open()
+ // call as long as we haven't been open()'ed before.
+ if (this->opened_)
+ {
+ //FUZZ: disable check_for_lack_ACE_OS
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TP_Task failed to open. ")
+ ACE_TEXT ("Task has previously been open()'ed.\n")),
+ -1);
+ //FUZZ: enable check_for_lack_ACE_OS
+ }
+
+ // Activate this task object with 'num' worker threads.
+ if (this->activate(THR_NEW_LWP | THR_JOINABLE, num) != 0)
+ {
+ // Assumes that when activate returns non-zero return code that
+ // no threads were activated.
+ ACE_ERROR_RETURN((LM_ERROR,
+ ACE_TEXT ("(%P|%t) TP_Task failed to activate ")
+ ACE_TEXT ("(%d) worker threads.\n"),
+ num),
+ -1);
+ }
+
+ // Now we have past the point where we can say we've been open()'ed before.
+ this->opened_ = true;
+
+ // Now we wait until all of the threads have started.
+ while (this->num_threads_ != num)
+ {
+ this->active_workers_.wait();
+ }
+
+ // We can now accept requests (via our add_request() method).
+ this->accepting_requests_ = true;
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_Task.h b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.h
new file mode 100644
index 00000000000..8900f153d16
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.h
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Dynamic_TP_Task.h
+ *
+ * $Id$
+ *
+ * @author
+ */
+//=============================================================================
+
+#ifndef TAO_DYNAMIC_TP_TASK_H
+#define TAO_DYNAMIC_TP_TASK_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/Dynamic_TP/dynamic_tp_export.h"
+
+#include "tao/CSD_ThreadPool/CSD_TP_Queue.h"
+#include "tao/CSD_ThreadPool/CSD_TP_Task.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/Condition.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Task.h"
+#include "ace/Synch.h"
+#include "ace/Containers_T.h"
+#include "ace/Vector_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+
+ /// Typedef for the number of threads.
+ typedef unsigned long Thread_Counter;
+
+ /**
+ * @class TP_Task
+ *
+ * @brief Active Object managing a queue of request objects.
+ *
+ * There are two types of "users" of a TP_Task object:
+ *
+ * 1) The TP_Strategy object that "owns" this task object.
+ * 2) The worker threads that "run" this task object as an
+ * "active object".
+ *
+ * The TP_Strategy object that "owns" this task object dictates
+ * when the worker threads are activated and when they are shutdown. It
+ * also injects requests into this task's queue via calls to the
+ * add_request() method. It is also the TP_Strategy object that
+ * dictates the number of worker threads to be activated via a call to
+ * the set_num_threads() method.
+ *
+ * The active object pattern is implemented via the use of the
+ * the ACE_Task_Base base class, and each worker thread will
+ * invoke this task's svc() method, and when the svc() returns, the
+ * worker thread will invoke this task's close() method (with the
+ * flag argument equal to 0).
+ *
+ * @note I just wanted to document an idea... When the pool consists
+ * of only one worker thread, we could care less about checking
+ * if target servant objects are busy or not. The simple fact
+ * that only one thread will be dispatching all requests means
+ * that servant objects will never be busy when the thread
+ * tests to see if a request is "ready_for_dispatch()". I'm
+ * just wondering if this knowledge can be applied to the
+ * implementation such that the "pool with one worker thread" case
+ * performs more efficiently. This is STP vs SSTP.
+ *
+ */
+ class TAO_Dynamic_TP_Export TAO_Dynamic_TP_Task : public TAO::CSD::TP_Task
+ {
+ public:
+
+ /// Default Constructor.
+ TAO_Dynamic_TP_Task();
+
+ /// Virtual Destructor.
+ virtual ~TAO_Dynamic_TP_Task();
+
+ struct Open_Args {
+ Open_Args (void)
+ : num_threads(1),
+ stack_size (0)
+ {}
+ Thread_Counter num_threads;
+ size_t stack_size;
+ };
+
+ /// Activate the worker threads
+ virtual int open(void* args = 0);
+
+ private:
+
+ typedef TAO_SYNCH_MUTEX LockType;
+ typedef TAO_Condition<LockType> ConditionType;
+
+ /// Lock to protect the "state" (all of the data members) of this object.
+ LockType lock_;
+
+ /// Condition used to signal worker threads that they may be able to
+ /// find a request in the queue_ that needs to be dispatched to a
+ /// servant that is currently "not busy".
+ /// This condition will be signal()'ed each time a new request is
+ /// added to the queue_, and also when a servant has become "not busy".
+ ConditionType work_available_;
+
+ /// This condition will be signal()'ed each time the num_threads_
+ /// data member has its value changed. This is used to keep the
+ /// close(1) invocation (ie, a shutdown request) blocked until all
+ /// of the worker threads have stopped running.
+ ConditionType active_workers_;
+
+ /// Flag used to indicate when this task will (or will not) accept
+ /// requests via the the add_request() method.
+ bool accepting_requests_;
+
+ /// Flag used to initiate a shutdown request to all worker threads.
+ bool shutdown_initiated_;
+
+ /// Complete shutdown needed to be deferred because the thread calling
+ /// close(1) was also one of the ThreadPool threads
+ bool deferred_shutdown_initiated_;
+
+ /// Flag used to avoid multiple open() calls.
+ bool opened_;
+
+ /// The number of currently active worker threads.
+ Thread_Counter num_threads_;
+
+ /// The queue of pending servant requests (a.k.a. the "request queue").
+ TAO::CSD::TP_Queue queue_;
+
+ typedef ACE_Vector <ACE_thread_t> Thread_Ids;
+
+ /// The list of ids for the threads launched by this task.
+ Thread_Ids activated_threads_;
+
+ enum { MAX_THREADPOOL_TASK_WORKER_THREADS = 50 };
+ };
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+# include "tao/Dynamic_TP/Dynamic_TP_Task.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_DYNAMIC_TP_TASK_H */
diff --git a/TAO/tao/Dynamic_TP/Dynamic_TP_Task.inl b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.inl
new file mode 100644
index 00000000000..fb4e3821832
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/Dynamic_TP_Task.inl
@@ -0,0 +1,20 @@
+// -*- C++ -*-
+//
+// $Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+TAO_Dynamic_TP_Task::TAO_Dynamic_TP_Task()
+ : work_available_(this->lock_),
+ active_workers_(this->lock_),
+ accepting_requests_(false),
+ shutdown_initiated_(false),
+ deferred_shutdown_initiated_(false),
+ opened_(false),
+ num_threads_(0),
+ activated_threads_ ((size_t)0)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Dynamic_TP/dynamic_tp_export.h b/TAO/tao/Dynamic_TP/dynamic_tp_export.h
new file mode 100644
index 00000000000..3c6fd2ff524
--- /dev/null
+++ b/TAO/tao/Dynamic_TP/dynamic_tp_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TAO_Dynamic_TP
+// ------------------------------
+#ifndef TAO_DYNAMIC_TP_EXPORT_H
+#define TAO_DYNAMIC_TP_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_DYNAMIC_TP_HAS_DLL)
+# define TAO_DYNAMIC_TP_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_DYNAMIC_TP_HAS_DLL */
+
+#if !defined (TAO_DYNAMIC_TP_HAS_DLL)
+# define TAO_DYNAMIC_TP_HAS_DLL 1
+#endif /* ! TAO_DYNAMIC_TP_HAS_DLL */
+
+#if defined (TAO_DYNAMIC_TP_HAS_DLL) && (TAO_DYNAMIC_TP_HAS_DLL == 1)
+# if defined (TAO_DYNAMIC_TP_BUILD_DLL)
+# define TAO_Dynamic_TP_Export ACE_Proper_Export_Flag
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_DYNAMIC_TP_BUILD_DLL */
+# define TAO_Dynamic_TP_Export ACE_Proper_Import_Flag
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_DYNAMIC_TP_BUILD_DLL */
+#else /* TAO_DYNAMIC_TP_HAS_DLL == 1 */
+# define TAO_Dynamic_TP_Export
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARATION(T)
+# define TAO_DYNAMIC_TP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_DYNAMIC_TP_HAS_DLL == 1 */
+
+// Set TAO_DYNAMIC_TP_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_DYNAMIC_TP_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_DYNAMIC_TP_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_DYNAMIC_TP_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_DYNAMIC_TP_NTRACE */
+
+#if (TAO_DYNAMIC_TP_NTRACE == 1)
+# define TAO_DYNAMIC_TP_TRACE(X)
+#else /* (TAO_DYNAMIC_TP_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_DYNAMIC_TP_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_DYNAMIC_TP_NTRACE == 1) */
+
+#endif /* TAO_DYNAMIC_TP_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index 3dc71149072..c4cb2025e99 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -166,6 +166,8 @@ TAO_IIOP_Transport::recv (char *buf,
size_t len,
const ACE_Time_Value *max_wait_time)
{
+ this->connection_closed_on_read_ = false;
+
ssize_t const n = this->connection_handler_->peer ().recv (buf,
len,
max_wait_time);
@@ -196,6 +198,7 @@ TAO_IIOP_Transport::recv (char *buf,
// @@ What are the other error handling here??
else if (n == 0)
{
+ this->connection_closed_on_read_ = true;
return -1;
}
diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp
index f85187b0172..aaadf64e536 100644
--- a/TAO/tao/Invocation_Adapter.cpp
+++ b/TAO/tao/Invocation_Adapter.cpp
@@ -15,6 +15,7 @@
#include "tao/TAOC.h"
#include "tao/SystemException.h"
#include "tao/Collocation_Resolver.h"
+#include "tao/Invocation_Retry_State.h"
#include "ace/Service_Config.h"
#if !defined (__ACE_INLINE__)
@@ -69,6 +70,11 @@ namespace TAO
max_wait_time= &tmp_wait_time;
}
+ // Although not used explicitly here, constructs
+ // the retry state that will stub that be used
+ // when restarting invocation.
+ TAO::Invocation_Retry_State retry_state(*stub);
+
while (status == TAO_INVOKE_START || status == TAO_INVOKE_RESTART)
{
// Default we go to remote
diff --git a/TAO/tao/Invocation_Retry_Params.cpp b/TAO/tao/Invocation_Retry_Params.cpp
new file mode 100644
index 00000000000..4d966613d36
--- /dev/null
+++ b/TAO/tao/Invocation_Retry_Params.cpp
@@ -0,0 +1,20 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/Invocation_Retry_Params.h"
+#include "tao/Invocation_Utils.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+TAO::Invocation_Retry_Params::Invocation_Retry_Params (void)
+ : forward_on_reply_closed_limit_ (0)
+ , init_retry_delay_ (0, 100000) // Set default to 0.1 seconds
+{
+ this->forward_on_exception_limit_[FOE_OBJECT_NOT_EXIST] = 0;
+ this->forward_on_exception_limit_[FOE_COMM_FAILURE] = 0;
+ this->forward_on_exception_limit_[FOE_TRANSIENT] = 0;
+ this->forward_on_exception_limit_[FOE_INV_OBJREF] = 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Invocation_Retry_Params.h b/TAO/tao/Invocation_Retry_Params.h
new file mode 100644
index 00000000000..659ad4f7655
--- /dev/null
+++ b/TAO/tao/Invocation_Retry_Params.h
@@ -0,0 +1,61 @@
+/* -*- C++ -*- $Id$ */
+//=============================================================================
+/**
+ * @file Invocation_Retry_Params.h
+ *
+ * $Id$
+ *
+ * @author Byron Harris (harrisb@ociweb.com)
+ */
+//=============================================================================
+
+#ifndef TAO_INVOCATION_RETRY_PARAMS_H
+#define TAO_INVOCATION_RETRY_PARAMS_H
+
+#include "tao/orbconf.h"
+#include "ace/Array_Map.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+ /**
+ * @struct Invocation_Retry_Params
+ *
+ * @brief Contains the invocation retry parameters used when encountering
+ * CORBA exceptions.
+ * The parameters can be specified using either the Client_Strategy_Factory
+ * service given in the service configuration file or through the command line.
+ * Any command line parameter overrides the corresponding option in the service
+ * configurator file.
+ */
+ struct Invocation_Retry_Params
+ {
+ Invocation_Retry_Params();
+
+ typedef ACE_Array_Map<int, int> exception_limit_map_type;
+
+ /**
+ * The maximum number of retry attempts per exception type
+ * when exceptions are encountered. The profiles are
+ * cycled through during each attempt.
+ */
+ exception_limit_map_type forward_on_exception_limit_;
+
+ /**
+ * The maximum number of times to retry a an invocation
+ * if the the connection to the server is closed when
+ * trying to get a reply.
+ */
+ int forward_on_reply_closed_limit_;
+
+ /**
+ * The delay to use between cycles of base and forward profiles.
+ */
+ ACE_Time_Value init_retry_delay_;
+ };
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_INVOCATION_RETRY_PARAMS_H*/
diff --git a/TAO/tao/Invocation_Retry_State.cpp b/TAO/tao/Invocation_Retry_State.cpp
new file mode 100644
index 00000000000..dc3e558c73b
--- /dev/null
+++ b/TAO/tao/Invocation_Retry_State.cpp
@@ -0,0 +1,173 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/Invocation_Retry_State.h"
+#include "tao/ORB_Core.h"
+#include "tao/Client_Strategy_Factory.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace
+{
+ void retry_limit_calc (int ex,
+ TAO::Invocation_Retry_Params &command_line_params,
+ TAO::Invocation_Retry_Params &client_factory_params,
+ TAO::Invocation_Retry_Params &result)
+ {
+ if (command_line_params.forward_on_exception_limit_[ex] !=
+ result.forward_on_exception_limit_[ex])
+ result.forward_on_exception_limit_[ex] = command_line_params.forward_on_exception_limit_[ex];
+ else if (client_factory_params.forward_on_exception_limit_[ex] !=
+ result.forward_on_exception_limit_[ex])
+ result.forward_on_exception_limit_[ex] = client_factory_params.forward_on_exception_limit_[ex];
+ }
+
+ /// Calculate the retry parameters by giving a command line parameter
+ /// precedence over the corresponding client strategy factory parameter.
+ /// result is assumed to be passed with default values
+ void retry_params_calc (TAO::Invocation_Retry_Params &command_line_params,
+ TAO::Invocation_Retry_Params &client_factory_params,
+ TAO::Invocation_Retry_Params &result)
+ {
+
+ // Retry delay
+ if (command_line_params.init_retry_delay_ !=
+ result.init_retry_delay_)
+ result.init_retry_delay_ = command_line_params.init_retry_delay_;
+ else if (client_factory_params.init_retry_delay_ !=
+ result.init_retry_delay_)
+ result.init_retry_delay_ = client_factory_params.init_retry_delay_;
+
+ // Retry on reply closed limit
+ if (command_line_params.forward_on_reply_closed_limit_ !=
+ result.forward_on_reply_closed_limit_)
+ result.forward_on_reply_closed_limit_ = command_line_params.forward_on_reply_closed_limit_;
+ else if (client_factory_params.forward_on_reply_closed_limit_ !=
+ result.forward_on_reply_closed_limit_)
+ result.forward_on_reply_closed_limit_ = client_factory_params.forward_on_reply_closed_limit_;
+
+ // Forward on exception limits
+
+ retry_limit_calc (TAO::FOE_OBJECT_NOT_EXIST,
+ command_line_params,
+ client_factory_params,
+ result);
+
+ retry_limit_calc (TAO::FOE_COMM_FAILURE,
+ command_line_params,
+ client_factory_params,
+ result);
+
+ retry_limit_calc (TAO::FOE_TRANSIENT,
+ command_line_params,
+ client_factory_params,
+ result);
+
+ retry_limit_calc (TAO::FOE_INV_OBJREF,
+ command_line_params,
+ client_factory_params,
+ result);
+
+ }
+
+}
+
+TAO::Invocation_Retry_State::Invocation_Retry_State (TAO_Stub &stub)
+ : forward_on_reply_closed_count_ (0)
+ , stub_ (stub)
+ , forward_on_exception_limit_used_ (false)
+{
+ this->stub_.invocation_retry_state (this);
+ this->ex_count_map_[FOE_OBJECT_NOT_EXIST] = 0;
+ this->ex_count_map_[FOE_COMM_FAILURE] = 0;
+ this->ex_count_map_[FOE_TRANSIENT] = 0;
+ this->ex_count_map_[FOE_INV_OBJREF] = 0;
+
+ // Cast away const to avoid tedious iterator operations on the ACE_Array_Map.
+ TAO::Invocation_Retry_Params &command_line_params =
+ const_cast<TAO::Invocation_Retry_Params &> (stub.orb_core ()->orb_params ()->invocation_retry_params ());
+ TAO::Invocation_Retry_Params &client_factory_params =
+ const_cast<TAO::Invocation_Retry_Params &> (stub.orb_core ()->client_factory ()->invocation_retry_params ());
+
+ retry_params_calc(command_line_params,
+ client_factory_params,
+ this->retry_params_);
+
+ for (Invocation_Retry_Params::exception_limit_map_type::const_iterator i =
+ this->retry_params_.forward_on_exception_limit_.begin();
+ i != this->retry_params_.forward_on_exception_limit_.end(); ++i)
+ {
+ if (i->second > 0)
+ {
+ forward_on_exception_limit_used_ = true;
+ break;
+ }
+ }
+}
+
+TAO::Invocation_Retry_State::~Invocation_Retry_State ()
+{
+ this->stub_.invocation_retry_state (0);
+}
+
+bool
+TAO::Invocation_Retry_State::forward_on_exception_limit_used () const
+{
+ return forward_on_exception_limit_used_;
+}
+
+bool
+TAO::Invocation_Retry_State::forward_on_exception_increment (const int ef)
+{
+ if (!this->forward_on_exception_limit_used_)
+ return false;
+
+ int count = this->ex_count_map_[ef];
+ Invocation_Retry_Params::exception_limit_map_type::const_iterator i =
+ this->retry_params_.forward_on_exception_limit_.find (ef);
+ int limit = i->second;
+ if (count < limit)
+ {
+ this->ex_count_map_[ef] = count + 1;
+ return true;
+ }
+
+ return false;
+}
+
+bool
+TAO::Invocation_Retry_State::forward_on_reply_closed_increment ()
+{
+ if (this->forward_on_reply_closed_count_ <
+ this->retry_params_.forward_on_reply_closed_limit_)
+ {
+ ++this->forward_on_reply_closed_count_;
+ return true;
+ }
+
+ return false;
+}
+
+void
+TAO::Invocation_Retry_State::next_profile_retry (void) const
+{
+ this->stub_.next_profile_retry ();
+ this->sleep_at_starting_profile ();
+}
+
+void
+TAO::Invocation_Retry_State::sleep_at_starting_profile () const
+{
+ if (stub_.at_starting_profile ())
+ this->sleep();
+}
+
+void
+TAO::Invocation_Retry_State::sleep () const
+{
+ ACE_OS::sleep (this->retry_params_.init_retry_delay_);
+}
+
+
+TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Invocation_Retry_State.h b/TAO/tao/Invocation_Retry_State.h
new file mode 100644
index 00000000000..df8c7d04eec
--- /dev/null
+++ b/TAO/tao/Invocation_Retry_State.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*- $Id$ */
+//=============================================================================
+/**
+ * @file Invocation_Retry_State.h
+ *
+ * $Id$
+ *
+ * @author Byron Harris (harrisb@ociweb.com)
+ *
+ */
+//=============================================================================
+
+#ifndef TAO_INVOCATION_RETRY_STATE_H
+#define TAO_INVOCATION_RETRY_STATE_H
+
+#include "tao/Stub.h"
+#include "tao/Invocation_Retry_Params.h"
+
+#include "ace/Array_Map.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+
+ /**
+ * @class Invocation_Retry_State
+ *
+ * @brief Maintains state of invocation retries.
+ */
+ class Invocation_Retry_State
+ {
+ public:
+ Invocation_Retry_State (TAO_Stub &stub);
+
+ ~Invocation_Retry_State ();
+
+ /**
+ * Answer if any profile forward on exception limit
+ * parameter is used.
+ */
+ bool forward_on_exception_limit_used () const;
+
+ /**
+ * Attempt to increment the count of profile
+ * forwards.
+ * @return false if forward on exception is not
+ * being used or the limit has been reached.
+ */
+ bool forward_on_exception_increment (const int ef);
+
+ /**
+ * Attempt to increment the count of retries
+ * when a server connection is seen as closed
+ * during reply.
+ */
+ bool forward_on_reply_closed_increment ();
+
+ /**
+ * Increment to next profile in preparation
+ * to retry using that profile.
+ * If the next profile is the starting
+ * base profile then also call
+ * sleep ().
+ * @see TAO_Stub::next_profile_retry()
+ */
+ void next_profile_retry (void) const;
+
+ /**
+ * Sleep if profile is the starting
+ * base profile.
+ */
+ void sleep_at_starting_profile () const;
+
+ /**
+ * Sleep according to the delay value
+ * in Invocation_Retry_Params.
+ */
+ void sleep () const;
+
+ private:
+
+ typedef ACE_Array_Map<int, int> Ex_Count_Map;
+ Ex_Count_Map ex_count_map_;
+ int forward_on_reply_closed_count_;
+ TAO_Stub &stub_;
+ Invocation_Retry_Params retry_params_;
+ bool forward_on_exception_limit_used_;
+ };
+
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* TAO_INVOCATION_RETRY_STATE_H*/
diff --git a/TAO/tao/Invocation_Utils.h b/TAO/tao/Invocation_Utils.h
index 54e8ec6a0c5..f17df10c510 100644
--- a/TAO/tao/Invocation_Utils.h
+++ b/TAO/tao/Invocation_Utils.h
@@ -71,7 +71,7 @@ namespace TAO
TAO_DII_ASYNCH_INVOCATION
};
- enum Forward_Once_Exception
+ enum Forward_On_Exception
{
FOE_NON = 0x0,
FOE_OBJECT_NOT_EXIST = 0x1,
diff --git a/TAO/tao/LocateRequest_Invocation.cpp b/TAO/tao/LocateRequest_Invocation.cpp
index 6e6b173d912..9b1a9768335 100644
--- a/TAO/tao/LocateRequest_Invocation.cpp
+++ b/TAO/tao/LocateRequest_Invocation.cpp
@@ -126,7 +126,7 @@ namespace TAO
countdown.update ();
// For some strategies one may want to release the transport
- // back to cache. If the idling is successful let the
+ // back to cache. If the idling is successful let the
// resolver about that.
if (this->resolver_.transport ()->idle_after_send ())
this->resolver_.transport_released ();
diff --git a/TAO/tao/Messaging/AMH_Response_Handler.h b/TAO/tao/Messaging/AMH_Response_Handler.h
index 12261a60cfa..df4fd4b836c 100644
--- a/TAO/tao/Messaging/AMH_Response_Handler.h
+++ b/TAO/tao/Messaging/AMH_Response_Handler.h
@@ -64,7 +64,14 @@ typedef ACE_Allocator TAO_AMH_BUFFER_ALLOCATOR;
* application.
*/
class TAO_Messaging_Export TAO_AMH_Response_Handler
- : public virtual ::CORBA::LocalObject
+// @@ Mayur, this is not the correct way to use
+// TAO_LocalRefCounted_Object. Application code is supposed to use
+// it when necessary. You're forcing applications to use a
+// reference counted version of their AMH_Response_Handler. This
+// isn't consistent with the specified semantics detailed in the
+// CCM spec. Please remove this and place it where appropriate in
+// your AMH tests and examples.
+ : public ::CORBA::LocalObject
{
public:
diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp
index 0ec90d435f8..de84e437005 100644
--- a/TAO/tao/ORBInitializer_Registry.cpp
+++ b/TAO/tao/ORBInitializer_Registry.cpp
@@ -47,9 +47,8 @@ namespace PortableInterceptor
if (orbinitializer_registry_ == 0)
{
ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("ORBInitializer_Registry",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("ORBInitializer_Registry",
"TAO_PI",
- TAO_VERSION,
"_make_ORBInitializer_Registry",
""));
orbinitializer_registry_ =
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 6fa0711bba6..27ca8ad953e 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -1102,6 +1102,50 @@ TAO_ORB_Core::init (int &argc, char *argv[] )
arg_shifter.consume_arg ();
}
else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardOnTransientLimit"))))
+ {
+ int limit = ACE_OS::atoi (current_arg);
+ this->orb_params_.forward_on_exception_limit (TAO::FOE_TRANSIENT, limit);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardOnCommFailureLimit"))))
+ {
+ int limit = ACE_OS::atoi (current_arg);
+ this->orb_params_.forward_on_exception_limit (TAO::FOE_COMM_FAILURE, limit);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardOnObjectNotExistLimit"))))
+ {
+ int limit = ACE_OS::atoi (current_arg);
+ this->orb_params_.forward_on_exception_limit (TAO::FOE_OBJECT_NOT_EXIST, limit);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardOnInvObjrefLimit"))))
+ {
+ int limit = ACE_OS::atoi (current_arg);
+ this->orb_params_.forward_on_exception_limit (TAO::FOE_INV_OBJREF, limit);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardOnReplyClosedLimit"))))
+ {
+ int limit = ACE_OS::atoi (current_arg);
+ this->orb_params_.invocation_retry_params ().forward_on_reply_closed_limit_ =
+ limit;
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
+ (ACE_TEXT("-ORBForwardDelay"))))
+ {
+ int msecs = ACE_OS::atoi (current_arg);
+ ACE_Time_Value delay(0, 1000*msecs);
+ this->orb_params_.forward_on_exception_delay (delay);
+ arg_shifter.consume_arg ();
+ }
+ else if (0 != (current_arg = arg_shifter.get_the_parameter
(ACE_TEXT("-ORBForwardOnceOnObjectNotExist"))))
{
int forward = ACE_OS::atoi (current_arg);
@@ -1666,9 +1710,8 @@ TAO_ORB_Core::policy_factory_registry_i (void)
if (loader == 0)
{
this->configuration ()->process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("PolicyFactory_Loader",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("PolicyFactory_Loader",
"TAO_PI",
- TAO_VERSION,
"_make_TAO_PolicyFactory_Loader",
""));
loader =
@@ -1719,9 +1762,8 @@ TAO_ORB_Core::orbinitializer_registry_i (void)
if (this->orbinitializer_registry_ == 0)
{
this->configuration ()->process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE ("ORBInitializer_Registry",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE ("ORBInitializer_Registry",
"TAO_PI",
- TAO_VERSION,
"_make_ORBInitializer_Registry",
""));
this->orbinitializer_registry_ =
@@ -2475,9 +2517,8 @@ TAO_ORB_Core::resolve_typecodefactory_i (void)
if (loader == 0)
{
this->configuration ()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TypeCodeFactory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TypeCodeFactory",
"TAO_TypeCodeFactory",
- TAO_VERSION,
"_make_TAO_TypeCodeFactory_Loader",
""));
loader =
@@ -2509,9 +2550,8 @@ TAO_ORB_Core::resolve_codecfactory_i (void)
if (loader == 0)
{
this->configuration()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("CodecFactory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
"TAO_CodecFactory",
- TAO_VERSION,
"_make_TAO_CodecFactory_Loader",
""));
loader =
@@ -2537,9 +2577,8 @@ TAO_ORB_Core::resolve_compression_manager_i (void)
if (loader == 0)
{
this->configuration()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("Compression",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("Compression",
"TAO_Compression",
- TAO_VERSION,
"_make_TAO_Compression_Loader",
""));
loader =
@@ -2564,9 +2603,8 @@ TAO_ORB_Core::resolve_poa_current_i (void)
if (loader == 0)
{
this->configuration()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TAO_POA_Current_Factory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_POA_Current_Factory",
"TAO_PortableServer",
- TAO_VERSION,
"_make_TAO_POA_Current_Factory",
""));
loader =
@@ -2594,9 +2632,8 @@ TAO_ORB_Core::resolve_picurrent_i (void)
if (loader == 0)
{
this->configuration ()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("PICurrent_Loader",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("PICurrent_Loader",
"TAO_PI",
- TAO_VERSION,
"_make_TAO_PICurrent_Loader",
""));
loader =
@@ -2626,9 +2663,8 @@ TAO_ORB_Core::resolve_dynanyfactory_i (void)
if (loader == 0)
{
this->configuration ()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("DynamicAny_Loader",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("DynamicAny_Loader",
"TAO_DynamicAny",
- TAO_VERSION,
"_make_TAO_DynamicAny_Loader",
""));
loader =
@@ -2654,9 +2690,8 @@ TAO_ORB_Core::resolve_iormanipulation_i (void)
if (loader == 0)
{
this->configuration()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("IORManip_Loader",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("IORManip_Loader",
"TAO_IORManip",
- TAO_VERSION,
"_make_TAO_IORManip_Loader",
""));
loader =
@@ -2681,9 +2716,8 @@ TAO_ORB_Core::resolve_ior_table_i (void)
if (factory == 0)
{
this->configuration ()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TAO_IORTable",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_IORTable",
"TAO_IORTable",
- TAO_VERSION,
"_make_TAO_Table_Adapter_Factory",
""));
factory =
@@ -2717,9 +2751,8 @@ TAO_ORB_Core::resolve_monitor_i (void)
if (loader == 0)
{
this->configuration ()->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("Monitor_Init",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("Monitor_Init",
"TAO_Monitor",
- TAO_VERSION,
"_make_TAO_Monitor_Init",
""));
loader =
diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h
index 61fe6c718d7..b149e24a073 100644
--- a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h
+++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h
@@ -48,7 +48,7 @@ namespace TAO
/// Destroy an adapter that is created by this factory
virtual void destroy (TAO::ORT_Adapter * adapter);
- /// Used to force the initialization of the code.
+ // Used to force the initialization of the code.
static int Initializer (void);
};
}
diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h
index e38048c774a..bdc9af25c20 100644
--- a/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h
+++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h
@@ -91,7 +91,9 @@ namespace TAO
/// The ORT Factory.
PortableInterceptor::ObjectReferenceFactory_var ort_factory_;
+
};
+
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/PI/ORBInitInfo.cpp b/TAO/tao/PI/ORBInitInfo.cpp
index 18e844abf28..cb1f7e5b9da 100644
--- a/TAO/tao/PI/ORBInitInfo.cpp
+++ b/TAO/tao/PI/ORBInitInfo.cpp
@@ -116,9 +116,8 @@ TAO_ORBInitInfo::codec_factory (void)
if (loader == 0)
{
ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("CodecFactory",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("CodecFactory",
"TAO_CodecFactory",
- TAO_VERSION,
"_make_TAO_CodecFactory_Loader",
""));
loader =
diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp
index 093c7c5ef9e..7d8eb1d7cb2 100644
--- a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp
+++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp
@@ -78,8 +78,8 @@ namespace TAO
if (adapter == 0)
{
ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
- "ImR_Client_Adapter", "TAO_ImR_Client", TAO_VERSION,
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
+ "ImR_Client_Adapter", "TAO_ImR_Client",
"_make_ImR_Client_Adapter_Impl", ""));
adapter =
diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp
index 3de8235bf06..4b72c25a4cd 100644
--- a/TAO/tao/PortableServer/Root_POA.cpp
+++ b/TAO/tao/PortableServer/Root_POA.cpp
@@ -199,7 +199,6 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name,
profile_id_array_ (0),
policies_ (policies),
ort_adapter_ (0),
- ort_adapter_factory_ (0),
adapter_state_ (PortableInterceptor::HOLDING),
network_priority_hook_ (0),
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
@@ -246,11 +245,6 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name,
*this, this->policies_);
}
- // Cache ort adapter factory
- this->ort_adapter_factory_
- = ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance
- (orb_core_.configuration (), TAO_Root_POA::ort_adapter_factory_name ());
-
#if (TAO_HAS_MINIMUM_POA == 1)
// If this is the RootPOA, set the value of the ImplicitActivationPolicy
// to IMPLICIT_ACTIVATION since it is impossible to pass the policy
@@ -408,10 +402,10 @@ TAO_Root_POA::complete_destruction_i (void)
{
ort_adapter->release (my_array_obj_ref_template[0]);
- if (this->ort_adapter_factory_)
- {
- this->ort_adapter_factory_->destroy (ort_adapter);
- }
+ TAO::ORT_Adapter_Factory *ort_factory =
+ this->ORT_adapter_factory ();
+
+ ort_factory->destroy (ort_adapter);
this->ort_adapter_ = 0;
}
@@ -945,10 +939,10 @@ TAO_Root_POA::destroy_i (CORBA::Boolean etherealize_objects,
{
ort_adapter->release (my_array_obj_ref_template[0]);
- if (this->ort_adapter_factory_)
- {
- this->ort_adapter_factory_->destroy (ort_adapter);
- }
+ TAO::ORT_Adapter_Factory *ort_factory =
+ this->ORT_adapter_factory ();
+
+ ort_factory->destroy (ort_adapter);
this->ort_adapter_ = 0;
}
@@ -1319,7 +1313,8 @@ TAO_Root_POA::invoke_key_to_object_helper_i (const char * repository_id,
if (this->ORT_adapter_i ())
{
// Ask the ORT to create the object.
- return this->ort_adapter_->make_object (repository_id, user_oid);
+ return this->ort_adapter_->make_object (repository_id,
+ user_oid);
}
else
{
@@ -2291,38 +2286,51 @@ TAO_Root_POA::find_servant_priority (
find_servant_priority (system_id, priority);
}
+TAO::ORT_Adapter_Factory *
+TAO_Root_POA::ORT_adapter_factory (void)
+{
+ return ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance
+ (orb_core_.configuration (),
+ TAO_Root_POA::ort_adapter_factory_name ());
+}
+
TAO::ORT_Adapter *
TAO_Root_POA::ORT_adapter_i (void)
{
- if ((this->ort_adapter_factory_) && (this->ort_adapter_ == 0))
+ if (this->ort_adapter_ != 0)
+ return this->ort_adapter_;
+
+ try
{
- try
- {
- // Get the full adapter name of this POA, do this before we
- // create the adapter so that in case this fails, we just
- // return 0 and not a not activated adapter
- PortableInterceptor::AdapterName *adapter_name = this->adapter_name_i ();
+ TAO::ORT_Adapter_Factory * ort_ap_factory = this->ORT_adapter_factory ();
- this->ort_adapter_ = this->ort_adapter_factory_->create ();
+ if (!ort_ap_factory)
+ return 0;
- if (this->ort_adapter_)
- {
- // @todo We have to look at this, we activate it but hold the POA lock,
- // in case we are called by ORT_adapter, we shouldn't keep the lock
- // here, but then the ort_adapter should be guarded against multiple
- // activations.
- this->ort_adapter_->activate (this->orb_core_.server_id (),
- this->orb_core_.orbid (),
- adapter_name,
- this);
- }
- }
- catch (const ::CORBA::Exception& ex)
- {
- ex._tao_print_exception (
- "(%P|%t) Cannot initialize the "
- "object_reference_template_adapter\n");
- }
+ // Get the full adapter name of this POA, do this before we
+ // create the adapter so that in case this fails, we just
+ // return 0 and not a not activated adapter
+ PortableInterceptor::AdapterName *adapter_name = this->adapter_name_i ();
+
+ this->ort_adapter_ = ort_ap_factory->create ();
+
+ if (!this->ort_adapter_)
+ return 0;
+
+ // @todo We have to look at this, we activate it but hold the POA lock,
+ // in case we are called by ORT_adapter, we shouldn't keep the lock
+ // here, but then the ort_adapter should be guarded against multiple
+ // activations.
+ this->ort_adapter_->activate (this->orb_core_.server_id (),
+ this->orb_core_.orbid (),
+ adapter_name,
+ this);
+ }
+ catch (const ::CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "(%P|%t) Cannot initialize the "
+ "object_reference_template_adapter\n");
}
return this->ort_adapter_;
diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h
index ecb17d5b2a9..ee14f22a65d 100644
--- a/TAO/tao/PortableServer/Root_POA.h
+++ b/TAO/tao/PortableServer/Root_POA.h
@@ -404,7 +404,7 @@ public:
TAO::Portable_Server::POA_Current_Impl &poa_current_impl);
/**
- * Find the the servant with ObjectId @a system_id, and retrieve
+ * Find the the servant with ObjectId <system_id>, and retrieve
* its priority. Usually used in RT CORBA with SERVER_DECLARED
* priority model.
*
@@ -649,6 +649,8 @@ protected:
/// try to create one but assumes the POA lock is already hold
TAO::ORT_Adapter *ORT_adapter_i (void);
+ TAO::ORT_Adapter_Factory *ORT_adapter_factory (void);
+
CORBA::Boolean persistent (void);
static char persistent_key_char (void);
@@ -704,9 +706,6 @@ protected:
/// Pointer to the object reference template adapter.
TAO::ORT_Adapter *ort_adapter_;
- /// Pointer to the object reference template adapter factory.
- TAO::ORT_Adapter_Factory *ort_adapter_factory_;
-
/// Adapter can be accepting, rejecting etc.
PortableInterceptor::AdapterState adapter_state_;
diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp
index d797edb925e..de26ec8ee98 100644
--- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp
+++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp
@@ -17,6 +17,10 @@
#include "tao/PortableServer/Servant_Base.h"
#include "tao/debug.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/Time_Value.h"
+#include "ace/OS_NS_sys_time.h"
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO
@@ -24,7 +28,8 @@ namespace TAO
namespace Portable_Server
{
ServantRetentionStrategyNonRetain::ServantRetentionStrategyNonRetain (void) :
- poa_ (0)
+ poa_ (0),
+ sys_id_count_ (0)
{
}
@@ -188,12 +193,29 @@ namespace TAO
PortableServer::ObjectId user_id;
// Otherwise, it is the NON_RETAIN policy. Therefore, any ol'
- // object id will do (even an empty one).
+ // object id will do (even an empty one). However, to make an
+ // object id useful for discriminating objects in applications
+ // use a simple id of a counter and a time stamp. The use of a
+ // counter by itself is not sufficient for uniqueness over time
+ // and a timestamp isn't sufficient since multiple IDs may be
+ // requested within the same time unit.
+
PortableServer::ObjectId *sys_id = 0;
ACE_NEW_THROW_EX (sys_id,
- PortableServer::ObjectId,
+ PortableServer::ObjectId (8),
CORBA::NO_MEMORY ());
+ sys_id->length(8);
+
+ long count = this->sys_id_count_++;
+ ACE_Time_Value now = ACE_OS::gettimeofday();
+
+ *reinterpret_cast<ACE_UINT32 *>(sys_id->get_buffer()) =
+ count;
+
+ *reinterpret_cast<ACE_UINT32 *>(sys_id->get_buffer() + 4) =
+ static_cast<ACE_UINT32>(now.sec());
+
system_id = sys_id;
// User id is the same as system id.
diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h
index bc4a2e1d50b..6870c1e018c 100644
--- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h
+++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h
@@ -21,6 +21,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/PortableServer/Servant_Location.h"
+#include "ace/Atomic_Op.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -124,6 +125,7 @@ namespace TAO
protected:
TAO_Root_POA *poa_;
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,long> sys_id_count_;
};
}
}
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
index 7e406b772f1..0fb917121dc 100644
--- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
+++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
@@ -36,10 +36,9 @@
static const char rt_poa_factory_name[] = "TAO_RT_Object_Adapter_Factory";
static const ACE_TCHAR rt_poa_factory_directive[] =
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
"TAO_RT_Object_Adapter_Factory",
"TAO_RTPortableServer",
- TAO_VERSION,
"_make_TAO_RT_Object_Adapter_Factory",
"");
diff --git a/TAO/tao/Seq_Var_T.h b/TAO/tao/Seq_Var_T.h
index 3ec1449d834..4d91492f547 100644
--- a/TAO/tao/Seq_Var_T.h
+++ b/TAO/tao/Seq_Var_T.h
@@ -61,8 +61,10 @@ public:
_out_type out (void);
_retn_type _retn (void);
- /// TAO extension.
- _retn_type ptr (void) const;
+ /// TAO extension.
+ _retn_type ptr (void) const;
+ operator T *& ();
+
protected:
T * ptr_;
};
@@ -120,9 +122,6 @@ public:
T_elem operator[] (CORBA::ULong index);
T_const_elem operator[] (CORBA::ULong index) const;
-
- /// Variable-size base types only.
- operator T *& ();
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Seq_Var_T.inl b/TAO/tao/Seq_Var_T.inl
index b1c7c16d024..ede406b652d 100644
--- a/TAO/tao/Seq_Var_T.inl
+++ b/TAO/tao/Seq_Var_T.inl
@@ -106,6 +106,13 @@ TAO_Seq_Var_Base_T<T>::ptr (void) const
return this->ptr_;
}
+template<typename T>
+ACE_INLINE
+TAO_Seq_Var_Base_T<T>::operator T *& ()
+{
+ return this->ptr_;
+}
+
// ***************************************************************
template<typename T>
@@ -194,14 +201,6 @@ TAO_VarSeq_Var_T<T>::operator= (T * p)
return *this;
}
-// Variable-size types only.
-template<typename T>
-ACE_INLINE
-TAO_VarSeq_Var_T<T>::operator T *& ()
-{
- return this->ptr_;
-}
-
template<typename T>
ACE_INLINE
typename TAO_VarSeq_Var_T<T>::T_elem
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index 0703795d5d4..76759eb57d3 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -19,6 +19,7 @@
#include "tao/Policy_Set.h"
#include "tao/SystemException.h"
#include "tao/CDR.h"
+#include "tao/Invocation_Retry_State.h"
#if !defined (__ACE_INLINE__)
# include "tao/Stub.inl"
@@ -52,6 +53,7 @@ TAO_Stub::TAO_Stub (const char *repository_id,
, forwarded_ior_info_ (0)
, collocation_opt_ (orb_core->optimize_collocation_objects ())
, forwarded_on_exception_ (false)
+ , invocation_retry_state_ (0)
{
if (this->orb_core_.get() == 0)
{
@@ -116,6 +118,11 @@ TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles,
ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX,
guard,
this->profile_lock_));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::add_forward_profiles, acquired profile lock this = 0x%x\n"), this));
+ }
if (permanent_forward)
{
@@ -133,8 +140,10 @@ TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles,
TAO_MProfile (mprofiles));
if (permanent_forward)
- // bookmark the new element at bottom of stack
- this->forward_profiles_perm_ = this->forward_profiles_;
+ {
+ // bookmark the new element at bottom of stack
+ this->forward_profiles_perm_ = this->forward_profiles_;
+ }
// forwarded profile points to the new IOR (profiles)
this->profile_in_use_->forward_to (this->forward_profiles_);
@@ -159,6 +168,12 @@ TAO_Stub::create_ior_info (IOP::IOR *&ior_info, CORBA::ULong &index)
guard,
this->profile_lock_,
-1));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::create_ior_info, acquired profile lock this = 0x%x\n"), this));
+ }
+
IOP::IOR *tmp_info = 0;
@@ -520,6 +535,12 @@ TAO_Stub::marshal (TAO_OutputCDR &cdr)
guard,
this->profile_lock_,
0));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::marshal, acquired profile lock this = 0x%x\n"), this));
+ }
+
ACE_ASSERT(this->forward_profiles_ !=0);
@@ -549,4 +570,16 @@ TAO_Stub::marshal (TAO_OutputCDR &cdr)
return (CORBA::Boolean) cdr.good_bit ();
}
+void
+TAO_Stub::invocation_retry_state (TAO::Invocation_Retry_State *state)
+{
+ this->invocation_retry_state_ = state;
+}
+
+TAO::Invocation_Retry_State *
+TAO_Stub::invocation_retry_state () const
+{
+ return this->invocation_retry_state_;
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h
index 789bc8e2e9b..5c09af7985a 100644
--- a/TAO/tao/Stub.h
+++ b/TAO/tao/Stub.h
@@ -45,6 +45,7 @@ namespace TAO
class ObjectKey;
class Object_Proxy_Broker;
class Transport_Queueing_Strategy;
+ class Invocation_Retry_State;
}
namespace IOP
@@ -165,6 +166,11 @@ public:
*/
void reset_profiles (void);
+ /// Returns true if the profile in use is
+ /// the same as the profile in use after
+ /// reset_profiles() is called.
+ CORBA::Boolean at_starting_profile (void) const;
+
/// Returns true if a forward profile has successfully been used.
/// profile_success_ && forward_profiles_
CORBA::Boolean valid_forward_profile (void);
@@ -265,6 +271,9 @@ public:
void forwarded_on_exception (bool forwarded);
bool forwarded_on_exception () const;
+ void invocation_retry_state (TAO::Invocation_Retry_State *state);
+ TAO::Invocation_Retry_State *invocation_retry_state () const;
+
protected:
/// Destructor is to be called only through _decr_refcnt() to
@@ -406,6 +415,8 @@ protected:
/// True if forwarding request upon some specific exceptions
/// (e.g. OBJECT_NOT_EXIST) already happened.
ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> forwarded_on_exception_;
+
+ TAO::Invocation_Retry_State *invocation_retry_state_;
};
// Define a TAO_Stub auto_ptr class.
diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl
index d4b0ae3d8c7..ad13c947d4f 100644
--- a/TAO/tao/Stub.inl
+++ b/TAO/tao/Stub.inl
@@ -3,6 +3,7 @@
// $Id$
#include "tao/ORB_Core.h"
+#include "ace/Reverse_Lock_T.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -56,6 +57,12 @@ TAO_Stub::reset_profiles (void)
ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX,
guard,
this->profile_lock_));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::reset_profiles, acquired profile lock this = 0x%x\n"), this));
+ }
+
this->reset_profiles_i ();
}
@@ -137,9 +144,24 @@ TAO_Stub::next_profile_i (void)
pfile_next = this->base_profiles_.get_next ();
}
- // We may have been forwarded to / from a collocated situation
- // Check for this and apply / remove optimisation if required.
- this->orb_core_->reinitialize_object (this);
+ {
+ typedef ACE_Reverse_Lock<ACE_MT_SYNCH::MUTEX> TAO_REVERSE_LOCK;
+ TAO_REVERSE_LOCK reverse (this->profile_lock_);
+ ACE_MT (ACE_GUARD_RETURN (TAO_REVERSE_LOCK, ace_mon, reverse, 0));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::next_profile_i, released profile lock to reinitialize this = 0x%x\n"), this));
+ }
+ // We may have been forwarded to / from a collocated situation
+ // Check for this and apply / remove optimisation if required.
+ this->orb_core_->reinitialize_object (this);
+ }
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::next_profile_i, reacquired profile lock on object this = 0x%x\n"), this));
+ }
}
else
pfile_next = this->base_profiles_.get_next ();
@@ -160,6 +182,11 @@ TAO_Stub::next_profile (void)
guard,
this->profile_lock_,
0));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::next_profile, acquired profile lock this = 0x%x\n"), this));
+ }
return this->next_profile_i ();
}
@@ -188,6 +215,12 @@ TAO_Stub::base_profiles (const TAO_MProfile &mprofiles)
guard,
this->profile_lock_,
0));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::base_profiles, acquired profile lock this = 0x%x\n"), this));
+ }
+
// first reset things so we start from scratch!
@@ -208,6 +241,11 @@ TAO_Stub::next_profile_retry (void)
guard,
this->profile_lock_,
0));
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - Stub::next_profile_retry, acquired profile lock this = 0x%x\n"), this));
+ }
if (this->profile_success_ && this->forward_profiles_)
{
@@ -362,6 +400,13 @@ TAO_Stub::_decr_refcnt (void)
delete this;
}
+ACE_INLINE
+CORBA::Boolean
+TAO_Stub::at_starting_profile (void) const
+{
+ return profile_in_use_ == base_profiles_.get_profile(0);
+}
+
// ---------------------------------------------------------------
// Creator methods for TAO_Stub_Auto_Ptr (TAO_Stub Auto Pointer)
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp
index 40064362ca6..54ca5c3573b 100644
--- a/TAO/tao/Synch_Invocation.cpp
+++ b/TAO/tao/Synch_Invocation.cpp
@@ -1,6 +1,7 @@
// $Id$
#include "tao/Synch_Invocation.h"
+#include "tao/Invocation_Retry_State.h"
#include "tao/Profile_Transport_Resolver.h"
#include "tao/Profile.h"
#include "tao/Synch_Reply_Dispatcher.h"
@@ -79,10 +80,24 @@ namespace TAO
if (!transport)
{
- // Way back, we failed to find a profile we could connect to.
- // We've come this far only so we reach the interception points
- // in case they can fix things. Time to bail....
- throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
+ TAO::Invocation_Retry_State *retry_state = this->stub ()->invocation_retry_state ();
+ if (retry_state->forward_on_exception_increment(FOE_TRANSIENT))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ "TAO (%P|%t) - Synch_Twoway_Invocation::"
+ "remote_twoway retrying on TRANSIENT exception\n"));
+ retry_state->next_profile_retry ();
+ return TAO_INVOKE_RESTART;
+ }
+ else
+ {
+ // Way back, we failed to find a profile we could connect to.
+ // We've come this far only so we reach the interception points
+ // in case they can fix things. Time to bail....
+ throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
+ }
+
}
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon,
@@ -312,6 +327,19 @@ namespace TAO
(void) bd.unbind_dispatcher ();
this->resolver_.transport ()->close_connection ();
+ TAO::Invocation_Retry_State *retry_state =
+ this->stub ()->invocation_retry_state ();
+ if (this->resolver_.transport ()->connection_closed_on_read() &&
+ retry_state->forward_on_reply_closed_increment ())
+ {
+ if (TAO_debug_level > 4)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Synch_Twoway_Invocation::"
+ "wait_for_reply, forward profile on connection closed\n"));
+ retry_state->next_profile_retry ();
+ return TAO_INVOKE_RESTART;
+ }
+
try
{
return
@@ -322,7 +350,10 @@ namespace TAO
}
catch (const ::CORBA::Exception&)
{
- this->resolver_.stub ()->reset_profiles ();
+ if (!this->stub ()->invocation_retry_state ()->forward_on_exception_limit_used ())
+ {
+ this->resolver_.stub ()->reset_profiles ();
+ }
throw;
}
}
@@ -533,40 +564,78 @@ namespace TAO
throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_MAYBE);
}
+ bool retry_on_exception = false;
bool do_forward = false;
- int foe_kind = this->stub ()->orb_core ()->orb_params ()->forward_once_exception();
-
- if ((CORBA::CompletionStatus) completion != CORBA::COMPLETED_YES
- && (((foe_kind & TAO::FOE_TRANSIENT) == 0
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0) ||
- ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0") == 0 ||
- ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/NO_RESPONSE:1.0") == 0 ||
- ((foe_kind & TAO::FOE_COMM_FAILURE) == 0
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0) ||
- (this->stub ()->orb_core ()->orb_params ()->forward_invocation_on_object_not_exist ()
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0) ||
- (do_forward = ! this->stub ()->forwarded_on_exception ()
- && ((((foe_kind & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0))))))
+
+ const TAO_ORB_Parameters *orb_params = this->stub ()->orb_core ()->orb_params ();
+ TAO::Invocation_Retry_State *retry_state = this->stub ()->invocation_retry_state ();
+
+ if (retry_state->forward_on_exception_limit_used () &&
+ (CORBA::CompletionStatus) completion == CORBA::COMPLETED_NO)
+ {
+ if ((ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0 &&
+ retry_state->forward_on_exception_increment (TAO::FOE_TRANSIENT)) ||
+ (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0 &&
+ retry_state->forward_on_exception_increment (TAO::FOE_COMM_FAILURE)) ||
+ (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0 &&
+ retry_state->forward_on_exception_increment (TAO::FOE_OBJECT_NOT_EXIST)) ||
+ (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0 &&
+ retry_state->forward_on_exception_increment (TAO::FOE_INV_OBJREF))
+ )
+ {
+ retry_on_exception = true;
+ retry_state->sleep_at_starting_profile ();
+ }
+ }
+ else
+ {
+ int foe_kind = orb_params->forward_once_exception();
+
+ retry_on_exception =
+ (CORBA::CompletionStatus) completion != CORBA::COMPLETED_YES
+ && (((foe_kind & TAO::FOE_TRANSIENT) == 0
+ && ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0) ||
+ ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0") == 0 ||
+ ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/NO_RESPONSE:1.0") == 0 ||
+ ((foe_kind & TAO::FOE_COMM_FAILURE) == 0
+ && ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0) ||
+ (orb_params->forward_invocation_on_object_not_exist ()
+ && ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0) ||
+ (do_forward = ! this->stub ()->forwarded_on_exception ()
+ && ((((foe_kind & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST)
+ && (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0)) ||
+ (((foe_kind & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE)
+ && (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0)) ||
+ (((foe_kind & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT)
+ && (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)) ||
+ (((foe_kind & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF)
+ && (ACE_OS_String::strcmp (type_id.in (),
+ "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0)))));
+ }
+
+ if (retry_on_exception)
{
// If we are here then possibly we'll need a restart.
mon.set_status (TAO_INVOKE_RESTART);
+ if (TAO_debug_level > 4)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Synch_Twoway_Invocation::"
+ "handle_system_exception, profile forwarding on exception ",
+ type_id.in (), "\n"));
+
if (do_forward)
this->stub ()->forwarded_on_exception (true);
@@ -676,80 +745,97 @@ namespace TAO
if (!transport)
{
- // Way back, we failed to find a profile we could connect to.
- // We've come this far only so we reach the interception points
- // in case they can fix things. Time to bail....
- throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
- }
+ TAO::Invocation_Retry_State *retry_state = this->stub ()->invocation_retry_state ();
+ if (retry_state->forward_on_exception_limit_used ())
+ {
+ if (retry_state->forward_on_exception_increment(FOE_TRANSIENT))
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_INFO,
+ "TAO (%P|%t) - Synch_Oneway_Invocation::"
+ "remote_oneway retrying on TRANSIENT exception\n"));
+ retry_state->next_profile_retry ();
+ return TAO_INVOKE_RESTART;
+ }
+ }
+ else
+ {
+ // Way back, we failed to find a profile we could connect to.
+ // We've come this far only so we reach the interception points
+ // in case they can fix things. Time to bail....
+ throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
+ }
- {
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, transport->output_cdr_lock (),
- TAO_INVOKE_FAILURE);
+ }
- TAO_OutputCDR &cdr = transport->out_stream ();
+ {
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, transport->output_cdr_lock (),
+ TAO_INVOKE_FAILURE);
- cdr.message_attributes (this->details_.request_id (),
- this->resolver_.stub (),
- TAO_Message_Semantics (TAO_Message_Semantics::TAO_ONEWAY_REQUEST),
- max_wait_time);
+ TAO_OutputCDR &cdr = transport->out_stream ();
- this->write_header (cdr);
+ cdr.message_attributes (this->details_.request_id (),
+ this->resolver_.stub (),
+ TAO_Message_Semantics (TAO_Message_Semantics::TAO_ONEWAY_REQUEST),
+ max_wait_time);
- this->marshal_data (cdr);
+ this->write_header (cdr);
- countdown.update ();
+ this->marshal_data (cdr);
- if (transport->is_connected ())
- {
- // We have a connected transport so we can send the message
- s = this->send_message (cdr,
- TAO_Message_Semantics (TAO_Message_Semantics::TAO_ONEWAY_REQUEST),
- max_wait_time);
+ countdown.update ();
- if (transport->wait_strategy ()->non_blocking () == 0 &&
- transport->orb_core ()->client_factory ()->use_cleanup_options ())
- {
- if (!transport->wait_strategy ()->is_registered())
- {
- ACE_Event_Handler * const eh =
- transport->event_handler_i ();
-
- ACE_Reactor * const r =
- transport->orb_core ()->reactor ();
-
- if (r->register_handler (eh, ACE_Event_Handler::READ_MASK) == -1)
- {
- if (TAO_debug_level > 0)
- ACE_ERROR ((LM_ERROR,
- "TAO (%P|%t) - Synch_Oneway_Invocation::"
- "remote_oneway transport[%d] registration with"
- "reactor returned an error\n",
- transport->id ()));
- }
- else
- {
- // Only set this flag when registration succeeds
- transport->wait_strategy ()->is_registered(true);
- }
- }
- }
+ if (transport->is_connected ())
+ {
+ // We have a connected transport so we can send the message
+ s = this->send_message (cdr,
+ TAO_Message_Semantics (TAO_Message_Semantics::TAO_ONEWAY_REQUEST),
+ max_wait_time);
- }
- else
- {
- if (TAO_debug_level > 4)
- ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) - Synch_Oneway_Invocation::"
- "remote_oneway, queueing message\n"));
+ if (transport->wait_strategy ()->non_blocking () == 0 &&
+ transport->orb_core ()->client_factory ()->use_cleanup_options ())
+ {
+ if (!transport->wait_strategy ()->is_registered())
+ {
+ ACE_Event_Handler * const eh =
+ transport->event_handler_i ();
+
+ ACE_Reactor * const r =
+ transport->orb_core ()->reactor ();
+
+ if (r->register_handler (eh, ACE_Event_Handler::READ_MASK) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - Synch_Oneway_Invocation::"
+ "remote_oneway transport[%d] registration with"
+ "reactor returned an error\n",
+ transport->id ()));
+ }
+ else
+ {
+ // Only set this flag when registration succeeds
+ transport->wait_strategy ()->is_registered(true);
+ }
+ }
+ }
- if (transport->format_queue_message (cdr,
- max_wait_time,
- this->resolver_.stub()) != 0)
- {
- s = TAO_INVOKE_FAILURE;
- }
- }
- }
+ }
+ else
+ {
+ if (TAO_debug_level > 4)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - Synch_Oneway_Invocation::"
+ "remote_oneway, queueing message\n"));
+
+ if (transport->format_queue_message (cdr,
+ max_wait_time,
+ this->resolver_.stub()) != 0)
+ {
+ s = TAO_INVOKE_FAILURE;
+ }
+ }
+ }
#if TAO_HAS_INTERCEPTORS == 1
s = this->receive_other_interception ();
@@ -763,7 +849,7 @@ namespace TAO
status == PortableInterceptor::TRANSPORT_RETRY)
s = TAO_INVOKE_RESTART;
else if (status == PortableInterceptor::SYSTEM_EXCEPTION
- || status == PortableInterceptor::USER_EXCEPTION)
+ || status == PortableInterceptor::USER_EXCEPTION)
throw;
}
catch (...)
@@ -771,14 +857,14 @@ namespace TAO
// Notify interceptors of non-CORBA exception, and propagate
// that exception to the caller.
- PortableInterceptor::ReplyStatus const st =
- this->handle_all_exception ();
+ PortableInterceptor::ReplyStatus const st =
+ this->handle_all_exception ();
- if (st == PortableInterceptor::LOCATION_FORWARD ||
- st == PortableInterceptor::TRANSPORT_RETRY)
- s = TAO_INVOKE_RESTART;
- else
- throw;
+ if (st == PortableInterceptor::LOCATION_FORWARD ||
+ st == PortableInterceptor::TRANSPORT_RETRY)
+ s = TAO_INVOKE_RESTART;
+ else
+ throw;
}
#endif /* TAO_HAS_INTERCEPTORS */
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp
index aeb47f3d6c8..3940142bbfa 100644
--- a/TAO/tao/TAO_Internal.cpp
+++ b/TAO/tao/TAO_Internal.cpp
@@ -607,10 +607,9 @@ namespace
ACE_REMOVE_SERVICE_DIRECTIVE ("TAO_Codeset"));
ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE (
+ ACE_DYNAMIC_SERVICE_DIRECTIVE (
"TAO_Codeset",
"TAO_Codeset",
- TAO_VERSION,
"_make_TAO_Codeset_Manager_Factory",
""));
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index da78037256f..4b44cd5db90 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -143,6 +143,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag,
, recv_buffer_size_ (0)
, sent_byte_count_ (0)
, is_connected_ (false)
+ , connection_closed_on_read_ (false)
, messaging_object_ (0)
, char_translator_ (0)
, wchar_translator_ (0)
@@ -2886,6 +2887,12 @@ TAO_Transport::using_blocking_io_for_asynch_messages (void) const
return false;
}
+bool
+TAO_Transport::connection_closed_on_read (void) const
+{
+ return connection_closed_on_read_;
+}
+
/*
* Hook to add concrete implementations from the derived class onto
* TAO's transport.
diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h
index 20b69828829..69633422a97 100644
--- a/TAO/tao/Transport.h
+++ b/TAO/tao/Transport.h
@@ -544,8 +544,8 @@ public:
* thread can execute it on the same instance concurrently.
*
* @param buffer ORB allocated buffer where the data should be
- * @param timeout The ACE_Time_Value *s is just a place holder for now. It is
- * not clear this this is the best place to specify this. The actual
+ * @@ The ACE_Time_Value *s is just a place holder for now. It is
+ * not clear this this is the best place to specify this. The actual
* timeout values will be kept in the Policies.
*/
virtual ssize_t recv (char *buffer,
@@ -648,6 +648,9 @@ public:
/// Is this transport really connected
bool is_connected (void) const;
+ /// Was a connection seen as closed during a read
+ bool connection_closed_on_read (void) const;
+
/// Perform all the actions when this transport get opened
bool post_open (size_t id);
@@ -1175,6 +1178,12 @@ protected:
/// buffer the requests in this transport until the connection is ready
bool is_connected_;
+ /// Track if connection was seen as closed during a read so that
+ /// invocation can optionally be retried using a different profile.
+ /// Note that this could result in violate the "at most once" CORBA
+ /// semantics.
+ bool connection_closed_on_read_;
+
private:
/// Our messaging object.
diff --git a/TAO/tao/Transport_Cache_Manager_T.cpp b/TAO/tao/Transport_Cache_Manager_T.cpp
index e4b903bc5b0..00ba766b6e7 100644
--- a/TAO/tao/Transport_Cache_Manager_T.cpp
+++ b/TAO/tao/Transport_Cache_Manager_T.cpp
@@ -236,7 +236,8 @@ namespace TAO
return CACHE_FOUND_NONE;
}
- Find_Result const find_result = this->find (prop, transport, busy_count);
+ Find_Result find_result = this->find (
+ prop, transport, busy_count);
if (find_result != CACHE_FOUND_NONE)
{
if (find_result == CACHE_FOUND_AVAILABLE)
@@ -299,6 +300,7 @@ namespace TAO
if (this->is_entry_available_i (*entry))
{
// Successfully found a transport_type.
+
found = CACHE_FOUND_AVAILABLE;
found_entry = entry;
entry->item ().recycle_state (ENTRY_BUSY);
diff --git a/TAO/tao/Transport_Connector.cpp b/TAO/tao/Transport_Connector.cpp
index b717d8027fd..160eec30b83 100644
--- a/TAO/tao/Transport_Connector.cpp
+++ b/TAO/tao/Transport_Connector.cpp
@@ -312,7 +312,7 @@ TAO_Connector::parallel_connect (TAO::Profile_Transport_Resolver *r,
TAO_Base_Transport_Property desc2(ep,0);
size_t busy_count = 0;
if (tcm.find_transport (&desc2, base_transport, busy_count) ==
- TAO::Transport_Cache_Manager::CACHE_FOUND_AVAILABLE)
+ TAO::Transport_Cache_Manager::CACHE_FOUND_AVAILABLE )
{
if (TAO_debug_level)
{
@@ -561,6 +561,7 @@ TAO_Connector::connect (TAO::Profile_Transport_Resolver *r,
// invocation is done with it. In that case it is up to
// a subsequent invocation to handle the connection
// completion.
+
TransportCleanupGuard tg(base_transport);
if (!this->wait_for_connection_completion (r, *desc,
base_transport,
@@ -650,7 +651,7 @@ TAO_Connector::connect (TAO::Profile_Transport_Resolver *r,
// @todo: This is not the right place for this! (bugzilla 3023)
// Purge connections (if necessary)
tcm.purge ();
- bool const make_new_connection =
+ bool make_new_connection =
(found == TAO::Transport_Cache_Manager::CACHE_FOUND_NONE) ||
(found == TAO::Transport_Cache_Manager::CACHE_FOUND_BUSY
&& this->new_connection_is_ok (busy_count));
diff --git a/TAO/tao/Utils/PolicyList_Destroyer.cpp b/TAO/tao/Utils/PolicyList_Destroyer.cpp
index 5e15e55e325..adc8436e240 100644
--- a/TAO/tao/Utils/PolicyList_Destroyer.cpp
+++ b/TAO/tao/Utils/PolicyList_Destroyer.cpp
@@ -10,20 +10,24 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO::Utils::PolicyList_Destroyer::~PolicyList_Destroyer() throw ()
{
+
for (CORBA::ULong i = 0; i != length(); ++i)
{
CORBA::Policy_ptr policy = (*this)[i];
- if (!CORBA::is_nil (policy))
+ if (CORBA::is_nil (policy))
+ {
+ continue;
+ }
+
+ try
{
- try
- {
- policy->destroy ();
- (*this)[i] = CORBA::Policy::_nil();
- }
- catch (...)
- {
- }
+ policy->destroy ();
}
+ catch (...)
+ {
+ }
+
+ (*this)[i] = CORBA::Policy::_nil();
}
}
diff --git a/TAO/tao/VarOut_T.h b/TAO/tao/VarOut_T.h
index c1608cab33a..fd3f1f4f041 100644
--- a/TAO/tao/VarOut_T.h
+++ b/TAO/tao/VarOut_T.h
@@ -54,6 +54,7 @@ public:
// TAO extension.
T * ptr (void) const;
+ operator T *& ();
protected:
T * ptr_;
@@ -113,9 +114,6 @@ public:
TAO_Var_Var_T & operator= (T *);
TAO_Var_Var_T & operator= (const TAO_Var_Var_T<T> &);
- // Variable size types only.
- operator T *& ();
-
operator const T & () const;
operator T & ();
operator T & () const;
diff --git a/TAO/tao/VarOut_T.inl b/TAO/tao/VarOut_T.inl
index d73084b4b16..7735ef6cefb 100644
--- a/TAO/tao/VarOut_T.inl
+++ b/TAO/tao/VarOut_T.inl
@@ -62,6 +62,14 @@ TAO_Var_Base_T<T>::ptr (void) const
{
return this->ptr_;
}
+
+template<typename T>
+ACE_INLINE
+TAO_Var_Base_T<T>::operator T *& ()
+{
+ return this->ptr_;
+}
+
// *************************************************************
template<typename T>
@@ -179,14 +187,6 @@ TAO_Var_Var_T<T>::operator= (T * p)
return *this;
}
-// Variable-size types only.
-template<typename T>
-ACE_INLINE
-TAO_Var_Var_T<T>::operator T *& ()
-{
- return this->ptr_;
-}
-
template<typename T>
ACE_INLINE
TAO_Var_Var_T<T>::operator const T & () const
diff --git a/TAO/tao/Version.h b/TAO/tao/Version.h
index 6545afba76e..a9560d6af55 100644
--- a/TAO/tao/Version.h
+++ b/TAO/tao/Version.h
@@ -5,5 +5,5 @@
#define TAO_MAJOR_VERSION 2
#define TAO_MINOR_VERSION 1
-#define TAO_BETA_VERSION 6
-#define TAO_VERSION "2.1.6"
+#define TAO_BETA_VERSION 4
+#define TAO_VERSION "2.1.4"
diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp
index ac2e0c1a57c..989ba8ccfc1 100644
--- a/TAO/tao/default_client.cpp
+++ b/TAO/tao/default_client.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// $Id: default_client.cpp 93686 2011-03-31 12:12:12Z johnnyw $
+// $Id$
#include "tao/default_client.h"
#include "tao/Wait_On_Read.h"
@@ -12,6 +12,7 @@
#include "tao/Reactive_Connect_Strategy.h"
#include "tao/LF_Connect_Strategy.h"
#include "tao/orbconf.h"
+#include "tao/Invocation_Utils.h"
#include "ace/Lock_Adapter_T.h"
#include "ace/Recursive_Thread_Mutex.h"
@@ -186,6 +187,103 @@ TAO_Default_Client_Strategy_Factory::parse_args (int argc, ACE_TCHAR* argv[])
this->report_option_value_error (ACE_TEXT("-ORBConnectionHandlerCleanup"), name);
}
}
+ else if (ACE_OS::strcmp (argv[curarg],
+ ACE_TEXT("-ORBForwardOnCommFailureLimit")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ ACE_TCHAR *err = 0;
+ long limit = ACE_OS::strtol (name, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (ACE_TEXT("-ORBForwardOnCommFailureLimit"),
+ name);
+ }
+ else
+ this->invocation_retry_params_.forward_on_exception_limit_[TAO::FOE_COMM_FAILURE] =
+ limit;
+ }
+ }
+ else if (ACE_OS::strcmp (argv[curarg],
+ ACE_TEXT("-ORBForwardOnTransientLimit")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ ACE_TCHAR *err = 0;
+ long limit = ACE_OS::strtol (name, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (ACE_TEXT("-ORBForwardOnTransientLimit"),
+ name);
+ }
+ else
+ this->invocation_retry_params_.forward_on_exception_limit_[TAO::FOE_TRANSIENT] =
+ limit;
+ }
+ }
+ else if (ACE_OS::strcmp (argv[curarg],
+ ACE_TEXT("-ORBForwardOnObjectNotExistLimit")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ ACE_TCHAR *err = 0;
+ long limit = ACE_OS::strtol (name, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (ACE_TEXT("-ORBForwardOnObjectNotExistLimit"),
+ name);
+ }
+ else
+ this->invocation_retry_params_.forward_on_exception_limit_[TAO::FOE_OBJECT_NOT_EXIST] =
+ limit;
+ }
+ }
+ else if (ACE_OS::strcmp (argv[curarg],
+ ACE_TEXT("-ORBForwardOnInvObjrefLimit")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ ACE_TCHAR *err = 0;
+ long limit = ACE_OS::strtol (name, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (ACE_TEXT("-ORBForwardOnInvObjrefLimit"), name);
+ }
+ else
+ this->invocation_retry_params_.forward_on_exception_limit_[TAO::FOE_INV_OBJREF] =
+ limit;
+ }
+ }
+ else if (ACE_OS::strcmp (argv[curarg],
+ ACE_TEXT("-ORBForwardOnReplyClosedLimit")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ ACE_TCHAR *err = 0;
+ long limit = ACE_OS::strtol (name, &err, 10);
+ if (err && *err != 0)
+ {
+ this->report_option_value_error (ACE_TEXT("-ORBForwardOnReplyClosedLimit"), name);
+ }
+ else
+ this->invocation_retry_params_.forward_on_reply_closed_limit_ = limit;
+ }
+ }
else if (ACE_OS::strncmp (argv[curarg], ACE_TEXT("-ORB"), 4) == 0)
{
// Can we assume there is an argument after the option?
@@ -374,6 +472,12 @@ TAO_Default_Client_Strategy_Factory::use_cleanup_options (void) const
return this->use_cleanup_options_;
}
+const TAO::Invocation_Retry_Params &
+TAO_Default_Client_Strategy_Factory::invocation_retry_params (void) const
+{
+ return this->invocation_retry_params_;
+}
+
// ****************************************************************
ACE_STATIC_SVC_DEFINE (TAO_Default_Client_Strategy_Factory,
diff --git a/TAO/tao/default_client.h b/TAO/tao/default_client.h
index 3d7ea54f599..bd506384cec 100644
--- a/TAO/tao/default_client.h
+++ b/TAO/tao/default_client.h
@@ -22,6 +22,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/Client_Strategy_Factory.h"
+#include "tao/Invocation_Retry_Params.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -61,6 +62,7 @@ public:
virtual TAO_Connect_Strategy *create_connect_strategy (TAO_ORB_Core *);
virtual bool use_cleanup_options (void) const;
virtual Connect_Strategy connect_strategy (void) const;
+ virtual const TAO::Invocation_Retry_Params &invocation_retry_params (void) const;
protected:
void report_option_value_error (const ACE_TCHAR* option_name,
@@ -104,6 +106,9 @@ private:
/// Cleanupoptions for RW strategy
bool use_cleanup_options_;
+
+ /// Retry options when exceptions occur
+ TAO::Invocation_Retry_Params invocation_retry_params_;
};
ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Client_Strategy_Factory)
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index 7adbe9e5cff..80e6e752437 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -2,7 +2,6 @@
#include "tao/params.h"
#include "tao/orbconf.h"
-#include "tao/Version.h"
#if !defined (__ACE_INLINE__)
# include "tao/params.inl"
@@ -59,13 +58,12 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void)
, thread_lane_resources_manager_factory_name_ ("Default_Thread_Lane_Resources_Manager_Factory")
, poa_factory_name_ ("TAO_Object_Adapter_Factory")
, poa_factory_directive_
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TAO_Object_Adapter_Factory",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Object_Adapter_Factory",
"TAO_PortableServer",
- TAO_VERSION,
"_make_TAO_Object_Adapter_Factory",
""))
, forward_invocation_on_object_not_exist_ (false)
- , forward_once_exception_ (TAO::FOE_NON)
+ , forward_once_exception_ (0)
, collocation_resolver_name_ ("Default_Collocation_Resolver")
, allow_ziop_no_server_policies_ (!!TAO_ALLOW_ZIOP_NO_SERVER_POLICIES_DEFAULT)
{
@@ -412,4 +410,28 @@ TAO_ORB_Parameters::endpoint_selector_factory_name (void) const
return this->endpoint_selector_factory_name_.c_str ();
}
+const TAO::Invocation_Retry_Params &
+TAO_ORB_Parameters::invocation_retry_params (void) const
+{
+ return this->invocation_retry_params_;
+}
+
+TAO::Invocation_Retry_Params &
+TAO_ORB_Parameters::invocation_retry_params (void)
+{
+ return this->invocation_retry_params_;
+}
+
+void
+TAO_ORB_Parameters::forward_on_exception_limit (const int ef, const int limit)
+{
+ this->invocation_retry_params_.forward_on_exception_limit_[ef] = limit;
+}
+
+void
+TAO_ORB_Parameters::forward_on_exception_delay (const ACE_Time_Value &delay)
+{
+ this->invocation_retry_params_.init_retry_delay_ = delay;
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index 90c5c80c4e4..c90ab913e0c 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -14,9 +14,11 @@
#define TAO_PARAMS_H
#include /**/ "ace/pre.h"
+#include "tao/Invocation_Retry_Params.h"
#include "ace/Unbounded_Queue.h"
#include "ace/Array_Map.h"
#include "ace/Synch.h"
+#include "ace/Time_Value.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -42,6 +44,8 @@ typedef ACE_Unbounded_Queue_Const_Iterator<ACE_CString> TAO_EndpointSetIterator;
// -------------------------------------------------------------------
+
+
/**
* @class TAO_ORB_Parameters
*
@@ -255,7 +259,13 @@ public:
void forward_invocation_on_object_not_exist (bool opt);
bool forward_invocation_on_object_not_exist (void) const;
- void forward_once_exception (const int);
+ void forward_on_exception_limit (const int ef, const int limit);
+ void forward_on_exception_delay (const ACE_Time_Value &delay);
+
+ TAO::Invocation_Retry_Params &invocation_retry_params (void);
+ const TAO::Invocation_Retry_Params &invocation_retry_params (void) const;
+
+ void forward_once_exception (const int ef);
int forward_once_exception () const;
void allow_ziop_no_server_policies (bool opt);
@@ -478,13 +488,15 @@ private:
*/
bool forward_invocation_on_object_not_exist_;
+ TAO::Invocation_Retry_Params invocation_retry_params_;
/**
* The exceptions upon which the requests will be forwarded once.
+ * This is retained for backward compatibility of behavior.
*/
int forward_once_exception_;
- /**
+/**
* Name of the collocation resolver that needs to be instantiated.
* The default value is "Default_Collocation_Resolver". If
* TAO_RTCORBA is linked, the set_collocation_resolver will be
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index b26544fbf41..af79945534f 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -174,6 +174,8 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid
Invocation_Adapter.cpp
Invocation_Base.cpp
Invocation_Endpoint_Selectors.cpp
+ Invocation_Retry_State.cpp
+ Invocation_Retry_Params.cpp
IOPC.cpp
IOR_Parser.cpp
IORInterceptor_Adapter.cpp
diff --git a/TAO/tests/Bug_2677_Regression/server.cpp b/TAO/tests/Bug_2677_Regression/server.cpp
index 943d1da62c4..b2554023954 100644
--- a/TAO/tests/Bug_2677_Regression/server.cpp
+++ b/TAO/tests/Bug_2677_Regression/server.cpp
@@ -7,9 +7,8 @@ int
ACE_TMAIN(int, ACE_TCHAR *[])
{
ACE_TCHAR const * const scpc_loadOrb =
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE ("testDllORB",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE ("testDllORB",
"Bug_2677_Regression",
- TAO_VERSION,
"_make_DllORB",
"testDllORB -ORBId testORB");
diff --git a/TAO/tests/Bug_2936_Regression/bug2936.cpp b/TAO/tests/Bug_2936_Regression/bug2936.cpp
index 26a264e2ba0..bd982c6a498 100644
--- a/TAO/tests/Bug_2936_Regression/bug2936.cpp
+++ b/TAO/tests/Bug_2936_Regression/bug2936.cpp
@@ -6,10 +6,9 @@
char const * const scpc_orbId = "testDllOrb";
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"bug2936",
- TAO_VERSION,
"_make_DllORB",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -ORBDottedDecimalAddresses 1"
);
@@ -17,10 +16,9 @@ ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
-ACE_TCHAR const * const scpc_loadPersistentPoa = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadPersistentPoa = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testPersistentPoa",
"bug2936",
- TAO_VERSION,
"_make_PersistentPoa",
"testPersistentPoa testDllOrb"
);
diff --git a/TAO/tests/Bug_3542_Regression/server.cpp b/TAO/tests/Bug_3542_Regression/server.cpp
index c2c302e0dd0..88ec7288fe0 100644
--- a/TAO/tests/Bug_3542_Regression/server.cpp
+++ b/TAO/tests/Bug_3542_Regression/server.cpp
@@ -6,10 +6,9 @@
#include "ace/Service_Config.h"
#include "ace/Log_Msg.h"
-ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
"testDllOrb",
"Bug_3542",
- TAO_VERSION,
"_make_DllOrb",
"testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -NumThreads 2 -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa"
);
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl
index c4c07660b20..5c38153c233 100755
--- a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl
+++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl
@@ -146,7 +146,7 @@ for ($i = 0; $i < $num_remote_clients; $i++) {
}
for ($i = 0; $i < $num_remote_clients; $i++) {
- $client_status = $CLS[$i]->WaitKill(2 * $client->ProcessStopWaitInterval ());
+ $client_status = $CLS[$i]->WaitKill($client->ProcessStopWaitInterval ());
if ($client_status != 0) {
print STDERR "ERROR: client $i returned $client_status\n";
diff --git a/TAO/tests/DLL_ORB/client.cpp b/TAO/tests/DLL_ORB/client.cpp
index 6ea2ac1955b..590432ba7eb 100644
--- a/TAO/tests/DLL_ORB/client.cpp
+++ b/TAO/tests/DLL_ORB/client.cpp
@@ -28,10 +28,9 @@ ACE_TMAIN(int, ACE_TCHAR *[])
// In the process of doing this, the Test method provided by target
// CORBA object will be invoked.
if (ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE(
+ ACE_DYNAMIC_SERVICE_DIRECTIVE(
"Client_Module",
"Test_Client_Module",
- TAO_VERSION,
"_make_Test_Client_Module",
"-k file://test.ior")) != 0)
{
diff --git a/TAO/tests/DLL_ORB/server.cpp b/TAO/tests/DLL_ORB/server.cpp
index 522c8f59826..268e1b0d546 100644
--- a/TAO/tests/DLL_ORB/server.cpp
+++ b/TAO/tests/DLL_ORB/server.cpp
@@ -28,8 +28,8 @@ ACE_TMAIN(int, ACE_TCHAR *[])
// In the process of doing this, the Test CORBA object will be
// activated, and the ORB will be run.
if (ACE_Service_Config::process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("Server_Module",
- "Test_Server_Module", TAO_VERSION, "_make_Test_Server_Module", "")) != 0)
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("Server_Module",
+ "Test_Server_Module", "_make_Test_Server_Module", "")) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
diff --git a/TAO/tests/Dynamic_TP/Config_Loader/Config_Loader.mpc b/TAO/tests/Dynamic_TP/Config_Loader/Config_Loader.mpc
new file mode 100644
index 00000000000..fff50baa1c2
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/Config_Loader/Config_Loader.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project(*test) : dynamic_tp {
+ exename = test
+}
diff --git a/TAO/tests/Dynamic_TP/Config_Loader/Test.cpp b/TAO/tests/Dynamic_TP/Config_Loader/Test.cpp
new file mode 100644
index 00000000000..dcce5806a08
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/Config_Loader/Test.cpp
@@ -0,0 +1,80 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_Config.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/Service_Config.h"
+#include "ace/Dynamic_Service.h"
+
+void
+show_tp_config (const ACE_CString &name, const TAO_DTP_Definition &entry)
+{
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Config set for %C:\n"), name.c_str()));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Initial threads: %d:\n"), entry.init_threads_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Min threads: %d:\n"), entry.min_threads_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Max threads: %d:\n"), entry.max_threads_));
+ if (entry.min_threads_ > -1)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Idle Timeout: %d (sec)\n"), entry.timeout_.sec()));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Stack Size: %d:\n"), entry.stack_size_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Request queue max depth: %d\n"), entry.queue_depth_));
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ ACE_Service_Config::open (argc, argv);
+
+ ACE_Service_Gestalt *current = ACE_Service_Config::current();
+ TAO_Dynamic_TP_Config_Registry* registry =
+ ACE_Dynamic_Service<TAO_Dynamic_TP_Config_Registry>::instance
+ (current, "Dynamic_TP_Config_Registry", true);
+
+ if (registry == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Unable to load configuration\n")));
+ return -1;
+ }
+
+ TAO_DTP_Definition entry;
+
+ const ACE_TCHAR *name_list [] =
+ { ACE_TEXT ("ORB"),
+ ACE_TEXT ("bogus"),
+ ACE_TEXT ("POA1"),
+ ACE_TEXT ("defaults"),
+ ACE_TEXT ("m1"),
+ ACE_TEXT ("m2"),
+ ACE_TEXT ("m3"),
+ ACE_TEXT ("m4"),
+ ACE_TEXT ("m5"),
+ ACE_TEXT ("m6"),
+ ACE_TEXT ("m7"),
+ 0
+ };
+
+ for (int i = 0; name_list[i] != 0; i++)
+ {
+ bool found = registry->find (name_list[i], entry);
+ if (!found && (i != 1))
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Cannot find TP Config definition for %C\n"), name_list[i]));
+ return -1;
+ }
+ if (i == 1)
+ {
+ if (found)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Found TP Config definition for %C which should have failed\n"), name_list[i]));
+ return -1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("TP definition for %C not found as expected\n"), name_list[i]));
+ }
+ }
+ else
+ {
+ show_tp_config (name_list[i], entry);
+ }
+ }
+ return 0;
+}
diff --git a/TAO/tests/Dynamic_TP/Config_Loader/svc.conf b/TAO/tests/Dynamic_TP/Config_Loader/svc.conf
new file mode 100644
index 00000000000..10417277b38
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/Config_Loader/svc.conf
@@ -0,0 +1,16 @@
+# $Id$
+
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config()
+ "-DTPName ORB -DTPMin 5 -DTPInit 6 -DTPMax 10 -DTPTimeout 240 -DTPStack 10240 -DTPQueue 20"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPMin 2 -DTPInit 4 -DTPMax 10 -DTPQueue 10"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPOverwrite 1 -DTPMin 7 -DTPMax 14 "
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPMin 7 -DTPMax 11 -DPQueue 14"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName defaults"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m1 -DTPMin 3"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m2 -DTPMax 10"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m3 -DTPTimeout 120"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m4 -DTPMin 3 -DTPInit 7 -DTPMax 10 -DTPTimeout 120"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m5 -DTPMin 3 -DTPInit 10 -DTPTimeout 30"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m6 -DTPInit 6 -DTPMax -1"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m7 -DTPInit 7"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName bogus -DTPMin 6 -DTPInit 3"
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Dynamic_TP_POA_Test_Dynamic.mpc b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Dynamic_TP_POA_Test_Dynamic.mpc
new file mode 100644
index 00000000000..d7225b8511a
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Dynamic_TP_POA_Test_Dynamic.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(Dynamic_TP_POA_Test_Dynamic_Server): taoserver, csd_framework, dynamic_tp {
+ after += *idl
+ Source_Files {
+ Hello.cpp
+ server.cpp
+ TestC.cpp
+ TestS.cpp
+ }
+
+ IDL_Files {
+ }
+
+}
+
+project(Dynamic_TP_POA_Test_Dynamic_Client): taoclient {
+ after += Dynamic_TP_POA_Test_Dynamic_Server
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+
+ IDL_Files {
+ }
+
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp
new file mode 100644
index 00000000000..0f62f20b906
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp
@@ -0,0 +1,21 @@
+//
+// $Id$
+//
+#include "Hello.h"
+
+Hello::Hello (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+char *
+Hello::get_string (void)
+{
+ return CORBA::string_dup ("Hello there!");
+}
+
+void
+Hello::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.h b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.h
new file mode 100644
index 00000000000..3a840d3d88d
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.h
@@ -0,0 +1,31 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// 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 (void);
+
+ virtual void shutdown (void);
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Test.idl b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Test.idl
new file mode 100644
index 00000000000..3c0976e106d
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/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
+ */
+ oneway void shutdown ();
+ };
+};
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/client.cpp b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/client.cpp
new file mode 100644
index 00000000000..abaed430dc8
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/client.cpp
@@ -0,0 +1,76 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior = ACE_TEXT("file://test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.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
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior);
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in ());
+
+ 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_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n",
+ the_string.in ()));
+
+ hello->shutdown ();
+
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp
new file mode 100644
index 00000000000..3d9a2e42363
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/server.cpp
@@ -0,0 +1,112 @@
+// $Id$
+
+#include "Hello.h"
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h"
+#include "tao/Dynamic_TP/Dynamic_TP_POA_StrategyImpl.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/Thread_Manager.h"
+
+const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ 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 ();
+
+ 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);
+
+ PortableServer::ObjectId_var id =
+ root_poa->activate_object (hello_impl);
+
+ CORBA::Object_var object = root_poa->id_to_reference (id.in ());
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow (object.in ());
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in ());
+
+ // 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 %s for writing IOR: %C",
+ ior_output_file,
+ ior.in ()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate ();
+
+ orb->run ();
+
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1);
+
+ orb->destroy ();
+
+ // Wait for all CSD task threads exit.
+ ACE_Thread_Manager::instance ()->wait ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/svc.conf b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/svc.conf
new file mode 100644
index 00000000000..9383c2a9910
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/svc.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic Dynamic_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPMin 5 -DTPInit 6 -DTPMax 10 -DTPTimeout 240 -DTPStack 10240 -DTPQueue 20"
+dynamic Dynamic_TP_POA_Loader Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_POA_Loader() "-DTPPOAConfigMap RootPOA,MyPOA2,MyPOA3:POA1" \ No newline at end of file
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/POA_Loader.mpc b/TAO/tests/Dynamic_TP/POA_Loader/POA_Loader.mpc
new file mode 100644
index 00000000000..5ab8a83701c
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/POA_Loader.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project(*test) : dynamic_tp,csd_framework {
+ exename = test
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/Test.cpp b/TAO/tests/Dynamic_TP/POA_Loader/Test.cpp
new file mode 100644
index 00000000000..83a0206f74a
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/Test.cpp
@@ -0,0 +1,102 @@
+// $Id$
+
+#include "tao/Dynamic_TP/Dynamic_TP_POA_Strategy.h"
+#include "tao/CSD_Framework/CSD_Strategy_Repository.h"
+
+#include "ace/OS_NS_stdio.h"
+#include "ace/Service_Config.h"
+#include "ace/Dynamic_Service.h"
+#include <iostream>
+#include "tao/debug.h"
+
+void
+show_tp_config (const ACE_CString &name, const TAO_DTP_Definition &entry)
+{
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Config set for %C:\n"), name.c_str()));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Initial threads: %d:\n"), entry.init_threads_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Min threads: %d:\n"), entry.min_threads_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Max threads: %d:\n"), entry.max_threads_));
+ if (entry.min_threads_ > -1)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Idle Timeout: %d (sec)\n"), entry.timeout_.sec()));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Stack Size: %d:\n"), entry.stack_size_));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Request queue max depth: %d\n"), entry.queue_depth_));
+}
+
+void
+show_poa_config (const ACE_CString &name, TAO_Dynamic_TP_POA_Strategy * strat)
+{
+ ACE_DEBUG ((LM_INFO, ACE_TEXT ("POA [%C] has the configuration key [%C]\n"), name.c_str(),strat->get_tp_config().c_str()));
+ //ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Initial threads: %d:\n"), entry.init_threads_));
+ //ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Min threads: %d:\n"), entry.min_threads_));
+ //ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Max threads: %d:\n"), entry.max_threads_));
+ //if (entry.min_threads_ > -1)
+ // ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Idle Timeout: %d (sec)\n"), entry.timeout_));
+ //ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Stack Size: %d:\n"), entry.stack_size_));
+ //ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Request queue max depth: %d\n"), entry.queue_depth_));
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ TAO_debug_level = 1;
+
+ ACE_Service_Config::open (argc, argv);
+
+ // Dump the POA to Strategy map
+ TAO_CSD_Strategy_Repository* dtp_poa_strat_repo =
+ ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance
+ ("TAO_CSD_Strategy_Repository");
+
+ if (dtp_poa_strat_repo == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Unable to load configuration\n")));
+ return -1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("TAO_CSD_Strategy_Repository found\n")));
+ }
+
+
+ // Now iterate through the repository and attempt to find sample POA configurations
+
+ const ACE_TCHAR *poa_list [] =
+ { ACE_TEXT ("MyPOA"), // should find this one
+ ACE_TEXT ("POA2"), // shouldn't find this one
+ ACE_TEXT ("MyPOA3"), // should find this one
+ ACE_TEXT ("MyPOA1"), // should find this one
+ 0
+ };
+
+ TAO_Dynamic_TP_POA_Strategy * mapped_strategy;
+
+ for (int i = 0; poa_list[i] != 0; i++)
+ {
+ mapped_strategy = 0;
+ ACE_DEBUG ((LM_INFO, ACE_TEXT("Config definition for %C\n"), poa_list[i]));
+ mapped_strategy = dynamic_cast <TAO_Dynamic_TP_POA_Strategy*> (dtp_poa_strat_repo->find (poa_list[i]));
+ if ((mapped_strategy == 0) && (i != 1))
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Cannot find TP Config definition for %C\n"), poa_list[i]));
+ continue;
+ }
+ if (i == 1)
+ {
+ if (mapped_strategy)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Found TP Config definition for %C which should have failed\n"), poa_list[i]));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Config definition for %C not found as expected\n"), poa_list[i]));
+ }
+ }
+ else
+ {
+ show_poa_config (poa_list[i], mapped_strategy);
+ }
+ }
+
+
+ return 0;
+}
diff --git a/TAO/tests/Dynamic_TP/POA_Loader/svc.conf b/TAO/tests/Dynamic_TP/POA_Loader/svc.conf
new file mode 100644
index 00000000000..750b31c3b0d
--- /dev/null
+++ b/TAO/tests/Dynamic_TP/POA_Loader/svc.conf
@@ -0,0 +1,15 @@
+# $Id$
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName ORB -DTPMin 5 -DTPInit 6 -DTPMax 10 -DTPTimeout 240 -DTPStack 10240 -DTPQueue 20"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPMin 2 -DTPInit 4 -DTPMax 10 -DTPQueue 10"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPOverwrite 1 -DTPMin 7 -DTPMax 14 "
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName POA1 -DTPMin 7 -DTPMax 11 -DPQueue 14"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName defaults"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m1 -DTPMin 3"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m2 -DTPMax 10"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m3 -DTPTimeout 120"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m4 -DTPMin 3 -DTPInit 7 -DTPMax 10 -DTPTimeout 120"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m5 -DTPMin 3 -DTPInit 10 -DTPTimeout 30"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m6 -DTPInit 6 -DTPMax -1"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName m7 -DTPInit 7"
+dynamic Dynamice_TP_Config Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_Config() "-DTPName bogus -DTPMin 6 -DTPInit 3"
+dynamic Dynamic_TP_POA_Loader Service_Object * TAO_Dynamic_TP:_make_TAO_Dynamic_TP_POA_Loader() "-DTPPOAConfigMap MyPOA,MyPOA2,MyPOA3:POA1"
diff --git a/TAO/tests/IDL_Test/IDL_Test.mpc b/TAO/tests/IDL_Test/IDL_Test.mpc
index d23f339a4e9..13d97910bce 100644
--- a/TAO/tests/IDL_Test/IDL_Test.mpc
+++ b/TAO/tests/IDL_Test/IDL_Test.mpc
@@ -84,13 +84,6 @@ project(*IDL): taoserver, messaging, gen_ostream {
typedef.idl
typecode.idl
}
-
- IDL_Files {
- // Workaround to get tao_idl to process multiple files in one pass,
- // since MPC doesn't support it.
- idlflags += loader_const.idl
- PEMNaming.idl
- }
}
project(*DLL): taoidldefaults, taolib, messaging {
@@ -165,7 +158,6 @@ project(*DLL): taoidldefaults, taolib, messaging {
keywordsA.cpp
keywordsC.cpp
keywordsS.cpp
- loader_constC.cpp
moduleA.cpp
moduleC.cpp
moduleS.cpp
@@ -185,8 +177,6 @@ project(*DLL): taoidldefaults, taolib, messaging {
old_unionS.cpp
paramsC.cpp
paramsS.cpp
- PEMNamingC.cpp
- PEMNamingS.cpp
pragmaA.cpp
pragmaC.cpp
pragmaS.cpp
diff --git a/TAO/tests/IDL_Test/PEMNaming.idl b/TAO/tests/IDL_Test/PEMNaming.idl
deleted file mode 100644
index 52069315e1c..00000000000
--- a/TAO/tests/IDL_Test/PEMNaming.idl
+++ /dev/null
@@ -1,61 +0,0 @@
-
-#ifndef _PEM_NAMING_IDL_
-#define _PEM_NAMING_IDL_
-
-module Plesk
-{
- typedef long TObjectID;
-
- enum TBool
- {
- TB_NO,
- TB_YES,
- TB_MAYBE
- };
-
- struct TProperty
- {
- string name;
- string value;
- };
-
- typedef sequence<TProperty> TPropertyList;
-
- exception ExSystem
- {
- string module_id;
- long extype_id;
- long errcode;
- long errcode_minor;
- string errmsg;
- TPropertyList props;
- TBool transient;
- };
-
- module Naming
- {
-
- struct NamingContext
- {
- string kernel_resolver_ior;
- };
-
- const long ERR_NO_SUCH_OBJ = 6; // don't change it
- // reserved for Naming
-
- interface ObjectResolver
- {
-# pragma version ObjectResolver 1.2
-
- Object
- resolve(in string service_type, inout TObjectID sc_id)
- raises (ExSystem);
-
- Object
- resolve_sc(in string service_type, in string version, inout TObjectID sc_id)
- raises (ExSystem);
- };
- }; // module Naming
-}; // module Plesk
-
-#endif // _PEM_NAMING_IDL_
diff --git a/TAO/tests/IDL_Test/loader_const.idl b/TAO/tests/IDL_Test/loader_const.idl
deleted file mode 100644
index c12c20623ea..00000000000
--- a/TAO/tests/IDL_Test/loader_const.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _LOADER_CONST_IDL_
-#define _LOADER_CONST_IDL_
-
-// This include caused a crash when another IDL file is processed after
-// this one in one pass. The node in the AST corresponding to the CORBA
-// module where the basic types are declared contained garbage due to
-// subsequent openings in the included file, which are destroyed between
-// files in the list (unlike the one containing the basic types).
-#include <orb.idl>
-
-#pragma prefix ""
-
-module Plesk {
- const unsigned long PLESK_VENDOR_ID = 40000;
-}; /* module Plesk */
-
-#endif /* _LOADER_CONST_IDL_ */
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp
new file mode 100644
index 00000000000..250ee6a55d4
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.cpp
@@ -0,0 +1,26 @@
+// $Id$
+#include "Hello.h"
+#include <iostream>
+
+Hello::Hello (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+char *
+Hello::get_string (void)
+{
+ return CORBA::string_dup ("Hello there!");
+}
+
+void
+Hello::set_string (const char * s)
+{
+ std::cout << "Call to Hello::set_string (" << s << ")" << std::endl;
+}
+
+void
+Hello::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h
new file mode 100644
index 00000000000..ad83199b24e
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Hello.h
@@ -0,0 +1,33 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// 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 (void);
+
+ virtual void set_string (const char * s);
+
+ virtual void shutdown (void);
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/README b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/README
new file mode 100644
index 00000000000..a12accca62a
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/README
@@ -0,0 +1,14 @@
+$Id$
+
+ This tests shows that by using -ORBForwardOnTransientLimit and -ORBForwardDelay
+ options on a client, the client will retry establishing
+ a connection to a server before throwing a TRANSIENT exception.
+
+ This is done by having the client start first, wait a few seconds, and then
+ start the server.
+
+ To run the test use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Retry_On_Connection_Failure.mpc b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Retry_On_Connection_Failure.mpc
new file mode 100644
index 00000000000..0b23fc42f14
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Retry_On_Connection_Failure.mpc
@@ -0,0 +1,37 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ idlflags += -Sp
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoserver, iortable {
+ after += *idl
+ Source_Files {
+ Hello.cpp
+ server.cpp
+ }
+ Source_Files {
+ TestC.cpp
+ TestS.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient {
+ after += *idl
+ Source_Files {
+ client.cpp
+ }
+ Source_Files {
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl
new file mode 100644
index 00000000000..c546c828670
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/Test.idl
@@ -0,0 +1,22 @@
+//
+// $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 oneway operation takes a
+ /// different path to get to a TRANSIENT
+ /// exception.
+ oneway void set_string (in string s);
+
+ /// Shutdown the ORB
+ oneway void shutdown ();
+ };
+};
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp
new file mode 100644
index 00000000000..c2fa3ae7849
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/client.cpp
@@ -0,0 +1,87 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior");
+bool oneway_call = false;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'o':
+ oneway_call = ACE_OS::atoi (get_opts.opt_arg ()) != 0;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-o <oneway flag> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp = orb->string_to_object(ior);
+
+ Test::Hello_var hello = Test::Hello::_narrow(tmp.in ());
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ if (oneway_call)
+ {
+ CORBA::String_var the_string = CORBA::string_dup( "Test" );
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Client sending string <%C> oneway\n",
+ the_string.in ()));
+ hello->set_string (the_string);
+ }
+ else
+ {
+ CORBA::String_var the_string = hello->get_string ();
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Client getting string <%C>\n",
+ the_string.in ()));
+ }
+
+ hello->shutdown ();
+
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl
new file mode 100755
index 00000000000..7436a6abe30
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/run_test.pl
@@ -0,0 +1,104 @@
+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::TestTarget;
+
+$status = 0;
+$debug_level = '0';
+$cdebug_level = '0';
+$oneway_call = 0;
+foreach $i (@ARGV) {
+ if ($i eq '-oneway') {
+ $oneway_call = 1;
+ }
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+ if ($i eq '-cdebug') {
+ $cdebug_level = '10';
+ }
+}
+
+my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+
+my $iorbase = "server.ior";
+my $host = $server->HostName();
+my $port = $server->RandomPort();
+my $endpoint = $host . ":" . $port;
+my $server_iorfile = $server->LocalFile ($iorbase);
+my $client_iorfile = $client->LocalFile ($iorbase);
+$server->DeleteFile($iorbase);
+$client->DeleteFile($iorbase);
+
+$SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level " .
+ "-o $server_iorfile " .
+ "-ORBEndpoint iiop://$endpoint");
+
+$CL = $client->CreateProcess ("client", "-ORBdebuglevel $debug_level " .
+ "-o $oneway_call " .
+ "-ORBForwardOnTransientLimit 20 " .
+ "-ORBForwardDelay 500 " .
+ "-k corbaloc::$endpoint/Simple_Server");
+
+print STDERR $CL->CommandLine () . "\n";
+$client_status = $CL->Spawn ();
+
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+}
+
+print "Waiting to start server\n";
+
+sleep(2);
+
+print STDERR $SV->CommandLine () . "\n";
+$server_status = $SV->Spawn ();
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ exit 1;
+}
+
+if ($server->WaitForFileTimed ($iorbase,
+ $server->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+if ($server->GetFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $status = 1;
+}
+
+$client_status = $CL->WaitKill ($client->ProcessStopWaitInterval());
+
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+}
+
+$server->DeleteFile($iorbase);
+$client->DeleteFile($iorbase);
+
+exit $status;
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp
new file mode 100644
index 00000000000..c08c71cb744
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Connection_Failure/server.cpp
@@ -0,0 +1,115 @@
+// $Id$
+
+#include "Hello.h"
+#include "tao/IORTable/IORTable.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+
+const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior");
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ 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 ();
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl = 0;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in ()),
+ 1);
+ PortableServer::ServantBase_var owner_transfer(hello_impl);
+
+ PortableServer::ObjectId_var id =
+ root_poa->activate_object (hello_impl);
+
+ CORBA::Object_var object = root_poa->id_to_reference (id.in ());
+
+ Test::Hello_var hello = Test::Hello::_narrow (object.in ());
+
+ CORBA::String_var ior = orb->object_to_string (hello.in ());
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references("IORTable");
+
+ IORTable::Table_var table =
+ IORTable::Table::_narrow (table_object.in ());
+ if (CORBA::is_nil (table.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the IORTable.\n"),
+ 1);
+ table->bind ("Simple_Server", ior.in ());
+
+ // 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_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop starting\n"));
+
+ orb->run ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1);
+
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/README b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/README
new file mode 100755
index 00000000000..b24ca308f8c
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/README
@@ -0,0 +1,23 @@
+/**
+
+$Id$
+
+@page Retry_On_Reply_Failure Test README File
+
+ This is test for the invocation retry feature when a client
+ receives OBJECT_NOT_EXIST, COMM_FAILURE, TRANSIENT or INV_OBJREF
+ exceptions from server as a reply to a request.
+ This feature can be enabled and disabled by -ORBForwardOnObjectNotExistLimit
+ -ORBForwardOnCommFailureLimit, -ORBForwardOnOnTransientLimit and
+ -ORBForwardOnInvObjLimit options with value 0(disable) and 1(enable).
+
+ The starting point for this test implementation was the
+ ForwardOnceUponException test.
+
+ To execute the test simply run:
+
+$ ./run_test.pl
+
+ the script returns 0 on success and non-zero on failures.
+
+*/
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/Retry_On_Reply_Failure.mpc b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/Retry_On_Reply_Failure.mpc
new file mode 100755
index 00000000000..ee705f01845
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/Retry_On_Reply_Failure.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoserver, iortable {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ server.cpp
+ }
+ Source_Files {
+ testC.cpp
+ testS.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, anytypecode {
+ after += *idl
+ Source_Files {
+ client.cpp
+ }
+ Source_Files {
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/client.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/client.cpp
new file mode 100755
index 00000000000..ecd2d0df42d
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/client.cpp
@@ -0,0 +1,278 @@
+// $Id$
+
+#include "testC.h"
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+#include "ace/streams.h"
+#include "tao/Invocation_Utils.h"
+#include "ace/OS_NS_unistd.h"
+
+const ACE_TCHAR *ior = ACE_TEXT("file://test.ior");
+int nthreads = 1;
+static const ACE_TCHAR corbaloc_prefix[] = ACE_TEXT("corbaloc:");
+int expect_ex_kind = TAO::FOE_NON;
+int num_requests = 1;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:e:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'e':
+ expect_ex_kind = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior>"
+ "-e <expected exception kind> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ if (ACE_OS::strncmp (ior,
+ corbaloc_prefix,
+ ACE_OS::strlen(corbaloc_prefix)) != 0)
+ return 1;
+
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+class Worker : public ACE_Task_Base
+{
+public:
+ Worker (CORBA::ORB_ptr orb);
+ // Constructor
+
+ // = The Task_Base methods
+ virtual int svc (void);
+
+ // Caught any exception ?
+ int received_ex_kind () const;
+
+ // Return number of received exceptions.
+ int num_received_ex () const;
+
+ // Indicate if the invocation completed.
+ bool invocation_completed () const;
+
+ // Is test done ?
+ void done ();
+
+private:
+
+ // The ORB reference
+ CORBA::ORB_var orb_;
+ // The exceptions caught.
+ int received_ex_kind_;
+ // The number of received exceptions.
+ int num_received_ex_;
+ // Flag indicating that the invocation was completed.
+ bool invocation_completed_;
+ // Flag for test completion. The result is
+ // collected before done.
+ bool done_;
+};
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Worker worker (orb.in ());
+
+ if (worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Cannot activate worker threads\n"),
+ 1);
+
+ int timeout = 30;
+ int now = 0;
+ while (now < timeout &&
+ ((expect_ex_kind == 0 && !worker.invocation_completed ()) ||
+ (expect_ex_kind != 0 && expect_ex_kind != worker.received_ex_kind ()))
+ )
+ {
+ std::cout << "." << std::flush;
+ now += 1;
+ ACE_Time_Value tv (1, 0);
+ orb->run (tv);
+ }
+ ACE_ASSERT (now != 0);
+
+
+ std::cout << std::endl;
+
+ worker.done ();
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior);
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ());
+
+ server->shutdown ();
+
+ ACE_OS::sleep (1);
+
+ orb->destroy ();
+
+ worker.thr_mgr ()->wait ();
+
+
+ bool expect_no_ex =
+ expect_ex_kind == TAO::FOE_NON && worker.num_received_ex () == 0 && worker.invocation_completed ();
+ bool expect_ex_received =
+ expect_ex_kind == worker.received_ex_kind () && worker.num_received_ex () > 0 && !worker.invocation_completed ();
+ if (expect_no_ex || expect_ex_received)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)client: test passed.\n"));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR, "(%P|%t)client: test failed.\n"));
+ return 1;
+ }
+ }
+
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught in main:");
+ return 1;
+ }
+
+ return 0;
+}
+
+// ****************************************************************
+
+Worker::Worker (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ received_ex_kind_ (TAO::FOE_NON),
+ num_received_ex_ (0),
+ invocation_completed_ (false),
+ done_ (false)
+{
+}
+
+int
+Worker::svc (void)
+{
+ try
+ {
+ CORBA::Object_var object =
+ this->orb_->string_to_object (ior);
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ());
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Object reference <%s> is nil.\n",
+ ior));
+ return 0;
+ }
+
+ try {
+ CORBA::Boolean r =
+ server->test_is_a ("IDL:Foo:1.0");
+
+ this->invocation_completed_ = true;
+
+ if (r != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) unexpected result = %d\n",
+ r));
+
+ }
+ catch (const CORBA::OBJECT_NOT_EXIST &)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)received OBJECT_NOT_EXIST \n"));
+ if (!this->done_)
+ {
+ ++ this->num_received_ex_;
+ received_ex_kind_ |= TAO::FOE_OBJECT_NOT_EXIST;
+ }
+ }
+ catch (const CORBA::COMM_FAILURE &)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)received COMM_FAILURE \n"));
+ if (!this->done_)
+ {
+ ++ this->num_received_ex_;
+ received_ex_kind_ |= TAO::FOE_COMM_FAILURE;
+ }
+ }
+ catch (const CORBA::TRANSIENT &)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)received TRANSIENT \n"));
+ if (!this->done_)
+ {
+ ++ this->num_received_ex_;
+ received_ex_kind_ |= TAO::FOE_TRANSIENT;
+ }
+ }
+ catch (const CORBA::INV_OBJREF &)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)received INV_OBJREF \n"));
+ if (!this->done_)
+ {
+ ++ this->num_received_ex_;
+ received_ex_kind_ |= TAO::FOE_INV_OBJREF;
+ }
+ }
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Unexpected exception caught");
+ }
+
+ return 0;
+}
+
+
+int
+Worker::received_ex_kind () const
+{
+ return received_ex_kind_;
+}
+
+int
+Worker::num_received_ex () const
+{
+ return num_received_ex_;
+}
+
+bool
+Worker::invocation_completed () const
+{
+ return invocation_completed_;
+}
+
+void
+Worker::done ()
+{
+ done_ = true;
+}
+
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/run_test.pl
new file mode 100755
index 00000000000..4f779484bd7
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/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 "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+# Current supported forward once exceptions:
+# EF_OBJECT_NOT_EXIST = 0x1,
+# EF_COMM_FAILURE = 0x2,
+# EF_TRANSIENT = 0x4,
+# EF_INV_OBJREF = 0x8,
+@configurations = ({
+ description => "case 1: retry on OBJECT_NOT_EXIST exceptions until no failure",
+ orb_invocation_retry_opts => "-ORBForwardOnObjectNotExistLimit 10 -ORBForwardDelay 50",
+ client_expect_ex_kind => "0",
+ server_raise_ex_kind => "1",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 2: retry on OBJECT_NOT_EXIST exceptions and give up",
+ orb_invocation_retry_opts => "-ORBForwardOnObjectNotExistLimit 1 -ORBForwardDelay 50",
+ client_expect_ex_kind => "1",
+ server_raise_ex_kind => "1",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 3: retry on COMM_FAILURE exceptions until no failure",
+ orb_invocation_retry_opts => "-ORBForwardOnCommFailureLimit 10 -ORBForwardDelay 50",
+ client_expect_ex_kind => "0",
+ server_raise_ex_kind => "2",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 4: retry on COMM_FAILURE exceptions and give up",
+ orb_invocation_retry_opts => "-ORBForwardOnCommFailureLimit 1 -ORBForwardDelay 50",
+ client_expect_ex_kind => "2",
+ server_raise_ex_kind => "2",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 5: retry on TRANSIENT exceptions until no failure",
+ orb_invocation_retry_opts => "-ORBForwardOnTransientLimit 10 -ORBForwardDelay 50",
+ client_expect_ex_kind => "0",
+ server_raise_ex_kind => "4",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 6: retry on TRANSIENT exceptions and give up",
+ orb_invocation_retry_opts => "-ORBForwardOnTransientLimit 1 -ORBForwardDelay 50",
+ client_expect_ex_kind => "4",
+ server_raise_ex_kind => "4",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 7: retry on INV_OBJREF exceptions until no failure",
+ orb_invocation_retry_opts => "-ORBForwardOnInvObjrefLimit 10 -ORBForwardDelay 50",
+ client_expect_ex_kind => "0",
+ server_raise_ex_kind => "8",
+ num_exceptions_to_throw => 2,
+ },{
+ description => "case 8: retry on INV_OBJREF exceptions and give up",
+ orb_invocation_retry_opts => "-ORBForwardOnInvObjrefLimit 1 -ORBForwardDelay 50",
+ client_expect_ex_kind => "8",
+ server_raise_ex_kind => "8",
+ num_exceptions_to_throw => 2,
+ },
+
+
+
+ );
+
+my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+
+my $iorbase = "test.ior";
+my $host = $server->HostName();
+my $server_iorfile = $server->LocalFile ($iorbase);
+my $client_iorfile = $client->LocalFile ($iorbase);
+
+for $test (@configurations) {
+ print STDERR "\n==== Running $test->{description} \n\n";
+
+ my $port = $server->RandomPort();
+ $server->DeleteFile($iorbase);
+ $client->DeleteFile($iorbase);
+
+ $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level ".
+ "-o $server_iorfile ".
+ "-ORBEndpoint iiop://$host:$port ".
+ "-e $test->{server_raise_ex_kind} ".
+ "-n $test->{num_exceptions_to_throw}");
+
+ $CL = $client->CreateProcess ("client", "-k corbaloc::$host:$port/Simple_Server ".
+ "-e $test->{client_expect_ex_kind} ".
+ "$test->{orb_invocation_retry_opts}");
+
+ print STDERR $SV->CommandLine () . "\n";
+ print STDERR $CL->CommandLine () . "\n";
+
+ $server_status = $SV->Spawn ();
+
+ if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ exit 1;
+ }
+
+ if ($server->WaitForFileTimed ($iorbase,
+ $server->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ if ($server->GetFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ if ($client->PutFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
+
+ if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+ }
+
+ $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
+
+ if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $status = 1;
+ }
+
+}
+
+$server->DeleteFile($iorbase);
+$client->DeleteFile($iorbase);
+
+exit $status;
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/server.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/server.cpp
new file mode 100755
index 00000000000..295e3bd018d
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/server.cpp
@@ -0,0 +1,121 @@
+// $Id$
+
+#include "test_i.h"
+#include "tao/IORTable/IORTable.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/Invocation_Utils.h"
+
+const ACE_TCHAR *ior_output_file = ACE_TEXT("test.ior");
+int num_exceptions_to_throw = 0;
+int raise_exception = TAO::FOE_NON;
+int num_requests = 1;
+
+int
+parse_args (int argc, ACE_TCHAR *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:e:n:"));
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'e':
+ raise_exception = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'n':
+ num_exceptions_to_throw = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <raise_exception> -n <num_exceptions_to_throw>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i server_impl (orb.in (), num_exceptions_to_throw);
+
+ PortableServer::ObjectId_var id =
+ root_poa->activate_object (&server_impl);
+
+ CORBA::Object_var object = root_poa->id_to_reference (id.in ());
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ());
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in ());
+
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references("IORTable");
+
+ IORTable::Table_var table =
+ IORTable::Table::_narrow (table_object.in ());
+ if (CORBA::is_nil (table.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the IORTable.\n"),
+ 1);
+ table->bind ("Simple_Server", ior.in ());
+
+ //ACE_DEBUG ((LM_DEBUG, "Activated as <%C>\n", ior.in ()));
+
+ 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 ();
+
+ orb->run ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t)server: event loop finished\n"));
+
+ root_poa->destroy (1, 1);
+
+ orb->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught in server:");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test.idl b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test.idl
new file mode 100755
index 00000000000..b9aa7108ed3
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test.idl
@@ -0,0 +1,8 @@
+// $Id$
+
+interface Simple_Server
+{
+ boolean test_is_a (in string type);
+
+ oneway void shutdown ();
+};
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp
new file mode 100755
index 00000000000..042b552b16d
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.cpp
@@ -0,0 +1,58 @@
+// $Id$
+
+#include "test_i.h"
+#include "tao/Invocation_Utils.h"
+
+extern int raise_exception;
+
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb, int num_exceptions_to_throw)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , num_exceptions_to_throw_(num_exceptions_to_throw)
+ , num_exceptions_thrown_(0)
+ , raise_exception_ (TAO::FOE_NON)
+{
+}
+
+CORBA::Boolean
+Simple_Server_i::test_is_a (const char * /* type */)
+{
+ if (this->num_exceptions_thrown_ ==
+ this->num_exceptions_to_throw_)
+ return 0;
+
+ if ((raise_exception & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST)
+ {
+ //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called and raise OBJECT_NOT_EXIST\n"));
+ ++this->num_exceptions_thrown_;
+ throw ::CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO);
+ }
+
+ if ((raise_exception & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE)
+ {
+ //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called and raise COMM_FAILURE\n"));
+ ++this->num_exceptions_thrown_;
+ throw ::CORBA::COMM_FAILURE (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO);
+ }
+
+ if ((raise_exception & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT)
+ {
+ //ACE_DEBUG ((LM_DEBUG, "(%P|%t) \t called and raise TRANSIENT\n"));
+ ++this->num_exceptions_thrown_;
+ throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO);
+ }
+
+ if ((raise_exception & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF)
+ {
+ //ACE_DEBUG ((LM_DEBUG, "(%P|%t) test_is_a called %d and raise INV_OBJREF\n", ncalls_));
+ ++this->num_exceptions_thrown_;
+ throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO);
+ }
+
+ return 0;
+}
+
+void
+Simple_Server_i::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.h b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.h
new file mode 100755
index 00000000000..8bc654aab28
--- /dev/null
+++ b/TAO/tests/Multiple_Retry_Tests/Retry_On_Reply_Failure/test_i.h
@@ -0,0 +1,46 @@
+
+//=============================================================================
+/**
+ * @file test_i.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan
+ */
+//=============================================================================
+
+
+#ifndef TAO_RETRY_ON_REPLY_FAILURE_I_H
+#define TAO_RETRY_ON_REPLY_FAILURE_I_H
+
+#include "testS.h"
+
+/**
+ * @class Simple_Server_i
+ *
+ * @brief Simpler Server implementation
+ *
+ * Implements the Simple_Server interface in test.idl
+ */
+class Simple_Server_i : public POA_Simple_Server
+{
+public:
+ /// ctor
+ Simple_Server_i (CORBA::ORB_ptr orb, int num_exceptions_to_throw);
+
+ // = The Simple_Server methods.
+ CORBA::Boolean test_is_a (const char * type);
+
+ void shutdown (void);
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ int num_exceptions_to_throw_;
+ int num_exceptions_thrown_;
+
+ int raise_exception_;
+};
+
+#endif /* TAO_RETRY_ON_REPLY_FAILURE_I_H */
diff --git a/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp b/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
index 2787fec934f..33fcae3e2a7 100644
--- a/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
+++ b/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
@@ -12,9 +12,8 @@
ACE_TCHAR const * const scpc_loadOrb = // NOTE due to the way ACE_DYNAMIC_SERVICE_DIRECTIVE() macro is defined,
// each parameter CANNOT be split into multiple quoted strings "line1" "nextline" with the expectation that
// they will be join together. Hence the long parameter 4.
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE ("testDllOrb",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE ("testDllOrb",
"DllOrb",
- TAO_VERSION,
"_make_DllOrb",
"DllOrb -t 1 -ORBGestalt Local -ORBDebugLevel 3 -ORBId testORB -ORBInitRef NameService=file:///tmp/test-ns.ior -ORBDottedDecimalAddresses 1"
);
diff --git a/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp b/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp
index 338701e06fa..b8e310f35f2 100644
--- a/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp
+++ b/TAO/tests/ORB_Local_Config/Service_Dependency/Test.cpp
@@ -152,9 +152,8 @@ testORBInitializer_Registry (int , ACE_TCHAR *[])
if (oir == 0)
{
one->process_directive (
- ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("ORBInitializer_Registry",
+ ACE_DYNAMIC_SERVICE_DIRECTIVE("ORBInitializer_Registry",
"TAO_PI",
- TAO_VERSION,
"_make_ORBInitializer_Registry",
""));
oir =
@@ -252,9 +251,8 @@ testORBInitializer_Registry (int , ACE_TCHAR *[])
" (although ORBInitializer_Registry already did it) ...\n"));
one->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("PolicyFactory_Loader",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("PolicyFactory_Loader",
"TAO_PI",
- TAO_VERSION,
"_make_TAO_PolicyFactory_Loader",
""));
@@ -293,9 +291,8 @@ testServiceDependency (int , ACE_TCHAR *[])
ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt_Test> one (new ACE_Service_Gestalt_Test (10));
int result = one->process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TAO_Codeset",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Codeset",
"TAO_Codeset",
- TAO_VERSION,
"_make_TAO_Codeset_Manager_Factory",
""));
if (result != 0)
diff --git a/TAO/tests/POA/Non_Retain_System_Id/Non_Retain_System_Id.mpc b/TAO/tests/POA/Non_Retain_System_Id/Non_Retain_System_Id.mpc
new file mode 100644
index 00000000000..f4e31f3dfd0
--- /dev/null
+++ b/TAO/tests/POA/Non_Retain_System_Id/Non_Retain_System_Id.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(POA*): taoserver, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro {
+ exename = test
+}
diff --git a/TAO/tests/POA/Non_Retain_System_Id/run_test.pl b/TAO/tests/POA/Non_Retain_System_Id/run_test.pl
new file mode 100755
index 00000000000..18bd124e73a
--- /dev/null
+++ b/TAO/tests/POA/Non_Retain_System_Id/run_test.pl
@@ -0,0 +1,22 @@
+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::TestTarget;
+
+my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
+$SV = $server->CreateProcess ("test");
+
+$test = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval());
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ exit 1;
+}
+
+exit 0;
diff --git a/TAO/tests/POA/Non_Retain_System_Id/test.cpp b/TAO/tests/POA/Non_Retain_System_Id/test.cpp
new file mode 100644
index 00000000000..95b5a5614ff
--- /dev/null
+++ b/TAO/tests/POA/Non_Retain_System_Id/test.cpp
@@ -0,0 +1,215 @@
+
+//=============================================================================
+/**
+ * @file test.cpp
+ *
+ * $Id$
+ *
+ * This program verifies that a POA using the NON_RETAIN policy creates
+ * unique system IDs, also that objects created with a USER id policy is
+ * not given a bo
+ *
+ * @author Phil Mesnier
+ */
+//=============================================================================
+
+
+#include "testS.h"
+#include "ace/SString.h"
+#include "tao/PortableServer/POA_Current.h"
+
+class ID_Check_i : public POA_ID_Check
+{
+public:
+ ID_Check_i (int num);
+ ~ID_Check_i (void);
+
+ void set_id (int index, PortableServer::ObjectId_var oid);
+
+ CORBA::Boolean check_servant_id (CORBA::Short index);
+
+private:
+ int count_;
+ PortableServer::ObjectId_var * oids_;
+ PortableServer::Current_var current_;
+};
+
+ID_Check_i::ID_Check_i (int num)
+ : count_ (num),
+ oids_ (0),
+ current_ ()
+{
+ int argc = 0;
+ char **argv = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+ CORBA::Object_var obj = orb->resolve_initial_references ("POACurrent");
+ current_ = PortableServer::Current::_narrow (obj.in());
+
+ oids_ = new PortableServer::ObjectId_var[num];
+}
+
+ID_Check_i::~ID_Check_i (void)
+{
+ delete [] oids_;
+}
+
+void
+ID_Check_i::set_id (int index, PortableServer::ObjectId_var oid)
+{
+ this->oids_[index] = oid;
+}
+
+CORBA::Boolean
+ID_Check_i::check_servant_id (CORBA::Short index)
+{
+ if (index < 0 || index >= this->count_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("check_servant_id: requested index outside of range\n")));
+ return false;
+ }
+ PortableServer::ObjectId_var oid = this->current_->get_object_id();
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("check_servant_id: index = %d current objectid ")
+ ACE_TEXT ("len %d octets: "),
+ index, oid->length()));
+ for (size_t i = 0; i < oid->length () && i < 16; i++)
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("%02x "), oid[i]));
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT ("\n")));
+
+ if (oid->length() != this->oids_[index]->length())
+ return false;
+ for (size_t i = 0; i < oid->length(); i++)
+ {
+ if (oid[i] != this->oids_[index][i])
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("check_servant_id: id[%d] mismatch at position %d, ")
+ ACE_TEXT ("got %d, expected %d\n"),
+ index, i, oid[i], this->oids_[index][i]));
+ return false;
+ }
+ }
+ return true;
+}
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+ // Initialize the ORB.
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ // Obtain the RootPOA.
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA");
+
+ // Narrow to POA.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (object.in ());
+
+ // Get the POAManager of the RootPOA.
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+
+ // Policies for the new POA.
+ CORBA::PolicyList policies (4);
+ policies.length (3);
+
+ // Request Processing Policy.
+ policies[0] =
+ root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT);
+
+ // Id Uniqueness Policy.
+ policies[1] =
+ root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID);
+
+ // Servant Retention Policy.
+ policies[2] =
+ root_poa->create_servant_retention_policy (PortableServer::NON_RETAIN);
+
+ // Create POA to host default servant.
+ ACE_CString name = "System IDs";
+ PortableServer::POA_var sys_id_poa =
+ root_poa->create_POA (name.c_str (),
+ poa_manager.in (),
+ policies);
+
+ policies.length (4);
+ policies[3] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID);
+
+ name = "User IDs";
+ PortableServer::POA_var user_id_poa =
+ root_poa->create_POA (name.c_str (),
+ poa_manager.in (),
+ policies);
+
+ // Destroy policies.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy ();
+ }
+
+ int objcount = 30;
+
+ ID_Check_i *servant = new ID_Check_i (objcount);
+ sys_id_poa->set_servant (servant);
+ user_id_poa->set_servant (servant);
+
+ // Activate POA manager.
+ poa_manager->activate ();
+
+ // Create object array.
+ ID_Check_var *refs = new ID_Check_var[objcount];
+ PortableServer::ObjectId_var obj_id;
+ char *user_id_str = new char[10];
+
+ for (int i = 0; i < objcount; i++)
+ {
+ if (i < objcount / 2)
+ {
+ object = sys_id_poa->create_reference ("IDL:ID_Check:1.0");
+ refs[i] = ID_Check::_narrow (object.in());
+ obj_id = sys_id_poa->reference_to_id (object);
+ servant->set_id (i, obj_id);
+ }
+ else
+ {
+ ACE_OS::sprintf (user_id_str, "id %d", i);
+ obj_id = PortableServer::string_to_ObjectId (user_id_str);
+ object = user_id_poa->create_reference_with_id (obj_id.in(),
+ "IDL:ID_Check:1.0");
+ refs[i] = ID_Check::_narrow (object.in());
+ servant->set_id (i, obj_id);
+ }
+ }
+
+ int successes = 0;
+ for (int i = 0; i < objcount; i++)
+ {
+ successes += refs[i]->check_servant_id (i) ? 1 : 0;
+ }
+
+ orb->destroy ();
+
+ if (successes != objcount)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("FAILURE: only got %d ids correct out of %d\n"),
+ successes, objcount));
+ return -1;
+ }
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Success: All ids match\n")));
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/TAO/tests/POA/Non_Retain_System_Id/test.idl b/TAO/tests/POA/Non_Retain_System_Id/test.idl
new file mode 100644
index 00000000000..8fb4acbb8ee
--- /dev/null
+++ b/TAO/tests/POA/Non_Retain_System_Id/test.idl
@@ -0,0 +1,6 @@
+// $Id$
+
+interface ID_Check
+{
+ boolean check_servant_id (in short index);
+};
diff --git a/TAO/tests/TransportCurrent/Framework/simple.cpp b/TAO/tests/TransportCurrent/Framework/simple.cpp
index 4a121500240..0b5d3a458b2 100644
--- a/TAO/tests/TransportCurrent/Framework/simple.cpp
+++ b/TAO/tests/TransportCurrent/Framework/simple.cpp
@@ -55,9 +55,8 @@ testCurrentLoader (int, char *[])
#if !defined (TAO_AS_STATIC_LIBS)
int ret = ACE_Service_Config::process_directive
- (ACE_DYNAMIC_VERSIONED_SERVICE_DIRECTIVE("TAO_Transport_Current_Loader",
+ (ACE_DYNAMIC_SERVICE_DIRECTIVE("TAO_Transport_Current_Loader",
"TAO_Transport_Current",
- TAO_VERSION
"_make_TAO_Transport_Current_Loader",
""));
ACE_ASSERT (ret == 0);
diff --git a/TAO/tests/Var_Deref/README.txt b/TAO/tests/Var_Deref/README.txt
new file mode 100644
index 00000000000..2f6afd2fc07
--- /dev/null
+++ b/TAO/tests/Var_Deref/README.txt
@@ -0,0 +1,8 @@
+$Id$
+
+This test is intended to demonstrate that Var types can be
+dereferenced to the pointer type using a casting operation.
+
+This behavior is dangerous in that the reference count is not
+increased by extracting the pointer, thus using for anything more than
+simple status testing should not be done.
diff --git a/TAO/tests/Var_Deref/Test.idl b/TAO/tests/Var_Deref/Test.idl
new file mode 100644
index 00000000000..b395b3a0711
--- /dev/null
+++ b/TAO/tests/Var_Deref/Test.idl
@@ -0,0 +1,19 @@
+// $Id$
+
+module Test
+{
+
+ struct FixedStruct
+ {
+ long l;
+ };
+
+ struct VarStruct
+ {
+ string st;
+ };
+
+ typedef sequence <FixedStruct> FixedSeq;
+ typedef sequence <VarStruct> VarSeq;
+
+};
diff --git a/TAO/tests/Var_Deref/Var_Deref.mpc b/TAO/tests/Var_Deref/Var_Deref.mpc
new file mode 100644
index 00000000000..05811812315
--- /dev/null
+++ b/TAO/tests/Var_Deref/Var_Deref.mpc
@@ -0,0 +1,23 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ idlflags += -Sp
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*exe): taoclient {
+ exename = var_deref
+ after += *idl
+ Source_Files {
+ var_deref.cpp
+ }
+ Source_Files {
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/tests/Var_Deref/var_deref.cpp b/TAO/tests/Var_Deref/var_deref.cpp
new file mode 100644
index 00000000000..d48bba980c3
--- /dev/null
+++ b/TAO/tests/Var_Deref/var_deref.cpp
@@ -0,0 +1,83 @@
+// $Id$
+
+#include "TestC.h"
+
+int
+ACE_TMAIN(int argc, ACE_TCHAR *argv[])
+{
+ int errors = 0;
+ Test::FixedStruct *ft = 0;
+ Test::FixedStruct_var ftvar ( new Test::FixedStruct );
+ Test::FixedStruct_var nftvar (0);
+
+ Test::FixedSeq *fs = 0;
+ Test::FixedSeq_var fsvar ( new Test::FixedSeq (0) );
+ Test::FixedSeq_var nfsvar (0);
+
+ Test::VarStruct *vt = 0;
+ Test::VarStruct_var vtvar ( new Test::VarStruct );
+ Test::VarStruct_var nvtvar (0);
+
+ Test::VarSeq *vs = 0;
+ Test::VarSeq_var vsvar (new Test::VarSeq (0) );
+ Test::VarSeq_var nvsvar (0);
+
+ ft = ftvar;
+ if (ft == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a non-null FixedStruct ref, got null\n"));
+ ++errors;
+ }
+ ft = nftvar;
+ if (ft != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a null FixedStruct ref, got non-null\n"));
+ ++errors;
+ }
+
+ fs = fsvar;
+ if (fs == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a non-null FixedSeq ref, got null\n"));
+ ++errors;
+ }
+ fs = nfsvar;
+ if (fs != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a null FixedSeq ref, got non-null\n"));
+ ++errors;
+ }
+
+ vt = vtvar;
+ if (vt == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a non-null VarStruct rev, got null\n"));
+ ++errors;
+ }
+ vt = nvtvar;
+ if (vt != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a null VarStruct rev, got non-null\n"));
+ ++errors;
+ }
+
+ vs = vsvar;
+ if (vs == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a non-null VarSeq rev, got null\n"));
+ ++errors;
+ }
+ vs = nvsvar;
+ if (vs != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Expected a null VarSeq rev, got non-null\n"));
+ ++errors;
+ }
+
+ if (errors == 0)
+ ACE_DEBUG ((LM_DEBUG, "Success: all dereferences worked as expected\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG, "Failure: %d dereferences didn't work\n", errors));
+
+ return errors;
+}
diff --git a/TAO/utils/catior/catior.mpc b/TAO/utils/catior/catior.mpc
index 15945b79937..65b6f71fa6f 100644
--- a/TAO/utils/catior/catior.mpc
+++ b/TAO/utils/catior/catior.mpc
@@ -24,9 +24,4 @@ project: namingexe, rtcorba, install, messaging, ziop {
Header_Files {
}
-
- InstallData_Files {
- gendir = .
- README.catior
- }
}
diff --git a/TAO/utils/logWalker/GIOP_Buffer.cpp b/TAO/utils/logWalker/GIOP_Buffer.cpp
new file mode 100644
index 00000000000..bd98f5eeedf
--- /dev/null
+++ b/TAO/utils/logWalker/GIOP_Buffer.cpp
@@ -0,0 +1,595 @@
+// $Id$
+
+#include "GIOP_Buffer.h"
+#include "ace/OS_NS_string.h"
+
+static const char *size_leadin_1_5 = "GIOP v1."; //"x msg, ";
+static size_t leadin_len_1_5 = 15;
+static const char *size_leadin_1_6 = "GIOP message v1."; //2, ";
+static size_t leadin_len_1_6 = 19;
+
+
+const char *GIOP_Buffer::size_leadin = 0;
+size_t GIOP_Buffer::leadin_len = 0;
+const size_t GIOP_Buffer::giop_header_len = 12;
+
+void
+GIOP_Buffer::init_leadin (int version)
+{
+ if (size_leadin == 0)
+ {
+ if (version == 150)
+ {
+ size_leadin = size_leadin_1_5;
+ leadin_len = leadin_len_1_5;
+ }
+ else
+ {
+ size_leadin = size_leadin_1_6;
+ leadin_len = leadin_len_1_6;
+ }
+ }
+}
+
+// GIOP 1.2 header: 12 bytes
+// Magic: 4
+// ver: 2
+// flags: 1 // bo
+// type: 1 // req/repl/lf/excp
+// len: 4
+//
+// Request 1.2 header:
+// req_id: 4
+// flags: 1
+// RESVD: 3
+// Address disposition: 4
+// target: <4 len, + len> [0-3 pad]
+// opname: <4 len, + len>
+
+// GIOP 1.0 header: 12 bytes
+// Magic: 4
+// ver: 2
+// byte_order: 1
+// type: 1 // req/repl/lf/excp
+// len: 4
+//
+// Request 1.0 header:
+/*
+struct RequestHeader_1_0 { // Renamed from RequestHeader
+ IOP::ServiceContextList service_context;
+ unsigned long request_id;
+ boolean response_expected;
+ sequence <octet> object_key;
+ string operation;
+ CORBA::OctetSeq requesting_principal;
+};
+*/
+// service_context: 4(count)+contexts.
+// context id: 4
+// content blob: 4(len) + len octets + (0-3)pad
+// request_id: 4
+// respexp: 1
+// RESVD: 3
+// Address disposition: 4
+// target: <4 len, + len> [0-3 pad]
+// opname: <4 len, + len>
+
+/*
+struct ReplyHeader_1_0 { // Renamed from ReplyHeader
+ IOP::ServiceContextList service_context;
+ unsigned long request_id;
+ ReplyStatusType_1_0 reply_status;
+ };
+ // GIOP 1.1
+ typedef ReplyHeader_1_0 ReplyHeader_1_1;
+ // Same Header contents for 1.0 and 1.1
+#else
+ // GIOP 1.2, 1.3
+ enum ReplyStatusType_1_2 {
+ NO_EXCEPTION,
+ USER_EXCEPTION,
+ SYSTEM_EXCEPTION,
+ LOCATION_FORWARD,
+ LOCATION_FORWARD_PERM,// new value for 1.2
+ NEEDS_ADDRESSING_MODE // new value for 1.2
+ };
+ struct ReplyHeader_1_2 {
+ unsigned long request_id;
+ ReplyStatusType_1_2 reply_status;
+ IOP::ServiceContextList service_context;
+ };
+
+ */
+
+
+
+static const size_t target_offset_12 = GIOP_Buffer::giop_header_len + 12;
+
+// 12 = req_id + flags + RESVD + addr disp.
+
+GIOP_Buffer::GIOP_Buffer(void)
+ : cdr_ (0),
+ preamble_(),
+ log_offset_(0),
+ thr_(0),
+ time_(0),
+ expected_req_id_(0),
+ expected_size_(0),
+ expected_type_(0),
+ buffer_size_(0),
+ wr_pos_ (0),
+ octets_ (0),
+ owner_ (0),
+ buffer_lost_ (false),
+ sending_(false),
+ oid_ (0),
+ oid_len_ (0),
+ opname_ (0),
+ req_id_ (0),
+ resp_exp_ (0),
+ reply_status_ (0),
+ ver_minor_ (0),
+ msg_size_ (0),
+ num_contexts_ (0),
+ header_parsed_ (false),
+ payload_start_ (0)
+{
+}
+
+GIOP_Buffer::GIOP_Buffer(const char *text,
+ size_t offset,
+ Thread *thread,
+ Invocation *owner)
+ : cdr_ (0),
+ preamble_(text),
+ log_offset_(offset),
+ thr_(thread),
+ time_(0),
+ expected_req_id_(0),
+ expected_size_(0),
+ expected_type_(0),
+ buffer_size_(0),
+ wr_pos_ (0),
+ octets_ (0),
+ owner_ (owner),
+ buffer_lost_ (false),
+ sending_(false),
+ oid_ (0),
+ oid_len_ (0),
+ opname_ (0),
+ req_id_ (0),
+ resp_exp_ (0),
+ reply_status_ (0),
+ ver_minor_ (0),
+ msg_size_ (0),
+ num_contexts_ (0),
+ header_parsed_ (false),
+ payload_start_ (0)
+{
+ const char *size_str = ACE_OS::strstr(text, size_leadin) + leadin_len;
+ const char *id = size_str == 0 ? 0 : ACE_OS::strchr(size_str, '[') + 1;
+ this->sending_ = ACE_OS::strstr(text,"send") ? 0 : 1;
+ this->expected_type_ = ACE_OS::strstr(text,"Request") ? 0 : 1;
+ this->expected_size_ = ACE_OS::strtol(size_str, 0,10);
+ this->expected_req_id_ = ACE_OS::strtol(id, 0, 10);
+ const char *time_tok = ACE_OS::strchr (text,'@');
+ if (time_tok != 0)
+ {
+ char timebuf[30];
+ ACE_OS::strncpy(timebuf, text, (time_tok - text));
+ timebuf[time_tok - text] = 0;
+ char *hms = ACE_OS::strchr (timebuf,' ');
+ if (hms != 0)
+ {
+ int hr, min, sec, msec;
+ ::sscanf (hms+1,"%d:%d:%d.%d", &hr, &min, &sec, &msec);
+ this->time_ = (hr * 3600 + min *60 + sec) * 1000 + msec;
+ }
+ }
+}
+
+void
+GIOP_Buffer::owner (Invocation *owner)
+{
+ this->owner_ = owner;
+}
+
+Invocation *
+GIOP_Buffer::owner (void)
+{
+ return this->owner_;
+}
+
+void
+GIOP_Buffer::init_buf (const char *text, size_t offset)
+{
+ // GIOP message - HEXDUMP
+ this->log_offset_ = offset;
+ const char * size_str = ACE_OS::strstr (text,"HEXDUMP ") + 8;
+ this->buffer_size_ = ACE_OS::strtol (size_str, 0, 10);
+ size_str = ACE_OS::strstr (text,"showing first ");
+ if (size_str != 0)
+ {
+ size_str += 14;
+ this->buffer_size_ = ACE_OS::strtol (size_str, 0, 10);
+ }
+ if (this->octets_ != 0)
+ {
+ delete [] this->octets_;
+ }
+ this->octets_ = new char [this->buffer_size_];
+ ACE_OS::memset (this->octets_, 0, this->buffer_size_);
+ this->wr_pos_ = this->octets_;
+}
+
+GIOP_Buffer::~GIOP_Buffer(void)
+{
+ delete [] this->octets_;
+}
+
+int
+GIOP_Buffer::add_octets(const char *text, size_t offset)
+{
+ if (this->octets_ == 0)
+ {
+ this->init_buf(text, offset);
+ return 0;
+ }
+
+ const char *c = text;
+ char *err;
+ for (int count = 0; count < 16 && this->cur_size() < this->buffer_size_; count++)
+ {
+ if (count == 8)
+ ++c;
+ int o = ::strtol(c, &err, 16);
+ if (err == c || *err == 0)
+ return -1;
+ *this->wr_pos_++ = o;
+ c = err+1;
+ }
+ size_t cs = this->cur_size();
+ int rtn = 0;
+ if (!this->header_parsed_)
+ {
+ this->header_parsed_ = this->parse_header();
+ if (this->header_parsed_ )
+ rtn = 1;
+ }
+ if (cs == this->buffer_size_)
+ {
+ char vmaj = this->octets_[4];
+ char order = this->octets_[6];
+
+ delete this->cdr_;
+ this->cdr_ = new ACE_InputCDR (this->octets_,
+ this->cur_size(),
+ order, vmaj, this->ver_minor_);
+ this->cdr_->skip_bytes (this->payload_start_ - this->octets_);
+ rtn = -1;
+ }
+ return rtn;
+}
+
+bool
+GIOP_Buffer::sending (void) const
+{
+ return this->sending_;
+}
+
+bool
+GIOP_Buffer::is_full(void) const
+{
+ return this->buffer_size_ > 0 && this->cur_size() == this->buffer_size_;
+}
+
+char
+GIOP_Buffer::type (void) const
+{
+ if (this->octets_ == 0)
+ return 127;
+ return this->octets_[7];
+}
+
+char
+GIOP_Buffer::expected_type (void) const
+{
+ return this->expected_type_;
+}
+
+char
+GIOP_Buffer::minor_version (void) const
+{
+ return this->ver_minor_;
+}
+
+char
+GIOP_Buffer::reply_status (void) const
+{
+ return this->reply_status_;
+}
+
+size_t
+GIOP_Buffer::num_contexts (void) const
+{
+ return this->num_contexts_;
+}
+
+bool
+GIOP_Buffer::is_oneway(void)
+{
+ if (this->octets_ == 0)
+ {
+ return false;
+ }
+
+ if (!this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+
+ return (resp_exp_ &1) == 0;
+}
+
+size_t
+GIOP_Buffer::log_posn (void) const
+{
+ return this->log_offset_;
+}
+
+Thread *
+GIOP_Buffer::thread (void)
+{
+ return this->thr_;
+}
+
+time_t
+GIOP_Buffer::time (void) const
+{
+ return this->time_;
+}
+
+const ACE_CString &
+GIOP_Buffer::preamble(void) const
+{
+ return this->preamble_;
+}
+
+size_t
+GIOP_Buffer::expected_size (void) const
+{
+ return this->expected_size_;
+}
+
+size_t
+GIOP_Buffer::msg_size (void)
+{
+ if (this->cur_size() < 12)
+ return 0;
+ if (!this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+ return this->msg_size_;
+}
+
+size_t
+GIOP_Buffer::expected_req_id(void) const
+{
+ return this->expected_req_id_;
+}
+
+size_t
+GIOP_Buffer::actual_req_id(void)
+{
+ if (this->octets_ == 0)
+ return 0;
+
+ if (!this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+
+ return this->req_id_;
+}
+
+size_t
+GIOP_Buffer::cur_size(void) const
+{
+ return this->wr_pos_ - this->octets_;
+}
+
+bool
+GIOP_Buffer::parse_svc_contexts (void)
+{
+ ACE_CDR::ULong temp;
+ ACE_CDR::ULong num_svc_cont;
+ if ( !(*this->cdr_ >> num_svc_cont))
+ return false;
+ this->num_contexts_ = static_cast<size_t>(num_svc_cont);
+ while (num_svc_cont > 0)
+ {
+ if (!(*this->cdr_ >> temp)) // tag really
+ return false;
+ if (!(*this->cdr_ >> temp))
+ return false;
+ if (!this->cdr_->skip_bytes(temp))
+ return false;
+ --num_svc_cont;
+ }
+ return true;
+}
+
+bool
+GIOP_Buffer::parse_header (void)
+{
+ if (this->octets_ == 0 || this->cur_size() < 12)
+ {
+ return false;
+ }
+
+ char vmaj = this->octets_[4];
+ this->ver_minor_ = this->octets_[5];
+ char order = this->octets_[6];
+
+ char mtype = this->octets_[7];
+ if (mtype > 1) // not a request or reply
+ return false;
+
+ delete this->cdr_;
+ this->cdr_ = new ACE_InputCDR (this->octets_,
+ this->cur_size(),
+ order, vmaj, this->ver_minor_);
+ this->cdr_->skip_bytes (8);
+ this->payload_start_ = this->cdr_->rd_ptr();
+ ACE_CDR::ULong len_ulong;
+ if (!(*this->cdr_ >> len_ulong))
+ return false;
+ this->msg_size_ = len_ulong;
+
+ if (this->ver_minor_ < 2)
+ {
+ if (!this->parse_svc_contexts())
+ return false;
+ }
+
+ if (!(*this->cdr_ >> len_ulong))
+ return false;
+ this->req_id_ = static_cast<size_t>(len_ulong);
+
+ switch (mtype) {
+ case 0: //Request
+ if (!(*this->cdr_ >> this->resp_exp_))
+ return false;
+ if (this->ver_minor_ > 1 &&
+ !(*this->cdr_ >> len_ulong)) // address disposition
+ return false;
+ if (!(*this->cdr_ >> len_ulong))
+ return false;
+ this->oid_len_ = static_cast<size_t>(len_ulong);
+ this->oid_ = this->cdr_->rd_ptr();
+ if (!this->cdr_->skip_bytes(len_ulong))
+ return false;
+
+ if (!(*this->cdr_ >> len_ulong))
+ return false;
+ this->opname_ = this->cdr_->rd_ptr();
+ if (!this->cdr_->skip_bytes(len_ulong))
+ return false;
+ break;
+ case 1: //Reply
+ if (!(*this->cdr_ >> len_ulong))
+ return false;
+ this->reply_status_ = static_cast<size_t>(len_ulong);
+ break;
+ default:
+ return true;
+ }
+ if (this->ver_minor_ > 1)
+ {
+ if (!this->parse_svc_contexts())
+ return false;
+ }
+ this->cdr_->align_read_ptr (8);
+ this->payload_start_ = this->cdr_->rd_ptr();
+ return true;
+}
+
+const char *
+GIOP_Buffer::target_oid(size_t &len)
+{
+ if (this->octets_ == 0)
+ {
+ return 0;
+ }
+
+ if (!this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+
+ if (this->oid_ == 0)
+ return 0;
+
+ len = this->oid_len_;
+ return this->oid_;
+}
+
+const char *
+GIOP_Buffer::operation(void)
+{
+ if (octets_ == 0)
+ return 0;
+
+ if (!this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+
+ return this->opname_;
+}
+
+ACE_InputCDR &
+GIOP_Buffer::payload(void)
+{
+ if (octets_ != 0 && !this->header_parsed_)
+ this->header_parsed_ = this->parse_header();
+ return *this->cdr_;
+}
+
+bool
+GIOP_Buffer::has_octets (void) const
+{
+ return (octets_ != 0);
+}
+
+bool
+GIOP_Buffer::validate (void)
+{
+ return
+ this->expected_req_id_ == this->actual_req_id() &&
+ this->expected_type_ == this->type() &&
+ this->expected_size_ == this->msg_size();
+}
+
+bool
+GIOP_Buffer::matches (GIOP_Buffer *other) const
+{
+ if (other->header_parsed_)
+ return this->expected_req_id_ == other->actual_req_id() &&
+ this->expected_type_ == other->type() &&
+ this->expected_size_ == other->msg_size();
+ else
+ return this->expected_req_id_ == other->expected_req_id() &&
+ this->expected_type_ == other->expected_type() &&
+ this->sending_ == other->sending() &&
+ this->expected_size_ == other->expected_size();
+}
+
+void
+GIOP_Buffer::reset (void)
+{
+ this->octets_ = 0;
+ this->wr_pos_ = 0;
+ this->buffer_size_ = 0;
+ this->buffer_lost_ = true;
+ this->header_parsed_ = false;
+ this->opname_ = 0;
+}
+
+void
+GIOP_Buffer::transfer_from (GIOP_Buffer *other)
+{
+ delete this->octets_;
+ this->octets_ = other->octets_;
+ this->wr_pos_ = other->wr_pos_;
+ this->buffer_size_ = other->buffer_size_;
+ this->header_parsed_ = false;
+ other->reset();
+}
+
+void
+GIOP_Buffer::swap (GIOP_Buffer *other)
+{
+ char *tmp_octets = this->octets_;
+ char *tmp_wr_pos = this->wr_pos_;
+ size_t tmp_size = this->buffer_size_;
+
+ this->octets_ = other->octets_;
+ this->wr_pos_ = other->wr_pos_;
+ this->buffer_size_ = other->buffer_size_;
+
+ other->octets_ = tmp_octets;
+ other->wr_pos_ = tmp_wr_pos;
+ other->buffer_size_ = tmp_size;
+}
diff --git a/TAO/utils/logWalker/GIOP_Buffer.h b/TAO/utils/logWalker/GIOP_Buffer.h
new file mode 100644
index 00000000000..fcc503e2685
--- /dev/null
+++ b/TAO/utils/logWalker/GIOP_Buffer.h
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+
+// $Id$
+//
+
+#ifndef LOG_WALKER_GIOP_BUFFER_H
+#define LOG_WALKER_GIOP_BUFFER_H
+
+#include "ace/SString.h"
+#include "ace/CDR_Stream.h"
+
+class Invocation;
+class Thread;
+
+// Invocation holds the buffer contents for a request/response pair.
+// This could be originating in this process, or in the peer process.
+//
+// The trigger for finding a new outgoing invocation is "Muxed_TMS[%d]"
+// following that the process/thread will perform a dump_msg.
+//
+// The trigger for finding a new incoming invocation is
+// "Transport[%d]::process_parsed_messages, entering (missing data == 0)"
+// which could indicate a new request or reply, depending on the context
+// in which the peer connection is made.
+//
+// It is possible that two or more threads may call dump_msg
+// concurrently and thus have the preamble and body printed out of
+// order. The HEXDUMP always reports a buffer size including the 12
+// byte GIOP header. Also, the first line of the text contains header
+// data which can be compared to the expected request ID.
+
+class GIOP_Buffer
+{
+public:
+
+ static const char *size_leadin;
+ static size_t leadin_len;
+ static const size_t giop_header_len;
+ static void init_leadin (int version);
+
+ GIOP_Buffer (const char *text, size_t offset, Thread *thread, Invocation *owner = 0);
+ GIOP_Buffer (void);
+ ~GIOP_Buffer (void);
+
+ void owner (Invocation *);
+ Invocation *owner (void);
+
+ void init_buf (const char *text, size_t offset);
+ int add_octets(const char *text, size_t offset);
+ char type (void) const;
+ char expected_type (void) const;
+ bool sending (void) const;
+ char minor_version (void) const;
+ char reply_status (void) const;
+ size_t num_contexts (void) const;
+ bool is_oneway (void);
+ bool is_full (void) const;
+ size_t log_posn (void) const;
+ Thread *thread (void);
+ time_t time (void) const;
+
+ const ACE_CString &preamble(void) const;
+ size_t expected_req_id(void) const;
+ size_t actual_req_id(void);
+
+ size_t expected_size (void) const;
+ size_t buf_size (void) const;
+ size_t cur_size(void) const;
+ size_t msg_size (void);
+
+ const char * target_oid (size_t &len);
+ const char * operation (void);
+ ACE_InputCDR &payload (void);
+
+ bool has_octets (void) const;
+ bool validate (void);
+ bool matches (GIOP_Buffer *other) const;
+
+ void reset (void);
+ void transfer_from (GIOP_Buffer *other);
+ void swap (GIOP_Buffer *other);
+
+private:
+ bool parse_svc_contexts (void);
+ bool parse_header (void);
+
+ ACE_InputCDR *cdr_;
+ ACE_CString preamble_;
+ size_t log_offset_;
+ Thread *thr_;
+ time_t time_;
+ size_t expected_req_id_;
+ size_t expected_size_;
+ char expected_type_;
+ size_t buffer_size_;
+ char * wr_pos_;
+ char * octets_;
+ Invocation *owner_;
+ bool buffer_lost_;
+ bool sending_;
+ char * oid_;
+ size_t oid_len_;
+ char * opname_;
+ size_t req_id_;
+ char resp_exp_;
+ size_t reply_status_;
+ char ver_minor_;
+ size_t msg_size_;
+ size_t num_contexts_;
+ bool header_parsed_;
+ char * payload_start_;
+};
+
+#endif // LOG_WALKER_GIOP_BUFFER_H
diff --git a/TAO/utils/logWalker/HostProcess.cpp b/TAO/utils/logWalker/HostProcess.cpp
index d68d518bfd8..d5db215b50f 100644
--- a/TAO/utils/logWalker/HostProcess.cpp
+++ b/TAO/utils/logWalker/HostProcess.cpp
@@ -9,16 +9,10 @@
PeerNode::PeerNode (long h, PeerProcess *p)
:handle_ (h),
- peer_ (p),
- closed_ (false)
+ peer_ (p)
{
}
-PeerNode::~PeerNode (void)
-{
- delete peer_;
-}
-
HostProcess::HostProcess (const ACE_CString &src, long pid)
: pid_(pid),
logfile_name_(src)
@@ -39,24 +33,15 @@ HostProcess::~HostProcess (void)
{
delete reinterpret_cast<Thread *>(i.next()->item_);
}
-
- for (PeerArray::ITERATOR i(this->by_handle_); !i.done(); i++)
+#if 0
+ for (PeerProcs::ITERATOR i = by_addr_.begin(); i != servers_.end(); i++)
{
- ACE_DLList_Node *entry;
+ PeerProcs::ENTRY *entry;
if (i.next(entry) == 0)
break;
- //i.remove ();
-
- PeerNode *node = reinterpret_cast<PeerNode*>(entry->item_);
- PeerProcess *pp = node->peer_;
- const ACE_CString &addr = pp->is_server() ?
- pp->server_addr() : pp->last_client_addr();
- this->by_addr_.unbind (addr);
- delete node;
+ delete entry->item();
}
-
- this->by_addr_.close();
-
+#endif
}
void
@@ -72,7 +57,7 @@ HostProcess::proc_name (void) const
}
Thread *
-HostProcess::find_thread (long tid)
+HostProcess::find_thread (long tid, size_t offset)
{
Thread *thr = 0;
for (ACE_DLList_Iterator<Thread> i(threads_);
@@ -86,12 +71,31 @@ HostProcess::find_thread (long tid)
char alias[20];
ACE_OS::sprintf (alias,"Thread[" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII "]",
this->threads_.size() + 1);
- thr = new Thread (tid, alias);
+ thr = new Thread (tid, alias, offset);
threads_.insert_tail (thr);
return thr;
}
Thread *
+HostProcess::find_thread_for_peer (const ACE_CString &addr)
+{
+ Thread *thr = 0;
+ for (ACE_DLList_Iterator<Thread> i(threads_);
+ !i.done();
+ i.advance())
+ {
+ i.next(thr);
+ PeerProcess *pp = thr->pending_peer();
+ if (pp == 0)
+ continue;
+
+ if (pp->server_addr() == addr)
+ return thr;
+ }
+ return 0;
+}
+
+Thread *
HostProcess::find_thread_for_handle (long h)
{
Thread *thr = 0;
@@ -115,8 +119,8 @@ HostProcess::find_peer (const ACE_CString &addr)
return pp;
}
-PeerNode *
-HostProcess::find_peer_i (long h)
+PeerProcess *
+HostProcess::find_peer (long h)
{
if (this->by_handle_.size() == 0)
return 0;
@@ -126,19 +130,8 @@ HostProcess::find_peer_i (long h)
{
PeerNode *node = reinterpret_cast<PeerNode *>(i.next()->item_);
if (node->handle_ == h)
- return node;
+ return node->peer_;
}
-
- return 0;
-}
-
-
-PeerProcess *
-HostProcess::find_peer (long h, bool ignore_closed)
-{
- PeerNode *node = this->find_peer_i (h);
- if (node != 0 && !(ignore_closed && node->closed_) )
- return node->peer_;
return 0;
}
@@ -181,8 +174,8 @@ void
HostProcess::add_peer(long handle, PeerProcess *peer)
{
peer->set_owner (this);
- PeerNode *node = this->find_peer_i(handle);
- if (node != 0 && !node->closed_ )
+ PeerProcess *existing = this->find_peer(handle);
+ if (existing != 0)
{
ACE_DEBUG ((LM_DEBUG,
"add_peer, found existing for %d\n",
@@ -190,29 +183,16 @@ HostProcess::add_peer(long handle, PeerProcess *peer)
}
const ACE_CString &addr = peer->is_server() ?
peer->server_addr() : peer->last_client_addr();
- errno = 0;
-
int result = this->by_addr_.bind (addr,peer);
- if (result == -1)
- {
- ACE_ERROR ((LM_ERROR,"add_peer, cannot bind handle %d to addr %s %p\n",
- handle, addr.c_str(), "by_addr_.bind"));
- }
+ if (result < 0)
+ ACE_ERROR ((LM_ERROR,"add_peer, cannot bind to addr %s result = %d, %p\n", addr.c_str(), result, "by_addr_.bind"));
- if (node == 0)
- {
- node = new PeerNode (handle,peer);
- this->by_handle_.insert_tail(node);
- }
- else
- {
- node->closed_ = false;
- node->peer_ = peer;
- }
+ PeerNode *node = new PeerNode (handle,peer);
+ this->by_handle_.insert_tail(node);
}
void
-HostProcess::close_peer(long h)
+HostProcess::remove_peer(long h)
{
if (this->by_handle_.size() == 0)
return;
@@ -223,7 +203,7 @@ HostProcess::close_peer(long h)
PeerNode *node = reinterpret_cast<PeerNode *>(i.next()->item_);
if (node->handle_ == h)
{
- node->closed_ = true;
+ this->by_handle_.remove(i.next());
return;
}
}
@@ -273,7 +253,11 @@ HostProcess::dump_ident (ostream &strm, const char *message)
void
HostProcess::dump_thread_detail (ostream &strm)
{
- this->dump_ident (strm, " thread details:");
+ this->dump_ident (strm, "thread details:");
+ long total_sent = 0;
+ long total_recv = 0;
+ size_t total_bytes_sent = 0;
+ size_t total_bytes_recv = 0;
for (ACE_DLList_Iterator <Thread> t_iter (this->threads_);
!t_iter.done();
t_iter.advance())
@@ -281,13 +265,16 @@ HostProcess::dump_thread_detail (ostream &strm)
Thread *thr = 0;
t_iter.next(thr);
thr->dump_detail (strm);
+ thr->get_summary (total_recv, total_sent, total_bytes_recv, total_bytes_sent);
}
+ strm << "Total requests sent: " << total_sent << " received: " << total_recv << endl;
+ strm << "Total requests bytes sent: " << total_bytes_sent << " received: " << total_bytes_recv << endl;
}
void
HostProcess::dump_thread_invocations (ostream &strm)
{
- this->dump_ident (strm, " invocations by thread:");
+ this->dump_ident (strm, "invocations by thread:");
for (ACE_DLList_Iterator <Thread> t_iter (this->threads_);
!t_iter.done();
t_iter.advance())
@@ -345,7 +332,7 @@ HostProcess::iterate_peers (int group,
void
HostProcess::dump_peer_detail (ostream &strm)
{
- this->dump_ident (strm, " peer processes:");
+ this->dump_ident (strm, "peer processes:");
size_t num_servers = 0;
size_t num_clients = 0;
strm << " total peers: " << this->by_addr_.current_size() << endl;
@@ -372,16 +359,16 @@ HostProcess::dump_peer_detail (ostream &strm)
void
HostProcess::dump_object_detail (ostream &strm)
{
- this->dump_ident (strm, " peer objects: ");
+ this->dump_ident (strm, "peer objects: ");
this->iterate_peers (3, 1, &strm);
}
void
HostProcess::dump_invocation_detail(ostream &strm)
{
- this->dump_ident (strm, " invocations: ");
+ this->dump_ident (strm, "invocations: ");
this->iterate_peers (3, 2, &strm);
- this->dump_ident (strm, " end invocation report");
+ this->dump_ident (strm, "end invocation report");
}
void
diff --git a/TAO/utils/logWalker/HostProcess.h b/TAO/utils/logWalker/HostProcess.h
index d92e9dd2630..06df774f974 100644
--- a/TAO/utils/logWalker/HostProcess.h
+++ b/TAO/utils/logWalker/HostProcess.h
@@ -27,10 +27,8 @@ class Thread;
struct PeerNode
{
PeerNode (long h, PeerProcess *p);
- ~PeerNode (void);
long handle_;
PeerProcess *peer_;
- bool closed_;
};
typedef ACE_DLList<Thread> ThreadList;
@@ -57,7 +55,10 @@ public:
// Returns a thread instance based on thread id. Will create an instance
// as needed.
- Thread * find_thread (long tid);
+ Thread * find_thread (long tid, size_t offset);
+
+ // Returns a thread that has a pending peer with the supplied address
+ Thread * find_thread_for_peer (const ACE_CString& addr);
// Returns a thread that had previously worked with handle h. May return
// a null pointer.
@@ -85,9 +86,12 @@ public:
// locate a peer process by handle or address
PeerProcess *find_peer (const ACE_CString& addr);
- PeerProcess *find_peer (long handle, bool ignore_closed);
+ PeerProcess *find_peer (long handle);
+
+ void remove_peer (long handle);
- void close_peer (long handle);
+ // remove a peer by handle, noting the line.
+ void close_peer (long handle, size_t offset);
// various output methods
void dump_ident (ostream &strm, const char *extra);
@@ -103,8 +107,6 @@ public:
void reconcile_peers (Session *session);
private:
- PeerNode *find_peer_i (long handle);
-
void iterate_peers (int group,
int operation,
ostream *strm = 0,
diff --git a/TAO/utils/logWalker/Invocation.cpp b/TAO/utils/logWalker/Invocation.cpp
index 7e8dc980154..0c781d9b7be 100644
--- a/TAO/utils/logWalker/Invocation.cpp
+++ b/TAO/utils/logWalker/Invocation.cpp
@@ -1,6 +1,7 @@
// $Id$
#include "Invocation.h"
+#include "GIOP_Buffer.h"
#include "PeerProcess.h"
#include "PeerObject.h"
#include "Session.h"
@@ -8,518 +9,19 @@
#include "Thread.h"
#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
#include "ace/Log_Msg.h"
-#include <stdio.h>
-
-static const char *size_leadin_1_5 = "GIOP v1."; //"x msg, ";
-static size_t leadin_len_1_5 = 15;
-static const char *size_leadin_1_6 = "GIOP message v1."; //2, ";
-static size_t leadin_len_1_6 = 19;
-
-
-static const char *size_leadin = 0;
-static size_t leadin_len = 0;
-static const size_t giop_header_len = 12;
-
-static const int date_format = 2;
-
-// GIOP 1.2 header: 12 bytes
-// Magic: 4
-// ver: 2
-// flags: 1 // bo
-// type: 1 // req/repl/lf/excp
-// len: 4
-//
-// Request 1.2 header:
-// req_id: 4
-// flags: 1
-// RESVD: 3
-// Address disposition: 4
-// target: <4 len, + len> [0-3 pad]
-// opname: <4 len, + len>
-
-// GIOP 1.0 header: 12 bytes
-// Magic: 4
-// ver: 2
-// byte_order: 1
-// type: 1 // req/repl/lf/excp
-// len: 4
-//
-// Request 1.0 header:
-/*
-struct RequestHeader_1_0 { // Renamed from RequestHeader
- IOP::ServiceContextList service_context;
- unsigned long request_id;
- boolean response_expected;
- sequence <octet> object_key;
- string operation;
- CORBA::OctetSeq requesting_principal;
-};
-*/
-// service_context: 4(count)+contexts.
-// context id: 4
-// content blob: 4(len) + len octets + (0-3)pad
-// request_id: 4
-// respexp: 1
-// RESVD: 3
-// Address disposition: 4
-// target: <4 len, + len> [0-3 pad]
-// opname: <4 len, + len>
-
-/*
-struct ReplyHeader_1_0 { // Renamed from ReplyHeader
- IOP::ServiceContextList service_context;
- unsigned long request_id;
- ReplyStatusType_1_0 reply_status;
- };
- // GIOP 1.1
- typedef ReplyHeader_1_0 ReplyHeader_1_1;
- // Same Header contents for 1.0 and 1.1
-#else
- // GIOP 1.2, 1.3
- enum ReplyStatusType_1_2 {
- NO_EXCEPTION,
- USER_EXCEPTION,
- SYSTEM_EXCEPTION,
- LOCATION_FORWARD,
- LOCATION_FORWARD_PERM,// new value for 1.2
- NEEDS_ADDRESSING_MODE // new value for 1.2
- };
- struct ReplyHeader_1_2 {
- unsigned long request_id;
- ReplyStatusType_1_2 reply_status;
- IOP::ServiceContextList service_context;
- };
-
- */
-
-
-
-static const size_t target_offset_12 = giop_header_len + 12;
-
-// 12 = req_id + flags + RESVD + addr disp.
-
-Invocation::GIOP_Buffer::GIOP_Buffer(const char *text,
- size_t offset,
- Thread *thread,
- Invocation *owner)
- : preamble_(text),
- log_offset_(offset),
- thr_(thread),
- time_(0),
- expected_req_id_(0),
- expected_size_(0),
- expected_type_(0),
- size_(0),
- wr_pos_ (0),
- octets_ (0),
- owner_ (owner),
- buffer_lost_ (false),
- sending_(false),
- oid_ (0),
- oid_len_ (0),
- opname_ (0),
- req_id_ (0),
- resp_exp_ (0),
- reply_status_ (0),
- ver_minor_ (0),
- num_contexts_ (0),
- header_parsed_ (false)
-{
- const char *size_str = ACE_OS::strstr(text, size_leadin) + leadin_len;
- const char *id = size_str == 0 ? 0 : ACE_OS::strchr(size_str, '[') + 1;
- this->sending_ = ACE_OS::strstr(text,"send") ? 0 : 1;
- this->expected_type_ = ACE_OS::strstr(text,"Request") ? 0 : 1;
- this->expected_size_ = ACE_OS::strtol(size_str, 0,10) + giop_header_len;
- this->expected_req_id_ = ACE_OS::strtol(id, 0, 10);
- const char *time_tok = ACE_OS::strchr (text,'@');
- if (time_tok != 0)
- {
- char timebuf[30];
- ACE_OS::strncpy(timebuf, text, (time_tok - text));
- timebuf[time_tok - text] = 0;
- char *hms = ACE_OS::strchr (timebuf,' ');
- if (Session::date_format() == 2) // MMM DD hh:mm:ss.msec YYYY
- {
- if (hms != 0)
- hms = ACE_OS::strchr (hms+1,' ');
- }
-
- if (hms != 0)
- {
- int hr, min, sec, msec;
- ::sscanf (hms+1,"%d:%d:%d.%d", &hr, &min, &sec, &msec);
- this->time_ = (hr * 3600 + min *60 + sec) * 1000 + msec;
- }
- }
-}
-
-void
-Invocation::GIOP_Buffer::owner (Invocation *owner)
-{
- this->owner_ = owner;
-}
-
-Invocation *
-Invocation::GIOP_Buffer::owner (void)
-{
- return this->owner_;
-}
-
-void
-Invocation::GIOP_Buffer::init_buf (const char *text)
-{
- // GIOP message - HEXDUMP
- const char * size_str = ACE_OS::strstr(text,"HEXDUMP ") + 8;
- this->size_ = ACE_OS::strtol(size_str, 0,10);
- size_str = ACE_OS::strstr(text,"showing first ");
- if (size_str != 0)
- {
- size_str += 14;
- this->size_ = ACE_OS::strtol(size_str, 0, 10);
- }
- this->octets_ = new char [this->size_];
- ACE_OS::memset(this->octets_,0,this->size_);
- this->wr_pos_ = this->octets_;
-}
-
-Invocation::GIOP_Buffer::~GIOP_Buffer(void)
-{
- delete [] this->octets_;
-}
-
-int
-Invocation::GIOP_Buffer::add_octets(const char *text)
-{
- if (this->octets_ == 0)
- {
- this->init_buf(text);
- return 0;
- }
-
- const char *c = text;
- char *err;
- for (int count = 0; count < 16 && this->cur_size() < this->size_; count++)
- {
- if (count == 8)
- ++c;
- int o = ::strtol(c, &err, 16);
- if (err == c || *err == 0)
- return -1;
- *this->wr_pos_++ = o;
- c = err+1;
- }
- size_t cs = this->cur_size();
- if (cs == this->size_)
- return -1;
- else
- if (!this->header_parsed_)
- {
- this->header_parsed_ = this->parse_header();
- if (this->header_parsed_ )
- return 1;
- }
- return 0;
-}
-
-bool
-Invocation::GIOP_Buffer::sending (void) const
-{
- return this->sending_;
-}
-
-bool
-Invocation::GIOP_Buffer::is_full(void) const
-{
- return this->size_ > 0 && this->cur_size() == this->size_;
-}
-
-char
-Invocation::GIOP_Buffer::type (void) const
-{
- if (this->octets_ == 0)
- return 127;
- return this->octets_[7];
-}
-
-char
-Invocation::GIOP_Buffer::expected_type (void) const
-{
- return this->expected_type_;
-}
-
-char
-Invocation::GIOP_Buffer::minor_version (void) const
-{
- return this->ver_minor_;
-}
-
-char
-Invocation::GIOP_Buffer::reply_status (void) const
-{
- return this->reply_status_;
-}
-
-size_t
-Invocation::GIOP_Buffer::num_contexts (void) const
-{
- return this->num_contexts_;
-}
-
-bool
-Invocation::GIOP_Buffer::is_oneway(void)
-{
- if (this->octets_ == 0)
- {
- return false;
- }
-
- if (!this->header_parsed_)
- this->header_parsed_ = this->parse_header();
-
- return (resp_exp_ &1) == 0;
-}
-
-size_t
-Invocation::GIOP_Buffer::log_posn (void) const
-{
- return this->log_offset_;
-}
-
-Thread *
-Invocation::GIOP_Buffer::thread (void)
-{
- return this->thr_;
-}
-
-time_t
-Invocation::GIOP_Buffer::time (void) const
-{
- return this->time_;
-}
-
-const ACE_CString &
-Invocation::GIOP_Buffer::preamble(void) const
-{
- return this->preamble_;
-}
-
-size_t
-Invocation::GIOP_Buffer::expected_size (void) const
-{
- return this->expected_size_;
-}
-
-size_t
-Invocation::GIOP_Buffer::size(void) const
-{
- return this->size_;
-}
-
-size_t
-Invocation::GIOP_Buffer::expected_req_id(void) const
-{
- return this->expected_req_id_;
-}
-
-size_t
-Invocation::GIOP_Buffer::actual_req_id(void)
-{
- if (this->octets_ == 0)
- return 0;
-
- if (!this->header_parsed_)
- this->header_parsed_ = this->parse_header();
-
- return this->req_id_;
-}
-
-size_t
-Invocation::GIOP_Buffer::cur_size(void) const
-{
- return this->wr_pos_ - this->octets_;
-}
-
-bool
-Invocation::GIOP_Buffer::parse_svc_contexts (ACE_InputCDR &cdr)
-{
- ACE_CDR::ULong temp;
- ACE_CDR::ULong num_svc_cont;
- if ( !(cdr >> num_svc_cont))
- return false;
- this->num_contexts_ = static_cast<size_t>(num_svc_cont);
- while (num_svc_cont > 0)
- {
- if (!(cdr >> temp)) // tag really
- return false;
- if (!(cdr >> temp))
- return false;
- if (!cdr.skip_bytes(temp))
- return false;
- --num_svc_cont;
- }
- return true;
-}
-
-bool
-Invocation::GIOP_Buffer::parse_header (void)
-{
- if (this->octets_ == 0)
- {
- return false;
- }
-
- char vmaj = this->octets_[4];
- this->ver_minor_ = this->octets_[5];
- char bo = this->octets_[6];
-
- char mtype = this->octets_[7];
- if (mtype > 1) // not a request or reply
- return false;
-
- ACE_InputCDR cdr(this->octets_ + giop_header_len,
- this->cur_size() - giop_header_len,
- bo, vmaj, this->ver_minor_);
-
- ACE_CDR::ULong len_ulong;
-
- if (this->ver_minor_ < 2)
- {
- if (!this->parse_svc_contexts(cdr))
- return false;
- }
-
- if (!(cdr >> len_ulong))
- return false;
- this->req_id_ = static_cast<size_t>(len_ulong);
-
- switch (mtype) {
- case 0: //Request
- if (!(cdr >> this->resp_exp_))
- return false;
- if (this->ver_minor_ > 1 &&
- !(cdr >> len_ulong)) // address disposition
- return false;
- if (!(cdr >> len_ulong))
- return false;
- this->oid_len_ = static_cast<size_t>(len_ulong);
- this->oid_ = cdr.rd_ptr();
- if (!cdr.skip_bytes(len_ulong))
- return false;
-
- if (!(cdr >> len_ulong))
- return false;
- this->opname_ = cdr.rd_ptr();
- if (!cdr.skip_bytes(len_ulong))
- return false;
- break;
- case 1: //Reply
- if (!(cdr >> len_ulong))
- return false;
- this->reply_status_ = static_cast<size_t>(len_ulong);
- break;
- default:
- return false;
- }
- if (this->ver_minor_ > 1)
- {
- if (!this->parse_svc_contexts(cdr))
- return false;
- }
-
- return true;
-}
-
-const char *
-Invocation::GIOP_Buffer::target_oid(size_t &len)
-{
- if (this->octets_ == 0)
- {
- return 0;
- }
-
- if (!this->header_parsed_)
- this->header_parsed_ = this->parse_header();
-
- if (this->oid_ == 0)
- return 0;
-
- len = this->oid_len_;
- return this->oid_;
-}
-
-const char *
-Invocation::GIOP_Buffer::operation(void)
-{
- if (octets_ == 0)
- return 0;
-
- if (!this->header_parsed_)
- this->header_parsed_ = this->parse_header();
-
- return this->opname_;
-}
-
-bool
-Invocation::GIOP_Buffer::validate (void)
-{
- return this->expected_req_id_ == this->actual_req_id() &&
- this->expected_type_ == this->type();
-}
-
-bool
-Invocation::GIOP_Buffer::matches (Invocation::GIOP_Buffer *other) const
-{
- return this->expected_req_id_ == other->actual_req_id() &&
- this->expected_type_ == other->type() &&
- this->expected_size_ == other->size();
-}
-
-void
-Invocation::GIOP_Buffer::reset (void)
-{
- this->octets_ = 0;
- this->wr_pos_ = 0;
- this->size_ = 0;
- this->buffer_lost_ = true;
-}
-
-void
-Invocation::GIOP_Buffer::transfer_from (GIOP_Buffer *other)
-{
- delete this->octets_;
- this->octets_ = other->octets_;
- this->wr_pos_ = other->wr_pos_;
- this->size_ = other->size_;
- other->reset();
-}
-
-
-//----------------------------------------------------------------------------
-
-
-Invocation::Invocation (PeerProcess *peer, long handle, size_t rid)
+Invocation::Invocation (PeerProcess *peer, Thread *thr, size_t rid)
:req_octets_(0),
repl_octets_(0),
+ waiter_ (thr),
+ notify_incidents_ (),
peer_(peer),
req_id_(rid),
target_(0),
- handle_(handle)
+ handle_(thr->active_handle())
{
- if (size_leadin == 0)
- {
- if (Session::tao_version() == 150)
- {
- size_leadin = size_leadin_1_5;
- leadin_len = leadin_len_1_5;
- }
- else
- {
- size_leadin = size_leadin_1_6;
- leadin_len = leadin_len_1_6;
- }
- }
}
Invocation::~Invocation (void)
@@ -531,7 +33,9 @@ Invocation::~Invocation (void)
bool
Invocation::init (const char * text, size_t offset, Thread *thread)
{
- const char *size_str = ACE_OS::strstr(text, size_leadin);
+ if (GIOP_Buffer::size_leadin == 0)
+ GIOP_Buffer::init_leadin (Session::tao_version());
+ const char *size_str = ACE_OS::strstr(text, GIOP_Buffer::size_leadin);
const char *id = size_str == 0 ? 0 : ACE_OS::strchr(size_str, '[');
if (size_str == 0 || id == 0)
{
@@ -549,6 +53,12 @@ Invocation::init (const char * text, size_t offset, Thread *thread)
return true;
}
+void
+Invocation::add_notify_incident (const ACE_CString &text, size_t offset)
+{
+ this->notify_incidents_.enqueue_tail (text);
+}
+
bool
Invocation::is_oneway(void) const
{
@@ -584,13 +94,13 @@ Invocation::message_complete (void)
return true;
}
-Invocation::GIOP_Buffer *
+GIOP_Buffer *
Invocation::octets (bool request)
{
return request ? this->req_octets_ : this->repl_octets_ ;
}
-Invocation::GIOP_Buffer *
+GIOP_Buffer *
Invocation::give_octets (bool request)
{
GIOP_Buffer *result = request ? this->req_octets_ : this->repl_octets_ ;
@@ -624,6 +134,16 @@ Invocation::set_octets (bool request, GIOP_Buffer *octets)
octets->owner(this);
}
+bool
+Invocation::sent_request (void) const
+{
+ if (this->req_octets_)
+ return this->req_octets_->sending();
+ if (this->repl_octets_)
+ return !this->repl_octets_->sending();
+ return false;
+}
+
size_t
Invocation::request_id (void) const
{
@@ -638,6 +158,18 @@ Invocation::expected_size (void) const
return req_octets_->expected_size();
}
+size_t
+Invocation::request_bytes (void) const
+{
+ return req_octets_ != 0 ? req_octets_->expected_size() : 0;
+}
+
+Thread *
+Invocation::waiter (void) const
+{
+ return this->waiter_;
+}
+
long
Invocation::handle (void) const
{
@@ -664,7 +196,7 @@ void
Invocation::dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_handle)
{
const char *opname = "";
- const char *dir_1 = "to ";
+ const char *dir_1 = "sent to ";
const char *dir_2 = " in ";
if (this->req_octets_ != 0)
@@ -672,7 +204,7 @@ Invocation::dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_ha
opname = this->req_octets_->operation();
if (this->req_octets_->sending())
{
- dir_1 = "for ";
+ dir_1 = "recv for ";
dir_2 = " from ";
}
}
@@ -715,6 +247,7 @@ Invocation::dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_ha
strm << " Request, ";
if (this->req_octets_->num_contexts() > 0)
strm << "with " << this->req_octets_->num_contexts() << " contexts, ";
+ strm << "size " << this->req_octets_->expected_size() << " ";
strm << "line " << this->req_octets_->log_posn();
if (mode == Dump_Thread || mode == Dump_Both)
strm << " " << this->req_octets_->thread()->alias();
@@ -730,26 +263,19 @@ Invocation::dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_ha
strm << " Reply, ";
if (this->repl_octets_->num_contexts() > 0)
strm << "with " << this->repl_octets_->num_contexts() << " contexts, ";
+ strm << "size " << this->repl_octets_->expected_size() << " ";
strm << "line " << this->repl_octets_->log_posn();
#if defined (SHOW_THREAD_ID)
strm << " " << this->repl_octets_->thread()->alias();
#endif
char rstat = this->repl_octets_->reply_status();
- switch (rstat)
+ if (rstat == 1 || rstat == 2)
+ {
+ strm << (rstat == 1 ? " User" : " System") << " Exception";
+ }
+ else if (rstat == 3)
{
- case 0:
- break;
- case 1:
- strm << " User Exception";
- break;
- case 2:
- strm << " System Exception";
- break;
- case 3:
strm << " Location Forward";
- break;
- default:
- strm << " status = " << static_cast<short>(rstat);
}
}
else
@@ -757,5 +283,134 @@ Invocation::dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_ha
}
if (delta > 0)
strm << " log span = " << delta;
+ if (this->req_octets_ != 0 && this->req_octets_->has_octets() &&
+ this->repl_octets_ != 0 && this->repl_octets_->has_octets())
+ this->dump_special_details (strm, opname);
strm << endl;
+ if (this->notify_incidents_.size() > 0)
+ {
+ for (NotifyIncidents::ITERATOR i = this->notify_incidents_.begin();
+ !(i.done()); i.advance())
+ {
+ ACE_CString *note;
+ i.next(note);
+ strm << " " << *note << endl;
+ }
+ }
+}
+
+void
+Invocation::dump_special_details (ostream &strm, const char *opname)
+{
+ char rstat = this->repl_octets_->reply_status();
+ int opid = 0;
+ if (ACE_OS::strcmp (opname, "_is_a") == 0)
+ {
+ opid = 1;
+ ACE_InputCDR &giop_cdr = this->req_octets_->payload();
+ ACE_InputCDR cdr (giop_cdr.rd_ptr(),giop_cdr.length(),giop_cdr.byte_order());
+ ACE_CDR::ULong len;
+ if (cdr >> len)
+ strm << "\n expected type ( len = " << len << ") " << cdr.rd_ptr();
+ }
+ else if (ACE_OS::strcmp (opname, "_get_MyID") == 0)
+ {
+ opid = 2;
+ }
+ else if (ACE_OS::strcmp (opname, "resolve_str") == 0)
+ {
+ opid = 3;
+ ACE_InputCDR &giop_cdr = this->req_octets_->payload();
+ ACE_InputCDR cdr (giop_cdr.rd_ptr(),giop_cdr.length(),giop_cdr.byte_order());
+ ACE_CDR::ULong len;
+ if (cdr >> len)
+ strm << "\n name len = " << len << ") " << cdr.rd_ptr();
+ }
+ else if (ACE_OS::strcmp (opname, "resolve") == 0 ||
+ ACE_OS::strcmp (opname, "bind") == 0 ||
+ ACE_OS::strcmp (opname, "rebind") == 0 ||
+ ACE_OS::strcmp (opname, "bind_new_context") == 0
+ )
+ {
+ opid = 3;
+ ACE_InputCDR &giop_cdr = this->req_octets_->payload();
+ ACE_InputCDR cdr (giop_cdr.rd_ptr(),giop_cdr.length(),giop_cdr.byte_order());
+ ACE_CDR::ULong count;
+ if (cdr >> count)
+ {
+ strm << "\n name_seq.lengh = " << count << " ";
+ while (count-- > 0)
+ {
+ ACE_CDR::ULong len;
+ if (!(cdr >> len))
+ break;
+ strm << cdr.rd_ptr();
+ if (!cdr.skip_bytes (len))
+ break;
+ if (!(cdr >> len))
+ break;
+ if (len > 1)
+ {
+ strm << "." << cdr.rd_ptr();
+ }
+ if (!cdr.skip_bytes (len))
+ break;
+ if (count > 0)
+ {
+ strm << "/";
+ }
+ }
+ if (static_cast<ACE_CDR::Long>(count) > 0)
+ {
+ strm << " [name truncated]";
+ }
+ }
+ }
+
+
+ ACE_InputCDR &giop_cdr = this->repl_octets_->payload();
+ ACE_InputCDR cdr (giop_cdr.rd_ptr(), giop_cdr.length(), giop_cdr.byte_order());
+
+ if (rstat == 0)
+ {
+ switch (opid)
+ {
+ case 1:
+ {
+ ACE_CDR::Boolean x;
+ if (cdr >> ACE_InputCDR::to_boolean (x))
+ strm << " reply: " << (x ? "yes" : "no");
+ break;
+ }
+ case 2:
+ {
+ ACE_CDR::Long x;
+ if (cdr >> x)
+ strm << " \n MyID reply: " << x;
+ break;
+ }
+ default:;
+ }
+ }
+ else
+ {
+ if (opid == 0)
+ {
+ strm << "\n ";
+ }
+ if (rstat == 1 || rstat == 2)
+ {
+ strm << " Exception ";
+ }
+ else
+ {
+ strm << " Redirect to ";
+ }
+ ACE_CDR::ULong len;
+ if (cdr >> len)
+ {
+ strm << cdr.rd_ptr();
+ }
+ }
+
}
diff --git a/TAO/utils/logWalker/Invocation.h b/TAO/utils/logWalker/Invocation.h
index 0594a79665f..107a513652d 100644
--- a/TAO/utils/logWalker/Invocation.h
+++ b/TAO/utils/logWalker/Invocation.h
@@ -8,10 +8,14 @@
#include "ace/SString.h"
#include "ace/CDR_Stream.h"
+#include "ace/Unbounded_Queue.h"
class PeerProcess;
class PeerObject;
class Thread;
+class GIOP_Buffer;
+
+typedef ACE_Unbounded_Queue<ACE_CString> NotifyIncidents;
// Invocation holds the buffer contents for a request/response pair.
// This could be originating in this process, or in the peer process.
@@ -33,68 +37,6 @@ class Thread;
class Invocation
{
public:
- class GIOP_Buffer
- {
- public:
- GIOP_Buffer (const char *text, size_t offset, Thread *thread, Invocation *owner = 0);
- ~GIOP_Buffer (void);
- void owner (Invocation *);
- Invocation *owner (void);
- void init_buf (const char *text);
- int add_octets(const char *text);
- char type (void) const;
- char expected_type (void) const;
- bool sending (void) const;
- char minor_version (void) const;
- char reply_status (void) const;
- size_t num_contexts (void) const;
- bool is_oneway (void);
- bool is_full (void) const;
- size_t log_posn (void) const;
- Thread *thread (void);
- time_t time (void) const;
-
- const ACE_CString &preamble(void) const;
- size_t expected_req_id(void) const;
- size_t actual_req_id(void);
- size_t expected_size (void) const;
- size_t size (void) const;
- size_t cur_size(void) const;
- const char * target_oid (size_t &len);
- const char * operation (void);
- bool validate (void);
- bool matches (GIOP_Buffer *other) const;
- void reset (void);
- void transfer_from (GIOP_Buffer *other);
-
- private:
- bool parse_svc_contexts (ACE_InputCDR& cdr);
- bool parse_header (void);
-
- ACE_CString preamble_;
- size_t log_offset_;
- Thread *thr_;
- time_t time_;
- size_t expected_req_id_;
- size_t expected_size_;
- char expected_type_;
- size_t size_;
- char * wr_pos_;
- char * octets_;
- Invocation *owner_;
- bool buffer_lost_;
- bool sending_;
- char * oid_;
- size_t oid_len_;
- char * opname_;
- size_t req_id_;
- char resp_exp_;
- size_t reply_status_;
- char ver_minor_;
- size_t num_contexts_;
- bool header_parsed_;
- };
-
enum Dump_Mode {
Dump_Proc,
Dump_Thread,
@@ -102,15 +44,13 @@ public:
};
// initialize a new instance, with the initial request text line and offeset
- Invocation (PeerProcess *peer, long handle, size_t req_id = 0);
+ Invocation (PeerProcess *peer, Thread *thr, size_t req_id = 0);
bool init ( const char * text, size_t offset, Thread *thr);
~Invocation (void);
// return true if the invocation was a oneway
bool is_oneway(void) const;
- void set_target (const char *oid, size_t oid_len);
-
// return true if the request is a oneway and has all its octets, or
// if it also has all its reply octets. The side-effect of this call
// is to obtain the target reference from the request buffer and associate
@@ -119,10 +59,17 @@ public:
size_t request_id (void) const;
+ // returns true if this request was sent by the host process.
+ bool sent_request (void) const;
+
// returns the size parsed from either the request or reply preamble
// which can be used to match a HEXDUMP b
size_t expected_size (void) const;
+ size_t request_bytes (void) const;
+
+ void set_target (const char *oid, size_t oid_len);
+
void set_octets (bool request, GIOP_Buffer *octets);
GIOP_Buffer *octets (bool request);
GIOP_Buffer *give_octets (bool request);
@@ -130,14 +77,19 @@ public:
bool contains (size_t line);
size_t req_line (void);
+ void add_notify_incident (const ACE_CString &text, size_t offset);
+ Thread *waiter (void) const;
long handle (void) const;
void dump_detail (ostream &strm, int indent, Dump_Mode mode, bool show_handle);
+ void dump_special_details (ostream &strm, const char *opname);
private:
GIOP_Buffer *req_octets_;
GIOP_Buffer *repl_octets_;
+ Thread *waiter_;
+ NotifyIncidents notify_incidents_;
PeerProcess *peer_;
size_t req_id_;
PeerObject *target_;
diff --git a/TAO/utils/logWalker/Log.cpp b/TAO/utils/logWalker/Log.cpp
index 0f2ebfa7889..07e0a2c5f7e 100644
--- a/TAO/utils/logWalker/Log.cpp
+++ b/TAO/utils/logWalker/Log.cpp
@@ -11,8 +11,15 @@
#include "ace/Mem_Map.h"
Log::Log (Session &session)
- : session_(session),
- dump_target_(0)
+ : session_ (session),
+ dump_target_ (0),
+ history_ (),
+ timestamp_ (),
+ line_ (0),
+ info_ (0),
+ offset_ (0),
+ hostproc_ (0),
+ thr_ (0)
{
}
@@ -21,7 +28,7 @@ Log::~Log (void)
}
bool
-Log::init (const ACE_TCHAR *filename, const char *alias)
+Log::process_file (const ACE_TCHAR *filename, const char *alias)
{
ACE_DEBUG ((LM_DEBUG,"Processing log file %C\n",
filename));
@@ -43,13 +50,13 @@ Log::init (const ACE_TCHAR *filename, const char *alias)
size_t remainder = mapsize;
size_t linelen = 0;
- char *line;
+ char *text;
size_t maxline = 1000;
char *buffer = new char[maxline];
- size_t line_pos = 1;
- while ((line = ACE_OS::strchr(base,'\n')) != 0)
+ this->offset_ = 1;
+ while ((text = ACE_OS::strchr(base,'\n')) != 0)
{
- linelen = line - base;
+ linelen = text - base;
if (linelen >= maxline)
{
delete [] buffer;
@@ -59,9 +66,11 @@ Log::init (const ACE_TCHAR *filename, const char *alias)
}
ACE_OS::strncpy(buffer,base,linelen);
buffer[linelen] = 0;
- this->parse_line (buffer, line_pos);
- base = line+1;
- ++line_pos;
+ this->line_ = buffer;
+ if (linelen > 0)
+ this->parse_line ();
+ base = text+1;
+ ++this->offset_;
remainder -= linelen;
if (remainder < 1)
break;
@@ -74,115 +83,104 @@ Log::init (const ACE_TCHAR *filename, const char *alias)
return true;
}
-bool
-Log::get_pid_tid (long &pid, long &tid, char *line)
+void
+Log::get_preamble ()
{
- const char * p = ACE_OS::strstr (line, "TAO (");
+ char * p = ACE_OS::strstr (this->line_, "(");
char * t = 0;
- if (p == 0)
- return false;
- pid = ACE_OS::strtol(p+5,&t,10);
- tid = ACE_OS::strtol(t+1,0,10);
- return true;
-}
+ this->info_ = this->line_;
-HostProcess *
-Log::get_host (long pid)
-{
- HostProcess *hp = 0;
+ if (p == 0)
+ return;
+
+ long pid = ACE_OS::strtol(p + 1, &t, 10);
if (pid == 0)
- return 0;
+ return;
+
+ long tid = 0;
+ if ( *t == '|' )
+ tid = ACE_OS::strtol(t + 1, 0, 10);
+ else if ( *t != ')')
+ return; // not either (pid) or (pid|tid)
+
+ this->info_ = ACE_OS::strstr (p, ")") + 1;
+ this->hostproc_ = 0;
for (ACE_DLList_Iterator<HostProcess> i (this->procs_);
!i.done();
i.advance())
{
- i.next(hp);
- if (hp->pid() == pid)
- return hp;
+ i.next(this->hostproc_);
+ if (this->hostproc_->pid() == pid)
+ {
+ break;
+ }
+ this->hostproc_ = 0;
}
- hp = this->session_.find_process(pid);
- if (hp != 0)
- return hp;
- size_t numprocs = this->procs_.size();
- hp = new HostProcess (this->origin_,pid);
- this->procs_.insert_tail(hp);
- ACE_CString &procname = this->alias_.length() > 0 ?
- this->alias_ : this->origin_;
- switch (numprocs)
+ if (this->hostproc_ == 0)
+ this->hostproc_ = this->session_.find_process(pid);
+
+ if (this->hostproc_ == 0)
{
- case 0:
- hp->proc_name(procname);
- break;
- case 1:
- {
- ACE_CString a2 = procname + "_1";
- HostProcess *first;
- if (this->procs_.get(first) == 0)
- first->proc_name(a2);
- }
- //fallthru
- default:
- {
- char ext[10];
- ACE_OS::sprintf(ext,"_" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII,numprocs+1);
- ACE_CString a2 = procname + ext;
- hp->proc_name(a2);
- }
- }
-
- this->session_.add_process(hp);
- return hp;
+ size_t numprocs = this->procs_.size();
+ this->hostproc_ = new HostProcess (this->origin_,pid);
+ this->procs_.insert_tail(this->hostproc_);
+ ACE_CString &procname = this->alias_.length() > 0 ?
+ this->alias_ : this->origin_;
+ switch (numprocs)
+ {
+ case 0:
+ this->hostproc_->proc_name(procname);
+ break;
+ case 1:
+ {
+ ACE_CString a2 = procname + "_1";
+ HostProcess *first;
+ if (this->procs_.get(first) == 0)
+ first->proc_name(a2);
+ }
+ //fallthru
+ default:
+ {
+ char ext[10];
+ ACE_OS::sprintf(ext,"_" ACE_SIZE_T_FORMAT_SPECIFIER_ASCII,numprocs+1);
+ ACE_CString a2 = procname + ext;
+ this->hostproc_->proc_name(a2);
+ }
+ }
+
+ this->session_.add_process(this->hostproc_);
+ }
+ this->thr_ = this->hostproc_->find_thread (tid, this->offset_);
+ return;
}
void
-Log::handle_msg_dump (char *line, size_t offset)
+Log::handle_msg_octets ()
{
- int pos = this->dump_target_->add_octets(line);
- if (pos > 0) // need to validate target
+ int pos = this->dump_target_->add_octets(this->line_, this->offset_);
+ if (this->dump_target_ == &this->unknown_msg_)
{
- if (!this->dump_target_->validate())
- {
- for (ACE_DLList_Iterator<Thread> t_iter(this->giop_waiters_);
- !t_iter.done();
- t_iter.advance())
- {
- Thread *th = 0;
- t_iter.next(th);
- Invocation::GIOP_Buffer *new_target = th->giop_target();
- if (new_target == 0 || new_target == this->dump_target_)
- continue;
- if (new_target->matches (this->dump_target_))
- {
- Thread *tmp_thr = this->dump_target_->thread();
- new_target->transfer_from (this->dump_target_);
- this->dump_target_ = new_target;
- t_iter.remove();
- this->giop_waiters_.insert_tail (tmp_thr);
- break;
- }
- }
- }
- else
+ for (ACE_DLList_Iterator<Thread> t_iter(this->giop_waiters_);
+ !t_iter.done();
+ t_iter.advance())
{
- for (ACE_DLList_Iterator<Thread> t_iter(this->giop_waiters_);
- !t_iter.done();
- t_iter.advance())
+ Thread *th = 0;
+ t_iter.next(th);
+ GIOP_Buffer *waiter = th->giop_target();
+ if (waiter == 0)
+ continue;
+ if (waiter->matches (this->dump_target_))
{
- Thread *th = 0;
- t_iter.next(th);
- if (this->dump_target_ == th->giop_target())
- {
- PeerProcess *pp = th->incoming();
- th->exit_wait(pp, offset);
- t_iter.remove();
- break;
- }
+ waiter->transfer_from (this->dump_target_);
+ this->dump_target_ = waiter;
+ t_iter.remove();
+ break;
}
}
}
- else if (pos == -1) // done
+ if (pos == -1) // done
{
Invocation *inv = this->dump_target_->owner();
if (inv != 0)
@@ -192,338 +190,282 @@ Log::handle_msg_dump (char *line, size_t offset)
if (oid != 0)
inv->set_target (oid, len);
}
+ else
+ {
+ if (this->dump_target_ == &this->unknown_msg_)
+ ACE_ERROR ((LM_ERROR, "%d dump ended with no target owner\n", this->offset_));
+ }
this->dump_target_ = 0;
+ this->unknown_msg_.reset();
}
}
void
-Log::parse_HEXDUMP (Log *this_, char *line, size_t offset)
+Log::parse_HEXDUMP_i (void)
{
Thread *thr = 0;
- char *pos = ACE_OS::strstr (line,"HEXDUMP");
+ char *pos = ACE_OS::strstr (this->line_,"HEXDUMP");
pos += 8;
size_t len = ACE_OS::strtol (pos, 0, 10);
- for (ACE_DLList_Reverse_Iterator<Thread> t_iter(this_->giop_waiters_);
- !t_iter.done();
- t_iter.advance())
- {
- t_iter.next(thr);
- Invocation::GIOP_Buffer *target = thr->giop_target();
- if (target == 0 || target->expected_size() != len || target->size() > 0)
- continue;
- this_->dump_target_ = target;
- t_iter.remove();
- break;
- }
- if (this_->dump_target_ == 0)
+
+ if (this->dump_target_ != 0)
{
ACE_ERROR ((LM_ERROR,
- "%d: Could not find a giop waiter for size %d\n",
- offset, len));
+ "%d: Parse HEXDUMP in the middle of an existing dump\n",
+ this->offset_));
}
else
- this_->dump_target_->init_buf (line);
+ {
+ this->unknown_msg_.init_buf (this->line_, this->offset_);
+ this->dump_target_ = &this->unknown_msg_;
+ }
}
void
-Log::parse_dump_msg (Log *this_, char *line, size_t offset)
+Log::parse_dump_giop_msg_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
+ int sending = ACE_OS::strstr (this->info_,"send") != 0 ? 0 : 1;
+ int type = ACE_OS::strstr (this->info_,"Request") != 0 ? 0 : 1;
+ int mode = sending + type * 2;
- int mode = ACE_OS::strstr (line,"send") != 0 ? 0 : 1;
- mode += ACE_OS::strstr (line,"Request") != 0 ? 0 : 2;
- char *pos = strrchr (line,'[');
+ char *pos = strrchr (this->info_,'[');
long rid = ACE_OS::strtol(pos+1, 0, 10);
- PeerProcess *pp = thr->incoming();
+ PeerProcess *pp = this->thr_->incoming();
if (pp == 0)
{
ACE_ERROR((LM_ERROR,
"%d: dump_msg, could not find pp for incoming, text = %s\n",
- offset, line));
+ this->offset_, this->info_));
return;
}
- Invocation::GIOP_Buffer *target = 0;
+ GIOP_Buffer *target = 0;
switch (mode)
{
case 1: { // receiving request
- thr->handle_request();
- Invocation *inv = pp->new_invocation (rid,thr);
+ this->thr_->handle_request();
+ Invocation *inv = pp->new_invocation (rid, this->thr_);
if (inv == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: process %s already has invocation %d\n",
- offset, pp->id(), rid));
+ this->offset_, pp->id(), rid));
break;
}
- inv->init (line, offset, thr);
+ inv->init (this->line_, this->offset_, this->thr_);
+ this->thr_->push_invocation (inv);
target = inv->octets(true);
break;
}
case 0: // sending request
- thr->enter_wait(pp);
+ this->thr_->enter_wait(pp);
+ this->thr_->push_invocation (0);
// fall through.
case 3: { // receiving reply
- Invocation *inv = pp->find_invocation(rid, thr->active_handle());
+ Invocation *inv = pp->find_invocation(rid, this->thr_->active_handle());
if (inv == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: could not find existing invocation for req_id %d\n",
- offset, rid));
- inv = pp->new_invocation (rid,thr);
+ this->offset_, rid));
+ inv = pp->new_invocation (rid,this->thr_);
}
- inv->init (line, offset, thr);
+ inv->init (this->line_, this->offset_, this->thr_);
target = inv->octets(mode == 0);
if (target == 0 && mode == 3)
{
ACE_ERROR ((LM_ERROR,
"%d: could not map invocation to target for req_id %d\n",
- offset, rid));
+ this->offset_, rid));
return;
}
// if (mode == 3)
-// thr->exit_wait(pp, offset);
+// this->thr_->exit_wait(pp, this->offset_);
break;
}
case 2: { // sending reply
- target = new Invocation::GIOP_Buffer(line,offset, thr);
+ target = new GIOP_Buffer(this->line_, this->offset_, this->thr_);
+ this->thr_->pop_invocation ();
break;
}
default:;
}
- thr->set_giop_target (target);
- this_->giop_waiters_.insert_tail(thr);
- if (this_->giop_waiters_.size() > 1 && (mode == 1 || mode == 3))
+ this->thr_->set_giop_target (target);
+ if (this->giop_waiters_.size() > 0)
{
- size_t prev_size = 0;
- for (ACE_DLList_Reverse_Iterator<Thread> t_iter(this_->giop_waiters_);
+ Thread *other_thr = 0;
+ for (ACE_DLList_Iterator<Thread> t_iter(this->giop_waiters_);
!t_iter.done();
t_iter.advance())
{
- if (prev_size == 0)
- prev_size = target->expected_size();
+ t_iter.next(other_thr);
+ GIOP_Buffer *tgt = other_thr->giop_target();
+ if (tgt != 0 && this->thr_ != other_thr && target->matches (tgt))
+ {
+ // ACE_ERROR ((LM_ERROR, "%d, found duplicate for req_id %d, size %d, sending = %d, type = %d, thread %d and %d\n",
+ // this->offset_, rid, target->expected_size(), target->sending(), target->expected_type(), this->thr_->id(), other_thr->id()));
+ this->thr_->set_dup (other_thr, true);
+ }
}
}
+ this->giop_waiters_.insert_tail(this->thr_);
}
void
-Log::parse_open_listener (Log *this_, char *line, size_t )
+Log::parse_open_listener_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- char *addr = ACE_OS::strchr(line,'<') +1;
+ char *addr = ACE_OS::strchr(this->info_,'<') +1;
char *c = ACE_OS::strchr(addr,'>');
*c = '\0';
ACE_CString server_addr(addr);
- hp->add_listen_endpoint(server_addr);
+ this->hostproc_->add_listen_endpoint(server_addr);
}
void
-Log::parse_got_existing (Log *this_, char *line, size_t offset)
+Log::parse_got_existing_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *hpos = ACE_OS::strchr(line,'[');
+ char *hpos = ACE_OS::strchr(this->info_,'[');
long handle = ACE_OS::strtol(hpos+1,0,10);
- PeerProcess *pp = hp->find_peer(handle, true);
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
if (pp == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: Error parsing %C, can't find peer "
"for handle %d, text = %s\n",
- offset, this_->origin_.c_str(), handle, line));
+ this->offset_, this->origin_.c_str(), handle, this->info_));
return;
}
- thr->active_handle (handle);
+ this->thr_->active_handle (handle);
}
void
-Log::parse_muxed_tms (Log *this_, char *line, size_t offset)
+Log::parse_muxed_tms_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *hpos = ACE_OS::strchr(line,'[');
+ char *hpos = ACE_OS::strchr(this->info_,'[');
long handle = ACE_OS::strtol(hpos+1,0,10);
hpos = ACE_OS::strchr(hpos, '<');
long req_id = ACE_OS::strtol(hpos+1,0,10);
- PeerProcess *pp = hp->find_peer(handle, true);
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
if (pp == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: Error parsing %C, can't find peer "
"for handle %d, text = %s\n",
- offset, this_->origin_.c_str(), handle, line));
+ this->offset_, this->origin_.c_str(), handle, this->info_));
return;
}
- thr->active_handle (handle);
+ this->thr_->active_handle (handle);
- Invocation *inv = pp->new_invocation(req_id, thr);
+ Invocation *inv = pp->new_invocation(req_id, this->thr_);
if (inv == 0)
ACE_DEBUG ((LM_DEBUG,"%d: peer %s already has invocation id %d\n",
- offset, pp->id(), req_id));
- thr->incoming_from (pp);
+ this->offset_, pp->id(), req_id));
+ this->thr_->incoming_from (pp);
}
void
-Log::parse_exclusive_tms (Log *this_, char *line, size_t offset)
+Log::parse_exclusive_tms_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- long handle = thr->active_handle();
- PeerProcess *pp = hp->find_peer(handle, true);
+ long handle = this->thr_->active_handle();
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
if (pp == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: Error parsing %C, can't find peer "
"for handle %d, text = %s\n",
- offset, this_->origin_.c_str(), handle, line));
+ this->offset_, this->origin_.c_str(), handle, this->info_));
return;
}
- char *rpos = ACE_OS::strchr(line, '<');
+ char *rpos = ACE_OS::strchr(this->info_, '<');
long req_id = ACE_OS::strtol(rpos+1,0,10);
- Invocation *inv = pp->new_invocation(req_id, thr);
+ Invocation *inv = pp->new_invocation(req_id, this->thr_);
if (inv == 0)
ACE_DEBUG ((LM_DEBUG,"%d: peer %s already has invocation id %d\n",
- offset, pp->id(), req_id));
- thr->incoming_from (pp);
+ this->offset_, pp->id(), req_id));
+ this->thr_->incoming_from (pp);
}
void
-Log::parse_process_parsed_msgs (Log *this_, char *line, size_t offset)
+Log::parse_process_parsed_msgs_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *hpos = ACE_OS::strchr(line,'[');
- long handle = ACE_OS::strtol(hpos+1,0,10);
+ char *hpos = ACE_OS::strchr(this->info_, '[');
+ long handle = ACE_OS::strtol(hpos+1, 0, 10);
- PeerProcess *pp = hp->find_peer(handle, true);
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
if (pp == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: Error parsing %C, can't find peer "
"for handle %d, text = %s\n",
- offset, this_->origin_.c_str(), handle, line));
- pp = new PeerProcess (offset,true);
- Transport *t = new Transport ("<unknown>",false, offset);
+ this->offset_, this->origin_.c_str(), handle, this->info_));
+ pp = new PeerProcess (this->offset_, true);
+ Transport *t = new Transport ("<unknown>", false, this->offset_);
t->handle_ = handle;
pp->add_transport(t);
- hp->add_peer (handle,pp);
+ this->hostproc_->add_peer (handle,pp);
return;
}
- thr->active_handle(handle);
- thr->incoming_from (pp);
+ this->thr_->active_handle(handle);
+ this->thr_->incoming_from (pp);
}
void
-Log::parse_wait_for_event (Log *this_, char *line, size_t offset)
+Log::parse_wait_for_event_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
+// char *pos = ACE_OS::strchr (this->info_,'[');
+// long rid = ACE_OS::strtol(pos+1, 0, 10);
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
+ bool done = (ACE_OS::strstr (this->info_,"done (follower)") != 0) ||
+ (ACE_OS::strstr(this->info_,"(leader) exit") != 0);
- PeerProcess *pp = thr->incoming();
+ PeerProcess *pp = this->thr_->incoming();
if (pp == 0)
+ pp = this->thr_->pending_peer();
+ if (pp != 0 && done)
{
- ACE_ERROR((LM_ERROR,
- "%d: wait_for_event, could not find peer process for incoming, text = %s\n",
- offset, line));
- return;
+ this->thr_->exit_wait(pp, this->offset_);
}
-
- bool done = (ACE_OS::strstr (line,"done (follower)") != 0) ||
- (ACE_OS::strstr(line,"(leader) exit") != 0);
-
-
- if (done)
- thr->exit_wait(pp, offset);
-// else
-// thr->enter_wait(pp);
}
void
-Log::parse_wait_on_read (Log *this_, char *line, size_t offset)
+Log::parse_wait_on_read_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
- PeerProcess *pp = thr->incoming();
-
- thr->exit_wait (pp, offset);
+ PeerProcess *pp = this->thr_->incoming();
+ this->thr_->exit_wait (pp, this->offset_);
}
void
-Log::parse_cleanup_queue (Log *this_, char *line, size_t offset)
+Log::parse_cleanup_queue_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *hpos = ACE_OS::strchr(line,'[');
+ char *hpos = ACE_OS::strchr(this->info_,'[');
long handle = ACE_OS::strtol(hpos+1,0,10);
- PeerProcess *pp = hp->find_peer(handle, false);
- if (pp == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "%d: cleanup queue, could not find peer for handle %d\n",
- offset, handle));
- return;
- }
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
- Thread *original_thr = thr;
- Invocation::GIOP_Buffer *target = original_thr->giop_target();
+ Thread *original_thr = this->thr_;
+ GIOP_Buffer *target = original_thr->giop_target();
if (target == 0 || target->owner() != 0)
{
- original_thr = hp->find_thread_for_handle (handle);
+ original_thr = this->hostproc_->find_thread_for_handle (handle);
if (original_thr == 0)
{
ACE_ERROR ((LM_ERROR,
"%d: cleanup queue, no original "
"thread found, handle %d\n",
- offset, handle));
+ this->offset_, handle));
return;
}
target = original_thr->giop_target();
}
+ if (target != 0 && target->cur_size() == 0 && original_thr->has_dup())
+ {
+ ACE_ERROR ((LM_ERROR, "%d: cleanup queue, swapping targets for thread %d\n",
+ this->offset_, original_thr->id()));
+ original_thr->swap_target();
+ }
original_thr->set_giop_target(0);
original_thr->active_handle (0);
@@ -536,18 +478,18 @@ Log::parse_cleanup_queue (Log *this_, char *line, size_t offset)
{
ACE_ERROR ((LM_ERROR,
"%d: Cleanup queue detected, "
- "could not find invocation for rid = %d\n",
- offset, rid));
+ "could not find invocation for rid = %d on thread %d\n",
+ this->offset_, rid, original_thr->id()));
rid = target->expected_req_id();
inv = pp->find_invocation (rid, handle);
if (inv == 0)
{
ACE_ERROR ((LM_ERROR,
- "%d, Cleanup queue still failed to find rid %d\n",
- offset, rid));
+ "%d, Cleanup queue still failed to find rid %d, on thread %d\n",
+ this->offset_, rid, original_thr->id()));
return;
}
- original_thr->exit_wait(pp, offset);
+ original_thr->exit_wait(pp, this->offset_);
mtype = target->expected_type();
}
inv->set_octets (mtype == 0, target);
@@ -560,48 +502,76 @@ Log::parse_cleanup_queue (Log *this_, char *line, size_t offset)
}
void
-Log::parse_close_connection (Log *this_, char *line, size_t offset)
+Log::parse_close_connection_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
-
- char *hpos = ACE_OS::strchr(line,'[');
+ char *hpos = ACE_OS::strchr(this->info_,'[');
long handle = ACE_OS::strtol(hpos+1,0,10);
- PeerProcess *pp = hp->find_peer(handle, false);
+ PeerProcess *pp = this->hostproc_->find_peer(handle);
if (pp != 0)
{
Transport *t = pp->find_transport (handle);
if (t != 0)
- t->close_offset_ = offset;
+ t->close_offset_ = this->offset_;
}
- hp->close_peer(handle);
+ this->hostproc_->remove_peer(handle);
}
void
-Log::parse_handler_open (Log *this_, char *line, size_t offset)
+Log::parse_handler_open_i (bool is_ssl)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *addr = ACE_OS::strchr(line,'<') +1;
+ char *addr = ACE_OS::strrchr(this->info_,'<') +1;
char *c = ACE_OS::strchr(addr,'>');
*c = '\0';
c = ACE_OS::strstr(c+1,"on ");
- long handle = ACE_OS::strtol(c + 3,0,10);
- PeerProcess *pp = thr->pending_peer();
+ c += 3;
+ if (*c == '[')
+ c++;
+ long handle = ACE_OS::strtol(c,0,10);
+ PeerProcess *pp = 0;
+ if (this->conn_waiters_.size() > 0)
+ {
+ for (ACE_DLList_Iterator<PeerProcess> c_iter (this->conn_waiters_);
+ !c_iter.done();
+ c_iter.advance())
+ {
+ PeerProcess *waiter = 0;
+ c_iter.next(waiter);
+ if (waiter != 0 && waiter->server_addr () == addr)
+ {
+ pp = waiter;
+ c_iter.remove();
+ break;
+ }
+ }
+ }
+ else
+ {
+ pp = this->thr_->pending_peer();
+ }
if (pp == 0)
+ {
+ ACE_ERROR ((LM_ERROR,"%d: no pending peer for addr %s\n",
+ this->offset_, addr));
+ return;
+ }
+
+ pp->ssl (is_ssl);
+
+ const ACE_CString &local_addr = this->thr_->pending_local_addr();
+ if (local_addr.length() > 0 )
{
- ACE_ERROR ((LM_ERROR,"%d: no pending peer for file %s\n",
- offset, this_->origin_.c_str()));
- return;
+ if (pp->is_server())
+ {
+ Transport *t = new Transport (addr, true, this->offset_);
+ pp->add_transport (t);
+ this->hostproc_->add_client_endpoint (t->client_endpoint_);
+ }
+ else
+ {
+ pp->set_server_addr (local_addr);
+ }
+ this->thr_->pending_local_addr ("");
}
Transport *trans = 0;
@@ -613,209 +583,302 @@ Log::parse_handler_open (Log *this_, char *line, size_t offset)
ACE_ERROR ((LM_ERROR,
"%d: Pending peer exists, but no last transport "
"set, file %s\n",
- offset, this_->origin_.c_str()));
+ this->offset_, this->origin_.c_str()));
return;
}
// trans->client_endpoint_ = addr;
}
else
{
- trans = new Transport (addr,false,offset);
+ trans = new Transport (addr, false, this->offset_);
pp->add_transport(trans);
}
trans->handle_ = handle;
- thr->pending_peer(0);
- hp->add_peer(handle,pp);
+ this->thr_->pending_peer(0);
+ this->hostproc_->add_peer (handle,pp);
}
void
-Log::parse_SSLIOP_from_client (Log *this_, char *line, size_t offset)
+Log::parse_begin_connection_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *addr = ACE_OS::strchr(line,'<') +1;
+ char *addr = ACE_OS::strchr(this->info_,'<') +1;
char *c = ACE_OS::strchr(addr,'>');
*c = '\0';
- c = ACE_OS::strstr(c+1,"on [");
-
- PeerProcess *pp = thr->pending_peer();
+ PeerProcess *pp = this->hostproc_->find_peer(addr);
if (pp == 0)
{
- pp = new PeerProcess (offset, false);
- thr->pending_peer (pp);
+ pp = new PeerProcess(this->offset_, true);
+ pp->set_server_addr (addr);
}
-
- pp->set_server_addr(addr);
+ this->conn_waiters_.insert_tail (pp);
+ this->thr_->pending_peer (pp);
}
+
void
-Log::parse_SSLIOP_from_server (Log *this_, char *line, size_t offset)
+Log::parse_local_addr_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *addr = ACE_OS::strchr(line,'<') +1;
+ char *addr = ACE_OS::strchr(this->info_,'<') +1;
char *c = ACE_OS::strchr(addr,'>');
*c = '\0';
- c = ACE_OS::strstr(c+1,"on [");
- long handle = ACE_OS::strtol(c + 4,0,10);
- PeerProcess *pp = thr->pending_peer();
- if (pp == 0)
+
+ PeerProcess *peer = this->thr_->pending_peer();
+ if (peer == 0)
{
- ACE_ERROR ((LM_ERROR,"%d: no pending peer for file %s\n",
- offset, this_->origin_.c_str()));
- return;
+ this->thr_->pending_local_addr (addr);
+ return;
}
- Transport *trans = new Transport (addr,false,offset);
- pp->add_transport(trans);
- trans->handle_ = handle;
- thr->pending_peer(0);
- hp->add_peer(handle,pp);
+ if (peer->is_server())
+ {
+ Transport *t = new Transport (addr, true, this->offset_);
+ peer->add_transport (t);
+ this->hostproc_->add_client_endpoint (t->client_endpoint_);
+ }
+ else
+ {
+ peer->set_server_addr (addr);
+ }
}
void
-Log::parse_begin_connection (Log *this_, char *line, size_t offset)
+Log::parse_connection_not_complete_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- char *addr = ACE_OS::strchr(line,'<') +1;
- char *c = ACE_OS::strchr(addr,'>');
- *c = '\0';
- PeerProcess *pp = hp->find_peer(addr);
- if (pp == 0)
- {
- pp = new PeerProcess(offset,true);
- pp->set_server_addr (addr);
- }
- thr->pending_peer (pp);
+ this->thr_->pending_peer (0);
}
void
-Log::parse_SSLIOP_begin_connection (Log *this_, char *line, size_t offset)
+Log::parse_open_as_server_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
+ this->thr_->pending_peer (new PeerProcess(this->offset_, false));
+}
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
+void
+Log::parse_wait_for_connection_i (void)
+{
+ // ACE_ERROR ((LM_ERROR,"%d: parse_wait_for_connection, line = %s\n", this->offset_, this->line_));
+}
- PeerProcess *pp = new PeerProcess(offset,true);
- thr->pending_peer (pp);
+void
+Log::parse_post_open_i (void)
+{
+ // ACE_ERROR ((LM_ERROR,"%d: parse_post_open, line = %s\n", this->offset_, this->line_));
}
void
-Log::parse_local_addr (Log *this_, char *line, size_t offset)
+Log::parse_notify_poa_helper_i (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
+ Invocation *inv = this->thr_->current_invocation ();
+ if (inv == 0)
+ {
+ ACE_ERROR ((LM_ERROR,"%d: parse_notify_poa_helper line = %s, no current invocation on thread\n", this->offset_, this->info_));
+ return;
+ }
+ bool activate = ACE_OS::strstr (this->info_, "Activating") != 0;
+ char *idpos = ACE_OS::strstr (this->info_, "id = ");
+ long objid = ACE_OS::strtol (idpos + 5, 0, 10);
+ idpos = ACE_OS::strstr (idpos + 5, "in POA : ");
+ long poaid = ACE_OS::strtol (idpos + 10, 0, 10);
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
+ char buffer[100];
+ ACE_OS::sprintf (buffer,"Notify object %s, object id %ld, POA %ld on line %ld",
+ (activate ? "activation" : "deactivation"), objid, poaid, this->offset_);
+ ACE_CString text (buffer);
- PeerProcess *peer = thr->pending_peer();
- if (peer == 0)
+ inv->add_notify_incident (text, this->offset_);
+}
+
+void
+Log::parse_notify_object_i (void)
+{
+ Invocation *inv = this->thr_->current_invocation ();
+ if (inv == 0)
{
- ACE_ERROR((LM_ERROR, "%d: file %s, no pending client or server\n",
- offset, this_->origin_.c_str()));
- return;
+ // ACE_ERROR ((LM_ERROR,"%d: parse_notify_object line = %s, no current invocation on thread\n", this->offset_, this->info_));
}
- char *addr = ACE_OS::strchr(line,'<') +1;
- char *c = ACE_OS::strchr(addr,'>');
- *c = '\0';
- if (peer->is_server())
+ char *ptr = ACE_OS::strstr (this->info_, "object:") + 7;
+ u_long objid = ACE_OS::strtol (ptr, &ptr, 16);
+ char note[100];
+ note[0] = 0;
+ if (ACE_OS::strstr (ptr, "created") != 0)
{
- Transport *t = new Transport (addr, true, offset);
- peer->add_transport (t);
- hp->add_client_endpoint (t->client_endpoint_);
+ ::sprintf (note, "Created notify object %lx",objid);
+#if 0
+ NotifyObject notobj = new NotifyObject (objid, this->offset_, this->timestamp_);
+ this->hostproc_->add_notify_obj (notobj);
+#endif
}
- else
+ else if (ACE_OS::strstr (ptr, "destroyed") != 0)
{
- peer->set_server_addr (addr);
+ ::sprintf (note, "Destroyed notify object %lx",objid);
+#if 0
+ NotifyObject notobj = this->hostproc_->find_notify_obj (objid);
+ if (notobj == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "%d: could not find notify object %lx\n", this->offset_, objid));
+ }
+ else
+ {
+ notobj->destroyed (this->offset_, this->timestamp_);
+ }
+#endif
+ }
+ else if (ACE_OS::strstr (ptr, "incr ") != 0)
+ {
+ ptr = ACE_OS::strchr (ptr, '=');
+ int count = ACE_OS::strtol (ptr + 2, 0, 10);
+ ::sprintf (note, "increment reference notify object %lx, count now %d",objid, count);
+#if 0
+ NotifyObject notobj = this->hostproc_->find_notify_obj (objid);
+ if (notobj == 0)
+ {
+ notobj = new NotifyObject (objid, this->offset_, this->timestamp_);
+ this->hostproc_->add_notify_obj (notobj);
+ }
+ notobj->incr (this->offset_, this->timestamp_);
+#endif
+ }
+ else if (ACE_OS::strstr (ptr, "decr ") != 0)
+ {
+ ptr = ACE_OS::strchr (ptr, '=');
+ int count = ACE_OS::strtol (ptr + 2, 0, 10);
+ ::sprintf (note, "decrement reference notify object %lx, count now %d",objid, count);
+#if 0
+ NotifyObject notobj = this->hostproc_->find_notify_obj (objid);
+ if (notobj == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "%d: could not find notify object %x\n", this->offset_, objid));
+ }
+ else
+ {
+ notobj->decr (this->offset_, this->timestamp_);
+ }
+#endif
}
+
+ ACE_CString text (note);
+ if (inv)
+ inv->add_notify_incident (text, this->offset_);
}
void
-Log::parse_open_as_server (Log *this_, char *line, size_t offset)
+Log::get_timestamp (void)
{
- long pid = 0;
- long tid = 0;
- this_->get_pid_tid(pid,tid,line);
-
- HostProcess *hp = this_->get_host(pid);
- Thread *thr = hp == 0 ? 0 : hp->find_thread (tid);
-
- thr->pending_peer (new PeerProcess(offset, false));
-
+ const char *time_tok = ACE_OS::strchr (this->line_,'@');
+ size_t len = (size_t)(time_tok - this->line_);
+ if (time_tok != 0 && len < 30)
+ {
+ this->timestamp_ = ACE_CString (this->line_, len);
+#if 0
+ int year, mon, day;
+ int hr, min, sec, msec;
+ ::sscanf (hms+1,"%d-%d-%d %d:%d:%d.%d", &year, &mon, &day, &hr, &min, &sec, &msec);
+ time = (hr * 3600 + min *60 + sec) * 1000 + msec;
+ if (this->time_ > time)
+ time += 24 * 3600 * 1000;
+#endif
+ }
}
void
-Log::parse_line (char *line, size_t offset)
+Log::parse_line (void)
{
- // first, is it a client connection to a new peer?
- // next is it a server connection to a new peer?
- // is it a new request or reply?
- // a GIOP hex dump?
-
- static parse_key exprs[] =
- {
- { "Handler::open, IIOP connection to peer", parse_handler_open },
- { "GIOP_Message_Base::dump_msg,", parse_dump_msg },
- { "GIOP message - HEXDUMP", parse_HEXDUMP },
- { "open_i, listening on:", parse_open_listener },
- { "open_i - listening on:", parse_open_listener },
- { "Muxed_TMS[", parse_muxed_tms },
- { "Exclusive_TMS::request_id", parse_exclusive_tms },
- { "process_parsed_messages", parse_process_parsed_msgs },
- { "wait_for_event", parse_wait_for_event },
- { "Wait_On_Read", parse_wait_on_read },
- { "::cleanup_queue, byte_count", parse_cleanup_queue },
- { "close_connection_eh", parse_close_connection },
- { "ssliop_connect, making a new ", parse_SSLIOP_begin_connection },
- { "SSLIOP connection from client", parse_SSLIOP_from_client },
- { "SSLIOP connection accepted from server", parse_SSLIOP_from_server },
- { "IIOP_Connector::begin_connection, to ", parse_begin_connection },
- { "IIOP_Connection_Handler::open, The local addr is", parse_local_addr },
- { "opened as TAO_SERVER_ROLE", parse_open_as_server },
- { "Transport_Connector::connect, got an existing connected", parse_got_existing },
- { 0,0 }
- };
-
if (this->dump_target_ != 0)
{
- this->handle_msg_dump (line, offset);
+ this->handle_msg_octets ();
return;
}
- for (int i = 0; exprs[i].text != 0; i++)
+ this->get_preamble();
+ this->get_timestamp();
+
+ if (ACE_OS::strstr (this->info_, "Handler::open, IIOP connection to peer") != 0)
{
- if (ACE_OS::strstr(line, exprs[i].text) != 0)
- {
- (*exprs[i].op)(this, line, offset);
- return;
- }
+ this->parse_handler_open_i(false);
+ }
+ else if (ACE_OS::strstr (this->info_, "GIOP_Message_Base::dump_msg,") != 0)
+ {
+ this->parse_dump_giop_msg_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "GIOP message - HEXDUMP") != 0)
+ {
+ this->parse_HEXDUMP_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "open_i, listening on:") != 0)
+ {
+ this->parse_open_listener_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Muxed_TMS[") != 0)
+ {
+ this->parse_muxed_tms_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Exclusive_TMS::request_id") != 0)
+ {
+ this->parse_exclusive_tms_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "process_parsed_messages") != 0)
+ {
+ this->parse_process_parsed_msgs_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "wait_for_event") != 0)
+ {
+ this->parse_wait_for_event_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Wait_On_Read") != 0)
+ {
+ this->parse_wait_on_read_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "::cleanup_queue, byte_count") != 0)
+ {
+ this->parse_cleanup_queue_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "close_connection_eh") != 0)
+ {
+ this->parse_close_connection_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "IIOP_Connector::begin_connection, to ") != 0)
+ {
+ this->parse_begin_connection_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "IIOP_Connection_Handler::open, The local addr is") != 0)
+ {
+ this->parse_local_addr_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Connection not complete.") != 0)
+ {
+ this->parse_connection_not_complete_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "opened as TAO_SERVER_ROLE") != 0)
+ {
+ this->parse_open_as_server_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Transport_Connector::connect, got an existing connected") != 0)
+ {
+ this->parse_got_existing_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Transport_Connector::wait_for_connection_competion") != 0)
+ {
+ this->parse_wait_for_connection_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "Transport::post_open, tport") != 0)
+ {
+ this->parse_post_open_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "SSLIOP connection from client") != 0)
+ {
+ this->parse_handler_open_i(true);
+ }
+ else if (ACE_OS::strstr (this->info_, "SSLIOP connection accepted from server") != 0)
+ {
+ this->parse_local_addr_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "POA_Helper") != 0)
+ {
+ this->parse_notify_poa_helper_i();
+ }
+ else if (ACE_OS::strstr (this->info_, "object:") != 0)
+ {
+ this->parse_notify_object_i ();
}
return;
}
-
-void
-Log::summarize (void)
-{
- // todo
-}
diff --git a/TAO/utils/logWalker/Log.h b/TAO/utils/logWalker/Log.h
index 3aaffa8853d..1ee3c21231d 100644
--- a/TAO/utils/logWalker/Log.h
+++ b/TAO/utils/logWalker/Log.h
@@ -9,68 +9,86 @@
#include "ace/Containers.h"
#include "ace/Synch.h"
#include "ace/SString.h"
+#include "ace/Time_Value.h"
#include "PeerProcess.h"
#include "HostProcess.h"
+#include "GIOP_Buffer.h"
class Session;
class HostProcess;
+class Invocation;
typedef ACE_DLList<HostProcess> HostProcesses;
+class Incident
+{
+public:
+ ACE_CString timestamp_;
+ size_t offset_;
+ int thread_;
+ ACE_CString annotation_;
+ Invocation *invocation_;
+};
+
+typedef ACE_Unbounded_Queue<Incident> IncidentList;
+
+
class Log
{
public:
Log (Session &s);
- ~Log();
-
- bool init (const ACE_TCHAR *filename, const char *alias = "");
-
- void summarize(void);
-
- void dump (ostream &strm);
-
-private:
- typedef void (* parser_func)(Log *this_, char *line, size_t offset);
-
- struct parse_key
- {
- const char *text;
- parser_func op;
- };
-
- bool get_pid_tid (long &pid, long &tid, char *line);
- HostProcess *get_host (long pid);
- void handle_msg_dump (char *line, size_t offset);
- void parse_line (char* line, size_t offset);
-
- static void parse_handler_open (Log *this_, char *line, size_t offset);
- static void parse_SSLIOP_handler_open (Log *this_, char *line, size_t offset);
- static void parse_dump_msg (Log *this_, char *line, size_t offset);
- static void parse_HEXDUMP (Log *this_, char *line, size_t offset);
- static void parse_open_listener (Log *this_, char *line, size_t offset);
- static void parse_got_existing (Log *this_, char *line, size_t offset);
- static void parse_muxed_tms (Log *this_, char *line, size_t offset);
- static void parse_exclusive_tms (Log *this_, char *line, size_t offset);
- static void parse_process_parsed_msgs (Log *this_, char *line, size_t offset);
- static void parse_wait_for_event (Log *this_, char *line, size_t offset);
- static void parse_wait_on_read (Log *this_, char *line, size_t offset);
- static void parse_cleanup_queue (Log *this_, char *line, size_t offset);
- static void parse_close_connection (Log *this_, char *line, size_t offset);
- static void parse_begin_connection (Log *this_, char *line, size_t offset);
- static void parse_SSLIOP_begin_connection (Log *this_, char *line, size_t offset);
- static void parse_SSLIOP_from_client (Log *this_, char *line, size_t offset);
- static void parse_SSLIOP_from_server (Log *this_, char *line, size_t offset);
- static void parse_local_addr (Log *this_, char *line, size_t offset);
- static void parse_open_as_server (Log *this_, char *line, size_t offset);
+ virtual ~Log(void);
+
+ bool process_file (const ACE_TCHAR *filename, const char *alias = "");
+
+protected:
+
+ virtual void parse_line (void);
+
+ void get_preamble (void);
+ void get_timestamp (void);
+ void handle_msg_octets (void);
+ bool match_target(void);
+
+ void parse_handler_open_i (bool is_ssl);
+ void parse_dump_giop_msg_i (void);
+ void parse_HEXDUMP_i (void);
+ void parse_open_listener_i (void);
+ void parse_got_existing_i (void);
+ void parse_muxed_tms_i (void);
+ void parse_exclusive_tms_i (void);
+ void parse_process_parsed_msgs_i (void);
+ void parse_wait_for_event_i (void);
+ void parse_wait_on_read_i (void);
+ void parse_cleanup_queue_i (void);
+ void parse_close_connection_i (void);
+ void parse_begin_connection_i (void);
+ void parse_local_addr_i (void);
+ void parse_connection_not_complete_i (void);
+ void parse_open_as_server_i (void);
+ void parse_wait_for_connection_i (void);
+ void parse_post_open_i (void);
+ void parse_notify_poa_helper_i (void);
+ void parse_notify_object_i (void);
ACE_CString origin_;
ACE_CString alias_;
Session &session_;
HostProcesses procs_;
- Invocation::GIOP_Buffer* dump_target_;
+ GIOP_Buffer unknown_msg_;
+ GIOP_Buffer* dump_target_;
ThreadList giop_waiters_;
-
+ ACE_DLList<PeerProcess> conn_waiters_;
+ IncidentList history_;
+
+ // parsed for every line
+ ACE_CString timestamp_;
+ char *line_;
+ char *info_;
+ size_t offset_;
+ HostProcess *hostproc_;
+ Thread *thr_;
};
#endif // LOG_WALKER_LOG_H
diff --git a/TAO/utils/logWalker/PeerObject.cpp b/TAO/utils/logWalker/PeerObject.cpp
index 3cf504bcb5e..00ec6e7f9c9 100644
--- a/TAO/utils/logWalker/PeerObject.cpp
+++ b/TAO/utils/logWalker/PeerObject.cpp
@@ -41,7 +41,10 @@ PeerObject::num_invocations (void)
void
PeerObject::dump_detail (ostream &strm)
{
- strm << this->ident_ << " has "
- << this->invocations_.size() << " invocations" << endl;
+ size_t s = this->invocations_.size();
+ strm << " " << this->name_ << " has "
+ << s << " invocation"
+ << (s > 1 ? "s" : "")
+ << endl;
}
diff --git a/TAO/utils/logWalker/PeerProcess.cpp b/TAO/utils/logWalker/PeerProcess.cpp
index 10669845dda..e0a7ca87ac1 100644
--- a/TAO/utils/logWalker/PeerProcess.cpp
+++ b/TAO/utils/logWalker/PeerProcess.cpp
@@ -20,11 +20,11 @@ Transport::Transport (const char *addr, bool is_client, size_t offset)
}
char *
-PeerProcess::nextIdent(void)
+PeerProcess::nextIdent(bool is_server)
{
static int count = 0;
char *ident = new char[15];
- ACE_OS::sprintf (ident,"proc_%d", count++);
+ ACE_OS::sprintf (ident,"%s_%d", (is_server ? "server" : "client"), count++);
return ident;
}
@@ -33,10 +33,12 @@ PeerProcess::PeerProcess (size_t offset, bool is_server)
remote_ (0),
server_addr_(),
server_(is_server),
+ ssl_(false),
origin_offset_ (offset),
- objects_ ()
+ objects_ (),
+ object_by_index_ ()
{
- this->ident_ = PeerProcess::nextIdent();
+ this->ident_ = PeerProcess::nextIdent(is_server);
}
PeerProcess::~PeerProcess (void)
@@ -54,18 +56,10 @@ PeerProcess::~PeerProcess (void)
break;
delete entry->item();
}
- for (TransportList::ITERATOR i(this->transports_); !i.done(); i++)
- {
- ACE_DLList_Node *entry;
- if (i.next(entry) == 0)
- break;
- //i.remove ();
- delete reinterpret_cast<Transport*>(entry->item_);
- }
}
void
-PeerProcess::set_server_addr (const char *addr)
+PeerProcess::set_server_addr (const ACE_CString &addr)
{
this->server_addr_ = addr;
}
@@ -89,6 +83,12 @@ PeerProcess::is_server (void) const
}
void
+PeerProcess::ssl (bool is_ssl)
+{
+ this->ssl_ = is_ssl;
+}
+
+void
PeerProcess::add_transport (Transport *t)
{
this->last_transport_ = t;
@@ -161,8 +161,9 @@ PeerProcess::object_for (const char *oid, size_t len)
long index = static_cast<long>(objects_.current_size());
char alias[20];
ACE_OS::sprintf (alias, "obj_%ld", index);
- po = new PeerObject(index,alias, this);
+ po = new PeerObject(index, alias, this);
objects_.bind(key, po);
+ object_by_index_.bind (index, po);
}
return po;
}
@@ -172,7 +173,7 @@ PeerProcess::new_invocation (size_t req_id, Thread *thr)
{
if (this->find_invocation (req_id, thr->active_handle()) != 0)
return 0;
- Invocation *inv = new Invocation (this, thr->active_handle(), req_id);
+ Invocation *inv = new Invocation (this, thr, req_id);
this->invocations_.insert_tail(inv);
thr->add_invocation (inv);
return inv;
@@ -236,6 +237,8 @@ PeerProcess::dump_summary (ostream &strm)
else
strm << " peer process " << this->ident_;
strm << " is a ";
+ if (this->ssl_)
+ strm << "secure ";
if (this->server_)
strm << "server at ";
else
@@ -252,7 +255,7 @@ PeerProcess::dump_summary (ostream &strm)
Transport *tran = 0;
i.next(tran);
strm << " connection[" << tran->handle_ << "] ";
- strm << (tran->local_is_client_ ? "from " : "to ");
+ strm << (tran->local_is_client_ ? "to " : "from ");
strm << tran->client_endpoint_;
strm << " created line " << tran->open_offset_;
if (tran->close_offset_)
@@ -265,18 +268,22 @@ void
PeerProcess::dump_object_detail (ostream &strm)
{
strm << this->objects_.current_size()
- << " Objects referenced in ";
+ << " Objects referenced";
+ if (this->server_)
+ strm << " in ";
+ else
+ strm << " by ";
if (this->remote_)
strm << remote_->proc_name();
else
- strm << " peer process " << this->ident_;
+ strm << "peer process " << this->ident_;
strm << ":" << endl;
size_t count_inv = 0;
- for (PeerObjectTable::ITERATOR i = this->objects_.begin();
- i != this->objects_.end();
- i++)
+ for (ObjectByIndex::ITERATOR i = this->object_by_index_.begin();
+ !i.done();
+ i.advance())
{
- PeerObjectTable::ENTRY *entry = 0;
+ ObjectByIndex::ENTRY *entry = 0;
i.next (entry);
PeerObject *obj = entry->item();
obj->dump_detail (strm);
@@ -288,7 +295,8 @@ PeerProcess::dump_object_detail (ostream &strm)
void
PeerProcess::dump_invocation_detail (ostream &strm)
{
- strm << "\n " << this->invocations_.size() << " Invocations with ";
+ strm << "\n " << this->invocations_.size() << " Invocations ";
+ strm << (this->server_ ? "to " : "from ");
if (this->remote_)
strm << remote_->proc_name();
else
diff --git a/TAO/utils/logWalker/PeerProcess.h b/TAO/utils/logWalker/PeerProcess.h
index 76205ba19ad..81165ac93a8 100644
--- a/TAO/utils/logWalker/PeerProcess.h
+++ b/TAO/utils/logWalker/PeerProcess.h
@@ -32,13 +32,14 @@ public:
typedef ACE_RB_Tree<u_long, PeerObject*, ACE_Less_Than<u_long>, ACE_Null_Mutex> PeerObjectTable;
+typedef ACE_RB_Tree<long, PeerObject*, ACE_Less_Than<long>, ACE_Null_Mutex> ObjectByIndex;
typedef ACE_DLList<Invocation> InvocationList;
typedef ACE_DLList<Transport> TransportList;
class PeerProcess
{
public:
- static char *nextIdent(void);
+ static char *nextIdent(bool is_server);
PeerProcess (size_t offset, bool is_server);
virtual ~PeerProcess (void);
@@ -49,11 +50,12 @@ public:
HostProcess *owner (void);
void match_hosts (Session *session);
- void set_server_addr (const char *addr);
+ void set_server_addr (const ACE_CString &addr);
const ACE_CString &server_addr (void) const;
const ACE_CString &last_client_addr (void) const;
bool is_server (void) const;
+ void ssl (bool is_ssl);
void add_transport (Transport *t);
Transport *last_transport (void);
Transport *find_transport (long handle);
@@ -72,15 +74,18 @@ public:
private:
char *ident_;
+ char *origin_;
HostProcess *owner_;
HostProcess *remote_;
ACE_CString server_addr_;
TransportList transports_;
Transport *last_transport_;
bool server_;
+ bool ssl_;
size_t origin_offset_;
PeerObjectTable objects_;
InvocationList invocations_;
+ ObjectByIndex object_by_index_;
};
diff --git a/TAO/utils/logWalker/Session.cpp b/TAO/utils/logWalker/Session.cpp
index ad497703eb9..898be5e84c6 100644
--- a/TAO/utils/logWalker/Session.cpp
+++ b/TAO/utils/logWalker/Session.cpp
@@ -9,8 +9,6 @@
long
Session::tao_version_ = 200;
-int
-Session::date_format_ = 1;
Session::Session (void)
{
@@ -53,24 +51,6 @@ Session::tao_version (void)
return tao_version_;
}
-bool
-Session::set_date_format (ACE_TCHAR *str)
-{
- if (ACE_OS::strncmp(str, ACE_TEXT("1"), 1)== 0)
- date_format_ = 1;
- else if (ACE_OS::strncmp (str, ACE_TEXT("2"), 1) == 0)
- date_format_ = 2;
- else
- return false;
- return true;
-}
-
-int
-Session::date_format (void)
-{
- return date_format_;
-}
-
void
Session::add_process (HostProcess *proc)
{
diff --git a/TAO/utils/logWalker/Session.h b/TAO/utils/logWalker/Session.h
index 7e944fc5701..2219921469a 100644
--- a/TAO/utils/logWalker/Session.h
+++ b/TAO/utils/logWalker/Session.h
@@ -33,9 +33,6 @@ public:
static bool set_tao_version (ACE_TCHAR *str);
static long tao_version (void);
- static int date_format (void);
- static bool set_date_format (ACE_TCHAR *ser);
-
void alternate_address (const char *string);
void default_service (const char *string);
@@ -56,7 +53,6 @@ private:
ACE_CString base_dir_;
ACE_CString outfile_;
static long tao_version_;
- static int date_format_;
};
#endif // LOG_WALKER_SESSION_H
diff --git a/TAO/utils/logWalker/Thread.cpp b/TAO/utils/logWalker/Thread.cpp
index 57345a22447..3635358006d 100644
--- a/TAO/utils/logWalker/Thread.cpp
+++ b/TAO/utils/logWalker/Thread.cpp
@@ -3,21 +3,25 @@
#include "Thread.h"
#include "Invocation.h"
#include "PeerProcess.h"
+#include "GIOP_Buffer.h"
#include "ace/OS_NS_stdio.h"
-
#include <stack>
-Thread::Thread (long tid, const char *alias)
+Thread::Thread (long tid, const char *alias, size_t offset)
: id_(tid),
alias_ (alias),
max_depth_ (0),
- encounters_ (0),
+ client_encounters_ (0),
+ server_encounters_ (0),
nested_ (0),
pending_(),
incoming_(0),
new_connection_(0),
giop_target_(0),
- active_handle_ (0)
+ target_dup_(0),
+ current_invocation_ (),
+ active_handle_ (0),
+ first_line_ (offset)
{
}
@@ -34,9 +38,21 @@ Thread::pending_peer (void) const
}
void
+Thread::pending_local_addr (const ACE_CString &addr)
+{
+ this->pending_local_addr_ = addr;
+}
+
+const ACE_CString &
+Thread::pending_local_addr (void) const
+{
+ return this->pending_local_addr_;
+}
+
+void
Thread::handle_request (void)
{
- this->encounters_++;
+ this->server_encounters_++;
if (this->pending_.size() > 1)
this->nested_++;
}
@@ -45,7 +61,7 @@ void
Thread::enter_wait (PeerProcess *pp)
{
this->pending_.push (pp);
- this->encounters_++;
+ this->client_encounters_++;
if (this->pending_.size() > this->max_depth_)
this->max_depth_ = this->pending_.size();
if (this->pending_.size() > 1)
@@ -76,12 +92,6 @@ Thread::max_depth (void) const
}
long
-Thread::encounters (void) const
-{
- return this->encounters_;
-}
-
-long
Thread::id (void) const
{
return this->id_;
@@ -117,16 +127,61 @@ Thread::active_handle (void) const
return this->active_handle_;
}
-Invocation::GIOP_Buffer *
+void
+Thread::set_dup (Thread *other, bool set_other)
+{
+ this->target_dup_ = other;
+ if (set_other)
+ {
+ other->set_dup (this, false);
+ }
+}
+
+void
+Thread::clear_dup (void)
+{
+ this->target_dup_ = 0;
+}
+
+bool
+Thread::has_dup (void)
+{
+ return this->target_dup_ != 0;
+}
+
+void
+Thread::swap_target (void)
+{
+ if (target_dup_ != 0 && target_dup_->giop_target() != 0)
+ {
+ this->giop_target_->swap (target_dup_->giop_target());
+ this->target_dup_->clear_dup ();
+ this->target_dup_ = 0;
+ }
+ else
+ {
+ if (target_dup_ == 0)
+ ACE_ERROR ((LM_ERROR, "Thread::swap_target, target_dup_ == 0\n"));
+ else
+ ACE_ERROR ((LM_ERROR, "Thread::swap_target, target_dup_.id = %d, giop_target == 0\n", target_dup_->id()));
+ }
+}
+
+GIOP_Buffer *
Thread::giop_target (void)
{
return this->giop_target_;
}
void
-Thread::set_giop_target (Invocation::GIOP_Buffer *buffer)
+Thread::set_giop_target (GIOP_Buffer *buffer)
{
this->giop_target_ = buffer;
+ if (this->target_dup_ != 0)
+ {
+ this->target_dup_->clear_dup();
+ this->target_dup_ = 0;
+ }
}
void
@@ -136,10 +191,34 @@ Thread::add_invocation (Invocation *inv)
}
void
-Thread::dump_detail (ostream &strm)
+Thread::push_invocation (Invocation *inv)
+{
+ this->current_invocation_.push(inv);
+}
+
+void
+Thread::pop_invocation (void)
+{
+ Invocation *inv;
+ this->current_invocation_.pop (inv);
+}
+
+Invocation *
+Thread::current_invocation (void) const
+{
+ Invocation *inv = 0;
+ if (this->current_invocation_.size() > 0)
+ this->current_invocation_.top(inv);
+ return inv;
+}
+
+void
+Thread::dump_detail (ostream &strm) const
{
strm << " " << this->alias_ << " tid = " << this->id_
- << "\t" << this->encounters_ << " encounters";
+ << "\tfirst line " << this->first_line_ << "\t"
+ << this->server_encounters_ << " requests sent "
+ << this->client_encounters_ << " requests received";
if (nested_ > 0)
strm <<", with " << this->nested_ << " nested upcalls, max depth "
<< this->max_depth_;
@@ -147,8 +226,31 @@ Thread::dump_detail (ostream &strm)
}
void
+Thread::get_summary (long &sent_reqs, long &recv_reqs, size_t &sent_size, size_t &recv_size)
+{
+ for (ACE_DLList_Iterator <Invocation> i(this->invocations_);
+ !i.done();
+ i.advance())
+ {
+ Invocation *inv;
+ i.next(inv);
+ if (inv->sent_request())
+ {
+ ++sent_reqs;
+ sent_size += inv->request_bytes();
+ }
+ else
+ {
+ ++recv_reqs;
+ recv_size += inv->request_bytes();
+ }
+ }
+}
+
+void
Thread::dump_invocations (ostream &strm)
{
+ unsigned long total_request_bytes = 0;
strm << " " << this->alias_ << " handled " << this->invocations_.size() << " invocations" << endl;
std::stack<Invocation *> nested;
@@ -171,5 +273,7 @@ Thread::dump_invocations (ostream &strm)
nested.push(inv);
inv->dump_detail (strm, level, Invocation::Dump_Proc, false);
+ total_request_bytes += inv->request_bytes();
}
+ strm << "total request octet count: " << total_request_bytes;
}
diff --git a/TAO/utils/logWalker/Thread.h b/TAO/utils/logWalker/Thread.h
index 4660d34a0c1..d6bf5f5d7b1 100644
--- a/TAO/utils/logWalker/Thread.h
+++ b/TAO/utils/logWalker/Thread.h
@@ -14,44 +14,60 @@
#include "PeerProcess.h"
typedef ACE_Unbounded_Stack<PeerProcess *> UpcallStack;
+typedef ACE_Unbounded_Stack<Invocation *> InvocationStack;
class Thread
{
public:
- Thread (long tid, const char *alias);
+ Thread (long tid, const char *alias, size_t offset);
long max_depth (void) const;
- long encounters (void) const;
+ long client_encounters (void) const;
+ long server_encounters (void) const;
long id (void) const;
const ACE_CString &alias (void) const;
void incoming_from (PeerProcess *);
void add_invocation (Invocation *);
+ void push_invocation (Invocation *);
+ void pop_invocation (void);
+ Invocation *current_invocation (void) const;
PeerProcess *incoming (void) const;
void handle_request (void);
void enter_wait (PeerProcess *);
void exit_wait (PeerProcess *, size_t linenum);
- Invocation::GIOP_Buffer *giop_target (void);
- void set_giop_target (Invocation::GIOP_Buffer *buffer);
- void dump_detail (ostream &strm);
+ GIOP_Buffer *giop_target (void);
+ void set_giop_target (GIOP_Buffer *buffer);
+ void dump_detail (ostream &strm) const;
void dump_invocations (ostream &strm);
+ void get_summary (long &sent_reqs, long &recv_reqs, size_t &sent_size, size_t &recv_size);
PeerProcess *pending_peer (void) const;
void pending_peer (PeerProcess *pp);
-
+ void pending_local_addr (const ACE_CString &addr);
+ const ACE_CString& pending_local_addr (void) const;
void active_handle (long handle);
long active_handle (void) const;
+ void set_dup (Thread *other, bool set_other);
+ void clear_dup (void);
+ void swap_target (void);
+ bool has_dup (void);
private:
long id_;
ACE_CString alias_;
size_t max_depth_;
- long encounters_;
+ long client_encounters_;
+ long server_encounters_;
long nested_;
UpcallStack pending_;
PeerProcess *incoming_;
PeerProcess *new_connection_;
- Invocation::GIOP_Buffer *giop_target_;
+ ACE_CString pending_local_addr_;
+ GIOP_Buffer *giop_target_;
+ Thread *target_dup_;
InvocationList invocations_;
+ InvocationStack current_invocation_;
long active_handle_;
+ size_t first_line_;
};
#endif // LOG_WALKER_THREAD_H
diff --git a/TAO/utils/logWalker/logWalker.cpp b/TAO/utils/logWalker/logWalker.cpp
index cbd0c7375c3..b669c89c1d3 100644
--- a/TAO/utils/logWalker/logWalker.cpp
+++ b/TAO/utils/logWalker/logWalker.cpp
@@ -30,7 +30,7 @@ parse_filename (Session &session, char * buffer)
Log log(session);
if (ACE_OS::strchr(buffer,'=') == 0)
{
- log.init(ACE_TEXT_CHAR_TO_TCHAR(buffer));
+ log.process_file (ACE_TEXT_CHAR_TO_TCHAR(buffer));
}
else
{
@@ -38,7 +38,7 @@ parse_filename (Session &session, char * buffer)
tokens.delimiter_replace('=', 0);
char *alias = tokens.next();
ACE_TString filename = ACE_TEXT_CHAR_TO_TCHAR(tokens.next());
- log.init(filename.c_str(), alias);
+ log.process_file (filename.c_str(), alias);
}
}
@@ -111,13 +111,12 @@ void
print_help (void)
{
ACE_DEBUG ((LM_DEBUG, "tao_logWalker recongizes the following arguments\n"));
- ACE_DEBUG ((LM_DEBUG, "-outfile <filename> - write all output to specified file\n"));
- ACE_DEBUG ((LM_DEBUG, "-dir <directory> - create separate output files, one per log, and put them in specified directory.\n Either -outfile or -dir may be set but not both. Default output to stdout.\n"));
- ACE_DEBUG ((LM_DEBUG, "-manifest <manifest> - Take inputs from named manifest file\n"));
- ACE_DEBUG ((LM_DEBUG, "-tao <1.5 .. 2.0> - set source TAO version, default 2.0\n"));
- ACE_DEBUG ((LM_DEBUG, "-date <1|2> - interpret dates as 1) YYYY-MM-DD hh:mm:ss.sss, or 2) MMM DD hh:mm:ss.sss YYYY\n"));
- ACE_DEBUG ((LM_DEBUG, "-alias <name=address> - bind an alias to a host address.\n Repeat as many times as necessary.\n"));
- ACE_DEBUG ((LM_DEBUG, "-proc <service=address> - bind a service such as Naming to a specific endpoint address\n"));
+ ACE_DEBUG ((LM_DEBUG, "-o <filename> - write all output to specified file\n"));
+ ACE_DEBUG ((LM_DEBUG, "-d <directory> - create separate output files, one per log, and put them in specified directory.\n Either -o or -d may be set but not both. Default output to stdout.\n"));
+ ACE_DEBUG ((LM_DEBUG, "-m <manifest> - Take inputs from named manifest file\n"));
+ ACE_DEBUG ((LM_DEBUG, "-t <1.5 .. 2.0> - set source TAO version, default 2.0\n"));
+ ACE_DEBUG ((LM_DEBUG, "-a <name=address> - bind an alias to a host address.\n Repeat as many times as necessary.\n"));
+ ACE_DEBUG ((LM_DEBUG, "-p <service=address> - bind a service such as Naming to a specific endpoint address\n"));
}
int
@@ -132,8 +131,7 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv)
Session session;
for (int i = 1; i < argc; i++)
{
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-outfile")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-o")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-o")) == 0)
{
if (session.has_dir())
ACE_ERROR_RETURN ((LM_ERROR,
@@ -142,8 +140,7 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv)
session.outfile(ACE_TEXT_ALWAYS_CHAR(argv[++i]));
continue;
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-dir")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-d")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-d")) == 0)
{
if (session.has_outfile())
ACE_ERROR_RETURN ((LM_ERROR,
@@ -152,14 +149,12 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv)
session.make_dir (ACE_TEXT_ALWAYS_CHAR(argv[++i]));
continue;
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-manifest")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-m")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-m")) == 0)
{
parse_manifest (session, argv[++i]);
continue;
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-tao")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-t")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-t")) == 0)
{
if (Session::set_tao_version (argv[++i]))
continue;
@@ -167,23 +162,12 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT("TAO version must be 1.5, 1.6, 1.7, 1.8, or 2.0 \n")), 0);
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT ("-date")) == 0)
- {
- if (Session::set_date_format (argv[++i]))
- continue;
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT("Date format option must be 1 or 2\n")), 0);
- }
-
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-alias")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-a")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-a")) == 0)
{
session.alternate_address (ACE_TEXT_ALWAYS_CHAR (argv[++i]));
continue;
}
- if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-proc")) == 0 ||
- ACE_OS::strcasecmp (argv[i], ACE_TEXT("-p")) == 0)
+ if (ACE_OS::strcasecmp (argv[i], ACE_TEXT("-p")) == 0)
{
session.default_service (ACE_TEXT_ALWAYS_CHAR (argv[++i]));
continue;
diff --git a/TAO/utils/nsgroup/README.nsgroup b/TAO/utils/nsgroup/README.nsgroup
new file mode 100644
index 00000000000..c1d7f490fad
--- /dev/null
+++ b/TAO/utils/nsgroup/README.nsgroup
@@ -0,0 +1,155 @@
+$Id$
+
+This utility provides a command line interface for the tao_ft_naming service.
+tao_ft_naming service supports the NameService and NamingManager interfaces.
+
+Here is a summary of the commands and options:
+
+tao_nsgroup group_create -group <group> -policy <round | rand | least> -type_id <type_id>
+tao_nsgroup group_remove -group <group>
+tao_nsgroup group_bind -group <group> -name <name>
+tao_nsgroup group_unbind -name <name>
+tao_nsgroup group_modify -group <group> -policy <round | rand | least>
+tao_nsgroup group_list
+tao_nsgroup member_add -group <group> -location <location> -ior <ior>
+tao_nsgroup member_remove -group <group> -location <location>
+tao_nsgroup member_show -group <group> -location <location>
+tao_nsgroup member_list -group <group>
+tao_nsgroup -help
+
+tao_nsgroup group_create -group <group> -policy <round | rand | least> -type_id <type_id>
+
+ Adds the object group to to the load balancing naming manager service with the
+ specified selection policy and specified type id. On Creation, an object group
+ contains no member objects. Returns error if <group> is not unique.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup group_create -group ieee -policy round -type_id IDL:omg.org/FT/NamingManager:1.0 \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+tao_nsgroup group_remove -group <group>
+
+ Removes the specified object group from the load balancing naming manager
+ service. Call group_unbind If the group was bound with the group_bind op
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup group_remove -group ieee \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+ Note: If the object group is bound with group_bind, you must also unbind it
+ with group_unbind.
+
+tao_nsgroup group_bind -group <group> -name <name>
+
+ Binds the specified object group to the specified stringified name in the
+ naming service. When clients resolve that name, they tranparently obtain a
+ member of the specified object group from the load balancing naming manager
+ service.
+
+ Returns Success(0), Error(1)
+
+ Example:
+
+ $ACE_ROOT/bin/tao_nsgroup group_bind -group ieee -name iso/ieee \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+ Note: The iso context used in this example must be created before calling
+ group_bind.
+
+tao_nsgroup group_unbind -name <name>
+
+ Unbinds the specified stringified name from the naming service, but does not
+ remove the object group.
+
+ Returns Success(0), Error(1)
+
+ Example:
+
+ $ACE_ROOT/bin/tao_nsgroup group_unbind -name iso/ieee \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+tao_nsgroup group_modify -group <group> -policy <round | rand | least>
+
+ Changes the selection algorithm for the specified object group. An object
+ group's selection algorithm determines how the load balancing naming manager
+ service directs client requests to object group members.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup group_modify -group ieee -policy rand \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+tao_nsgroup group_list
+
+ Displays all object groups that currently exist in the load balancing naming manager service by
+ selection policy.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup group_list \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+ Round Robin Load Balancing Groups:
+ ieee
+
+ Random Load Balancing Groups:
+ ieed
+
+ Least Load Balancing Groups:
+ No Least Load Balancing Groups Registered
+
+
+tao_nsgroup member_add -group <group> -location <location> -ior <ior>
+
+ Adds an member object to the specified object group. After being added, the
+ member object is available for selection. Returns error if the ior is not
+ unique for the specified object group.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup member_add -group ieee -location 127.0.0.1 -ior file://mo.ior \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+tao_nsgroup member_remove -group <group> -location <location>
+
+ Removes the specified member object location from the specified object group.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup member_remove -group ieee -location 127.0.0.1 \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+
+tao_nsgroup member_list -group <group>
+
+ Lists the member locations of the specified object group.
+
+ Returns Success(0), Error(1)
+
+ Example:
+ $ACE_ROOT/bin/tao_nsgroup member_list -group ieee \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+ 127.0.0.1
+
+
+tao_nsgroup member_show -group <group> -location <location>
+
+ Displays the object reference that cooresponds to the specified member location
+ of an object group.
+
+ Returns Success(0), Error(1)
+
+ Example:
+
+ $ACE_ROOT/bin/tao_nsgroup member_show -group ieee -location 127.0.0.1 \
+ -ORBInitRef NameService=file://ns.ior -ORBInitRef NamingManager=file://nm.ior
+ IOR:010000002100000049444c3a6f6d672e6f72672f46542f4e616d696e674d616e616765723a312e300000000001000000000000006c000000010102000e00000031302e3230312e3230302e363400e1841b00000014010f005253541571a65076c60a000000000001000000010000000002000000000000000800000001000000004f41540100000018000000010000000100010001000000010001050901010000000000
+
+
diff --git a/TAO/utils/nsgroup/nsgroup.cpp b/TAO/utils/nsgroup/nsgroup.cpp
new file mode 100644
index 00000000000..45b85385d16
--- /dev/null
+++ b/TAO/utils/nsgroup/nsgroup.cpp
@@ -0,0 +1,98 @@
+//==========================================================================
+/**
+ * @file nsgroup.cpp
+ *
+ * $Id$
+ *
+ * @author Phillip LaBanca <labancap@ociweb.com>
+ */
+//==========================================================================
+
+
+#include "utils/nsgroup/nsgroup_svc.h"
+#include "ace/Get_Opt.h"
+
+//============================================================================
+bool
+show_help(int argc, ACE_TCHAR *argv[])
+{
+ static const ACE_TCHAR options[] = ACE_TEXT("h");
+ static const int skip_args = 1;
+ static const int report_errors = 0;
+ static const int ordering = ACE_Get_Opt::RETURN_IN_ORDER;
+ static const int long_only = 0;
+
+ // Not enough arguments indicates help is required
+ if( argc < 2 )
+ {
+ return true;
+ }
+
+ // Did they ask for help ?
+ ACE_Get_Opt get_opts (
+ argc,
+ argv,
+ options,
+ skip_args,
+ report_errors,
+ ordering,
+ long_only
+ );
+
+ if (get_opts.long_option (ACE_TEXT ("help"),'h') != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT (" Unable to add long option 'H'\n")), true);
+ }
+
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'h': // help
+
+ return true;
+ break;
+ }
+ }
+ return false;
+}
+
+//============================================================================
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ try
+ {
+
+ NS_group_svc ns_group (argc, argv);
+
+ if ( show_help (argc, argv) )
+ {
+ return ns_group.show_usage();
+ }
+
+ if ( ns_group.start_orb () == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to start orb\n")),
+ 1);
+ }
+
+ if ( ns_group.run_cmd () == -1 )
+ {
+ return 1;
+ }
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to run %C\n"),
+ argv[0]),
+ 1);
+
+ }
+
+ return 0;
+}
diff --git a/TAO/utils/nsgroup/nsgroup.mpc b/TAO/utils/nsgroup/nsgroup.mpc
new file mode 100644
index 00000000000..ef7b3fa5e0c
--- /dev/null
+++ b/TAO/utils/nsgroup/nsgroup.mpc
@@ -0,0 +1,12 @@
+// $Id$
+
+project(nsgroup): orbsvcsexe, portablegroup, ftnaming, naming, install, svc_utils {
+ install = $(ACE_ROOT)/bin
+ exename = tao_nsgroup
+ Source_Files {
+ nsgroup.cpp
+ nsgroup_svc.cpp
+ }
+}
+
+
diff --git a/TAO/utils/nsgroup/nsgroup_svc.cpp b/TAO/utils/nsgroup/nsgroup_svc.cpp
new file mode 100644
index 00000000000..e27c04711e8
--- /dev/null
+++ b/TAO/utils/nsgroup/nsgroup_svc.cpp
@@ -0,0 +1,973 @@
+//=============================================================================
+/**
+ * @file nsgroup_svc.cpp
+ *
+ * $Id$
+ *
+ * This file implements nsgroup command line utility operations
+ *
+ * @author Phillip LaBanca <labancap@ociweb.com>
+ */
+//=============================================================================
+
+#include "utils/nsgroup/nsgroup_svc.h"
+#include "ace/Get_Opt.h"
+#include "ace/Service_Config.h"
+#include "ace/OS_NS_strings.h"
+
+
+NS_group_svc::NS_group_svc (int argc, ACE_TCHAR **argv)
+ : argc_ (argc),
+ argv_ (argv),
+ nsgroup_cmd_(NS_group_svc::NSGROUP_NONE)
+{
+}
+
+NS_group_svc::NSGROUP_COMMAND
+NS_group_svc::parse_command_line (void)
+{
+ #if 0
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("parse_command_line::argc(%u)\n"), this->argc_));
+ for( int i = 0; i < this->argc_; ++i){
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("parse_command_line::argv(%u:%s)\n"), i, this->argv_[i]));
+ }
+ #endif
+
+ static const ACE_TCHAR options[] = ACE_TEXT("g:p:t:l:i:n:h");
+ static const int skip_args = 1;
+ static const int report_errors = 0;
+ static const int ordering = ACE_Get_Opt::PERMUTE_ARGS;
+ static const int long_only = 1;
+
+ ACE_Get_Opt get_opts (
+ this->argc_,
+ this->argv_,
+ options,
+ skip_args,
+ report_errors,
+ ordering,
+ long_only
+ );
+
+ this->group_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("group"),
+ 'g',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'g'\n")), NSGROUP_NONE);
+
+ this->policy_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("policy"),
+ 'p',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'p'\n")), NSGROUP_NONE);
+
+ this->typeid_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("type_id"),
+ 't',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 't'\n")), NSGROUP_NONE);
+
+ this->location_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("location"),
+ 'l',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'l'\n")), NSGROUP_NONE);
+
+ this->ior_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("ior"),
+ 'i',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'i'\n")), NSGROUP_NONE);
+
+ this->namepath_arg_ = 0;
+ if (get_opts.long_option (ACE_TEXT ("name"),
+ 'n',
+ ACE_Get_Opt::ARG_REQUIRED) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'n'\n")), NSGROUP_NONE);
+
+ if (get_opts.long_option (ACE_TEXT ("help"), 'h') != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to add long option 'h'\n")), NSGROUP_NONE);
+
+ int c;
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'g': // group
+ this->group_arg_ = get_opts.opt_arg ();
+ break;
+ case 'p': // policy
+ this->policy_arg_ = get_opts.opt_arg ();
+ break;
+ case 't': // type_id
+ this->typeid_arg_ = get_opts.opt_arg ();
+ break;
+ case 'l': // location
+ this->location_arg_ = get_opts.opt_arg ();
+ break;
+ case 'i': // ior
+ this->ior_arg_ = get_opts.opt_arg ();
+ break;
+ case 'n': // name
+ this->namepath_arg_ = get_opts.opt_arg ();
+ break;
+ case 'h':
+ return NSGROUP_HELP;
+ }
+
+ // handle non-option arguments
+ int non_option_arg_count = 0;
+ for( int i = get_opts.opt_ind (); i < this->argc_; ++i)
+ {
+
+ non_option_arg_count++;
+
+ //ACE_DEBUG ((LM_INFO, "Found non-option argument \"%s\"\n", this->argv_[i]));
+
+
+ if( ACE_OS::strncmp (this->argv_[i],"group_create",
+ ACE_OS::strlen ("group_create")) == 0 ) {
+
+ nsgroup_cmd_ = NSGROUP_GROUP_CREATE;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "group_bind",
+ ACE_OS::strlen ("group_bind")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_GROUP_BIND;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "group_unbind",
+ ACE_OS::strlen ("group_unbind")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_GROUP_UNBIND;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "group_modify",
+ ACE_OS::strlen ("group_modify")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_GROUP_MODIFY;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "group_list",
+ ACE_OS::strlen ("group_list")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_GROUP_LIST;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "group_remove",
+ ACE_OS::strlen ("group_remove")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_GROUP_REMOVE;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "member_list",
+ ACE_OS::strlen ("member_list")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_MEMBER_LIST;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "member_add",
+ ACE_OS::strlen ("member_add")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_MEMBER_ADD;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "member_remove",
+ ACE_OS::strlen ("member_remove")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_MEMBER_REMOVE;
+
+ } else if(ACE_OS::strncmp (this->argv_[i], "member_show",
+ ACE_OS::strlen ("member_show")) == 0 ){
+
+ nsgroup_cmd_ = NSGROUP_MEMBER_SHOW;
+
+ } else {
+
+ nsgroup_cmd_ = NSGROUP_NONE;
+
+ }
+ }
+
+ // The command should be the only non option argument
+ if ( non_option_arg_count > 1 ) {
+ nsgroup_cmd_ = NSGROUP_NONE;
+ }
+
+ return nsgroup_cmd_;
+}
+
+int
+NS_group_svc::run_cmd(void)
+{
+ int rc = -1;
+ switch( parse_command_line() )
+ {
+
+ case NSGROUP_HELP:
+ return show_usage();
+ break;
+
+ case NSGROUP_GROUP_CREATE:
+ return group_create ( group_arg(), typeid_arg(), policy_arg() );
+ break;
+
+ case NSGROUP_GROUP_BIND:
+ return group_bind ( group_arg(), namepath_arg() );
+ break;
+
+ case NSGROUP_GROUP_UNBIND:
+ return group_unbind ( namepath_arg() );
+ break;
+
+ case NSGROUP_GROUP_MODIFY:
+ return group_modify ( group_arg(), policy_arg() );
+ break;
+
+ case NSGROUP_GROUP_LIST:
+ return group_list ();
+ break;
+
+ case NSGROUP_GROUP_REMOVE:
+ return group_remove ( group_arg() );
+ break;
+
+ case NSGROUP_MEMBER_LIST:
+ return member_list ( group_arg() );
+ break;
+
+ case NSGROUP_MEMBER_ADD:
+ return member_add ( group_arg(), location_arg(), ior_arg() );
+ break;
+
+ case NSGROUP_MEMBER_REMOVE:
+ return member_remove ( group_arg(), location_arg() );
+ break;
+
+ case NSGROUP_MEMBER_SHOW:
+ return member_show ( group_arg(), location_arg() );
+ break;
+
+ default:
+ return rc;
+ break;
+ }
+
+ return rc;
+}
+
+int
+NS_group_svc::destroy (void)
+{
+ try
+ {
+ this->orb_->destroy ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "\nException caught while destroying NS_group_svc.\n"),
+ -1);
+ }
+
+ return 1;
+}
+
+FT::LoadBalancingStrategyValue
+NS_group_svc::determine_policy_string (const char *policy)
+{
+ if (ACE_OS::strcasecmp (policy, ACE_TEXT("rand")) == 0) {
+ return FT::RANDOM;
+ } else if (ACE_OS::strcasecmp (policy, ACE_TEXT("least")) == 0){
+ return FT::LEAST;
+ } else {
+ return FT::ROUND_ROBIN; // Default case
+ }
+}
+
+
+int
+NS_group_svc::start_orb (void)
+{
+ try
+ {
+
+#if 0
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("start_orb::argc(%u)\n"), this->argc_));
+ for( int i = 0; i < this->argc_; ++i){
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("start_orb::argv(%u:%s)\n"), i, this->argv_[i]));
+ }
+#endif //
+
+ // Initialise the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_, this->argv_);
+ if (CORBA::is_nil (this->orb_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the ORB.\n"),
+ -1);
+
+ //////////////////////////////////////////////////////////////////////////
+ //
+ //////////////////////////////////////////////////////////////////////////
+ CORBA::Object_var naming_manager_object =
+ this->orb_->resolve_initial_references ("NamingManager");
+
+ this->naming_manager_ =
+ FT::NamingManager::_narrow (naming_manager_object.in ());
+
+ if (CORBA::is_nil (this->naming_manager_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Naming Manager Reference\n"),
+ -1);
+ //////////////////////////////////////////////////////////////////////////
+ //
+ //////////////////////////////////////////////////////////////////////////
+ CORBA::Object_var naming_object =
+ this->orb_->resolve_initial_references("NameService");
+
+ this->name_service_ =
+ CosNaming::NamingContextExt::_narrow (naming_object.in ());
+
+ if (CORBA::is_nil (this->name_service_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "\nUnable to get Name Service Reference\n"),
+ -1);
+ //////////////////////////////////////////////////////////////////////////
+ //
+ //////////////////////////////////////////////////////////////////////////
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("\nException raised initialising ORB\n");
+ return -1;
+ }
+
+ return 1;
+
+}
+
+int
+NS_group_svc::show_usage( void )
+{
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("Usage:\n")
+ ACE_TEXT (" %s\n")
+ ACE_TEXT (" group_create -group <group> -policy <round | rand | least> -type_id <type_id> \n")
+ ACE_TEXT (" group_bind -group <group> -name <name>\n")
+ ACE_TEXT (" group_unbind -name <name>\n")
+ ACE_TEXT (" group_modify -group <group> -policy <round | rand | least> \n")
+ ACE_TEXT (" group_list\n")
+ ACE_TEXT (" group_remove -group <group>\n")
+ ACE_TEXT (" member_list -group <group>\n")
+ ACE_TEXT (" member_add -group <group> -location <location> -ior <IOR>\n")
+ ACE_TEXT (" member_remove -group <group> -location <location>\n")
+ ACE_TEXT (" member_show -group <group> -location <location>\n")
+ ACE_TEXT (" -help\n")
+ ACE_TEXT ("\n"),
+ this->argv_[0]));
+ return 0;
+}
+
+bool
+NS_group_svc::group_exist (
+ const char* group_name
+)
+{
+ if (group_name == 0 )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_exist args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * The naming service shall provide a command line utility for creating object groups.
+ * Adds the object group to to the load balancing service with the specified
+ * selection policy. On Creation, an object group contains no member objects.
+ */
+
+int
+NS_group_svc::group_create (
+ const char* group_name,
+ const char* type_id,
+ const char* policy )
+{
+
+ if (group_name == 0 || type_id == 0 || policy == 0 )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_create args not provided\n")),
+ -1);
+
+ }
+
+ try
+ {
+
+ /// Verify that the group does not already exist
+ /// Group names must be unique
+ if ( true == group_exist (group_name))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Group %C already exists\n"),
+ group_name),
+ -1);
+ }
+
+ 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;
+
+ CORBA::Object_var obj =
+ this->naming_manager_->create_object_group (group_name,
+ determine_policy_string(policy),
+ type_id,
+ criteria);
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "\nUnable to create group %C.\n", group_name),
+ -1);
+ }
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to create group %C\n"),
+ group_name),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility for binding an object
+ * group to a path in the naming service.
+ * Binds the specified object group to the specified path in the naming service.
+ * When clients resolve that path, they tranparently obtain a member of the
+ * specified object group.
+ */
+int
+NS_group_svc::group_bind (
+ const char* group_name,
+ const char* path)
+{
+
+ if (group_name == 0 || path == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_bind args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+
+ if (CORBA::is_nil (group_var.in()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to get reference.\n"),
+ -1);
+
+ CORBA::String_var str = CORBA::string_dup(path);
+ CosNaming::Name_var name = this->name_service_->to_name ( str.in() );
+
+ this->name_service_->rebind ( name.in(), group_var.in() );
+
+ }
+ catch (const CosNaming::NamingContextExt::InvalidName& ex){
+ ex._tao_print_exception ("InvalidName Exception in group_bind");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\n%C is invalid\n"),
+ path),
+ -1);
+ }
+ catch (const CosNaming::NamingContext::CannotProceed& ex){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nCannot proceed with %C\n"),
+ path),
+ -1);
+ }
+ catch (const CosNaming::NamingContext::NotFound& ex){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find %C\n"),
+ path),
+ -1);
+ }
+ catch (const CORBA::SystemException& ex){
+ ex._tao_print_exception ("SystemException Exception in group_bind");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to bind %C\n"),
+ path),
+ -1);
+ }
+ catch (const CORBA::Exception& ex){
+ ex._tao_print_exception ("Exception in group_bind");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to bind %C\n"),
+ path),
+ -1);
+ }
+ return 0;
+}
+
+int
+NS_group_svc::group_unbind (const char* path){
+ if ( path == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_unbind args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+
+ CORBA::String_var str = CORBA::string_dup(path);
+ CosNaming::Name_var name = this->name_service_->to_name ( str.in() );
+ this->name_service_->unbind ( name.in() );
+
+ }
+ catch (const CosNaming::NamingContext::NotFound& ex){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find %C\n"),
+ path),
+ -1);
+ }
+ catch (const CosNaming::NamingContext::CannotProceed& ex){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nCannot proceed with %C\n"),
+ path),
+ -1);
+ }
+ catch (const CosNaming::NamingContext::InvalidName& ex){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\n%C is invalid\n"),
+ path),
+ -1);
+ }
+ catch (const CORBA::SystemException& ex){
+ ex._tao_print_exception ("Exception in group_unbind");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to unbind %C\n"),
+ path),
+ -1);
+ }
+ catch (const CORBA::Exception& ex){
+ ex._tao_print_exception ("Exception in group_unbind");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to unbind %C\n"),
+ path),
+ -1);
+ }
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility to display all
+ * defined object groups within the naming service.
+ * Displays all object groups that currently exist in the naming service.
+ */
+int
+NS_group_svc::group_list (void)
+{
+
+ // KCS: The group list is independent of locations. I created a new operation in the
+ // naming manager IDL to support requesting the group list - which is a list of names
+
+ /// Display object group list for each load balancing strategy
+ int rc = 0;
+ if( display_load_policy_group (FT::ROUND_ROBIN, "Round Robin") < 0 ) {
+ rc = -1;
+ }
+ if( display_load_policy_group (FT::RANDOM, "Random") < 0 ) {
+ rc = -1;
+ }
+ if( display_load_policy_group (FT::LEAST, "Least") < 0 ) {
+ rc = -1;
+ }
+ return rc;
+}
+
+int
+NS_group_svc::display_load_policy_group(
+ FT::LoadBalancingStrategyValue strategy,
+ const char *display_label) {
+
+ if( display_label == 0 ) {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("display_load_policy_group args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+
+ FT::GroupNames_var list = this->naming_manager_->groups (strategy);
+
+ std::cout << "\n" << display_label << " Load Balancing Groups:" << std::endl;
+
+ if ( list->length () > 0 ) {
+
+ for (unsigned int i = 0; i < list->length (); ++i)
+ {
+ std::cout << " " << (*list)[i] << std::endl;
+ }
+
+ } else {
+
+ std::cout << "No " << display_label << " Load Balancing Groups Registered" << std::endl;
+
+ }
+
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception in group_list");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Unable to get %C group list\n"),
+ display_label),-1);
+ }
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility to modify the load
+ * balancing strategy for a specified object group.
+ * Changes the selection algorithm for the specified object group. An object
+ * group's selection algorithm determines how the naming service directs client
+ * requests to object group members.
+ */
+int
+NS_group_svc::group_modify (
+ const char* group_name,
+ const char* policy)
+{
+ if (group_name == 0 || policy == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_modify args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+ this->naming_manager_->set_load_balancing_strategy (
+ group_name,
+ determine_policy_string(policy) );
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to modify group %C\n"),
+ group_name),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility to remove a specified
+ * object group from the naming service.
+ * Removes the specified object group from the naming service.
+ */
+int
+NS_group_svc::group_remove (const char* group_name)
+{
+ if (group_name == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("group_remove args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+ this->naming_manager_->delete_object_group (group_name);
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to remove group %C\n"),
+ group_name),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility for adding object
+ * references to an object group.
+ * Adds an object to the specified object group. After being added, the object
+ * is available for selection.
+ */
+int
+NS_group_svc::member_add (
+ const char* group_name,
+ const char* location,
+ const char* ior)
+{
+ if (group_name == 0 || location == 0 || ior == 0 )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("member_add args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+ PortableGroup::Location location_name;
+ location_name.length (1);
+ location_name[0].id = CORBA::string_dup(location);
+
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+
+ CORBA::Object_var ior_var =
+ this->orb_->string_to_object( CORBA::string_dup(ior) );
+
+ this->naming_manager_->add_member (
+ group_var.in(),
+ location_name,
+ ior_var.in());
+
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const PortableGroup::ObjectNotAdded& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to add location %C to group %C\n"),
+ location, group_name),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to add location %C to group %C\n"),
+ location, group_name),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility for displaying all
+ * members (object references) for a specified object group.
+ * Lists the members of the specified object group.
+ */
+int
+NS_group_svc::member_list (const char* group_name)
+{
+ if (group_name == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("member_list args not provided\n")),
+ -1);
+ }
+
+ try
+ {
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+
+ PortableGroup::Locations_var locations =
+ this->naming_manager_->locations_of_members (group_var.in());
+
+ for (unsigned int i = 0; i < locations->length(); ++i)
+ {
+ const PortableGroup::Location & loc = locations[i];
+ if (loc.length() > 0) {
+ std::cout << loc[0].id.in() << std::endl;
+ }
+ }
+
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to list members for group %C\n"),
+ group_name),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility for removing object
+ * references from an object group.
+ * Removes the specified member object from the specified object group.
+ */
+int
+NS_group_svc::member_remove (
+ const char* group_name,
+ const char* location)
+{
+ if (group_name == 0 || location == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("member_remove args not provided\n")),
+ -1);
+ }
+
+ /**
+ * 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.
+ */
+
+ try
+ {
+ PortableGroup::Location location_name;
+ location_name.length (1);
+ location_name[0].id = CORBA::string_dup(location);
+
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+
+ this->naming_manager_->remove_member (
+ group_var.in(),
+ location_name);
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const PortableGroup::MemberNotFound& ex )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find member %C\n"),
+ location),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to remove member %C\n"),
+ location),
+ -1);
+ }
+
+ return 0;
+}
+
+/**
+ * The naming service shall provide a command line utility to display an object
+ * reference from a specified object group.
+ * Displays the object reference that cooresponds to the specified member of an
+ * object group.
+ */
+int
+NS_group_svc::member_show (
+ const char* group_name,
+ const char* location)
+{
+ if (group_name == 0 || location == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("member_show args not provided\n")),
+ -1);
+ }
+
+ //Get and display IOR for the member location
+ try
+ {
+ PortableGroup::Location location_name (1);
+ location_name.length (1);
+ location_name[0].id = CORBA::string_dup(location);
+
+ PortableGroup::ObjectGroup_var group_var =
+ this->naming_manager_->get_object_group_ref_from_name (group_name);
+
+ CORBA::Object_var ior_var =
+ this->naming_manager_->get_member_ref (group_var.in(), location_name);
+
+ CORBA::String_var ior_string =
+ this->orb_->object_to_string( ior_var.in() );
+
+ std::cout << ior_string.in() << std::endl;
+ }
+ catch (const PortableGroup::ObjectGroupNotFound& ex )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find group %C\n"),
+ group_name),
+ -1);
+ }
+ catch (const PortableGroup::MemberNotFound& ex )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to find member location %C\n"),
+ location),
+ -1);
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("\nUnable to show member location %C\n"),
+ location),
+ -1);
+ }
+
+ return 0;
+}
diff --git a/TAO/utils/nsgroup/nsgroup_svc.h b/TAO/utils/nsgroup/nsgroup_svc.h
new file mode 100644
index 00000000000..e2658b65dcc
--- /dev/null
+++ b/TAO/utils/nsgroup/nsgroup_svc.h
@@ -0,0 +1,140 @@
+//==========================================================================
+/**
+ * @file nsgroup_svc.h
+ *
+ * $Id$
+ *
+ * @author Phillip LaBanca <labancap@ociweb.com>
+ */
+//==========================================================================
+
+#ifndef i_nsgroup_svc_h
+#define i_nsgroup_svc_h
+
+#include "orbsvcs/FT_NamingManagerC.h"
+
+/**
+ * @class NS_group_svc
+ *
+ * @brief Encapsulate the NS group operations in a class.
+ *
+ *
+ */
+class NS_group_svc
+{
+public:
+
+ enum NSGROUP_COMMAND {
+ NSGROUP_NONE,
+ NSGROUP_HELP,
+ NSGROUP_GROUP_CREATE,
+ NSGROUP_GROUP_BIND,
+ NSGROUP_GROUP_UNBIND,
+ NSGROUP_GROUP_MODIFY,
+ NSGROUP_GROUP_LIST,
+ NSGROUP_GROUP_REMOVE,
+ NSGROUP_MEMBER_LIST,
+ NSGROUP_MEMBER_ADD,
+ NSGROUP_MEMBER_REMOVE,
+ NSGROUP_MEMBER_SHOW
+ };
+
+ /// Constructor
+ NS_group_svc (int argc, ACE_TCHAR **argv);
+
+ /// destroys LoadManager, ORB and POA.
+ int destroy (void);
+
+ /// start the ORB.
+ int start_orb (void);
+
+ /// parse command line, validate arguments and run the command
+ int run_cmd (void);
+
+ /// Display command line interface usage
+ int show_usage( void );
+
+ /// The naming service shall provide a command line utility for creating
+ /// object groups.
+ int group_create (const char* group, const char* type_id, const char* policy);
+
+ /// The naming service shall provide a command line utility for binding an
+ /// object group to a path in the naming service.
+ int group_bind (const char* group, const char* path);
+ int group_unbind (const char* path);
+
+ /// The naming service shall provide a command line utility to display all
+ /// defined object groups within the naming service.
+ int group_list (void);
+
+ /// The naming service shall provide a command line utility to modify the load
+ /// balancing strategy for a specified object group.
+ int group_modify (const char* group, const char* policy);
+
+ /// The naming service shall provide a command line utility to remove a
+ /// specified object group from the naming service.
+ int group_remove (const char* group);
+
+ /// The naming service shall provide a command line utility for adding object
+ /// references to an object group.
+ int member_add (const char* group,
+ const char* location,
+ const char* ior);
+
+ /// The naming service shall provide a command line utility for displaying all
+ /// members (object references) for a specified object group.
+ int member_list (const char* group);
+
+ /// The naming service shall provide a command line utility for removing
+ /// object references from an object group.
+ int member_remove (const char* group, const char* location);
+
+ /// The naming service shall provide a command line utility to display an
+ /// object reference from a specified object group.
+ int member_show (const char* group, const char* location);
+
+ /// returns true if the specified object group name is found
+ bool group_exist (const char* group_name);
+
+ const char * group_arg(void) const { return group_arg_; }
+ const char * policy_arg(void) const { return policy_arg_; }
+ const char * typeid_arg(void) const { return typeid_arg_; }
+ const char * location_arg(void) const { return location_arg_; }
+ const char * ior_arg(void) const { return ior_arg_; }
+ const char * namepath_arg(void) const { return namepath_arg_; }
+
+private:
+
+ /// parse command line arguments
+ NSGROUP_COMMAND parse_command_line (void);
+
+ /// determine stategy based on policy string value default to ROUND_ROBIN
+ FT::LoadBalancingStrategyValue determine_policy_string (const char *policy);
+
+ int display_load_policy_group( FT::LoadBalancingStrategyValue strategy, const char *display_label);
+
+private:
+
+ FT::NamingManager_var naming_manager_;
+
+ /// Name Service
+ CosNaming::NamingContextExt_var name_service_;
+
+ CORBA::ORB_var orb_;
+
+ int argc_;
+ ACE_TCHAR **argv_;
+
+ /// parsed command result
+ NSGROUP_COMMAND nsgroup_cmd_;
+
+ /// parsed command line arguments
+ const char *group_arg_;
+ const char *policy_arg_;
+ const char *typeid_arg_;
+ const char *location_arg_;
+ const char *ior_arg_;
+ const char *namepath_arg_;
+};
+
+#endif
diff --git a/TAO/utils/nsgroup/run_test.pl b/TAO/utils/nsgroup/run_test.pl
new file mode 100755
index 00000000000..c4d1a04f116
--- /dev/null
+++ b/TAO/utils/nsgroup/run_test.pl
@@ -0,0 +1,363 @@
+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::TestTarget;
+
+$status = 0;
+$debug_level = 0;
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+#$ENV{ACE_TEST_VERBOSE} = "1";
+
+my $name_manager = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $nslist = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $nsadd = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $nsdel = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+
+## 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.
+$NM_conf = $name_manager->LocalFile ("windows" . $PerlACE::svcconf_ext);
+
+my $name_mgr_iorbase = "nm.ior";
+my $name_srv_iorbase = "ns.ior";
+my $stdout_file = "test.out";
+my $stderr_file = "test.err";
+
+my $name_manager_iorfile = $name_manager->LocalFile ($name_mgr_iorbase);
+my $name_server_iorfile = $name_manager->LocalFile ($name_srv_iorbase);
+
+my $naming_mgr_client_iorfile = $client->LocalFile ($name_mgr_iorbase);
+my $name_srv_client_iorfile = $client->LocalFile ($name_srv_iorbase);
+my $client_stdout_file = $client->LocalFile ($stdout_file);
+my $client_stderr_file = $client->LocalFile ($stderr_file);
+
+$name_manager->DeleteFile($name_mgr_iorbase);
+$name_manager->DeleteFile($name_srv_iorbase);
+$client->DeleteFile($name_mgr_iorbase);
+$client->DeleteFile($name_srv_iorbase);
+$client->DeleteFile($stdout_file);
+$client->DeleteFile($stderr_file);
+
+$NM = $name_manager->CreateProcess ("../../orbsvcs/Naming_Service/tao_ft_naming",
+ "-f persist.dat -g $name_manager_iorfile -o $name_server_iorfile " .
+ "-ORBDebugLevel $debug_level " .
+ "-ORBDottedDecimalAddresses 1" .
+ ($^O eq 'MSWin32' ? " -ORBSvcConf $NM_conf" : ''));
+
+$NM_REF = "-ORBInitRef NameService=file://$name_srv_client_iorfile";
+$RM_REF = "-ORBInitRef NamingManager=file://$naming_mgr_client_iorfile";
+$NS_REF = "--ns file://$name_srv_client_iorfile";
+$DEBUG_LEVEL = "-ORBDebugLevel $debug_level";
+$LOAD_ARG = "$NM_REF $RM_REF $DEBUG_LEVEL";
+
+$CL = $client->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_nsgroup");
+$NSLIST = $nslist->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_nslist");
+$NSADD = $nsadd->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_nsadd");
+$NSDEL = $nsdel->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_nsdel");
+
+$POSITIVE_TEST_RESULT = 0;
+$NEGATIVE_TEST_RESULT = 1;
+
+sub cat_file($)
+{
+ my $file_name = shift;
+ if (-s $file_name ) # size of file is greater than zero
+ {
+ open TESTFILE, $file_name or die "Couldn't open file: $!";
+ my @teststring = <TESTFILE>; # read in all of the file
+ print STDERR "\n@teststring\n";
+ close TESTFILE;
+ }
+}
+
+sub redirect_output()
+{
+ open(OLDOUT, ">&", \*STDOUT) or die "Can't dup STDOUT: $!";
+ open(OLDERR, ">&", \*STDERR) or die "Can't dup STDERR: $!";
+ open STDERR, '>', $client_stderr_file;
+ open STDOUT, '>', $client_stdout_file;
+}
+
+sub restore_output()
+{
+ open(STDERR, ">&OLDERR") or die "Can't dup OLDERR: $!";
+ open(STDOUT, ">&OLDOUT") or die "Can't dup OLDOUT: $!";
+}
+
+sub run_client ($$)
+{
+ my $args = shift;
+ my $expected_test_result = shift;
+
+ my $arglist = "$LOAD_ARG $args";
+
+ if ($expected_test_result != $POSITIVE_TEST_RESULT ) {
+ print STDERR "\n\n======== Running Negative Test ================\n";
+ } else {
+ print STDERR "\n\n======== Running Positive Test ================\n";
+ }
+ print STDERR "$args\n";
+
+ $CL->Arguments ($arglist);
+
+ if ($debug_level == 0) {
+ redirect_output();
+ }
+
+ my $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
+
+ if ($debug_level == 0) {
+ restore_output();
+ }
+
+
+ if ($client_status != $expected_test_result) {
+ my $time = localtime;
+ print STDERR "ERROR: client returned $client_status at $time\n";
+ if ($debug_level == 0) {
+ cat_file($client_stderr_file);
+ cat_file($client_stdout_file);
+ }
+ $status = 1;
+ }
+}
+
+sub run_nsadd($)
+{
+ print STDERR "\n\n======== Running tao_nsadd ================\n";
+ my $args = shift;
+ $NSADD->Arguments ($args);
+
+ if ($debug_level == 0) {
+ redirect_output();
+ }
+
+ #tao_nsadd --ns file://ns.ior --name iso --ctx
+ my $nsadd_status = $NSADD->SpawnWaitKill ($nsadd->ProcessStartWaitInterval());
+
+ if ($debug_level == 0) {
+ restore_output();
+ }
+
+ if ($nsadd_status != $0) {
+ my $time = localtime;
+ print STDERR "ERROR: nsadd returned $nsadd_status at $time\n";
+ if ($debug_level == 0) {
+ cat_file($client_stderr_file);
+ }
+ $status = 1;
+ }
+}
+
+sub run_nsdel($)
+{
+ print STDERR "\n\n======== Running tao_nsdel ================\n";
+ my $args = shift;
+ $NSDEL->Arguments ($args);
+
+ if ($debug_level == 0) {
+ redirect_output();
+ }
+
+ #tao_nsdel --ns file://ns.ior --name iso --destroy
+ my $nsdel_status = $NSDEL->SpawnWaitKill ($nsdel->ProcessStartWaitInterval());
+
+ if ($debug_level == 0) {
+ restore_output();
+ }
+
+ if ($nsdel_status != $0) {
+ my $time = localtime;
+ print STDERR "ERROR: nsdel returned $nsdel_status at $time\n";
+ if ($debug_level == 0) {
+ cat_file($client_stderr_file);
+ }
+ $status = 1;
+ }
+}
+
+sub run_nslist($)
+{
+ print STDERR "\n\n======== Running tao_nslist ================\n";
+ my $args = shift;
+ $NSLIST->Arguments ($args);
+
+ if ($debug_level == 0) {
+ redirect_output();
+ }
+
+ #tao_nslist --ns file://ns.ior
+ my $nslist_status = $NSLIST->SpawnWaitKill ($nslist->ProcessStartWaitInterval());
+
+ if ($debug_level == 0) {
+ restore_output();
+ }
+
+ if ($nslist_status != $0) {
+ my $time = localtime;
+ print STDERR "ERROR: nslist returned $nslist_status at $time\n";
+ if ($debug_level == 0) {
+ cat_file($client_stderr_file);
+ }
+ $status = 1;
+ }
+}
+
+sub run_clients ()
+{
+ run_client (
+ "group_list",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "group_create -group ieee -policy round -type_id IDL:FT/NamingManager:1.0",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "group_create -group ieed -policy rand -type_id IDL:/FT/NamingManager:1.0",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "group_create -group ieee -policy round -type_id IDL:/FT/NamingManager:1.0",
+ $NEGATIVE_TEST_RESULT);
+
+ run_client (
+ "group_list",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "member_list -group ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "member_add -group ieee -location 127.0.0.1 -ior file://$naming_mgr_client_iorfile",
+ $POSITIVE_TEST_RESULT);
+
+ run_nsadd("$NS_REF"." --name iso --ctx");
+
+ run_nslist("$NS_REF");
+
+ run_client (
+ "group_unbind -name iso/ieee",
+ $NEGATIVE_TEST_RESULT);
+
+ run_nslist("$NS_REF");
+
+ run_client (
+ "group_bind -group ieee -name iso/ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_nslist("$NS_REF");
+
+ run_client (
+ "group_modify -group ieee -policy rand",
+ $POSITIVE_TEST_RESULT);
+
+ run_nslist("$NS_REF");
+
+ run_client (
+ "member_add -group ieee -location 127.0.0.1 -ior file://$naming_mgr_client_iorfile",
+ $NEGATIVE_TEST_RESULT);
+
+ run_client (
+ "member_list -group ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "member_show -group ieee -location 127.0.0.1",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "member_remove -group ieee -location 127.0.0.1",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "member_list -group ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "group_remove -group ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_client (
+ "group_unbind -name iso/ieee",
+ $POSITIVE_TEST_RESULT);
+
+ run_nslist("$NS_REF");
+
+ run_client (
+ "group_list",
+ $POSITIVE_TEST_RESULT);
+
+ run_nsdel("$NS_REF"." --name iso --destroy");
+
+ run_client (
+ "-help",
+ $POSITIVE_TEST_RESULT);
+}
+
+print STDERR "\n\n======== Running tao_nsgroup Test================\n";
+print STDERR "\n";
+
+print STDERR "This test will check the methods of the tao_nsgroup\n";
+print STDERR "\n";
+
+################################################################################
+## Start tao_ft_naming Service
+################################################################################
+$name_manager_status = $NM->Spawn ();
+
+if ($name_manager_status != 0) {
+ print STDERR "ERROR: server returned $name_manager_status\n";
+ exit 1;
+}
+if ($name_manager->WaitForFileTimed ($name_mgr_iorbase,
+ $name_manager->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$name_manager_iorfile>\n";
+ $NM->Kill (); $NM->TimedWait (1);
+ exit 1;
+}
+
+if ($name_manager->GetFile ($name_mgr_iorbase) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$name_manager_iorfile>\n";
+ $NM->Kill (); $NM->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($name_mgr_iorbase) == -1) {
+ print STDERR "ERROR: cannot set file <$naming_mgr_client_iorfile>\n";
+ $NM->Kill (); $NM->TimedWait (1);
+ exit 1;
+}
+
+run_clients();
+
+
+print STDERR "\n\n====================================================\n";
+print STDERR "\n";
+$name_manager_status = $NM->TerminateWaitKill ($name_manager->ProcessStopWaitInterval());
+
+if ($name_manager_status != 0) {
+ print STDERR "ERROR: server returned $name_manager_status\n";
+ $status = 1;
+}
+
+$name_manager->DeleteFile($name_mgr_iorbase);
+$name_manager->DeleteFile($name_srv_iorbase);
+$client->DeleteFile($name_mgr_iorbase);
+$client->DeleteFile($name_srv_iorbase);
+$client->DeleteFile($stdout_file);
+$client->DeleteFile($stderr_file);
+
+exit $status;
diff --git a/TAO/utils/nsgroup/windows.conf b/TAO/utils/nsgroup/windows.conf
new file mode 100644
index 00000000000..e02d5089fce
--- /dev/null
+++ b/TAO/utils/nsgroup/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/utils/nsgroup/windows.conf.xml b/TAO/utils/nsgroup/windows.conf.xml
new file mode 100644
index 00000000000..37af1733d3b
--- /dev/null
+++ b/TAO/utils/nsgroup/windows.conf.xml
@@ -0,0 +1,10 @@
+<?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/utils/nslist/nslist.mpc b/TAO/utils/nslist/nslist.mpc
index 10384bef498..841f314646b 100644
--- a/TAO/utils/nslist/nslist.mpc
+++ b/TAO/utils/nslist/nslist.mpc
@@ -23,9 +23,5 @@ project(nslist): namingexe, install, svc_utils, messaging, strategies {
Source_Files {
nslist.cpp
}
- InstallData_Files {
- gendir = .
- README.nslist
- }
}
diff --git a/TAO/utils/utils.mwc b/TAO/utils/utils.mwc
index eb8edb1783e..e6c25693aa5 100644
--- a/TAO/utils/utils.mwc
+++ b/TAO/utils/utils.mwc
@@ -10,4 +10,6 @@ workspace {
// must have mfc=1 in $ACE_ROOT/bin/MakeProjectCreator/config/default.features to generate Makefile for wxNamingViewer
NamingViewer
+
+ nsgroup
}