From feb8e89d1f3932917e3068c9c23db15ce55286e4 Mon Sep 17 00:00:00 2001 From: "William R. Otte" Date: Thu, 13 Apr 2006 14:47:50 +0000 Subject: Thu Apr 13 13:43:19 UTC 2006 William R. Otte --- TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Factory.hpp | 2 +- TAO/CIAO/CCF/CCF/CIDL/SemanticGraph/Elements.cpp | 2 +- .../CCF/CodeGenerationKit/IndentationImplanter.hpp | 2 +- TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp | 1 + TAO/CIAO/CCF/CCF/IDL2/SemanticAction/TypeId.hpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Enum.hpp | 4 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Exception.cpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Member.cpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Native.cpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Struct.cpp | 16 +- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Union.cpp | 16 +- TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.cpp | 2 +- TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.hpp | 4 +- TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Elements.cpp | 2 +- TAO/CIAO/CCF/Documentation/DesignNotes | 192 +- TAO/CIAO/CCF/Documentation/TODO | 14 +- .../Example/CIDL/LocalExecutorMapping/test-0.idl | 8 +- .../Example/CIDL/LocalExecutorMapping/test-1.idl | 6 +- .../Example/CIDL/LocalExecutorMapping/test-2.idl | 32 +- .../Indentation/XML/indent_xml.cpp | 2 +- TAO/CIAO/CCF/Test/IDL2/Compiler/test.idl | 20 +- .../CCF/Test/IDL2/LexicalAnalyzer/Coverage.idl | 2 +- TAO/CIAO/CCF/Test/IDL3/Compiler/GeneratorImpl.hpp | 4 +- TAO/CIAO/CCF/Test/IDL3/Compiler/test.idl | 14 +- TAO/CIAO/CIAO-INSTALL.html | 122 +- TAO/CIAO/CIDLC/DescriptorGenerator.cpp | 20 +- TAO/CIAO/CIDLC/ExecImplHeaderGenerator.hpp | 2 +- TAO/CIAO/CIDLC/ExecImplSourceGenerator.hpp | 2 +- TAO/CIAO/CIDLC/RepositoryIdGenerator.cpp | 28 +- TAO/CIAO/CIDLC/ServantHeaderGenerator.hpp | 2 +- TAO/CIAO/CIDLC/ServantSourceGenerator.cpp | 415 +- TAO/CIAO/CIDLC/SizeTypeCalculator.cpp | 18 +- TAO/CIAO/CIDLC/TypeNameEmitter.cpp | 52 +- TAO/CIAO/CIDLC/TypeNameEmitter.hpp | 14 +- TAO/CIAO/CIDLC/Version | 2 +- TAO/CIAO/COPYING | 22 +- TAO/CIAO/ChangeLog | 14 +- TAO/CIAO/DAnCE/Deployment.xsd | 122 +- .../Deployment_Configuration.cpp | 27 +- .../DomainApplicationManager.mpc | 2 +- .../DomainApplicationManager_Impl.cpp | 191 +- .../DomainApplicationManager_Impl.h | 31 +- TAO/CIAO/DAnCE/ExecutionManager/DAM_Map.h | 2 +- .../DAnCE/ExecutionManager/Execution_Manager.cpp | 66 +- .../ExecutionManager/Execution_Manager_Impl.cpp | 109 +- .../ExecutionManager/Execution_Manager_Impl.h | 20 +- TAO/CIAO/DAnCE/Interfaces/Interfaces.mpc | 6 +- TAO/CIAO/DAnCE/Interfaces/NodeManager.idl | 10 +- TAO/CIAO/DAnCE/Interfaces/README | 4 +- .../DAnCE/NodeApplication/Configurator_Factory.cpp | 7 + TAO/CIAO/DAnCE/NodeApplication/Container_Impl.cpp | 144 +- TAO/CIAO/DAnCE/NodeApplication/Container_Impl.h | 2 +- TAO/CIAO/DAnCE/NodeApplication/Container_Impl.inl | 4 + TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h | 2 +- TAO/CIAO/DAnCE/NodeApplication/NodeApplication.cpp | 26 +- TAO/CIAO/DAnCE/NodeApplication/NodeApplication.mpc | 4 +- .../DAnCE/NodeApplication/NodeApplication_Core.cpp | 22 +- .../DAnCE/NodeApplication/NodeApplication_Core.h | 2 +- .../DAnCE/NodeApplication/NodeApplication_Core.inl | 2 +- .../DAnCE/NodeApplication/NodeApplication_Impl.cpp | 165 +- .../DAnCE/NodeApplication/NodeApplication_Impl.h | 10 + .../DAnCE/NodeApplication/RTConfig_Manager.cpp | 2 +- .../NodeApplication/RTNodeApp_Configurator.cpp | 4 +- .../DAnCE/NodeApplication/RTNodeApp_Configurator.h | 4 +- .../NodeApplicationManager/Containers_Info_Map.cpp | 257 +- .../NodeApplicationManager/Containers_Info_Map.h | 56 +- .../DAnCE/NodeApplicationManager/HTTP_Client.cpp | 59 + .../DAnCE/NodeApplicationManager/HTTP_Client.h | 72 + .../DAnCE/NodeApplicationManager/HTTP_Handler.cpp | 203 + .../DAnCE/NodeApplicationManager/HTTP_Handler.h | 86 + .../NodeApplicationManager/ImplementationInfo.cpp | 28 +- .../NodeApplicationManager.mpc | 6 + .../NodeApplicationManager_Impl.cpp | 461 +- .../NodeApplicationManager_Impl.h | 65 +- .../DAnCE/NodeApplicationManager/URL_Parser.cpp | 103 + TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h | 68 + TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp | 102 +- TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.h | 13 + TAO/CIAO/DAnCE/NodeManager/Monitor.mpc | 6 +- TAO/CIAO/DAnCE/NodeManager/MonitorCB.cpp | 14 +- TAO/CIAO/DAnCE/NodeManager/MonitorController.cpp | 110 +- TAO/CIAO/DAnCE/NodeManager/MonitorController.h | 41 +- TAO/CIAO/DAnCE/NodeManager/NodeManager.mpc | 4 +- TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp | 216 +- TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h | 27 + TAO/CIAO/DAnCE/NodeManager/Node_Manager.cpp | 79 +- TAO/CIAO/DAnCE/NodeManager/README | 4 +- TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp | 30 +- .../DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp | 165 +- TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h | 30 +- .../RTNodeApplication/NodeApplication_Task.cpp | 20 +- .../RTNodeApplication/NodeApplication_Task.inl | 2 +- TAO/CIAO/DAnCE/RTNodeApplication/README | 10 +- TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp | 16 +- TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp | 12 +- TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h | 4 +- TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp | 1 - TAO/CIAO/DAnCE/RepositoryManager/README.txt | 18 +- TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp | 10 +- TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h | 1 + TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp | 8 +- .../DAnCE/RepositoryManager/RepositoryManager.cpp | 25 +- .../DAnCE/RepositoryManager/RepositoryManager.mpc | 3 + .../RepositoryManager/RepositoryManager_Impl.cpp | 30 +- .../RepositoryManager/RepositoryManager_Impl.h | 53 +- TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp | 16 +- TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h | 9 +- TAO/CIAO/DAnCE/StaticConfigurator/README | 12 +- .../StaticConfigurator/StaticDAnCEApp.cpp.tmpl | 12 +- .../StaticConfigurator/StaticDAnCEApp.mpc.tmpl | 4 +- .../DAnCE/StaticConfigurator/StaticDAnCEParser.cpp | 12 +- .../DAnCE/StaticConfigurator/StaticDAnCEParser.mpc | 4 +- TAO/CIAO/DAnCE/TargetManager/CmpClient.cpp | 83 + TAO/CIAO/DAnCE/TargetManager/DomainDataManager.cpp | 467 +- TAO/CIAO/DAnCE/TargetManager/DomainDataManager.h | 157 +- TAO/CIAO/DAnCE/TargetManager/TM_Client.mpc | 8 +- TAO/CIAO/DAnCE/TargetManager/TargetManager.mpc | 21 +- TAO/CIAO/DAnCE/TargetManager/TargetManagerExt.idl | 25 +- .../DAnCE/TargetManager/TargetManager_exec.cpp | 53 +- TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.h | 11 +- .../DAnCE/TargetManager/descriptors/Domain.cdd | 4 + .../descriptors/flattened_deploymentplan.cdp | 10 +- .../NodeApplicationTest/NodeAppTest_RoundTrip.cidl | 2 +- .../NodeApp_test_client_dynamic.cpp | 2 +- .../NodeApplicationTest/NodeApp_test_client_ex.cpp | 72 +- .../tests/NodeApplicationTest/RoundTrip_exec.h | 70 +- .../DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl | 4 +- TAO/CIAO/NEWS | 16 +- TAO/CIAO/PROBLEM-REPORT-FORM | 2 +- .../RACE/Input_Adapters/Base/Input_Adapter.mpc | 2 +- .../Interactive_Input_Adapter.idl | 2 +- .../Interactive_Input_Adapter.mpc | 4 +- .../Output_Adapters/Component/Output_Manager.idl | 2 +- .../RACE/Output_Adapters/Interface/PlanEgress.idl | 2 +- .../XML_Output_Adapter/XML_Output_Adapter.idl | 2 +- .../XML_Output_Adapter/XML_Output_Adapter.mpc | 8 +- .../RACE/Plan_Analyzer/Component/Plan_Analyzer.idl | 2 +- .../RACE/Plan_Analyzer/Component/Plan_Analyzer.mpc | 2 +- .../Planner_Manager/Component/Planner_Manager.cidl | 2 +- .../Planner_Manager/Component/Planner_Manager.mpc | 4 +- TAO/CIAO/RACE/Planners/Base/Planner.idl | 4 +- TAO/CIAO/RACE/Planners/Interface/Planner_I.idl | 2 +- .../Planners/SimpleBinPacker/SimpleBinPacker.idl | 2 +- .../Planners/SimpleBinPacker/SimpleBinPacker.mpc | 6 +- TAO/CIAO/RACE/common/RACE_common.idl | 2 +- TAO/CIAO/RACE/descriptors/Deployment.xsd | 122 +- TAO/CIAO/RACE/descriptors/Modified_Deployment.xsd | 92 +- .../RACE/descriptors/flattened_deploymentplan.cdp | 16 +- TAO/CIAO/README | 2 +- TAO/CIAO/bin/valgrind_nodedaemon.py | 14 +- TAO/CIAO/ciao/CCM_Core.mpc | 2 +- TAO/CIAO/ciao/CCM_Event.idl | 2 +- TAO/CIAO/ciao/CIAO_common.h | 23 + TAO/CIAO/ciao/Container_Base.cpp | 142 +- TAO/CIAO/ciao/Container_Base.h | 2 +- TAO/CIAO/ciao/Context_Impl_Base.cpp | 12 + TAO/CIAO/ciao/Context_Impl_Base.h | 7 + TAO/CIAO/ciao/Context_Impl_T.cpp | 32 +- TAO/CIAO/ciao/Context_Impl_T.h | 12 +- TAO/CIAO/ciao/Deployment.idl | 20 + TAO/CIAO/ciao/Deployment_Base.idl | 1 + TAO/CIAO/ciao/Deployment_Core.idl | 10 + TAO/CIAO/ciao/Deployment_Data.idl | 40 +- TAO/CIAO/ciao/Deployment_common.h | 4 +- TAO/CIAO/ciao/Home_Servant_Impl_T.cpp | 18 +- TAO/CIAO/ciao/Object_Set_T.h | 2 +- TAO/CIAO/ciao/Packaging_Data.idl | 59 +- TAO/CIAO/ciao/Servant_Activator.cpp | 6 +- TAO/CIAO/ciao/Servant_Impl_Base.cpp | 98 +- TAO/CIAO/ciao/Servant_Impl_Base.h | 12 + TAO/CIAO/ciao/Servant_Impl_T.cpp | 4 + TAO/CIAO/ciao/Server_init.cpp | 271 +- TAO/CIAO/ciao/Server_init.h | 38 + TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp | 2 +- TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp | 34 +- TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h | 8 +- TAO/CIAO/docs/Purify.html | 82 +- TAO/CIAO/docs/XML/ciao_rt_cad_ext.dtd | 2 +- TAO/CIAO/docs/imgs/CCM-v5.vsd | Bin 486912 -> 486891 bytes TAO/CIAO/docs/imgs/CCM.vsd | Bin 643072 -> 643056 bytes TAO/CIAO/docs/imgs/DAnCE-Dynamic.png | Bin 71061 -> 71061 bytes TAO/CIAO/docs/imgs/DAnCE-Dynamic.sxd | Bin 46579 -> 46580 bytes TAO/CIAO/docs/imgs/File-Gen-Existing.png | Bin 40181 -> 40179 bytes TAO/CIAO/docs/imgs/File-Gen-Future.png | Bin 41057 -> 41056 bytes TAO/CIAO/docs/imgs/File_Generation_Flow.vsd | Bin 107008 -> 107007 bytes TAO/CIAO/docs/imgs/IDL-CIDL-classes.vsd | Bin 201216 -> 201212 bytes TAO/CIAO/docs/imgs/basic-container.png | Bin 8000 -> 8001 bytes TAO/CIAO/docs/imgs/ciao-dynamic1.jpg | Bin 56203 -> 56199 bytes TAO/CIAO/docs/imgs/ciao-dynamic2.jpg | Bin 46081 -> 46079 bytes TAO/CIAO/docs/imgs/ciao-static-vs-dynamic.jpg | Bin 44220 -> 44217 bytes TAO/CIAO/docs/imgs/ciao-static1.jpg | Bin 53013 -> 53009 bytes TAO/CIAO/docs/imgs/ciao-static2.jpg | Bin 64775 -> 64773 bytes TAO/CIAO/docs/imgs/component-basic.png | Bin 151172 -> 151170 bytes TAO/CIAO/docs/imgs/dance_arch.jpg | Bin 70526 -> 70523 bytes TAO/CIAO/docs/imgs/dance_arch.vsd | Bin 100352 -> 100349 bytes TAO/CIAO/docs/imgs/deployment.png | Bin 10392 -> 10392 bytes TAO/CIAO/docs/imgs/extended-container.png | Bin 19243 -> 19244 bytes TAO/CIAO/docs/imgs/home-config.png | Bin 9873 -> 9874 bytes TAO/CIAO/docs/imgs/static_dance_arch.jpg | Bin 58112 -> 58109 bytes TAO/CIAO/docs/imgs/static_dance_arch.vsd | Bin 86528 -> 86529 bytes TAO/CIAO/docs/imgs/static_dance_impl.jpg | Bin 56080 -> 56074 bytes TAO/CIAO/docs/imgs/static_dance_impl.vsd | Bin 101888 -> 101889 bytes TAO/CIAO/docs/index.html | 4 +- TAO/CIAO/docs/releasenotes/index.html | 30 +- TAO/CIAO/docs/releasenotes/switch.html | 2 +- TAO/CIAO/docs/schema/Basic_Deployment_Data.xsd | 112 +- TAO/CIAO/docs/schema/CIAOServerResources.xsd | 12 +- TAO/CIAO/docs/schema/README.html | 8 +- TAO/CIAO/docs/schema/ServerResourceUsage.txt | 8 +- TAO/CIAO/docs/schema/ccd.xsd | 7 +- TAO/CIAO/docs/schema/cdd.xsd | 22 +- TAO/CIAO/docs/schema/cdp.xsd | 4 +- TAO/CIAO/docs/schema/ciaopolicy.xsd | 80 +- TAO/CIAO/docs/schema/cid.xsd | 57 +- TAO/CIAO/docs/schema/cpd.xsd | 21 +- TAO/CIAO/docs/schema/iad.xsd | 23 +- TAO/CIAO/docs/schema/pcd.xsd | 31 +- TAO/CIAO/docs/schema/toplevel.xsd | 4 +- TAO/CIAO/docs/schema/unused_elements.xsd | 32 +- TAO/CIAO/docs/schema/xsc-banner.cpp | 4 +- TAO/CIAO/docs/schema/xsc-banner.h | 4 +- .../docs/templates/CIAO_Glue_Session_Template.cpp | 8 +- .../docs/tutorials/CoSMIC/Icons/AddConnMode.gif | Bin 106 -> 107 bytes TAO/CIAO/docs/tutorials/CoSMIC/Icons/SetMode.gif | Bin 125 -> 126 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig1.jpg | Bin 13971 -> 13966 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig10.jpg | Bin 34684 -> 34681 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig11.jpg | Bin 36849 -> 36846 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig2.jpg | Bin 91215 -> 91208 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig3.jpg | Bin 23857 -> 23853 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig4.jpg | Bin 59400 -> 59395 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig5.jpg | Bin 49434 -> 49430 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig6.jpg | Bin 40156 -> 40153 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig7.jpg | Bin 36808 -> 36805 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig8.jpg | Bin 30951 -> 30948 bytes TAO/CIAO/docs/tutorials/CoSMIC/Images/fig9.jpg | Bin 42044 -> 42041 bytes .../Quoter/Simple/Distributor/Distributor.mpc | 8 +- .../Quoter/Simple/Distributor/Distributor_exec.cpp | 4 +- .../tutorials/Quoter/Simple/descriptors/Broker.ccd | 2 +- .../tutorials/Quoter/Simple/descriptors/Broker.cid | 2 +- .../tutorials/Quoter/Simple/descriptors/Broker.cpd | 2 +- .../Quoter/Simple/descriptors/Broker_Exec.iad | 2 +- .../Quoter/Simple/descriptors/Broker_Stub.iad | 2 +- .../Quoter/Simple/descriptors/Broker_Svnt.iad | 2 +- .../Quoter/Simple/descriptors/Distributor.ccd | 2 +- .../Quoter/Simple/descriptors/Distributor.cid | 2 +- .../Quoter/Simple/descriptors/Distributor.cpd | 2 +- .../Quoter/Simple/descriptors/Distributor_Exec.iad | 2 +- .../Quoter/Simple/descriptors/Distributor_Stub.iad | 2 +- .../Quoter/Simple/descriptors/Distributor_Svnt.iad | 2 +- .../docs/tutorials/Quoter/Simple/images/quoter.jpg | Bin 15027 -> 15022 bytes TAO/CIAO/docs/value_factory_registration.html | 98 +- .../examples/BasicSP/BMClosedED/BMClosedED.mpc | 14 +- .../examples/BasicSP/BMDevice/BMDevice_exec.cpp | 18 +- TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc | 14 +- .../examples/BasicSP/BMDisplay/BMDisplay_exec.cpp | 8 +- TAO/CIAO/examples/BasicSP/EC/EC.mpc | 10 +- TAO/CIAO/examples/BasicSP/EC/controller.cpp | 14 +- TAO/CIAO/examples/BasicSP/README.html | 16 +- .../BasicSP/descriptors/NodeManagerMap.dat | 2 +- .../BasicSP/descriptors/basicNodeDaemon.pl | 4 +- .../descriptors/flattened_deploymentplan.cdp | 60 +- TAO/CIAO/examples/Display/GPS/GPS.mpc | 4 +- TAO/CIAO/examples/Display/HUDisplay.mpc | 16 +- .../examples/Display/NavDisplay/NavDisplay.mpc | 2 +- .../Display/NavDisplayGUI_exec/trolltech.gif | Bin 42629 -> 42627 bytes .../Display/NavDisplayGUI_exec/worldmap1.gif | Bin 207612 -> 207576 bytes TAO/CIAO/examples/Display/README.html | 2 +- TAO/CIAO/examples/Display/RateGen/RateGen.mpc | 2 +- TAO/CIAO/examples/Display/descriptors/EM.ior | 2 +- TAO/CIAO/examples/Display/descriptors/GPS.ior | 2 +- .../examples/Display/descriptors/NavDisplay.ior | 2 +- .../examples/Display/descriptors/NavDisplayGUI.ior | 2 +- TAO/CIAO/examples/Display/descriptors/RateGen.ior | 2 +- .../Display/descriptors/basicNodeDaemon.pl | 4 +- .../descriptors/flattened_deploymentplan.cdp | 80 +- TAO/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc | 16 +- TAO/CIAO/examples/Hello/ReDaC-Usage.html | 28 +- TAO/CIAO/examples/Hello/Receiver/Receiver.mpc | 12 +- TAO/CIAO/examples/Hello/Receiver/Receiver_exec.cpp | 2 +- TAO/CIAO/examples/Hello/Sender/Sender.idl | 8 +- TAO/CIAO/examples/Hello/Sender/Sender.mpc | 14 +- TAO/CIAO/examples/Hello/Sender/Sender_exec.h | 2 +- TAO/CIAO/examples/Hello/Sender/starter.cpp | 26 +- TAO/CIAO/examples/Hello/descriptors/Hello.cid | 16 +- .../Hello/descriptors/flattened_deploymentplan.cdp | 18 +- .../flattened_deploymentplan_without_ns.cdp | 16 +- TAO/CIAO/examples/Hello/descriptors/run_test.pl | 14 +- .../Hello/descriptors/run_test_without_ns.pl | 8 +- .../examples/Hello/descriptors_RTCCM/input.csr | 20 +- .../Hello/descriptors_RTCCM/rt-config-example.cdp | 6 +- .../Hello/descriptors_RTCCM/rt-config-example.csr | 12 +- .../Hello/descriptors_RTCCM/rt-example.cdp | 16 +- .../Hello/descriptors_RTCCM/rt_run_test.pl | 8 +- .../Hello/descriptors_ReDaC/deploymentplan.cdp | 16 +- .../Hello/descriptors_ReDaC/deploymentplan_add.cdp | 16 +- .../descriptors_ReDaC/deploymentplan_remove.cdp | 16 +- .../descriptors_naming/deploymentplan_naming.cdp | 18 +- .../deploymentplan.cdp | 16 +- .../deploymentplan_shared_components.cdp | 22 +- TAO/CIAO/examples/Hello/step-by-step.html | 24 +- TAO/CIAO/examples/Philosophers/README | 2 +- .../examples/Swapping/Hello_Base/Hello_Base.mpc | 6 +- TAO/CIAO/examples/Swapping/Receiver/Receiver.mpc | 4 +- .../examples/Swapping/Receiver/Receiver_exec.cpp | 10 +- .../examples/Swapping/Receiver/Receiver_exec.h | 10 +- TAO/CIAO/examples/Swapping/Sender/Sender.idl | 2 +- TAO/CIAO/examples/Swapping/Sender/starter.cpp | 22 +- TAO/CIAO/performance-tests/Benchmark/Benchmark.idl | 4 +- TAO/CIAO/performance-tests/Benchmark/Benchmark.mpc | 6 +- .../Benchmark/Multi_Threaded/NOTE.txt | 4 +- .../Benchmark/Multi_Threaded/README | 10 +- TAO/CIAO/performance-tests/Benchmark/README | 4 +- .../performance-tests/Benchmark/RoundTrip/README | 4 +- .../Benchmark/RoundTrip/RoundTrip.mpc | 10 +- .../Benchmark/RoundTrip/RoundTripEI.idl | 4 +- .../performance-tests/Benchmark/RoundTrip/svc.conf | 2 +- .../Benchmark/RoundTripClient/RoundTripClient.mpc | 10 +- .../RoundTripClient/RoundTripClientEI.idl | 6 +- .../Benchmark/RoundTripServer/Test.idl | 2 +- .../Benchmark/RoundTripServer/server.cpp | 2 +- .../Benchmark/descriptors/Multi_Threaded.cad | 14 +- .../Benchmark/descriptors/NOTE.txt | 10 +- TAO/CIAO/performance-tests/Benchmark/server.cpp | 2 +- TAO/CIAO/performance-tests/Benchmark/svc.conf | 2 +- .../performance-tests/Protocols/Sender/Sender.idl | 4 +- .../Protocols/common/Protocols.idl | 6 +- .../Protocols/common/Protocols.mpc | 6 +- .../Protocols/descriptors/Receiver.ssd | 2 +- .../performance-tests/mico/mico-thrput-st/README | 10 +- .../performance-tests/mico/mico-thrput-st/mico-env | 6 +- TAO/CIAO/tests/CIDL/CodeGen/Basic.idl | 6 +- TAO/CIAO/tests/CIDL/CodeGen/CodeGen.idl | 18 +- TAO/CIAO/tests/CIDL/CodeGen/README | 2 +- .../ComplexComponent/Attributes/Attributes.idl | 16 +- .../ComplexComponent/Attributes/Attributes.mpc | 2 +- .../ComplexComponent/EventSink/EventSink.idl | 8 +- .../ComplexComponent/EventSink/EventSink.mpc | 2 +- .../ComplexComponent/EventSource/EventSource.idl | 4 +- .../ComplexComponent/EventSource/EventSource.mpc | 2 +- .../Components/ComplexComponent/Facets/Facets.idl | 8 +- .../Components/ComplexComponent/Facets/Facets.mpc | 2 +- .../ComplexComponent/Receptacles/Receptacles.idl | 18 +- .../ComplexComponent/Receptacles/Receptacles.mpc | 2 +- .../Components/SimpleComponent/SimpleComponent.idl | 28 +- .../Components/SimpleComponent/SimpleComponent.mpc | 2 +- TAO/CIAO/tests/IDL3/Events/Abstract/Abstract.idl | 8 +- TAO/CIAO/tests/IDL3/Events/Abstract/Abstract.mpc | 2 +- TAO/CIAO/tests/IDL3/Events/Regular/Regular.idl | 14 +- TAO/CIAO/tests/IDL3/Events/Regular/Regular.mpc | 2 +- .../tests/IDL3/Homes/Attributes/HomeAttributes.idl | 22 +- .../tests/IDL3/Homes/Attributes/HomeAttributes.mpc | 2 +- TAO/CIAO/tests/IDL3/Homes/Basic/Basic.idl | 16 +- TAO/CIAO/tests/IDL3/Homes/Basic/Basic.mpc | 2 +- TAO/CIAO/tests/IDL3/Homes/Factory/Factory.idl | 14 +- TAO/CIAO/tests/IDL3/Homes/Factory/Factory.mpc | 2 +- TAO/CIAO/tests/IDL3/Homes/Finder/Finder.idl | 12 +- TAO/CIAO/tests/IDL3/Homes/Finder/Finder.mpc | 2 +- .../tests/IDL3/Homes/Inheritance/Inheritance.idl | 14 +- .../tests/IDL3/Homes/Inheritance/Inheritance.mpc | 2 +- TAO/CIAO/tests/IDL3/ImpliedIDL/All/README | 8 +- TAO/CIAO/tests/IDL3/ImpliedIDL/All/all.mpc | 6 +- TAO/CIAO/tests/IDL3/ImpliedIDL/All/include.idl | 2 +- .../tests/IDL3/ImpliedIDL/All/pass_through.idl | 6 +- .../IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc | 2 +- .../Components/EventSink/ICEventSink.idl | 2 +- .../Components/EventSink/ICEventSink.mpc | 2 +- .../Components/EventSource/ICEventSource.idl | 8 +- .../Components/EventSource/ICEventSource.mpc | 2 +- .../Components/Receptacles/ICReceptacles.idl | 8 +- .../Components/Receptacles/ICReceptacles.mpc | 2 +- TAO/CIAO/tests/IDL3/ImpliedIDL/Events/Events.idl | 2 +- TAO/CIAO/tests/IDL3/ImpliedIDL/Events/Events.mpc | 2 +- TAO/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.idl | 4 +- TAO/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.mpc | 2 +- TAO/CIAO/tests/IDL3/Lookup/README | 2 +- TAO/CIAO/tests/IDL3/Lookup/lookup_test.idl | 20 +- TAO/CIAO/tests/IDL3/Lookup/lookup_test.mpc | 2 +- TAO/CIAO/tests/Minimum/Minimum_Base/Minimum.mpc | 16 +- TAO/CIAO/tests/Minimum/Receiver/Receiver.mpc | 12 +- TAO/CIAO/tests/Minimum/Sender/Sender.idl | 2 +- TAO/CIAO/tests/Minimum/Sender/Sender.mpc | 10 +- TAO/CIAO/tests/tests.mwc | 2 +- TAO/CIAO/tools/Config_Handlers/ADD_Handler.cpp | 293 +- TAO/CIAO/tools/Config_Handlers/ADD_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/Any_Handler.cpp | 20 +- TAO/CIAO/tools/Config_Handlers/Any_Handler.h | 66 +- TAO/CIAO/tools/Config_Handlers/BasicSP.cdp | 976 +- .../Config_Handlers/Basic_Deployment_Data.cpp | 21561 ++++++++++--------- .../Config_Handlers/Basic_Deployment_Data.hpp | 10368 ++++----- TAO/CIAO/tools/Config_Handlers/CCD_Handler.cpp | 308 +- TAO/CIAO/tools/Config_Handlers/CCD_Handler.h | 66 +- TAO/CIAO/tools/Config_Handlers/CEPE_Handler.cpp | 21 +- TAO/CIAO/tools/Config_Handlers/CEPE_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/CPD_Handler.cpp | 129 +- TAO/CIAO/tools/Config_Handlers/CPD_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/CRDD_Handler.cpp | 53 +- TAO/CIAO/tools/Config_Handlers/CRDD_Handler.h | 84 +- TAO/CIAO/tools/Config_Handlers/Common.h | 62 +- .../ComponentPropertyDescription_Handler.cpp | 18 +- .../ComponentPropertyDescription_Handler.h | 72 +- TAO/CIAO/tools/Config_Handlers/Config_Handlers.mpc | 162 +- TAO/CIAO/tools/Config_Handlers/DD_Handler.cpp | 97 +- TAO/CIAO/tools/Config_Handlers/DD_Handler.h | 224 +- TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp | 478 +- TAO/CIAO/tools/Config_Handlers/DP_Handler.h | 130 +- TAO/CIAO/tools/Config_Handlers/DP_PCD_Handler.cpp | 35 +- TAO/CIAO/tools/Config_Handlers/DP_PCD_Handler.h | 76 +- .../tools/Config_Handlers/DataType_Handler.cpp | 301 +- TAO/CIAO/tools/Config_Handlers/DataType_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/Deployment.cpp | 758 +- TAO/CIAO/tools/Config_Handlers/Deployment.hpp | 194 +- TAO/CIAO/tools/Config_Handlers/DnC_Dump.cpp | 86 +- TAO/CIAO/tools/Config_Handlers/DnC_Dump.h | 164 +- TAO/CIAO/tools/Config_Handlers/DnC_Dump_T.cpp | 122 +- TAO/CIAO/tools/Config_Handlers/DnC_Dump_T.h | 42 +- TAO/CIAO/tools/Config_Handlers/Dump_Obj.cpp | 100 +- TAO/CIAO/tools/Config_Handlers/Dump_Obj.h | 88 +- TAO/CIAO/tools/Config_Handlers/DynAny_Handler.mpc | 30 +- .../DynAny_Handler/DataType_Handler.cpp | 44 +- .../DynAny_Handler/DataType_Handler.h | 22 +- .../DynAny_Handler/DynAny_Handler.cpp | 112 +- .../DynAny_Handler/DynAny_Handler.h | 23 +- .../DynAny_Handler/DynEnum_Handler.cpp | 24 +- .../DynAny_Handler/DynEnum_Handler.h | 8 +- TAO/CIAO/tools/Config_Handlers/ERE_Handler.cpp | 19 +- TAO/CIAO/tools/Config_Handlers/ERE_Handler.h | 81 +- TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp | 215 +- TAO/CIAO/tools/Config_Handlers/IDD_Handler.h | 88 +- TAO/CIAO/tools/Config_Handlers/IDREF_Base.cpp | 141 +- TAO/CIAO/tools/Config_Handlers/IDREF_Base.h | 123 +- TAO/CIAO/tools/Config_Handlers/ID_Handler.cpp | 14 +- TAO/CIAO/tools/Config_Handlers/ID_Handler.h | 86 +- TAO/CIAO/tools/Config_Handlers/IRDD_Handler.cpp | 150 +- TAO/CIAO/tools/Config_Handlers/IRDD_Handler.h | 87 +- TAO/CIAO/tools/Config_Handlers/MDD_Handler.cpp | 157 +- TAO/CIAO/tools/Config_Handlers/MDD_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/PCD_Handler.cpp | 185 +- TAO/CIAO/tools/Config_Handlers/PCD_Handler.h | 86 +- TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp | 102 +- TAO/CIAO/tools/Config_Handlers/PSPE_Handler.h | 74 +- .../Package_Handlers/CAD_Handler.cpp | 259 + .../Config_Handlers/Package_Handlers/CAD_Handler.h | 59 + .../Package_Handlers/CID_Handler.cpp | 382 + .../Config_Handlers/Package_Handlers/CID_Handler.h | 67 + .../Package_Handlers/CPD_Handler.cpp | 158 + .../Config_Handlers/Package_Handlers/CPD_Handler.h | 74 + .../Package_Handlers/Comp_Intf_Descr_Handler.cpp | 164 + .../Package_Handlers/Comp_Intf_Descr_Handler.h | 54 + .../Package_Handlers/IAD_Handler.cpp | 122 + .../Config_Handlers/Package_Handlers/IAD_Handler.h | 66 + .../Config_Handlers/Package_Handlers/NIA_Handler.h | 64 + .../Package_Handlers/PCD_Handler.cpp | 152 + .../Config_Handlers/Package_Handlers/PCD_Handler.h | 69 + .../Config_Handlers/Package_Handlers/PC_Intf.cpp | 81 + .../Config_Handlers/Package_Handlers/PC_Intf.h | 58 + .../Package_Handlers/Package_Handlers.mpc | 45 + .../Package_Handlers/Packaging_Handlers_Export.h | 58 + .../Package_Handlers/SID_Handler.cpp | 140 + .../Config_Handlers/Package_Handlers/SID_Handler.h | 71 + .../Config_Handlers/Package_Handlers/test.cpp | 111 + .../tools/Config_Handlers/Property_Handler.cpp | 12 +- TAO/CIAO/tools/Config_Handlers/Property_Handler.h | 85 +- TAO/CIAO/tools/Config_Handlers/RDD_Handler.cpp | 30 +- TAO/CIAO/tools/Config_Handlers/RDD_Handler.h | 70 +- .../tools/Config_Handlers/RT-CCM/CB_Handler.cpp | 24 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/CB_Handler.h | 40 +- .../Config_Handlers/RT-CCM/CIAOServerResources.cpp | 204 +- .../Config_Handlers/RT-CCM/CIAOServerResources.hpp | 260 +- .../tools/Config_Handlers/RT-CCM/CLA_Handler.cpp | 66 +- .../tools/Config_Handlers/RT-CCM/CLA_Handler.h | 48 +- .../tools/Config_Handlers/RT-CCM/OC_Handler.cpp | 76 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/OC_Handler.h | 40 +- .../tools/Config_Handlers/RT-CCM/OR_Handler.cpp | 148 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/OR_Handler.h | 46 +- .../tools/Config_Handlers/RT-CCM/PM_Handler.cpp | 36 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/PM_Handler.h | 10 +- .../tools/Config_Handlers/RT-CCM/PS_Handler.cpp | 50 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.h | 12 +- .../tools/Config_Handlers/RT-CCM/SRD_Handler.cpp | 44 +- .../tools/Config_Handlers/RT-CCM/SRD_Handler.h | 96 +- .../tools/Config_Handlers/RT-CCM/TPL_Handler.cpp | 16 +- .../tools/Config_Handlers/RT-CCM/TP_Handler.cpp | 62 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/TP_Handler.h | 34 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/input.csr | 18 +- TAO/CIAO/tools/Config_Handlers/RT-CCM/test.cpp | 32 +- TAO/CIAO/tools/Config_Handlers/Req_Handler.cpp | 67 +- TAO/CIAO/tools/Config_Handlers/Req_Handler.h | 82 +- TAO/CIAO/tools/Config_Handlers/STD_CID_Handler.cpp | 246 +- TAO/CIAO/tools/Config_Handlers/STD_CID_Handler.h | 84 +- TAO/CIAO/tools/Config_Handlers/STD_CPD_Handler.cpp | 4 +- TAO/CIAO/tools/Config_Handlers/STD_CPD_Handler.h | 94 +- TAO/CIAO/tools/Config_Handlers/STD_IAD_Handler.cpp | 32 +- TAO/CIAO/tools/Config_Handlers/STD_IAD_Handler.h | 64 +- TAO/CIAO/tools/Config_Handlers/STD_PCD_Handler.cpp | 4 +- TAO/CIAO/tools/Config_Handlers/STD_PCD_Handler.h | 84 +- TAO/CIAO/tools/Config_Handlers/STD_PC_Intf.h | 70 +- .../Config_Handlers/SatisfierProperty_Handler.cpp | 113 + .../Config_Handlers/SatisfierProperty_Handler.h | 71 + TAO/CIAO/tools/Config_Handlers/Utils/Exceptions.h | 39 + TAO/CIAO/tools/Config_Handlers/Utils/Functors.h | 137 + TAO/CIAO/tools/Config_Handlers/Utils/Utils.mpc | 2 +- .../Config_Handlers/Utils/XML_Error_Handler.cpp | 12 +- .../tools/Config_Handlers/Utils/XML_Helper.cpp | 70 +- TAO/CIAO/tools/Config_Handlers/Utils/XML_Helper.h | 18 +- .../tools/Config_Handlers/Utils/XercesString.cpp | 2 +- .../tools/Config_Handlers/Utils/XercesString.h | 12 +- .../tools/Config_Handlers/XMLSchema/Traversal.ipp | 4 +- .../tools/Config_Handlers/XMLSchema/Traversal.tpp | 2 +- .../tools/Config_Handlers/XMLSchema/TypeInfo.ipp | 2 +- TAO/CIAO/tools/Config_Handlers/XMLSchema/Types.hpp | 2 +- TAO/CIAO/tools/Config_Handlers/XMLSchema/Types.ipp | 2 +- TAO/CIAO/tools/Config_Handlers/XMLSchema/Types.tpp | 2 +- .../tools/Config_Handlers/XMLSchema/Writer.hpp | 61 +- TAO/CIAO/tools/Config_Handlers/XML_File_Intf.cpp | 9 +- TAO/CIAO/tools/Config_Handlers/XML_File_Intf.h | 42 +- TAO/CIAO/tools/Config_Handlers/XSCRT/Elements.hpp | 4 +- .../Config_Handlers/XSCRT/ExtendedTypeInfo.hpp | 4 +- .../Config_Handlers/XSCRT/ExtendedTypeInfo.ipp | 2 +- TAO/CIAO/tools/Config_Handlers/XSCRT/XML.hpp | 10 +- TAO/CIAO/tools/Config_Handlers/ccd.cpp | 470 +- TAO/CIAO/tools/Config_Handlers/ccd.hpp | 1088 +- TAO/CIAO/tools/Config_Handlers/cdd.cpp | 5109 +++-- TAO/CIAO/tools/Config_Handlers/cdd.hpp | 2460 ++- TAO/CIAO/tools/Config_Handlers/cdp.cpp | 400 +- TAO/CIAO/tools/Config_Handlers/cdp.hpp | 978 +- TAO/CIAO/tools/Config_Handlers/cid.cpp | 5903 +++-- TAO/CIAO/tools/Config_Handlers/cid.hpp | 2776 ++- TAO/CIAO/tools/Config_Handlers/cpd.cpp | 2084 +- TAO/CIAO/tools/Config_Handlers/cpd.hpp | 883 +- TAO/CIAO/tools/Config_Handlers/iad.cpp | 2548 ++- TAO/CIAO/tools/Config_Handlers/iad.hpp | 1057 +- TAO/CIAO/tools/Config_Handlers/pcd.cpp | 1020 +- TAO/CIAO/tools/Config_Handlers/pcd.hpp | 838 +- TAO/CIAO/tools/Config_Handlers/test.cdp | 2030 +- TAO/CIAO/tools/Config_Handlers/test.cpp | 24 +- TAO/CIAO/tools/Config_Handlers/toplevel.cpp | 173 +- TAO/CIAO/tools/Config_Handlers/toplevel.hpp | 238 +- TAO/CIAO/tools/Config_Handlers/vc6-4786.h | 12 +- TAO/CIAO/tools/IDL3_to_IDL2/README | 14 +- TAO/CIAO/tools/IDL3_to_IDL2/be_global.cpp | 4 +- TAO/CIAO/tools/IDL3_to_IDL2/be_global.h | 14 +- TAO/CIAO/tools/IDL3_to_IDL2/be_helper.h | 2 +- TAO/CIAO/tools/IDL3_to_IDL2/be_produce.cpp | 2 +- TAO/CIAO/tools/IDL3_to_IDL2/be_sunsoft.cpp | 64 +- .../tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp | 922 +- TAO/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h | 4 +- TAO/CIAO/tools/tools.mwc | 2 +- 549 files changed, 48914 insertions(+), 35600 deletions(-) create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.h create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.cpp create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.h create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp create mode 100644 TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/NIA_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/PC_Intf.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/Packaging_Handlers_Export.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Package_Handlers/test.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.cpp create mode 100644 TAO/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Utils/Exceptions.h create mode 100644 TAO/CIAO/tools/Config_Handlers/Utils/Functors.h diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Factory.hpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Factory.hpp index d16c5ce3ec1..521602ac70f 100644 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Factory.hpp +++ b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Factory.hpp @@ -15,7 +15,7 @@ namespace CCF { struct Composition; struct HomeExecutor; - + struct Factory : virtual IDL3::SemanticAction::Factory { virtual Composition& diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticGraph/Elements.cpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticGraph/Elements.cpp index 82220fe9bb7..349f1854786 100644 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticGraph/Elements.cpp +++ b/TAO/CIAO/CCF/CCF/CIDL/SemanticGraph/Elements.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + namespace { TypeInfo diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp index 57dcf02af4a..40259a694f6 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp @@ -77,7 +77,7 @@ namespace Indentation virtual int_type put (char_type c) throw (Exception, ExH::System::Exception) - { + { return buffer_.sputc (c); } diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp index 8b5a14cbf22..be0bd3827e0 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp @@ -46,7 +46,7 @@ namespace regex if (e.empty ()) return src; wchar_t delimiter (e[0]); - + std::wstring::size_type first = e.find (delimiter); std::wstring::size_type middle = e.find (delimiter, first + 1); std::wstring::size_type last = e.find (delimiter, middle + 1); diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp index a87d87470b2..5e846d90211 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp @@ -55,6 +55,7 @@ namespace CCF { Enumerator& e (ctx.tu ().new_node ()); ctx.tu ().new_edge (e, *type_); + ctx.tu ().new_edge (ctx.scope (), e, name); } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/TypeId.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/TypeId.hpp index 1c8d7bdadae..a716961bbf0 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/TypeId.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/TypeId.hpp @@ -22,7 +22,7 @@ namespace CCF end () = 0; }; - + struct TypePrefix { virtual void diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Enum.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Enum.hpp index 8399fecc6b0..6e3d2ee723d 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Enum.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Enum.hpp @@ -5,7 +5,7 @@ #ifndef CCF_IDL2_SEMANTIC_GRAPH_ENUM_HPP #define CCF_IDL2_SEMANTIC_GRAPH_ENUM_HPP -#include "CCF/IDL2/SemanticGraph/Elements.hpp" +#include "CCF/IDL2/SemanticGraph/IntExpression.hpp" namespace CCF { @@ -35,7 +35,7 @@ namespace CCF }; - class Enumerator : public virtual Nameable, public virtual Instance + class Enumerator : public virtual Nameable, public virtual IntConst { public: static Introspection::TypeInfo const& diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Exception.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Exception.cpp index 84ca130cafa..9ed3a7e494b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Exception.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Exception.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + namespace { TypeInfo diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Member.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Member.cpp index b57bb0fe764..597be660772 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Member.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Member.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + namespace { TypeInfo diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Native.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Native.cpp index 46e24ae9c76..b2c29fe2881 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Native.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Native.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + namespace { TypeInfo diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp index 697751f14cd..83ed23ffe40 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + // Receives // // diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Struct.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Struct.cpp index 463dec37f23..46fd9b9ef3a 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Struct.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Struct.cpp @@ -36,18 +36,28 @@ namespace CCF { if (defined ()) { + CompilerElements::Context& ctx ( + const_cast (context ())); + + if (ctx.count ("struct-complete-test")) + return true; + + ctx.set ("struct-complete-test", true); + bool c (true); + for (Scope::NamesIterator i (names_begin ()); - i != names_end (); + c && i != names_end (); ++i) { Member const& m (dynamic_cast ((*i)->named ())); Type const& t (m.belongs ().type ()); if (!t.complete ()) - return false; + c = false; } - return true; + ctx.remove ("struct-complete-test"); + return c; } return false; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Union.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Union.cpp index a1d32705644..28c673a94f3 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Union.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Union.cpp @@ -142,18 +142,28 @@ namespace CCF { if (defined ()) { + CompilerElements::Context& ctx ( + const_cast (context ())); + + if (ctx.count ("union-complete-test")) + return true; + + ctx.set ("union-complete-test", true); + bool c (true); + for (Scope::NamesIterator i (names_begin ()); - i != names_end (); + c && i != names_end (); ++i) { Member const& m (dynamic_cast ((*i)->named ())); Type const& t (m.belongs ().type ()); if (!t.complete ()) - return false; + c = false; } - return true; + ctx.remove ("union-complete-test"); + return c; } return false; diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.cpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.cpp index d440907ed4c..b14f518983e 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.cpp @@ -49,7 +49,7 @@ namespace CCF { } - + // Union // // diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.hpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.hpp index 0237be5016d..2bcad1eb4ea 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Union.hpp @@ -38,7 +38,7 @@ namespace CCF post (Type&); }; - + // // // @@ -52,7 +52,7 @@ namespace CCF virtual void name (Type&); - + virtual void post (Type&); }; diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Elements.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Elements.cpp index 4d3b325f5fd..ab49a698842 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Elements.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Elements.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + namespace { TypeInfo diff --git a/TAO/CIAO/CCF/Documentation/DesignNotes b/TAO/CIAO/CCF/Documentation/DesignNotes index b81778b5ba4..1cf74e88400 100644 --- a/TAO/CIAO/CCF/Documentation/DesignNotes +++ b/TAO/CIAO/CCF/Documentation/DesignNotes @@ -1,14 +1,14 @@ Note: this file is somewhat outdated -Intention of this file is to capture and document CIDL complier design +Intention of this file is to capture and document CIDL complier design ideas/decisions. Conceptual parts of CIDL compiler design ---------------------------------------- Option Parser Consists of option parser and option - database. + database. C Preprocessor Interfacing Represents mechanism of preprocessing cidl files. @@ -30,10 +30,10 @@ Semantic Analyzer Traverses Syntax Tree and performs semantic expansions. -Code Generation Stream Stream to output generated code to. Used +Code Generation Stream Stream to output generated code to. Used by concrete Code Generators -Code Generators +Code Generators { Executor Mapping Generator Generator for local executor mapping. @@ -48,7 +48,7 @@ Code Generators } Compiler driver Establishes order of execution of - different components as part of + different components as part of compilation process. @@ -63,8 +63,8 @@ How everything works together cidl file and generates Syntax Tree by means of semantic rules. (4) At this point we have Syntax Tree corresponding to the original cidl - file. Compiler Driver executes Executor Mapping Generator, - Executor Implementation Generator and Skeleton Thunk Generator on + file. Compiler Driver executes Executor Mapping Generator, + Executor Implementation Generator and Skeleton Thunk Generator on Syntax Tree. @@ -72,7 +72,7 @@ How everything works together General Design Ideas/Decision ------------- -[IDEA]: There is an effort to use autoconf/automake in ACE/TAO. Maybe it's +[IDEA]: There is an effort to use autoconf/automake in ACE/TAO. Maybe it's a good idea to start using it with CIDLC? There is one side advantage of this approach: if we decide to embed GCC CPP then we will have to use configure (or otherwise ACE-ify the code which doesn't sound like @@ -81,7 +81,7 @@ General Design Ideas/Decision [IDEA]: CIDLC is a prototype for a new IDLC, PSDLC and IfR model. Here are basic concepts: - - use common IDL grammar, semantic rules and syntax tree nodes + - use common IDL grammar, semantic rules and syntax tree nodes for IDLC, CIDLC, PSDLC and IfR. Possibly have several libraries for example ast_idl-2.so, ast_idl-3.so, scaner_idl-2.so scaner_idl-3.so, parser_idl-2.so, parser_idl-3.so. Dependency @@ -102,16 +102,16 @@ General Design Ideas/Decision ---------parser_idl-3.so--------- Same idea applies for CIDL and PSDL. - - - use the same internal representation (syntax tree) in all + + - use the same internal representation (syntax tree) in all compilers and IfR. This way at some stage if we will need to make one of the compilers IfR-integrated (import keyword?) then it will be a much easier task than it's now. This internal - representation may also be usable in typecodes + representation may also be usable in typecodes + + @@ boris: not clear to me. - @@ boris: not clear to me. - @@ jeff: A typecode is like a piece of the Syntax Tree with these exceptions - @@ -125,44 +125,44 @@ General Design Ideas/Decision different classes than used to compose the ST itself. @@ boris: Ok, let me see if I got it right. So when typecode - is kept in parsed state (as opposite to binary) (btw, when + is kept in parsed state (as opposite to binary) (btw, when does it happen?) it makes sense to apply the same techniques (if in fact not the same ST nodes and traversal mechs) as for XIDL compilation. [IDEA]: We should be consistent with the way external compilers that we call report errors. For now those are CPP and IDLC. - + Option Parser ------------- [IDEA]: Use Spirit parser framework to generate option parser. -[IDEA]: Option Database is probably a singleton. +[IDEA]: Option Database is probably a singleton. - @@ jeff: This is a good idea, especially when passing some of the - options to a preprocessor or spawned IDL compier. But I think we - will still need 'state' classes for the front and back ends (to - hold values set by command line options and default values) so + @@ jeff: This is a good idea, especially when passing some of the + options to a preprocessor or spawned IDL compier. But I think we + will still need 'state' classes for the front and back ends (to + hold values set by command line options and default values) so we can keep them decoupled). - @@ boris: I understand what you mean. Though I think we will be + @@ boris: I understand what you mean. Though I think we will be able to do with one 'runtime database'. Each 'compiler module' will be able to populate its 'namespace' with (1) default - values, (2) with module-specific options and (3) arbitrary + values, (2) with module-specific options and (3) arbitrary runtime information. I will present prototopy design shortly. - + [IDEA]: It seems we will have to execute at least two external programs as part of CIDLC execution: CPP and IDLC. Why wouldn't we follow GCC specs model (gcc -dumpspecs). Here are candidates to be put into - specs: + specs: - default CPP name and options - default IDLC name and options - default file extensions and formats for different mappings - - other ideas? + - other ideas? [IDEA]: Provide short and long option names (e.g. -o and --output-dir) for every option (maybe except -I, -D, etc). @@ -188,9 +188,9 @@ C Preprocessor Interfacing IDL Compiler Interfacing ------------------------ -[IDEA]: Same as for CPP: Can we use pipes? +[IDEA]: Same as for CPP: Can we use pipes? - @@ jeff: check with Nanbor on this. I think there may be CCM/CIAO + @@ jeff: check with Nanbor on this. I think there may be CCM/CIAO use cases where we need the intermediate IDL file. [IDEA]: Will need a mechanism to pass options to IDLC from CIDLC command @@ -207,7 +207,7 @@ Scanner iterator"-based scanner. So this basically mean that we may have to keep the whole sequence in memory. BTW, this is another good reason to have scanner: if we manage to make scanner a predictable parser - (i.e. no backtracking) then we don't have to keep the whole + (i.e. no backtracking) then we don't have to keep the whole preprocessed cidl file in memory. @@ -221,17 +221,17 @@ Parser much easier to reuse/inherit even dynamically. Need to elaborate this idea. -[IDEA]: Use functors as semantic actions. This way we can specify (via +[IDEA]: Use functors as semantic actions. This way we can specify (via functor's data member) on which Syntax Tree they are working. Bad side: semantic rules are defined during grammar construction. However we can use a modification of the factory method pattern. - Better ideas? + Better ideas? @@ jeff: I think ST node creation with a factory is a good idea - another ST implementation could be plugged in, as long as it uses a factory with the same method names. - @@ boris: Right. In fact it's our 'improved' way of handling 'BE' + @@ boris: Right. In fact it's our 'improved' way of handling 'BE' usecases. @@ -242,23 +242,23 @@ Syntax Tree [IDEA]: Use interface repository model as a base for Syntax Tree hierarchy. [IDEA]: Currently (in IDLC) symbol lookup is accomplished by AST navigation, - and is probably the biggest single bottleneck in performance. Perhaps - a separate symbol table would be preferable. Also, lookups could be - specialized, e.g., for declaration, for references, and perhaps a + and is probably the biggest single bottleneck in performance. Perhaps + a separate symbol table would be preferable. Also, lookups could be + specialized, e.g., for declaration, for references, and perhaps a third type for argument-related lookups. [NOTE]: If we are to implement symbol tables then we need to think how we are going to inherit (extend) this tables. [NOTE]: Inheritance/supports graphs: these graphs need to be traversed at - several points in the back end. Currently they are rebuilt for each - use, using an n-squared algorithm. We could at least build them only - once for each interface/valuetype, perhaps even with a better - algorithm. It could be integrated into inheritance/supports error - checking at node creation time, which also be streamlined. - - @@ boris: Well, I think we should design our Syntax Tree so that - every interface/valuetype has a list (flat?) of interfaces it + several points in the back end. Currently they are rebuilt for each + use, using an n-squared algorithm. We could at least build them only + once for each interface/valuetype, perhaps even with a better + algorithm. It could be integrated into inheritance/supports error + checking at node creation time, which also be streamlined. + + @@ boris: Well, I think we should design our Syntax Tree so that + every interface/valuetype has a list (flat?) of interfaces it inherits from/supports. [IDEA]: We will probably want to use factories to instantiate Syntax Tree @@ -272,19 +272,19 @@ Common Syntax Tree traversal Design Ideas/Decision [IDEA] If we specify Syntax Tree traversal facility then we will be able to specify (or even plug dynamically) Syntax Tree traversal agents - that may not only generate something but also annotate or modify + that may not only generate something but also annotate or modify Syntax Tree. We are already using this technique for a number of features (e.g. AMI, IDL3 extension, what else?) but all these agents are hardwired inside TAO IDLC. If we have this facility then we will be able to produce modular and highly extensible design. Notes: - Some traversal agents can change Syntax Tree so that it will be - unusable by some later traversal agents. So maybe the more - generic approach would be to produce new Syntax Tree? + unusable by some later traversal agents. So maybe the more + generic approach would be to produce new Syntax Tree? - @@ jeff: Yes, say for example that we were using a common ST - representation for the IDL compiler and the IFR. We would not - want to send the extra AMI nodes to the IFR so in that case + @@ jeff: Yes, say for example that we were using a common ST + representation for the IDL compiler and the IFR. We would not + want to send the extra AMI nodes to the IFR so in that case simple modification of the ST might not be best. [IDEA] Need a generic name for "Syntax Tree Traversal Agents". What about @@ -306,16 +306,16 @@ Code Generation Stream will result in a generated code like this: namespace N - { - ... + { + ... long foo (long arg0, long arg1) { return arg0 + arg1; } - - ... + + ... } Note that no special actions were taken to ensure proper indentation. @@ -336,34 +336,34 @@ Code Generators @@ boris: I would say may not always be correct - However, for purposes of type coercion and other checking (such as - for positive integer values in string, array and sequence bounds) + However, for purposes of type coercion and other checking (such as + for positive integer values in string, array and sequence bounds) evaluation must be done internally. - + @@ boris: note that evaluation is needed to only verify that things - are correct. You don't have to (shouldn't?) substitute original + are correct. You don't have to (shouldn't?) substitute original (const) expression with what's been evaluated. - @@ jeff: it may be necessary in some cases to append 'f' or 'U' to + @@ jeff: it may be necessary in some cases to append 'f' or 'U' to a generated number to avoid a C++ compiler warning. @@ boris: shouldn't this 'f' and 'U' be in IDL as well? [IDEA] I wonder if it's a good idea to use a separate pass over syntax tree - for semantic checking (e.g. type coercion, positive values for - sequence bounds). + for semantic checking (e.g. type coercion, positive values for + sequence bounds). - @@ jeff: This may hurt performance a little - more lookups - but it + @@ jeff: This may hurt performance a little - more lookups - but it will improve error reporting. - + @@ boris: As we dicussed earlier this pass could be used to do 'semantic expansions' (e.g. calculate a flat list of interface's children, etc). Also I don't think we should worry about speed very much here (of course I don't say we have to be stupid ;-) In fact if we are trading better design vs faster compilation at this stage we should always go for better design. - + Executor Mapping Generator -------------------------- @@ -394,66 +394,66 @@ Vault Some thoughts from Jeff that I are not directly related to CIDLC and are rather current IDLC design defects: -* AMI/AMH implied IDL: more can be done in the BE preprocessing pass, - hopefully eliminating a big chunk of the huge volume of AMI/AMH visitor - code. The implied IDL generated for CCM types, for example, leaves almost +* AMI/AMH implied IDL: more can be done in the BE preprocessing pass, + hopefully eliminating a big chunk of the huge volume of AMI/AMH visitor + code. The implied IDL generated for CCM types, for example, leaves almost nothing extra for the visitors to do. -* Fwd decl redefinition: forward declaration nodes all initially contain a - heap-allocated dummy full-definition member, later replaced by a copy +* Fwd decl redefinition: forward declaration nodes all initially contain a + heap-allocated dummy full-definition member, later replaced by a copy of the full definition. This needs to be streamlined. -* Memory leaks: inconsistent copying/passing policies make it almost - impossible to eliminate the huge number of leaks. The front end will be - more and more reused, and it may be desirable to make it executable as a - function call, in which case it will important to eliminate the leaks. - Perhaps copying of AST nodes can be eliminated with reference counting or +* Memory leaks: inconsistent copying/passing policies make it almost + impossible to eliminate the huge number of leaks. The front end will be + more and more reused, and it may be desirable to make it executable as a + function call, in which case it will important to eliminate the leaks. + Perhaps copying of AST nodes can be eliminated with reference counting or just with careful management, similarly for string identifiers and literals. - Destroy() methods have been put in all the node classes, and are called - recursively from the AST root at destruction time, but they are far from + Destroy() methods have been put in all the node classes, and are called + recursively from the AST root at destruction time, but they are far from doing a complete job. -* Visitor instantiation: the huge visitor factory has already been much - reduced, and the huge enum of context state values is being reduced. - However there will still be an abundance of switch statements at nearly - every instance of visitor creation at scope nesting. We could make better +* Visitor instantiation: the huge visitor factory has already been much + reduced, and the huge enum of context state values is being reduced. + However there will still be an abundance of switch statements at nearly + every instance of visitor creation at scope nesting. We could make better use of polymorphism to get rid of them. * Node narrowing: instead of the impenetrable macros we use now, we - could either generate valuetype-like downcast methods for the (C)IDL + could either generate valuetype-like downcast methods for the (C)IDL types, or we could just use dynamic_cast. * Error reporting: making error messages more informative, and error recovery - could both be a lot better, as they are in most other IDL compilers. If a - recursive descent parser is used (such as Spirit), there is a simple + could both be a lot better, as they are in most other IDL compilers. If a + recursive descent parser is used (such as Spirit), there is a simple generic algorithm for error recovery. -* FE/BE node classes: if BE node classes are implemented at all, there should - be a complete separation of concerns - BE node classes should contain only - info related to code generation, and FE node classes should contain only - info related to the AST representation. As the front end becomes more - modular and reusable, this will become more and more necessary. +* FE/BE node classes: if BE node classes are implemented at all, there should + be a complete separation of concerns - BE node classes should contain only + info related to code generation, and FE node classes should contain only + info related to the AST representation. As the front end becomes more + modular and reusable, this will become more and more necessary. @@ boris: It doesn't seem we will need two separate and parallel hierarhies. * Undefined fwd decls: now that we have dropped support for platforms without - namespaces, the code generated for fwd declarations not defined in the same - translation unit can be much improved, most likely by the elimination of + namespaces, the code generated for fwd declarations not defined in the same + translation unit can be much improved, most likely by the elimination of generated flat-name global methods, and perhaps other improvements as well. -* Strategized code generation: many places now have either lots of - duplication, or an explosion of branching in a single visitor. Adding code - generation for use cases incrementally may give us an opportunity to +* Strategized code generation: many places now have either lots of + duplication, or an explosion of branching in a single visitor. Adding code + generation for use cases incrementally may give us an opportunity to refactor and strategize it better. -* Node generator: this class does nothing more than call 'new' and pass - unchanged the arguments it gets to the appropriate constructor - it can be +* Node generator: this class does nothing more than call 'new' and pass + unchanged the arguments it gets to the appropriate constructor - it can be eliminated. -* Virtual methods: there are many member functions in the IDL compiler that +* Virtual methods: there are many member functions in the IDL compiler that are needlessly virtual. -* Misc. leveraging: redesign of mechanisms listed above can have an effect +* Misc. leveraging: redesign of mechanisms listed above can have an effect on other mechanisms, such as the handling of pragma prefix, typeprefix, and reopened modules. diff --git a/TAO/CIAO/CCF/Documentation/TODO b/TAO/CIAO/CCF/Documentation/TODO index 7a70b99f513..879602513df 100644 --- a/TAO/CIAO/CCF/Documentation/TODO +++ b/TAO/CIAO/CCF/Documentation/TODO @@ -10,7 +10,7 @@ Legend: ------------------------------------------------------------------------ -@@ In operation comma member function is used both for parameters and +@@ In operation comma member function is used both for parameters and exceptions. As a result one can get unexpected extra commas. @@ Make CCF buildable with MPC. @@ -21,7 +21,7 @@ Legend: @@ Typedef.hpp TypeId.hpp: naming inconsistency. -@@ Need ICE mechanism (search for abort ()) +@@ Need ICE mechanism (search for abort ()) @@ Need evolution of semantic action error handling/reporting. @@ -31,17 +31,17 @@ Legend: @@+++ Currently character stream is scanned completely before parsing. The better approach would be scanning on demand (1). -@@+++ IDL2::Parsing::parse () should be eliminated (or terminated if you +@@+++ IDL2::Parsing::parse () should be eliminated (or terminated if you like ;-). This item depends on (1). @@++ 'using namespace' cleanup. - + @@ Replace all i++ with ++i. -@@ It seems that SyntaxTree::Node origin in terms of file:line should be - preserved for subsequent diagnostic implemented as separate paths +@@ It seems that SyntaxTree::Node origin in terms of file:line should be + preserved for subsequent diagnostic implemented as separate paths (see repository id generator for example). - + @@++++ Diagnostic evolution @%++ XML indentation buffer diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-0.idl b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-0.idl index cba2229b654..3c50f4acdd2 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-0.idl +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-0.idl @@ -4,17 +4,17 @@ module Empty { - interface I + interface I { }; }; module M -{ +{ interface I {}; - + typedef I Internal; - + //local interface CCM_I : I {}; }; diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-1.idl b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-1.idl index 2140367480c..0a437cb0320 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-1.idl +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-1.idl @@ -9,13 +9,13 @@ module M1 { interface Blah; interface Fool {}; - - component C1 + + component C1 { provides M::I i; readonly attribute long l; }; - + home H1 manages C1 { attribute M::I i; diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl index 8d6ccd7ad6b..51bf3d88a4b 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl @@ -27,7 +27,7 @@ module M2 { provides Goof pg; uses Goof ug; - + publishes E pe; emits E me; consumes E ce; @@ -40,34 +40,34 @@ module M2 long l; OctetSeq octet_seq; }; - + typedef sequence S_Seq; - - exception Ex1 + + exception Ex1 { string descr; }; - + exception Ex2 { }; - + home H2 : M1::H1 supports I, J manages C2 { readonly attribute long rl; readonly attribute M::I rai; attribute OctetSeq seq; attribute S_Seq a_s_seq; - - void - foo (in long l, - inout boolean b, - out long ol, - in M::I i, - out unsigned long long ull, - inout S_Seq s_seq, - in V v) raises (Ex1, Ex2); - + + void + foo (in long l, + inout boolean b, + out long ol, + in M::I i, + out unsigned long long ull, + inout S_Seq s_seq, + in V v) raises (Ex1, Ex2); + factory new (in long l, in OctetSeq s) raises (Ex2, Ex1); finder find (in long l, in OctetSeq s) raises (Ex1, Ex2); }; diff --git a/TAO/CIAO/CCF/Example/CodeGenerationKit/Indentation/XML/indent_xml.cpp b/TAO/CIAO/CCF/Example/CodeGenerationKit/Indentation/XML/indent_xml.cpp index b65389ca306..f244249c69b 100644 --- a/TAO/CIAO/CCF/Example/CodeGenerationKit/Indentation/XML/indent_xml.cpp +++ b/TAO/CIAO/CCF/Example/CodeGenerationKit/Indentation/XML/indent_xml.cpp @@ -17,7 +17,7 @@ main () cout << "" << endl; cout << "" << endl << endl; - + cout << "whatever" << endl; cout << "" << endl; diff --git a/TAO/CIAO/CCF/Test/IDL2/Compiler/test.idl b/TAO/CIAO/CCF/Test/IDL2/Compiler/test.idl index 1d18e7118fe..737a729524b 100644 --- a/TAO/CIAO/CCF/Test/IDL2/Compiler/test.idl +++ b/TAO/CIAO/CCF/Test/IDL2/Compiler/test.idl @@ -22,11 +22,11 @@ module InterfaceTest abstract interface AI; local interface LI; interface I; - + abstract interface AI { }; - + interface I : AI { }; @@ -42,7 +42,7 @@ module InterfaceTest module MemberTest { typedef long Id; - + struct S { Id id; @@ -62,12 +62,12 @@ module ModuleTest typedef long L; }; }; - + module M { typedef N::L L; }; - + module N { typedef M::N::L L; @@ -95,7 +95,7 @@ module Sequence typedef sequence OctetSeq; typedef OctetSeq RawSeq; - + typedef sequence StringSeq, StrSeq; }; @@ -106,12 +106,12 @@ module Sequence module StructTest { struct S; - + struct S { long m; // Struct cannot be empty. }; - + }; // Typeid @@ -120,7 +120,7 @@ module StructTest module TypeidTest { interface I; - + typeid I "Foo"; typeprefix TypeidTest "Bar"; }; @@ -133,7 +133,7 @@ module TypeidTest module TypedefTest { interface I; - + typedef I J; interface I diff --git a/TAO/CIAO/CCF/Test/IDL2/LexicalAnalyzer/Coverage.idl b/TAO/CIAO/CCF/Test/IDL2/LexicalAnalyzer/Coverage.idl index dc1aa225336..a29dde465d2 100644 --- a/TAO/CIAO/CCF/Test/IDL2/LexicalAnalyzer/Coverage.idl +++ b/TAO/CIAO/CCF/Test/IDL2/LexicalAnalyzer/Coverage.idl @@ -2,7 +2,7 @@ // author : Boris Kolpackov // cvs-id : $Id$ -// This file is supposed to cover an IDL2 lexical structure and intended +// This file is supposed to cover an IDL2 lexical structure and intended // for IDL2 lexer regression testing. // diff --git a/TAO/CIAO/CCF/Test/IDL3/Compiler/GeneratorImpl.hpp b/TAO/CIAO/CCF/Test/IDL3/Compiler/GeneratorImpl.hpp index 5125e62d580..91e3ab3cb49 100644 --- a/TAO/CIAO/CCF/Test/IDL3/Compiler/GeneratorImpl.hpp +++ b/TAO/CIAO/CCF/Test/IDL3/Compiler/GeneratorImpl.hpp @@ -516,9 +516,9 @@ namespace IDL3 concrete_event_type.edge_traverser (inherits); //-- - + supports.node_traverser (type_name); - + component_defines.node_traverser (attribute); component_defines.node_traverser (provider); component_defines.node_traverser (user); diff --git a/TAO/CIAO/CCF/Test/IDL3/Compiler/test.idl b/TAO/CIAO/CCF/Test/IDL3/Compiler/test.idl index e85e86a610d..a7e1cfb1d5a 100644 --- a/TAO/CIAO/CCF/Test/IDL3/Compiler/test.idl +++ b/TAO/CIAO/CCF/Test/IDL3/Compiler/test.idl @@ -21,7 +21,7 @@ module ComponentTest interface J { }; - + component A : B supports I, J { }; @@ -83,11 +83,11 @@ module HomeTest interface J { }; - + component A { }; - + home AH manages A { }; @@ -103,14 +103,14 @@ module HomeTest // HomeFactory -// +// // module HomeFactoryTest { component A { }; - + home AH manages A { factory new (in long size); @@ -126,7 +126,7 @@ module ProvidesTest interface I { }; - + component C { provides I i; @@ -158,7 +158,7 @@ module UsesTest interface I { }; - + component C { uses I i; diff --git a/TAO/CIAO/CIAO-INSTALL.html b/TAO/CIAO/CIAO-INSTALL.html index ce66f61fb5f..9b98f798491 100644 --- a/TAO/CIAO/CIAO-INSTALL.html +++ b/TAO/CIAO/CIAO-INSTALL.html @@ -6,15 +6,15 @@

Building and Installing CIAO

-

The first thing you should do to install CIAO is to set the environment - variable CIAO_ROOT to be $TAO_ROOT/CIAO. Please refer +

The first thing you should do to install CIAO is to set the environment + variable CIAO_ROOT to be $TAO_ROOT/CIAO. Please refer to the ACE installation notes and - TAO installation notes for instructions on setting $ACE_ROOT - and $TAO_ROOT, respectively. They are needed since CIAO sits on - top of ACE+TAO. Compiling ACE+TAO successfully is the first requirement + TAO installation notes for instructions on setting $ACE_ROOT + and $TAO_ROOT, respectively. They are needed since CIAO sits on + top of ACE+TAO. Compiling ACE+TAO successfully is the first requirement for compiling CIAO.

-

CIAO is divided into several parts, so different installation/building rules +

CIAO is divided into several parts, so different installation/building rules apply to different parts of CIAO.

@@ -25,11 +25,11 @@
  • CIDL Compiler: This part of CIAO include $CIAO_ROOT/CCF and $CIAO_ROOT/CIDLC.
  • - CIAO Deployment and Configuration Framework: This part of CIAO includes all the - directories in $CIAO_ROOT/DAnCE. DAnCE is an implementation of the - new Deployment and - Configuration specification. We refer, henceforth, to all pieces as CIAO - in general. The above two pieces will be referred specifically by their names + CIAO Deployment and Configuration Framework: This part of CIAO includes all the + directories in $CIAO_ROOT/DAnCE. DAnCE is an implementation of the + new Deployment and + Configuration specification. We refer, henceforth, to all pieces as CIAO + in general. The above two pieces will be referred specifically by their names as CIDLC and DAnCE though they are part of CIAO.
  • @@ -53,31 +53,31 @@ - Binaries available intermittently, + Binaries available intermittently, no automatic builds or tests MacOS, Solaris -

    If you have porting questions or - have a problem compiling CIAO with TAO and ACE on the platforms shown above - please send email to either ACE Newsgroup or - the CIAO mailing list and we'll - try to help you fix the problems. You can also submit bug reports and - enhancement requests in our bug tracking +

    If you have porting questions or + have a problem compiling CIAO with TAO and ACE on the platforms shown above + please send email to either ACE Newsgroup or + the CIAO mailing list and we'll + try to help you fix the problems. You can also submit bug reports and + enhancement requests in our bug tracking system.

    CIAO can be obtained electronically - via the WWW and ftp. CIAO is - bundled with the ACE and TAO release. You'll always need the most recent + via the WWW and ftp. CIAO is + bundled with the ACE and TAO release. You'll always need the most recent version of ACE and TAO because CIAO tracks changes to ACE and TAO very closely.


    Install CIDL Compiler

    We suggest you download the prebuilt binary cidlc(exe) from - here or, if you + here or, if you are using Windows or Linux, you can build it by yourself.

    MPC is used to build the CIDL compiler on @@ -93,14 +93,14 @@

  • Make sure you set cidl=1, boost=1, and exceptions=1 in $ACE_ROOT/include/makeinclude/platfrom_macros.GNU.
  • - Install boost_filesystem, boost_regex and Utility + Install boost_filesystem, boost_regex and Utility Library. For how to do that please see Build.html.
  • In $CIAO_ROOT/CIDLC run $ACE_ROOT/bin/mwc.pl CIDLC.mwc
  • In $CIAO_ROOT/CIDLC run make.
    - Note: The linking time is a bit long (more than 5 Minutes with an Intel XEON + Note: The linking time is a bit long (more than 5 Minutes with an Intel XEON 1.90GHZ CPU, please be patient).
  • @@ -109,30 +109,30 @@
    1. Use the provided Visual Studio solution/project file. For detail please see - Build.html. Since MPC is now supported to build the CIDL compiler on + Build.html. Since MPC is now supported to build the CIDL compiler on Windows, these solution/project files may be removed in the future.
    2. Use MPC. The procedure is outlined below.
      • If you have not created it already, create the file %ACE_ROOT%/bin/MakeProjectCreator/config/default.features - and add cidl=1 and boost=1 to it, each on its own - line. An easy way to do this is to copy the file global.features (in the + and add cidl=1 and boost=1 to it, each on its own + line. An easy way to do this is to copy the file global.features (in the same directory) as default.features - and modify the appropriate lines in the new file, leaving everything else the + and modify the appropriate lines in the new file, leaving everything else the same.
      • Install the Boost - libraries on your machine. For Windows, you can download either the - Windows-specific .exe file or the platform-independent .zip file. Use version - 1.32.0 or later. The accompanying documentation on how to build and install + libraries on your machine. For Windows, you can download either the + Windows-specific .exe file or the platform-independent .zip file. Use version + 1.32.0 or later. The accompanying documentation on how to build and install Boost is pretty straightforward.
      • Set the following environment variables:
        • ACE_ROOT - - [path ending with ACE_wrappers directory] (this should already be + - [path ending with ACE_wrappers directory] (this should already be set if you're using CIAO)
        • BOOST_CFG - _vc7_mdsd @@ -140,18 +140,18 @@ BOOST_ROOT - [path ending with Boost directory]
        • - BOOST_VERSION - [name of the directory under %BOOST_ROOT%\include, + BOOST_VERSION - [name of the directory under %BOOST_ROOT%\include, for ex. boost-1_32, for Boost vesrion 1.32.0]
        • UTILITY_ROOT - %ACE_ROOT%\contrib\utility
      • - In %CIAO_ROOT%\CIDLC run %ACE_ROOT%\bin\mwc.pl -type vc71 + In %CIAO_ROOT%\CIDLC run %ACE_ROOT%\bin\mwc.pl -type vc71 CIDLC.mwc
      • - Open CIDLC.sln and build as usual. Within the solution, the CIDLC - project is the top-level one, which depends on all the other projects, and + Open CIDLC.sln and build as usual. Within the solution, the CIDLC + project is the top-level one, which depends on all the other projects, and produces cidlc.exe in %CIAO_ROOT%\bin.
      @@ -160,43 +160,43 @@

      Obtaining and Installing Xerces-C

      -

      The Xerces-C XML parsing library is a necessary component to build parts of - DAnCE that need to process XML based descriptor files, which include the Plan - Launcher and the Repository Manager. Currently, the only Xerces-C +

      The Xerces-C XML parsing library is a necessary component to build parts of + DAnCE that need to process XML based descriptor files, which include the Plan + Launcher and the Repository Manager. Currently, the only Xerces-C version supported by the DOC group is version 2.6 or later. Earlier versions of the Xerces-C library may work.

      Building Xerces-C

      -

      You may check here to - see if there is a prebuilt binary available for your platform. Otherwise, you +

      You may check here to + see if there is a prebuilt binary available for your platform. Otherwise, you will have to obtain the source from the - Xerces-C webpage and build it. Building Xerces-C is fairly + Xerces-C webpage and build it. Building Xerces-C is fairly straightfoward. Please see the documentation available here for instructions particular to your platform.

      • - NOTE: Some of the provided projects with Xerces-C attach - inconsistant library decorators onto the end of the Xerces-C libraries. The MPC - build tool will expect these libraries to be named xerces-c for non debug + NOTE: Some of the provided projects with Xerces-C attach + inconsistant library decorators onto the end of the Xerces-C libraries. The MPC + build tool will expect these libraries to be named xerces-c for non debug versions, and xerces-cd for debug versions.

      Xerces-C Environment Settings

      -

      If the Xerces includes and libraries are in your system include and library - paths, respectively, then you need not set up any environment and may proceed - to the next step. If not, you will need to set an environment variable named - XERCESCROOT to a path such that $XERCESCROOT/include points to the includes and - $XERCESCROOT/lib points to the libraries. Also make sure that $XERCESCROOT/lib - is in the appropriate environment variable that your platform uses to search +

      If the Xerces includes and libraries are in your system include and library + paths, respectively, then you need not set up any environment and may proceed + to the next step. If not, you will need to set an environment variable named + XERCESCROOT to a path such that $XERCESCROOT/include points to the includes and + $XERCESCROOT/lib points to the libraries. Also make sure that $XERCESCROOT/lib + is in the appropriate environment variable that your platform uses to search for dynamically linked libraries.


      Install CIAO core/tools/examples

      -

      Most of the GNUmakefiles/project files/solution files required to build CIAO - are available in the release. If you don't like the configurations used, please +

      Most of the GNUmakefiles/project files/solution files required to build CIAO + are available in the release. If you don't like the configurations used, please feel free to regenerate them using MPC. Please see this for more details.

      @@ -208,7 +208,7 @@
    3. Make sure you have the Xerces-C libraries installed/built
    4. - Make sure all ACE/TAO/etc. generated libs are in $ACE_ROOT/lib. To + Make sure all ACE/TAO/etc. generated libs are in $ACE_ROOT/lib. To build CIAO you will need:
      • @@ -237,7 +237,7 @@

        For the supported build tools please see MPC manual.

        -

        You have to execute the MPC command in the following directories if you only +

        You have to execute the MPC command in the following directories if you only want to build the examples and have a peek at CIAO:

          @@ -245,7 +245,7 @@ $CIAO_ROOT/DAnCE/
        -

        On Linux: do $ACE_ROOT/bin/mwc.pl at the +

        On Linux: do $ACE_ROOT/bin/mwc.pl at the locations specified above then make.

        On Windows/VC6: do %ACE_ROOT%/bin/mwc.pl -type vc6 @@ -255,14 +255,14 @@ at the locations specified above then Open the solution file and build.

        Note: You can run mwc.pl at $CIAO_ROOT - as long as you don't intend to build CIDL compiler with MPC. If this is the - case(default), you can run the mwc.pl command with proper augment once then you - can do make at $CIAO_ROOT (Linux) or open the + as long as you don't intend to build CIDL compiler with MPC. If this is the + case(default), you can run the mwc.pl command with proper augment once then you + can do make at $CIAO_ROOT (Linux) or open the workspace/solution file at $CIAO_ROOT (Windows) to build.

    - Building CIAO quickly : You can build CIAO quickly by doing + Building CIAO quickly : You can build CIAO quickly by doing the following:
    • @@ -276,12 +276,12 @@
    • Type 'make'
    • - This will build all the required ACE+TAO libraries including CIAO libraries and + This will build all the required ACE+TAO libraries including CIAO libraries and tools.

    -

    Back to the CIAO home +

    Back to the CIAO home page.

    diff --git a/TAO/CIAO/CIDLC/DescriptorGenerator.cpp b/TAO/CIAO/CIDLC/DescriptorGenerator.cpp index 7b5b41933c2..740df3eda19 100644 --- a/TAO/CIAO/CIDLC/DescriptorGenerator.cpp +++ b/TAO/CIAO/CIDLC/DescriptorGenerator.cpp @@ -56,7 +56,7 @@ namespace virtual void traverse (Type& c) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; @@ -72,7 +72,7 @@ namespace virtual void traverse (Type& h) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; @@ -90,7 +90,7 @@ namespace { os << " (STRS[REPO_ID]) << "\">" << endl; @@ -116,7 +116,7 @@ namespace virtual void traverse (Type& h) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; @@ -135,7 +135,7 @@ namespace { os << " (STRS[REPO_ID]) << "\">" << endl; @@ -175,7 +175,7 @@ namespace virtual void traverse (Type& c) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; @@ -191,7 +191,7 @@ namespace virtual void traverse (Type& i) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; @@ -294,7 +294,7 @@ namespace virtual void traverse (SemanticGraph::Type& t) { - os << '\"' + os << '\"' << t.context ().get (STRS[REPO_ID]) << '\"'; } @@ -328,7 +328,7 @@ namespace os << " (STRS[REPO_ID]) << "\">" << endl; @@ -354,7 +354,7 @@ namespace virtual void traverse (Type& i) { - os << " (STRS[REPO_ID]) << "\"/>" << endl; } diff --git a/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.hpp b/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.hpp index 9ebe0cd300c..0cc8127cc76 100644 --- a/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.hpp +++ b/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.hpp @@ -19,7 +19,7 @@ public: CommandLine const& cl, string export_macro, fs::path const& file); - + virtual ~ExecImplHeaderEmitter () {} virtual void diff --git a/TAO/CIAO/CIDLC/ExecImplSourceGenerator.hpp b/TAO/CIAO/CIDLC/ExecImplSourceGenerator.hpp index efac70d2543..bf70a53870a 100644 --- a/TAO/CIAO/CIDLC/ExecImplSourceGenerator.hpp +++ b/TAO/CIAO/CIDLC/ExecImplSourceGenerator.hpp @@ -19,7 +19,7 @@ public: CommandLine const& cl, string export_macro, fs::path const& file); - + virtual ~ExecImplSourceEmitter () {} virtual void diff --git a/TAO/CIAO/CIDLC/RepositoryIdGenerator.cpp b/TAO/CIAO/CIDLC/RepositoryIdGenerator.cpp index 073aa844f77..f3915422cde 100644 --- a/TAO/CIAO/CIDLC/RepositoryIdGenerator.cpp +++ b/TAO/CIAO/CIDLC/RepositoryIdGenerator.cpp @@ -38,7 +38,7 @@ namespace return 0; } - + void compute_new_repo_id (Nameable& d) { @@ -177,7 +177,7 @@ namespace { SemanticGraph::TypePrefix* prev = ctx.get (STRS[TYPE_PREFIX]); - + if (prev->prefix () != tp.prefix ()) { //@@ Seems tp should contain filename and line @@ -200,7 +200,7 @@ namespace else { decl->context ().set (STRS[TYPE_PREFIX], &tp); - + // A typeprefix declaration could appear after the IDL // type declaration, so we want to update the repo id // every time. @@ -213,7 +213,7 @@ namespace Diagnostic::Stream& dout_; SemanticGraph::TranslationUnit& tu_; }; - + class RepoIdGenerator : public Traversal::Interface, public Traversal::EventType, public Traversal::Home, @@ -224,19 +224,19 @@ namespace { compute_repo_id (i); } - + virtual void traverse (SemanticGraph::EventType& e) { compute_repo_id (e); } - + virtual void traverse (SemanticGraph::Home& h) { compute_repo_id (h); } - + virtual void traverse (SemanticGraph::Component& c) { @@ -264,11 +264,11 @@ bool RepositoryIdGenerator::generate (TranslationUnit& u) Traversal::ContainsRoot contains_root; Traversal::Includes includes; - + region.edge_traverser (includes); region.edge_traverser (contains_root); - - Traversal::Root root; + + Traversal::Root root; includes.node_traverser (region); contains_root.node_traverser (root); @@ -276,17 +276,17 @@ bool RepositoryIdGenerator::generate (TranslationUnit& u) root.edge_traverser (defines); Traversal::Module module; - + defines.node_traverser (module); defines.node_traverser (type_id); defines.node_traverser (type_prefix); defines.node_traverser (repo_id); - + module.edge_traverser (defines); - + Traversal::Interface iface; defines.node_traverser (iface); - + unit.traverse (u); if (dout.error_count () != 0) return false; diff --git a/TAO/CIAO/CIDLC/ServantHeaderGenerator.hpp b/TAO/CIAO/CIDLC/ServantHeaderGenerator.hpp index 47fc1acf369..b81625b6b80 100644 --- a/TAO/CIAO/CIDLC/ServantHeaderGenerator.hpp +++ b/TAO/CIAO/CIDLC/ServantHeaderGenerator.hpp @@ -20,7 +20,7 @@ public: CommandLine const& cl, std::string export_macro, fs::path const& file); - + virtual ~ServantHeaderEmitter () {} virtual void diff --git a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp index c389eade22e..a83c7673f4f 100644 --- a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp +++ b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp @@ -24,41 +24,41 @@ namespace Context (std::ostream& os, string export_macro, CommandLine const& cl) - : os_ (os), - export_macro_ (export_macro), - cl_ (cl) + : os_ (os), + export_macro_ (export_macro), + cl_ (cl) { } - std::ostream& - os () - { - return os_; - } + std::ostream& + os () + { + return os_; + } - string - export_macro () - { - return export_macro_; - } + string + export_macro () + { + return export_macro_; + } - CommandLine const& - cl () - { - return cl_; - } + CommandLine const& + cl () + { + return cl_; + } - string - composition_name () - { - return composition_name_; - } + string + composition_name () + { + return composition_name_; + } - void - composition_name (const string& name) - { - composition_name_ = name; - } + void + composition_name (const string& name) + { + composition_name_ = name; + } private: std::ostream& os_; @@ -280,13 +280,13 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");"; + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");"; - Traversal::Operation::returns (o, ace_check_returns_); + Traversal::Operation::returns (o, ace_check_returns_); - os << endl; - } + os << endl; + } } virtual void @@ -439,9 +439,9 @@ namespace traverse (Interface& i) { if (add (i)) - { - Traversal::Interface::traverse (i); - } + { + Traversal::Interface::traverse (i); + } } private: @@ -451,7 +451,7 @@ namespace // Generates the set operation of a ReadWriteAttribute. template struct WriteAttributeEmitter : Traversal::ReadWriteAttribute, - EmitterBase + EmitterBase { WriteAttributeEmitter (Context& c, T& scope, bool swapping) : EmitterBase (c), @@ -520,9 +520,9 @@ namespace os << "{"; if (swapping_) - { - this->gen_swapping_set (); - } + { + this->gen_swapping_set (); + } os << "this->executor_->" << a.name () << " (" << endl << a.name () << endl @@ -550,8 +550,8 @@ namespace // Generates operations associated with attributes. template struct AttributeEmitter : Traversal::ReadAttribute, - Traversal::ReadWriteAttribute, - EmitterBase + Traversal::ReadWriteAttribute, + EmitterBase { AttributeEmitter (Context& c, T& scope) : EmitterBase (c), @@ -640,9 +640,9 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - this->gen_swapping_get (a); - } + { + this->gen_swapping_get (a); + } os << "return this->executor_->" << a.name () << " (" << endl << STRS[ENV_SNGL_ARG] << ");" << endl @@ -719,9 +719,9 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - this->gen_swapping_get (a); - } + { + this->gen_swapping_get (a); + } os << "return this->executor_->" << a.name () << " (" << endl << STRS[ENV_SNGL_ARG] << ");" << endl @@ -750,7 +750,7 @@ namespace // @@@ (JP) Need to support exceptions. template struct ReadOnlyAttributeEmitter : Traversal::ReadAttribute, - EmitterBase + EmitterBase { ReadOnlyAttributeEmitter (Context& c, T& scope) @@ -803,9 +803,9 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - this->gen_swapping_get (a); - } + { + this->gen_swapping_get (a); + } os << "return this->executor_->" << a.name () << " (" << endl << STRS[ENV_SNGL_ARG] << ");" << endl @@ -1068,13 +1068,13 @@ namespace : EmitterBase (c) {} - // Nested classes used by ContextEmitter. + // Nested classes used by ContextEmitter. private: struct ContextPortsEmitter : Traversal::SingleUserData, - Traversal::MultiUserData, - Traversal::PublisherData, - Traversal::EmitterData, - EmitterBase + Traversal::MultiUserData, + Traversal::PublisherData, + Traversal::EmitterData, + EmitterBase { ContextPortsEmitter (Context& c, SemanticGraph::Component& scope) : EmitterBase (c), @@ -1684,14 +1684,14 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << "," << endl - << " ug_ctx_svnt_base (h, c, sv)" << endl; - } + { + os << "," << endl + << " ug_ctx_svnt_base (h, c, sv)" << endl; + } else - { - os << endl; - } + { + os << endl; + } os << "{" << "}"; @@ -1726,55 +1726,55 @@ namespace // Extra *_Context methods for swapping container. if (swapping) - { - os << "// Operations defined in " << t.scoped_name ().scope_name () - << "::CCM_" << t.name () << "_Context" << endl - << "// that enable component swapping in the container" - << endl << endl; - - os << STRS[COMP_CD] << " *" << endl - << t.name () << "_Context::get_registered_consumers (" << endl - << "const char *publisher_name" << endl - << STRS[ENV_SRC] << ")" << endl - << STRS[EXCP_START] << endl - << STRS[EXCP_SYS] << "," << endl - << STRS[EXCP_IN] << "," << endl - << STRS[EXCP_IC] << "))" << endl - << "{" - << "if (publisher_name == 0)" << endl - << "{" - << STRS[ACE_TR] << " (" << STRS[EXCP_IN] << " (), 0);" - << "}" - << STRS[COMP_CD] << " *tmp = 0;" - << STRS[COMP_CD] << "_var retval;" - << "CORBA::ULong _ciao_index = 0;" - << "CORBA::ULong _ciao_size = 0;" - << STRS[ACE_UA] << " (tmp);" - << STRS[ACE_UA] << " (retval);" - << STRS[ACE_UA] << " (_ciao_index);" - << STRS[ACE_UA] << " (_ciao_size);" << endl; - - // Generate IF block for each event sources. { - Traversal::Component component_emitter; - - Traversal::Inherits inherits; - inherits.node_traverser (component_emitter); - - Traversal::Defines defines; - component_emitter.edge_traverser (defines); - component_emitter.edge_traverser (inherits); - - SwappableGetConsumersEmitter get_consumers_emitter (ctx); - defines.node_traverser (get_consumers_emitter); - - component_emitter.traverse (t); + os << "// Operations defined in " << t.scoped_name ().scope_name () + << "::CCM_" << t.name () << "_Context" << endl + << "// that enable component swapping in the container" + << endl << endl; + + os << STRS[COMP_CD] << " *" << endl + << t.name () << "_Context::get_registered_consumers (" << endl + << "const char *publisher_name" << endl + << STRS[ENV_SRC] << ")" << endl + << STRS[EXCP_START] << endl + << STRS[EXCP_SYS] << "," << endl + << STRS[EXCP_IN] << "," << endl + << STRS[EXCP_IC] << "))" << endl + << "{" + << "if (publisher_name == 0)" << endl + << "{" + << STRS[ACE_TR] << " (" << STRS[EXCP_IN] << " (), 0);" + << "}" + << STRS[COMP_CD] << " *tmp = 0;" + << STRS[COMP_CD] << "_var retval;" + << "CORBA::ULong _ciao_index = 0;" + << "CORBA::ULong _ciao_size = 0;" + << STRS[ACE_UA] << " (tmp);" + << STRS[ACE_UA] << " (retval);" + << STRS[ACE_UA] << " (_ciao_index);" + << STRS[ACE_UA] << " (_ciao_size);" << endl; + + // Generate IF block for each event sources. + { + Traversal::Component component_emitter; + + Traversal::Inherits inherits; + inherits.node_traverser (component_emitter); + + Traversal::Defines defines; + component_emitter.edge_traverser (defines); + component_emitter.edge_traverser (inherits); + + SwappableGetConsumersEmitter get_consumers_emitter (ctx); + defines.node_traverser (get_consumers_emitter); + + component_emitter.traverse (t); + } + + os << STRS[ACE_TR] << " (" << STRS[EXCP_IN] << " (), 0);" + << "}"; } - os << STRS[ACE_TR] << " (" << STRS[EXCP_IN] << " (), 0);" - << "}"; - } - os << "// CIAO-specific." << endl << endl; os << t.name () << "_Context *" << endl @@ -1794,10 +1794,10 @@ namespace : EmitterBase (c) {} - // Nested classes used by ServantEmitter. + // Nested classes used by ServantEmitter. private: struct NavigationEmitsEmitter : Traversal::EmitterData, - EmitterBase + EmitterBase { NavigationEmitsEmitter (Context& c) : EmitterBase (c), @@ -1892,10 +1892,10 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (0);" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (0);" << endl; + } os << "return this->context_->subscribe_" << p.name () << " (" << endl @@ -1914,10 +1914,10 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (0);" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (0);" << endl; + } os << "return this->context_->subscribe_" << p.name () << "_generic (" << endl @@ -1938,14 +1938,14 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " ("; + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " ("; - Traversal::PublisherData::belongs (p, belongs_); + Traversal::PublisherData::belongs (p, belongs_); - os << "Consumer::_nil ());" << endl; - } + os << "Consumer::_nil ());" << endl; + } os << "return this->context_->unsubscribe_" << p.name () << " (" << endl @@ -2103,6 +2103,8 @@ namespace << endl << "c" << endl << STRS[ENV_ARG] << ");" << endl + << "this->add_receptacle (\"" << u.name () + << "\", c, 0);" << endl << "}"; Traversal::SingleUserData::belongs (u, belongs_); @@ -2151,10 +2153,14 @@ namespace << STRS[EXCP_ECL] << "," << endl << STRS[EXCP_IC] << "))" << endl << "{" - << "return this->context_->connect_" << u.name () << " (" + << "::Components::Cookie * cookie = " + "this->context_->connect_" << u.name () << " (" << endl << "c" << endl << STRS[ENV_ARG] << ");" << endl + << "this->add_receptacle (\"" << u.name () + << "\", c, cookie);" << endl + << "return cookie;" << endl << "}"; Traversal::MultiUserData::belongs (u, belongs_); @@ -2384,14 +2390,14 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " ("; + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " ("; - Traversal::ProviderData::belongs (p, belongs_); + Traversal::ProviderData::belongs (p, belongs_); - os << "::_nil ());" << endl; - } + os << "::_nil ());" << endl; + } os << "if (! ::CORBA::is_nil (this->provide_" << p.name () << "_.in ()))" << endl @@ -2899,7 +2905,7 @@ namespace os << "return ecb._retn ();" << endl << "}"; - } + } private: TypeNameEmitter type_name_emitter_; @@ -2976,29 +2982,29 @@ namespace } if (gen_factory_) - { - os << "CIAO_REGISTER_OBV_FACTORY (" << endl; + { + os << "CIAO_REGISTER_OBV_FACTORY (" << endl; - Traversal::ConsumerData::belongs (c, belongs_); + Traversal::ConsumerData::belongs (c, belongs_); - os << "_init," << endl; + os << "_init," << endl; - Traversal::ConsumerData::belongs (c, belongs_); + Traversal::ConsumerData::belongs (c, belongs_); - os << ");" << endl; - } + os << ");" << endl; + } else - { - cerr << " " << endl - << "event type "; + { + cerr << " " << endl + << "event type "; - Traversal::ConsumerData::belongs (c, cerr_belongs_); + Traversal::ConsumerData::belongs (c, cerr_belongs_); - cerr << " consumed by " << c.scoped_name () << endl - << "has an operation, factory declaration," - << " or private member. " - << "ORB registration of default factory not generated" << endl; - } + cerr << " consumed by " << c.scoped_name () << endl + << "has an operation, factory declaration," + << " or private member. " + << "ORB registration of default factory not generated" << endl; + } } private: @@ -3163,24 +3169,29 @@ namespace << "this->context_," << endl << t.name () << "_Context (h, c, this));" << endl; + os << "// Set the instance id of the component on the context" << endl + << endl + << "this->context_->_ciao_instance_id (this->ins_name_);" << endl; + + // Generate the macro to register a value factory for each // eventtype consumed. if (!ctx.cl ().get_value ("suppress-register-factory", false)) - { - Traversal::Component component_emitter; + { + Traversal::Component component_emitter; - Traversal::Inherits inherits; - inherits.node_traverser (component_emitter); + Traversal::Inherits inherits; + inherits.node_traverser (component_emitter); - Traversal::Defines defines; - component_emitter.edge_traverser (defines); - component_emitter.edge_traverser (inherits); + Traversal::Defines defines; + component_emitter.edge_traverser (defines); + component_emitter.edge_traverser (inherits); - RegisterValueFactoryEmitter factory_emitter (ctx); - defines.node_traverser (factory_emitter); + RegisterValueFactoryEmitter factory_emitter (ctx); + defines.node_traverser (factory_emitter); - component_emitter.traverse (t); - } + component_emitter.traverse (t); + } os << "ACE_TRY_NEW_ENV" << endl << "{" @@ -3224,10 +3235,10 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << "ACE_CHECK;" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << "ACE_CHECK;" << endl; + } os << "for (CORBA::ULong i = 0; i < descr.length (); ++i)" << endl << "{" @@ -3323,10 +3334,10 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (0);" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (0);" << endl; + } os << "// If the component has no receptacles, this will be unused." << endl @@ -3371,10 +3382,10 @@ namespace << STRS[ACE_UA] << " (ck);" << endl; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (CORBA::Object::_nil ());" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (CORBA::Object::_nil ());" << endl; + } os << "if (name == 0)" << endl << "{" @@ -3436,10 +3447,10 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << "ACE_CHECK;" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << "ACE_CHECK;" << endl; + } os << "if (emitter_name == 0)" << endl << "{" @@ -3481,10 +3492,10 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (0);" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (0);" << endl; + } os << "// Just in case there are no if blocks" << endl << STRS[ACE_UA] << " (subscribe);" << endl @@ -3527,11 +3538,11 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (" << STRS[COMP_ECB] - << "::_nil ());" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (" << STRS[COMP_ECB] + << "::_nil ());" << endl; + } os << "// Just in case there are no if blocks" << endl << STRS[ACE_UA] << " (ck);" << endl @@ -3591,10 +3602,10 @@ namespace << "{"; if (swapping) - { - os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" - << STRS[ACE_CR] << " (CORBA::Object::_nil ());" << endl; - } + { + os << "this->activate_component (" << STRS[ENV_SNGL_ARG] << ");" + << STRS[ACE_CR] << " (CORBA::Object::_nil ());" << endl; + } os << "if (name == 0)" << endl << "{" @@ -3603,6 +3614,7 @@ namespace << "::CORBA::Object::_nil ());" << endl << "}"; + // Generate an IF block for each facet inside provide_facet(). { Traversal::Component component_emitter; @@ -3622,6 +3634,7 @@ namespace os << " return CORBA::Object::_nil ();" << "}"; + os << "// Supported operations." << endl << endl; // Generate operations for all supported interfaces. @@ -3746,7 +3759,7 @@ namespace flat_name_manages_.node_traverser (flat_name_emitter_); } - // Nested classes used by this emitter. + // Nested classes used by this emitter. private: struct HomeOpExecReturnEmitter : Traversal::Type { @@ -4067,15 +4080,15 @@ namespace bool swapping = (swap_option == "upgradeable"); if (swapping) - { - os << ", \"" << ctx.composition_name (); + { + os << ", \"" << ctx.composition_name (); - Traversal::Home::manages (t, flat_name_manages_); + Traversal::Home::manages (t, flat_name_manages_); - os << "\", "; + os << "\", "; - Traversal::Home::manages (t, repo_id_manages_); - } + Traversal::Home::manages (t, repo_id_manages_); + } os << ")" << endl << "{" @@ -4358,9 +4371,9 @@ ServantSourceEmitter::pre (TranslationUnit&) string file_name (""); if (! file_.empty ()) - { - file_name = file_.leaf (); - } + { + file_name = file_.leaf (); + } string file_suffix = cl_.get_value ("svnt-hdr-file-suffix", "_svnt.h"); @@ -4409,7 +4422,7 @@ ServantSourceEmitter::generate (TranslationUnit& u) //-- Traversal::Root root; -// includes.node_traverser (region); + // includes.node_traverser (region); contains_root.node_traverser (root); // Layer 3 diff --git a/TAO/CIAO/CIDLC/SizeTypeCalculator.cpp b/TAO/CIAO/CIDLC/SizeTypeCalculator.cpp index 015053b956b..b8f44e879ed 100644 --- a/TAO/CIAO/CIDLC/SizeTypeCalculator.cpp +++ b/TAO/CIAO/CIDLC/SizeTypeCalculator.cpp @@ -163,12 +163,12 @@ calculate (SemanticGraph::TranslationUnit& u) // Traversal::ContainsRoot contains_root; Traversal::Includes includes; - + region.edge_traverser (includes); region.edge_traverser (contains_root); - + //-- - Traversal::Root root; + Traversal::Root root; includes.node_traverser (region); contains_root.node_traverser (root); @@ -183,15 +183,15 @@ calculate (SemanticGraph::TranslationUnit& u) Traversal::UnconstrainedInterface uinterface; Traversal::ValueType vtype; Traversal::Home component_home; - + Calculator calculator; - + defines.node_traverser (module); defines.node_traverser (uinterface); defines.node_traverser (vtype); defines.node_traverser (component_home); defines.node_traverser (calculator); - + // Layer 4 // Traversal::Defines struct_defines; @@ -200,16 +200,16 @@ calculate (SemanticGraph::TranslationUnit& u) vtype.edge_traverser (defines); component_home.edge_traverser (defines); calculator.edge_traverser (struct_defines); - + //-- Traversal::Member member; struct_defines.node_traverser (member); - + // Layer 5 // Traversal::Belongs belongs; member.edge_traverser (belongs); - + //-- belongs.node_traverser (calculator); diff --git a/TAO/CIAO/CIDLC/TypeNameEmitter.cpp b/TAO/CIAO/CIDLC/TypeNameEmitter.cpp index ca45894b0ce..87d33058ada 100644 --- a/TAO/CIAO/CIDLC/TypeNameEmitter.cpp +++ b/TAO/CIAO/CIDLC/TypeNameEmitter.cpp @@ -315,9 +315,9 @@ ReturnTypeNameEmitter::traverse (SemanticGraph::Struct& s) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = s.context ().get (STRS[VAR_SIZE]); - + os << s.scoped_name (); - + if (var_size) { os << " *"; @@ -330,9 +330,9 @@ ReturnTypeNameEmitter::traverse (SemanticGraph::Union& u) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = u.context ().get (STRS[VAR_SIZE]); - + os << u.scoped_name (); - + if (var_size) { os << " *"; @@ -1081,7 +1081,7 @@ NullReturnEmitter::traverse (SemanticGraph::Struct& s) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = s.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << "return 0;"; @@ -1099,7 +1099,7 @@ NullReturnEmitter::traverse (SemanticGraph::Union& u) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = u.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << "return 0;"; @@ -1300,7 +1300,7 @@ AceCheckReturnEmitter::traverse (SemanticGraph::Struct& s) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = s.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << STRS[ACE_CR] << " (0);"; @@ -1319,7 +1319,7 @@ AceCheckReturnEmitter::traverse (SemanticGraph::Union& u) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = u.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << STRS[ACE_CR] << " (0);"; @@ -1518,7 +1518,7 @@ NullRHSEmitter::traverse (SemanticGraph::Struct& s) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = s.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << "= 0;"; @@ -1535,7 +1535,7 @@ NullRHSEmitter::traverse (SemanticGraph::Union& u) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = u.context ().get (STRS[VAR_SIZE]); - + if (var_size) { os << "= 0;"; @@ -1599,7 +1599,7 @@ void ExtractedTypeDeclEmitter::traverse (Boolean&) { os << "::CORBA::Boolean " << STRS[EXTRACT_TMP] << " = false;" - << "::CORBA::Any::to_boolean " << STRS[EXTRACT] + << "::CORBA::Any::to_boolean " << STRS[EXTRACT] << " (" << STRS[EXTRACT_TMP] << ");"; } @@ -1607,7 +1607,7 @@ void ExtractedTypeDeclEmitter::traverse (Octet&) { os << "::CORBA::Octet " << STRS[EXTRACT_TMP] << " = 0;" - << "::CORBA::Any::to_octet " << STRS[EXTRACT] + << "::CORBA::Any::to_octet " << STRS[EXTRACT] << " (" << STRS[EXTRACT_TMP] << ");"; } @@ -1615,7 +1615,7 @@ void ExtractedTypeDeclEmitter::traverse (Char&) { os << "::CORBA::Char " << STRS[EXTRACT_TMP] << " = 0;" - << "::CORBA::Any::to_char " << STRS[EXTRACT] + << "::CORBA::Any::to_char " << STRS[EXTRACT] << " (" << STRS[EXTRACT_TMP] << ");"; } @@ -1623,7 +1623,7 @@ void ExtractedTypeDeclEmitter::traverse (Wchar&) { os << "::CORBA::WChar " << STRS[EXTRACT_TMP] << " = 0;" - << "::CORBA::Any::to_wchar " << STRS[EXTRACT] + << "::CORBA::Any::to_wchar " << STRS[EXTRACT] << " (" << STRS[EXTRACT_TMP] << ");"; } @@ -1654,7 +1654,7 @@ ExtractedTypeDeclEmitter::traverse (UnsignedLong&) void ExtractedTypeDeclEmitter::traverse (LongLong&) { - os << "::CORBA::LongLong " << STRS[EXTRACT] + os << "::CORBA::LongLong " << STRS[EXTRACT] << " = ACE_CDR_LONGLONG_INITIALIZER;"; } @@ -1703,7 +1703,7 @@ ExtractedTypeDeclEmitter::traverse (SemanticGraph::BoundedWideString&) void ExtractedTypeDeclEmitter::traverse (Object&) { - os << "::CORBA::Object_ptr " << STRS[EXTRACT] + os << "::CORBA::Object_ptr " << STRS[EXTRACT] << " = ::CORBA::Object::_nil ();"; } @@ -1927,12 +1927,12 @@ AssignFromExtractedEmitter::traverse (SemanticGraph::Struct& s) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = s.context ().get (STRS[VAR_SIZE]); - + if (!var_size) { os << "*"; } - + os << STRS[EXTRACT]; } @@ -1942,12 +1942,12 @@ AssignFromExtractedEmitter::traverse (SemanticGraph::Union& u) // This should always be in the context, since the SizeTypeCalculator // is executed before the servant code generators. bool var_size = u.context ().get (STRS[VAR_SIZE]); - + if (!var_size) { os << "*"; } - + os << STRS[EXTRACT]; } @@ -2192,16 +2192,16 @@ void SetAttributeDelegationEmitter::emit_delegation (void) { open_if_block (); - + Traversal::ReadWriteAttribute::belongs (attr_, extract_belongs_); os << "descr_value >>= " << STRS[EXTRACT] << ";" << "this->" << attr_.name () << " ("; - + Traversal::ReadWriteAttribute::belongs (attr_, assign_belongs_); - + os << ");"; - + close_if_block (); } @@ -2209,13 +2209,13 @@ void SetAttributeDelegationEmitter::emit_error (const char *corba_kind) { open_if_block (); - + os << "ACE_ERROR ((" << endl << " LM_ERROR," << endl << " \"Component attributes of " << corba_kind << "\"" << endl << " \"IDL type are not yet supported by CIAO\\n\"" << endl << " ));"; - + close_if_block (); } diff --git a/TAO/CIAO/CIDLC/TypeNameEmitter.hpp b/TAO/CIAO/CIDLC/TypeNameEmitter.hpp index 9e3be6e5a40..7700520e86f 100644 --- a/TAO/CIAO/CIDLC/TypeNameEmitter.hpp +++ b/TAO/CIAO/CIDLC/TypeNameEmitter.hpp @@ -79,7 +79,7 @@ public: virtual void traverse (SemanticGraph::EventType&); virtual void traverse (SemanticGraph::Component&); virtual void traverse (SemanticGraph::Home&); - + protected: TypeNameEmitter (std::ostream&); @@ -380,7 +380,7 @@ class ExtractedTypeDeclEmitter : public TypeNameEmitter { public: ExtractedTypeDeclEmitter (std::ostream&); - + virtual void traverse (Boolean&); virtual void traverse (Octet&); virtual void traverse (Char&); @@ -420,7 +420,7 @@ class AssignFromExtractedEmitter : public TypeNameEmitter { public: AssignFromExtractedEmitter (std::ostream&); - + virtual void traverse (Boolean&); virtual void traverse (Octet&); virtual void traverse (Char&); @@ -459,7 +459,7 @@ class SetAttributeDelegationEmitter : public TypeNameEmitter, public: SetAttributeDelegationEmitter (std::ostream&, SemanticGraph::ReadWriteAttribute&); - + virtual void traverse (Boolean&); virtual void traverse (Octet&); virtual void traverse (Char&); @@ -490,13 +490,13 @@ public: virtual void traverse (SemanticGraph::EventType&); virtual void traverse (SemanticGraph::Component&); virtual void traverse (SemanticGraph::Home&); - -private: + +private: void emit_delegation (void); void emit_error (const char *); void open_if_block (void); void close_if_block (void); - + private: SemanticGraph::ReadWriteAttribute& attr_; AssignFromExtractedEmitter assign_emitter_; diff --git a/TAO/CIAO/CIDLC/Version b/TAO/CIAO/CIDLC/Version index 99d85ecdbb7..1750564f270 100644 --- a/TAO/CIAO/CIDLC/Version +++ b/TAO/CIAO/CIDLC/Version @@ -1 +1 @@ -0.0.6 \ No newline at end of file +0.0.6 diff --git a/TAO/CIAO/COPYING b/TAO/CIAO/COPYING index 348e67a580e..3217cd09562 100644 --- a/TAO/CIAO/COPYING +++ b/TAO/CIAO/COPYING @@ -1,9 +1,9 @@ _________________________________________________________________ - + Copyright and Licensing Information for ACE(TM), TAO(TM), CIAO(TM), and CoSMIC(TM) - + [1]ACE(TM), [2]TAO(TM), [3]CIAO(TM), and [4]CoSMIC(TM) (henceforth referred to as "DOC software") are copyrighted by [5]Douglas C. Schmidt and his [6]research group at [7]Washington University, @@ -15,7 +15,7 @@ and distribute modified versions of this software. You must, however, include this copyright statement along with code built using DOC software. - + You can use DOC software in commercial and/or binary software releases and are under no obligation to redistribute any of your source code that is built using DOC software. Note, however, that you may not do @@ -26,7 +26,7 @@ software in your software, though we encourage you to let [10]us know so we can promote your project in the [11]DOC software success stories. - + The [12]ACE, [13]TAO, [14]CIAO, and [15]CoSMIC web sites are maintained by the [16]DOC Group at the [17]Institute for Software Integrated Systems (ISIS) and the [18]Center for Distributed Object @@ -44,7 +44,7 @@ modification of such Submissions is entirely at the discretion of the moderators of the open-source DOC software projects or their designees. - + Submissions are provided by the submitter ``as is'' with no warranties whatsoever, including any warranty of merchantability, noninfringement of third party intellectual property, or fitness for any particular @@ -62,13 +62,13 @@ University, UC Irvine, or Vanderbilt University, their employees, or students be liable for any lost revenue or profits or other special, indirect and consequential damages. - + DOC software is provided with no support and without any obligation on the part of Washington University, UC Irvine, Vanderbilt University, their employees, or students to assist in its use, correction, modification, or enhancement. A [19]number of companies around the world provide commercial support for DOC software, however. - + DOC software is Y2K-compliant, as long as the underlying OS platform is Y2K-compliant. Likewise, DOC software is compliant with the new US daylight savings rule passed by Congress as "The Energy Policy Act of @@ -77,7 +77,7 @@ obtains time/date and calendaring information from operating systems users will not be affected by the new DST rules as long as they upgrade their operating systems accordingly. - + The names ACE(TM), TAO(TM), CIAO(TM), CoSMIC(TM), Washington University, UC Irvine, and Vanderbilt University, may not be used to endorse or promote products or services derived from this source @@ -88,13 +88,13 @@ Vanderbilt University appear in their names, without express written permission from Washington University, UC Irvine, and Vanderbilt University. - + If you have any suggestions, additions, comments, or questions, please let [20]me know. - + [21]Douglas C. Schmidt _________________________________________________________________ - + Back to the [22]ACE home page. References diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index d6ae4ef405a..9465042d8bb 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 13 13:43:19 UTC 2006 William R. Otte + + * First cut integration point. + Wed Feb 08 15:53:31 2006 Wallace Zhang * CIAO version 0.4.9 released. @@ -5,19 +9,19 @@ Wed Feb 08 15:53:31 2006 Wallace Zhang Tue Feb 7 16:10:10 UTC 2006 William Otte * DAnCE/NodeManager/NodeManager.mpc - + Fixed an ordering problem. Mon Feb 6 19:13:13 UTC 2006 William Otte * DAnCE/NodeApplicationManager/NodeApplicationManager.mpc - + Fixed an export problem manifesting in VC8. - + * performance-tests/Benchmark/Benchmark.mpc - + Added an empty IDL_Files section to the servant to prevent - nmake from regenerating from the IDL file. + nmake from regenerating from the IDL file. Mon Feb 6 13:54:39 UTC 2006 Ossama Othman diff --git a/TAO/CIAO/DAnCE/Deployment.xsd b/TAO/CIAO/DAnCE/Deployment.xsd index c8a6399730b..7743791b54e 100644 --- a/TAO/CIAO/DAnCE/Deployment.xsd +++ b/TAO/CIAO/DAnCE/Deployment.xsd @@ -10,7 +10,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -157,7 +157,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -233,7 +233,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -262,13 +262,13 @@ - + - + @@ -279,7 +279,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -353,7 +353,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -456,7 +456,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -480,7 +480,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -499,7 +499,7 @@ - + @@ -508,7 +508,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -542,7 +542,7 @@ - + @@ -558,7 +558,7 @@ - + @@ -568,7 +568,7 @@ - + @@ -581,7 +581,7 @@ - + @@ -595,7 +595,7 @@ - + @@ -604,7 +604,7 @@ - + @@ -613,7 +613,7 @@ - + @@ -626,7 +626,7 @@ - + @@ -636,7 +636,7 @@ - + @@ -646,7 +646,7 @@ - + @@ -656,7 +656,7 @@ - + @@ -665,7 +665,7 @@ - + @@ -673,7 +673,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -689,7 +689,7 @@ - + @@ -697,7 +697,7 @@ - + diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp index 394369b12c7..a7123da88b4 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp @@ -23,7 +23,7 @@ CIAO::Deployment_Configuration::init (const char *filename) if (filename == 0) { - ACE_ERROR ((LM_ERROR, "CIAO (%P|%t) Deployment_Configuration.cpp" + ACE_ERROR ((LM_ERROR, "DANCE (%P|%t) Deployment_Configuration.cpp" ": Unable to identify the file name \n")); return -1; } @@ -118,14 +118,25 @@ CIAO::Deployment_Configuration::get_node_manager (const char *name if (CORBA::is_nil (entry->int_id_.node_manager_.in ())) { - CORBA::Object_var temp = this->orb_->string_to_object - (entry->int_id_.IOR_.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + ACE_TRY + { - entry->int_id_.node_manager_ = - ::Deployment::NodeManager::_narrow (temp.in () - ACE_ENV_ARG_PARAMETER); + CORBA::Object_var temp = this->orb_->string_to_object + (entry->int_id_.IOR_.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + entry->int_id_.node_manager_ = + ::Deployment::NodeManager::_narrow (temp.in () + ACE_ENV_ARG_PARAMETER); + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "DANCE (%P|%t) Deployment_Configuration.cpp: " + "Error while contacting NodeManager %s\n", name)); + ACE_RE_THROW; + } + ACE_ENDTRY; ACE_CHECK_RETURN (0); } return ::Deployment::NodeManager::_duplicate diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc index ed69dfe37e9..263fb68e16e 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc @@ -6,7 +6,7 @@ project (DomainApplicationManager): ciao_deployment_svnt { after += ExecutionManager_stub dynamicflags = DOMAINAPPLICATIONMANAGER_BUILD_DLL - + Source_Files { DomainApplicationManager_Impl.cpp Deployment_Configuration.cpp diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 729c5eab0ac..26b4776290a 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -618,6 +618,12 @@ startLaunch (const ::Deployment::Properties & configProperty, this->synchronize_shared_components_with_node_managers (); } + ACE_CATCH (Deployment::StartError,ex) + { + ACE_DEBUG ((LM_DEBUG, "DAM_Impl:StartError: %s, %s\n", + ex.name.in (), + ex.reason.in ())); + } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, @@ -798,6 +804,12 @@ finishLaunch (CORBA::Boolean start, // Establish bindings on external/shared components of this deployment plan. this->post_finishLaunch (); } + ACE_CATCH (Deployment::StartError, ex) + { + ACE_ERROR ((LM_ERROR, "DAM_Impl::finishLaunch - StartError: %s, %s\n", + ex.name.in (), + ex.reason.in ())); + } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, @@ -1024,7 +1036,7 @@ get_outgoing_connections (const Deployment::DeploymentPlan &plan, connections.inout (), is_getting_all_connections, is_search_new_plan - ACE_ENV_ARG_PARAMETER)) + ACE_ENV_ARG_PARAMETER)) return 0; } return connections._retn (); @@ -1093,9 +1105,12 @@ get_outgoing_connections_i (const char * instname, ACE_CString port_name = curr_conn.internalEndpoint[index].portName.in (); - ACE_DEBUG ((LM_ERROR, "Looking: %s,%s \n", - name.c_str (), - port_name.c_str ())); + if (CIAO::debug_level () > 10) + { + ACE_DEBUG ((LM_ERROR, "Looking: %s,%s \n", + name.c_str (), + port_name.c_str ())); + } bool found = false; // Now we have to search in the received @@ -1115,7 +1130,6 @@ get_outgoing_connections_i (const char * instname, ACE_OS::strcmp (curr_rev_conn.portName.in (), port_name.c_str ()) == 0) { - //ACE_DEBUG ((LM_DEBUG, "step5\n")); retv.length (len+1); retv[len].instanceName = instname; retv[len].portName = endpoint.portName.in (); @@ -1277,6 +1291,10 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) CIAO_TRACE("CIAO::DomainApplicationManager_Impl::destroyApplication"); ACE_TRY { + // Passivate shared components also, which should delegate to EM to handle + this->passivate_shared_components (); + + // Passivate all components associated with the plan for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) { ACE_Hash_Map_Entry *entry = 0; @@ -1300,17 +1318,31 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) ("DomainApplicationManager_Impl::destroyApplication", error.c_str ())); } + ACE_DEBUG ((LM_DEBUG, "DAM_Impl: Invoking passivate on %s\n", + this->node_manager_names_[i].c_str ())); // Invoke ciao_passivate () operation on each cached NodeApplication object. ::Deployment::NodeApplication_ptr my_na = (entry->int_id_).node_application_.in (); my_na->ciao_passivate (); + } + + + // Remove all connections associated with the plan + for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) + { + ACE_DEBUG ((LM_DEBUG, "DAM:DA Second for loop %s\n", + this->node_manager_names_[i].c_str ())); + + ACE_Hash_Map_Entry *entry = 0; + + this->artifact_map_.find (this->node_manager_names_[i], entry); Deployment::Connections_var connections = this->get_outgoing_connections ( (entry->int_id_).child_plan_.in (), - true, // yes, get *all* the connections + true, // yes, get *all* the connections true, // yes, we search the current plan DomainApplicationManager_Impl::External_Connections ACE_ENV_ARG_PARAMETER); @@ -1332,35 +1364,36 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) if (this->is_shared_component (connections[j].instanceName.in ())) { // ask EM to remove the binding for us + ACE_CString inst_name = connections[j].instanceName.in (); CIAO::Component_Binding_Info * - binding = this->populate_binding_info ( - connections[j].instanceName.in ()); + binding = this->populate_binding_info (inst_name.c_str ()); this->execution_manager_->finalize_global_binding ( *binding, false); - // If this element is the last one in the sequence - if (j == connections->length () - 1) - { - connections->length (connections->length () - 1); - break; - } - - // otherwise, remove this element from the list - for (CORBA::ULong k = j; k < connections->length (); ++k) - { - connections[k] = connections [k + 1]; - connections->length (connections->length () - 1); - } + // Remove all the connections whose "source" component + // is this component instance from the list + this->purge_connections (connections, + inst_name.c_str ()); } } - entry->int_id_.node_application_->finishLaunch - (connections.in (), - true, // "true" ==> start the components - false // "false" => remove connections - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + if (connections->length () > 0) + { + entry->int_id_.node_application_->finishLaunch + (connections.in (), + true, // "true" ==> start the components + false // "false" => remove connections + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + } + + for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) + { + ACE_Hash_Map_Entry *entry = 0; + + this->artifact_map_.find (this->node_manager_names_[i], entry); // To invoke operations on NodeManagers is the way to go. @@ -1377,6 +1410,8 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) // to clean up all the NodeApplicationManagers associated with this deployment // plan (one NodeApplicationManager per Node per plan). + // We should again activate those shared components + this->activate_shared_components (); } ACE_CATCHANY { @@ -1614,3 +1649,105 @@ subtract_connections (const Deployment::Connections & left, } return retv._retn (); } + +void +CIAO::DomainApplicationManager_Impl:: +purge_connections (Deployment::Connections_var & connections, + const char * inst) +{ + CORBA::ULong total_len = connections->length (); + + for (CORBA::ULong i = 0; i < total_len; ++i) + { + bool found = false; + + // Remove all the connections whose "source" component + // name is + if (ACE_OS::strcmp (connections[i].instanceName.in (), + inst) == 0) + { + found = true; + + for (CORBA::ULong j = i; j < total_len - 1; ++j) + { + connections[j] = connections[j + 1]; + } + connections->length (total_len - 1); + } + + if (found) + this->purge_connections (connections, inst); + } +} + +void +CIAO::DomainApplicationManager_Impl:: +passivate_shared_components (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + ACE_TRY + { + // For each "external" component... + CORBA::ULong length = this->shared_->length (); + for (CORBA::ULong j = 0; j < length; ++j) + { + // Construct struct for the component + CIAO::Component_Binding_Info * + binding = this->populate_binding_info ( + this->shared_[j].name.in (), + this->shared_[j].plan_uuid.in ()); + + // Invoke on ExecutionManager + this->execution_manager_->passivate_shared_components ( + *binding); + + delete binding; + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "DomainApplicationManager_Impl::passivate_shared_components.\n"); + ACE_RE_THROW; + } + ACE_ENDTRY; + + ACE_CHECK; +} + +void +CIAO::DomainApplicationManager_Impl:: +activate_shared_components (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + ACE_TRY + { + // For each "external" component... + CORBA::ULong length = this->shared_->length (); + for (CORBA::ULong j = 0; j < length; ++j) + { + // Construct struct for the component + CIAO::Component_Binding_Info * + binding = this->populate_binding_info ( + this->shared_[j].name.in (), + this->shared_[j].plan_uuid.in ()); + + // Invoke on ExecutionManager + this->execution_manager_->activate_shared_components ( + *binding); + + delete binding; + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "DomainApplicationManager_Impl::activate_shared_components.\n"); + ACE_RE_THROW; + } + ACE_ENDTRY; + + ACE_CHECK; +} diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h index 837c6b4291d..f18e5b6206e 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h @@ -58,7 +58,7 @@ namespace CIAO // port objrefs of components within this plan enum Connection_Search_Type { - External_Connections, + External_Connections, Internal_Connections }; @@ -183,6 +183,15 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError)); + virtual void passivate_shared_components (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + virtual void activate_shared_components (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + /** * Starts the application. Raises the StartError exception if * starting the application fails. @@ -220,7 +229,7 @@ namespace CIAO // The input parameter is a *new_plan* which has the // same UUID of the existing running plan. - virtual void + virtual void perform_redeployment ( const Deployment::DeploymentPlan & plan ACE_ENV_ARG_DECL_WITH_DEFAULTS) @@ -256,12 +265,12 @@ namespace CIAO /** * Construct struct for the component instance. - * + * * @para name component instance name * @para child_uuid child plan uuid string */ CIAO::Component_Binding_Info * - populate_binding_info (const ACE_CString& name, + populate_binding_info (const ACE_CString& name, const ACE_CString& child_uuid); /** @@ -281,9 +290,9 @@ namespace CIAO void synchronize_shared_components_with_node_managers (void); /** - * A helper function to add a list of shared components into + * A helper function to add a list of shared components into * the cached shared component list. - * + * * @para shared A list of shared components to be added. */ void add_shared_components (const Deployment::ComponentPlans & shared); @@ -291,7 +300,7 @@ namespace CIAO /** * A private function to check whether a component is in the shared * component list. - * + * * @para name The name of a component instance. */ bool is_shared_component (const char * name); @@ -313,7 +322,7 @@ namespace CIAO bool is_getting_all_connections = true, bool is_search_new_plan = true, Connection_Search_Type t = Internal_Connections - ACE_ENV_ARG_DECL_WITH_DEFAULTS); + ACE_ENV_ARG_DECL_WITH_DEFAULTS); /// This is a helper function to find the connection for a component. bool @@ -321,7 +330,7 @@ namespace CIAO Deployment::Connections & retv, bool is_ReDAC, bool is_search_new_plan - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment::StartError)); /// Dump connections, a static method @@ -335,6 +344,10 @@ namespace CIAO subtract_connections (const Deployment::Connections & left, const Deployment::Connections & right); + void + purge_connections (Deployment::Connections_var & connections, + const char * inst); + protected: /// location of the Domainapplication CORBA::String_var domainapp_path_; diff --git a/TAO/CIAO/DAnCE/ExecutionManager/DAM_Map.h b/TAO/CIAO/DAnCE/ExecutionManager/DAM_Map.h index 2be163c6908..841bd1a437e 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/DAM_Map.h +++ b/TAO/CIAO/DAnCE/ExecutionManager/DAM_Map.h @@ -52,7 +52,7 @@ namespace CIAO get_dams (ACE_ENV_SINGLE_ARG_DECL); bool unbind_dam (const ACE_CString &str); - + size_t size (void); private: diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp index 2c62f431071..cfb3b55fc70 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp @@ -18,25 +18,30 @@ namespace CIAO { const char *ior_file_name_ = "executionManager.ior"; const char *init_file_name = "deployment.dat"; - - bool register_with_ns_ = 0; + const char *pid_file_name_ = 0; + static bool register_with_ns_ = false; + static bool write_to_ior_ = false; bool parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:m:i:n"); + ACE_Get_Opt get_opts (argc, argv, "o:m:i:n:p"); int c; while ((c = get_opts ()) != -1) switch (c) { case 'o': + write_to_ior_ = true; ior_file_name_ = get_opts.opt_arg (); break; case 'i': init_file_name = get_opts.opt_arg (); break; case 'n': - register_with_ns_ = 1; + register_with_ns_ = true; + break; + case 'p': + pid_file_name_ = get_opts.opt_arg (); break; case '?': // display help for use of the server. default: @@ -79,6 +84,23 @@ namespace CIAO return true; } + void + write_pid (void) + { + if (pid_file_name_ == 0) + return; + + FILE* pid_file = ACE_OS::fopen (pid_file_name_, "w"); + + if (pid_file) + { + ACE_OS::fprintf (pid_file, + "%i", + ACE_OS::getpid ()); + ACE_OS::fclose (pid_file); + } + } + bool register_with_ns (CORBA::ORB_ptr orb, CIAO::ExecutionManagerDaemon_ptr obj @@ -94,18 +116,23 @@ namespace CIAO CosNaming::NamingContext::_narrow (naming_context_object.in ()); // Initialize the Naming Sequence - CosNaming::Name name (2); - name.length (2); + CosNaming::Name name (1); + name.length (1); // String dup required for MSVC6 - name[0].id = CORBA::string_dup ("CIAO"); - name[1].id = CORBA::string_dup ("ExecutionManager"); + name[0].id = CORBA::string_dup ("ExecutionManager"); // Register the servant with the Naming Service - naming_context->bind (name, - obj - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (false); + try + { + // Register the servant with the Naming Service + naming_context->bind (name, obj); + } + catch (CosNaming::NamingContext::AlreadyBound &) + { + ACE_DEBUG ((LM_DEBUG, "Execution_Manager.cpp: Name already bound, rebinding....\n")); + naming_context->rebind (name, obj); + } return true; } @@ -141,9 +168,9 @@ namespace CIAO if (poa.in () == 0) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " + "(%P|%t) CIAO_ExecutionManager: " "Nil POA panic error, returning \n"), - -1); + -1); // Create and install the CIAO Daemon servant Execution_Manager_Impl *daemon_servant = 0; @@ -160,7 +187,7 @@ namespace CIAO daemon_servant->_this (); TAO::Utils::Implicit_Deactivator de (daemon_servant); - + ACE_TRY_CHECK; bool retval = false; @@ -173,7 +200,8 @@ namespace CIAO ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } - else + + if (write_to_ior_) { retval = write_ior_file (orb.in (), @@ -194,7 +222,7 @@ namespace CIAO ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) CIAO_ExecutionManager: " "Nil POA Manager error, returning \n"), - -1); + -1); mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -203,6 +231,8 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "CIAO_ExecutionManager is running...\n")); + write_pid (); + // Run the main event loop for the ORB. orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -239,5 +269,5 @@ int main (int argc, char *argv[]) { return CIAO::Execution_Manager::run_main (argc, - argv); + argv); } diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp index 4f9ce7f9405..06ba9fb8276 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp @@ -48,8 +48,15 @@ namespace CIAO // No need to create a new DAM. Hence pass the // reference that is already created. // - if (this->map_.is_plan_available (plan.UUID.in ())) + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) calling this->man_.is_plan_available()...\n")); + if (this->map_.is_plan_available (plan.UUID.in ())) { + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) Plan is already available; " + "calling this->man_.fetch_dam_reference()...\n")); + return this->map_.fetch_dam_reference (plan.UUID.in ()); + } + else + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) Plan wasn't already available\n")); // We are about to begin working on a new DeploymentPlan. // Create a DAM servant, which will be populated @@ -60,6 +67,7 @@ namespace CIAO // Create a new Domain Application Manager servant // to be sent back to the Plan Launcher. // + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) About to instantiate CIAO::DomainApplicationManager_Impl\n")); ACE_NEW_THROW_EX ( dam_servant, CIAO::DomainApplicationManager_Impl ( @@ -70,6 +78,7 @@ namespace CIAO plan, this->init_file_.c_str ()), CORBA::NO_MEMORY ()); + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) Instantiated CIAO::DomainApplicationManager_Impl\n")); // Sanity check for NULL pointer // Should we throw an exception here? @@ -88,6 +97,7 @@ namespace CIAO // plans, so that those plans can be sent off to individual // Node Application Managers. // + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) About to init...\n")); dam_servant->init (ACE_ENV_SINGLE_ARG_PARAMETER); // This is a wrong exception to be thrown here. @@ -97,6 +107,7 @@ namespace CIAO // ACE_CHECK_RETURN (::Deployment::DomainApplicationManager::_nil ()); + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) About to set uuid on DAM...\n")); dam_servant->set_uuid (plan.UUID.in ()); Deployment::DomainApplicationManager_var dam = @@ -107,6 +118,7 @@ namespace CIAO this->map_.bind_dam_reference ( plan.UUID.in (), Deployment::DomainApplicationManager::_duplicate (dam.in ())); + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) Bound DAM reference...\n")); // Return the ApplicationManager instance return dam._retn (); @@ -146,7 +158,7 @@ namespace CIAO ACE_TRY_CHECK; // What if we still have components running within this plan? - // + // (void) this->map_.unbind_dam (plan->UUID.in ()); // Where does the POA deactivate happen? @@ -205,7 +217,7 @@ namespace CIAO CORBA::ULong inst_lenth = plan->instance.length (); for (CORBA::ULong i = 0; i < inst_lenth; ++i) { - if (this->is_component_running (plan->instance[i].name.in (), + if (this->is_component_running (plan->instance[i].name.in (), plan_uuid)) return; } @@ -249,7 +261,7 @@ namespace CIAO ACE_CHECK; } - void + void Execution_Manager_Impl::perform_redeployment ( const Deployment::DeploymentPlan & plan ACE_ENV_ARG_DECL) @@ -263,7 +275,7 @@ namespace CIAO ::Components::RemoveFailure)) { CIAO_TRACE ("CIAO::Execution_Manager_Impl::perform_redeployment"); - + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) Dynamic Redeployment: " "invoked CIAO::Execution_Manager_Impl::perform_redeployment \n")); @@ -299,7 +311,7 @@ namespace CIAO ACE_CHECK; } - Deployment::DeploymentPlan * + Deployment::DeploymentPlan * Execution_Manager_Impl::getPlan (const char * plan_uuid ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((::CORBA::SystemException)) @@ -339,10 +351,10 @@ namespace CIAO ::CORBA::SystemException, ::Deployment::InvalidConnection)) { - ACE_DEBUG ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, "Execution_Manage::finalizing global bindings.\n")); - // Find the NodeApplication hosting the component, and then call + // Find the NodeApplication hosting the component, and then call // on it ACE_TRY { @@ -376,7 +388,80 @@ namespace CIAO ACE_ENDTRY; } - Deployment::NodeApplication_ptr + void + Execution_Manager_Impl::passivate_shared_components ( + const Component_Binding_Info & binding) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + Deployment::StartError)) + { + ACE_DEBUG ((LM_ERROR, + "Execution_Manage::passivate shared components.\n")); + + // Find the NodeApplication hosting the component, and then call + // on it + ACE_TRY + { + Deployment::NodeApplication_var + node_app = this->find_node_application (binding); + + if (CORBA::is_nil (node_app.in ())) + { + ACE_DEBUG ((LM_ERROR, + "Execution_Manager_Impl::passivate_shared_components - " + "nil NodeApplication object reference.\n")); + ACE_THROW (Deployment::StartError ()); + } + + node_app->passivate_component (binding.name_.c_str ()); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Execution_Manager_Impl::passivate_shared_components\t\n"); + ACE_THROW (Deployment::StartError ()); + } + ACE_ENDTRY; + } + + void + Execution_Manager_Impl::activate_shared_components ( + const Component_Binding_Info & binding) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + Deployment::StartError)) + { + ACE_DEBUG ((LM_ERROR, + "Execution_Manage::activate shared components.\n")); + + // Find the NodeApplication hosting the component, and then call + // on it + ACE_TRY + { + Deployment::NodeApplication_var + node_app = this->find_node_application (binding); + + if (CORBA::is_nil (node_app.in ())) + { + ACE_DEBUG ((LM_ERROR, + "Execution_Manager_Impl::activate_shared_components - " + "nil NodeApplication object reference.\n")); + ACE_THROW (Deployment::StartError ()); + } + + node_app->activate_component (binding.name_.c_str ()); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Execution_Manager_Impl::passivate_shared_components\t\n"); + ACE_THROW (Deployment::StartError ()); + } + ACE_ENDTRY; + } + + + Deployment::NodeApplication_ptr Execution_Manager_Impl:: find_node_application (const Component_Binding_Info & binding) ACE_THROW_SPEC (( @@ -399,7 +484,7 @@ namespace CIAO // Find the NA based on the NodeName field of the binding // This is a CORBA call on the DAM - Deployment::NodeApplication_var + Deployment::NodeApplication_var node_app = dam->get_node_app (binding.node_.c_str ()); if (CORBA::is_nil (node_app.in ())) @@ -414,14 +499,14 @@ namespace CIAO return node_app._retn (); } - void + void Execution_Manager_Impl:: add_shared_component (const Component_Binding_Info & comp) { this->shared_components_.insert (comp); } - void + void Execution_Manager_Impl:: remove_shared_component (const Component_Binding_Info & comp) { diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h index 523413e1c91..a64fb545f33 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h @@ -77,7 +77,7 @@ namespace CIAO // Below method is CIAO specific extension, please see the IDL // definition for more details. - virtual void + virtual void destroyManagerByPlan (const char * plan_uuid ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((::CORBA::SystemException, @@ -121,25 +121,35 @@ namespace CIAO ::CORBA::SystemException, ::Deployment::InvalidConnection)); + virtual void passivate_shared_components ( + const Component_Binding_Info & binding) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + virtual void activate_shared_components ( + const Component_Binding_Info & binding) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + /// Add shared component information. /// This call will be made by DomainApplicationManager. - virtual void + virtual void add_shared_component (const Component_Binding_Info & binding); /// Remove shared component - virtual void + virtual void remove_shared_component (const Component_Binding_Info & binding); /// If the input component was found in the internal /// cached shared component list, and the plan_uuid also matches, - /// then this member function returns , otherwise it + /// then this member function returns , otherwise it /// returns . virtual bool is_component_running (const char * name, const char * plan_uuid); protected: /// Return the NodeApplication hosting the given biding - virtual Deployment::NodeApplication_ptr + virtual Deployment::NodeApplication_ptr find_node_application (const Component_Binding_Info & binding) ACE_THROW_SPEC (( ::CORBA::SystemException, diff --git a/TAO/CIAO/DAnCE/Interfaces/Interfaces.mpc b/TAO/CIAO/DAnCE/Interfaces/Interfaces.mpc index 0b42adc33f2..8f8933283a2 100644 --- a/TAO/CIAO/DAnCE/Interfaces/Interfaces.mpc +++ b/TAO/CIAO/DAnCE/Interfaces/Interfaces.mpc @@ -5,7 +5,7 @@ project (ExecutionManager_stub): ciao_component_dnc { sharedname = ExecutionManager_stub - idlflags += -Wb,stub_export_macro=ExecutionManager_stub_Export + idlflags += -Wb,stub_export_macro=ExecutionManager_stub_Export idlflags += -Wb,stub_export_include=ExecutionManager_stub_export.h dynamicflags = EXECUTIONMANAGER_STUB_BUILD_DLL @@ -22,7 +22,7 @@ project (ExecutionManager_stub): ciao_component_dnc { project (NodeManager_stub): ciao_component_dnc { sharedname = NodeManager_stub - idlflags += -Wb,stub_export_macro=NodeManager_stub_Export + idlflags += -Wb,stub_export_macro=NodeManager_stub_Export idlflags += -Wb,stub_export_include=NodeManager_stub_export.h idlflags += -Wb,skel_export_macro=NodeManager_svnt_Export idlflags += -Wb,skel_export_include=NodeManager_svnt_export.h @@ -36,4 +36,4 @@ project (NodeManager_stub): ciao_component_dnc { Source_Files { NodeManagerC.cpp } -} \ No newline at end of file +} diff --git a/TAO/CIAO/DAnCE/Interfaces/NodeManager.idl b/TAO/CIAO/DAnCE/Interfaces/NodeManager.idl index ea964a4e14b..75f1dc617ea 100644 --- a/TAO/CIAO/DAnCE/Interfaces/NodeManager.idl +++ b/TAO/CIAO/DAnCE/Interfaces/NodeManager.idl @@ -19,10 +19,16 @@ module CIAO */ interface NodeManager : Deployment::NodeManager { - // Canonical name of this daemon + /// Canonical name of this daemon readonly attribute string name; - // Shutdown the daemon process. + /// Shutdown the daemon process. oneway void shutdown (); + + /// RACE specific extension. + /// Modify the priority of a node application process. + long set_priority (in string plan_id, + in string cid, + in ::Deployment::Sched_Params nm_params); }; }; diff --git a/TAO/CIAO/DAnCE/Interfaces/README b/TAO/CIAO/DAnCE/Interfaces/README index 5553fdde229..0118689ad70 100644 --- a/TAO/CIAO/DAnCE/Interfaces/README +++ b/TAO/CIAO/DAnCE/Interfaces/README @@ -1,2 +1,2 @@ -To resolve the MPC issue of directory dependency, we have to put some IDL -files into a separate directory. This directory servers for this purpose. \ No newline at end of file +To resolve the MPC issue of directory dependency, we have to put some IDL +files into a separate directory. This directory servers for this purpose. diff --git a/TAO/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp b/TAO/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp index 0b54350047a..3facc261b5a 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp @@ -26,6 +26,13 @@ CIAO::NodeApplication_Options::parse_args (int argc, char *argv[]) this->rt_support_ = 1; shifter.consume_arg (); } + else if (ACE_OS::strncmp (shifter.get_current (), + "-ORB", + ACE_OS::strlen ("-ORB")) == 0) + { + // Ignore ORB parameter + shifter.ignore_arg (); + } else if ((parm = shifter.get_the_parameter ("-o")) !=0) { this->ior_output_filename_ = parm; diff --git a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.cpp index 30db3d0ba3a..7b459a75bdc 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.cpp @@ -17,6 +17,7 @@ CIAO::Container_Impl::~Container_Impl () PortableServer::POA_ptr CIAO::Container_Impl::_default_POA (void) { + CIAO_TRACE ("CIAO::Container_Impl::_default_POA"); return PortableServer::POA::_duplicate (this->poa_.in ()); } @@ -27,6 +28,7 @@ CIAO::Container_Impl::init (const CORBA::PolicyList *policies ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("CIAO::Container_Impl::init"); // @@ Initialize container and create the internal container // implementation that actually interacts with installed // homes/components. @@ -47,7 +49,7 @@ CIAO::Container_Impl::init (const CORBA::PolicyList *policies else { ACE_NEW_THROW_EX (this->container_, - CIAO::Session_Container (this->orb_.in (), this, 1, + CIAO::Session_Container (this->orb_.in (), this, 1, this->static_entrypts_maps_), CORBA::INTERNAL ()); ACE_CHECK_RETURN (-1); @@ -70,6 +72,7 @@ CIAO::Container_Impl::install ( ::Deployment::InstallationFailure, ::Components::InvalidConfiguration)) { + CIAO_TRACE ("CIAO::Container_Impl::install"); Deployment::ComponentInfos_var retv; ACE_TRY { @@ -78,7 +81,7 @@ CIAO::Container_Impl::install ( CORBA::NO_MEMORY ()); ACE_TRY_CHECK; - // Get the ComponentImplementationInfos from the + // Get the ComponentImplementationInfos from the // ContainerImplementationInfo // to avoid too long syntax representation const ::Deployment::ComponentImplementationInfos impl_infos = @@ -111,7 +114,7 @@ CIAO::Container_Impl::install ( if (CORBA::is_nil (comp.in ())) ACE_TRY_THROW (Deployment::InstallationFailure ()); - if (this->component_map_.bind + if (this->component_map_.bind (impl_infos[i].component_instance_name.in (), Components::CCMObject::_duplicate (comp.in ()))) { @@ -128,7 +131,7 @@ CIAO::Container_Impl::install ( (*retv)[i].component_instance_name = impl_infos[i].component_instance_name.in (); - (*retv)[i].component_ref = + (*retv)[i].component_ref = Components::CCMObject::_duplicate (comp.in ()); // Deal with Component instance related Properties. @@ -143,7 +146,7 @@ CIAO::Container_Impl::install ( for (CORBA::ULong prop_len = 0; prop_len < clen; ++prop_len) { // Set up the ComponentIOR attribute - if (ACE_OS::strcmp + if (ACE_OS::strcmp (impl_infos[i].component_config[prop_len].name.in (), "ComponentIOR") == 0) { @@ -165,7 +168,7 @@ CIAO::Container_Impl::install ( } // Set up the naming service attribute - if (ACE_OS::strcmp + if (ACE_OS::strcmp (impl_infos[i].component_config[prop_len].name.in (), "RegisterNaming") == 0) { @@ -174,26 +177,29 @@ CIAO::Container_Impl::install ( component_config[prop_len].value >>= naming_context; // Register the component with the naming service - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "Register component with naming service.\n")); - bool result = register_with_ns (naming_context, - this->orb_.in (), - comp.in () - ACE_ENV_ARG_PARAMETER); + bool result = + register_with_ns ( + naming_context, + this->orb_.in (), + Components::CCMObject::_duplicate (comp.in ()) + ACE_ENV_ARG_PARAMETER + ); ACE_TRY_CHECK; if (!result) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "Failed to register with naming service.\n")); } } // Initialize attributes through StandardConfigurator interface - // @@Todo: Currently I have to manually map - // the Deployment::Properties to - // Components::ConfigValues, we should use a + // @@Todo: Currently I have to manually map + // the Deployment::Properties to + // Components::ConfigValues, we should use a // common data structure in // the future. - Gan CORBA::ULong cur_len = comp_attributes.length (); @@ -206,11 +212,11 @@ CIAO::Container_Impl::install ( comp_attributes[cur_len] = item; } - + if (comp_attributes.length () != 0) { //std_configurator.set_configuration - ::Components::StandardConfigurator_var std_configurator = + ::Components::StandardConfigurator_var std_configurator = comp->get_standard_configurator (); std_configurator->set_configuration (comp_attributes); @@ -233,6 +239,7 @@ CIAO::Container_Impl::install ( CIAO::Container_Impl::properties (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("CIAO::Container_Impl::properties"); ::Deployment::Properties *retval; ACE_NEW_THROW_EX (retval, @@ -249,6 +256,7 @@ CIAO::Container_Impl::properties (ACE_ENV_SINGLE_ARG_DECL) CIAO::Container_Impl::get_node_application (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("CIAO::Container_Impl::get_node_application"); return ::Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); } @@ -262,6 +270,7 @@ CIAO::Container_Impl::install_home ( Deployment::InstallationFailure, Components::InvalidConfiguration)) { + CIAO_TRACE ("CIAO::Container_Impl::install_home"); if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, @@ -319,6 +328,8 @@ CIAO::Container_Impl::remove_home (const char * comp_ins_name ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { + CIAO_TRACE ("CIAO::Container_Impl::remove_home"); + Components::CCMHome_ptr home; ACE_CString str (comp_ins_name); @@ -344,6 +355,7 @@ CIAO::Container_Impl::remove_home (const char * comp_ins_name CIAO::Container_Impl::get_homes (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("CIAO::Container_Impl::get_homes"); Components::CCMHomes * tmp; ACE_NEW_THROW_EX (tmp, Components::CCMHomes (), @@ -374,6 +386,8 @@ CIAO::Container_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { + CIAO_TRACE ("CIAO::Container_Impl::remove"); + // Remove all components first. this->remove_components (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -393,9 +407,8 @@ CIAO::Container_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) this->home_map_.unbind_all (); - //if (CIAO::debug_level () > 1) - if (true) - ACE_DEBUG ((LM_DEBUG, + if (CIAO::debug_level () > 3) + ACE_DEBUG ((LM_DEBUG, "Removed all homes and components from this container!\n")); } @@ -408,6 +421,8 @@ CIAO::Container_Impl::remove_components (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { + CIAO_TRACE ("CIAO::Container_Impl::remove_components"); + // Remove all the components in the NodeApplication/Container // Release all component servant object. const Component_Iterator end = this->component_map_.end (); @@ -442,11 +457,17 @@ CIAO::Container_Impl::remove_component (const char * comp_ins_name ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { + CIAO_TRACE ("CIAO::Container_Impl::remove_component"); + Components::CCMObject_var comp; Components::CCMHome_ptr home; ACE_CString str (comp_ins_name); + if (CIAO::debug_level () > 5) + ACE_DEBUG ((LM_DEBUG, "CIAO::COntainer_Impl::remove_component: Removing comp_ins_name:: %s\n", + str.c_str ())); + /* Before we do remove component we have to inform the homeservant so * Component::ccm_passivate () * constainer::uninstall_component () ->deactivate_object () will be called. @@ -469,47 +490,77 @@ CIAO::Container_Impl::remove_component (const char * comp_ins_name // @@ Still need to remove the home if the previous operation fails? if (this->component_map_.unbind (str) == -1) ACE_THROW (::Components::RemoveFailure ()); + } bool -CIAO::Container_Impl::register_with_ns (const char * obj_name, +CIAO::Container_Impl::register_with_ns (const char * s, CORBA::ORB_ptr orb, Components::CCMObject_ptr obj ACE_ENV_ARG_DECL) { + CIAO_TRACE ("CIAO::Container_Impl::register_with_ns"); + ACE_TRY { - // Obtain the naming service + // Obtain the naming service CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService" + orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (CORBA::is_nil (naming_obj.in ())) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to get the Naming Service.\n"), - false); + "DAnCE: (%P|%t) Unable to get the Naming Service.\n"), + false); - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in () - ACE_ENV_ARG_PARAMETER); + CosNaming::NamingContextExt_var root = + CosNaming::NamingContextExt::_narrow (naming_obj.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - - // Create a Naming Sequence - CosNaming::Name name (1); - name.length (1); - name[0].id = CORBA::string_dup (obj_name); - name[0].kind = CORBA::string_dup (""); - // Register with the Name Server - naming_context->bind (name, obj ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CosNaming::Name name (0); + name.length (0); + + // Get the multicomponent naming context from the . + // The convention of this input string is that + // different naming context is separated by character '/', such as + // "create a naming context A/B/C/D". + ACE_CString tmp (s); + char * naming_string = tmp.rep (); + char seps[] = "/:"; + + char *token, *lastToken = NULL; + token = ACE_OS::strtok (naming_string, seps); + + for (CORBA::ULong i = 0; token != NULL; ++i) + { + // While there still are tokens in the "naming_string" + name.length (name.length () + 1); + name[i].id = CORBA::string_dup (token); + + // Get next naming context + lastToken = token; + token = ACE_OS::strtok ( NULL, seps ); + } + + if (name.length() > 1) + { + // Let's create the context path first + name.length(name.length()-1); + Utility::NameUtility::CreateContextPath (root.in (), name); + name.length(name.length()+1); + name[name.length()-1].id = CORBA::string_dup(lastToken); + } + + // Bind the actual object + Utility::NameUtility::BindObjectPath (root.in (), name, obj); return true; } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "CIAO (%P|%t) Container_Impl.cpp -" "CIAO::Container_Impl::register_with_ns -" "NodeApplication: failed to register " @@ -525,11 +576,13 @@ CIAO::Container_Impl::unregister_with_ns (const char * obj_name, CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) { + CIAO_TRACE ("CIAO::Container_Impl::unregister_with_ns"); + ACE_TRY { - // Obtain the naming service + // Obtain the naming service CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService" + orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -539,10 +592,10 @@ CIAO::Container_Impl::unregister_with_ns (const char * obj_name, false); CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in () + CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + // Create a Naming Sequence CosNaming::Name name (1); name.length (1); @@ -550,8 +603,8 @@ CIAO::Container_Impl::unregister_with_ns (const char * obj_name, name[0].kind = CORBA::string_dup (""); // Register with the Name Server - ACE_DEBUG ((LM_DEBUG, - "Unregister component with the name server : %s!\n", + ACE_DEBUG ((LM_DEBUG, + "Unregister component with the name server : %s!\n", obj_name)); naming_context->unbind (name ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -560,7 +613,7 @@ CIAO::Container_Impl::unregister_with_ns (const char * obj_name, } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "CIAO (%P|%t) Container_Impl.cpp -" "CIAO::Container_Impl::unregister_with_ns -" "NodeApplication: failed to unregister " @@ -570,4 +623,3 @@ CIAO::Container_Impl::unregister_with_ns (const char * obj_name, ACE_ENDTRY; return true; } - diff --git a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.h b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.h index 3f3bb550cf0..b877587758f 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.h @@ -208,7 +208,7 @@ protected: ACE_Null_Mutex> CCMComponent_Map; typedef CCMComponent_Map::iterator Component_Iterator; CCMComponent_Map component_map_; - + const Static_Config_EntryPoints_Maps* static_entrypts_maps_; }; } diff --git a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.inl b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.inl index b0ee9c6d558..e25d1e7e38e 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.inl +++ b/TAO/CIAO/DAnCE/NodeApplication/Container_Impl.inl @@ -17,6 +17,8 @@ ACE_INLINE void CIAO::Container_Impl::set_objref (Deployment::Container_ptr o ACE_ENV_ARG_DECL) { + CIAO_TRACE("CIAO::Container_Imp::set_objref"); + if (!CORBA::is_nil (this->objref_.in ())) ACE_THROW (CORBA::BAD_INV_ORDER ()); @@ -26,6 +28,8 @@ CIAO::Container_Impl::set_objref (Deployment::Container_ptr o ACE_INLINE ::Deployment::Container_ptr CIAO::Container_Impl::get_objref (ACE_ENV_SINGLE_ARG_DECL) { + CIAO_TRACE("CIAO::Container_Imp::get_objref"); + if (CORBA::is_nil (this->objref_.in ())) { this->objref_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); diff --git a/TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h b/TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h index ff536b23cf0..6c32b83ce0d 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h +++ b/TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h @@ -24,7 +24,7 @@ namespace CIAO * * @brief The NoOp_Configurator doesn't do anything. */ - class NoOp_Configurator_Export NoOp_Configurator + class NoOp_Configurator_Export NoOp_Configurator : public NodeApp_Configurator { public: diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.cpp index 4ceab08ebdb..27379d47950 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.cpp @@ -1,9 +1,31 @@ // $Id$ #include "NodeApplication_Core.h" +#include "ace/Sched_Params.h" +#include "ace/OS_NS_errno.h" +#include "ciao/CIAO_common.h" + int main (int argc, char *argv[]) { + int priority = 20; + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + + if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_RR, + priority, + ACE_SCOPE_PROCESS)) != 0) + { + if (errno == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "server (%P|%t): user is not superuser, " + "test runs in time-shared class\n")); + } + else + ACE_ERROR ((LM_ERROR, + "server (%P|%t): sched_params failed\n")); + } + ACE_TRY_NEW_ENV { ACE_DEBUG ((LM_DEBUG, "*** Starting NodeApplication\n")); @@ -30,6 +52,8 @@ main (int argc, char *argv[]) } ACE_ENDTRY; - ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) - This NodeApplication is destroyed!\n")); + if (CIAO::debug_level () > 1) + ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) - This NodeApplication is destroyed!\n")); + return 0; } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.mpc b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.mpc index 1d9b07d6cb7..b2769803d9f 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.mpc +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication.mpc @@ -23,7 +23,7 @@ project(NoOp_Configurator): ciao_component_dnc { NoOp_Configurator.cpp } } - + project(RTNA_Configurator): ciao_component_dnc, rt_server { sharedname = CIAO_RTNA_Configurator dynamicflags = CIAO_RTNA_CONFIGURATOR_BUILD_DLL @@ -32,4 +32,4 @@ project(RTNA_Configurator): ciao_component_dnc, rt_server { RTNodeApp_Configurator.cpp RTConfig_Manager.cpp } -} \ No newline at end of file +} diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp index b50bb12d50e..54d33e52e97 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp @@ -38,6 +38,8 @@ sched_policy_name (int sched_policy) int check_supported_priorities (CORBA::ORB_ptr orb) { + CIAO_TRACE ("NodeApplication_Core::check_supported_priorities"); + int sched_policy = orb->orb_core ()->orb_params ()->ace_sched_policy (); @@ -64,11 +66,13 @@ check_supported_priorities (CORBA::ORB_ptr orb) int CIAO::NodeApplication_Core::svc () { + CIAO_TRACE ("CIAO::NodeApplication_Core::svc"); + ACE_TRY_NEW_ENV { CORBA::Object_var object = this->orb_->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = @@ -125,11 +129,11 @@ CIAO::NodeApplication_Core::svc () ACE_TRY_CHECK; if (retval) - { - ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ + { + ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ initializing the session container!")); - return 1; - } + return 1; + } CORBA::String_var str = this->orb_->object_to_string (nodeapp_obj.in () ACE_ENV_ARG_PARAMETER); @@ -157,7 +161,7 @@ CIAO::NodeApplication_Core::svc () CIAO::NodeApplication_Callback_var nam_callback = CIAO::NodeApplication_Callback::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Deployment::Properties_out properties_out (prop.out ()); @@ -196,6 +200,8 @@ CIAO::NodeApplication_Core::svc () int CIAO::NodeApplication_Core::startup (int argc, char *argv[]) { + CIAO_TRACE ("CIAO::NodeApplication_Core::startup"); + // pre-init this->configurator_.reset (this->options_.create_nodeapp_configurator ()); @@ -215,6 +221,8 @@ CIAO::NodeApplication_Core::startup (int argc, char *argv[]) int CIAO::NodeApplication_Core::run_orb () { + CIAO_TRACE ("CIAO::NodeApplication_Core::run_orb"); + // check supported priority before running RT if (this->options_.rt_support () && check_supported_priorities (this->orb_.in ()) != 0) @@ -225,7 +233,7 @@ CIAO::NodeApplication_Core::run_orb () if (this->options_.rt_support ()) // RT support reuqested { - + // spawn a thread // Task activation flags. diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h index 8f8f06772b5..3a8795eccea 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h @@ -48,7 +48,7 @@ namespace CIAO virtual int svc (void); int startup (int argc, char *argv[]); - + int run_orb (void); protected: diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl index 563a960f584..85a0add56a7 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl @@ -3,6 +3,6 @@ ACE_INLINE CIAO::NodeApplication_Core::NodeApplication_Core (CIAO::NodeApplication_Options &opts) : options_ (opts) -{ +{ } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index 9045e47a136..7c4de13585f 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -76,7 +76,7 @@ void CIAO::NodeApplication_Impl::finishLaunch_i ( const Deployment::Connections & providedReference, CORBA::Boolean start, - CORBA::Boolean add_connection + CORBA::Boolean add_connection ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, @@ -92,6 +92,7 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( for (CORBA::ULong i = 0; i < length; ++i) { ACE_CString name = providedReference[i].instanceName.in (); + Components::CCMObject_var comp; if (this->component_objref_map_.find (name, comp) != 0) @@ -105,6 +106,12 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( ACE_TRY_THROW (Deployment::InvalidConnection ()); } + if (CORBA::is_nil (comp.in ())) + { + ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); + throw Deployment::InvalidConnection (); + } + Components::EventConsumerBase_var consumer; // Since we know CCMObject inherits from @@ -128,15 +135,33 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( if (add_connection) { - ::Components::Cookie_var cookie = - comp->connect (providedReference[i].portName.in (), - providedReference[i].endpoint.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + try + { + ::Components::Cookie_var cookie = + comp->connect (providedReference[i].portName.in (), + providedReference[i].endpoint.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; - ACE_CString key = (*create_connection_key (providedReference[i])); - ACE_DEBUG ((LM_ERROR, "[BINGDING KEY]: %s\n", key.c_str ())); - this->cookie_map_.rebind (key, cookie); + ACE_CString key = (*create_connection_key (providedReference[i])); + + if (CIAO::debug_level () > 10) + ACE_DEBUG ((LM_ERROR, "[BINGDING KEY]: %s\n", key.c_str ())); + + this->cookie_map_.rebind (key, cookie); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + "CIAO (%P|%t) - NodeApplicationImpl.cpp, " + "CIAO::NodeApplication_Impl::finishLaunch\n" + "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connection FAILED.\n", + providedReference[i].instanceName.in (), + providedReference[i].portName.in (), + providedReference[i].endpointInstanceName.in (), + providedReference[i].endpointPortName.in ())); + throw; + } if (CIAO::debug_level () > 6) { @@ -154,7 +179,10 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( { ACE_CString key = (*create_connection_key (providedReference[i])); ::Components::Cookie_var cookie; - ACE_DEBUG ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); + + if (CIAO::debug_level () > 10) + ACE_DEBUG ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); + if (this->cookie_map_.find (key, cookie) != 0) { ACE_DEBUG ((LM_ERROR, "Error: Cookie Not Found!\n")); @@ -178,15 +206,17 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( } break; - // @@ (GD) A place holder where the Event Channel connections - // should be set up. + // @@ (GD) A place holder where the Event Channel connections + // should be set up. case Deployment::EventEmitter: + ACE_DEBUG ((LM_DEBUG, "NA_I: EventEmitter\n")); consumer = Components::EventConsumerBase:: _narrow (providedReference[i].endpoint.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Narrow compelted\n")); if (CORBA::is_nil (consumer.in ())) { @@ -253,10 +283,17 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( case Deployment::EventPublisher: + ACE_DEBUG ((LM_DEBUG, "NA_I: EventPublisher - %s:%s\n", + providedReference[i].instanceName.in (), + providedReference[i].portName.in ())); + ACE_DEBUG ((LM_DEBUG, "NA_I: endPoint instance:port %s:%s\n", + providedReference[i].endpointInstanceName.in (), + providedReference[i].endpointPortName.in ())); consumer = Components::EventConsumerBase:: _narrow (providedReference[i].endpoint.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "NA_I: Narrow completed\n")); if (CORBA::is_nil (consumer.in ())) { @@ -290,7 +327,9 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( ACE_CString key = (*create_connection_key (providedReference[i])); this->cookie_map_.rebind (key, cookie); - ACE_DEBUG ((LM_ERROR, "[BINGDING KEY]: %s\n", key.c_str ())); + + if (CIAO::debug_level () > 10) + ACE_DEBUG ((LM_ERROR, "[BINGDING KEY]: %s\n", key.c_str ())); if (CIAO::debug_level () > 6) { @@ -308,7 +347,10 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( { ACE_CString key = (*create_connection_key (providedReference[i])); ::Components::Cookie_var cookie; - ACE_DEBUG ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); + + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); + if (this->cookie_map_.find (key, cookie) != 0) { ACE_DEBUG ((LM_ERROR, "Error: Cookie Not Found!\n")); @@ -405,9 +447,12 @@ CIAO::NodeApplication_Impl::ciao_passivate (ACE_ENV_SINGLE_ARG_DECL) iter != end; ++iter) { + ACE_DEBUG ((LM_DEBUG, "passivating %s\n", + (*iter).ext_id_.c_str ())); ((*iter).int_id_)->ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } + ACE_DEBUG ((LM_DEBUG, "exiting passivate\n")); } Deployment::ComponentInfos * @@ -488,7 +533,7 @@ CIAO::NodeApplication_Impl::install ( { //Since we know the type ahead of time...narrow is omitted here. if (this->component_objref_map_.bind ( - retv[len].component_instance_name.in(), + retv[len].component_instance_name.in(), Components::CCMObject::_duplicate (retv[len]. component_ref.in ()))) { @@ -522,6 +567,9 @@ CIAO::NodeApplication_Impl::remove_component (const char * inst_name ACE_THROW_SPEC ((::CORBA::SystemException, ::Components::RemoveFailure)) { + ACE_DEBUG ((LM_DEBUG, "NA_I: removing component %s\n", + inst_name)); + // Fetch the container object reference from the componet_container_map ::Deployment::Container_var container_ref; if (this->component_container_map_.find (inst_name, container_ref) != 0) @@ -541,24 +589,91 @@ CIAO::NodeApplication_Impl::remove_component (const char * inst_name container_ref->remove_component (inst_name); } +void +CIAO::NodeApplication_Impl::passivate_component (const char * name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((::CORBA::SystemException, + ::Components::RemoveFailure)) +{ + Components::CCMObject_var comp; + + if (this->component_objref_map_.find (name, comp) != 0) + { + ACE_ERROR ((LM_ERROR, + "CIAO (%P|%t) - NodeApplication_Impl.cpp, " + "CIAO::NodeApplication_Impl::passivate_component, " + "invalid instance [%s] \n", + name)); + ACE_TRY_THROW (Deployment::StartError ()); + } + + if (CORBA::is_nil (comp.in ())) + { + ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); + throw Deployment::StartError (); + } + + comp->ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; +} + +void +CIAO::NodeApplication_Impl::activate_component (const char * name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((::CORBA::SystemException, + ::Components::RemoveFailure)) +{ + Components::CCMObject_var comp; + + if (this->component_objref_map_.find (name, comp) != 0) + { + ACE_ERROR ((LM_ERROR, + "CIAO (%P|%t) - NodeApplication_Impl.cpp, " + "CIAO::NodeApplication_Impl::passivate_component, " + "invalid instance [%s] \n", + name)); + ACE_TRY_THROW (Deployment::StartError ()); + } + + if (CORBA::is_nil (comp.in ())) + { + ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); + throw Deployment::StartError (); + } + + comp->ciao_preactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + comp->ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + comp->ciao_postactivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; +} + + void CIAO::NodeApplication_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { // If we still have components installed, then do nothing if (this->component_objref_map_.current_size () != 0) - return; - + { + ACE_DEBUG ((LM_DEBUG, "NA: remove: still have components, doing nothing\n")); + return; + } // For each container, invoke operation to remove home and components. const CORBA::ULong set_size = this->container_set_.size (); for (CORBA::ULong i = 0; i < set_size; ++i) { + ACE_DEBUG ((LM_DEBUG, "NA: calling remove on container %i\n")); this->container_set_.at(i)->remove (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; } // Remove all containers // Maybe we should also deactivate container object reference. + ACE_DEBUG ((LM_DEBUG, "NA: remove all\n")); this->container_set_.remove_all (); if (CIAO::debug_level () > 1) @@ -566,14 +681,17 @@ CIAO::NodeApplication_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) //For static deployment, ORB will be shutdown in the Static_NodeManager if (this->static_entrypts_maps_ == 0) - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + { + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + ACE_DEBUG ((LM_DEBUG, "NA: shutdown\n")); + } } // Create a container interface, which will be hosted in this NodeApplication. ::Deployment::Container_ptr CIAO::NodeApplication_Impl::create_container ( - const ::Deployment::Properties &properties + const ::Deployment::Properties &properties ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, ::Components::CreateFailure, @@ -694,6 +812,9 @@ create_connection_key (const Deployment::Connection & connection) (*retv) += connection.portName.in (); (*retv) += connection.endpointInstanceName.in (); (*retv) += connection.endpointPortName.in (); - ACE_DEBUG ((LM_ERROR, "The key is: %s\n", (*retv).c_str ())); + + if (CIAO::debug_level () > 3) + ACE_DEBUG ((LM_ERROR, "The key is: %s\n", (*retv).c_str ())); + return retv; } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h index dde2a353750..bcf5813c474 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h @@ -158,6 +158,16 @@ namespace CIAO ACE_THROW_SPEC ((::CORBA::SystemException, ::Components::RemoveFailure)); + virtual void activate_component (const char * name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual void passivate_component (const char * name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException, + ::Components::RemoveFailure)); + /// Remove everything inside including all components and homes. virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp index f4b8fb42171..9d74fa817c4 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp @@ -368,7 +368,7 @@ CIAO::RTResource_Config_Manager::find_policies_by_name (const char *name ACE_DEBUG ((LM_DEBUG, "RTResource_Config_Manager::find_policies_by_name: %s\n", name)); - + POLICY_MAP::ENTRY *entry = 0; if (this->policy_map_.find (name, entry) != 0) diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp index 2ea36daf383..5e81e669182 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp @@ -34,7 +34,7 @@ int CIAO::RTNodeApp_Configurator::init_resource_manager (const ::Deployment::Properties &properties) { - + // if (CIAO::debug_level () > 9) ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::init_resource_manager\n")); // @@ Should we cache the properties that we consumed here? @@ -57,7 +57,7 @@ CIAO::RTNodeApp_Configurator::init_resource_manager ACE_ERROR_RETURN ((LM_ERROR, "ERROR: RTNodeApp_Configurator::init_resource_manager unable to extract CIAOServerResources\n"), -1); } - + // Ignore other stuff } diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h index 37683d04956..c44786195e9 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h +++ b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h @@ -6,7 +6,7 @@ * @Brief This file contains the implementation of * the RTNodeApp_Configurator, a concrete NodeApp_Configurator for * setting up real-time support for NodeApplication. - * + * * * @author Nanbor Wang *========================================================*/ @@ -31,7 +31,7 @@ namespace CIAO /** * @class RTNodeApp_Configurator * - * @brief This class implements a concrete NodeApp_Configurator for + * @brief This class implements a concrete NodeApp_Configurator for * setting up the NodeApplication process for RT support. **/ class CIAO_RTNA_Configurator_Export RTNodeApp_Configurator : diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp index 5618e775bc7..24a2349a66c 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp @@ -3,6 +3,16 @@ #include "ciao/CIAO_Config.h" #include "ciao/CIAO_common.h" +//Added for HTTP +#include "URL_Parser.h" //for parsing the URL +#include "HTTP_Client.h" //the HTTP client class to downloading packages +#include "ace/Message_Block.h" //for ACE_Message_Block +#include "ace/OS_NS_fcntl.h" //for open +#include "ace/OS_NS_unistd.h" //for close +#include "ace/OS_NS_sys_stat.h" //for filesize and mkdir +#include "ace/OS_NS_string.h" //for string functions + + namespace CIAO { Containers_Info_Map:: @@ -10,8 +20,29 @@ namespace CIAO const Deployment::ComponentPlans & shared_components) : map_ (CIAO_DEFAULT_MAP_SIZE), plan_ (plan), - shared_components_ (shared_components) + shared_components_ (shared_components), + HTTP_DOWNLOAD_PATH () { + char* temp = ACE_OS::getenv ("CIAO_ROOT"); + HTTP_DOWNLOAD_PATH += temp; + +#if defined (ACE_WIN32) || defined (ACE_WIN64) + HTTP_DOWNLOAD_PATH += "\\"; +#else + HTTP_DOWNLOAD_PATH += "/"; +#endif + + HTTP_DOWNLOAD_PATH += "HTTP_DOWNLOADED_LIBS"; + + ACE_OS::mkdir(HTTP_DOWNLOAD_PATH.c_str ()); + //if dir already exists a -1 is returned + //we ignore this, just need to make sure the directory exists + + //now lets update the loader path to include + //the HTTP_DOWNLOAD_PATH + this->update_loader_path (); + + this->initialize_map (); this->build_map (); } @@ -60,11 +91,15 @@ namespace CIAO if (this->plan_.instance[i].deployedResource.length () != 0) { + /* my_resource_id = this->plan_.instance[i].deployedResource[0].resourceName.in (); this->plan_.instance[i].deployedResource[0].resourceValue >>= my_policy_set_id; + */ + + // ACE_ERROR ((LM_ERROR, "ERROR: RT-CCM support has been disabled until code in Containers_Info_Map is updated to reflect IDL changes.")); } // If we find a existing policy_set_id, then do nothing. @@ -162,12 +197,12 @@ namespace CIAO const Deployment::InstanceDeploymentDescription & instance = this->plan_.instance[i]; - // If this component instance happens to be in the "shared components + // If this component instance happens to be in the "shared components // list", then we ignore it, otherwise we shall install it. ACE_CString name (instance.name.in ()); if (this->is_shared_component (name)) continue; - + if (! this->insert_instance_into_map (instance)) return false; } @@ -184,7 +219,8 @@ namespace CIAO const char * policy_set_id = ""; if (instance.deployedResource.length () != 0) { - instance.deployedResource[0].resourceValue >>= policy_set_id; + // instance.deployedResource[0].resourceValue >>= policy_set_id; + //ACE_ERROR ((LM_ERROR, "ERROR: RT-CCM support has been disabled until code in Containers_Info_Map is updated to reflect IDL changes.")); } // Find the ContainerImplementationInfo entry from the map @@ -234,6 +270,35 @@ namespace CIAO const Deployment::ArtifactDeploymentDescription & arti = this->plan_.artifact[ impl.artifactRef[j] ]; +#if defined (ACE_WIN32) || defined (ACE_WIN64) + for (size_t loc_num = 0; + loc_num < arti.location.length (); + ++loc_num) + { + if (ACE_OS::strstr (arti.location[loc_num], "http://")) + { + ACE_CString path; + if (!this->resolve_http_reference (arti.location[loc_num], + path)) + { + ACE_ERROR + ((LM_ERROR, + "CIAO (%P|%t) Containers_Info_Map.cpp -" + "Containers_Info_Map::insert_instance_into_container -" + "ERROR: Unable to resolve HTTP ref to location[%d] of %s\n", + loc_num, arti.name.in ())); + + arti.location[loc_num] = CORBA::string_dup ("HTTP_failure"); + } + else + { + arti.location[loc_num] = CORBA::string_dup (arti.name.in ()); + //enque for cleanup + } + } + } +#endif + ACE_CString tmp = arti.name.in (); ssize_t pos; @@ -241,6 +306,10 @@ namespace CIAO // the modeling tool should make sure of // uniqueness, i.e., one component implementation // should have only 1 _svnt and 1 _exec libs. + if ((pos = tmp.find ("_stub")) != ACE_CString::npos || + (pos = tmp.find ("_Stub")) != ACE_CString::npos) + continue; // We ignore _stub artifact since it's not used. + if (!svnt_found && ((pos = tmp.find ("_svnt")) != ACE_CString::npos || (pos = tmp.find ("_Svnt")) != ACE_CString::npos)) @@ -258,7 +327,7 @@ namespace CIAO CORBA::string_dup (arti.location[0].in ()); // Get the entry point. - const CORBA::ULong prop_length = arti.execParameter.length (); + const CORBA::ULong prop_length = arti.execParameter.length (); for (CORBA::ULong prop_num = 0; prop_num < prop_length; @@ -294,7 +363,7 @@ namespace CIAO } exec_found = true; - // Cpoy the servant dll/so name. + // Copy the servant dll/so name. // @@ Note: I ignore all the other locations except the first one. exec_found = true; impl_infos[i].executor_dll = @@ -341,3 +410,179 @@ is_shared_component (ACE_CString & name) return false; } + + +/*--------------------------------------------------------------------- + * functions to support HTTP capabilities of the NodeApplicationManager + * @author Stoyan Paunov + * + * Purpose: Adding the HTTP access code which will resove + * any references to HTTP URLs + */ + + // This function checks if the HTTP_DOWNLOAD_PATH is + // in the library load path + void + CIAO::Containers_Info_Map::update_loader_path (void) + { +#if defined (ACE_WIN32) || defined (ACE_WIN64) + char* path = ACE_OS::getenv ("PATH"); +#else + char* path = ACE_OS::getenv ("LD_LIBRARY_PATH"); +#endif + + if (ACE_OS::strstr (path, this->HTTP_DOWNLOAD_PATH.c_str ())) + return; + +#if defined (ACE_WIN32) || defined (ACE_WIN64) + ACE_CString new_path = "PATH="; +#else + ACE_CString new_path = "LD_LIBRARY_PATH="; +#endif + + new_path += this->HTTP_DOWNLOAD_PATH; + +#if defined (ACE_WIN32) || defined (ACE_WIN64) + new_path += ";"; +#else + new_path += ":"; +#endif + + new_path += path; + +//turn off the HTTP feature for Linux until +//I discover what the problem with Linux is +#if defined (ACE_WIN32) || defined (ACE_WIN64) + ACE_OS::putenv (new_path.c_str ()); +#endif + + } + + //This function resolves any http location references + //in the name of the implementation artifacts + //It returns true on success and false on failure + + bool + CIAO::Containers_Info_Map::resolve_http_reference (const char* location, + ACE_CString &path) + { + + ACE_DEBUG ((LM_INFO, + "Attempting to download %s\n", + location)); + + //figure out the file name + char* name = const_cast (location); + char* p = NULL; + while (1) + { + if (p = ACE_OS::strstr (name, "/")) + { + name = ++p; + continue; + } + else if (p = ACE_OS::strstr (name, "\\")) + { + name = ++p; + continue; + } + else + break; + } + + //get the file + ACE_Message_Block* mb = 0; + ACE_NEW_RETURN (mb, ACE_Message_Block (0,0), false); + + if (!this->retrieve_via_HTTP (location, *mb)) + { + mb->release (); + return false; + } + + path = HTTP_DOWNLOAD_PATH; + path += "/"; + path += name; + + if (!this->write_to_disk (path.c_str (), *mb)) + { + mb->release (); + return false; + } + + mb->release (); + return true; + } + + //function to retvieve a file via HTTP + //stores the file in the passed preallocated ACE_Message_Block + //returns 1 on success + // 0 on error + + bool + CIAO::Containers_Info_Map::retrieve_via_HTTP (const char* URL, + ACE_Message_Block &mb) + { + URL_Parser *parser = TheURL_Parser::instance (); + if (!parser->parseURL (const_cast (URL))) + return false; + + // Create a client + HTTP_Client client; + + // Open the client + if (client.open (parser->filename_, + parser->hostname_, + parser->port_) == -1) + { + client.close (); + return false; + } + + // Read from it + if (client.read (&mb) <= 0) + { + client.close (); + return false; + } + + return true; + } + + //This function attempts to write a sequence of bytes from an + //ACE_Message_Block to a specified location. A 0 is returned + //in the case of an error and a 1 upon success + + bool + CIAO::Containers_Info_Map::write_to_disk (const char* full_path, + ACE_Message_Block& mb, + bool replace) + { + ACE_stat stat; + + if (ACE_OS::stat(full_path, &stat) != -1 && !replace) + return false; + + // Open a file handle to the local filesystem + ACE_HANDLE handle = ACE_OS::open (full_path, O_CREAT | O_TRUNC | O_WRONLY); + if (handle == ACE_INVALID_HANDLE) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("[CIAO::Containers_Info_Map::write_to_disk]"), + ACE_TEXT (" file creation error")), + false); + + //write the data to the file + for (ACE_Message_Block * curr = &mb; curr != 0; curr = curr->cont ()) + if (ACE_OS::write_n (handle, curr->rd_ptr(), curr->length()) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("[CIAO::Containers_Info_Map::write_to_disk]"), + ACE_TEXT (" write error")), + false); + + // Close the file handle + ACE_OS::close (handle); + + return true; + } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h b/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h index 33f15ba0362..4fb23a46f19 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h @@ -1,5 +1,5 @@ /** - * + * * @file Containers_Info_Map.h * @author Gan Deng * @@ -15,6 +15,10 @@ #include "ace/Null_Mutex.h" #include "ace/Hash_Map_Manager.h" + +//added for the HTTP support +#include "ace/Message_Block.h" //for ACE_Message_Block + #include "ciao/DeploymentC.h" #include "ace/SString.h" #include "CIAO_NAM_Export.h" @@ -59,7 +63,7 @@ namespace CIAO //Deployment::ContainerImplementationInfos_var containers_info_; - typedef + typedef ACE_Hash_Map_Manager_Ex , @@ -74,6 +78,54 @@ namespace CIAO /// shared components list, passed in from NodeImplementationInfoHandler /// class. Deployment::ComponentPlans shared_components_; + + /**------------------------------------------------------------------- + * HTTP capability + * @author Stoyan Paunov + * + * Purpose: Adding the HTTP access code which will resove + * any references to HTTP URLs + */ + protected: + + //directory in which to download the libraries obtained via HTTP + ACE_CString HTTP_DOWNLOAD_PATH; + + /// This function checks if the HTTP_DOWNLOAD_PATH is + /// in the library load path + void + update_loader_path (void); + + /// This function resolves any http location references + /// in the name of the implementation artifacts + /// It returns true on success and false on failure + + bool + resolve_http_reference (const char* location, + ACE_CString &name); + + /// function to retvieve a file via HTTP + /// stores the file in the passed preallocated ACE_Message_Block + /// returns 1 on success + /// 0 on error + + bool + retrieve_via_HTTP (const char* URL, + ACE_Message_Block &mb); + + /// function that writes out a file to a specified location on the hand disk + /// returns 1 on success + /// 0 on already exists and replace == false + /// 0 on error + + bool + write_to_disk (const char* full_path, + ACE_Message_Block& mb, + bool replace = true); + + /// TODO: Fuction to remove the downloaded library to ensure + /// consisterncy in future runs + }; } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp new file mode 100644 index 00000000000..73a8071f305 --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp @@ -0,0 +1,59 @@ +// $Id$ + +// HTTP_Client.cpp, Stoyan + +#include "HTTP_Client.h" +#include "HTTP_Handler.h" +#include "ace/OS_NS_string.h" + +HTTP_Client::HTTP_Client (void) +{ +} + +HTTP_Client::~HTTP_Client (void) +{ + this->close (); +} + +// initialize address and filename. No network i/o in open +int +HTTP_Client::open (const ACE_TCHAR *filename, + const ACE_TCHAR *hostname, + u_short port) +{ + filename_ = ACE_OS::strdup (filename); + inet_addr_.set (port, hostname); + return 0; +} + +// read from connection length bytes from offset, into Message block +int +HTTP_Client::read (ACE_Message_Block *mb) +{ + + // Create a HTTP_Client Reader + HTTP_Reader HTTP_reader (mb, filename_); + HTTP_Handler *brp = &HTTP_reader; + + // Connect to the server + if (connector_.connect (brp, inet_addr_) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Client::read():Connector error"), -1); + + return HTTP_reader.byte_count (); + +} + +// close down the HTTP_Client +int +HTTP_Client::close (void) +{ + + if (filename_) + { + ACE_OS::free ((void *) filename_); + filename_ = 0; + } + return 0; + +} + diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.h b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.h new file mode 100644 index 00000000000..ac0f9cbea92 --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.h @@ -0,0 +1,72 @@ + +/* -*- C++ -*- */ + +//============================================================================= +/** + * @file HTTP_Client.h + * + * $Id$ + * + * This is the HTTP_Client class, which is the API for doing file + * uploads/downloads. + * + * @author Stoyan Paunov + */ +//============================================================================= + + +#ifndef HTTP_Client_H +#define HTTP_Client_H + + +#include "ace/INET_Addr.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Connector.h" +#include "ace/Connector.h" +#include "ace/Message_Block.h" +#include "HTTP_Handler.h" + +/** + * @class HTTP_Client + * + * @brief HTTP_Client is intended to provide application API to + * classes that wish to do network i/o at a very + * high level of abstraction. + * + * This class provides the ability to retrieve data from + * the network, of specified length and offset, and potentially + * use any protocol "under the hood" to do so. It currently + * uses HTTP. See HTTP_Handler also. + */ +class HTTP_Client +{ +public: + HTTP_Client (void); + ~HTTP_Client (void); + + /// Initializes the class with the given filename, hostname and port. + /// it should be called with the filename, before any read/write calls + int open (const ACE_TCHAR *filename, + const ACE_TCHAR *hostname = ACE_DEFAULT_SERVER_HOST, + u_short port = 80); + + /// Starts a connection, and reads a file from the server into + /// Message_Block mb + int read (ACE_Message_Block *mb); + + /// Frees memory allocated for filename. + int close (); + +private: + /// Store the internet address of the server + ACE_INET_Addr inet_addr_; + + /// The filename + ACE_TCHAR *filename_; + + /// The connector endpoint to initiate the client connection + ACE_Connector connector_; + +}; + +#endif /* HTTP_Client_H */ diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.cpp new file mode 100644 index 00000000000..ffd85ca1ebf --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.cpp @@ -0,0 +1,203 @@ +// $Id$ + +// HTTP_Handler.cpp, Stoyan + +#include "HTTP_Handler.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_strings.h" + +// Empty constructor for compliance with new Connector behavior. +HTTP_Handler::HTTP_Handler (void) +{ +} + +// Always use this constructor +HTTP_Handler::HTTP_Handler (ACE_Message_Block * mb, + ACE_TCHAR *filename) : + mb_ (mb), + filename_ (ACE_OS::strdup (filename)), + bytecount_ (0) +{ +} + +HTTP_Handler::~HTTP_Handler (void) +{ + if (filename_) + { + ACE_OS::free (filename_); + filename_ = 0; + } +} + +// Called by Connector after connection is established +int +HTTP_Handler::open (void *) +{ + if (this->send_request () != 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():send_request failed\n"), -1); + + if (this->receive_reply () != 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():receive_reply failed\n"), -1); + return 0; + +} + +// No-op +int +HTTP_Handler::close (u_long) +{ + return 0; +} + +// Always overridden by the derived classes +int +HTTP_Handler::send_request (void) +{ + return -1; +} + +// Always overridden by the derived classes +int +HTTP_Handler::receive_reply (void) +{ + return -1; +} + +// used to retrieve the number of bytes read/written by the +// last operation on the Blob +size_t +HTTP_Handler::byte_count (void) +{ + return bytecount_; +} + +// Reader ************************************************** + +HTTP_Reader::HTTP_Reader (ACE_Message_Block * mb, + ACE_TCHAR *filename, + const char *request_prefix, + const char *request_suffix) : + HTTP_Handler (mb, filename), + request_prefix_ (request_prefix), + request_suffix_ (request_suffix) +{ +} + +// Send the HTTP request +int +HTTP_Reader::send_request (void) +{ + char mesg [MAX_HEADER_SIZE]; + + // Check to see if the request is too big + if (MAX_HEADER_SIZE < (ACE_OS::strlen (request_prefix_) + + ACE_OS::strlen (filename_) + + ACE_OS::strlen (request_suffix_) + 4)) + ACE_ERROR_RETURN((LM_ERROR,"Request too large!"), -1); + + // Create a message to send to the server requesting retrieval of the file + int len = ACE_OS::sprintf (mesg, "%s %s %s", request_prefix_, filename_, request_suffix_); + + // Send the message to server + if (peer ().send_n (mesg, len) != len) + ACE_ERROR_RETURN((LM_ERROR,"Error sending request\n"), -1); + + + return 0; +} + +// Recieve the HTTP Reply +int +HTTP_Reader::receive_reply (void) +{ + size_t num_recvd = 0; + char buf [MTU+1]; + char *buf_ptr = 0; + size_t bytes_read = 0; + + // Receive the first MTU bytes and strip the header off. + // Note that we assume that the header will fit into MTU bytes. + + if (peer ().recv_n (buf, MTU, 0, &num_recvd) >= 0) + { + //Make sure that response type is 200 OK + if (ACE_OS::strstr (buf,"200 OK") == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "HTTP_Reader::receiveReply(): Response is not 200 OK\n" ), -1); + + // Search for the header termination string "\r\n\r\n", or "\n\n". If + // found, move past it to get to the data portion. + if ((buf_ptr = ACE_OS::strstr (buf,"\r\n\r\n")) != 0) + buf_ptr += 4; + else if ((buf_ptr = ACE_OS::strstr (buf, "\n\n")) != 0) //for compatibility with JAWS + buf_ptr += 2; + else + buf_ptr = buf; + + // Determine number of data bytes read. This is equal to the + // total bytes read minus number of header bytes. + bytes_read = num_recvd - (buf_ptr - buf); + + } + else + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1); + + // *************************************************************** + // At this point, we have stripped off the header and are ready to + // process data. buf_ptr points to the data + + //set the size of the ACE_Message_Block to the current bytes read + //NOTE: this function reallocates if necessary + //this->mb_->size (bytes_read); + + ACE_Message_Block* temp; //pointer used temporarily + //for memory allocations before + //chaining to Message_Block + + ACE_Message_Block* curr = this->mb_; + + ACE_NEW_RETURN (temp, ACE_Message_Block (bytes_read), -1); + curr->cont (temp); + + curr = curr->cont (); + + // Copy over all the data bytes into our message buffer. + if (curr->copy (buf_ptr, bytes_read) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", + "HTTP_Reader::receiveReply():Error copying data into Message_Block\n" ), -1); + + //read the rest of the data into a number of ACE_Message_Blocks and + //chain them together in a link list fashion + + num_recvd = 0; + + do + { + if (curr->space () == 0) + { + ACE_NEW_RETURN (temp, ACE_Message_Block (MTU), -1); + curr->cont (temp); + curr = curr->cont (); + } + + if (peer ().recv_n (curr->wr_ptr (), curr->space (), 0, &num_recvd) >= 0) + { + //move the write pointer + curr->wr_ptr (num_recvd); + + //increment bytes_read + bytes_read += num_recvd; + + } + else + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1); + + }while (num_recvd != 0); + + // Set the byte count to number of bytes received + this->bytecount_ = bytes_read; + + return 0; +} + diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.h b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.h new file mode 100644 index 00000000000..d1e9aae2894 --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Handler.h @@ -0,0 +1,86 @@ + +/* -*- C++ -*- */ + +//============================================================================= +/** + * @file HTTP_Handler.h + * + * $Id$ + * + * HTTP_Handler is a base class for HTTP_Reader and + * HTTP_Writer which are created in response to calls to + * read/write, as appropriate + * + * + * @author Stoyan Paunov + */ +//============================================================================= + + +#ifndef HTTP_HANDLER_H +#define HTTP_HANDLER_H + +#include "ace/SOCK_Stream.h" +#include "ace/Svc_Handler.h" +#include "ace/Message_Block.h" + +/** + * @class HTTP_Handler + * class to retrieve data via HTTP + */ +class HTTP_Handler : public ACE_Svc_Handler +{ +public: + /// Null constructor, insures that it works properly with Connector + HTTP_Handler (void); + + /// Always use this constructor to make HTTP_Handlers + HTTP_Handler (ACE_Message_Block *mb, + ACE_TCHAR *filename); + + /// returns the number of bytes read/written in the last operation. + size_t byte_count (void); + + /// Activate this instance of the + virtual int open (void * = 0); + + /// Close down the Blob + virtual int close (u_long flags = 0); + + ~HTTP_Handler (void); + +protected: + virtual int send_request (void); + virtual int receive_reply (void); + + ACE_Message_Block *mb_; + ACE_TCHAR *filename_; + size_t bytecount_; + enum + { + /// The handler assumes that the first 2048 bytes of a server response + /// contains the header + MAX_HEADER_SIZE = 2048, + + /// set the MAX_TRANSMISSION_UNIT (MTU) = BUFSIZ as defined by OS + MTU = BUFSIZ + }; +}; + +class HTTP_Reader : public HTTP_Handler +{ +public: + HTTP_Reader (ACE_Message_Block *mb, + ACE_TCHAR *filename, + const char *request_prefix = "GET", + const char *request_suffix = "HTTP/1.0\r\n\r\n"); + +private: + //NOTE: these functions return -1 on error + int send_request (void); + int receive_reply (void); + const char *request_prefix_; + const char *request_suffix_; +}; + +#endif /* HTTP_HANDLER_H */ diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp index 40875a9571f..c4f6b37c963 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp @@ -7,7 +7,7 @@ CIAO::NodeImplementationInfoHandler:: NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components) : + const Deployment::ComponentPlans & shared_components) : plan_ (plan), node_info_ (0), containers_info_map_ (plan, shared_components) @@ -17,17 +17,17 @@ NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan, this->populate_container_impl_infos (); } -Deployment::NodeImplementationInfo * +Deployment::NodeImplementationInfo * CIAO::NodeImplementationInfoHandler::node_impl_info (void) const { Deployment::NodeImplementationInfo_var retv; - ACE_NEW_RETURN (retv, + ACE_NEW_RETURN (retv, Deployment::NodeImplementationInfo (this->node_info_.in ()), 0); return retv._retn (); } -void +void CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) { const CORBA::ULong instance_len = plan_.instance.length (); @@ -39,13 +39,13 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) // has been specified // TODO: We shoud do some sanity check here, since all the component // instance in this NodeApplication should have the same "server_resource_def" - // defined. Since currently we ignored this sanity check, then will allow + // defined. Since currently we ignored this sanity check, then will allow // users to specify some self-conflicting configuration in the descriptor. for (i = 0; i < instance_len; ++i) { - if (this->plan_.instance[i].deployedResource.length () != 0) + if (false && this->plan_.instance[i].deployedResource.length () != 0) { - target_resource_id = + target_resource_id = this->plan_.instance[i].deployedResource[0].resourceName.in (); // Some component instance has server resource usage defined, so we @@ -55,16 +55,16 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) CIAO::DAnCE::ServerResource *server_resource_def = 0; this->plan_.infoProperty[j].value >>= server_resource_def; - if (ACE_OS::strcmp ((*server_resource_def).Id, + if (ACE_OS::strcmp ((*server_resource_def).Id, target_resource_id) == 0) { // Found the target server resource def, and store it. this->node_info_->nodeapp_config.length (1); - this->node_info_->nodeapp_config[0].name = + this->node_info_->nodeapp_config[0].name = CORBA::string_dup ("CIAOServerResource"); - this->node_info_->nodeapp_config[0].value <<= + this->node_info_->nodeapp_config[0].value <<= *server_resource_def; break; } @@ -73,15 +73,15 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) } } -void +void CIAO::NodeImplementationInfoHandler::populate_container_impl_infos (void) { - CORBA::ULong curr_len = + CORBA::ULong curr_len = this->containers_info_map_.containers_info ()->length (); ACE_UNUSED_ARG (curr_len); - + // assignment operation - this->node_info_->impl_infos = + this->node_info_->impl_infos = *(this->containers_info_map_.containers_info ()); } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc index 4f4e2e6478a..9ceae6ca738 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc @@ -17,6 +17,9 @@ project(NodeApplicationManager): ciao_component_dnc, ciao_deployment_svnt, dance NodeApplicationManager_Impl.cpp ImplementationInfo.cpp Containers_Info_Map.cpp + URL_Parser.cpp + HTTP_Handler.cpp + HTTP_Client.cpp ../NodeApplication/NodeApplication_Core.cpp ../NodeApplication/NodeApp_Configurator.cpp ../NodeApplication/NodeApplication_Impl.cpp @@ -29,6 +32,9 @@ project(NodeApplicationManager): ciao_component_dnc, ciao_deployment_svnt, dance NodeApplicationManager_Impl.h ImplementationInfo.h Containers_Info_Map.h + URL_Parser.h + HTTP_Handler.h + HTTP_Client.h NodeApplicationManager_Export.h } } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index 0538f110189..3c5744cd3e6 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -2,9 +2,12 @@ #include "NodeApplicationManager_Impl.h" #include "ace/Process.h" + #include "ace/OS_NS_stdio.h" +#include "ace/Sched_Params.h" #include "ciao/Container_Base.h" #include "NodeApplication/NodeApplication_Impl.h" +#include "ace/Reactor.h" #if !defined (__ACE_INLINE__) # include "NodeApplicationManager_Impl.inl" @@ -63,98 +66,112 @@ create_connections (ACE_ENV_SINGLE_ARG_DECL) for (Component_Iterator iter (this->component_map_.begin ()); iter != end; ++iter) - { - // If this component is in the "shared components list", then we - // should just simply fetch the port object references from the - // NodeManager. - ACE_CString comp_name ((*iter).ext_id_.c_str ()); - - // Get all the facets first - Components::FacetDescriptions_var facets; - - if (is_shared_component (comp_name)) - facets = this->node_manager_->get_all_facets (comp_name); - else - { - facets = ((*iter).int_id_)->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); - this->node_manager_->set_all_facets (comp_name, facets); - } + { + // If this component is in the "shared components list", then we + // should just simply fetch the port object references from the + // NodeManager. + ACE_CString comp_name ((*iter).ext_id_.c_str ()); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::create_connections -" - "success getting facets for the component " - "instance [%s] \n", - comp_name.c_str ())); - } + // Get all the facets first + Components::FacetDescriptions_var facets; - // Get all the event consumers - Components::ConsumerDescriptions_var consumers; - - if (is_shared_component (comp_name)) - consumers = this->node_manager_->get_all_consumers (comp_name); - else - { - consumers = - ((*iter).int_id_)->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); - this->node_manager_->set_all_consumers (comp_name, consumers); - } + if (is_shared_component (comp_name)) + { + ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Componsnt %s is shared\n", + comp_name.c_str ())); + facets = this->node_manager_->get_all_facets (comp_name); + } + else + { + ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Component %s is not shared, getting and setting" + "all facets\n", + comp_name.c_str ())); + facets = ((*iter).int_id_)->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + this->node_manager_->set_all_facets (comp_name, facets); + } - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::create_connections -" - "success getting consumers for the component " - "instance [%s] \n", - comp_name.c_str ())); - } + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, + "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" + "CIAO::NodeApplicationManager_Impl::create_connections -" + "success getting facets for the component " + "instance [%s] \n", + comp_name.c_str ())); + } - CORBA::ULong facet_len = facets->length (); - CORBA::ULong consumer_len = consumers->length (); + // Get all the event consumers + Components::ConsumerDescriptions_var consumers; - CORBA::ULong curr_len = retv->length (); - retv->length (curr_len + facet_len + consumer_len); + if (is_shared_component (comp_name)) + { + ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Componsnt %s is shared\n", + comp_name.c_str ())); + consumers = this->node_manager_->get_all_consumers (comp_name); + } + else + { + ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Component %s is not shared, getting and setting" + "all facets\n", + comp_name.c_str ())); + consumers = + ((*iter).int_id_)->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + this->node_manager_->set_all_consumers (comp_name, consumers); + } - CORBA::ULong i = 0; - for (i = 0; i < facet_len; ++i) - { - Deployment::Connection & conn = retv[len]; - conn.instanceName = (*iter).ext_id_.c_str (); - conn.portName = facets[i]->name (); if (CIAO::debug_level () > 9) { ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::create_connections -" - "adding connection for facet [%s] in instance [%s] \n", - conn.portName.in (), conn.instanceName.in ())); + "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" + "CIAO::NodeApplicationManager_Impl::create_connections -" + "success getting consumers for the component " + "instance [%s] \n", + comp_name.c_str ())); } - conn.kind = Deployment::Facet; - conn.endpoint = CORBA::Object::_duplicate (facets[i]->facet_ref ()); - ++len; - } - for (i = 0; i < consumer_len; ++i) - { - Deployment::Connection & conn = retv[len]; - conn.instanceName = (*iter).ext_id_.c_str (); - conn.portName = consumers[i]->name (); - if (CIAO::debug_level () > 9) + CORBA::ULong facet_len = facets->length (); + CORBA::ULong consumer_len = consumers->length (); + + CORBA::ULong curr_len = retv->length (); + retv->length (curr_len + facet_len + consumer_len); + + CORBA::ULong i = 0; + for (i = 0; i < facet_len; ++i) { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::create_connections -" - "adding connection for consumer [%s] in instance [%s] \n", - conn.portName.in (), conn.instanceName.in ())); + Deployment::Connection & conn = retv[len]; + conn.instanceName = (*iter).ext_id_.c_str (); + conn.portName = facets[i]->name (); + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, + "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" + "CIAO::NodeApplicationManager_Impl::create_connections -" + "adding connection for facet [%s] in instance [%s] \n", + conn.portName.in (), conn.instanceName.in ())); + } + conn.kind = Deployment::Facet; + conn.endpoint = CORBA::Object::_duplicate (facets[i]->facet_ref ()); + ++len; + } + + for (i = 0; i < consumer_len; ++i) + { + Deployment::Connection & conn = retv[len]; + conn.instanceName = (*iter).ext_id_.c_str (); + conn.portName = consumers[i]->name (); + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, + "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" + "CIAO::NodeApplicationManager_Impl::create_connections -" + "adding connection for consumer [%s] in instance [%s] \n", + conn.portName.in (), conn.instanceName.in ())); + } + conn.kind = Deployment::EventConsumer; + conn.endpoint = CORBA::Object::_duplicate (consumers[i]->consumer ()); + ++len; } - conn.kind = Deployment::EventConsumer; - conn.endpoint = CORBA::Object::_duplicate (consumers[i]->consumer ()); - ++len; } - } return retv._retn (); } @@ -184,7 +201,7 @@ startLaunch (const Deployment::Properties & configProperty, if (this->plan_.instance.length () == this->shared_components_.length ()) { ACE_DEBUG ((LM_DEBUG, "Prespawn a NodeApplication process without " - "installing any components.\n")); + "installing any components.\n")); } /** @@ -251,6 +268,7 @@ startLaunch (const Deployment::Properties & configProperty, comp_info = this->nodeapp_->install (*node_info ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + // Now fill in the map we have for the "newly installed" components. const CORBA::ULong comp_len = comp_info->length (); for (CORBA::ULong len = 0; @@ -261,15 +279,15 @@ startLaunch (const Deployment::Properties & configProperty, if (this->component_map_. bind (comp_info[len].component_instance_name.in(), Components::CCMObject::_duplicate - (comp_info[len].component_ref.in()))) + (comp_info[len].component_ref.in()))) { ACE_CString error ("Duplicate component instance name "); error += comp_info[len].component_instance_name.in(); ACE_TRY_THROW (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); + ("NodeApplicationManager_Impl::startLaunch", + error.c_str ())); } } @@ -280,16 +298,16 @@ startLaunch (const Deployment::Properties & configProperty, for (CORBA::ULong j = 0; j < shared_comp_length; ++j) { if (this->component_map_. - bind (this->shared_components_[j].name.in (), - Components::CCMObject::_nil ())) + bind (this->shared_components_[j].name.in (), + Components::CCMObject::_nil ())) { ACE_CString error ("Duplicate component instance name "); error += this->shared_components_[j].name.in(); ACE_TRY_THROW (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); + ("NodeApplicationManager_Impl::startLaunch", + error.c_str ())); } } @@ -302,27 +320,27 @@ startLaunch (const Deployment::Properties & configProperty, { ACE_TRY_THROW (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - "Error creating connections for components during startLaunch.")); + ("NodeApplicationManager_Impl::startLaunch", + "Error creating connections for components during startLaunch.")); } } ACE_CATCH (Deployment::UnknownImplId, e) { ACE_THROW_RETURN (Deployment::StartError (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_CATCH (Deployment::ImplEntryPointNotFound, e) { ACE_THROW_RETURN (Deployment::StartError (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_CATCH (Deployment::InstallationFailure,e) { ACE_THROW_RETURN (Deployment::StartError (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_ENDTRY; ACE_CHECK_RETURN (Deployment::Application::_nil()); @@ -397,7 +415,7 @@ perform_redeployment (const Deployment::Properties & configProperty, } // package the components - NodeImplementationInfoHandler handler (tmp_plan, + NodeImplementationInfoHandler handler (tmp_plan, this->shared_components_); Deployment::NodeImplementationInfo * node_info = handler.node_impl_info (); @@ -423,22 +441,22 @@ perform_redeployment (const Deployment::Properties & configProperty, // Now fill in the map we have for the components. const CORBA::ULong comp_len = comp_info->length (); for (CORBA::ULong len = 0; - len < comp_len; - ++len) + len < comp_len; + ++len) { //Since we know the type ahead of time...narrow is omitted here. if (this->component_map_. bind (comp_info[len].component_instance_name.in(), Components::CCMObject::_duplicate - (comp_info[len].component_ref.in()))) + (comp_info[len].component_ref.in()))) { ACE_CString error ("Duplicate component instance name "); error += comp_info[len].component_instance_name.in(); ACE_TRY_THROW (Deployment::PlanError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); + ("NodeApplicationManager_Impl::startLaunch", + error.c_str ())); } } @@ -451,9 +469,9 @@ perform_redeployment (const Deployment::Properties & configProperty, if (providedReference == 0) { ACE_TRY_THROW - (Deployment::InstallationFailure - ("NodeApplicationManager_Impl::startLaunch", - "Error creating connections during startLaunch.")); + (Deployment::InstallationFailure + ("NodeApplicationManager_Impl::startLaunch", + "Error creating connections during startLaunch.")); } // @@TODO // Do an iteration over the , for those components that @@ -462,30 +480,30 @@ perform_redeployment (const Deployment::Properties & configProperty, else // This is a new NodeApplication process, then we need to install // all the components. We should try to reuse much of the above code. { - this->startLaunch (configProperty, - providedReference, - start - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->startLaunch (configProperty, + providedReference, + start + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } } ACE_CATCH (Deployment::UnknownImplId, e) { ACE_THROW_RETURN (Deployment::UnknownImplId (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_CATCH (Deployment::ImplEntryPointNotFound, e) { ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_CATCH (Deployment::InstallationFailure,e) { ACE_THROW_RETURN (Deployment::InstallationFailure (e.name.in (), - e.reason.in ()), - Deployment::Application::_nil()); + e.reason.in ()), + Deployment::Application::_nil()); } ACE_ENDTRY; ACE_CHECK_RETURN (Deployment::Application::_nil()); @@ -512,8 +530,8 @@ destroyApplication (Deployment::Application_ptr app { CIAO_TRACE("CIAO::NodeApplicationManager_Impl::destroyApplication"); ACE_UNUSED_ARG (app); - printf("Entering NAM_Impl::destroyApplication\n"); + ACE_DEBUG ((LM_DEBUG, "NAM: entering DA\n")); //ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); //@@ Since we know there is only 1 nodeapp so the passed in // parameter is ignored for now. @@ -525,27 +543,113 @@ destroyApplication (Deployment::Application_ptr app // are removed, then we shall kill the NA totally. for (CORBA::ULong i = 0; i < this->plan_.instance.length (); ++i) { + ACE_DEBUG ((LM_DEBUG, "NAM: first for loop: %s\n", + this->plan_.instance[i].name.in ())); ACE_CString name = plan_.instance[i].name.in (); if (this->is_shared_component (name)) - continue; + { + this->component_map_.unbind (name); + continue; + } // If this is not a shared component and is installed within // this NAM, then remove it. Otherwise, we do nothing. // Ideally, we should ask NM to remove this component for // us even if this is not within this NAM. if (! this->is_external_component (name)) - this->nodeapp_->remove_component (name.c_str ()); + { + ACE_DEBUG ((LM_DEBUG, "NAM: contacting nodeapp\n")); + this->nodeapp_->remove_component (name.c_str ()); + ACE_DEBUG ((LM_DEBUG, "NAM: nodeapp contacted\n")); + this->component_map_.unbind (name); + } } - + // Call remove on NodeApplication, if all the components are removed, // then the NodeApplication will kill itself. + ACE_DEBUG ((LM_DEBUG, "NAM: calling remove\n")); this->nodeapp_->remove (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_DEBUG ((LM_DEBUG, "NAM: remove returned\n")); ACE_CHECK; - printf("Exiting NAM_Impl::destroyApplication\n"); return; } +// The set priority method +::CORBA::Long +CIAO::NodeApplicationManager_Impl_Base::set_priority ( + const char * cid, + const ::Deployment::Sched_Params & params + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((::CORBA::SystemException)) +{ + if (CIAO::debug_level () > 20) + { + ACE_DEBUG ((LM_DEBUG , "NAM::The component Id received [%s]", cid)); + + ACE_DEBUG ((LM_DEBUG , + "NAM::The params are policy [%d], priority [%d], " + "scope [%d], time [%d]\n", + params.policy_ , + params.priority_, + params.scope_, params.msec_)); + } + + // First validate the values coming in .... + ACE_Sched_Params::Policy policy = params.policy_; + + if (policy != ACE_SCHED_FIFO && + policy != ACE_SCHED_RR && + policy != ACE_SCHED_OTHER) + return -1; + + ACE_Sched_Priority priority = params.priority_; + + // check the scope .. + if (params.scope_ != ACE_SCOPE_PROCESS && + params.scope_ != ACE_SCOPE_THREAD && + params.scope_ != ACE_SCOPE_LWP) + { + return -1; + } + + // Here form the ACE_Sched_Params structure and pass it on to the Process + // manager with the current process id. + // @@ TODO: Right now we are ignoring params.msec_ value since + // ACE_OS::sched_params fails setting errno = EINVAL if + // scope = ACE_PROCESS_SCOPE and quantun != ACE_Time_Value:zero. + ACE_Sched_Params sched_params (policy , + priority, + params.scope_, + ACE_Time_Value::zero); + + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + if (node_app_process_manager_.set_scheduler (sched_params, process_id_) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "User is not superuser, therefore cannot modify the " + "priority of the component\n")); + } + else if (ACE_OS::last_error () == ESRCH) + { + ACE_DEBUG ((LM_DEBUG, + "No process with PID: %d was found!\n", + process_id_)); + } + else if (ACE_OS::last_error () == EINVAL) + { + ACE_DEBUG ((LM_DEBUG, "\nGiven sched_params does not make sence " + "for the current scheduling policy\n")); + } + ACE_ERROR ((LM_ERROR, "NodeApplicationManager (%P|%t): sched_params " + "failed\n")); + return -1; + } + return 1; +} + CIAO::NodeApplicationManager_Impl::~NodeApplicationManager_Impl (void) { @@ -560,13 +664,13 @@ NodeApplicationManager_Impl (CORBA::ORB_ptr o, PortableServer::ObjectId CIAO::NodeApplicationManager_Impl::init ( - const char *nodeapp_location, - const char *nodeapp_op, - const CORBA::ULong delay, - const Deployment::DeploymentPlan & plan, - const PortableServer::POA_ptr callback_poa, - NodeManager_Impl_Base * nm - ACE_ENV_ARG_DECL) + const char *nodeapp_location, + const char *nodeapp_op, + const CORBA::ULong delay, + const Deployment::DeploymentPlan & plan, + const PortableServer::POA_ptr callback_poa, + NodeManager_Impl_Base * nm + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::InvalidProperty)) { @@ -619,7 +723,22 @@ CIAO::NodeApplicationManager_Impl::init ( Deployment::NodeApplicationManager::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; + + // add the signal handler to the ACE_REACTOR + + /* + if (orb_->orb_core ()->reactor ()-> + register_handler (SIGCHLD, + &child_handler_) == -1) + + if (ACE_Reactor::instance ()->register_handler (SIGCHLD, + &child_handler_) == -1) + { + ACE_DEBUG ((LM_DEBUG, "Error in registering Handler\n\n")); + } + */ } + ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, @@ -655,10 +774,10 @@ create_node_application (const ACE_CString & options CIAO::NodeApplication_Callback_Impl * callback_servant = 0; ACE_NEW_THROW_EX (callback_servant, CIAO::NodeApplication_Callback_Impl (this->orb_.in (), - this->callback_poa_.in (), - this->objref_.in (), - prop.in ()), - CORBA::NO_MEMORY ()); + this->callback_poa_.in (), + this->objref_.in (), + prop.in ()), + CORBA::NO_MEMORY ()); ACE_CHECK_RETURN (Deployment::NodeApplication::_nil()); PortableServer::ServantBase_var servant_var (callback_servant); @@ -667,7 +786,6 @@ create_node_application (const ACE_CString & options ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Deployment::NodeApplication::_nil()); - ACE_Process node_application; ACE_Process_Options p_options; ACE_TRY @@ -694,9 +812,12 @@ create_node_application (const ACE_CString & options cb_ior.in (), options.c_str ()); - p_options.avoid_zombies (1); + p_options.avoid_zombies (0); - if (node_application.spawn (p_options) == -1) + process_id_ = node_app_process_manager_.spawn (p_options, + &child_handler_); + + if (process_id_ == ACE_INVALID_PID) { if (CIAO::debug_level () > 1) { @@ -706,11 +827,11 @@ create_node_application (const ACE_CString & options ACE_TRY_THROW (Deployment::ResourceNotAvailable - ("Failed to spawn process", - "NodeApplication", - "", - "", - "")); + ("Failed to spawn process", + "NodeApplication", + "", + "", + "")); } // wait for nodeApp to pass back its object reference. with a @@ -746,7 +867,7 @@ create_node_application (const ACE_CString & options { //ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); this->nodeapp_ = - Deployment::NodeApplication::_duplicate (retval.in ()); + Deployment::NodeApplication::_duplicate (retval.in ()); } } ACE_CATCHANY @@ -765,20 +886,48 @@ create_node_application (const ACE_CString & options if (CIAO::debug_level () > 1) { ACE_DEBUG ((LM_DEBUG, - "CIAO::NodeApplicationManager_Impl::NodeApplication spawned!\n")); + "CIAO::NodeApplicationManager_Impl::NodeApplication spawned!\n")); } + // push the component info and the process id to the + // NodeManager + push_component_info (process_id_); + + return retval._retn (); } + +void +CIAO::NodeApplicationManager_Impl:: +push_component_info (pid_t process_id) +{ + CIAO::NodeManager_Impl_Base::Component_Ids comp; + + for (unsigned int i=0;i < plan_.instance.length ();i++) + { + if (CIAO::debug_level () > 10) + { + ACE_DEBUG ((LM_DEBUG, "The component id is [%s]", + plan_.instance[i].name.in ())); + } + comp.cid_seq_.insert (plan_.instance[i].name.in ()); + } + + comp.process_id_ = process_id; + + node_manager_->push_component_id_info (comp); +} + + CIAO::Static_NodeApplicationManager_Impl::~Static_NodeApplicationManager_Impl (void) { } CIAO::Static_NodeApplicationManager_Impl:: Static_NodeApplicationManager_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps) + PortableServer::POA_ptr p, + Static_Config_EntryPoints_Maps* static_config_entrypoints_maps) : NodeApplicationManager_Impl_Base (o, p), static_config_entrypoints_maps_ (static_config_entrypoints_maps) { @@ -786,13 +935,13 @@ Static_NodeApplicationManager_Impl (CORBA::ORB_ptr o, PortableServer::ObjectId CIAO::Static_NodeApplicationManager_Impl::init ( - const char *nodeapp_location, - const char *nodeapp_op, - const CORBA::ULong delay, - const Deployment::DeploymentPlan & plan, - const PortableServer::POA_ptr callback_poa, - NodeManager_Impl_Base * nm - ACE_ENV_ARG_DECL) + const char *nodeapp_location, + const char *nodeapp_op, + const CORBA::ULong delay, + const Deployment::DeploymentPlan & plan, + const PortableServer::POA_ptr callback_poa, + NodeManager_Impl_Base * nm + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::InvalidProperty)) { @@ -854,12 +1003,12 @@ create_node_application (const ACE_CString & options ACE_DEBUG ((LM_DEBUG, "create_static_node_application\n")); ACE_NEW_RETURN (nodeapp_servant, - CIAO::NodeApplication_Impl (orb_.in (), - poa_.in (), - configurator_, - this->static_config_entrypoints_maps_), + CIAO::NodeApplication_Impl (orb_.in (), + poa_.in (), + configurator_, + this->static_config_entrypoints_maps_), Deployment::NodeApplication::_nil () - ); + ); if (nodeapp_servant->init (ACE_ENV_SINGLE_ARG_PARAMETER)) { ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ @@ -871,12 +1020,12 @@ create_node_application (const ACE_CString & options // CONFIGURING NodeApplication PortableServer::ObjectId_var nodeapp_oid = poa_->activate_object (nodeapp_servant - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; CORBA::Object_var obj = poa_->id_to_reference (nodeapp_oid.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Deployment::NodeApplication_var nodeapp_obj = diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h index 96affb146d9..d133ed64fb2 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h @@ -26,6 +26,8 @@ #include "ace/SString.h" #include "ace/Hash_Map_Manager_T.h" +#include "ace/OS_NS_sys_wait.h" +#include "ace/Process_Manager.h" #include "ciao/NodeApp_CB_Impl.h" #include "ciao/DeploymentS.h" #include "ciao/CIAO_common.h" @@ -36,6 +38,7 @@ namespace CIAO { + /** * @class NodeApplicationManager_Impl_Base */ @@ -142,6 +145,13 @@ namespace CIAO /// @note This method doesn't do duplicate. Deployment::NodeApplicationManager_ptr get_nodeapp_manager (void); + /// Set the priority of the NodeApplication process which this NAM manages + virtual ::CORBA::Long set_priority ( + const char * cid, + const ::Deployment::Sched_Params & params + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException )); + protected: /// Destructor virtual ~NodeApplicationManager_Impl_Base (void); @@ -234,9 +244,51 @@ namespace CIAO /// Synchronize access to the object set. TAO_SYNCH_MUTEX lock_; + + /// The Process Manager for this NodeApplicationManager + ACE_Process_Manager node_app_process_manager_; + + /// The process id of the NA associated with the NAM, + /// Each NAM will only have one NA associated with it, + /// so we have only one process associated with it. + + // this is UNIX specific .... not portable + pid_t process_id_; }; + /** + * @class NAM_Handler + * @brief The signal handler class for the SIGCHLD + * handling to avoid zombies + * + */ + class NAM_Handler : public ACE_Event_Handler + { + public: + virtual int handle_signal (int sig, + siginfo_t *, + ucontext_t *) + { + ACE_UNUSED_ARG (sig); + + // @@ Note that this code is not portable to all OS platforms + // since it uses print statements within signal handler context. + //ACE_DEBUG ((LM_DEBUG, + // "Executed ACE signal handler for signal %S \n", + // sig)); + + ACE_exitcode status; + // makes a claal to the underlying os system call + // -1 to wait for any child process + // and WNOHANG so that it retuurns immediately + ACE_OS::waitpid (-1 ,&status, WNOHANG, 0); + + return 0; + } + }; + + /** * @class NodeApplicationManager_Impl */ @@ -272,6 +324,18 @@ namespace CIAO Deployment::ResourceNotAvailable, Deployment::StartError, Deployment::InvalidProperty)); + + + /** + * @operation push_component_info + * @brief pushes component info to the NodeManager + * + * @param process_id The id of the process of NodeApplication + */ + void push_component_info (pid_t process_id); + + /// The signal handler + NAM_Handler child_handler_; }; @@ -319,7 +383,6 @@ namespace CIAO CIAO::NoOp_Configurator configurator_; }; - } #if defined (__ACE_INLINE__) diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp new file mode 100644 index 00000000000..7eed65dafbb --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp @@ -0,0 +1,103 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/ARGV.h" +#include "URL_Parser.h" + +#include "ace/OS_NS_string.h" + +bool +URL_Parser::parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("rwu:h:p:f:d")); + + bool success = true; + int c; + + while ((c = get_opt ()) != -1) + switch (c) + { + case 'd': + this->debug_ = 1; + break; + case 'u': + success = parseURL (get_opt.opt_arg ()); + break; + // Usage fallthrough. + default: + success = false; + } + if (this->hostname_ == 0 || this->filename_ == 0) + success = false; + + return success; +} + +URL_Parser::URL_Parser (void) + : hostname_ ("127.0.0.1"), + port_ (ACE_DEFAULT_HTTP_SERVER_PORT), + filename_ (0), + debug_ (0) +{ +} + +bool URL_Parser::parseURL (char* url) +{ + char* ptr; + bool success = true; + + if (ptr = ACE_OS::strstr (url, "http://")) + url += ACE_OS::strlen ("http://"); + + if (url[0] == '/') + { + this->filename_ = ACE_OS::strdup (url); + } + else + { + if (ptr = ACE_OS::strstr (url, ":")) + this->port_ = ACE_OS::atoi (ptr + 1); + else + ptr = ACE_OS::strstr (url, "/"); + + if(!ptr) + success = false; + else + { + size_t host_len = ptr - url; + ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false); + ACE_OS::strncpy (this->hostname_, url, host_len); + this->hostname_ [host_len] = '\0'; + + if (ptr = ACE_OS::strstr (ptr, "/")) + { + this->filename_ = ACE_OS::strdup(ptr); + } + else + success = false; + } + } + return success; +} + + +void URL_Parser::Error (void) +{ + ACE_DEBUG ((LM_DEBUG, "./http_client -u http://hostname:port/filename [-d]\n")); + +} + + + URL_Parser::~URL_Parser() + { + if(this->hostname_) + { + delete [] this->hostname_; + this->hostname_ =0; + } + if (this->filename_) + { + ACE_OS::free (this->filename_); + this->filename_ = 0; + } + } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h b/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h new file mode 100644 index 00000000000..aaaeab4960c --- /dev/null +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h @@ -0,0 +1,68 @@ + +/* -*- C++ -*- */ + +//============================================================================= +/** + * @file URL_Parser.h + * + * $Id$ + * + * Parses a URL into its logical chunks + * + * + * @author Stoyan Paunov + */ +//============================================================================= + + +#ifndef URL_PARSER_H +#define URL_PARSER_H + +#include "ace/Get_Opt.h" +#include "ace/ARGV.h" +#include "ace/Singleton.h" //for ACE_Singleton +#include "ace/Null_Mutex.h" //for ACE_Null_Mutex + +//forward declaration +class URL_Parser; + +typedef ACE_Singleton TheURL_Parser; + + +class URL_Parser +{ +public: + + friend class ACE_Singleton ; + + /// parses commandline arguments + bool parse_args (int argc, ACE_TCHAR *argv[]); + + //return false on failure + bool parseURL (char* url); + + void Error (void); + + /// Hostname to connect to + ACE_TCHAR *hostname_; + + /// Port number to use + u_short port_; + + /// Filename to upload/download + ACE_TCHAR *filename_; + + /// turns on verbosity + int debug_; + + //destructor + ~URL_Parser (void); + +protected: + URL_Parser (void); + // protected constructor, singleton +}; + + + +#endif /* URL_PARSER_H */ diff --git a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp b/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp index 7c5485adf82..cbd494ac776 100644 --- a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp @@ -56,15 +56,24 @@ int CIAO::CIAO_Monitor::stop () { if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Inside the get_current_data")); + // ACE_DEBUG ((LM_DEBUG , + // "CIAO_Monitor::Inside the get_current_data of[%s]\n", + // current_domain_->node[0].name.in ())); } - float current_load; + CORBA::Double current_load = 0; + + long user_cpu; + long user_cpu_low; + long sys_cpu; + long idle_time; // get the load average value from the /proc/loadavg - FILE *load_file = ACE_OS::fopen ("/proc/loadavg", "r"); - + FILE *load_file = 0; + + load_file = ACE_OS::fopen ("/proc/stat", "r"); + if (load_file == 0) { // load file cannot be opened .. @@ -72,25 +81,90 @@ int CIAO::CIAO_Monitor::stop () } else { - fscanf (load_file, "%f", ¤t_load); + char buffer [99]; + + // read in the cpu label + fscanf (load_file, "%s", buffer); + + //read the user_cpu + fscanf (load_file, "%ld", &user_cpu); + + //read the user cpu low priority + fscanf (load_file, "%ld", &user_cpu_low); + + //read the system cpu + fscanf (load_file, "%ld", &sys_cpu); + + //read the cpu in idle time .. + fscanf (load_file, "%ld", &idle_time); + + if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Current load is %d\n",current_load)); + // ACE_DEBUG ((LM_DEBUG , "Current load is %d\n",current_load)); } + + ACE_OS::fclose (load_file); + + + // Calculate the percent CPU + + long current_user_cpu = user_cpu - prev_user_cpu_; + long total_cpu_usage = user_cpu + user_cpu_low + sys_cpu + + idle_time - prev_user_cpu_ - prev_idle_time_ - prev_sys_cpu_ + - prev_user_cpu_low_; + + current_load = (current_user_cpu * 100)/total_cpu_usage; + + // Save the current cpu values in the previous variables + + prev_user_cpu_ = user_cpu; + + prev_user_cpu_low_ = user_cpu_low; + + prev_sys_cpu_ = sys_cpu; + + prev_idle_time_ = idle_time; + } - ACE_OS::fclose (load_file); - CORBA::Any any; - any <<= current_load; + CORBA::Any any; + any <<= current_load; + + // here insert the util value, in the right position + + for (unsigned int i = 0; + i < current_domain_->node[0].resource.length (); + i++) + { + if (!strcmp (current_domain_->node[0].resource[i].name, "Processor")) + { + // ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::The Resource found\n")); + for (unsigned int j = 0; + j < current_domain_->node[0].resource[i].property.length (); + j++) + { + if (!strcmp ( + current_domain_ + ->node[0].resource[i].property[j].name.in (), + "LoadAverage")) + { + //ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::The property found\n")); + current_domain_->node[0].resource[i].property[j].kind = + ::Deployment::Quantity; + current_domain_->node[0].resource[i].property[j].value = + any; + } + } + } + } - current_domain_->node[0].resource[0].property[0].kind = ::Deployment::Quantity; - current_domain_->node[0].resource[0].property[0].value = any; - if (CIAO::debug_level () > 9) + if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Exiting from the get_current_data function\n")); + //ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::Exiting from the get_current_data function\n")); } - return current_domain_.get (); + return current_domain_.get (); } diff --git a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.h b/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.h index d6f15d06802..62fd78da735 100644 --- a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.h +++ b/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.h @@ -100,6 +100,19 @@ namespace CIAO /// The Domain data structure auto_ptr current_domain_; + + ///The previous user cpu + long prev_user_cpu_; + + ///The previous user cpu low priority + long prev_user_cpu_low_; + + ///The previous system cpu + long prev_sys_cpu_; + + ///The previous idle time + long prev_idle_time_; + }; } // CIAO diff --git a/TAO/CIAO/DAnCE/NodeManager/Monitor.mpc b/TAO/CIAO/DAnCE/NodeManager/Monitor.mpc index 911b8bc9ce8..d082a5ecd3c 100644 --- a/TAO/CIAO/DAnCE/NodeManager/Monitor.mpc +++ b/TAO/CIAO/DAnCE/NodeManager/Monitor.mpc @@ -1,12 +1,12 @@ // $Id$ -// MPC file for the Monitor +// MPC file for the Monitor project(*monitorlib): ciao_client_dnc{ after += CIAO_TargetManager_stub includes += $(CIAO_ROOT)/DAnCE/TargetManager - sharedname = ciaomonlib + sharedname = ciaomonlib libs += TargetManager_stub CIAO_Deployment_stub @@ -15,7 +15,7 @@ project(*monitorlib): ciao_client_dnc{ Header_Files { } - + Inline_Files { } diff --git a/TAO/CIAO/DAnCE/NodeManager/MonitorCB.cpp b/TAO/CIAO/DAnCE/NodeManager/MonitorCB.cpp index 5bd59627d2e..c5333d60a77 100644 --- a/TAO/CIAO/DAnCE/NodeManager/MonitorCB.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/MonitorCB.cpp @@ -39,16 +39,20 @@ int CIAO::MonitorCB::update_data (::Deployment::Domain& data) try { - if (CIAO::debug_level () > 9) + if (CIAO::debug_level () > 20) { - ACE_DEBUG ((LM_DEBUG , "---Making a call to update\n")); + ACE_DEBUG ((LM_DEBUG , "CIAO::NM::MonitorCB::Making a call to update\n")); } target_mgr_->updateDomain (elements , domain , update_kind); } - catch (CORBA::Exception&) + catch (CORBA::Exception& ex) { - ACE_DEBUG ((LM_DEBUG, "Unknown Exception")); + //ACE_DEBUG ((LM_DEBUG, "CIAO::NM::MonitorCB::Unknown Exception\n")); + //ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NM::MonitorCB::updateDomain"); + } + catch (...) + { + // ignore } - return 0; } diff --git a/TAO/CIAO/DAnCE/NodeManager/MonitorController.cpp b/TAO/CIAO/DAnCE/NodeManager/MonitorController.cpp index fc009f1b3fe..dd1c987a434 100644 --- a/TAO/CIAO/DAnCE/NodeManager/MonitorController.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/MonitorController.cpp @@ -16,10 +16,15 @@ #include "MonitorCB.h" #include "CIAO_common.h" + #include "ace/Log_Msg.h" #include "ace/DLL.h" #include "ace/SString.h" +#include "NodeManager_Impl.h" + + + namespace CIAO { typedef MonitorBase* (*MonitorFactory) (void); @@ -36,18 +41,22 @@ namespace CIAO CIAO::MonitorController::MonitorController (CORBA::ORB_ptr orb, ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target + ::Deployment::TargetManager_ptr target, + ::CIAO::NodeManager_Impl_Base* node_mgr ) : target_facet_i_ (::Deployment::TargetManager::_duplicate (target)), terminate_flag_ (0), orb_ (orb), - initial_domain_ (domain) + initial_domain_ (domain), + node_mgr_ (node_mgr), + monitor_cpu_usage_ (0), + add_component_pid_ (1) { } int CIAO::MonitorController::svc (void) { - ACE_DLL dll; + ACE_DLL dll; // forming the library name ACE_CString lib_name = ACE_DLL_PREFIX; @@ -74,6 +83,7 @@ int CIAO::MonitorController::svc (void) { ACE_TRACE ((LM_DEBUG "Inside the init call\n")); + // here creating the monitor object monitor_.reset ((MonitorBase*) factory ()); monitor_->initialize_params (initial_domain_, target_facet_i_.in (), @@ -83,30 +93,108 @@ int CIAO::MonitorController::svc (void) // Start the Monitor monitor_->start (orb_); auto_ptr monitor_callback (new CIAO::MonitorCB (orb_, - target_facet_i_.in (), - interval)); + target_facet_i_.in (), + interval)); + + // check if cpu needs to be monitored or not + for (unsigned int i = 0;i < initial_domain_.node[0].resource.length ();i++) + { + if (!strcmp (initial_domain_.node[0].resource[i].name, "Processor")) + monitor_cpu_usage_ = 1; + } + + // Wait for system to stabilize itself + ACE_OS::sleep (interval); + // The loop in which UpdateData is called while (!terminating ()) { + + //ACE_DEBUG ((LM_DEBUG , "=The Terminate is %d\n", terminate_flag_)); + + + // if monitoring of cpu is enable , monitor , else dont do + // anything + ::Deployment::Domain* domain; + + if (monitor_cpu_usage_) + domain = monitor_->get_current_data (); + else + domain = &initial_domain_; + + + + // ****** add component data ******************* + + NodeManager_Impl_Base::Component_Ids cids = + node_mgr_->get_component_detail (); + + // Here save the old resource length + int counter = domain->node[0].resource.length (); + + // if pid is already added , dont add + if (add_component_pid_) + { + // then add more resource element to the + // domain structure + // ACE_DEBUG ((LM_DEBUG , "Going to add CID/PID data\n")); + int new_res_size = domain->node[0].resource.length () + + cids.cid_seq_.size (); + + domain->node[0].resource.length (new_res_size); + + ACE_Unbounded_Set_Iterator iter (cids.cid_seq_); + + for (iter = cids.cid_seq_.begin (); + iter != cids.cid_seq_.end (); + iter++,counter++) + { + domain->node[0].resource[counter].name = + CORBA::string_dup ("Component"); + domain->node[0].resource[counter].resourceType.length (0); + + // Have one property for now + domain->node[0].resource[counter].property.length (1); + domain->node[0].resource[counter].property[0].name = + CORBA::string_dup ((*iter).c_str ()); + domain->node[0].resource[counter].property[0].kind = + ::Deployment::Quantity; + domain->node[0].resource[counter].property[0].dynamic = + 0; + domain->node[0].resource[counter].property[0].value <<= + CORBA::Long (cids.process_id_); + + // ACE_DEBUG ((LM_DEBUG , "The process id is [%d]\n", + // CORBA::Long (cids.process_id_))); + } + // set the add_component_pid_ to 0 + add_component_pid_ = 0; + } + + //******add compoennt data + + monitor_callback->update_data (*domain); + // data will be updated in intervals of 10 secs. // in the latest version of spec , this value will // come from Execution Manager ACE_OS::sleep (interval); - // ACE_DEBUG ((LM_DEBUG , "=The Terminate is %d\n", terminate_flag_)); - ::Deployment::Domain* domain = - monitor_->get_current_data (); - monitor_callback->update_data (*domain); } monitor_->stop (); } + // here delete the monitor object before + // unloading the library + monitor_.reset (); + + // unload the library dll.close (); if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Terminating Monitor\n")); + ACE_DEBUG ((LM_DEBUG , "CIAO::Monitor::Terminating Monitor\n")); } return 0; } @@ -124,7 +212,7 @@ void CIAO::MonitorController::terminate () guard, lock_ ); - ACE_DEBUG ((LM_DEBUG , "WITHIN TERMINATE CALL ......")); + //ACE_DEBUG ((LM_DEBUG , "WITHIN TERMINATE CALL ......\n")); terminate_flag_=1; } diff --git a/TAO/CIAO/DAnCE/NodeManager/MonitorController.h b/TAO/CIAO/DAnCE/NodeManager/MonitorController.h index 9fc62beed8b..9a02042022b 100644 --- a/TAO/CIAO/DAnCE/NodeManager/MonitorController.h +++ b/TAO/CIAO/DAnCE/NodeManager/MonitorController.h @@ -15,6 +15,8 @@ #define MONITOR_CONTROLLER_H #include "NodeManager_svnt_export.h" +#include "Deployment_BaseC.h" + #include "TargetManager/TargetManagerC.h" #include "ace/Task.h" #include "ace/Auto_Ptr.h" @@ -23,7 +25,6 @@ #include "ace/Synch.h" - /** * @namespace CIAO * @@ -36,6 +37,8 @@ namespace CIAO class MonitorBase; + class NodeManager_Impl_Base; + /** * @class MonitorController * @@ -66,46 +69,56 @@ namespace CIAO * thread */ void terminate (); - - + + /// The Constructor. MonitorController (CORBA::ORB_ptr orb, ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target + ::Deployment::TargetManager_ptr target, + ::CIAO::NodeManager_Impl_Base* node_mgr ); - + ~MonitorController (); protected: - + /** * @function terminating. * @brief returns the terminating flag * @return bool The terminting state of the thread */ bool terminating (); - + /// The monitor object auto_ptr monitor_; - + /// The TargetManagerImpl object CIAO::TargetManagerImpl_var target_impl_cmp_; - + /// The TargetManager Facet .... Deployment::TargetManager_var target_facet_i_; - + /// The terminate flag_ bool terminate_flag_; - + //Thread Mutex for synchronizing call ACE_SYNCH_MUTEX lock_; - + // the ORB pointer .. CORBA::ORB_ptr orb_; - + /// The initial domain ::Deployment::Domain initial_domain_; + + /// The Node Manager + ::CIAO::NodeManager_Impl_Base* node_mgr_; + + /// flag tells ; what to monitor + bool monitor_cpu_usage_; + + /// TO add component pid or not .. + bool add_component_pid_; }; } // CIAO - + #endif diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager.mpc b/TAO/CIAO/DAnCE/NodeManager/NodeManager.mpc index ec5eabcca8a..192fe6f31f0 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager.mpc +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager.mpc @@ -8,10 +8,10 @@ project(NodeManager_svnt): ciao_component_dnc, iortable, ifr_client, dance_exten libs += NodeManager_stub NodeApplicationManager TargetManager_stub CIAO_NoOp_Configurator includes += $(CIAO_ROOT)/ciao $(CIAO_ROOT)/DAnCE/Interfaces $(CIAO_ROOT)/DAnCE/TargetManager dynamicflags = NODEMANAGER_SVNT_BUILD_DLL - + IDL_Files { } - + Source_Files { ../Interfaces/NodeManagerS.cpp NodeManager_Impl.cpp diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp index db1c0883454..052b5bdbfc0 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp @@ -3,21 +3,22 @@ #include "NodeManager_Impl.h" #include "../NodeApplicationManager/NodeApplicationManager_Impl.h" #include "ace/Log_Msg.h" +#include CIAO::NodeManager_Impl_Base::NodeManager_Impl_Base (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * nodeapp_loc, - const char * nodeapp_options, - int spawn_delay) + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char * nodeapp_loc, + const char * nodeapp_options, + int spawn_delay) ACE_THROW_SPEC ((CORBA::SystemException)) - : orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - name_ (CORBA::string_dup (name)), - nodeapp_location_ (CORBA::string_dup (nodeapp_loc)), - nodeapp_options_ (CORBA::string_dup (nodeapp_options)), - callback_poa_ (PortableServer::POA::_nil ()), - spawn_delay_ (spawn_delay) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + name_ (CORBA::string_dup (name)), + nodeapp_location_ (CORBA::string_dup (nodeapp_loc)), + nodeapp_options_ (CORBA::string_dup (nodeapp_options)), + callback_poa_ (PortableServer::POA::_nil ()), + spawn_delay_ (spawn_delay) { } @@ -71,48 +72,88 @@ void CIAO::NodeManager_Impl_Base::shutdown (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); ACE_CHECK; } void CIAO::NodeManager_Impl_Base::joinDomain (const Deployment::Domain & domain, - Deployment::TargetManager_ptr target, - Deployment::Logger_ptr - ACE_ENV_ARG_DECL) + Deployment::TargetManager_ptr target, + Deployment::Logger_ptr + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { -// ACE_THROW (CORBA::NO_IMPLEMENT ()); -// Here start the Monitor - CIAO_TRACE("CIAO::NodeManager_Impl_Base::joinDomain"); - - ::Deployment::Domain this_domain = domain; -// MonitorController* monitor_controller - monitor_controller_.reset ( - new MonitorController (orb_.in (), - this_domain, - target)); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "Before Activate")); - } + // ACE_THROW (CORBA::NO_IMPLEMENT ()); + // Here start the Monitor + CIAO_TRACE("CIAO::NodeManager_Impl_Base::joinDomain"); + + ::Deployment::Domain this_domain = domain; + + monitor_controller_.reset ( + new MonitorController (orb_.in (), + this_domain, + target, + this)); + + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG , "Before Activate\n")); + } /// Activate the Monitor Controller to //start the monitoring - monitor_controller_->activate (); + monitor_controller_->activate (); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "After Activate")); - } + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG , "Monitor Activated\n")); + } } void CIAO::NodeManager_Impl_Base::leaveDomain (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - //Implementation undefined. - ACE_THROW (CORBA::NO_IMPLEMENT ()); + // Delete the monitor , this will also terminate the thread + monitor_controller_.reset (); +} + +CORBA::Long +CIAO::NodeManager_Impl_Base::set_priority ( + const char * plan_id, + const char * cid, + const ::Deployment::Sched_Params & nm_params + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC ((::CORBA::SystemException)) + +{ + ACE_CString key (plan_id); + key += "@"; + key += this->name_.in (); + + if (CIAO::debug_level () > 10) + { + ACE_DEBUG ((LM_DEBUG , "Inside the set_priority\n")); + ACE_DEBUG ((LM_DEBUG , "pid = [%s] , cid = [%s]\n", key.c_str () , cid)); + } + + try { + CORBA::Object_var obj = + this->poa_->id_to_reference (this->map_.get_nam (key)); + + Deployment::NodeApplicationManager_var nam = + Deployment::NodeApplicationManager::_narrow (obj.in ()); + + return nam->set_priority (cid, nm_params); + } + catch (CORBA::Exception& ex) + { + + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "(%P|%t) NodeManager_Impl::set_priority ()\t\n"); + ACE_RE_THROW; + } } ::Components::FacetDescriptions * @@ -123,7 +164,7 @@ get_all_facets (ACE_CString & name) if (this->comp_facets_map_.find (name.c_str (), entry) != 0) ACE_DEBUG ((LM_ERROR, "(%P|%t) - NodeManager_Impl_Base::get_all_facets - " - "No component with name [%s] was found in the NodeManager\n", name.c_str ())); + "No component with name [%s] was found in the NodeManager\n", name.c_str ())); CORBA::ULong facet_len = entry->int_id_->length (); @@ -150,7 +191,7 @@ get_all_consumers (ACE_CString & name) if (this->comp_consumers_map_.find (name.c_str (), entry) != 0) ACE_DEBUG ((LM_ERROR, "(%P|%t) - NodeManager_Impl_Base::get_all_facets - " - "Component [%s] was not found in the NodeManager\n", name.c_str ())); + "Component [%s] was not found in the NodeManager\n", name.c_str ())); CORBA::ULong consumer_len = entry->int_id_->length (); @@ -197,10 +238,10 @@ CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan if (! this->validate_plan (plan)) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) NodeManager <%s>:prepare_plan:Plan_Error.\n", - plan.instance[0].node.in ())); + plan.instance[0].node.in ())); ACE_DEBUG ((LM_DEBUG, "(%P|%t) All component instances hosted in the " - "same component server must have the " - "same \"resourceName\" defined.\n")); + "same component server must have the " + "same \"resourceName\" defined.\n")); ACE_THROW_RETURN (Deployment::PlanError (), Deployment::NodeApplicationManager::_nil ()); @@ -329,8 +370,8 @@ CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan void CIAO::NodeManager_Impl_Base::destroyManager - (Deployment::NodeApplicationManager_ptr manager - ACE_ENV_ARG_DECL) +(Deployment::NodeApplicationManager_ptr manager + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StopError, Deployment::InvalidReference)) @@ -338,7 +379,6 @@ CIAO::NodeManager_Impl_Base::destroyManager CIAO_TRACE("CIAO::NodeManager_Impl::destroyManager"); ACE_TRY { - printf("Entering NM_Impl::destroyManager\n"); // Deactivate this object PortableServer::ObjectId_var id = this->poa_->reference_to_id (manager @@ -355,7 +395,6 @@ CIAO::NodeManager_Impl_Base::destroyManager this->poa_->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - printf("Exiting NM_Impl::destroyManager\n"); } ACE_CATCH (PortableServer::POA::WrongAdapter, ex) { @@ -398,6 +437,9 @@ destroyPlan (const Deployment::DeploymentPlan & plan CORBA::ULong const length = plan.instance.length (); for (CORBA::ULong i = 0; i < length; ++i) { + ACE_DEBUG ((LM_DEBUG, "NM_DP - forloop instance %s\n", + plan.instance[i].name.in ())); + Reference_Count_Map::ENTRY *entry = 0; if (this->ref_count_map_.find (plan.instance[i].name.in (), entry) == 0) { @@ -406,23 +448,25 @@ destroyPlan (const Deployment::DeploymentPlan & plan if (entry->int_id_.count_ == 0) { // Remove this component from the shared set + ACE_DEBUG ((LM_DEBUG, "\tremoving shared...\n")); this->shared_components_.remove (plan.instance[i].name.in ()); - + ACE_DEBUG ((LM_DEBUG, "\tunbinding from the ref count map\n")); // Unbind this component from the ref_count_map_ this->ref_count_map_.unbind (plan.instance[i].name.in ()); + ACE_DEBUG ((LM_DEBUG, "\tunbinding from the facet/consumer maps\n")); // Unbind this component from the facet/consumer maps if (this->comp_facets_map_.unbind ( - plan.instance[i].name.in ()) != 0 || + plan.instance[i].name.in ()) != 0 || this->comp_consumers_map_.unbind ( - plan.instance[i].name.in ()) != 0) + plan.instance[i].name.in ()) != 0) { ACE_TRY_THROW (Deployment::StopError ("NodeManager_Impl_Base::destroyPlan ", "Unable to find component instance")); } } - } + } } // Find the NAM from the map and invoke the destroyPlan() operation on @@ -434,10 +478,12 @@ destroyPlan (const Deployment::DeploymentPlan & plan Deployment::NodeApplicationManager_var nam = Deployment::NodeApplicationManager::_narrow (obj.in ()); + // Reset each NAM about the shared components information Deployment::ComponentPlans_var shared = this->get_shared_components_i (); + ACE_DEBUG ((LM_DEBUG, "contacting the nams - set shared components\n")); nam->set_shared_components (shared.inout ()); - + ACE_DEBUG ((LM_DEBUG, "contacting the nams destroyApplication\n")); nam->destroyApplication (0); @@ -486,8 +532,8 @@ CIAO::NodeManager_Impl_Base::get_shared_components_i (void) { // should never happen ACE_DEBUG ((LM_ERROR, "Component [%s] in the list of shared component, " - "was not found in the NodeManager ref count map.\n", - (*iter).c_str ())); + "was not found in the NodeManager ref count map.\n", + (*iter).c_str ())); } } @@ -523,6 +569,9 @@ validate_plan (const Deployment::DeploymentPlan &plan) const char * resource_id = 0; CORBA::ULong i = 0; + // Update the name of ourself + this->name_ = plan.instance[0].node.in (); + for (i = 0; i < plan.instance.length (); ++i) { if (plan.instance[i].deployedResource.length () != 0) @@ -531,9 +580,10 @@ validate_plan (const Deployment::DeploymentPlan &plan) // the "resourceValue" field represents the policy_set_id, so we // are checking to make sure that all component instances have // the same server_resource_id. - resource_id = - plan.instance[i].deployedResource[0].resourceName.in (); - break; + + //resource_id = + // plan.instance[i].deployedResource[0].resourceName.in (); + //break; } } if (i == plan.instance.length ()) // No server resource id has been set for any instance @@ -542,7 +592,7 @@ validate_plan (const Deployment::DeploymentPlan &plan) for (i = 0; i < plan.instance.length (); ++i) { const char * my_resource_id; - if (plan.instance[i].deployedResource.length () == 0) + if (true || plan.instance[i].deployedResource.length () == 0) { continue; } @@ -560,17 +610,31 @@ validate_plan (const Deployment::DeploymentPlan &plan) return true; } + +void CIAO::NodeManager_Impl_Base:: +push_component_id_info (Component_Ids comps) +{ + components_ = comps; +} + +CIAO::NodeManager_Impl_Base::Component_Ids +CIAO::NodeManager_Impl_Base:: +get_component_detail () +{ + return components_; +} + CIAO::NodeManager_Impl::~NodeManager_Impl () { } CIAO::NodeManager_Impl:: NodeManager_Impl (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * nodeapp_loc, - const char * nodeapp_options, - int spawn_delay) + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char * nodeapp_loc, + const char * nodeapp_options, + int spawn_delay) : NodeManager_Impl_Base (name, orb, poa, nodeapp_loc, nodeapp_options, spawn_delay) {} @@ -596,12 +660,12 @@ CIAO::Static_NodeManager_Impl::~Static_NodeManager_Impl () CIAO::Static_NodeManager_Impl:: Static_NodeManager_Impl (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * nodeapp_loc, - const char * nodeapp_options, - int spawn_delay, - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps) + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char * nodeapp_loc, + const char * nodeapp_options, + int spawn_delay, + Static_Config_EntryPoints_Maps* static_config_entrypoints_maps) : NodeManager_Impl_Base (name, orb, poa, nodeapp_loc, nodeapp_options, spawn_delay), static_config_entrypoints_maps_ (static_config_entrypoints_maps) {} @@ -613,20 +677,22 @@ create_node_app_manager (CORBA::ORB_ptr orb, ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_DEBUG ((LM_DEBUG, "creating static_node_app_manager\n")); + if (CIAO::debug_level () > 10) + ACE_DEBUG ((LM_DEBUG, "creating static_node_app_manager\n")); + CIAO::NodeApplicationManager_Impl_Base *app_mgr; ACE_NEW_THROW_EX (app_mgr, - CIAO::Static_NodeApplicationManager_Impl (orb, - poa, - this->static_config_entrypoints_maps_), - CORBA::NO_MEMORY ()); + CIAO::Static_NodeApplicationManager_Impl (orb, + poa, + this->static_config_entrypoints_maps_), + CORBA::NO_MEMORY ()); return app_mgr; } void CIAO::Static_NodeManager_Impl::destroyManager - (Deployment::NodeApplicationManager_ptr manager - ACE_ENV_ARG_DECL) +(Deployment::NodeApplicationManager_ptr manager + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StopError, Deployment::InvalidReference)) diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h index bae08351a45..1003f18327e 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h @@ -123,6 +123,17 @@ namespace CIAO get_shared_components (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((::CORBA::SystemException)); + /// RACE specific extension. Modify the priority of a node application + /// process. + + virtual ::CORBA::Long + set_priority ( + const char * plan_id, + const char * cid, + const ::Deployment::Sched_Params & nm_params + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException)); + // ********* CIAO Specific Helper functions ************ virtual ::Components::FacetDescriptions * @@ -139,6 +150,19 @@ namespace CIAO set_all_consumers (ACE_CString &name, const ::Components::ConsumerDescriptions_var & consumers); + // ********* Function added for getting component ids... + + struct Component_Ids + { + ACE_Unbounded_Set cid_seq_; + pid_t process_id_; + }; + + virtual void push_component_id_info (Component_Ids comps); + + + Component_Ids get_component_detail (); + private: /// Validate the child deployment plan. In particular, we are /// trying to verify that all the component instances within this @@ -232,6 +256,9 @@ namespace CIAO /// The MonitorController pointer auto_ptr monitor_controller_; + + /// The set of Components + Component_Ids components_; }; diff --git a/TAO/CIAO/DAnCE/NodeManager/Node_Manager.cpp b/TAO/CIAO/DAnCE/NodeManager/Node_Manager.cpp index 7318939fe16..4c3684f5d3c 100644 --- a/TAO/CIAO/DAnCE/NodeManager/Node_Manager.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/Node_Manager.cpp @@ -17,6 +17,7 @@ char *default_svcconf_ = 0; char *svcconf_config_ = 0; char *nodeapp_location_ = 0; char *nodeapp_options_ = 0; +const char *pid_file_name_ = 0; int write_to_ior_ = 0; int register_with_ns_ = 0; int nodeapp_loc_ = 0; @@ -25,29 +26,33 @@ int spawn_delay = 1; int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "o:c:m:s:d:na:"); + ACE_Get_Opt get_opts (argc, argv, "o:c:m:s:d:na:p:z:"); int c; while ((c = get_opts ()) != -1) switch (c) { + case 'z': + nodeapp_options_ = "-ORBDebugLevel 10"; + break; + case 'o': // get the file name to write to - ior_file_name_ = get_opts.opt_arg (); - write_to_ior_ = 1; - break; + ior_file_name_ = get_opts.opt_arg (); + write_to_ior_ = 1; + break; case 'c': // get the default svc.conf filename default_svcconf_ = get_opts.opt_arg (); - break; + break; case 'm': // get the svc.conf map configuration filename svcconf_config_ = get_opts.opt_arg (); - break; + break; case 's': //get the location to spawn the NodeApplication nodeapp_location_ = get_opts.opt_arg (); nodeapp_loc_ = 1; - break; + break; case 'a': // Nodeapplication arguments nodeapp_options_ = get_opts.opt_arg (); @@ -55,11 +60,15 @@ parse_args (int argc, char *argv[]) case 'd': //get the spawn delay argument spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; + break; case 'n': register_with_ns_ = 1; - break; + break; + + case 'p': + pid_file_name_ = get_opts.opt_arg (); + break; case '?': // display help for use of the server. default: @@ -71,6 +80,7 @@ parse_args (int argc, char *argv[]) "-s \n" "-a \n" "-d \n" + "-p \n" "\n", argv [0]), -1); @@ -96,6 +106,23 @@ write_IOR(const char* ior) return 0; } +void +write_pid (void) +{ + if (pid_file_name_ == 0) + return; + + FILE* pid_file = ACE_OS::fopen (pid_file_name_, "w"); + + if (pid_file) + { + ACE_OS::fprintf (pid_file, + "%i", + ACE_OS::getpid ()); + ACE_OS::fclose (pid_file); + } +} + bool register_with_ns (const char * name_context, CORBA::ORB_ptr orb, @@ -116,8 +143,16 @@ register_with_ns (const char * name_context, name.length (1); name[0].id = name_context; - // Register the servant with the Naming Service - naming_context->bind (name, obj); + try + { + // Register the servant with the Naming Service + naming_context->bind (name, obj); + } + catch (CosNaming::NamingContext::AlreadyBound &) + { + ACE_DEBUG ((LM_DEBUG, "Node_Manager.cpp: Name already bound, rebinding....\n")); + naming_context->rebind (name, obj); + } return true; } @@ -170,7 +205,7 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (CORBA::is_nil (adapter.in ())) - ACE_ERROR_RETURN ((LM_ERROR, "Nil IORTable\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "Nil IORTable\n"), -1); // Create and install the CIAO NodeManager servant CIAO::NodeManager_Impl *node_manager_servant = 0; @@ -184,9 +219,9 @@ main (int argc, char *argv[]) -1); PortableServer::ServantBase_var safe_daemon (node_manager_servant); - + node_manager_servant->init (); - + // Implicit activation CIAO::NodeManager_var node_manager = node_manager_servant->_this (); @@ -232,19 +267,21 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; // Here start the Monitor -/* - MonitorController* monitor_controller - = new MonitorController (orb); + /* + MonitorController* monitor_controller + = new MonitorController (orb); - ACE_DEBUG ((LM_DEBUG , "Before Activate")); - monitor_controller->activate (); - ACE_DEBUG ((LM_DEBUG , "After Activate")); -*/ + ACE_DEBUG ((LM_DEBUG , "Before Activate")); + monitor_controller->activate (); + ACE_DEBUG ((LM_DEBUG , "After Activate")); + */ // Finishing Deployment part ACE_DEBUG ((LM_DEBUG, "CIAO_NodeManager is running...\n")); + write_pid (); + // Run the main event loop for the ORB. orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; diff --git a/TAO/CIAO/DAnCE/NodeManager/README b/TAO/CIAO/DAnCE/NodeManager/README index 2b6553863eb..09f407f6a65 100644 --- a/TAO/CIAO/DAnCE/NodeManager/README +++ b/TAO/CIAO/DAnCE/NodeManager/README @@ -9,5 +9,5 @@ some port of all the hosts that have NodeApplication install to function properly. The port to run this daemon can be set by using the TAO ORB options command of -ORBEndpoint . This replaces the earlier CIAO_Daemon implementation of CIAO as defined in the CCM -specification. -*/ \ No newline at end of file +specification. +*/ diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index ab0ea432153..5d2978c7ce5 100644 --- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -20,7 +20,7 @@ namespace CIAO const char* dap_ior_filename = 0; const char* dap_ior = 0; - enum mode_type { + enum mode_type { pl_mode_start, pl_mode_interactive, pl_mode_stop_by_dam, @@ -94,15 +94,15 @@ namespace CIAO } } - if ((mode != pl_mode_stop_by_dam) && + if ((mode != pl_mode_stop_by_dam) && (mode != pl_mode_stop_by_uuid) && - (package_url == 0) && + (package_url == 0) && (new_package_url ==0)) { usage (argv[0]); return false; } - + return true; } @@ -153,32 +153,32 @@ namespace CIAO if (parse_args (argc, argv) == false) return -1; - - + + Plan_Launcher_i launcher; - + if (!launcher.init (use_naming ? 0 : ior_file, orb.in ())) { ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error initializing the EM.\n")); return -1; } - + ::Deployment::DomainApplicationManager_var dapp_mgr; - + if (mode == pl_mode_start || mode == pl_mode_interactive) // initial deployment { const char* uuid = launcher.launch_plan (package_url); - + if (uuid == 0) { ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error launching plan\n")); return -1; } - + ACE_DEBUG ((LM_DEBUG, "Plan_Launcher returned UUID is %s\n", uuid)); dapp_mgr = launcher.get_dam (uuid); - + // Write out DAM ior if requested if (mode == pl_mode_start) write_dap_ior (orb.in (), dapp_mgr.in ()); @@ -203,7 +203,7 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "Plan_Launcher: reconfigure application assembly.....")); const char* uuid = launcher.re_launch_plan (new_package_url); - + if (uuid == 0) { ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error re-launching plan\n")); @@ -239,7 +239,7 @@ namespace CIAO "(%P|%t) CIAO_PlanLauncher:tear down assembly failed: " "unkonw plan uuid.\n")); } - + orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -276,6 +276,6 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { //ACE_DEBUG ((LM_DEBUG, "NEW PLAN LAUNCHER\n")); - + return run_main_implementation (argc, argv); } diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index c8522b9b4fb..7f5aa59ceda 100644 --- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -10,7 +10,7 @@ namespace CIAO { namespace Plan_Launcher { - + static CORBA::Object_ptr fetch_reference_naming (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) @@ -19,19 +19,17 @@ namespace CIAO orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + CosNaming::NamingContext_var pns = CosNaming::NamingContext::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - - CosNaming::Name name (2); - name.length (2); + + CosNaming::Name name (1); + name.length (1); name[0].id = - CORBA::string_dup ("CIAO"); - name[1].id = CORBA::string_dup ("ExecutionManager"); - + return pns->resolve (name ACE_ENV_ARG_PARAMETER); } @@ -40,13 +38,13 @@ namespace CIAO : em_ () { } - + bool Plan_Launcher_i::init (const char *em_ior, - CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) + CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) { CORBA::Object_var obj; - + if (em_ior == 0) { obj = fetch_reference_naming (orb ACE_ENV_ARG_PARAMETER); @@ -58,55 +56,63 @@ namespace CIAO ACE_ENV_ARG_PARAMETER); ACE_CHECK; } - + this->em_ = ::CIAO::ExecutionManagerDaemon::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + if (CORBA::is_nil (this->em_.in ())) { ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher: nil Execution" - " Manager reference, narrow failed\n")); + "(%P|%t) CIAO_PlanLauncher: nil Execution" + " Manager reference, narrow failed\n")); return false; } - + if (CIAO::debug_level () > 9) ACE_DEBUG ((LM_DEBUG, "(%P|%t) CIAO_PlanLauncher: Obtained Execution" " Manager ref \n")); - + return true; } - - - const char * + + + const char * Plan_Launcher_i::launch_plan (const char *plan_uri ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { + ACE_DEBUG ((LM_DEBUG, "Parsing plan...\n")); + CIAO::Config_Handlers::XML_File_Intf intf (plan_uri); - + ::Deployment::DeploymentPlan_var plan = intf.get_plan (); - + ACE_DEBUG ((LM_DEBUG, "Parsing complete....\n")); return this->launch_plan (plan.in ()); } - const char * + const char * Plan_Launcher_i::launch_plan (const ::Deployment::DeploymentPlan &plan ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { - + if (CORBA::is_nil (this->em_.in ())) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("CIAO::Plan_Launcher_i: ") - ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); + ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); return 0; } - + + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("about to call this->em_->preparePlan\n"))); ::Deployment::DomainApplicationManager_var dam (this->em_->preparePlan (plan, 1)); - + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("after to call this->em_->preparePlan\n"))); + if (CORBA::is_nil (dam.in ())) { ACE_DEBUG ((LM_DEBUG, @@ -114,20 +120,20 @@ namespace CIAO "nil DomainApplicationManager reference\n")); return 0; } - + if (CIAO::debug_level () > 9) ACE_DEBUG ((LM_DEBUG, "CIAO_PlanLauncher: Obtained DAM ref \n")); - + ::Deployment::Properties_var properties; ACE_NEW_RETURN (properties, Deployment::Properties, 0); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "CIAO_PlanLauncher: start Launch application...\n")); - + // Dont not start the Application immediately since it vialtes // the semantics of component activation sequence int start = 0; @@ -135,33 +141,33 @@ namespace CIAO { dam->startLaunch (properties.in (), 0); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); - + // Call finish Launch to complete the connections if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "CIAO_PlanLauncher: finish Launch application...\n")); dam->finishLaunch (start, false); // is_ReDAC by default is - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); - + // Call start to activate components if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "CIAO_PlanLauncher: start activating components...\n")); dam->start (); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("CIAO_PlanLauncher: ") ACE_TEXT ("Application Deployed successfully\n"))); - + map_.bind_dam_reference (plan.UUID.in (), Deployment::DomainApplicationManager::_duplicate (dam.in ())); } @@ -177,7 +183,7 @@ namespace CIAO ex.resourceType.in (), ex.propertyName.in (), ex.elementName.in (), - ex.resourceName.in ())); + ex.resourceName.in ())); ACE_THROW (Deployment_Failure ()); } ACE_CATCH (Deployment::StartError, ex) @@ -204,15 +210,28 @@ namespace CIAO ex.reason.in ())); ACE_THROW (Deployment_Failure ()); } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, + "CORBA EXCEPTION: %s\n", + ACE_ANY_EXCEPTION._info().fast_rep())); + ACE_THROW (Deployment_Failure ()); + } + ACE_CATCHALL + { + ACE_ERROR ((LM_ERROR, + "EXCEPTION: non-CORBA exception\n")); + ACE_THROW (Deployment_Failure ()); + } ACE_ENDTRY; ACE_CHECK_RETURN (0); - + std::string * retv = new std::string (plan.UUID.in ()); - - return (*retv).c_str (); + + return (*retv).c_str (); } - - ::Deployment::DomainApplicationManager_ptr + + ::Deployment::DomainApplicationManager_ptr Plan_Launcher_i::get_dam (const char *uuid ACE_ENV_ARG_DECL) { if (!this->map_.is_plan_available (uuid)) @@ -224,7 +243,7 @@ namespace CIAO } return this->map_.fetch_dam_reference (uuid); } - + bool Plan_Launcher_i::teardown_plan (const char *uuid) { @@ -232,31 +251,31 @@ namespace CIAO // executable to tear down a plan, so we could NOT rely on the local // DAM_Map to fetch DAM obj reference. Instead, we make a remote call // on ExecutionManager to fetch it. - ACE_TRY + ACE_TRY { ::Deployment::DomainApplicationManager_var dapp_mgr = - this->em_->getManager (uuid); + this->em_->getManager (uuid); - dapp_mgr->destroyApplication (); - if (CIAO::debug_level ()) - ACE_DEBUG ((LM_DEBUG, "[success]\n")); + dapp_mgr->destroyApplication (); + if (CIAO::debug_level ()) + ACE_DEBUG ((LM_DEBUG, "[success]\n")); - // Note that we should ask the DAM to tell EM whether the DAM should - // be destroyed - this->destroy_dam_by_plan (uuid); + // Note that we should ask the DAM to tell EM whether the DAM should + // be destroyed + this->destroy_dam_by_plan (uuid); } ACE_CATCHANY { ACE_DEBUG ((LM_ERROR, "Unable to find DomainApplicationManager " - "for plan with uuid: %s\n", uuid)); + "for plan with uuid: %s\n", uuid)); return false; } ACE_ENDTRY; return true; } - - bool + + bool Plan_Launcher_i::teardown_plan (::Deployment::DomainApplicationManager_ptr dam ACE_ENV_ARG_DECL) { @@ -265,16 +284,16 @@ namespace CIAO "CIAO_PlanLauncher: destroy the application.....\n")); dam->destroyApplication (); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "[success]\n")); this->destroy_dam (dam); - + return true; } - - void + + void Plan_Launcher_i::destroy_dam (::Deployment::DomainApplicationManager_ptr dam ACE_ENV_ARG_DECL) { @@ -288,7 +307,7 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "[success]\n")); } - void + void Plan_Launcher_i::destroy_dam_by_plan (const char* plan_uuid ACE_ENV_ARG_DECL) { @@ -302,40 +321,40 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "[success]\n")); } - const char * + const char * Plan_Launcher_i::re_launch_plan (const char *plan_uri ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { CIAO::Config_Handlers::XML_File_Intf intf (plan_uri); - + ::Deployment::DeploymentPlan_var plan = intf.get_plan (); - + return this->re_launch_plan (plan.in ()); } - const char * + const char * Plan_Launcher_i::re_launch_plan (const ::Deployment::DeploymentPlan &plan ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { - + if (CORBA::is_nil (this->em_.in ())) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_TEXT ("CIAO::Plan_Launcher_i: ") - ACE_TEXT ("re_launch_plan called witn an uninitialized EM.\n"))); + ACE_TEXT ("re_launch_plan called witn an uninitialized EM.\n"))); return 0; } - + this->em_->perform_redeployment (plan); - + if (CIAO::debug_level ()) ACE_DEBUG ((LM_DEBUG, "CIAO_PlanLauncher: new plan redeployed ...\n")); std::string * retv = new std::string (plan.UUID.in ()); - - return (*retv).c_str (); + + return (*retv).c_str (); } } } diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h index 8f4f3c7d127..371d7eb2f19 100644 --- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h +++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h @@ -1,8 +1,8 @@ -/** +/** * $Id$ * @file Plan_Launcher_Impl.h * @author Will Otte - * + * * Contains the Plan_Launcher_i class, which can be used by * applications to launch component assemblies. */ @@ -19,7 +19,7 @@ namespace CIAO { namespace Plan_Launcher { - + /** * @class Plan_Launcher_i * @brief This class launches and manages deployment plans. @@ -28,11 +28,11 @@ namespace CIAO { public: class Deployment_Failure {}; - + Plan_Launcher_i (); - - - bool init (const char *em_ior, + + + bool init (const char *em_ior, CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_WITH_DEFAULTS); @@ -49,7 +49,7 @@ namespace CIAO const char * re_launch_plan (const char *plan_uri ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment_Failure)); - + /** * @fn launch_plan * @brief Launch a plan, given an IDL deployment plan @@ -63,30 +63,30 @@ namespace CIAO const char * re_launch_plan (const ::Deployment::DeploymentPlan &plan ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment_Failure)); - + /// Returns the DAM associated with a given plan URI ::Deployment::DomainApplicationManager_ptr get_dam (const char *uuid ACE_ENV_ARG_DECL_WITH_DEFAULTS); - + /// Tears down a plan given the UUID bool teardown_plan (const char *uuid ACE_ENV_ARG_DECL); - + bool teardown_plan (::Deployment::DomainApplicationManager_ptr dam ACE_ENV_ARG_DECL_WITH_DEFAULTS); - + void destroy_dam (::Deployment::DomainApplicationManager_ptr dam ACE_ENV_ARG_DECL_WITH_DEFAULTS); void destroy_dam_by_plan (const char * plan_uuid ACE_ENV_ARG_DECL_WITH_DEFAULTS); - + private: ::CIAO::ExecutionManagerDaemon_var em_; - + /// Local map for DAMs, to save expensive UUID lookups. Execution_Manager::DAM_Map map_; }; - + } } diff --git a/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.cpp b/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.cpp index 4f92f0edbe9..4cba063e6d4 100644 --- a/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.cpp +++ b/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.cpp @@ -19,7 +19,7 @@ CIAO::NodeApplication_Task::svc () { CORBA::Object_var object = this->orb_->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; RTCORBA::RTORB_var rt_orb = @@ -29,7 +29,7 @@ CIAO::NodeApplication_Task::svc () object = this->orb_->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; PortableServer::POA_var root_poa = @@ -84,18 +84,18 @@ CIAO::NodeApplication_Task::svc () */ bool retval = nodeapp_servant->init (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - + if (retval) - { - ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ + { + ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ initializing the session container!")); - return 1; - } - + return 1; + } + CORBA::String_var str = this->orb_->object_to_string (nodeapp_obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (this->options_.ior_output_filename_.length () != 0) CIAO::Utility::write_IOR (this->options_.ior_output_filename_.c_str (), str.in ()); @@ -118,7 +118,7 @@ CIAO::NodeApplication_Task::svc () CIAO::NodeApplication_Callback_var nam_callback = CIAO::NodeApplication_Callback::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; Deployment::Properties_out properties_out (prop.out ()); diff --git a/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.inl b/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.inl index c3ae7a829b5..b2923cde8aa 100644 --- a/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.inl +++ b/TAO/CIAO/DAnCE/RTNodeApplication/NodeApplication_Task.inl @@ -7,5 +7,5 @@ CIAO::NodeApplication_Task::NodeApplication_Task (ACE_Thread_Manager &tm, : ACE_Task_Base (&tm), orb_ (CORBA::ORB::_duplicate (o)), options_ (opts) -{ +{ } diff --git a/TAO/CIAO/DAnCE/RTNodeApplication/README b/TAO/CIAO/DAnCE/RTNodeApplication/README index 1eb382ceaf7..9a0c7e03aaa 100644 --- a/TAO/CIAO/DAnCE/RTNodeApplication/README +++ b/TAO/CIAO/DAnCE/RTNodeApplication/README @@ -22,18 +22,18 @@ implementation. It will be removed shortly. RTNodeApplication.cpp: Main program NodeApplication_Task.*: ACE_Task class for spawning the thread for - RT-NodeApplication using the right scheduling + RT-NodeApplication using the right scheduling strategy. - RTNodeApplication_Impl.* : Actual RTNodeApplication server implementation. + RTNodeApplication_Impl.* : Actual RTNodeApplication server implementation. senv.sh: A simple shell script for setting up the run-time - environment when starting NodeDaemon with sudo. + environment when starting NodeDaemon with sudo. This is necessary because the RTNodeApplication needs to spawn threads with real-time scheduling class. This operation requires the process to be run by privileged user. - You may need to tweak this shell script to suit your need. - Here's an example of how to use the script: + You may need to tweak this shell script to suit your need. + Here's an example of how to use the script: $ sudo senv.sh $CIAO_ROOT/DAnCE/NodeManager/NodeManager \ -ORBEndpoint iiop://localhost:10000 \ diff --git a/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp b/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp index 0e91f073a9c..ffd85ca1ebf 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp @@ -25,7 +25,7 @@ HTTP_Handler::~HTTP_Handler (void) { if (filename_) { - ACE_OS::free ((void *) filename_); + ACE_OS::free (filename_); filename_ = 0; } } @@ -35,10 +35,10 @@ int HTTP_Handler::open (void *) { if (this->send_request () != 0) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():send_request failed"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():send_request failed\n"), -1); if (this->receive_reply () != 0) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():receive_reply failed"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():receive_reply failed\n"), -1); return 0; } @@ -101,7 +101,7 @@ HTTP_Reader::send_request (void) // Send the message to server if (peer ().send_n (mesg, len) != len) - ACE_ERROR_RETURN((LM_ERROR,"Error sending request"), -1); + ACE_ERROR_RETURN((LM_ERROR,"Error sending request\n"), -1); return 0; @@ -124,7 +124,7 @@ HTTP_Reader::receive_reply (void) //Make sure that response type is 200 OK if (ACE_OS::strstr (buf,"200 OK") == 0) ACE_ERROR_RETURN ((LM_ERROR, - "HTTP_Reader::receiveReply(): Response is not 200 OK" ), -1); + "HTTP_Reader::receiveReply(): Response is not 200 OK\n" ), -1); // Search for the header termination string "\r\n\r\n", or "\n\n". If // found, move past it to get to the data portion. @@ -141,7 +141,7 @@ HTTP_Reader::receive_reply (void) } else - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1); // *************************************************************** // At this point, we have stripped off the header and are ready to @@ -165,7 +165,7 @@ HTTP_Reader::receive_reply (void) // Copy over all the data bytes into our message buffer. if (curr->copy (buf_ptr, bytes_read) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", - "HTTP_Reader::receiveReply():Error copying data into Message_Block" ), -1); + "HTTP_Reader::receiveReply():Error copying data into Message_Block\n" ), -1); //read the rest of the data into a number of ACE_Message_Blocks and //chain them together in a link list fashion @@ -191,7 +191,7 @@ HTTP_Reader::receive_reply (void) } else - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1); }while (num_recvd != 0); diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp index 9858d39a3c5..2096fccbc6f 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp @@ -44,7 +44,7 @@ using namespace PC_Updater_T; PC_Updater::PC_Updater (const char* server_path, const char* package) : server_path_ (server_path), - file_list_ (&allocator_), + file_list_ (), package_ (package), success_ (true) { @@ -53,7 +53,7 @@ PC_Updater::PC_Updater (const char* server_path, const char* package) PC_Updater::PC_Updater (ACE_CString& server_path, ACE_CString& package) : server_path_ (server_path), - file_list_ (&allocator_), + file_list_ (), package_ (package), success_ (true) { @@ -137,7 +137,7 @@ void PC_Updater::clear_list () void PC_Updater::update (const ::Deployment::SubcomponentInstantiationDescription &sid) { - update_sequence (sid.package, this); + update_sequence (sid.basePackage, this); } // SubcomponentPortEndpoint @@ -185,17 +185,13 @@ void PC_Updater::clear_list () //weird. Need to call next to get current ?!?! const char* name; - const char* ext; name = ACE_OS::strstr (str, iad.location[0].in ()); if (name) { - ext = ACE_OS::strstr (name, "."); - ACE_CString loc (this->server_path_); - loc += iad.location[0].in (); - loc += ext; + loc += name; iad.location[0] = CORBA::string_dup (loc.c_str ()); diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h index da254ab97dc..b9d8a1cb7cf 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h @@ -26,12 +26,10 @@ #include "ace/Containers_T.h" //for ACE_Double_Linked_List #include "ace/Malloc_Allocator.h" //for ACE_New_Allocator needed by the doubly link list - #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - /** * @class PC_Updater * @@ -103,7 +101,7 @@ private: ACE_CString server_path_; /// create a doubly link list - ACE_New_Allocator allocator_; + //ACE_New_Allocator allocator_; ACE_Double_Linked_List file_list_; ACE_CString package_; diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp index 2fb6bdb6bd3..f1b53537735 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp @@ -15,7 +15,6 @@ namespace PC_Updater_T for (CORBA::ULong i = 0; i < size; ++i) updater->update (seq[i]); } - } #endif /* PC_Updater_C */ diff --git a/TAO/CIAO/DAnCE/RepositoryManager/README.txt b/TAO/CIAO/DAnCE/RepositoryManager/README.txt index e4cd2fa6397..ee8eb6bcdce 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/README.txt +++ b/TAO/CIAO/DAnCE/RepositoryManager/README.txt @@ -1,28 +1,28 @@ This is the README file for the Repository Manager (RM). -In order to be able to compile the RM you need to have ZZIP lib because the Repository +In order to be able to compile the RM you need to have ZZIP lib because the Repository Manager (RM) uses it to read the contents of CCM packages. ZZIP itself is a C++ wrapper around ZLIB, thus you will also need ZLIB. In order to compile the RM successfully you will need to do the following: - + 1. Download ZLIB and ZZIP-LIB 2. Compile the multi-threaded versions of these libraries -3. [on Windows] create a separate directory for each library; create an include and a lib +3. [on Windows] create a separate directory for each library; create an include and a lib subdirectory within them. Then copy the libraries files in the library subdirectory. -Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h +Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h (for Windows platforms; Linux might have its own file!!!). This step might be easier if you find a binary package of the libraries and just install it. -4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the +4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the libraries and the include files. 5. Turn on zzip and zlib in default.features for MPC. 6. MPC will handle the rest. -Things to watch out for: -On Windows make sure that you are linking the right ZIP libraries -together with the rest of the libraries, i.e. if you are building the debug version of ACE, +Things to watch out for: +On Windows make sure that you are linking the right ZIP libraries +together with the rest of the libraries, i.e. if you are building the debug version of ACE, TAO and CIAO, then use the debug version of the ZIP libraries. Otherwise the RM will compile -but it will not work properly. +but it will not work properly. to compile the idl with the tao_idl compiler: diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp index f2af0de45b5..9c14b6b9608 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp @@ -2,11 +2,11 @@ #include "RM_Helper.h" #include "ciao/Packaging_DataC.h" //for the PackageConfiguration declaration -#include "tao/CDR.h" //for TAO CDR classes -#include "ace/Message_Block.h" //for ACE_Message_Block -#include "ace/Auto_Ptr.h" //for Auto_Ptr -#include "ace/OS_NS_fcntl.h" //for open -#include "ace/OS_NS_unistd.h" //for close +#include "tao/CDR.h" //for TAO CDR classes +#include "ace/Message_Block.h" //for ACE_Message_Block +#include "ace/Auto_Ptr.h" //for Auto_Ptr +#include "ace/OS_NS_fcntl.h" //for open +#include "ace/OS_NS_unistd.h" //for close #include "ace/OS_NS_sys_stat.h" //for filesize and mkdir diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h index 241ae507078..fb2f8a61db0 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h @@ -21,6 +21,7 @@ #include "ciao/Packaging_DataC.h" //for the PackageConfiguration declaration #include "tao/CDR.h" //for TAO CDR classes +#include "ace/Message_Block.h" //for ACE_Message_Block //int operator<< (ACE_OutputCDR& cdr, const Deployment::PackageConfiguration& pc); //int operator>> (ACE_InputCDR& cdr, Deployment::PackageConfiguration& pc); diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp index 0840a02dfb8..705af70b8d3 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp @@ -14,7 +14,6 @@ #include "RepositoryManagerC.h" #include "Options.h" -//#include "Config_Handlers/pcd.hpp" //for the PackageConfiguration data struct #include "ace/OS_NS_fcntl.h" //for open #include "ace/OS_NS_unistd.h" //for close #include "ace/OS_NS_sys_stat.h" //for filesize and fstat and mkdir @@ -228,10 +227,10 @@ CORBA::Octet* read_from_disk ( ACE_OS::fstat (handle, &file_info); - CORBA::Octet* buffer; + CORBA::Octet* buffer = 0; ACE_NEW_RETURN (buffer, CORBA::Octet[file_info.st_size], 0); - //read the contents of the file into the buffer + // read the contents of the file into the buffer if (ACE_OS::read_n (handle, buffer, file_info.st_size) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), @@ -252,7 +251,6 @@ int write_to_disk ( size_t length ) { - // Open a file handle to the local filesystem ACE_HANDLE handle = ACE_OS::open (full_path, O_CREAT | O_TRUNC | O_WRONLY); if (handle == ACE_INVALID_HANDLE) @@ -265,7 +263,7 @@ int write_to_disk ( if (ACE_OS::write (handle, buffer, length) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("[RM::write_to_disk] file write error")), + ACE_TEXT ("[RM::write_to_disk] file write error")), -1); // Close the file handle diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp index 744f5df5a02..b8a94492920 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp @@ -25,35 +25,32 @@ using namespace std; namespace { -///name of the file holding the IOR of the RM +/// Name of the file holding the IOR of the RM const char * rm_ior = "RepositoryManagerDeamon.ior"; -///default number of worker threads to run in the multi-threaded RM +/// Default number of worker threads to run in the multi-threaded RM unsigned int nthreads = 3; } -///Class that implements the service routine of the worker threads -///of the repository manager - +/** + * @class Worker + * + * Class that implements the service routine of the worker threads + * of the repository manager + */ class Worker : public ACE_Task_Base { - // = TITLE - // Run a server thread - // - // = DESCRIPTION - // Use the ACE_Task_Base class to run server threads - // public: + /// ctor Worker (CORBA::ORB_ptr orb); - // ctor + /// The thread entry point. virtual int svc (void); - // The thread entry point. private: + /// The orb CORBA::ORB_var orb_; - // The orb }; diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc index 6ab070bc72a..d558e6fbb46 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc @@ -6,8 +6,11 @@ project (RepositoryManager) : ciao_component_dnc, taoexe, ciao_config_handlers, zzip, zlib { + includes += $(CIAO_ROOT)/tools/Config_Handlers //to circumvent an improper include resolution + //in the Package_Handlers/PC_Intf.h exename = RepositoryManagerDeamon requires += zzip zlib + libs += Package_Config_Handlers IDL_Files { RepositoryManager.idl diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp index 476df857146..0def3f8ff68 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp @@ -30,11 +30,12 @@ #include "ace/Malloc_Allocator.h" //for ACE_New_Allocator //for the PackageConfiguration parsing -#include "Config_Handlers/STD_PC_Intf.h" +//#include "Config_Handlers/Package_Handlers/PC_Intf.h" #include "ciao/Deployment_DataC.h" #include "ciao/Packaging_DataC.h" #include "Config_Handlers/Utils/XML_Helper.h" -#include "xercesc/dom/DOM.hpp" +#include "Config_Handlers/Package_Handlers/PCD_Handler.h" +//#include "xercesc/dom/DOM.hpp" #include "RM_Helper.h" //to be able to externalize/internalize a PackageConfiguration #include "ace/Message_Block.h" //for ACE_Message_Block @@ -153,7 +154,7 @@ void CIAO_RepositoryManagerDaemon_i::installPackage ( //TODO: how can I incorporate a Auto_Ptr is explicit release is needed ACE_Message_Block* mb; - ACE_NEW_THROW_EX (mb, ACE_Message_Block (0,0), CORBA::INTERNAL ()); + ACE_NEW_THROW_EX (mb, ACE_Message_Block (), CORBA::INTERNAL ()); ACE_CHECK_RETURN (0); //get the remote file @@ -169,6 +170,8 @@ void CIAO_RepositoryManagerDaemon_i::installPackage ( mb->release (); ACE_THROW (CORBA::INTERNAL ()); } + + mb->release (); } else { @@ -710,9 +713,8 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_package (char* package) //parse the PCD to make sure that there are no package errors ACE_TRY { - CIAO::Config_Handlers::STD_PC_Intf intf (pcd_name.c_str ()); - - pc = intf.get_PC (); + //CIAO::Config_Handlers::STD_PC_Intf intf (pcd_name.c_str ()); + //pc = intf.get_PC (); } ACE_CATCHALL { @@ -789,9 +791,21 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_descriptors (const char* pc_nam //parse the PCD to make sure that there are no package errors ACE_TRY { - CIAO::Config_Handlers::STD_PC_Intf intf (pc_name); + //CIAO::Config_Handlers::STD_PC_Intf intf (pc_name); + //pc = intf.get_PC (); + if (xercesc::DOMDocument *doc = CIAO::Config_Handlers::XML_HELPER->create_dom (pc_name)) + { + { + //Read in the XSC type structure from the DOMDocument - pc = intf.get_PC (); + //Convert the XSC to an IDL datatype + CIAO::Config_Handlers::Packaging::PCD_Handler::package_config (pc_name, pc); + std::cout << "Instance document import succeeded. Dumping contents to file\n"; + } + + //Cleanliness is next to Godliness + delete doc; + } } ACE_CATCHALL { diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h index 7023b12fa25..a3d9557aa35 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h @@ -33,7 +33,6 @@ #include "RepositoryManagerS.h" -#include "DeploymentS.h" //added for the deployment stuff #include "ace/Hash_Map_Manager.h" //for the ACE_Hash_Map_Manager #include "ace/Null_Mutex.h" //for ACE_Null_Mutex @@ -41,30 +40,29 @@ #include "ace/OS_NS_string.h" //for ACE_CString #include "ace/SString.h" - #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - namespace { -///DIRECTORY WHERE THE PACKAGES WILL BE STORED LOCALLY -const static char* INSTALL_PATH = "RepositoryDir"; + /// Directory where the packages will be stored locally + const static char* INSTALL_PATH = "RepositoryDir"; -const static size_t TEMP_LEN = 512; + const static size_t TEMP_LEN = 512; -const static char* PC_EXTENSION = ".epc"; + const static char* PC_EXTENSION = ".epc"; } -class CIAO_RepositoryManagerDaemon_i : public virtual POA_CIAO::RepositoryManagerDaemon +class CIAO_RepositoryManagerDaemon_i : + public virtual POA_CIAO::RepositoryManagerDaemon { public: - //Constructor + /// Constructor CIAO_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb, const char* server = "http://localhost:5432/"); - //Destructor + /// Destructor virtual ~CIAO_RepositoryManagerDaemon_i (void); virtual @@ -152,34 +150,35 @@ public: protected: - ///function to parse and return the PackageConfiguration from a specified package + /// Function to parse and return the PackageConfiguration from a specified + /// package Deployment::PackageConfiguration* retrieve_PC_from_package (char* package); - ///find out what the name of the PackageConfiguration file is + /// Find out what the name of the PackageConfiguration file is void find_PC_name (char* package, ACE_CString& pcd_name); - ///function to parse and return the PackageConfiguration from the already - ///extracted descriptor files + /// Function to parse and return the PackageConfiguration from the already + /// extracted descriptor files Deployment::PackageConfiguration* retrieve_PC_from_descriptors (const char* pc_name, const char* descriptor_dir); - ///function to retvieve a file via HTTP - ///stores the file in the passed preallocated ACE_Message_Block - ///returns 1 on success - /// 0 on error + /// Function to retrieve a file via HTTP + /// stores the file in the passed preallocated ACE_Message_Block + /// @retval 1 success + /// @retval 0 error int HTTP_Get (const char* URL, ACE_Message_Block &mb); - ///function to extract all necessary files for parsing the PackageConfiguration - ///descriptor and populating the idl struct. - ///return 1 on success - /// 0 on error + /// Function to extract all necessary files for parsing the + /// PackageConfiguration descriptor and populating the idl struct. + /// @retval 1 success + /// @retval 0 error /// - ///NOTE: ACE_CString& pcd_name is an out parameter + /// @note ACE_CString& pcd_name is an out parameter int extract_descriptor_files (char* package, - ACE_CString& pcd_name); + ACE_CString& pcd_name); ///function to remove the files extracted for parsing the PackageConfiguration @@ -270,10 +269,10 @@ public: //a hash map that associates the names of //PackageConfigurations with their location - PCMap names_; + PCMap names_; - //a hash map that associates the UUIDs of - //PackageConfigurations with their location + /// a hash map that associates the UUIDs of + /// PackageConfigurations with their location PCMap uuids_; #if defined ASSEMBLY_INTERFACE_SUPPORT diff --git a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp index 2ab483823b6..7eed65dafbb 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp +++ b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp @@ -50,7 +50,9 @@ bool URL_Parser::parseURL (char* url) url += ACE_OS::strlen ("http://"); if (url[0] == '/') - this->filename_ = url; + { + this->filename_ = ACE_OS::strdup (url); + } else { if (ptr = ACE_OS::strstr (url, ":")) @@ -63,13 +65,13 @@ bool URL_Parser::parseURL (char* url) else { size_t host_len = ptr - url; - ACE_NEW_RETURN (this->hostname_, char [host_len], false); + ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false); ACE_OS::strncpy (this->hostname_, url, host_len); this->hostname_ [host_len] = '\0'; if (ptr = ACE_OS::strstr (ptr, "/")) { - this->filename_ = ptr; + this->filename_ = ACE_OS::strdup(ptr); } else success = false; @@ -89,5 +91,13 @@ void URL_Parser::Error (void) URL_Parser::~URL_Parser() { if(this->hostname_) + { delete [] this->hostname_; + this->hostname_ =0; + } + if (this->filename_) + { + ACE_OS::free (this->filename_); + this->filename_ = 0; + } } diff --git a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h index 54f9db42877..aaaeab4960c 100644 --- a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h +++ b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h @@ -33,6 +33,8 @@ class URL_Parser { public: + friend class ACE_Singleton ; + /// parses commandline arguments bool parse_args (int argc, ACE_TCHAR *argv[]); @@ -53,11 +55,12 @@ public: /// turns on verbosity int debug_; - URL_Parser (void); - // protected constructor, singleton - //destructor ~URL_Parser (void); + +protected: + URL_Parser (void); + // protected constructor, singleton }; diff --git a/TAO/CIAO/DAnCE/StaticConfigurator/README b/TAO/CIAO/DAnCE/StaticConfigurator/README index 76d3c83f48f..e42c1099cfd 100644 --- a/TAO/CIAO/DAnCE/StaticConfigurator/README +++ b/TAO/CIAO/DAnCE/StaticConfigurator/README @@ -3,7 +3,7 @@ Please see $CIAO_ROOT/docs/static_dance.html for details. To run the static version of Hello example, do the following, 1. Build ACE+TAO+CIAO statically -2. Build $CIAO_ROOT/examples/Hello +2. Build $CIAO_ROOT/examples/Hello 3. Generate the static function entrypoints (plan.h) > cd $CIAO_ROOT/examples/Hello/descriptors > $CIAO_ROOT/DAnCE/StaticConfigurator/StaticDAnCEParser -p flattened_deploymentplan_without_ns.cdp @@ -14,15 +14,15 @@ To run the static version of Hello example, do the following, > cp StaticDAnCEApp.mpc.tmpl StaticDAnCEApp.mpc > $ACE_ROOT/bin/mwc.pl > make -5. Run the static node managers. Note that the ORBEndpoint values should +5. Run the static node managers. Note that the ORBEndpoint values should correspond to the ones in $CIAO_ROOT/examples/Hello/descriptors/TestNodeManagerMap.dat > cd $CIAO_ROOT/DAnCE/StaticConfigurator > ./StaticDAnCEApp -ORBEndpoint iiop://localhost:60001 & > ./StaticDAnCEApp -ORBEndpoint iiop://localhost:60002 & -6. Do the deployment. This is just the same as the non-static version of DAnCE - except that we have the NodeManagers already running and need not spawn node - managers. To accomplish this, change - $CIAO_ROOT/examples/Hello/descriptors/run_test_without_ns.pl +6. Do the deployment. This is just the same as the non-static version of DAnCE + except that we have the NodeManagers already running and need not spawn node + managers. To accomplish this, change + $CIAO_ROOT/examples/Hello/descriptors/run_test_without_ns.pl to *not* run the node manager daemons and do the following. > cd $CIAO_ROOT/examples/Hello/descriptors > ./run_test_without_ns.pl diff --git a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.cpp.tmpl b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.cpp.tmpl index 3b230c3c843..370444d528f 100644 --- a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.cpp.tmpl +++ b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.cpp.tmpl @@ -56,13 +56,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) homesvnt_creator_fptr_map.bind (homes_table[i].servant_entrypt_, homes_table[i].servant_fptr_); - } + } CIAO::Static_NodeManager_Impl *static_node_manager_impl; // Create and install the CIAO Daemon servant - + ACE_DEBUG ((LM_DEBUG, "creating static_node_manager\n")); - + static_node_manager_impl = new CIAO::Static_NodeManager_Impl("NodeManager", orb.in (), @@ -70,7 +70,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) "", //exe location "", //exe options 0, //spawn delay - &static_config_entrypoints_maps); + &static_config_entrypoints_maps); static_node_manager_impl->init (); @@ -98,11 +98,11 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) str.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + // Run the main event loop for the ORB. orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - + poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; diff --git a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.mpc.tmpl b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.mpc.tmpl index c9790a28bc3..d237d09ac20 100644 --- a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.mpc.tmpl +++ b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEApp.mpc.tmpl @@ -5,8 +5,8 @@ project(StaticDAnCEApp): ciao_component_dnc, iortable { exename = StaticDAnCEApp requires += exceptions includes += ../NodeApplicationManager ../NodeManager - libs += NodeManager NodeManager_stub NodeApplicationManager - after += NodeManager NodeManager_stub NodeApplicationManager + libs += NodeManager NodeManager_stub NodeApplicationManager + after += NodeManager NodeManager_stub NodeApplicationManager libs += Hello_Base_DnC_stub libs += Hello_Base_DnC_svnt diff --git a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.cpp b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.cpp index bce83577955..b5a496291d8 100644 --- a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.cpp +++ b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.cpp @@ -70,7 +70,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } CIAO::Config_Handlers::XML_File_Intf intf (package_url); - + ::Deployment::DeploymentPlan_var plan = intf.get_plan (); @@ -78,16 +78,16 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) dummy.length (0); NodeImplementationInfoHandler handler (plan, dummy); - + Deployment::NodeImplementationInfo * node_impl_info = handler.node_impl_info (); - + if (!node_impl_info) { - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "DAnCE (%P|%t) StaticParser -" "Failed to create Node Implementation Infos!\n"), 1); - + } Deployment::ContainerImplementationInfos& impl_infos = node_impl_info[0].impl_infos; @@ -123,7 +123,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) "\t\tACE_ENV_ARG_DECL_WITH_DEFAULTS);\n"); } } - + ACE_OS::fprintf (fp, "struct HomeAttributes\n"); ACE_OS::fprintf (fp, "{\n"); ACE_OS::fprintf (fp, " ACE_TString component_instance_name_;\n"); diff --git a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc index a44a4039749..903d754f7fa 100644 --- a/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc +++ b/TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc @@ -3,10 +3,10 @@ project(StaticDAnCEParser): ciao_component_dnc, taoexe, ciao_config_handlers { exename = StaticDAnCEParser - requires += exceptions + requires += exceptions dummy_label includes += .. libs += TAO_IORTable NodeApplicationManager DomainApplicationManager - after += TAO_IORTable NodeApplicationManager DomainApplicationManager NodeManager + after += TAO_IORTable NodeApplicationManager DomainApplicationManager NodeManager Source_Files { StaticDAnCEParser.cpp diff --git a/TAO/CIAO/DAnCE/TargetManager/CmpClient.cpp b/TAO/CIAO/DAnCE/TargetManager/CmpClient.cpp index d695ab38062..b10bf6fd51d 100644 --- a/TAO/CIAO/DAnCE/TargetManager/CmpClient.cpp +++ b/TAO/CIAO/DAnCE/TargetManager/CmpClient.cpp @@ -9,6 +9,7 @@ * TM to getAllResources and getAvailable resources */ +#include "Deployment_DataC.h" #include "TargetManagerC.h" #include "ace/streams.h" #include "Config_Handlers/DnC_Dump.h" @@ -63,6 +64,88 @@ int main (int argc, char* argv[]) ACE_DEBUG((LM_DEBUG ,"Error:TargetManager:Exception in TargetManager call\n")); } + + // make a call to the commit resources ..... + + + Deployment::DeploymentPlan plan; + + plan.instance.length (1); + + ::Deployment::InstanceDeploymentDescription instance_; + instance_.node = CORBA::string_dup ("Delta"); + instance_.deployedResource.length (1); + instance_.deployedResource[0].requirementName = + CORBA::string_dup ("Processor"); + instance_.deployedResource[0].resourceName = + CORBA::string_dup ("CPULoad"); + + instance_.deployedResource[0].property.length (1); + instance_.deployedResource[0].property[0].name = + CORBA::string_dup ("LoadAverage"); + CORBA::Double d = 20; + instance_.deployedResource[0].property[0].value <<= d; + + plan.instance[0] = instance_; + + bool resource_available = 1; + + try + { + targetI->commitResources(plan); + ACE_DEBUG ((LM_DEBUG , "\n\ncommitResources Returned \n")); + } + catch(CORBA::NO_IMPLEMENT &) + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } + catch (Deployment::ResourceNotAvailable & e) + { + resource_available = 0; + cout << "TargetManager commitResources ResourceNotAvailable Exception" <releaseResources(plan); + ACE_DEBUG ((LM_DEBUG , "\n\nreleaseResources Returned \n")); + } + } + catch(CORBA::NO_IMPLEMENT &) + { + cerr << "Error:TargetManager:CORBA::NO_IMPLEMENT thrown" << endl; + } + catch (Deployment::ResourceNotAvailable & e) + { + cout << "Error:TargetManager releaseResources ResourceNotAvailable Exception" < 9) { - ACE_DEBUG ((LM_DEBUG , "Inside The update Domain of Manager\n")); - ACE_DEBUG ((LM_DEBUG , "the length of domain is [%d]", - current_domain_.node.length ())); - ACE_DEBUG ((LM_DEBUG , "domainSubsetNode is \n" )); + /* + ACE_DEBUG ((LM_DEBUG , + "TM::update_domain::Inside The update Domain of Manager\n")); + ACE_DEBUG ((LM_DEBUG , + "TM::update_domain_::The length of domain is [%d]", + current_domain_.node.length ())); + ACE_DEBUG ((LM_DEBUG , + "TM::update_domain::domainSubsetNode is \n" )); + */ } int size = current_domain_.node.length (); + int i; for (i=0;i < size;i++) { - if (!strcmp (domainSubset.node[0].name , current_domain_.node[i].name)) + if (!strcmp (domainSubset.node[0].name , + current_domain_.node[i].name)) { // found a match // for now overwrite the entire Node info ... @@ -46,7 +81,7 @@ int CIAO::DomainDataManager::update_domain (const ::CORBA::StringSeq &, // only the specific part ... if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Changed the memory Value\n")); + ACE_DEBUG ((LM_DEBUG , "TM::Changed the cpu Value\n")); } current_domain_.node[i] = domainSubset.node[0]; break; // finished job ...break @@ -62,7 +97,8 @@ int CIAO::DomainDataManager::update_domain (const ::CORBA::StringSeq &, } if (CIAO::debug_level () > 9) { - ACE_DEBUG ((LM_DEBUG , "Inside The update Domain of Manager\n")); + ACE_DEBUG ((LM_DEBUG , + "TM::Inside The update Domain of Manager\n")); } return 0; } @@ -74,25 +110,33 @@ DomainDataManager (CORBA::ORB_ptr orb, deployment_config_ (orb_.in()), target_mgr_ (::Deployment::TargetManager::_duplicate(target)) { + // ACE_DEBUG((LM_DEBUG , "Calling DD_HANDLER\n")); CIAO::Config_Handlers::DD_Handler dd (domain_file_name); + // ACE_DEBUG((LM_DEBUG , "After DD_HANDLER Constructor\n")); ::Deployment::Domain* dmn = dd.domain_idl (); - ::Deployment::DnC_Dump::dump (*dmn); + // ACE_DEBUG((LM_DEBUG , "After DD_HANDLER domain_idl\n")); + + if (CIAO::debug_level () > 9) + ::Deployment::DnC_Dump::dump (*dmn); + current_domain_ = *dmn; initial_domain_ = current_domain_; + // initialize the provisioning domain + provisioned_data_ = initial_domain_; + call_all_node_managers (); + } ::Deployment::Domain* CIAO::DomainDataManager::get_current_domain () { - ::Deployment::Domain * retval = new ::Deployment::Domain (current_domain_); - return retval; + return new ::Deployment::Domain (provisioned_data_); } ::Deployment::Domain* CIAO::DomainDataManager::get_initial_domain () { - ::Deployment::Domain * retval = new ::Deployment::Domain (initial_domain_); - return retval; + return new ::Deployment::Domain (initial_domain_); } int CIAO::DomainDataManager::readin_domain_data () @@ -115,12 +159,39 @@ int CIAO::DomainDataManager::call_all_node_managers () } int length = initial_domain_.node.length (); + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, "Number of nodes in domain.cdd is : %d\n", length)); + } + for (int i=0;i < length;i++) { - ::Deployment::NodeManager_var node_manager = - deployment_config_.get_node_manager (initial_domain_.node[i].name); - if (node_manager.in () != 0) + + ::Deployment::NodeManager_var node_manager; + + + try + { + node_manager = + deployment_config_.get_node_manager + (initial_domain_.node[i].name.in ()); + } + catch (CORBA::Exception& ex) + { + ACE_ERROR ((LM_ERROR, "DANCE::TM (%P|%t) DomainDataManager.cpp: " + "Error trying to contact NodeManager %s\n", + initial_domain_.node[i].name.in ())); + continue; + } + + + if (!CORBA::is_nil (node_manager.in ())) { + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, "Trying to contact nodemanager on %s\n", + initial_domain_.node[i].name.in ())); + } Deployment::Logger_ptr log = Deployment::Logger::_nil (); ::Deployment::Domain sub_domain; @@ -134,14 +205,370 @@ int CIAO::DomainDataManager::call_all_node_managers () sub_domain.node[0] = initial_domain_.node[i]; try { - node_manager->joinDomain (sub_domain , target_mgr_.in (), log); + node_manager->joinDomain (sub_domain, + target_mgr_.in (), + log); } - catch (CORBA::Exception&) + catch (CORBA::Exception& ex) { - ACE_DEBUG ((LM_DEBUG , "Error in calling Join Domain==\n")); + ACE_DEBUG ((LM_DEBUG , "TM::Error in calling Join Domain==\n")); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught in " + "DomainDataManager::joinDomain"); } } } return 0; } + +CIAO::Host_NodeManager_seq * CIAO::DomainDataManager::get_node_managers () +{ + ::CIAO::Host_NodeManager_seq* node_mgr_seq = + new ::CIAO::Host_NodeManager_seq (); + node_mgr_seq->length (initial_domain_.node.length ()); + for (unsigned int i=0;i < initial_domain_.node.length ();i++) + { + (*node_mgr_seq)[i].host_ = + CORBA::string_dup (initial_domain_.node[i].name); + ::Deployment::NodeManager_var node_manager = + deployment_config_.get_node_manager (initial_domain_.node[i].name); + // if (node_manager.in () != 0) + { + (*node_mgr_seq)[i].node_mgr_ = ::CIAO::NodeManager::_narrow (node_manager.in ()); + } + } + return node_mgr_seq; +} + +CIAO::Host_Infos* CIAO::DomainDataManager::get_cpu_info () +{ + CIAO::Host_Infos* host_info_seq = new CIAO::Host_Infos (); + host_info_seq->length (current_domain_.node.length ()); + + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , "TM:: The node length is [%d]", + current_domain_.node.length ())); + + for (unsigned int i=0;i < current_domain_.node.length ();i++) + { + (*host_info_seq)[i].hostname = + CORBA::string_dup (current_domain_.node[i].name); + // ACE_DEBUG ((LM_DEBUG , "The resource length is [%d]", + // current_domain_.node[i].resource.length ())); + + for (unsigned int j = 0;j < current_domain_.node[i].resource.length ();j++) + { + if (!strcmp( + current_domain_.node[i].resource[j].name, + "Processor")) + { + current_domain_.node[i].resource[j].property[0].value + >>= (*host_info_seq)[i].cpu_util; + CORBA::Double d; + current_domain_.node[i].resource[j].property[0].value + >>= d; + // ACE_DEBUG ((LM_DEBUG, "TM::The current cpu util is [%f]\n", d)); + } + } + } + + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , "TM::Returning from get_cpu_info")); + + return host_info_seq; +} + +CORBA::Long CIAO::DomainDataManager::get_pid (ACE_CString cmp) +{ + CORBA::Long pid; + + // This is really ineffiecient this is O(n) ; searching all the nodes + // all the resources for a particular component. + // It needs to be stored in some other data structure + + for (unsigned int i=0;i < current_domain_.node.length ();i++) + { + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , "TM::The resource length is [%d]", + current_domain_.node[i].resource.length ())); + + for (unsigned int j = 0;j < current_domain_.node[i].resource.length ();j++) + { + // The resource + if (!strcmp( + current_domain_.node[i].resource[j].name, + "Component") && + ACE_CString (current_domain_.node[i].resource[j].property[0].name) == + cmp) + { + current_domain_.node[i].resource[j].property[0].value + >>= pid; + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG, + "TM::getpid::The current pid is [%d]\n", pid)); + + } + } // resources + }// nodes + + return pid; +} + +void CIAO::DomainDataManager +::commitResources ( + const ::Deployment::DeploymentPlan & plan) +{ + // commit the resources + // parse into the plan and commit resources ... + + // set the action value + current_action_ = commit; + + for (unsigned int i = 0;i < plan.instance.length ();i++) + { + for (unsigned int j = 0;j < provisioned_data_.node.length ();j++) + { + if (!strcmp (plan.instance[i].node.in () , + provisioned_data_.node[j].name.in ())) + { + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , + "TM::commitResource::Host name matched\n")); + try { + match_requirement_resource ( + plan.instance[i].deployedResource, + provisioned_data_.node[j].resource); + } + catch (::Deployment::ResourceNotAvailable& ex) + { + // catch the exception and add parameters + ex.elementName = + CORBA::string_dup (provisioned_data_.node[j].name); + + throw ex; + } + } + } + } +} + + +void CIAO::DomainDataManager:: +releaseResources ( + const ::Deployment::DeploymentPlan& plan) +{ + // release the resources + + + // set the action value + current_action_ = release; + + for (unsigned int i = 0;i < plan.instance.length ();i++) + { + for (unsigned int j = 0;j < provisioned_data_.node.length ();j++) + { + if (!strcmp (plan.instance[i].node.in () , + provisioned_data_.node[j].name.in ())) + { + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , + "TM::commitResource::Host name matched\n")); + + match_requirement_resource ( + plan.instance[i].deployedResource, + provisioned_data_.node[j].resource); + + } + } + } + +} + + +void CIAO::DomainDataManager:: +match_requirement_resource ( + ::Deployment::InstanceResourceDeploymentDescriptions deployed, + ::Deployment::Resources & available + ) +{ + // here match the deployed to the available + + for (unsigned int i = 0;i < deployed.length ();i++) + { + // for each deployed resource ....search the corresponding + // available resource + for (unsigned int j = 0;j < available.length ();j++) + { + if (!strcmp (deployed[i].requirementName, available[j].name)) + { + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , + "TM::commitResource::Requirement name matched\n")); + // search for the resourcename in the resourceType + for (unsigned int k = 0;k < available[j].resourceType.length ();k++) + { + if (!strcmp (deployed[i].resourceName, + available[j].resourceType[k])) + { + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , + "TM::commitResource::Resource name matched\n")); + + try { + match_properties (deployed[i].property, + available[j].property); + } + catch (::Deployment::ResourceNotAvailable& ex) + { + // catch the exception and add parameters + ex.resourceType = + CORBA::string_dup (available[j].resourceType[k]); + ex.resourceName = + CORBA::string_dup (available[j].name); + throw ex; + } + } + } + } + } + } + +} + +void CIAO::DomainDataManager:: +match_properties ( + ::Deployment::Properties deployed, + ::Deployment::SatisfierProperties & available) +{ + for (unsigned int i = 0;i < deployed.length ();i++) + { + for (unsigned int j = 0;j < available.length ();j++) + if (!strcmp (deployed[i].name , available[j].name)) + { + // check kind here ....and then subtract .... + // accordingly , ..this is complex ... better to write + // some specialised algo + // for now assuming Capacity .... + // and tk_double .... + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG , + "TM::commitResource::Property name matched\n")); + + commit_release_resource (deployed[i] , available[j]); + + } + } +} + +void CIAO::DomainDataManager::commit_release_resource ( + ::Deployment::Property & deployed, + ::Deployment::SatisfierProperty & available) +{ + if (current_action_ == commit) + { + + CORBA::Double required_d; + + if ((deployed.value >>= required_d) == false) + ACE_ERROR ((LM_ERROR, "Failed to extract required amount\n")); + + CORBA::Double available_d; + + if ((available.value >>= available_d) == false) + ACE_ERROR ((LM_ERROR, "failed to extract available amount\n")); + + if (available_d >= required_d) + { + available_d = available_d - required_d; + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG, "TM::The available is [%f]", + available_d)); + + available.value <<= available_d; + } + else + { + ACE_DEBUG ((LM_DEBUG, "Insufficient resources! Available: %d, Required %d\n", + available_d, required_d)); + throw ::Deployment::ResourceNotAvailable ("", + "", + deployed.name.in (), + "", + ""); + } + + + } + else + { + //must be release + CORBA::Double required_d; + deployed.value >>= required_d; + CORBA::Double available_d; + available.value >>= available_d; + + available_d = available_d + required_d; + + + // Should we check for bin > 100 ?????? + + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG, "TM::The available is [%f]", + available_d)); + + available.value <<= available_d; + } +} + +void CIAO::DomainDataManager::stop_monitors () +{ + + int length = initial_domain_.node.length (); + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, "Number of nodes in domain.cdd is : %d\n", length)); + } + + for (int i=0;i < length;i++) + { + + ::Deployment::NodeManager_var node_manager; + + + try + { + node_manager = + deployment_config_.get_node_manager + (initial_domain_.node[i].name.in ()); + } + catch (CORBA::Exception& ex) + { + ACE_ERROR ((LM_ERROR, "DANCE::TM (%P|%t) DomainDataManager.cpp: " + "Error in get Node Manager from Deployment Config %s\n", + initial_domain_.node[i].name.in ())); + continue; + } + + + if (!CORBA::is_nil (node_manager.in ())) + { + if (CIAO::debug_level () > 9) + { + ACE_DEBUG ((LM_DEBUG, "Trying to contact nodemanager on %s\n", + initial_domain_.node[i].name.in ())); + } + try + { + node_manager->leaveDomain (); + } + catch (CORBA::Exception& ex) + { + ACE_DEBUG ((LM_DEBUG , "TM::Error in calling Leave Domain\n")); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught in " + "DomainDataManager::leaveDomain"); + } + } + } + return; + +} diff --git a/TAO/CIAO/DAnCE/TargetManager/DomainDataManager.h b/TAO/CIAO/DAnCE/TargetManager/DomainDataManager.h index 6d3e8772c87..84e50a5fabf 100644 --- a/TAO/CIAO/DAnCE/TargetManager/DomainDataManager.h +++ b/TAO/CIAO/DAnCE/TargetManager/DomainDataManager.h @@ -69,17 +69,113 @@ namespace CIAO ::Deployment::Domain* get_current_domain (); + /** + * @operation create + * @brief This function is called to create the Datamanager + * @param orb The orb pointer + * @param target The Target Manager Object Reference + * + * @description This function calls the constructor of the + * class Domain Data Manager + */ + static DomainDataManager * create (CORBA::ORB_ptr orb, + ::Deployment::TargetManager_ptr target + ); + + /** + * @operation get_data_manager + * @brief Returns the static pointer to the + * data manager. + * @return DomainDataManager* + * @description The staic get_data_manger function returning + * the data_manager pointer + */ + static DomainDataManager* get_data_manager (); + + /** + * @operation delete_data_manager + * @brief deletes the data manager + */ + + static void delete_data_manger (); + + /** + * @operation get_node_managers + * @brief returns the sequence of node managers + * object reference + */ + + CIAO::Host_NodeManager_seq * + get_node_managers (); + + /** + * @operation get_cpu_info + * @brief returns the node specific cpu utilization + * + * @return CIAO::Host_Infos* + */ + + CIAO::Host_Infos* get_cpu_info (); + + /** + * @operation get_pid + * @brief returns the pid of the component id submitted + * @param cmp The component id + * + * @return process id + */ + CORBA::Long get_pid (ACE_CString cmp); + + /** + * @operation commitResources + * @brief commits the resources that are specified + * in the plan. + * @param plan ::Deployment::DeploymentPlan + * @exception ::Deployment::ResourceNotAvailable thrown + * when the resources mentioned in the plan exceeds + * the current resource. + * @exception ::Deployment::PlanError thrown if the plan has any + * error + * + */ + void commitResources ( + const ::Deployment::DeploymentPlan & plan); + + /** + * @operation releaseResources + * @brief The function releases the resources held by a plan + * + * @param argname ::Deployment::DeploymentPlan the plan whose + * resources are to be released + */ + void releaseResources ( + const ::Deployment::DeploymentPlan& plan); + + /** + * @operation stop_monitors + * @brief The function makes a call on the leaveDomain on the + * NodeManager + * + * @description The node manager in turn stops the monitor + * + */ + + void stop_monitors (); + + protected: + + /** * @operation Constructor * @param orb The orb pointer * @param target The Target Manager Object Reference + * @description The constructor made proteccted so that no one can create + * it. */ DomainDataManager (CORBA::ORB_ptr orb, ::Deployment::TargetManager_ptr target ); - protected: - /** * @operation readinDomainData * @brief It will read the initial Domain data from @@ -87,6 +183,49 @@ namespace CIAO */ int readin_domain_data (); + /** + * @operation match_requirement_resource + * @brief Match the deployed resources to the + * available resource + */ + void match_requirement_resource ( + ::Deployment::InstanceResourceDeploymentDescriptions deployed, + ::Deployment::Resources& available + ); + + /** + * @operation match_properties + * @brief Match the properties of a Requirement to the + * properties of available resource + * @param deployed The deployed Properties + * @param available The available Properties + */ + + void CIAO::DomainDataManager:: + match_properties ( + ::Deployment::Properties deployed, + ::Deployment::SatisfierProperties& available); + + + /// The different actiona that can take place + enum Action {commit , release}; + + /** + * @operation commit_release_resource + * @brief Either commits or releases the given resource + * based on the current Action set. + * @param deployed ::Deployment::Property is the resource + * to be commited/released + * @param available ::Deployment::SatisfierProperty is the + * available resource from which committed/released. + * @exception ::Deployment::ResourceNotAvailable thrown + * when the deployed resources exceeds + * the available resource. + */ + + void commit_release_resource ( ::Deployment::Property & deployed, + ::Deployment::SatisfierProperty & available); + /** * @operation call_all_node_managers * @brief This function calls all NM and gives them @@ -111,6 +250,20 @@ namespace CIAO /// The Target Manager Context ::Deployment::TargetManager_var target_mgr_; + + /** + * The staic data manager pointer implementing + * singleton pattern + */ + static DomainDataManager* global_data_manager_; + + /** + * The static provisioned Domain data + */ + ::Deployment::Domain provisioned_data_; + + ///The current action + Action current_action_; }; } // CIAO diff --git a/TAO/CIAO/DAnCE/TargetManager/TM_Client.mpc b/TAO/CIAO/DAnCE/TargetManager/TM_Client.mpc index 40904b1585d..aba5c8737d3 100644 --- a/TAO/CIAO/DAnCE/TargetManager/TM_Client.mpc +++ b/TAO/CIAO/DAnCE/TargetManager/TM_Client.mpc @@ -5,7 +5,7 @@ project(TMClient): ciao_client_dnc,ciao_deployment_stub, ciao_config_handlers { after += CIAO_TargetManager_stub - includes += $(CIAO_ROOT)/DAnCE $(TAO_ROOT)/orbsvcs + includes += $(CIAO_ROOT)/DAnCE $(TAO_ROOT)/orbsvcs includes += $(CIAO_ROOT)/DAnCE/TargetManager libs += TargetManager_stub @@ -14,12 +14,12 @@ project(TMClient): ciao_client_dnc,ciao_deployment_stub, ciao_config_handlers { } Source_Files { - CmpClient.cpp + CmpClient.cpp } - + Header_Files { } - + Inline_Files { } diff --git a/TAO/CIAO/DAnCE/TargetManager/TargetManager.mpc b/TAO/CIAO/DAnCE/TargetManager/TargetManager.mpc index 2add70e94e3..ef22db4924f 100644 --- a/TAO/CIAO/DAnCE/TargetManager/TargetManager.mpc +++ b/TAO/CIAO/DAnCE/TargetManager/TargetManager.mpc @@ -1,11 +1,14 @@ // $Id$ -// generate_component_mpc.pl,v +// generate_component_mpc.pl,v project(CIAO_TargetManager_stub): ciao_client_dnc, ciao_deployment_stub { + after += NodeManager_stub sharedname = TargetManager_stub idlflags += -Wb,stub_export_macro=TARGETMANAGER_STUB_Export -Wb,stub_export_include=TargetManager_stub_export.h -Wb,skel_export_macro=TARGETMANAGER_SVNT_Export -Wb,skel_export_include=TargetManager_svnt_export.h dynamicflags = TARGETMANAGER_STUB_BUILD_DLL + libs += NodeManager_stub + IDL_Files { TargetManager.idl TargetManagerExt.idl @@ -20,8 +23,8 @@ project(CIAO_TargetManager_stub): ciao_client_dnc, ciao_deployment_stub { project(CIAO_TargetManager_svnt) : ciao_servant_dnc { after += CIAO_TargetManager_stub sharedname = TargetManager_svnt - libs += TargetManager_stub - + libs += TargetManager_stub + idlflags += -Wb,export_macro=TARGETMANAGER_SVNT_Export -Wb,export_include=TargetManager_svnt_export.h dynamicflags = TARGETMANAGER_SVNT_BUILD_DLL @@ -45,15 +48,19 @@ project(CIAO_TargetManager_svnt) : ciao_servant_dnc { project(CIAO_TargetManager_exec) : namingexe, ciao_component_dnc , ciao_config_handlers { after += CIAO_TargetManager_svnt DomainApplicationManager sharedname = TargetManager_exec - libs += TargetManager_stub TargetManager_svnt DomainApplicationManager - + libs += TargetManager_stub \ + TargetManager_svnt \ + DomainApplicationManager \ + NodeManager_stub + + includes += $(CIAO_ROOT)/DomainApplicationManager - + idlflags += -Wb,export_macro=TARGETMANAGER_EXEC_Export -Wb,export_include=TargetManager_exec_export.h dynamicflags = TARGETMANAGER_EXEC_BUILD_DLL Source_Files { - DomainDataManager.cpp + DomainDataManager.cpp TargetManager_exec.cpp } diff --git a/TAO/CIAO/DAnCE/TargetManager/TargetManagerExt.idl b/TAO/CIAO/DAnCE/TargetManager/TargetManagerExt.idl index cc9443b3c51..17311a60120 100644 --- a/TAO/CIAO/DAnCE/TargetManager/TargetManagerExt.idl +++ b/TAO/CIAO/DAnCE/TargetManager/TargetManagerExt.idl @@ -1,20 +1,26 @@ // $Id$ -/** +/** * @file TargetManagerExt.idl * * @brief The Extensions to the TM interface for ARMS demo * + * @author Nilabja R + * @author Nishanth Shankaran + * * This file declares a interface which will be implemented as * a facet by the TargetManager component */ /** * @module CIAO - * + * * @brief The CIAO module */ +//#include +#include + module CIAO { /** @@ -43,6 +49,20 @@ module CIAO /// The sequence of component cpu utilization typedef sequence Component_Infos; + + /** + * @struct Host_NodeManager + * @brief Contains the node manager to host reference + */ + struct Host_NodeManager + { + string host_; + ::CIAO::NodeManager node_mgr_; + }; + + /// Sequence of NodeManager. + typedef sequence Host_NodeManager_seq; + /** * @interface TargetManagerExt * @brief The Target Manager Extension @@ -55,5 +75,6 @@ module CIAO long get_pid (in string component_uuid); Host_Infos get_host_cpu (); Component_Infos get_component_cpu (); + Host_NodeManager_seq get_all_node_managers (); }; }; diff --git a/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.cpp b/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.cpp index 552197adf0e..7fe8f24a707 100644 --- a/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.cpp +++ b/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.cpp @@ -41,7 +41,8 @@ namespace CIDL_TargetManager_i CIAO::TargetManagerImpl::_narrow (object.in ()); ::Deployment::TargetManager_var target = target_impl->provide_targetMgr (); - dataManager_.reset (new CIAO::DomainDataManager (orb, target.in ())); + // dataManager_.reset (new CIAO::DomainDataManager (orb, target.in ())); + CIAO::DomainDataManager::create (orb, target.in()); } TargetManager_exec_i::~TargetManager_exec_i (void) @@ -55,7 +56,8 @@ namespace CIDL_TargetManager_i ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { - return dataManager_->get_initial_domain (); + return CIAO::DomainDataManager:: + get_data_manager ()->get_initial_domain (); } ::Deployment::Domain * @@ -63,28 +65,31 @@ namespace CIDL_TargetManager_i ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { - return dataManager_->get_current_domain (); + return CIAO::DomainDataManager:: + get_data_manager ()->get_current_domain (); } void TargetManager_exec_i::commitResources ( - const ::Deployment::DeploymentPlan & /* plan */ + const ::Deployment::DeploymentPlan & plan ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC (( ::CORBA::SystemException, ::Deployment::ResourceNotAvailable, ::Deployment::PlanError)) { - throw CORBA::NO_IMPLEMENT (); + return CIAO::DomainDataManager:: + get_data_manager ()->commitResources (plan); } void TargetManager_exec_i::releaseResources ( - const ::Deployment::DeploymentPlan & /* argname */ + const ::Deployment::DeploymentPlan & plan ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { - throw CORBA::NO_IMPLEMENT (); + return CIAO::DomainDataManager:: + get_data_manager ()->releaseResources (plan); } void @@ -100,7 +105,8 @@ namespace CIDL_TargetManager_i { ACE_DEBUG ((LM_DEBUG , ".. Update Domain called ...\n")); } - dataManager_->update_domain ( + CIAO::DomainDataManager:: + get_data_manager ()->update_domain ( elements, domainSubset, updateKind @@ -124,13 +130,14 @@ namespace CIDL_TargetManager_i ::CORBA::Long TargetManagerExt_exec_i::get_pid ( - const char * /* component_uuid */ + const char * component_uuid ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { // Your code here. ACE_DEBUG ((LM_DEBUG, "Get PID :: Skeleton Impl")); - return 0; + return CIAO::DomainDataManager:: + get_data_manager ()->get_pid (component_uuid); } ::CIAO::Host_Infos * @@ -139,8 +146,9 @@ namespace CIDL_TargetManager_i ACE_THROW_SPEC ((CORBA::SystemException)) { // Your code here. - ACE_DEBUG ((LM_DEBUG, "Get host cpu :: Skeleton Impl")); - return 0; + ACE_DEBUG ((LM_DEBUG, "Get host cpu :: Skeleton Impl entering\n")); + return CIAO::DomainDataManager:: + get_data_manager ()->get_cpu_info (); } ::CIAO::Component_Infos * @@ -153,6 +161,15 @@ namespace CIDL_TargetManager_i return 0; } + ::CIAO::Host_NodeManager_seq * + TargetManagerExt_exec_i::get_all_node_managers + (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return CIAO::DomainDataManager:: + get_data_manager ()->get_node_managers (); + } + //================================================================== // Component Executor Implementation Class: TargetManagerImpl_exec_i //================================================================== @@ -198,7 +215,11 @@ namespace CIDL_TargetManager_i ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) ACE_THROW_SPEC ((CORBA::SystemException)) { - return new TargetManagerExt_exec_i (); + if (this->exec_ext_object_.in () == 0) + { + this->exec_ext_object_ = new TargetManagerExt_exec_i(); + } + return this->exec_ext_object_.in (); } // Operations from Components::SessionComponent @@ -277,6 +298,10 @@ namespace CIDL_TargetManager_i ::Components::CCMException)) { // Your code here. + ACE_DEBUG ((LM_DEBUG , "TM::ccm_remove , calling LeaveDomain\n")); + return CIAO::DomainDataManager:: + get_data_manager ()->stop_monitors (); + ACE_DEBUG ((LM_DEBUG , "TM::ccm_remove , After calling LeaveDomain\n")); } @@ -322,7 +347,7 @@ namespace CIDL_TargetManager_i } extern "C" TARGETMANAGER_EXEC_Export ::Components::HomeExecutorBase_ptr - createTargetManagerHome_Impl (void) + create_CIAO_TargetManagerHome_Impl (void) { ::Components::HomeExecutorBase_ptr retval = ::Components::HomeExecutorBase::_nil (); diff --git a/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.h b/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.h index a756f67ec5e..1b3b7b0e470 100644 --- a/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.h +++ b/TAO/CIAO/DAnCE/TargetManager/TargetManager_exec.h @@ -47,7 +47,7 @@ namespace CIDL_TargetManager_i ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::CIAO::CCM_TargetManagerExt_ptr + virtual ::CIAO::CCM_TargetManagerExt_ptr get_target_manager_ext ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) @@ -104,6 +104,8 @@ namespace CIDL_TargetManager_i /// The exec Object ::Deployment::CCM_TargetManager_var exec_object_; + + ::CIAO::CCM_TargetManagerExt_var exec_ext_object_; }; class TARGETMANAGER_EXEC_Export TargetManagerExt_exec_i @@ -131,6 +133,11 @@ namespace CIDL_TargetManager_i get_component_cpu ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CIAO::Host_NodeManager_seq * + get_all_node_managers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); }; class TARGETMANAGER_EXEC_Export TargetManager_exec_i @@ -221,7 +228,7 @@ namespace CIDL_TargetManager_i }; extern "C" TARGETMANAGER_EXEC_Export ::Components::HomeExecutorBase_ptr - createTargetManagerHome_Impl (void); + create_CIAO_TargetManagerHome_Impl (void); } #include /**/ "ace/post.h" diff --git a/TAO/CIAO/DAnCE/TargetManager/descriptors/Domain.cdd b/TAO/CIAO/DAnCE/TargetManager/descriptors/Domain.cdd index 382f7f6b83b..fe21a4b48f5 100644 --- a/TAO/CIAO/DAnCE/TargetManager/descriptors/Domain.cdd +++ b/TAO/CIAO/DAnCE/TargetManager/descriptors/Domain.cdd @@ -18,6 +18,7 @@ LoadAverage Quantity + true tk_long @@ -36,6 +37,7 @@ LoadAverage Quantity + true tk_long @@ -57,6 +59,7 @@ LoadAverage Quantity + true tk_long @@ -81,6 +84,7 @@ LoadAverage Quantity + true tk_long diff --git a/TAO/CIAO/DAnCE/TargetManager/descriptors/flattened_deploymentplan.cdp b/TAO/CIAO/DAnCE/TargetManager/descriptors/flattened_deploymentplan.cdp index be10e2254bf..fae71c39fa1 100644 --- a/TAO/CIAO/DAnCE/TargetManager/descriptors/flattened_deploymentplan.cdp +++ b/TAO/CIAO/DAnCE/TargetManager/descriptors/flattened_deploymentplan.cdp @@ -10,7 +10,7 @@ c0965470-7b83-11d9-9669-0800200c9a66 - IDL:BasicSP/EC:1.0 + IDL:BasicSP/EC:1.0 read_message IDL:Hello/ReadMessage:1.0 @@ -53,7 +53,7 @@ - + TargetManager_exec @@ -66,12 +66,12 @@ tk_string - createTargetManagerHome_Impl + create_CIAO_TargetManagerHome_Impl - + TargetManager_svnt @@ -89,4 +89,4 @@ - + diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl index f620ec569d0..3063a673d5a 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl @@ -1,4 +1,4 @@ -// $Id$ +// $Id$ #ifndef NODEAPPTEST_ROUNDTRIP_CIDL #define NODEAPPTEST_ROUNDTRIP_CIDL diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp index 9807170cc79..33f74f55976 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp @@ -138,7 +138,7 @@ main (int argc, char *argv[]) CORBA::string_dup ("NodeAppTest_RoundTrip_2"); Deployment::ComponentInfos_var comp_info_new = node_app->install (node_info ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_TRY_CHECK; assert (comp_info_new->length () == 1); //return 1 component objeref diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp index 7792de3eed2..d984de8860b 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp @@ -81,8 +81,8 @@ main (int argc, char *argv[]) CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); info.servant_entrypt = CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); + "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" + ); // Create a ContainerImplementationInfo sequence Deployment::ContainerImplementationInfo container_info; @@ -110,11 +110,11 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (CORBA::is_nil (roundtrip_var.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil RoundTrip reference\n"), + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil RoundTrip reference\n"), 1); - } + } // initialize the component roundtrip_var->ciao_postactivate (); @@ -122,45 +122,45 @@ main (int argc, char *argv[]) //get the provided facets info. Components::FacetDescriptions_var facets_info = - roundtrip_var->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER) ; + roundtrip_var->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER) ; ACE_TRY_CHECK; if ( facets_info->length () != 2 ) - { - ACE_DEBUG((LM_DEBUG, "Didn't get 2 facet back! but only %d\n", - facets_info->length ())); - return 1; - } + { + ACE_DEBUG((LM_DEBUG, "Didn't get 2 facet back! but only %d\n", + facets_info->length ())); + return 1; + } // Invoke Operation on the Interface ACE_DEBUG ((LM_DEBUG, "Try cube_long operation on the Interface \n")); for (i = 0; i < 2; ++i ) { - NodeAppTest::LatencyTest_var latency_var - = NodeAppTest::LatencyTest::_narrow ( (facets_info[i]->facet_ref ())); - ACE_DEBUG((LM_DEBUG, "Calling on facet %s\n", (facets_info[i]->name ()))); - - ACE_TRY_CHECK; - - if ( CORBA::is_nil (latency_var.in ()) ) - { - ACE_DEBUG((LM_DEBUG, "get nil latency ref for facet%d\n", i)); - return 1; - } - - CORBA::Long input = 1L; - CORBA::Long output = - latency_var->cube_long (input ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (input == output) - ACE_DEBUG ((LM_DEBUG, "Retrun values matched!!\n")); - else - { - ACE_DEBUG ((LM_DEBUG, "Return values did not match: failure\n")); - exit (1); - } + NodeAppTest::LatencyTest_var latency_var + = NodeAppTest::LatencyTest::_narrow ( (facets_info[i]->facet_ref ())); + ACE_DEBUG((LM_DEBUG, "Calling on facet %s\n", (facets_info[i]->name ()))); + + ACE_TRY_CHECK; + + if ( CORBA::is_nil (latency_var.in ()) ) + { + ACE_DEBUG((LM_DEBUG, "get nil latency ref for facet%d\n", i)); + return 1; + } + + CORBA::Long input = 1L; + CORBA::Long output = + latency_var->cube_long (input ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (input == output) + ACE_DEBUG ((LM_DEBUG, "Retrun values matched!!\n")); + else + { + ACE_DEBUG ((LM_DEBUG, "Return values did not match: failure\n")); + exit (1); + } } ACE_DEBUG ((LM_DEBUG, "Try removing test component and its home\n")); diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h index c235a794806..042840f4679 100644 --- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h +++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h @@ -38,54 +38,54 @@ namespace CIDL_RoundTrip_Impl RoundTrip_exec_i (); /// Operation to test the data - virtual CORBA::Long cube_long (CORBA::Long data - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual CORBA::Long cube_long (CORBA::Long data + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); /* - virtual ::NodeAppTest::CCM_LatencyTest* - get_latency (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual ::NodeAppTest::CCM_LatencyTest* + get_latency (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); */ - NodeAppTest::CCM_LatencyTest_ptr - get_facet_1(ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + NodeAppTest::CCM_LatencyTest_ptr + get_facet_1(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); - NodeAppTest::CCM_LatencyTest_ptr - get_facet_2(ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + NodeAppTest::CCM_LatencyTest_ptr + get_facet_2(ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); // Operations from Components::SessionComponent - virtual void set_session_context (Components::SessionContext_ptr ctx - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); - virtual void ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); - virtual void ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); - virtual void ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); /// Helper function to be called back by timeout_Handler - void pulse (void); + void pulse (void); // CIAO defined methods - virtual void ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); - virtual void ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::CCMException)); + virtual void ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); protected: @@ -109,9 +109,9 @@ namespace CIDL_RoundTrip_Impl { } - virtual CORBA::Long cube_long (CORBA::Long data - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); + virtual CORBA::Long cube_long (CORBA::Long data + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); }; /** diff --git a/TAO/CIAO/DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl b/TAO/CIAO/DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl index 361c6950fe8..d5521d0554f 100755 --- a/TAO/CIAO/DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl +++ b/TAO/CIAO/DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl @@ -49,10 +49,10 @@ $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); $SV4 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", "-ORBEndpoint iiop://localhost:40000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); - + $SV5 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", "-ORBEndpoint iiop://localhost:50000 -s -$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); +$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); $SV1->Spawn (); $SV2->Spawn (); $SV3->Spawn (); diff --git a/TAO/CIAO/NEWS b/TAO/CIAO/NEWS index 5da48f1e2c4..cbc0f71823c 100644 --- a/TAO/CIAO/NEWS +++ b/TAO/CIAO/NEWS @@ -52,7 +52,7 @@ PLANNED MAJOR CHANGES "SOMETIME IN THE FUTURE" (i.e., exact beta not known) . Add support for querying for interface types to the RepositoryManager. - + . Implement a planner to query the TargetManager and RepositoryManager and generate deployment plans on the fly. @@ -71,7 +71,7 @@ PLANNED MAJOR CHANGES FOR THE NEXT RELEASE USER VISIBLE CHANGES BETWEEN CIAO-0.4.8 and CIAO-0.4.9 ====================================================== . RTTI enabled versions of the Xerces library are no longer needed on - Windows platforms. + Windows platforms. . The CIDLC compiler now supports basic preprocessor directives: #ifdef, #ifndef, #else, and #endif as well as the -D command- @@ -79,7 +79,7 @@ USER VISIBLE CHANGES BETWEEN CIAO-0.4.8 and CIAO-0.4.9 . The CIDLC compiler now supports incomplete struct and union semantics which will appear in CORBA 3.1. - + . DAnCE now supports dynamically adding/removing components to/from the existing running assembly without shutting down the running appliation. This will allow the application developers to @@ -101,8 +101,8 @@ USER VISIBLE CHANGES BETWEEN CIAO-0.4.8 and CIAO-0.4.9 the same physical node. 6) Install new component instances into another component server into a remote host. - - To see how to use this feature, please see the ReDaC-Usage.html + + To see how to use this feature, please see the ReDaC-Usage.html under the $CIAO_ROOT/examples/Hello/ directory. . Removed the Old Config Handlers, which have been deprecated for some @@ -139,10 +139,10 @@ USER VISIBLE CHANGES BETWEEN CIAO-0.4.8 and CIAO-0.4.9 . The RepositoryManager has been enhanced to support standards based interfaces. A number of techniques have been used to ensure high - performance and scalability. + performance and scalability. . The RepositoryManager can now retrieve packages from remote locations via - HTTP. + HTTP. . The Target Manager is released with this CIAO release. It is an infrastructure component which keeps track of resource usage in the @@ -155,7 +155,7 @@ USER VISIBLE CHANGES BETWEEN CIAO-0.4.8 and CIAO-0.4.9 new monitors which can monitor different resources in the domain. The Target manager is a component thus it needs to be started using a deployment plan. It is right now a optional component in the DAnCE - tool chain. + tool chain. . We added a skeleton implementation of the Resource Allocation and Control Engine (RACE) which is a middleware framework built atop diff --git a/TAO/CIAO/PROBLEM-REPORT-FORM b/TAO/CIAO/PROBLEM-REPORT-FORM index 25700ef490d..4375a78d20e 100644 --- a/TAO/CIAO/PROBLEM-REPORT-FORM +++ b/TAO/CIAO/PROBLEM-REPORT-FORM @@ -60,7 +60,7 @@ Subject: [area]: [synopsis] THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you use a link to a platform-specific file, simply state which one (unless this isn't used in this case, e.g., with Microsoft Visual - C++)]: + C++)]: CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features (used by MPC when you generate your own makefiles): diff --git a/TAO/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc b/TAO/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc index 6258cad826b..0da6e7b7ed5 100644 --- a/TAO/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc +++ b/TAO/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc @@ -1,4 +1,4 @@ -// $Id$ +// $Id$ // This file is generated with "generate_component_mpc.pl -n Input_Adapter" project(Input_Adapter_stub): ciao_deployment_stub { diff --git a/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl b/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl index d027b608c8b..e04bae9d80e 100644 --- a/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl +++ b/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl @@ -12,7 +12,7 @@ module CIAO component Interactive_Input_Adapter : Input_Adapter { }; - + home Interactive_Input_Adapter_Home manages Interactive_Input_Adapter { }; diff --git a/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc b/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc index 5870d40d6b4..b675084bb96 100644 --- a/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc +++ b/TAO/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc @@ -82,14 +82,14 @@ project(Interactive_Input_Adapter_exec) : ciao_component_dnc, ciao_config_handle Input_Adapter_svnt \ Plan_Analyzer_Interface_stub \ XSC_Config_Handlers - + idlflags += -Sc \ -Wb,export_macro=INTERACTIVE_INPUT_ADAPTER_EXEC_Export \ -Wb,export_include=Interactive_Input_Adapter_exec_export.h dynamicflags = INTERACTIVE_INPUT_ADAPTER_EXEC_BUILD_DLL IDL_Files { - + } Source_Files { diff --git a/TAO/CIAO/RACE/Output_Adapters/Component/Output_Manager.idl b/TAO/CIAO/RACE/Output_Adapters/Component/Output_Manager.idl index 6f0199494f5..7e672014026 100644 --- a/TAO/CIAO/RACE/Output_Adapters/Component/Output_Manager.idl +++ b/TAO/CIAO/RACE/Output_Adapters/Component/Output_Manager.idl @@ -13,6 +13,6 @@ module CIAO provides PlanEgress output; uses multiple PlanEgress adapters; }; - + }; }; diff --git a/TAO/CIAO/RACE/Output_Adapters/Interface/PlanEgress.idl b/TAO/CIAO/RACE/Output_Adapters/Interface/PlanEgress.idl index cd42287f4d2..ce75aa0bc05 100644 --- a/TAO/CIAO/RACE/Output_Adapters/Interface/PlanEgress.idl +++ b/TAO/CIAO/RACE/Output_Adapters/Interface/PlanEgress.idl @@ -9,7 +9,7 @@ module CIAO { - + module RACE { interface PlanEgress diff --git a/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.idl b/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.idl index 818e1626111..20f29bcc1c8 100644 --- a/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.idl +++ b/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.idl @@ -11,7 +11,7 @@ module CIAO component XML_Output_Adapter : Output_Adapter { }; - + home XML_Output_Adapter_Home manages XML_Output_Adapter { }; diff --git a/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.mpc b/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.mpc index fca465a75fd..981cd3d76f0 100644 --- a/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.mpc +++ b/TAO/CIAO/RACE/Output_Adapters/XML_Output_Adapter/XML_Output_Adapter.mpc @@ -30,7 +30,7 @@ project(XML_Output_Adapter_svnt) : ciao_servant_dnc { Output_Adapter_svnt \ Output_Adapter_Interface_stub \ Output_Adapter_Interface_svnt - + idlflags += -Wb,export_macro=XML_OUTPUT_ADAPTER_SVNT_Export \ -Wb,export_include=XML_Output_Adapter_svnt_export.h dynamicflags = XML_OUTPUT_ADAPTER_SVNT_BUILD_DLL @@ -60,17 +60,17 @@ project(XML_Output_Adapter_exec) : ciao_component_dnc { Output_Adapter_svnt \ Output_Adapter_Interface_stub \ Output_Adapter_Interface_svnt - + idlflags += -Wb,export_macro=XML_OUTPUT_ADAPTER_EXEC_Export \ -Wb,export_include=XML_Output_Adapter_exec_export.h dynamicflags = XML_OUTPUT_ADAPTER_EXEC_BUILD_DLL IDL_Files { - + } Source_Files { - + XML_Output_Adapter_exec.cpp } } diff --git a/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.idl b/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.idl index 9f4fdd4668d..f2e3ab26f66 100644 --- a/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.idl +++ b/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.idl @@ -8,7 +8,7 @@ module CIAO { - + module RACE { component Plan_Analyzer diff --git a/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.mpc b/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.mpc index 3ea12c0608e..7cb588e74c0 100644 --- a/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.mpc +++ b/TAO/CIAO/RACE/Plan_Analyzer/Component/Plan_Analyzer.mpc @@ -94,7 +94,7 @@ project(Plan_Analyzer_exec) : ciao_component_dnc { dynamicflags = PLAN_ANALYZER_EXEC_BUILD_DLL IDL_Files { - + } Source_Files { diff --git a/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.cidl b/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.cidl index dcf42d8218c..98b02691a32 100644 --- a/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.cidl +++ b/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.cidl @@ -13,7 +13,7 @@ module CIAO { module RACE { - + composition session Planner_Manager_Impl { home executor Planner_Manager_Home_Exec diff --git a/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.mpc b/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.mpc index 673c8647431..46dee1a6480 100644 --- a/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.mpc +++ b/TAO/CIAO/RACE/Planner_Manager/Component/Planner_Manager.mpc @@ -90,14 +90,14 @@ project(Planner_Manager_exec) : ciao_component_dnc { Planner_Interface_stub \ Planner_stub \ Output_Adapter_Interface_stub - + idlflags += -Sc \ -Wb,export_macro=PLANNER_MANAGER_EXEC_Export \ -Wb,export_include=Planner_Manager_exec_export.h dynamicflags = PLANNER_MANAGER_EXEC_BUILD_DLL IDL_Files { - + } Source_Files { diff --git a/TAO/CIAO/RACE/Planners/Base/Planner.idl b/TAO/CIAO/RACE/Planners/Base/Planner.idl index ae81074d5e7..5fc58c5cc1c 100644 --- a/TAO/CIAO/RACE/Planners/Base/Planner.idl +++ b/TAO/CIAO/RACE/Planners/Base/Planner.idl @@ -8,7 +8,7 @@ module CIAO { - + module RACE { component Planner @@ -18,7 +18,7 @@ module CIAO attribute RACE_Classification type; }; }; - + }; #endif /* RACE_PLANNER_IDL */ diff --git a/TAO/CIAO/RACE/Planners/Interface/Planner_I.idl b/TAO/CIAO/RACE/Planners/Interface/Planner_I.idl index b947c132540..8c8fc9a6194 100644 --- a/TAO/CIAO/RACE/Planners/Interface/Planner_I.idl +++ b/TAO/CIAO/RACE/Planners/Interface/Planner_I.idl @@ -9,7 +9,7 @@ module CIAO { - + module RACE { interface Planner_I diff --git a/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.idl b/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.idl index bb1a67e4a79..5678d1d21fc 100644 --- a/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.idl +++ b/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.idl @@ -13,7 +13,7 @@ module CIAO component SimpleBinPacker : Planner { }; - + home SimpleBinPacker_Home manages SimpleBinPacker { }; diff --git a/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.mpc b/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.mpc index 8e69a6d96a7..8d504bad06f 100644 --- a/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.mpc +++ b/TAO/CIAO/RACE/Planners/SimpleBinPacker/SimpleBinPacker.mpc @@ -83,16 +83,16 @@ project(SimpleBinPacker_exec) : ciao_component_dnc { Planner_Interface_stub \ Planner_Interface_svnt \ Planner_stub \ - Planner_svnt \ + Planner_svnt \ RACE_common_stub - + idlflags += -Sc \ -Wb,export_macro=SIMPLEBINPACKER_EXEC_Export \ -Wb,export_include=SimpleBinPacker_exec_export.h dynamicflags = SIMPLEBINPACKER_EXEC_BUILD_DLL IDL_Files { - + } Source_Files { diff --git a/TAO/CIAO/RACE/common/RACE_common.idl b/TAO/CIAO/RACE/common/RACE_common.idl index f5b1d9e59d8..3aa05fb6681 100644 --- a/TAO/CIAO/RACE/common/RACE_common.idl +++ b/TAO/CIAO/RACE/common/RACE_common.idl @@ -3,7 +3,7 @@ #define RACE_COMMON_IDL module CIAO -{ +{ module RACE { typedef string RACE_Classification; diff --git a/TAO/CIAO/RACE/descriptors/Deployment.xsd b/TAO/CIAO/RACE/descriptors/Deployment.xsd index c8a6399730b..7743791b54e 100644 --- a/TAO/CIAO/RACE/descriptors/Deployment.xsd +++ b/TAO/CIAO/RACE/descriptors/Deployment.xsd @@ -10,7 +10,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -157,7 +157,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -198,7 +198,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -233,7 +233,7 @@ - + @@ -254,7 +254,7 @@ - + @@ -262,13 +262,13 @@ - + - + @@ -279,7 +279,7 @@ - + @@ -288,7 +288,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -313,7 +313,7 @@ - + @@ -327,7 +327,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -353,7 +353,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -384,7 +384,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -416,7 +416,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -456,7 +456,7 @@ - + @@ -470,7 +470,7 @@ - + @@ -480,7 +480,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -499,7 +499,7 @@ - + @@ -508,7 +508,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -542,7 +542,7 @@ - + @@ -558,7 +558,7 @@ - + @@ -568,7 +568,7 @@ - + @@ -581,7 +581,7 @@ - + @@ -595,7 +595,7 @@ - + @@ -604,7 +604,7 @@ - + @@ -613,7 +613,7 @@ - + @@ -626,7 +626,7 @@ - + @@ -636,7 +636,7 @@ - + @@ -646,7 +646,7 @@ - + @@ -656,7 +656,7 @@ - + @@ -665,7 +665,7 @@ - + @@ -673,7 +673,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -689,7 +689,7 @@ - + @@ -697,7 +697,7 @@ - + diff --git a/TAO/CIAO/RACE/descriptors/Modified_Deployment.xsd b/TAO/CIAO/RACE/descriptors/Modified_Deployment.xsd index b73077b0980..5c35bd669db 100644 --- a/TAO/CIAO/RACE/descriptors/Modified_Deployment.xsd +++ b/TAO/CIAO/RACE/descriptors/Modified_Deployment.xsd @@ -50,7 +50,7 @@ - - + @@ -132,7 +132,7 @@ @@ recursive, not used - + --> @@ -154,7 +154,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -446,7 +446,7 @@ - + @@ -463,7 +463,7 @@ - + @@ -477,7 +477,7 @@ - + @@ -488,7 +488,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -545,7 +545,7 @@ - + @@ -563,7 +563,7 @@ - + @@ -614,7 +614,7 @@ - - IDL:BasicSP/EC:1.0 + IDL:BasicSP/EC:1.0 deployment_stage_port IDL:RACE/deployment_stage:1.0 @@ -22,7 +22,7 @@ SimplexReceptacle - + RACE-Interactive_Input_Adapter-mdd @@ -191,7 +191,7 @@ - + Interactive_Input_Adapter_svnt @@ -228,7 +228,7 @@ - + Plan_Analyzer_svnt @@ -265,7 +265,7 @@ - + Planner_Manager_svnt @@ -302,7 +302,7 @@ - + SimpleBinPacker_svnt @@ -339,7 +339,7 @@ - + XML_Output_Adapter_svnt @@ -358,4 +358,4 @@ - + diff --git a/TAO/CIAO/README b/TAO/CIAO/README index 1ec960c4268..597927d76e4 100644 --- a/TAO/CIAO/README +++ b/TAO/CIAO/README @@ -102,7 +102,7 @@ and also the libraries they depends on. developing and deploying components. Pleas see $CIAO_ROOT/CIDLC/README.html for instructions on how to build and use CIDLC. - + * Now you can play with the examples: - $CIAO_ROOT/examples/Hello diff --git a/TAO/CIAO/bin/valgrind_nodedaemon.py b/TAO/CIAO/bin/valgrind_nodedaemon.py index a0845864370..23c365c0ede 100755 --- a/TAO/CIAO/bin/valgrind_nodedaemon.py +++ b/TAO/CIAO/bin/valgrind_nodedaemon.py @@ -8,7 +8,7 @@ from os import system from os import environ def parse_args (): - + parser = OptionParser (usage="usage: valgrind_nodemanager [options] ") parser.add_option ("-v", "--verbose", dest="verbose", action="store_true", @@ -38,7 +38,7 @@ def parse_args (): parser.add_option ("--lc", dest="leak_check", action="store_true", help="Perform a full leak check", default=False) - + return parser.parse_args () import os @@ -47,7 +47,7 @@ def main (): (option, args) = parse_args () ciao_root = environ['CIAO_ROOT'] - + # Build the valgrind command valgrind_command = "valgrind --tool=" + option.valgrind_tool + ' ' +\ option.valgrind_args + ' ' @@ -63,7 +63,7 @@ def main (): # Build the actual command command = "" - + if option.node_manager: command += valgrind_command @@ -74,7 +74,7 @@ def main (): command += "-d 60 -s\"" + valgrind_command else: command += " -s \"" - + command += ciao_root + "/DAnCE/NodeApplication/NodeApplication" + '"' print command @@ -83,5 +83,5 @@ def main (): if __name__ == "__main__": main () - - + + diff --git a/TAO/CIAO/ciao/CCM_Core.mpc b/TAO/CIAO/ciao/CCM_Core.mpc index 4667e2cbaef..d291aaa5f1a 100644 --- a/TAO/CIAO/ciao/CCM_Core.mpc +++ b/TAO/CIAO/ciao/CCM_Core.mpc @@ -10,7 +10,7 @@ project (CIAO_DnC_Client) : taolib_with_idl, valuetype, ifr_client { // This is necessary for MPC to pull in rules.ciao.GNU includes += $(CIAO_ROOT)/DAnCE - + dynamicflags = CIAO_CLIENT_BUILD_DLL IDL_Files { diff --git a/TAO/CIAO/ciao/CCM_Event.idl b/TAO/CIAO/ciao/CCM_Event.idl index 575220a0283..59fa878f97f 100644 --- a/TAO/CIAO/ciao/CCM_Event.idl +++ b/TAO/CIAO/ciao/CCM_Event.idl @@ -27,7 +27,7 @@ module Components interface EventConsumerBase { void push_event (in EventBase evt) raises (BadEventType); - + // CIAO-specific operation to help support the capability // to subscribe to eventtypes more derived than the type // consumed. diff --git a/TAO/CIAO/ciao/CIAO_common.h b/TAO/CIAO/ciao/CIAO_common.h index 56796f04a13..21d96a2658f 100644 --- a/TAO/CIAO/ciao/CIAO_common.h +++ b/TAO/CIAO/ciao/CIAO_common.h @@ -56,6 +56,29 @@ # include "ace/Trace.h" #endif /* CIAO_NTRACE */ +#if defined (CIAO_NDEBUG) +#define CIAO_DEBUG(X, ...) do {} while (0) +#define CIAO_ERROR(X, ...) do {} while (0) +#else +#define CIAO_DEBUG(X, ...) \ + do { \ + if (CIAO::debug_level () > X) { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ + ace___->log (LM_DEBUG, __VA_ARGS__); \ + } \ + } while (0) +#define CIAO_ERROR(X, ...) \ + do { \ + if (CIAO::debug_level () > X) { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ + ace___->log (LM_ERROR, __VA_ARGS__); \ + } \ + } while (0) +#endif namespace CIAO { diff --git a/TAO/CIAO/ciao/Container_Base.cpp b/TAO/CIAO/ciao/Container_Base.cpp index 22ce67cd3c9..5917fe94934 100644 --- a/TAO/CIAO/ciao/Container_Base.cpp +++ b/TAO/CIAO/ciao/Container_Base.cpp @@ -15,7 +15,7 @@ namespace CIAO { -//////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////// Container::Container (CORBA::ORB_ptr o) : orb_ (CORBA::ORB::_duplicate (o)), @@ -53,18 +53,18 @@ namespace CIAO /////////////////////////////////////////////////////////////// - ACE_Atomic_Op + ACE_Atomic_Op Session_Container::serial_number_ (0); Session_Container::Session_Container (CORBA::ORB_ptr o, Container_Impl *container_impl, bool static_config_flag, - const Static_Config_EntryPoints_Maps* maps) - : Container (o, container_impl), - number_ (0), - static_config_flag_ (static_config_flag), - static_entrypts_maps_ (maps), - sa_ (0) + const Static_Config_EntryPoints_Maps* maps) + : Container (o, container_impl), + number_ (0), + static_config_flag_ (static_config_flag), + static_entrypts_maps_ (maps), + sa_ (0) { } @@ -79,6 +79,8 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::init"); + char buffer[MAXPATHLEN]; if (name == 0) @@ -98,7 +100,7 @@ namespace CIAO if (CORBA::is_nil (poa_object.in ())) { ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), + " (%P|%t) Unable to initialize the POA.\n"), -1); } @@ -137,6 +139,8 @@ namespace CIAO PortableServer::POA_ptr root ACE_ENV_ARG_DECL) { + CIAO_TRACE ("Session_Container::create_component_POA"); + // Set up proper poa policies here. Default policies seems to be // fine for session container. If you add some other default // policies here, then you need to "add" more_policies below @@ -163,11 +167,13 @@ namespace CIAO void Session_Container::create_facet_consumer_POA ( - const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root - ACE_ENV_ARG_DECL) + const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root + ACE_ENV_ARG_DECL) { + CIAO_TRACE ("Session_Container::create_facet_consumer_POA"); + PortableServer::POAManager_var poa_manager = root->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -193,8 +199,8 @@ namespace CIAO // Servant Manager Policy policies[1] = root->create_request_processing_policy - (PortableServer::USE_SERVANT_MANAGER - ACE_ENV_ARG_PARAMETER); + (PortableServer::USE_SERVANT_MANAGER + ACE_ENV_ARG_PARAMETER); ACE_CHECK; // Servant Retention Policy @@ -220,9 +226,9 @@ namespace CIAO CORBA::NO_MEMORY ()); this->facet_cons_poa_->set_servant_manager ( - this->sa_ - ACE_ENV_ARG_PARAMETER - ); + this->sa_ + ACE_ENV_ARG_PARAMETER + ); ACE_CHECK; } @@ -232,6 +238,8 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::install_servant"); + PortableServer::POA_ptr tmp = 0; if (t == Container::Component) @@ -262,6 +270,7 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::install_component"); PortableServer::ObjectId_var id = this->component_poa_->activate_object (p ACE_ENV_ARG_PARAMETER); @@ -295,16 +304,18 @@ namespace CIAO Deployment::ImplEntryPointNotFound, Deployment::InstallationFailure)) { + CIAO_TRACE ("Session_Container::ciao_install_home"); + HomeFactory hcreator = 0; ServantFactory screator = 0; - if (this->static_config_flag_ == 0) + if (this->static_config_flag_ == false) { ACE_DLL executor_dll, servant_dll; if (exe_dll_name == 0 || sv_dll_name == 0) { - ACE_CString exception; + ACE_CString exception; if (exe_dll_name == 0) { @@ -324,9 +335,9 @@ namespace CIAO ACE_THROW_RETURN (Deployment::UnknownImplId ( - "Session_Container::ciao_install_home", - exception.c_str ()), - Components::CCMHome::_nil ()); + "Session_Container::ciao_install_home", + exception.c_str ()), + Components::CCMHome::_nil ()); } if (executor_dll.open (exe_dll_name, @@ -344,8 +355,8 @@ namespace CIAO ACE_THROW_RETURN (Deployment::UnknownImplId - ("Session_Container::ciao_install_home", - error.c_str ()), Components::CCMHome::_nil ()); + ("Session_Container::ciao_install_home", + error.c_str ()), Components::CCMHome::_nil ()); } if (servant_dll.open (sv_dll_name, @@ -362,9 +373,9 @@ namespace CIAO sv_dll_name)); ACE_THROW_RETURN - (Deployment::UnknownImplId - ("Session_Container::ciao_install_home", - error.c_str ()), Components::CCMHome::_nil ()); + (Deployment::UnknownImplId + ("Session_Container::ciao_install_home", + error.c_str ()), Components::CCMHome::_nil ()); } if (exe_entrypt == 0 || sv_entrypt == 0) @@ -394,8 +405,8 @@ namespace CIAO ACE_THROW_RETURN (Deployment::ImplEntryPointNotFound - ("Session_Container::ciao_install_home", - error.c_str ()), Components::CCMHome::_nil ()); + ("Session_Container::ciao_install_home", + error.c_str ()), Components::CCMHome::_nil ()); } // @@ (OO) Please use a static_cast<> here instead of a C-style @@ -403,7 +414,7 @@ namespace CIAO // way of casting in ACE/TAO/CIAO. hcreator = (HomeFactory) executor_dll.symbol (exe_entrypt); screator = (ServantFactory) servant_dll.symbol (sv_entrypt); - } + } else { if (static_entrypts_maps_ == 0 @@ -416,15 +427,15 @@ namespace CIAO ACE_CString exe_entrypt_str (exe_entrypt); static_entrypts_maps_->home_creator_funcptr_map_->find ( - exe_entrypt_str, - hcreator - ); + exe_entrypt_str, + hcreator + ); ACE_CString sv_entrypt_str (sv_entrypt); static_entrypts_maps_->home_servant_creator_funcptr_map_->find ( - sv_entrypt_str, - screator - ); + sv_entrypt_str, + screator + ); } if (hcreator == 0 || screator == 0) @@ -445,9 +456,9 @@ namespace CIAO } ACE_THROW_RETURN - (Deployment::ImplEntryPointNotFound - ("SessionContainer::ciao_install_home", - error.c_str ()), Components::CCMHome::_nil ()); + (Deployment::ImplEntryPointNotFound + ("SessionContainer::ciao_install_home", + error.c_str ()), Components::CCMHome::_nil ()); } Components::HomeExecutorBase_var home_executor = hcreator (); @@ -456,9 +467,9 @@ namespace CIAO { ACE_THROW_RETURN (Deployment::InstallationFailure - ("SessionContainer::ciao_install_home", - "Executor entrypoint failed to create a home."), - Components::CCMHome::_nil ()); + ("SessionContainer::ciao_install_home", + "Executor entrypoint failed to create a home."), + Components::CCMHome::_nil ()); } PortableServer::Servant home_servant = screator (home_executor.in (), @@ -471,9 +482,9 @@ namespace CIAO { ACE_THROW_RETURN (Deployment::InstallationFailure - ("SessionContainer::ciao_install_home", - "Servant entrypoing failed to create a home."), - Components::CCMHome::_nil ()); + ("SessionContainer::ciao_install_home", + "Servant entrypoing failed to create a home."), + Components::CCMHome::_nil ()); } PortableServer::ServantBase_var safe (home_servant); @@ -497,6 +508,8 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::ciao_uninstall_home"); + this->uninstall (homeref, Container::Component ACE_ENV_ARG_PARAMETER); @@ -509,6 +522,8 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::uninstall"); + PortableServer::POA_ptr tmp = 0; if (t == Container::Component) @@ -536,6 +551,7 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::uninstall"); PortableServer::POA_ptr tmp = 0; if (t == Container::Component) @@ -549,7 +565,7 @@ namespace CIAO PortableServer::ObjectId_var oid = tmp->servant_to_id (svt - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_CHECK; tmp->deactivate_object (oid.in () @@ -563,6 +579,8 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::uninstall_component"); + PortableServer::ObjectId_var id = this->component_poa_->reference_to_id (objref ACE_ENV_ARG_PARAMETER); @@ -577,11 +595,12 @@ namespace CIAO void Session_Container::add_servant_map ( - PortableServer::ObjectId &, - Dynamic_Component_Servant_Base* - ACE_ENV_ARG_DECL_NOT_USED - ) + PortableServer::ObjectId &, + Dynamic_Component_Servant_Base* + ACE_ENV_ARG_DECL_NOT_USED + ) { + CIAO_TRACE ("Session_Container::add_servant_map"); } void @@ -589,14 +608,16 @@ namespace CIAO ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::deactivate_facet"); } void Session_Container::delete_servant_map ( - PortableServer::ObjectId & - ACE_ENV_ARG_DECL_NOT_USED - ) + PortableServer::ObjectId & + ACE_ENV_ARG_DECL_NOT_USED + ) { + CIAO_TRACE ("Session_Container::delete_servant_map"); } CORBA::Object_ptr @@ -604,6 +625,7 @@ namespace CIAO ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Session_Container::get_home_objref"); ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } @@ -613,6 +635,8 @@ namespace CIAO Container::OA_Type t ACE_ENV_ARG_DECL) { + CIAO_TRACE ("Session_Container::generate_reference"); + PortableServer::POA_ptr tmp = 0; if (t == Container::Component) @@ -631,11 +655,11 @@ namespace CIAO PortableServer::ObjectId_to_string (oid.in ()); if (t == Container::Facet_Consumer) - { - //if (CIAO::debug_level () > 9) - // ACE_DEBUG ((LM_DEBUG, "STRING in container is %s\n", - // str.in ())); - } + { + //if (CIAO::debug_level () > 9) + // ACE_DEBUG ((LM_DEBUG, "STRING in container is %s\n", + // str.in ())); + } CORBA::Object_var objref = tmp->create_reference_with_id (oid.in (), diff --git a/TAO/CIAO/ciao/Container_Base.h b/TAO/CIAO/ciao/Container_Base.h index 943eab3ddf6..4753c1d6f23 100644 --- a/TAO/CIAO/ciao/Container_Base.h +++ b/TAO/CIAO/ciao/Container_Base.h @@ -318,7 +318,7 @@ namespace CIAO protected: long number_; - static ACE_Atomic_Op serial_number_; + static ACE_Atomic_Op serial_number_; // @@ (OO) Does this really need to be an int? It appears to be a // boolean value. Please use bool instead. diff --git a/TAO/CIAO/ciao/Context_Impl_Base.cpp b/TAO/CIAO/ciao/Context_Impl_Base.cpp index 71581293d8c..6b31dedf392 100644 --- a/TAO/CIAO/ciao/Context_Impl_Base.cpp +++ b/TAO/CIAO/ciao/Context_Impl_Base.cpp @@ -89,4 +89,16 @@ namespace CIAO { return this->container_; } + + const char * + Context_Impl_Base::_ciao_instance_id (void) const + { + return this->ciao_instance_id_.in (); + } + + void + Context_Impl_Base::_ciao_instance_id (const char *instance_id) + { + this->ciao_instance_id_ = instance_id; + } } diff --git a/TAO/CIAO/ciao/Context_Impl_Base.h b/TAO/CIAO/ciao/Context_Impl_Base.h index 9a86e3bfd7d..62df2bba097 100644 --- a/TAO/CIAO/ciao/Context_Impl_Base.h +++ b/TAO/CIAO/ciao/Context_Impl_Base.h @@ -99,9 +99,16 @@ namespace CIAO CIAO::Session_Container *_ciao_the_Container (void) const; + const char *_ciao_instance_id (void) const; + void _ciao_instance_id (const char *instance_id); + // Accessors for the private member. + protected: Components::CCMHome_var home_; Session_Container *container_; + + private: + CORBA::String_var ciao_instance_id_; }; } diff --git a/TAO/CIAO/ciao/Context_Impl_T.cpp b/TAO/CIAO/ciao/Context_Impl_T.cpp index 9dca7821824..0ef58a1b735 100644 --- a/TAO/CIAO/ciao/Context_Impl_T.cpp +++ b/TAO/CIAO/ciao/Context_Impl_T.cpp @@ -7,9 +7,9 @@ namespace CIAO { - template Context_Impl::Context_Impl ( Components::CCMHome_ptr home, @@ -20,9 +20,9 @@ namespace CIAO { } - template Context_Impl::~Context_Impl (void) { @@ -30,9 +30,9 @@ namespace CIAO // Operations from ::Components::SessionContext. - template CORBA::Object_ptr Context_Impl::get_CCM_object ( @@ -45,22 +45,22 @@ namespace CIAO { CORBA::Object_var obj; - ACE_TRY + ACE_TRY { obj = this->container_->get_objref (this->servant_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_TRY_CHECK; } - ACE_CATCHANY - { + ACE_CATCHANY + { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught Exception \n"); + "Caught Exception \n"); return CORBA::Object::_nil (); } ACE_ENDTRY; - - + + this->component_ = COMP::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (CORBA::Object::_nil ()); diff --git a/TAO/CIAO/ciao/Context_Impl_T.h b/TAO/CIAO/ciao/Context_Impl_T.h index a2cdc0b8fc8..cc09becfd35 100644 --- a/TAO/CIAO/ciao/Context_Impl_T.h +++ b/TAO/CIAO/ciao/Context_Impl_T.h @@ -42,9 +42,9 @@ namespace Components { typedef SecurityLevel2::Credentials Principal; typedef Principal *Principal_ptr; - + class IllegalState; - + namespace Transaction { class UserTransaction; @@ -64,9 +64,9 @@ namespace CIAO * This class implements operations and contains parameterized * members common to all generated servants. */ - template class Context_Impl : public virtual BASE_CTX, public virtual Context_Impl_Base, @@ -85,7 +85,7 @@ namespace CIAO get_CCM_object (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::IllegalState)); - + protected: SVNT *servant_; COMP_VAR component_; diff --git a/TAO/CIAO/ciao/Deployment.idl b/TAO/CIAO/ciao/Deployment.idl index 089bc145c9d..032f1e10dd6 100644 --- a/TAO/CIAO/ciao/Deployment.idl +++ b/TAO/CIAO/ciao/Deployment.idl @@ -147,6 +147,21 @@ module Deployment { interface Logger { }; + /** + * @struct Sched_Params + * @brief Carries Scheduling Params + * @description CIAO specific structure to carry the scheduling params + * to set the process, required by RACE + */ + + struct Sched_Params + { + long policy_; + long priority_; + long scope_; + long msec_; + }; + interface NodeApplicationManager : ApplicationManager { @@ -171,6 +186,11 @@ module Deployment { /// CIAO speicfic operation to set the information of /// "shared components" (through NodeManager) void set_shared_components (in ComponentPlans components); + + /// CIAO specific function to set priority + /// o component , required by RACE + + long set_priority (in string cid , in Sched_Params params); }; interface NodeManager { diff --git a/TAO/CIAO/ciao/Deployment_Base.idl b/TAO/CIAO/ciao/Deployment_Base.idl index 4c769c61aed..82f97aa4a1f 100644 --- a/TAO/CIAO/ciao/Deployment_Base.idl +++ b/TAO/CIAO/ciao/Deployment_Base.idl @@ -20,6 +20,7 @@ module Deployment { struct SatisfierProperty { string name; SatisfierPropertyKind kind; + boolean dynamic; any value; }; diff --git a/TAO/CIAO/ciao/Deployment_Core.idl b/TAO/CIAO/ciao/Deployment_Core.idl index 831b41752cd..6c09f62828d 100644 --- a/TAO/CIAO/ciao/Deployment_Core.idl +++ b/TAO/CIAO/ciao/Deployment_Core.idl @@ -250,6 +250,16 @@ module Deployment void remove_component (in string inst_name) raises (::Components::RemoveFailure); + /// CIAO specific extensions + /// Activate a component instance from the NodeApplication + void activate_component (in string inst_name) + raises (::Components::RemoveFailure); + + /// CIAO specific extensions + /// Passivate a component instance from the NodeApplication + void passivate_component (in string inst_name) + raises (::Components::RemoveFailure); + /// CIAO specific extensions /// Remove all containers, components and component homes. /// Shuts down the ORB of the NodeApplication to terminate the process. diff --git a/TAO/CIAO/ciao/Deployment_Data.idl b/TAO/CIAO/ciao/Deployment_Data.idl index 62b5c7a2ce6..d4e0628ebce 100644 --- a/TAO/CIAO/ciao/Deployment_Data.idl +++ b/TAO/CIAO/ciao/Deployment_Data.idl @@ -68,7 +68,7 @@ module Deployment { ResourceUsageKind resourceUsage; string requirementName; string resourceName; - any resourceValue; + Properties property; }; typedef sequence < InstanceResourceDeploymentDescription > InstanceResourceDeploymentDescriptions; @@ -110,7 +110,7 @@ module Deployment { string targetName; string requirementName; string resourceName; - any resourceValue; + Properties property; }; typedef sequence < ConnectionResourceDeploymentDescription > ConnectionResourceDeploymentDescriptions; @@ -152,7 +152,7 @@ module Deployment { struct ResourceDeploymentDescription { string requirementName; string resourceName; - any resourceValue; + Properties property; }; typedef sequence < ResourceDeploymentDescription > ResourceDeploymentDescriptions; @@ -176,7 +176,7 @@ module Deployment { MonolithicDeploymentDescriptions implementation; InstanceDeploymentDescriptions instance; PlanConnectionDescriptions connection; - PlanPropertyMappings externalProperty; + PlanPropertyMappings externalProperty; ImplementationDependencies dependsOn; ArtifactDeploymentDescriptions artifact; Properties infoProperty; @@ -197,38 +197,6 @@ module Deployment { typedef sequence < ComponentPackageReference > ComponentPackageReferences; - struct SubcomponentPortEndpoint { - string portName; - unsigned long instanceRef; - }; - - typedef sequence < SubcomponentPortEndpoint > SubcomponentPortEndpoints; - - struct AssemblyConnectionDescription { - string name; - Requirements deployRequirement; - ComponentExternalPortEndpoints externalEndpoint; - SubcomponentPortEndpoints internalEndpoint; - ExternalReferenceEndpoints externalReference; - }; - - typedef sequence < AssemblyConnectionDescription > AssemblyConnectionDescriptions; - - struct SubcomponentPropertyReference { - string propertyName; - unsigned long instanceRef; - }; - - typedef sequence < SubcomponentPropertyReference > SubcomponentPropertyReferences; - - struct AssemblyPropertyMapping { - string name; - string externalName; - SubcomponentPropertyReferences delegatesTo; - }; - - typedef sequence < AssemblyPropertyMapping > AssemblyPropertyMappings; - typedef sequence < ResourceUsageKind > ResourceUsageKinds; struct ImplementationRequirement { diff --git a/TAO/CIAO/ciao/Deployment_common.h b/TAO/CIAO/ciao/Deployment_common.h index 4e15401d7d8..725b6afd953 100644 --- a/TAO/CIAO/ciao/Deployment_common.h +++ b/TAO/CIAO/ciao/Deployment_common.h @@ -7,7 +7,7 @@ * objects of DAnCE toolchain. * * @author Gan Deng - */ + */ #ifndef DANCE_COMMON_H #define DANCE_COMMON_H @@ -40,7 +40,7 @@ namespace CIAO bool operator==(const struct _component_binding & comp) { - if (this->name_ == comp.name_ && + if (this->name_ == comp.name_ && this->plan_uuid_ == comp.plan_uuid_ && this->node_ == comp.node_) return true; diff --git a/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp b/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp index adebb4ffee1..404b1c94a7d 100644 --- a/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp +++ b/TAO/CIAO/ciao/Home_Servant_Impl_T.cpp @@ -4,6 +4,7 @@ #define CIAO_HOME_SERVANT_IMPL_T_C #include "Home_Servant_Impl_T.h" +#include "CIAO_common.h" namespace CIAO @@ -51,6 +52,8 @@ namespace CIAO COMP_EXEC_VAR, COMP_SVNT>::~Home_Servant_Impl (void) { + CIAO_TRACE ("Home_Servant_Impl<>::destructor"); + const OBJ_ITERATOR end = this->objref_map_.end (); @@ -87,6 +90,8 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)) { + CIAO_TRACE ("Home_Servant_Impl<>::remove_component"); + PortableServer::ObjectId_var oid = this->container_->the_POA ()->reference_to_id (comp ACE_ENV_ARG_PARAMETER); @@ -112,7 +117,8 @@ namespace CIAO _ciao_comp->remove (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - ACE_DEBUG ((LM_DEBUG, "removed the component\n")); + if (CIAO::debug_level () > 3) + ACE_DEBUG ((LM_DEBUG, "removed the component\n")); } template ::update_component_map ( PortableServer::ObjectId &oid) { + CIAO_TRACE ("update_component_map"); + Components::CCMObject_var ccm_obj_ptr; if (objref_map_.unbind (oid, ccm_obj_ptr) != 0) { @@ -167,6 +175,8 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)) { + CIAO_TRACE ("Home_Servant_Impl<>::create_component"); + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -194,6 +204,8 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)) { + CIAO_TRACE ("Home_Servant_Impl<>::create"); + if (this->executor_.in () == 0) { ACE_THROW_RETURN (CORBA::INTERNAL (), @@ -237,6 +249,8 @@ namespace CIAO ) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Home_Servant_Impl<>::_ciao_activate_component"); + CORBA::Object_var hobj = this->container_->get_objref (this ACE_ENV_ARG_PARAMETER); @@ -302,6 +316,8 @@ namespace CIAO ) ACE_THROW_SPEC ((CORBA::SystemException)) { + CIAO_TRACE ("Home_Servant_Impl<>::_ciao_passivate_component"); + PortableServer::ObjectId_var oid; this->container_->uninstall_component (comp, oid.out () diff --git a/TAO/CIAO/ciao/Object_Set_T.h b/TAO/CIAO/ciao/Object_Set_T.h index d21ff724faf..b11632a5e1b 100644 --- a/TAO/CIAO/ciao/Object_Set_T.h +++ b/TAO/CIAO/ciao/Object_Set_T.h @@ -60,7 +60,7 @@ namespace CIAO /// Removing all objects from the set. Return -1 if error occurred. CORBA::Long remove_all (void); - + /// Access the underlying T_var array directly. This is added to /// get around a bug in TAO's sequence of object C++ mapping. T_var &at (CORBA::ULong index); diff --git a/TAO/CIAO/ciao/Packaging_Data.idl b/TAO/CIAO/ciao/Packaging_Data.idl index 59f8420fd16..533116196eb 100644 --- a/TAO/CIAO/ciao/Packaging_Data.idl +++ b/TAO/CIAO/ciao/Packaging_Data.idl @@ -7,10 +7,39 @@ module Deployment { + struct ComponentPackageImport { + ::CORBA::StringSeq location; + }; + + typedef sequence < ComponentPackageImport > ComponentPackageImports; + + struct SubcomponentPropertyReference { + string propertyName; + unsigned long instanceRef; + }; + + struct SubcomponentPortEndpoint { + string portName; + unsigned long instanceRef; + }; + + typedef sequence < SubcomponentPortEndpoint > SubcomponentPortEndpoints; + + typedef sequence < SubcomponentPropertyReference > SubcomponentPropertyReferences; + + struct AssemblyPropertyMapping { + string name; + string externalName; + SubcomponentPropertyReferences delegatesTo; + }; + typedef sequence < AssemblyPropertyMapping > AssemblyPropertyMappings; + +#ifndef AVOID_IFR_CRASH struct NamedImplementationArtifact; typedef sequence < NamedImplementationArtifact > NamedImplementationArtifacts; +#endif /* AVOID_IFR_CRASH */ struct ImplementationArtifactDescription { string label; @@ -18,7 +47,9 @@ module Deployment ::CORBA::StringSeq location; Properties execParameter; Requirements deployRequirement; +#ifndef AVOID_IFR_CRASH NamedImplementationArtifacts dependsOn; +#endif /* AVOID_IFR_CRASH */ Properties infoProperty; }; @@ -28,13 +59,17 @@ module Deployment }; struct MonolithicImplementationDescription { - Properties execParameter; + Properties nodeExecParameter; + Properties componentExecParameter; +#ifndef AVOID_IFR_CRASH NamedImplementationArtifacts primaryArtifact; +#endif /* AVOID_IFR_CRASH */ ImplementationRequirements deployRequirement; }; typedef sequence < MonolithicImplementationDescription > MonolithicImplementationDescriptions; +#ifndef AVOID_IFR_CRASH struct PackageConfiguration; typedef sequence < PackageConfiguration > PackageConfigurations; @@ -42,17 +77,31 @@ module Deployment struct ComponentPackageDescription; typedef sequence < ComponentPackageDescription > ComponentPackageDescriptions; +#endif /* AVOID_IFR_CRASH */ struct SubcomponentInstantiationDescription { string name; - ComponentPackageDescriptions package; - Properties configProperty; +#ifndef AVOID_IFR_CRASH + ComponentPackageDescriptions basePackage; + PackageConfigurations specializedConfig; +#endif /* AVOID_IFR_CRASH */ Requirements selectRequirement; - ComponentPackageReferences reference; + Properties configProperty; + ComponentPackageReferences referencedPackage; + ComponentPackageImports importedPackage; }; typedef sequence < SubcomponentInstantiationDescription > SubcomponentInstantiationDescriptions; + struct AssemblyConnectionDescription { + string name; + Requirements deployRequirement; + ComponentExternalPortEndpoints externalEndpoint; + SubcomponentPortEndpoints internalEndpoint; + ExternalReferenceEndpoints externalReference; + }; + + typedef sequence < AssemblyConnectionDescription > AssemblyConnectionDescriptions; struct ComponentAssemblyDescription { SubcomponentInstantiationDescriptions instance; @@ -96,8 +145,10 @@ module Deployment struct PackageConfiguration { string label; string UUID; +#ifndef AVOID_IFR_CRASH PackageConfigurations specializedConfig; ComponentPackageDescriptions basePackage; +#endif /* AVOID_IFR_CRASH */ ComponentPackageReferences reference; Requirements selectRequirement; Properties configProperty; diff --git a/TAO/CIAO/ciao/Servant_Activator.cpp b/TAO/CIAO/ciao/Servant_Activator.cpp index 6830454ac35..cf194524ec7 100644 --- a/TAO/CIAO/ciao/Servant_Activator.cpp +++ b/TAO/CIAO/ciao/Servant_Activator.cpp @@ -110,8 +110,10 @@ namespace CIAO // We should try avoiding making outbound calls with the // lock held. Oh well, let us get some sense of sanity in // CIAO to do think about these. - ACE_DEBUG ((LM_DEBUG, "Activating Port %s\n", - str.in ())); + if (CIAO::debug_level () > 5) + ACE_DEBUG ((LM_DEBUG, "Activating Port %s\n", + str.in ())); + return this->pa_[t]->activate (oid ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/CIAO/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/ciao/Servant_Impl_Base.cpp index 51c1ae27867..5cefb47882b 100644 --- a/TAO/CIAO/ciao/Servant_Impl_Base.cpp +++ b/TAO/CIAO/ciao/Servant_Impl_Base.cpp @@ -410,7 +410,32 @@ namespace CIAO ) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + ACE_DEBUG ((LM_DEBUG, "In Servant_Impl_Base::get_all_receptacles\n")); + + ::Components::ReceptacleDescriptions *tmp = 0; + ACE_NEW_RETURN (tmp, + ::Components::ReceptacleDescriptions, + 0); + + ::Components::ReceptacleDescriptions_var retval = tmp; + + retval->length (this->receptacle_table_.current_size ()); + CORBA::ULong i = 0; + + ACE_DEBUG ((LM_DEBUG, "Building sequence of length %d\n", retval->length())); + + for (ReceptacleTable::iterator iter = this->receptacle_table_.begin (); + iter != this->receptacle_table_.end (); + ++iter, ++i) + { + ACE_DEBUG ((LM_DEBUG, "Starting loop iteration...\n", retval->length())); + + ReceptacleTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; + } + + ACE_DEBUG ((LM_DEBUG, "Escaped loop.\n")); + return retval._retn (); } ::Components::ReceptacleDescriptions * @@ -491,6 +516,73 @@ namespace CIAO return fd._retn (); } + void + Servant_Impl_Base::add_receptacle (const char *receptacle_name, + CORBA::Object_ptr recept_ref, + ::Components::Cookie * cookie) + { + ACE_DEBUG ((LM_DEBUG, "In Servant_Impl_Base::add_receptacle (%s)\n", receptacle_name)); + + ::Components::ReceptacleDescription_var safe; + ::Components::ReceptacleDescription *rd = 0; + + if (this->receptacle_table_.find (receptacle_name, + safe) == -1) + { + ACE_DEBUG ((LM_DEBUG, "Found no receptacle named (%s)\n", receptacle_name)); + + ACE_NEW (rd, + OBV_Components::ReceptacleDescription); + safe = rd; + + rd->name (receptacle_name); + rd->type_id (recept_ref->_interface_repository_id ()); + // The receptacle is a multiplex receptacle if and only if a + // cookie was given. + rd->is_multiple (cookie != 0); + + ::Components::ConnectionDescription *cd = 0; + ACE_NEW (cd, + OBV_Components::ConnectionDescription); + ::Components::ConnectionDescription_var cd_safe = cd; + + cd->ck (cookie); + cd->objref (recept_ref); + + ::Components::ConnectionDescriptions cds (1); + + cds.length (1); + cds[0] = cd_safe; + rd->connections (cds); + } + else + { + ACE_DEBUG ((LM_DEBUG, "Found a receptacle named (%s)\n", receptacle_name)); + rd = safe.inout (); + + ::Components::ConnectionDescription *cd = 0; + ACE_NEW (cd, + OBV_Components::ConnectionDescription); + ::Components::ConnectionDescription_var cd_safe = cd; + + cd->ck (cookie); + cd->objref (recept_ref); + + ::Components::ConnectionDescriptions & cds = rd->connections (); + CORBA::ULong old_length = cds.length (); + ACE_DEBUG ((LM_DEBUG, "Old length was %d\n", old_length)); + cds.length (old_length + 1); + ACE_DEBUG ((LM_DEBUG, "New length %d\n", cds.length ())); + cds [old_length] = cd_safe; + ACE_DEBUG ((LM_DEBUG, "Added new connection to receptacle named (%s)\n", receptacle_name)); + } + + if (this->receptacle_table_.bind (receptacle_name, safe) == 0) + { + ACE_DEBUG ((LM_DEBUG, "Successfully added new receptacle named (%s)\n", receptacle_name)); + } + } + void Servant_Impl_Base::add_consumer ( const char *port_name, @@ -540,8 +632,8 @@ namespace CIAO return cd._retn (); } - - ::Components::StandardConfigurator_ptr + + ::Components::StandardConfigurator_ptr Servant_Impl_Base::get_standard_configurator (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { diff --git a/TAO/CIAO/ciao/Servant_Impl_Base.h b/TAO/CIAO/ciao/Servant_Impl_Base.h index abbc73091a8..90eac8b8585 100644 --- a/TAO/CIAO/ciao/Servant_Impl_Base.h +++ b/TAO/CIAO/ciao/Servant_Impl_Base.h @@ -186,6 +186,10 @@ namespace CIAO const char *port_name ); + void add_receptacle (const char *receptacle_name, + CORBA::Object_ptr recept_ref, + ::Components::Cookie * cookie); + void add_consumer (const char *port_name, ::Components::EventConsumerBase_ptr port_ref); @@ -212,8 +216,16 @@ namespace CIAO ACE_Null_Mutex> ConsumerTable; + typedef ACE_Hash_Map_Manager_Ex, + ACE_Equal_To, + ACE_Null_Mutex> + ReceptacleTable; + FacetTable facet_table_; ConsumerTable consumer_table_; + ReceptacleTable receptacle_table_; Components::CCMHome_var home_; Home_Servant_Impl_Base *home_servant_; Session_Container * container_; diff --git a/TAO/CIAO/ciao/Servant_Impl_T.cpp b/TAO/CIAO/ciao/Servant_Impl_T.cpp index 4d1d15b4823..01ee28df790 100644 --- a/TAO/CIAO/ciao/Servant_Impl_T.cpp +++ b/TAO/CIAO/ciao/Servant_Impl_T.cpp @@ -301,6 +301,10 @@ namespace CIAO if (! ::CORBA::is_nil (temp.in ())) temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; + + this->pre_activated_ = 0; + this->activated_ = 0; + this->post_activated_ = 0; } } diff --git a/TAO/CIAO/ciao/Server_init.cpp b/TAO/CIAO/ciao/Server_init.cpp index 43eaabcd598..27c4d035cdc 100644 --- a/TAO/CIAO/ciao/Server_init.cpp +++ b/TAO/CIAO/ciao/Server_init.cpp @@ -6,52 +6,235 @@ #include "Cookies.h" #include "ace/OS_NS_stdio.h" - -int -CIAO::Server_init (CORBA::ORB_ptr o) -{ - CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, - Components::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, - CIAO::Cookie); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PortDescription_init, - Components::PortDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::FacetDescription_init, - Components::FacetDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConnectionDescription_init, - Components::ConnectionDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ReceptacleDescription_init, - Components::ReceptacleDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConsumerDescription_init, - Components::ConsumerDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::EmitterDescription_init, - Components::EmitterDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::SubscriberDescription_init, - Components::SubscriberDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::PublisherDescription_init, - Components::PublisherDescription); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ConfigValue_init, - Components::ConfigValue); - CIAO_REGISTER_VALUE_FACTORY (o, Components::ComponentPortDescription_init, - Components::ComponentPortDescription); - return 0; -} - -int -CIAO::Utility::write_IOR (const char *pathname, - const char *ior) +namespace CIAO { - FILE* ior_output_file_ = - ACE_OS::fopen (pathname, "w"); + int + Server_init (CORBA::ORB_ptr o) + { + CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, + Components::Cookie); + CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Map_Key_Cookie_init, + CIAO::Cookie); + CIAO_REGISTER_VALUE_FACTORY (o, Components::PortDescription_init, + Components::PortDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::FacetDescription_init, + Components::FacetDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::ConnectionDescription_init, + Components::ConnectionDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::ReceptacleDescription_init, + Components::ReceptacleDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::ConsumerDescription_init, + Components::ConsumerDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::EmitterDescription_init, + Components::EmitterDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::SubscriberDescription_init, + Components::SubscriberDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::PublisherDescription_init, + Components::PublisherDescription); + CIAO_REGISTER_VALUE_FACTORY (o, Components::ConfigValue_init, + Components::ConfigValue); + CIAO_REGISTER_VALUE_FACTORY (o, Components::ComponentPortDescription_init, + Components::ComponentPortDescription); + return 0; + } + + namespace Utility + { + int write_IOR (const char *pathname, + const char *ior) + { + FILE* ior_output_file_ = + ACE_OS::fopen (pathname, "w"); + + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, + "%s", + ior); + ACE_OS::fclose (ior_output_file_); + return 0; + } + + return -1; + } + + // -------------------------------------------------------------- + // Implementation of NameUtility class + // -------------------------------------------------------------- + + void NameUtility::CreateContextPath (const CosNaming::NamingContextExt_ptr nc, + const CosNaming::Name& name) + { + bool isNotFound = false; + CORBA::ULong lengthMissing = 0; + CORBA::ULong OriginalLength = name.length(); + CosNaming::Name tmpName; - if (ior_output_file_) + CosNaming::NamingContext_var tmpCtxVar; + + ACE_TRY + { + tmpCtxVar = nc->bind_new_context(name); + ACE_DEBUG ((LM_DEBUG, "Bound Context.\n\n")); + } + ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex) + { + ACE_DEBUG ((LM_DEBUG, "Context Already Bound.\n\n")); + } + ACE_CATCH (CosNaming::NamingContext::NotFound, nf) + { + ACE_DEBUG ((LM_DEBUG, "Context not found.\n\n")); + isNotFound = true; + lengthMissing = nf.rest_of_name.length(); + } + ACE_ENDTRY; + + if (lengthMissing == name.length()) + { + ACE_DEBUG ((LM_ERROR, "Null name length.\n\n")); + } + + if (isNotFound) + { + for (CORBA::ULong l = OriginalLength-lengthMissing; + l < OriginalLength; + l++) + { + tmpName.length(l+1); + for (CORBA::ULong i=0; i <= l; i++) + { + tmpName[i] = name[i]; + + CORBA::String_var newSCName = nc->to_string(tmpName); + ACE_DEBUG ((LM_DEBUG, "What's left of the name:%s\n", + newSCName.in ())); + } + + tmpCtxVar = nc->bind_new_context(tmpName); + ACE_DEBUG ((LM_DEBUG, "Bound New Context.\n")); + } + } + } + + //--------------------------------------------------------------------------------------------- + void NameUtility::BindObjectPath (const CosNaming::NamingContextExt_ptr nc, + const CosNaming::Name& name, + const CORBA::Object_var obj) { - ACE_OS::fprintf (ior_output_file_, - "%s", - ior); - ACE_OS::fclose (ior_output_file_); - return 0; + CosNaming::Name tmpName; + CORBA::String_var newSCName = nc->to_string(name); + ACE_DEBUG ((LM_DEBUG, "The name is: %s\n", newSCName.in ())); + + ACE_TRY + { + nc->rebind(name, obj); + } + + ACE_CATCH (CosNaming::NamingContext::NotFound, ex ) + { + ACE_DEBUG ((LM_DEBUG, "Name not found, doing new bind.\n")); + nc->bind(name, obj); + } + ACE_ENDTRY; + } + + //--------------------------------------------------------------------------------------------- + CosNaming::BindingList * + NameUtility::listBindings (const CosNaming::NamingContext_ptr nc, + const CosNaming::Name& name, + CORBA::ULong max_list_size) + { + CosNaming::BindingList_var basicListV; + CosNaming::BindingIterator_var bIterV; + + CORBA::Object_var objV; + CosNaming::NamingContext_var tmpContextV; + + if (name.length()==0) + { + tmpContextV = CosNaming::NamingContext::_duplicate(nc); + } + else + { + objV = nc->resolve(name); + tmpContextV = CosNaming::NamingContext::_narrow(objV.in ()); + } + if (CORBA::is_nil(tmpContextV.in ())) + { + ACE_DEBUG ((LM_ERROR, "listBindings: Nil context.\n")); + return 0; + } + + tmpContextV->list(max_list_size, basicListV.out(), bIterV.out()); + + CORBA::Long max_remaining = max_list_size - basicListV->length(); + CORBA::Boolean moreBindings = !CORBA::is_nil(bIterV.in ()); + + if (moreBindings) + { + while (moreBindings && (max_remaining > 0) ) + { + CosNaming::BindingList_var tmpListV; + + moreBindings = bIterV->next_n(max_remaining, tmpListV.out()); + + //Append 'tmpListV' to 'basicListV' + CORBA::ULong basicListLen = basicListV->length(); + basicListV->length(basicListLen+tmpListV->length()); + for (CORBA::ULong i=0; i < tmpListV->length(); i++) + { + (*basicListV)[i+basicListLen] = (*tmpListV)[i]; + } + + //Re-calculate 'max_remaining' + max_remaining = max_list_size - basicListV->length(); + } + bIterV->destroy(); + } + + return basicListV._retn(); + } + + //--------------------------------------------------------------------------------------------- + void + NameUtility::recursiveUnbind (const CosNaming::NamingContext_ptr nc, + const CosNaming::Name& name) + { + CORBA::Object_var objV; + CosNaming::NamingContext_var tmpContextV; + + objV = nc->resolve(name); + tmpContextV = CosNaming::NamingContext::_narrow(objV.in ()); + if (CORBA::is_nil(tmpContextV.in ())) + { + ACE_DEBUG ((LM_ERROR, "recursiveUnbind: Nil context reference.\n")); + return; + } + + CosNaming::BindingList_var blV; + CosNaming::Name tmpName; + tmpName.length(0); + + blV = NameUtility::listBindings(tmpContextV.in(), + tmpName, + 10000); // 'max_list_size' + + for (CORBA::ULong i=0; ilength(); i++) + { + tmpName = (*blV)[i].binding_name; + + if ((*blV)[i].binding_type==CosNaming::nobject) + { + tmpContextV->unbind(tmpName); + } + else if ( (*blV)[i].binding_type==CosNaming::ncontext) + { + NameUtility::recursiveUnbind(tmpContextV.in(), tmpName); + } + } + nc->unbind(name); + tmpContextV->destroy(); } - return -1; -} + } /* namespace Utility */ +} /* namespace CIAO */ diff --git a/TAO/CIAO/ciao/Server_init.h b/TAO/CIAO/ciao/Server_init.h index 728c4abdd10..c5fe53ed77d 100644 --- a/TAO/CIAO/ciao/Server_init.h +++ b/TAO/CIAO/ciao/Server_init.h @@ -7,6 +7,7 @@ * I'm also puting some utilities functions here. * * @author Nanbor Wang + * @author Gan Deng */ #ifndef CIAO_SERVER_INIT_H @@ -15,6 +16,7 @@ #include "CIAO_Server_Export.h" #include "tao/Versioned_Namespace.h" +#include #if !defined ACE_LACKS_PRAGMA_ONCE #pragma once @@ -46,6 +48,42 @@ namespace CIAO /// overwritten. CIAO_SERVER_Export int write_IOR (const char *pathname, const char *IOR); + + class CIAO_SERVER_Export NameUtility + { + /** + * A utility class to bind naming context. This class is contributed by + * Dipa Suri . + * + * The concept/code are derived from + * http://www.informit.com/articles/article.asp?p=23266&seqNum=6 + */ + + public: + /// For each 'NameComponent' in 'name', create a corresponding 'NamingContext'. + static void CreateContextPath (const CosNaming::NamingContextExt_ptr, + const CosNaming::Name &); + + /// For the first [0, length-2] NameComponents of 'name', create a + /// corresponding 'NamingContext'. + /// For the length-1 NameComponent of 'name', bind it to the object + /// reference 'obj'. + static void BindObjectPath (const CosNaming::NamingContextExt_ptr, + const CosNaming::Name&, + const CORBA::Object_var); + + /// Get a list of all bindings under the given context, up to + /// max_list_size. + static CosNaming::BindingList * listBindings (const CosNaming::NamingContext_ptr, + const CosNaming::Name&, + CORBA::ULong); + + /// Recursively unbind all objects and contexts below the given name + /// context, given the initial context nc. + /// Assumes a tree shape to service (not cyclic) + static void recursiveUnbind (const CosNaming::NamingContext_ptr, + const CosNaming::Name&); + }; } } diff --git a/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp index 2b7e644b0b9..452aea78035 100644 --- a/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp +++ b/TAO/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp @@ -229,7 +229,7 @@ namespace CIAO this->container_->add_servant_map (oid, svt ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (COMP::_nil ()); - + this->dynamic_servant_map_.bind (oid.in (), svt); COMP_VAR ho = COMP::_narrow (objref.in () diff --git a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp index b2a85351487..da7843974c4 100644 --- a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp +++ b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.cpp @@ -7,9 +7,9 @@ namespace CIAO { - template Upgradeable_Context_Impl:: Upgradeable_Context_Impl ( @@ -21,18 +21,18 @@ namespace CIAO { } - template Upgradeable_Context_Impl:: ~Upgradeable_Context_Impl (void) { } - template void Upgradeable_Context_Impl::deactivate_facet ( @@ -50,9 +50,9 @@ namespace CIAO ACE_CHECK; } - template void Upgradeable_Context_Impl:: @@ -65,17 +65,17 @@ namespace CIAO this->container_->the_facet_cons_POA ()->reference_to_id (reference ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + this->update_port_activator (oid.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + this->deactivate_facet (oid.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; } - template void Upgradeable_Context_Impl:: diff --git a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h index 42a28142284..62086b1f0c3 100644 --- a/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h +++ b/TAO/CIAO/ciao/Upgradeable_Context_Impl_T.h @@ -31,9 +31,9 @@ TAO_END_VERSIONED_NAMESPACE_DECL namespace CIAO { - template class Upgradeable_Context_Impl : public virtual Context_Impl< BASE_CTX, SVNT, COMP, COMP_VAR> @@ -66,7 +66,7 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, ::Components::InvalidName, ::Components::InvalidConnection)) = 0; - + protected: SVNT *servant_; COMP_VAR component_; diff --git a/TAO/CIAO/docs/Purify.html b/TAO/CIAO/docs/Purify.html index fff258db120..12c1900ba0c 100644 --- a/TAO/CIAO/docs/Purify.html +++ b/TAO/CIAO/docs/Purify.html @@ -1,72 +1,72 @@ - Using Rational Purify with CIAO + Using Rational Purify with CIAO

    Using Rational Purify with CIAO

    -

    This document is about using Purify with Visual Studio 7.1 to track down - memory leaks and other bugs in CIAO applications. For the Linux/Unix - environment, Valgrind is a better-suited tool - see Will Otte's documentation +

    This document is about using Purify with Visual Studio 7.1 to track down + memory leaks and other bugs in CIAO applications. For the Linux/Unix + environment, Valgrind is a better-suited tool - see Will Otte's documentation on using Valgrind with CIAO in this directory.

    -

    Purify can be run from within Visual Studio, or standalone. The executable is - c:\Program Files\Rational\PurifyPlus\purifyw.exe. Typing this will bring up the - same Purify window you see if you run it from within Visual Studio. You can +

    Purify can be run from within Visual Studio, or standalone. The executable is + c:\Program Files\Rational\PurifyPlus\purifyw.exe. Typing this will bring up the + same Purify window you see if you run it from within Visual Studio. You can install Purify from the web by going to - \\Atlantis\software\RationSuiteEnterprise-v2003-06-12  and clicking - on C57BPML.zip. This will install a whole bunch of Rational stuff - by default, so you will probaby want to deselect everything but PurifyPlus, - although Quantify is a good bottleneck-finder when you're trying to improve - performance, so that might be worth installing and playing with as well. During - the installation process, you'll be prompted for a mode of licensing. Select + \\Atlantis\software\RationSuiteEnterprise-v2003-06-12  and clicking + on C57BPML.zip. This will install a whole bunch of Rational stuff + by default, so you will probaby want to deselect everything but PurifyPlus, + although Quantify is a good bottleneck-finder when you're trying to improve + performance, so that might be worth installing and playing with as well. During + the installation process, you'll be prompted for a mode of licensing. Select the use of a license server, and then you'll be prompted for its address. Use rational.vuse.vanderbilt.edu.

    -

    The option to exclude all modules in Windows directories will probably be set - by default, but if you notice memory leaks reported for Windows stuff, you - might want to double check this and turn it off. From the PurifyPlus menu bar - item in Visual Studio, it's at PurifyPlus->Purify->Settings->DefaultSettings->PowerCheck. - When run for the first time, Purify will instrument all libraries linked to the - executable. Select PurifyPlus->Purify->Run, and a window will pop - up prompting you for the executable name, command line options, and working +

    The option to exclude all modules in Windows directories will probably be set + by default, but if you notice memory leaks reported for Windows stuff, you + might want to double check this and turn it off. From the PurifyPlus menu bar + item in Visual Studio, it's at PurifyPlus->Purify->Settings->DefaultSettings->PowerCheck. + When run for the first time, Purify will instrument all libraries linked to the + executable. Select PurifyPlus->Purify->Run, and a window will pop + up prompting you for the executable name, command line options, and working directory.

    -

    Purify's output will appear in the Visual Studio text editing window. This - output can be saved to the given filename. The type of error reported is - indicated by a 3-letter code - the most common are UMR (Unitialized Memory - Read), FMM (Freeing Mismatched Memory), and MLK (Memory Leak). Each of these - can be expanded to show the call stack. The depth of the call stack can be - modified in Settings if it's not deep enough. FMM messages will show both +

    Purify's output will appear in the Visual Studio text editing window. This + output can be saved to the given filename. The type of error reported is + indicated by a 3-letter code - the most common are UMR (Unitialized Memory + Read), FMM (Freeing Mismatched Memory), and MLK (Memory Leak). Each of these + can be expanded to show the call stack. The depth of the call stack can be + modified in Settings if it's not deep enough. FMM messages will show both allocation and deallocation call stacks.

    - Quite often in CIAO, we will want to Purify a process that is spawned by - another process, and therefore not directly runnable in Purify. This is fairly - easy to do, but it must be done from the command line. If the name of the child - process we want to instrument is child.exe, then it can be + Quite often in CIAO, we will want to Purify a process that is spawned by + another process, and therefore not directly runnable in Purify. This is fairly + easy to do, but it must be done from the command line. If the name of the child + process we want to instrument is child.exe, then it can be instrumented by typing
    purifyw /Run=no /Replace=yes child.exe
    - This will rename the original executable as child.exe.Original, - and the new instrumented executable will be child.exe. Now when - you run the parent process under Purify, you'll see one window opened up in - Visual Studio's text editor for this process, and when the child process is - spawned, a second window will open. A couple of caveats to make this work + This will rename the original executable as child.exe.Original, + and the new instrumented executable will be child.exe. Now when + you run the parent process under Purify, you'll see one window opened up in + Visual Studio's text editor for this process, and when the child process is + spawned, a second window will open. A couple of caveats to make this work smoothly:
    • - Instrumented executables run 2 to 5 times slower than uninstrumented ones, so - any timeouts in the code should be extended accordingly. For example, if an + Instrumented executables run 2 to 5 times slower than uninstrumented ones, so + any timeouts in the code should be extended accordingly. For example, if an instrumented NodeApplication is spawned by NodeManager, add -d 15 or -d 20 to NodeManager's command line.
    • - If an instrumented process is simply killed, there will probably be many - spurious error messages, mostly related to ORB resources that were not cleaned - up by a graceful shutdown. All processes tested with Purify should have a + If an instrumented process is simply killed, there will probably be many + spurious error messages, mostly related to ORB resources that were not cleaned + up by a graceful shutdown. All processes tested with Purify should have a graceful shutdown built in to eliminate these bogus memory leak messages.

    Jeff Parsons
    - Last modified: Oct 3 2005 + Last modified: Oct 3 2005 diff --git a/TAO/CIAO/docs/XML/ciao_rt_cad_ext.dtd b/TAO/CIAO/docs/XML/ciao_rt_cad_ext.dtd index 7877afe2151..ca30620ae4f 100644 --- a/TAO/CIAO/docs/XML/ciao_rt_cad_ext.dtd +++ b/TAO/CIAO/docs/XML/ciao_rt_cad_ext.dtd @@ -90,4 +90,4 @@ element. --> \ No newline at end of file + idref IDREF #REQUIRED> diff --git a/TAO/CIAO/docs/imgs/CCM-v5.vsd b/TAO/CIAO/docs/imgs/CCM-v5.vsd index 7f4d7539050..ba79699b477 100644 Binary files a/TAO/CIAO/docs/imgs/CCM-v5.vsd and b/TAO/CIAO/docs/imgs/CCM-v5.vsd differ diff --git a/TAO/CIAO/docs/imgs/CCM.vsd b/TAO/CIAO/docs/imgs/CCM.vsd index 239a4e7943d..4ca4f231805 100644 Binary files a/TAO/CIAO/docs/imgs/CCM.vsd and b/TAO/CIAO/docs/imgs/CCM.vsd differ diff --git a/TAO/CIAO/docs/imgs/DAnCE-Dynamic.png b/TAO/CIAO/docs/imgs/DAnCE-Dynamic.png index 2e9917e1520..ac719b3af2a 100644 Binary files a/TAO/CIAO/docs/imgs/DAnCE-Dynamic.png and b/TAO/CIAO/docs/imgs/DAnCE-Dynamic.png differ diff --git a/TAO/CIAO/docs/imgs/DAnCE-Dynamic.sxd b/TAO/CIAO/docs/imgs/DAnCE-Dynamic.sxd index b795c5ae049..3175b935a17 100644 Binary files a/TAO/CIAO/docs/imgs/DAnCE-Dynamic.sxd and b/TAO/CIAO/docs/imgs/DAnCE-Dynamic.sxd differ diff --git a/TAO/CIAO/docs/imgs/File-Gen-Existing.png b/TAO/CIAO/docs/imgs/File-Gen-Existing.png index 8deb5d32fd3..0c89f232ce3 100644 Binary files a/TAO/CIAO/docs/imgs/File-Gen-Existing.png and b/TAO/CIAO/docs/imgs/File-Gen-Existing.png differ diff --git a/TAO/CIAO/docs/imgs/File-Gen-Future.png b/TAO/CIAO/docs/imgs/File-Gen-Future.png index 1daef691bdf..1b4d3ae25cb 100644 Binary files a/TAO/CIAO/docs/imgs/File-Gen-Future.png and b/TAO/CIAO/docs/imgs/File-Gen-Future.png differ diff --git a/TAO/CIAO/docs/imgs/File_Generation_Flow.vsd b/TAO/CIAO/docs/imgs/File_Generation_Flow.vsd index ef6332d49ac..e39ba75c4e6 100644 Binary files a/TAO/CIAO/docs/imgs/File_Generation_Flow.vsd and b/TAO/CIAO/docs/imgs/File_Generation_Flow.vsd differ diff --git a/TAO/CIAO/docs/imgs/IDL-CIDL-classes.vsd b/TAO/CIAO/docs/imgs/IDL-CIDL-classes.vsd index 0986aa78d70..ed1c7191bab 100644 Binary files a/TAO/CIAO/docs/imgs/IDL-CIDL-classes.vsd and b/TAO/CIAO/docs/imgs/IDL-CIDL-classes.vsd differ diff --git a/TAO/CIAO/docs/imgs/basic-container.png b/TAO/CIAO/docs/imgs/basic-container.png index 9df767b45a2..99f0bc2dd4b 100644 Binary files a/TAO/CIAO/docs/imgs/basic-container.png and b/TAO/CIAO/docs/imgs/basic-container.png differ diff --git a/TAO/CIAO/docs/imgs/ciao-dynamic1.jpg b/TAO/CIAO/docs/imgs/ciao-dynamic1.jpg index a385ad30848..65f5d4154f8 100644 Binary files a/TAO/CIAO/docs/imgs/ciao-dynamic1.jpg and b/TAO/CIAO/docs/imgs/ciao-dynamic1.jpg differ diff --git a/TAO/CIAO/docs/imgs/ciao-dynamic2.jpg b/TAO/CIAO/docs/imgs/ciao-dynamic2.jpg index e0a705b9d3a..31d5eeb88d7 100644 Binary files a/TAO/CIAO/docs/imgs/ciao-dynamic2.jpg and b/TAO/CIAO/docs/imgs/ciao-dynamic2.jpg differ diff --git a/TAO/CIAO/docs/imgs/ciao-static-vs-dynamic.jpg b/TAO/CIAO/docs/imgs/ciao-static-vs-dynamic.jpg index b876b7a82cb..eeb699c3469 100644 Binary files a/TAO/CIAO/docs/imgs/ciao-static-vs-dynamic.jpg and b/TAO/CIAO/docs/imgs/ciao-static-vs-dynamic.jpg differ diff --git a/TAO/CIAO/docs/imgs/ciao-static1.jpg b/TAO/CIAO/docs/imgs/ciao-static1.jpg index 313084ff34d..de49dd66015 100644 Binary files a/TAO/CIAO/docs/imgs/ciao-static1.jpg and b/TAO/CIAO/docs/imgs/ciao-static1.jpg differ diff --git a/TAO/CIAO/docs/imgs/ciao-static2.jpg b/TAO/CIAO/docs/imgs/ciao-static2.jpg index 86ded87f448..6fd6e60b503 100644 Binary files a/TAO/CIAO/docs/imgs/ciao-static2.jpg and b/TAO/CIAO/docs/imgs/ciao-static2.jpg differ diff --git a/TAO/CIAO/docs/imgs/component-basic.png b/TAO/CIAO/docs/imgs/component-basic.png index 520dc9c4cca..ee5aed4951d 100644 Binary files a/TAO/CIAO/docs/imgs/component-basic.png and b/TAO/CIAO/docs/imgs/component-basic.png differ diff --git a/TAO/CIAO/docs/imgs/dance_arch.jpg b/TAO/CIAO/docs/imgs/dance_arch.jpg index 95f139c7e6e..2bb391f7b92 100644 Binary files a/TAO/CIAO/docs/imgs/dance_arch.jpg and b/TAO/CIAO/docs/imgs/dance_arch.jpg differ diff --git a/TAO/CIAO/docs/imgs/dance_arch.vsd b/TAO/CIAO/docs/imgs/dance_arch.vsd index cfe75fca9c6..d8813a7afdf 100644 Binary files a/TAO/CIAO/docs/imgs/dance_arch.vsd and b/TAO/CIAO/docs/imgs/dance_arch.vsd differ diff --git a/TAO/CIAO/docs/imgs/deployment.png b/TAO/CIAO/docs/imgs/deployment.png index 4cd8c6be646..f7759729b8b 100644 Binary files a/TAO/CIAO/docs/imgs/deployment.png and b/TAO/CIAO/docs/imgs/deployment.png differ diff --git a/TAO/CIAO/docs/imgs/extended-container.png b/TAO/CIAO/docs/imgs/extended-container.png index 39977e6eb83..5ff96da018e 100644 Binary files a/TAO/CIAO/docs/imgs/extended-container.png and b/TAO/CIAO/docs/imgs/extended-container.png differ diff --git a/TAO/CIAO/docs/imgs/home-config.png b/TAO/CIAO/docs/imgs/home-config.png index aebf5e62751..69144945bae 100644 Binary files a/TAO/CIAO/docs/imgs/home-config.png and b/TAO/CIAO/docs/imgs/home-config.png differ diff --git a/TAO/CIAO/docs/imgs/static_dance_arch.jpg b/TAO/CIAO/docs/imgs/static_dance_arch.jpg index 3a4b579c3d5..7811cc27f6b 100644 Binary files a/TAO/CIAO/docs/imgs/static_dance_arch.jpg and b/TAO/CIAO/docs/imgs/static_dance_arch.jpg differ diff --git a/TAO/CIAO/docs/imgs/static_dance_arch.vsd b/TAO/CIAO/docs/imgs/static_dance_arch.vsd index 1ca1f50f69d..bc7a826c668 100644 Binary files a/TAO/CIAO/docs/imgs/static_dance_arch.vsd and b/TAO/CIAO/docs/imgs/static_dance_arch.vsd differ diff --git a/TAO/CIAO/docs/imgs/static_dance_impl.jpg b/TAO/CIAO/docs/imgs/static_dance_impl.jpg index 1040e65c1db..51923fe5152 100644 Binary files a/TAO/CIAO/docs/imgs/static_dance_impl.jpg and b/TAO/CIAO/docs/imgs/static_dance_impl.jpg differ diff --git a/TAO/CIAO/docs/imgs/static_dance_impl.vsd b/TAO/CIAO/docs/imgs/static_dance_impl.vsd index 6c21e6139d4..1971a11292b 100644 Binary files a/TAO/CIAO/docs/imgs/static_dance_impl.vsd and b/TAO/CIAO/docs/imgs/static_dance_impl.vsd differ diff --git a/TAO/CIAO/docs/index.html b/TAO/CIAO/docs/index.html index fcfc8cd2060..2c6a17379a0 100644 --- a/TAO/CIAO/docs/index.html +++ b/TAO/CIAO/docs/index.html @@ -34,7 +34,7 @@ notes.)