diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-02-11 14:59:08 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-02-11 14:59:08 +0000 |
commit | 1d548515ebcc0fecee1bc83c1a46505f07757170 (patch) | |
tree | 94c4f1e2792532189cf0f536ab4c3d4ea608f21c | |
parent | 500fdb3bc07404d9b62f72a84d69f510108168df (diff) | |
download | ATCD-1d548515ebcc0fecee1bc83c1a46505f07757170.tar.gz |
ChangeLogTag: Wed Feb 11 14:46:15 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
1210 files changed, 62836 insertions, 45895 deletions
diff --git a/CIAO/CCF/CCF/IDL2/Parser.hpp b/CIAO/CCF/CCF/IDL2/Parser.hpp index 0935eb41f86..6cd00814754 100644 --- a/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -34,7 +34,6 @@ #undef interface #endif - namespace CCF { namespace IDL2 diff --git a/CIAO/CCF/Documentation/Build.html b/CIAO/CCF/Documentation/Build.html index 94415303afe..227dc2358f0 100644 --- a/CIAO/CCF/Documentation/Build.html +++ b/CIAO/CCF/Documentation/Build.html @@ -196,7 +196,9 @@ section.</p> <a href="http://www.boost.org/more/getting_started.html">Boost Building Instructions</a>. Please remember the install locations of the boost libraries because they will be needed to properly configure your environment for building -CCF.<p> +CCF. +bjam --build-dir="c:\temp\boost2" --toolset=msvc-8.0 link=static/variant=debug/runtime-link=static --with-regex<p> + <!--p>After you have successfully compiled necessary libraries in the boost distribution you need to do one more thing. Inside the boost distribution diff --git a/CIAO/CIAO-INSTALL.html b/CIAO/CIAO-INSTALL.html index 680b36d0f9c..5b0dfe95939 100644 --- a/CIAO/CIAO-INSTALL.html +++ b/CIAO/CIAO-INSTALL.html @@ -114,7 +114,7 @@ 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. + Boost is pretty straightforward. Another option is to use the intsaller from <a href="http://www.boostpro.com/products/free">BoostPro Computing</a>. Install the latest boost version and select the Multi Threaded Static version, also make sure you select FileSystem <li> Set the following environment variables: <ul> diff --git a/CIAO/CIAO_TAO.mwc b/CIAO/CIAO_TAO.mwc index 76b40c9019e..a6c45e7fa80 100644 --- a/CIAO/CIAO_TAO.mwc +++ b/CIAO/CIAO_TAO.mwc @@ -10,6 +10,7 @@ workspace { $(ACE_ROOT)/contrib $(TAO_ROOT)/tao $(TAO_ROOT)/TAO_IDL + $(TAO_ROOT)/utils $(TAO_ROOT)/orbsvcs/orbsvcs/CosEvent.mpc $(TAO_ROOT)/orbsvcs/orbsvcs/CosNaming.mpc $(TAO_ROOT)/orbsvcs/orbsvcs/CosNaming_Serv.mpc diff --git a/CIAO/CIAO_TAO_DAnCE.mwc b/CIAO/CIAO_TAO_DAnCE.mwc index 8646df221f5..4bf32ec038c 100644 --- a/CIAO/CIAO_TAO_DAnCE.mwc +++ b/CIAO/CIAO_TAO_DAnCE.mwc @@ -18,12 +18,13 @@ workspace { $(TAO_ROOT)/orbsvcs/orbsvcs/RTEvent.mpc $(TAO_ROOT)/orbsvcs/orbsvcs/RTEvent_Serv.mpc $(TAO_ROOT)/orbsvcs/orbsvcs/RTEvent_Skel.mpc + ccm CIDLC/CIDLC.mwc ciao ciaosvcs DAnCE tools/Config_Handlers - + tools/XML exclude { DAnCE/tests } diff --git a/CIAO/CIDLC/ExecImplHeaderGenerator.cpp b/CIAO/CIDLC/ExecImplHeaderGenerator.cpp index 11c92e48f09..cf303972972 100644 --- a/CIAO/CIDLC/ExecImplHeaderGenerator.cpp +++ b/CIAO/CIDLC/ExecImplHeaderGenerator.cpp @@ -306,9 +306,7 @@ namespace << "set_session_context (" << endl << STRS[COMP_SC] << "_ptr ctx);" << endl; - os << "virtual void ciao_preactivate ();" << endl; - - os << "virtual void ciao_postactivate ();" << endl; + os << "virtual void configuration_complete ();" << endl; os << "virtual void ccm_activate ();" << endl; @@ -324,6 +322,21 @@ namespace << t.scoped_name ().scope_name () << "::CCM_" << t.name () << "_Context_var context_;" << endl << "};"; + + string name; + + // We need to escape C++ keywords before flattening the name. + // + { + std::ostringstream ostr; + ostr.pword (name_printer_index) = os.pword (name_printer_index); + ostr << t.scoped_name (); + name = regex::perl_s (ostr.str (), "/::/_/"); + } + + os << "extern \"C\" " << ctx.export_macro () + << " ::Components::EnterpriseComponent_ptr" << endl + << "create" << name << "_Impl (void);" << endl; } private: diff --git a/CIAO/CIDLC/ExecImplSourceGenerator.cpp b/CIAO/CIDLC/ExecImplSourceGenerator.cpp index 99babcb6d99..0e68c342313 100644 --- a/CIAO/CIDLC/ExecImplSourceGenerator.cpp +++ b/CIAO/CIDLC/ExecImplSourceGenerator.cpp @@ -440,13 +440,7 @@ namespace << "}"; os << "void" << endl - << t.name () << "_exec_i::ciao_preactivate ()" << endl - << "{" - << STRS[YCH] - << "}"; - - os << "void" << endl - << t.name () << "_exec_i::ciao_postactivate ()" << endl + << t.name () << "_exec_i::configuration_complete ()" << endl << "{" << STRS[YCH] << "}"; @@ -471,8 +465,28 @@ namespace } virtual void - post (Type&) + post (Type &t) { + string name; + { + std::ostringstream ostr; + ostr.pword (name_printer_index) = os.pword (name_printer_index); + ostr << t.scoped_name (); + name = regex::perl_s (ostr.str (), "/::/_/"); + } + + os << "extern \"C\" " << ctx.export_macro () + << " ::Components::EnterpriseComponent_ptr" << endl + << "create" << name << "_Impl (void)" << endl + << "{" + << "::Components::EnterpriseComponent_ptr retval =" << endl + << " ::Components::EnterpriseComponent::_nil ();" << endl + << "ACE_NEW_RETURN (" << endl + << "retval," << endl + << t.name () << "_exec_i," << endl + << "::Components::EnterpriseComponent::_nil ());" << endl + << "return retval;" + << "}"; } }; diff --git a/CIAO/CIDLC/ExecutorMappingGenerator.cpp b/CIAO/CIDLC/ExecutorMappingGenerator.cpp index 369fbbaac02..e5aa0a8b445 100644 --- a/CIAO/CIDLC/ExecutorMappingGenerator.cpp +++ b/CIAO/CIDLC/ExecutorMappingGenerator.cpp @@ -1928,7 +1928,7 @@ generate (CommandLine const& cl, } { - os << "#include \"ciao/CCM_Container.idl\"" << endl; + os << "#include \"ccm/CCM_Container.idl\"" << endl; if (cl.get_value ("lem-force-all", false) && !file_name.empty ()) { @@ -1940,7 +1940,7 @@ generate (CommandLine const& cl, if (swapping) { - os << "#include <CIAO_UpgradeableContext.idl>" << endl; + os << "#include <ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl>" << endl; } Traversal::TranslationUnit unit; diff --git a/CIAO/CIDLC/Literals.cpp b/CIAO/CIDLC/Literals.cpp index e160a8348a5..a7c723d06fd 100644 --- a/CIAO/CIDLC/Literals.cpp +++ b/CIAO/CIDLC/Literals.cpp @@ -3,14 +3,15 @@ // cvs-id : $Id$ #include "Literals.hpp" +#include "ciao/Version.h" namespace StringLiterals { char const* const COPYRIGHT = "// $I" "d$\n" "//\n" - "// **** Code generated by the ****\n" - "// **** Component Integrated ACE ORB (CIAO) CIDL Compiler ****\n" + "// **** Code generated by the ****\n" + "// **** Component Integrated ACE ORB (CIAO) CIDL Compiler v" CIAO_VERSION " ****\n" "// CIAO has been developed by:\n" "// Center for Distributed Object Computing\n" "// Washington University\n" diff --git a/CIAO/CIDLC/ServantHeaderGenerator.cpp b/CIAO/CIDLC/ServantHeaderGenerator.cpp index 4ffdc64b4a9..127463aeb33 100644 --- a/CIAO/CIDLC/ServantHeaderGenerator.cpp +++ b/CIAO/CIDLC/ServantHeaderGenerator.cpp @@ -441,7 +441,7 @@ namespace os << t.name () << "_Context (" << endl << "::Components::CCMHome_ptr h," << endl - << "::CIAO::Session_Container *c," << endl + << "::CIAO::Container_ptr c," << endl << t.name () << "_Servant *sv);" << endl; os << "virtual ~" << t.name () << "_Context (void);" @@ -887,7 +887,7 @@ namespace << "::Components::CCMHome_ptr h," << endl << "const char *ins_name," << endl << "::CIAO::Home_Servant_Impl_Base *hs," << endl - << "::CIAO::Session_Container *c);" << endl; + << "::CIAO::Container_ptr c);" << endl; os << "virtual ~" << t.name () << "_Servant (void);" << endl; @@ -1082,10 +1082,28 @@ namespace } virtual void - post (Type&) + post (Type &t) { // Component servant class closer. os << "};"; + + std::string name; + + // We need to escape C++ keywords before flattening the name. + // + { + std::ostringstream ostr; + ostr.pword (name_printer_index) = os.pword (name_printer_index); + ostr << t.scoped_name (); + name = regex::perl_s (ostr.str (), "/::/_/"); + } + + os << "extern \"C\" " << ctx.export_macro () + << " ::PortableServer::Servant" << endl + << "create" << name << "_Servant (" << endl + << "::Components::EnterpriseComponent_ptr p," << endl + << "CIAO::Container_ptr c," << endl + << "const char *ins_name);" << endl; } }; @@ -1132,7 +1150,7 @@ namespace << t.scoped_name ().scope_name () << "::CCM_" << t.name () << "_ptr exe," << endl << "const char *ins_name," << endl - << "::CIAO::Session_Container *c);" << endl; + << "::CIAO::Container_ptr c);" << endl; os << "virtual ~" << t.name () << "_Servant (void);" << endl; @@ -1342,7 +1360,7 @@ namespace << " ::PortableServer::Servant" << endl << "create" << name << "_Servant (" << endl << "::Components::HomeExecutorBase_ptr p," << endl - << "CIAO::Session_Container *c," << endl + << "CIAO::Container_ptr c," << endl << "const char *ins_name);" << endl; } @@ -1538,16 +1556,16 @@ ServantHeaderEmitter::pre (TranslationUnit&) string swap_option = cl_.get_value ("custom-container", ""); bool swapping = (swap_option == "upgradeable"); - os << "#include \"ciao/" - << (swapping ? "Swapping_Container.h" : "Session_Container.h") + os << "#include \"ciao/Containers/" + << (swapping ? "Swapping/Swapping_Container.h" : "Container_BaseC.h") << "\"" << endl - << "#include \"ciao/" - << (swapping ? "Upgradeable_Context_Impl_T.h" + << "#include \"ciao/Contexts/" + << (swapping ? "Swapping/Upgradeable_Context_Impl_T.h" : "Context_Impl_T.h") << "\"" << endl - << "#include \"ciao/Servant_Impl_T.h\"" << endl - << "#include \"ciao/" - << (swapping ? "Swapping_Servant_Home_Impl_T.h" + << "#include \"ciao/Servants/Servant_Impl_T.h\"" << endl + << "#include \"ciao/Servants/" + << (swapping ? "Swapping/Swapping_Servant_Home_Impl_T.h" : "Home_Servant_Impl_T.h") << "\"" << endl << endl; } diff --git a/CIAO/CIDLC/ServantSourceGenerator.cpp b/CIAO/CIDLC/ServantSourceGenerator.cpp index b7f2bf0d32d..1fc6aee6ecb 100644 --- a/CIAO/CIDLC/ServantSourceGenerator.cpp +++ b/CIAO/CIDLC/ServantSourceGenerator.cpp @@ -861,7 +861,7 @@ namespace os << "if (! result.second)" << endl << "{" << "ACE_ERROR_RETURN ((LM_ERROR," << endl - << "\"subscribe on %s failed\\n\"," << endl + << "\"subscribe on %C failed\\n\"," << endl << "\"" << p.name () << "\")," << endl << "0);" << "}"; @@ -911,7 +911,7 @@ namespace os << "if (! result.second)" << endl << "{" << "ACE_ERROR_RETURN ((LM_ERROR," << endl - << "\"generic subscribe on %s failed\\n\"," << endl + << "\"generic subscribe on %C failed\\n\"," << endl << "\"" << p.name () << "\")," << endl << "0);" << "}"; @@ -1176,7 +1176,7 @@ namespace os << t.name () << "_Context::" << t.name () << "_Context (" << endl << "::Components::CCMHome_ptr h," << endl - << "::CIAO::Session_Container *c," << endl + << "::CIAO::Container_ptr c," << endl << t.name () << "_Servant *sv)" << endl << " : ::CIAO::Context_Impl_Base (h, c), " << endl << " ::CIAO::Context_Impl<" << endl @@ -1497,14 +1497,14 @@ namespace << u.name ().unescaped_str () << "\");" << "receptacle_name += '_';" << "receptacle_name += this->context_->_ciao_instance_id ();" - << "::CORBA::PolicyList policy_list =" << endl + << "::CORBA::PolicyList_var policy_list =" << endl << " this->container_->get_receptacle_policy (" << "receptacle_name.c_str ());" << endl; - os << "if (policy_list.length () != 0)" << endl + os << "if (policy_list->length () != 0)" << endl << "{" << "::CORBA::Object_var over_ridden_object =" << endl - << " _ciao_conn->_set_policy_overrides (policy_list," << endl + << " _ciao_conn->_set_policy_overrides (policy_list.in ()," << endl << "CORBA::SET_OVERRIDE);" << "_ciao_conn =" << endl << " "; @@ -1951,15 +1951,16 @@ namespace << "tmp," << endl << "MACRO_MADNESS_TYPEDEF (obj_id.c_str ()," << endl << "\"" << p.name ().unescaped_str () << "\"," << endl - << "::CIAO::Port_Activator::Facet," << endl + << "::CIAO::Port_Activator_Types::FACET," << endl << "0," << endl << "this->context_," << endl << "this)," << endl - << "::CORBA::NO_MEMORY ());" << endl; + << "::CORBA::NO_MEMORY ());" << endl + << "::CIAO::Port_Activator_var pa = tmp;" << endl; - os << "::CIAO::Servant_Activator *sa = " << endl + os << "::CIAO::Servant_Activator_var sa = " << endl << "this->container_->ports_servant_activator ();" << endl - << "if (!sa->register_port_activator (tmp))" << endl + << "if (!sa->register_port_activator (pa._retn ()))" << endl << "{" << "return "; @@ -1976,7 +1977,7 @@ namespace Traversal::ProviderData::belongs (p, repo_id_belongs_); os << "," << endl - << " ::CIAO::Container::Facet_Consumer);" << endl + << " ::CIAO::Container_Types::FACET_CONSUMER_t);" << endl << "this->add_facet (\"" << p.name ().unescaped_str () << "\"," << endl << "obj.in ());" << endl; @@ -2155,12 +2156,9 @@ namespace << "if (event_repo_id == 0)" << endl << "{" << "throw ::CORBA::BAD_PARAM ();" << endl - << "}" - << scope_.name () << "_Context *ctx =" << endl - << " " << scope_.name () - << "_Context::_narrow (this->ctx_.in ());" << endl; + << "}" << endl; - os << "CORBA::ORB_ptr orb = ctx->_ciao_the_Container ()->the_ORB ();" + os << "CORBA::ORB_ptr orb = TAO_ORB_Core_instance ()->orb ();" << endl; os << "CORBA::ValueFactory f =" << endl @@ -2261,13 +2259,14 @@ namespace os << "ACE_NEW_THROW_EX (tmp," << endl << "MACRO_MADNESS_TYPEDEF (obj_id.c_str ()," << endl << "\"" << c.name ().unescaped_str () << "\"," << endl - << "::CIAO::Port_Activator::Sink," << endl + << "::CIAO::Port_Activator_Types::SINK," << endl << "this->executor_.in ()," << endl << "this->context_," << endl << "this)," << endl - << "::CORBA::NO_MEMORY ());" << endl; + << "::CORBA::NO_MEMORY ());" << endl + << "::CIAO::Port_Activator_var pa = tmp;" << endl; - os << "::CIAO::Servant_Activator *sa =" << endl + os << "::CIAO::Servant_Activator_var sa =" << endl << " this->container_->ports_servant_activator ();" << endl << "if (!sa->register_port_activator (tmp))" << endl << "{" @@ -2286,7 +2285,7 @@ namespace Traversal::ConsumerData::belongs (c, repo_id_belongs_); os << "," << endl - << " ::CIAO::Container::Facet_Consumer);" << endl; + << " ::CIAO::Container_Types::FACET_CONSUMER_t);" << endl; os << "::Components::EventConsumerBase_var ecb =" << endl << " ::Components::EventConsumerBase::_narrow (obj.in ());" @@ -2411,7 +2410,7 @@ namespace if (r->gen_factory ()) { - os << "CIAO_REGISTER_OBV_FACTORY (" << endl; + os << "TAO_OBV_REGISTER_FACTORY (" << endl; r->TraversalType::belongs (st, blongs); @@ -2819,7 +2818,7 @@ namespace << "::Components::CCMHome_ptr h," << endl << "const char *ins_name," << endl << "::CIAO::Home_Servant_Impl_Base *hs," << endl - << "::CIAO::Session_Container *c)" << endl + << "::CIAO::Container_ptr c)" << endl << " : ::CIAO::Servant_Impl_Base " << "(h, hs, c)," << endl << " ::CIAO::Servant_Impl<" << endl @@ -3536,6 +3535,45 @@ namespace os << "}"; } + + virtual void + post (Type& t) + { + // We need to escape C++ keywords before flattening the name. + // + string name; + { + std::ostringstream ostr; + ostr.pword (name_printer_index) = os.pword (name_printer_index); + ostr << t.scoped_name (); + name = regex::perl_s (ostr.str (), "/::/_/"); + } + + os << "extern \"C\" " << ctx.export_macro () + << " ::PortableServer::Servant" + << endl + << "create" << name << "_Servant (" << endl + << "::Components::EnterpriseComponent_ptr p," << endl + << "::CIAO::Container_ptr c," << endl + << "const char *ins_name)" << endl + << "{" + << t.scoped_name ().scope_name () << "::CCM_" + << t.name () << "_var x =" << endl + << t.scoped_name ().scope_name () << "::CCM_" << t.name () + << "::_narrow (p);" << endl + << "if (::CORBA::is_nil (x.in ()))" << endl + << "{" + << "return 0;" << endl + << "}" + << "::PortableServer::Servant retval = 0;" + << "ACE_NEW_RETURN(retval, " << endl + << t.name () << "_Servant (x.in ()," << endl + << "::Components::CCMHome::_nil ()," << endl + << "ins_name, 0, c)," << endl + << "0);" << endl + << "return retval;" << endl + << "}"; + } }; struct HomeEmitter : Traversal::Home, EmitterBase @@ -3820,7 +3858,7 @@ namespace << t.scoped_name ().scope_name () << "::CCM_" << t.name () << "_ptr exe," << endl << "const char *ins_name," << endl - << "::CIAO::Session_Container *c)" << endl + << "::CIAO::Container_ptr c)" << endl << " : ::CIAO::Home_Servant_Impl_Base (c)," << endl << " ::CIAO::"; @@ -4053,7 +4091,7 @@ namespace << endl << "create" << name << "_Servant (" << endl << "::Components::HomeExecutorBase_ptr p," << endl - << "::CIAO::Session_Container *c," << endl + << "::CIAO::Container_ptr c," << endl << "const char *ins_name)" << endl << "{" << t.scoped_name ().scope_name () << "::CCM_" @@ -4193,11 +4231,14 @@ ServantSourceEmitter::pre (TranslationUnit&) bool swapping = (swap_option == "upgradeable"); os << "#include \"" << file_name << "\"" << endl - << "#include \"ciao/Cookies.h\"" << endl - << "#include \"ciao/Servant_Activator.h\"" << endl - << (swapping ? "#include \"ciao/Dynamic_Component_Activator.h\"\n" : "") - << "#include \"ciao/Port_Activator_T.h\"" << endl + << "#include \"ciao/Valuetype_Factories/Cookies.h\"" << endl + << "#include \"ciao/Containers/CIAO_Servant_ActivatorC.h\"" << endl + << (swapping ? "#include \"ciao/Servants/Swapping/Dynamic_Component_Activator.h\"\n" : "") + << "#include \"ciao/Servants/Port_Activator_T.h\"" << endl + << "#include \"ciao/Servants/CIAO_Port_ActivatorC.h\"" << endl << "#include \"tao/SystemException.h\"" << endl + << "#include \"tao/Valuetype/ValueFactory.h\"" << endl + << "#include \"tao/ORB_Core.h\"" << endl << "#include \"ace/SString.h\"" << endl << endl; } diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 591522cff6e..d58726d87ef 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,4818 @@ +Wed Feb 11 14:46:15 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CCF: + * CCF/CCF/IDL2/Parser.hpp: + * CCF/Documentation/Build.html: + * CIAO-INSTALL.html: + * CIAO.mwc: + * CIAO_DAnCE.mwc: + * CIAO_TAO.mwc: + * CIAO_TAO_DAnCE.mwc: + * CIDLC: + * CIDLC/ExecImplHeaderGenerator.cpp: + * CIDLC/ExecImplSourceGenerator.cpp: + * CIDLC/ExecutorMappingGenerator.cpp: + * CIDLC/Literals.cpp: + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/ServantSourceGenerator.cpp: + * COPYING: + * ChangeLog: + * DAnCE/Deployment: + * DAnCE/Deployment.mwc: + * DAnCE/Deployment/DAnCE_Core.mpc: + * DAnCE/Deployment/DAnCE_Loader.h: + * DAnCE/Deployment/DAnCE_Properties.idl: + * DAnCE/Deployment/Deployment.idl: + * DAnCE/Deployment/Deployment_Application.idl: + * DAnCE/Deployment/Deployment_ApplicationManager.idl: + * DAnCE/Deployment/Deployment_Base.idl: + * DAnCE/Deployment/Deployment_Connection.idl: + * DAnCE/Deployment/Deployment_Core.idl: + * DAnCE/Deployment/Deployment_Data.idl: + * DAnCE/Deployment/Deployment_DeploymentPlan.idl: + * DAnCE/Deployment/Deployment_DomainApplication.idl: + * DAnCE/Deployment/Deployment_DomainApplicationManager.idl: + * DAnCE/Deployment/Deployment_ExecutionManager.idl: + * DAnCE/Deployment/Deployment_NodeApplication.idl: + * DAnCE/Deployment/Deployment_NodeApplicationManager.idl: + * DAnCE/Deployment/Deployment_NodeManager.idl: + * DAnCE/Deployment/Deployment_Packaging_Data.idl: + * DAnCE/Deployment/Deployment_PlanError.idl: + * DAnCE/Deployment/Deployment_RepositoryManager.idl: + * DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl: + * DAnCE/Deployment/Deployment_TargetData.idl: + * DAnCE/Deployment/Deployment_TargetManager.idl: + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/Deployment/Deployment_stub_export.h: + * DAnCE/Deployment/Deployment_svnt_export.h: + * DAnCE/Deployment/Module_Main.h: + * DAnCE/DomainApplication: + * DAnCE/DomainApplication/DomainApplication.mpc: + * DAnCE/DomainApplication/Domain_Application_Export.h: + * DAnCE/DomainApplication/Domain_Application_Impl.h: + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager: + * DAnCE/DomainApplicationManager/DomainApplicationManager.mpc: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Export.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/DomainApplicationManager/Node_Locator.h: + * DAnCE/DomainApplicationManager/Node_Locator.cpp: + * DAnCE/ExecutionManager: + * DAnCE/ExecutionManager/DAnCE_ExecutionManager_Module_Export.h: + * DAnCE/ExecutionManager/ExecutionManager.mpc: + * DAnCE/ExecutionManager/ExecutionManager_Export.h: + * DAnCE/ExecutionManager/ExecutionManager_Impl.h: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/ExecutionManager/Execution_Manager_Exec.cpp: + * DAnCE/Interfaces: + * DAnCE/Interfaces/ExecutionManagerDaemon.idl: + * DAnCE/Interfaces/ExecutionManager_stub_export.h: + * DAnCE/Interfaces/Interfaces.mpc: + * DAnCE/Interfaces/NodeManagerDaemon.idl: + * DAnCE/Interfaces/NodeManager_stub_export.h: + * DAnCE/Interfaces/NodeManager_svnt_export.h: + * DAnCE/Interfaces/README: + * DAnCE/Logger: + * DAnCE/Logger/DAnCE_Logger_Export.h: + * DAnCE/Logger/File_Logger_Backend.h: + * DAnCE/Logger/File_Logger_Backend.cpp: + * DAnCE/Logger/Log_Macros.h: + * DAnCE/Logger/Logger.mpc: + * DAnCE/Logger/Logger_Service.h: + * DAnCE/Logger/Logger_Service.cpp: + * DAnCE/NodeApplication: + * DAnCE/NodeApplication/ComponentAttributesSetter.h: + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + * DAnCE/NodeApplication/ComponentInstallation_Impl.h: + * DAnCE/NodeApplication/ComponentInstallation_Impl.cpp: + * DAnCE/NodeApplication/Name_Utilities.h: + * DAnCE/NodeApplication/Name_Utilities.cpp: + * DAnCE/NodeApplication/NodeApplication.mpc: + * DAnCE/NodeApplication/NodeApplication_Export.h: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplication/ServerActivator_Impl.h: + * DAnCE/NodeApplication/ServerActivator_Impl.cpp: + * DAnCE/NodeApplicationManager: + * DAnCE/NodeApplicationManager/NodeApplicationManager.mpc: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Export.h: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager: + * DAnCE/NodeManager/DAnCE_NodeManager_Module_Export.h: + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/NodeManager/NodeManager_Export.h: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Exec.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/NodeManager/README: + * DAnCE/Plan_Generator/Plan_Generator.mpc: + * DAnCE/Plan_Launcher: + * DAnCE/Plan_Launcher/Plan_Launcher.h: + * DAnCE/Plan_Launcher/Plan_Launcher.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher.mpc: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_Export.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module_Export.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Exec.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl_Export.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Module_Export.h: + * DAnCE/Plan_Launcher/launcher.cpp: + * DAnCE/RedirectionService: + * DAnCE/RedirectionService/CCMObjectLocator.h: + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + * DAnCE/RedirectionService/NameServiceRedirection.h: + * DAnCE/RedirectionService/NameServiceRedirection.cpp: + * DAnCE/RedirectionService/RedirectionService.h: + * DAnCE/RedirectionService/RedirectionService.cpp: + * DAnCE/RedirectionService/RedirectionService.mpc: + * DAnCE/RedirectionService/RedirectionService_Export.h: + * DAnCE/RepositoryManager/RepositoryManager.mpc: + * DAnCE/Starter: + * DAnCE/Starter/DAnCELoggerFactory.h: + * DAnCE/Starter/Starter.h: + * DAnCE/Starter/Starter.cpp: + * DAnCE/Starter/Starter.mpc: + * DAnCE/StaticConfigurator/StaticDAnCEParser.mpc: + * DAnCE/TargetManager/TM_Client.mpc: + * DAnCE/TargetManager/TargetManager.mpc: + * DAnCE/Utils: + * DAnCE/Utils/DAnCE_Utils.mpc: + * DAnCE/Utils/DAnCE_Utils_Export.h: + * DAnCE/Utils/Plan_Handler.h: + * DAnCE/Utils/Plan_Handler.cpp: + * DAnCE/bin: + * DAnCE/bin/.empty: + * DAnCE/bin/PythonDAnCE: + * DAnCE/bin/PythonDAnCE/__init__.py: + * DAnCE/bin/PythonDAnCE/generator: + * DAnCE/bin/PythonDAnCE/generator/__init__.py: + * DAnCE/bin/PythonDAnCE/generator/_path.py: + * DAnCE/bin/PythonDAnCE/generator/artifact.py: + * DAnCE/bin/PythonDAnCE/generator/comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/comp_inst.py: + * DAnCE/bin/PythonDAnCE/generator/footer.py: + * DAnCE/bin/PythonDAnCE/generator/header.py: + * DAnCE/bin/PythonDAnCE/generator/home_impl.py: + * DAnCE/bin/PythonDAnCE/generator/home_inst.py: + * DAnCE/bin/PythonDAnCE/generator/homed_comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/homed_comp_inst.py: + * DAnCE/bin/PythonDAnCE/generator/templet.py: + * DAnCE/bin/generate_plan.py: + * DAnCE/lib: + * DAnCE/lib/.empty: + * DAnCE/tests: + * DAnCE/tests/CIAO: + * DAnCE/tests/CIAO/Components: + * DAnCE/tests/CIAO/Components/SimpleAttribute.cidl: + * DAnCE/tests/CIAO/Components/SimpleAttribute.idl: + * DAnCE/tests/CIAO/Components/SimpleAttribute.mpc: + * DAnCE/tests/CIAO/Components/SimpleAttribute_exec.h: + * DAnCE/tests/CIAO/Components/SimpleAttribute_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleAttribute_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleAttribute_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleAttribute_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleCommon.idl: + * DAnCE/tests/CIAO/Components/SimpleCommon.mpc: + * DAnCE/tests/CIAO/Components/SimpleCommon_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleCommon_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer.cidl: + * DAnCE/tests/CIAO/Components/SimpleConsumer.idl: + * DAnCE/tests/CIAO/Components/SimpleConsumer.mpc: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter.cidl: + * DAnCE/tests/CIAO/Components/SimpleEmitter.idl: + * DAnCE/tests/CIAO/Components/SimpleEmitter.mpc: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.cidl: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.idl: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.mpc: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleNull.cidl: + * DAnCE/tests/CIAO/Components/SimpleNull.idl: + * DAnCE/tests/CIAO/Components/SimpleNull.mpc: + * DAnCE/tests/CIAO/Components/SimpleNull_exec.h: + * DAnCE/tests/CIAO/Components/SimpleNull_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleNull_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleNull_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleNull_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider.cidl: + * DAnCE/tests/CIAO/Components/SimpleProvider.idl: + * DAnCE/tests/CIAO/Components/SimpleProvider.mpc: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher.cidl: + * DAnCE/tests/CIAO/Components/SimplePublisher.idl: + * DAnCE/tests/CIAO/Components/SimplePublisher.mpc: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec.cpp: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_stub_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser.cidl: + * DAnCE/tests/CIAO/Components/SimpleUser.idl: + * DAnCE/tests/CIAO/Components/SimpleUser.mpc: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.h: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleUser_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser_svnt_export.h: + * DAnCE/tests/CIAO/ExecutionManager-Deployments: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments: + * DAnCE/tests/CIAO/NodeManager-Deployments/EmitsConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/MultiplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/PublishConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleAttributeExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentUnhomed.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/nm_launcher.mpc: + * DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl: + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + * DAnCE/tests/DeploymentPlanDump: + * DAnCE/tests/DeploymentPlanDump/CcmDance2-host1.cdp: + * DAnCE/tests/DeploymentPlanDump/CcmDance2-host2.cdp: + * DAnCE/tests/DeploymentPlanDump/CcmDance2.cdp: + * DAnCE/tests/DeploymentPlanDump/CcmDance4-host1.cdp: + * DAnCE/tests/DeploymentPlanDump/CcmDance4-host2.cdp: + * DAnCE/tests/DeploymentPlanDump/DeploymentPlanDump.mpc: + * DAnCE/tests/DeploymentPlanDump/NewCcmDance1.cdp: + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/DeploymentPlanTestReferences: + * DAnCE/tests/DeploymentPlanTestReferences/DeploymentPlanTestReferences.mpc: + * DAnCE/tests/DeploymentPlanTestReferences/test.cpp: + * DAnCE/tests/DeploymentTest1: + * DAnCE/tests/DeploymentTest1/DeploymentTest1.mpc: + * DAnCE/tests/DeploymentTest1/test.cpp: + * DAnCE/tests/MocksTest: + * DAnCE/tests/MocksTest/MockObjectHome.h: + * DAnCE/tests/MocksTest/MockObjectHome.cpp: + * DAnCE/tests/MocksTest/MockTest.cdp: + * DAnCE/tests/MocksTest/MockTest.mpc: + * DAnCE/tests/MocksTest/MocksTest.cpp: + * DAnCE/tests/MocksTest/MocksTest_Export.h: + * DAnCE/tests/MocksTest/plCommand.In: + * DAnCE/tests/MocksTest/run_test.pl: + * DAnCE/tests/NameServiceTest: + * DAnCE/tests/NameServiceTest/Dummy.idl: + * DAnCE/tests/NameServiceTest/DummyImpl.h: + * DAnCE/tests/NameServiceTest/DummyImpl.cpp: + * DAnCE/tests/NameServiceTest/NameServiceTest.mpc: + * DAnCE/tests/NameServiceTest/RegistrationPath.h: + * DAnCE/tests/NameServiceTest/clt_main.cpp: + * DAnCE/tests/NameServiceTest/run_test.pl: + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication: + * DAnCE/tests/NodeApplicationManager-NodeApplication/NodeApplicationManager-NodeApplication.mpc: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + * DAnCE/tests/NodeManager-NodeApplicationManager: + * DAnCE/tests/NodeManager-NodeApplicationManager/NodeManager-NodeApplicationManager.mpc: + * DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp: + * DAnCE/tests/ObjectLocatorTest: + * DAnCE/tests/ObjectLocatorTest/Dummy.idl: + * DAnCE/tests/ObjectLocatorTest/DummyImpl.h: + * DAnCE/tests/ObjectLocatorTest/DummyImpl.cpp: + * DAnCE/tests/ObjectLocatorTest/ObjectLocatorTest.mpc: + * DAnCE/tests/ObjectLocatorTest/RegistrationPath.h: + * DAnCE/tests/ObjectLocatorTest/clt_main.cpp: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest: + * DAnCE/tests/RedirectionServiceTest/Dummy.idl: + * DAnCE/tests/RedirectionServiceTest/DummyImpl.h: + * DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp: + * DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc: + * DAnCE/tests/RedirectionServiceTest/RegistrationPath.h: + * DAnCE/tests/RedirectionServiceTest/clt_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + * DAnCE/tests/scripts: + * DAnCE/tests/scripts/BasicSP: + * DAnCE/tests/scripts/BasicSP/basicNodeDaemon.pl: + * DAnCE/tests/scripts/BasicSP/basicsp.dat: + * MPC: + * MPC/config/ccm.mpb: + * MPC/config/ccm_componentserver_stub.mpb: + * MPC/config/ccm_componentserver_svnt.mpb: + * MPC/config/ccm_configvalue.mpb: + * MPC/config/ccm_cookie.mpb: + * MPC/config/ccm_executor.mpb: + * MPC/config/ccm_stub.mpb: + * MPC/config/ccm_svnt.mpb: + * MPC/config/ciao.mpb: + * MPC/config/ciao_client.mpb: + * MPC/config/ciao_client_dnc.mpb: + * MPC/config/ciao_componentserver_configurator.mpb: + * MPC/config/ciao_componentserver_stub.mpb: + * MPC/config/ciao_componentserver_svnt.mpb: + * MPC/config/ciao_config_handlers.mpb: + * MPC/config/ciao_config_handlers_base.mpb: + * MPC/config/ciao_config_manager.mpb: + * MPC/config/ciao_container_base.mpb: + * MPC/config/ciao_context_impl.mpb: + * MPC/config/ciao_cs_client.mpb: + * MPC/config/ciao_domainapplicationmanager_dnc.mpb: + * MPC/config/ciao_events_base_dnc.mpb: + * MPC/config/ciao_events_dnc.mpb: + * MPC/config/ciao_exe.mpb: + * MPC/config/ciao_executionmanager_stub.mpb: + * MPC/config/ciao_executor.mpb: + * MPC/config/ciao_lib.mpb: + * MPC/config/ciao_logger.mpb: + * MPC/config/ciao_nodeapplication.mpb: + * MPC/config/ciao_nodemanager_stub.mpb: + * MPC/config/ciao_noop_configurator.mpb: + * MPC/config/ciao_port_activator_stub.mpb: + * MPC/config/ciao_servant.mpb: + * MPC/config/ciao_servant_activator.mpb: + * MPC/config/ciao_servant_dnc.mpb: + * MPC/config/ciao_server.mpb: + * MPC/config/ciao_session_container.mpb: + * MPC/config/ciao_targetmanager_stub.mpb: + * MPC/config/ciao_targetmanager_svnt.mpb: + * MPC/config/ciao_vcwarnings.mpb: + * MPC/config/ciaocidldefaults.mpb: + * MPC/config/cidlc.mpb: + * MPC/config/dance.mpb: + * MPC/config/dance_cdmw_idl.mpb: + * MPC/config/dance_component_server.mpb: + * MPC/config/dance_component_server_svnt.mpb: + * MPC/config/dance_deployment_stub.mpb: + * MPC/config/dance_deployment_svnt.mpb: + * MPC/config/dance_domain_application.mpb: + * MPC/config/dance_domain_application_manager.mpb: + * MPC/config/dance_exe.mpb: + * MPC/config/dance_executionmanager_stub.mpb: + * MPC/config/dance_extension_stub.mpb: + * MPC/config/dance_lib.mpb: + * MPC/config/dance_logger.mpb: + * MPC/config/dance_mocks.mpb: + * MPC/config/dance_node_application.mpb: + * MPC/config/dance_node_application_manager.mpb: + * MPC/config/dance_node_manager.mpb: + * MPC/config/dance_nodemanager_stub.mpb: + * MPC/config/dance_nodemanager_svnt.mpb: + * MPC/config/dance_redirection_service.mpb: + * MPC/config/dance_utils.mpb: + * NEWS: + * bin: + * bin/ciao_tests.lst: + * bin/generate_component_mpc.pl: + * ccm: + * ciao: + * ciao/CIAO.mpc: + * ciao/CIAO_FailureReasons.idl: + * ciao/CIAO_common.h: + * ciao/Client_init.h: + * ciao/Client_init.cpp: + * ciao/ComponentServer: + * ciao/ComponentServer/CIAO_CS_Client.idl: + * ciao/ComponentServer/CIAO_CS_Client_svnt_export.h: + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_ComponentServer_stub_export.h: + * ciao/ComponentServer/CIAO_ComponentServer_svnt_export.h: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_Properties.idl: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerResources.idl: + * ciao/ComponentServer/Configurator_Factory.h: + * ciao/ComponentServer/Configurator_Factory.cpp: + * ciao/ComponentServer/Configurators: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.inl: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp: + * ciao/ComponentServer/Configurators/Basic_Config_Manager_export.h: + * ciao/ComponentServer/Configurators/Basic_Configurator_export.h: + * ciao/ComponentServer/Configurators/ComponentServer_Configurator_export.h: + * ciao/ComponentServer/Configurators/Config_Manager.h: + * ciao/ComponentServer/Configurators/Config_Manager.cpp: + * ciao/ComponentServer/Configurators/Configurators.mpc: + * ciao/ComponentServer/Configurators/NA_Configurator_Export.h: + * ciao/ComponentServer/Configurators/NoOp: + * ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.h: + * ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.cpp: + * ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.mpc: + * ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator_export.h: + * ciao/ComponentServer/Configurators/RT: + * ciao/ComponentServer/Configurators/RT/RTConfig_Manager.h: + * ciao/ComponentServer/Configurators/RT/RTConfig_Manager.inl: + * ciao/ComponentServer/Configurators/RT/RTConfig_Manager.cpp: + * ciao/ComponentServer/Configurators/RT/RTNA_Configurator_Export.h: + * ciao/ComponentServer/Configurators/RTNodeApp_Configurator.h: + * ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + * ciao/Containers: + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/CIAO_Servant_Activator.mpc: + * ciao/Containers/CIAO_Servant_Activator_export.h: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Container_Base.inl: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Container_Base_export.h: + * ciao/Containers/Containers.mpc: + * ciao/Containers/Servant_Activator.h: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.idl: + * ciao/Containers/Session/Session_Container.inl: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Containers/Session/Session_Container.mpc: + * ciao/Containers/Session/Session_Container_export.h: + * ciao/Containers/Swapping: + * ciao/Containers/Swapping/Dynamic_Component_Activator.h: + * ciao/Containers/Swapping/Dynamic_Component_Activator.inl: + * ciao/Containers/Swapping/Dynamic_Component_Activator.cpp: + * ciao/Containers/Swapping/Swapping_Container.h: + * ciao/Containers/Swapping/Swapping_Container.inl: + * ciao/Containers/Swapping/Swapping_Container.cpp: + * ciao/Containers/Swapping/Swapping_Container.mpc: + * ciao/Containers/Swapping/Swapping_Container_export.h: + * ciao/Contexts: + * ciao/Contexts/Context.mpc: + * ciao/Contexts/Context_Impl_Base.h: + * ciao/Contexts/Context_Impl_Base.inl: + * ciao/Contexts/Context_Impl_Base.cpp: + * ciao/Contexts/Context_Impl_T.h: + * ciao/Contexts/Context_Impl_T.cpp: + * ciao/Contexts/Context_Impl_export.h: + * ciao/Contexts/Swapping: + * ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl: + * ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.h: + * ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.cpp: + * ciao/Logger: + * ciao/Logger/CIAOLoggerFactory.h: + * ciao/Logger/CIAO_Logger_Export.h: + * ciao/Logger/File_Logger_Backend.h: + * ciao/Logger/File_Logger_Backend.cpp: + * ciao/Logger/Log_Macros.h: + * ciao/Logger/Logger.mpc: + * ciao/Logger/Logger_Service.h: + * ciao/Logger/Logger_Service.cpp: + * ciao/Servants: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/CIAO_Port_Activator_export.h: + * ciao/Servants/CIAO_Servant_Impl_export.h: + * ciao/Servants/Home_Servant_Impl_Base.h: + * ciao/Servants/Home_Servant_Impl_Base.cpp: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Port_Activator.inl: + * ciao/Servants/Port_Activator.cpp: + * ciao/Servants/Port_Activator_T.h: + * ciao/Servants/Port_Activator_T.cpp: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.h: + * ciao/Servants/Servant_Impl_T.cpp: + * ciao/Servants/Servant_Impl_Utils_T.cpp: + * ciao/Servants/Servants.mpc: + * ciao/Servants/StandardConfigurator_Impl.h: + * ciao/Servants/StandardConfigurator_Impl.cpp: + * ciao/Servants/Swapping: + * ciao/Servants/Swapping/CIAO_SwapExec.idl: + * ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h: + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h: + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp: + * ciao/Servants/Swapping/Dynamic_Component_Servant_T.h: + * ciao/Servants/Swapping/Dynamic_Component_Servant_T.cpp: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.cpp: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.h: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.cpp: + * ciao/Servants/Swapping/Swapping_Servants.mpc: + * ciao/Server_init.h: + * ciao/Server_init.cpp: + * ciao/Valuetype_Factories: + * ciao/Valuetype_Factories/ConfigValue.h: + * ciao/Valuetype_Factories/ConfigValue.cpp: + * ciao/Valuetype_Factories/ConfigValue_Export.h: + * ciao/Valuetype_Factories/Cookie_Export.h: + * ciao/Valuetype_Factories/Cookies.h: + * ciao/Valuetype_Factories/Cookies.inl: + * ciao/Valuetype_Factories/Cookies.cpp: + * ciao/Valuetype_Factories/Factories.mpc: + * ciao/Version.h: + * docs: + * docs/CIAO_Style_Guide.txt: + * docs/TODO.html: + * docs/schema: + * docs/schema/Basic_Deployment_Data.xsd: + * docs/schema/CIAOEvents.xsd: + * docs/schema/CIAOServerResources.xsd: + * docs/schema/Deployment.xsd: + * docs/schema/Modified_Deployment.xsd: + * docs/schema/README.html: + * docs/schema/SANet_Network.xsd: + * docs/schema/ServerResourceUsage.txt: + * docs/schema/Spec_Defined_Deployment.xsd: + * docs/schema/Spec_Defined_XMI.xsd: + * docs/schema/Task_Map.xsd: + * docs/schema/XMI.xsd: + * docs/schema/ccd.xsd: + * docs/schema/cdd.xsd: + * docs/schema/cdp.xsd: + * docs/schema/ciaopolicy.xsd: + * docs/schema/cid.xsd: + * docs/schema/cpd.xsd: + * docs/schema/iad.xsd: + * docs/schema/pcd.xsd: + * docs/schema/toplevel.xsd: + * docs/schema/unused_elements.xsd: + * docs/schema/xsc-banner.h: + * docs/schema/xsc-banner.cpp: + * docs/tutorials/Quoter/Simple/01.html: + * docs/tutorials/Quoter/Simple/02.html: + * docs/tutorials/Quoter/Simple/03.html: + * docs/tutorials/Quoter/Simple/04.html: + * docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc: + * docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h: + * docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp: + * docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc: + * examples: + * examples/BasicSP/BMClosedED/BMClosedED.mpc: + * examples/BasicSP/BMClosedED/BMClosedED_exec.h: + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp: + * examples/BasicSP/BMDevice/BMDevice.mpc: + * examples/BasicSP/BMDevice/BMDevice_exec.h: + * examples/BasicSP/BMDevice/BMDevice_exec.cpp: + * examples/BasicSP/BMDisplay/BMDisplay.mpc: + * examples/BasicSP/BMDisplay/BMDisplay_exec.h: + * examples/BasicSP/BMDisplay/BMDisplay_exec.cpp: + * examples/BasicSP/BasicSP.mpc: + * examples/BasicSP/EC/EC.mpc: + * examples/BasicSP/EC/EC_exec.h: + * examples/BasicSP/EC/EC_exec.cpp: + * examples/BasicSP/EC/controller.cpp: + * examples/BasicSP/descriptors/BasicSP.dat: + * examples/BasicSP/descriptors/BasicSP_Homed.cdp: + * examples/BasicSP/descriptors/BasicSP_Unhomed.cdp: + * examples/BasicSP/descriptors/run_test.pl: + * examples/DevGuideExamples: + * examples/DevGuideExamples/CIAO.mwc: + * examples/DevGuideExamples/Messenger: + * examples/DevGuideExamples/Messenger/Administrator.cidl: + * examples/DevGuideExamples/Messenger/Administrator.idl: + * examples/DevGuideExamples/Messenger/Administrator.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client.cpp: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc: + * examples/DevGuideExamples/Messenger/Administrator_exec_export.h: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.h: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Administrator_stub_export.h: + * examples/DevGuideExamples/Messenger/Administrator_svnt_export.h: + * examples/DevGuideExamples/Messenger/History.idl: + * examples/DevGuideExamples/Messenger/History_exec_i.h: + * examples/DevGuideExamples/Messenger/History_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Message.idl: + * examples/DevGuideExamples/Messenger/Messenger.cidl: + * examples/DevGuideExamples/Messenger/Messenger.idl: + * examples/DevGuideExamples/Messenger/Messenger.mpc: + * examples/DevGuideExamples/Messenger/Messenger_exec_export.h: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.h: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Messenger_stub_export.h: + * examples/DevGuideExamples/Messenger/Messenger_svnt_export.h: + * examples/DevGuideExamples/Messenger/Publication.idl: + * examples/DevGuideExamples/Messenger/Publication_exec_i.h: + * examples/DevGuideExamples/Messenger/Publication_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Receiver.cidl: + * examples/DevGuideExamples/Messenger/Receiver.idl: + * examples/DevGuideExamples/Messenger/Receiver.mpc: + * examples/DevGuideExamples/Messenger/Receiver_exec_export.h: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.h: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Receiver_stub_export.h: + * examples/DevGuideExamples/Messenger/Receiver_svnt_export.h: + * examples/DevGuideExamples/Messenger/Runnable.idl: + * examples/DevGuideExamples/Messenger/Runnable_exec_i.h: + * examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp: + * examples/DevGuideExamples/Messenger/StaticDAnCE: + * examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc: + * examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt: + * examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp: + * examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h: + * examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl: + * examples/DevGuideExamples/Messenger/descriptors: + * examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd: + * examples/DevGuideExamples/Messenger/descriptors/Administrator.cid: + * examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd: + * examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad: + * examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad: + * examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad: + * examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp: + * examples/DevGuideExamples/Messenger/descriptors/Application.cdp: + * examples/DevGuideExamples/Messenger/descriptors/Application.pcd: + * examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat: + * examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd: + * examples/DevGuideExamples/Messenger/descriptors/Domain.cdd: + * examples/DevGuideExamples/Messenger/descriptors/Libraries.iad: + * examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd: + * examples/DevGuideExamples/Messenger/descriptors/Messenger.cid: + * examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd: + * examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd: + * examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid: + * examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd: + * examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad: + * examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad: + * examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad: + * examples/DevGuideExamples/Messenger/descriptors/README_15a: + * examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd: + * examples/DevGuideExamples/Messenger/descriptors/Receiver.cid: + * examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd: + * examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad: + * examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad: + * examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad: + * examples/DevGuideExamples/Messenger/descriptors/XMI.xsd: + * examples/DevGuideExamples/Messenger/descriptors/admin.dat: + * examples/DevGuideExamples/Messenger/descriptors/package.tpd: + * examples/DevGuideExamples/Messenger/descriptors/run_test.pl: + * examples/DevGuideExamples/readme.txt: + * examples/Display/Display_Base/Display_Base.mpc: + * examples/Display/GPS/GPS.mpc: + * examples/Display/GPS/GPS_exec.h: + * examples/Display/GPS/GPS_exec.cpp: + * examples/Display/GPS/GPS_tracing_exec.h: + * examples/Display/GPS/GPS_tracing_exec.cpp: + * examples/Display/NavDisplay/NavDisplay.mpc: + * examples/Display/NavDisplay/NavDisplay_exec.h: + * examples/Display/NavDisplay/NavDisplay_exec.cpp: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp: + * examples/Display/RateGen/RateGen.mpc: + * examples/Display/RateGen/RateGen_exec.h: + * examples/Display/RateGen/RateGen_exec.cpp: + * examples/Display/RateGen/controller.cpp: + * examples/Hello/Hello_Base/Hello_Base.mpc: + * examples/Hello/Receiver/Receiver.mpc: + * examples/Hello/Receiver/Receiver_exec.h: + * examples/Hello/Receiver/Receiver_exec.cpp: + * examples/Hello/Sender/Sender.mpc: + * examples/Hello/Sender/Sender_exec.h: + * examples/Hello/Sender/Sender_exec.cpp: + * examples/Hello/Sender/starter.cpp: + * examples/Hello/descriptors/DeploymentPlan.cdp: + * examples/Hello/descriptors/NodeManagerMap.dat: + * examples/Hello/descriptors/run_test.pl: + * examples/Null_Component/Null_Component.mpc: + * examples/Null_Component/Null_Component_exec.h: + * examples/Null_Component/Null_Component_exec.cpp: + * examples/Null_Component/Null_Interface.mpc: + * examples/Null_Component/StaticDAnCEApp.mpc: + * examples/Null_Component/descriptors/NodeMap.dat: + * examples/Null_Component/descriptors/Null_Homed.cdp: + * examples/Null_Component/descriptors/Null_Unhomed.cdp: + * examples/Null_Component/descriptors/run_test.pl: + * examples/Swapping/Hello_Base/Hello_Base.mpc: + * examples/Swapping/Receiver/Receiver.mpc: + * examples/Swapping/Receiver/Receiver_exec.h: + * examples/Swapping/Receiver/Receiver_exec.cpp: + * examples/Swapping/Sender/Sender.mpc: + * examples/Swapping/Sender/Sender_exec.h: + * examples/Swapping/Sender/Sender_exec.cpp: + * examples/Swapping/Sender/Sender_exec_1.h: + * examples/Swapping/Sender/Sender_exec_1.cpp: + * examples/Swapping/Sender/Sender_exec_2.h: + * examples/Swapping/Sender/Sender_exec_2.cpp: + * performance-tests: + * performance-tests/Benchmark/Benchmark.mpc: + * performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc: + * performance-tests/Benchmark/RoundTrip/RoundTrip.mpc: + * performance-tests/Benchmark/RoundTrip/RoundTripEI.idl: + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h: + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc: + * performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp: + * performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp: + * performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc: + * performance-tests/Protocols/Controller/Controller.mpc: + * performance-tests/Protocols/Receiver/Receiver.mpc: + * performance-tests/Protocols/Receiver/Receiver_exec.h: + * performance-tests/Protocols/Receiver/Receiver_exec.cpp: + * performance-tests/Protocols/Sender/Sender.mpc: + * performance-tests/Protocols/Sender/Sender_exec.h: + * performance-tests/Protocols/Sender/Sender_exec.cpp: + * performance-tests/Protocols/common/Protocols.mpc: + * rules.ciao.GNU: + * tests: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp: + * tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp: + * tests/Bug_2130_Regression/interfaces/ENW.mpc: + * tests/CIAO_ComponentServer: + * tests/CIAO_ComponentServer/Activator: + * tests/CIAO_ComponentServer/Activator/Activator.mpc: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/Activator/run_test.pl: + * tests/CIAO_ComponentServer/Basic: + * tests/CIAO_ComponentServer/Basic/Basic.mpc: + * tests/CIAO_ComponentServer/Basic/client.cpp: + * tests/CIAO_ComponentServer/Basic/run_test.pl: + * tests/CIAO_ComponentServer/SimpleComponent: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.cidl: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_stub_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_svnt_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/run_test.pl: + * tests/CIDL/CodeGen/Basic.mpc: + * tests/CIDL/CodeGen/CodeGen.mpc: + * tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc: + * tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc: + * tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc: + * tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc: + * tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc: + * tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc: + * tests/IDL3/Events/Abstract/Abstract.mpc: + * tests/IDL3/Events/Any/Any.mpc: + * tests/IDL3/Events/Regular/Regular.mpc: + * tests/IDL3/Homes/Attributes/HomeAttributes.mpc: + * tests/IDL3/Homes/Basic/Basic.mpc: + * tests/IDL3/Homes/Factory/Factory.mpc: + * tests/IDL3/Homes/Finder/Finder.mpc: + * tests/IDL3/Homes/Inheritance/Inheritance.mpc: + * tests/IDL3/ImpliedIDL/All/all.mpc: + * tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc: + * tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc: + * tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc: + * tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc: + * tests/IDL3/ImpliedIDL/Events/Events.mpc: + * tests/IDL3/ImpliedIDL/Homes/Homes.mpc: + * tests/IDL3/Lookup/lookup_test.mpc: + * tests/Minimum/Minimum_Base/Minimum_Base.mpc: + * tests/Minimum/Receiver/Receiver.mpc: + * tests/Minimum/Receiver/Receiver_exec.h: + * tests/Minimum/Receiver/Receiver_exec.cpp: + * tests/Minimum/Sender/Sender.mpc: + * tests/Minimum/Sender/Sender_exec.h: + * tests/Minimum/Sender/Sender_exec.cpp: + * tools: + * tools/Config_Handlers: + * tools/Config_Handlers/ADD_Handler.h: + * tools/Config_Handlers/ADD_Handler.cpp: + * tools/Config_Handlers/Any_Handler.h: + * tools/Config_Handlers/Any_Handler.cpp: + * tools/Config_Handlers/Basic_Deployment_Data.cpp: + * tools/Config_Handlers/Basic_Deployment_Data.hpp: + * tools/Config_Handlers/CCD_Handler.h: + * tools/Config_Handlers/CCD_Handler.cpp: + * tools/Config_Handlers/CEPE_Handler.h: + * tools/Config_Handlers/CEPE_Handler.cpp: + * tools/Config_Handlers/CIAO_Events: + * tools/Config_Handlers/CIAO_Events/CIAOEvents.cpp: + * tools/Config_Handlers/CIAO_Events/CIAOEvents.hpp: + * tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h: + * tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp: + * tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc: + * tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h: + * tools/Config_Handlers/CIAO_Events/test.cpp: + * tools/Config_Handlers/CPD_Handler.h: + * tools/Config_Handlers/CPD_Handler.cpp: + * tools/Config_Handlers/CRDD_Handler.h: + * tools/Config_Handlers/CRDD_Handler.cpp: + * tools/Config_Handlers/Common.h: + * tools/Config_Handlers/ComponentPropertyDescription_Handler.h: + * tools/Config_Handlers/ComponentPropertyDescription_Handler.cpp: + * tools/Config_Handlers/Config_Handlers.mpc: + * tools/Config_Handlers/Config_Handlers_Common_Export.h: + * tools/Config_Handlers/Config_Handlers_Export.h: + * tools/Config_Handlers/DD_Handler.h: + * tools/Config_Handlers/DD_Handler.cpp: + * tools/Config_Handlers/DP_Handler.h: + * tools/Config_Handlers/DP_Handler.cpp: + * tools/Config_Handlers/DP_PCD_Handler.h: + * tools/Config_Handlers/DP_PCD_Handler.cpp: + * tools/Config_Handlers/DataType_Handler.h: + * tools/Config_Handlers/DataType_Handler.cpp: + * tools/Config_Handlers/Deployment.cpp: + * tools/Config_Handlers/Deployment.hpp: + * tools/Config_Handlers/DnC_Dump.h: + * tools/Config_Handlers/DnC_Dump.cpp: + * tools/Config_Handlers/DnC_Dump_T.h: + * tools/Config_Handlers/DnC_Dump_T.cpp: + * tools/Config_Handlers/Dump_Obj.h: + * tools/Config_Handlers/Dump_Obj.cpp: + * tools/Config_Handlers/DynAny_Handler: + * tools/Config_Handlers/DynAny_Handler.mpc: + * tools/Config_Handlers/DynAny_Handler/DataType_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/DynAny_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DynAny_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h: + * tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.h: + * tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/dynany_test.idl: + * tools/Config_Handlers/DynAny_Handler/test.cpp: + * tools/Config_Handlers/DynAny_Handler/test.mpc: + * tools/Config_Handlers/ERE_Handler.h: + * tools/Config_Handlers/ERE_Handler.cpp: + * tools/Config_Handlers/ESD_Handler.h: + * tools/Config_Handlers/ESD_Handler.cpp: + * tools/Config_Handlers/IDD_Handler.h: + * tools/Config_Handlers/IDD_Handler.cpp: + * tools/Config_Handlers/IDREF_Base.h: + * tools/Config_Handlers/IDREF_Base.cpp: + * tools/Config_Handlers/ID_Handler.h: + * tools/Config_Handlers/ID_Handler.cpp: + * tools/Config_Handlers/IRDD_Handler.h: + * tools/Config_Handlers/IRDD_Handler.cpp: + * tools/Config_Handlers/MDD_Handler.h: + * tools/Config_Handlers/MDD_Handler.cpp: + * tools/Config_Handlers/PCD_Handler.h: + * tools/Config_Handlers/PCD_Handler.cpp: + * tools/Config_Handlers/PSPE_Handler.h: + * tools/Config_Handlers/PSPE_Handler.cpp: + * tools/Config_Handlers/Package_Handlers: + * tools/Config_Handlers/Package_Handlers/CAD_Handler.h: + * tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/CID_Handler.h: + * tools/Config_Handlers/Package_Handlers/CID_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/CPD_Handler.h: + * tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h: + * tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/IAD_Handler.h: + * tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/NIA_Handler.h: + * tools/Config_Handlers/Package_Handlers/PCD_Handler.h: + * tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/PC_Intf.h: + * tools/Config_Handlers/Package_Handlers/PC_Intf.cpp: + * tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc: + * tools/Config_Handlers/Package_Handlers/Packaging_Handlers_Export.h: + * tools/Config_Handlers/Package_Handlers/SID_Handler.h: + * tools/Config_Handlers/Package_Handlers/SID_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/test.cpp: + * tools/Config_Handlers/Property_Handler.h: + * tools/Config_Handlers/Property_Handler.cpp: + * tools/Config_Handlers/RDD_Handler.h: + * tools/Config_Handlers/RDD_Handler.cpp: + * tools/Config_Handlers/RT-CCM: + * tools/Config_Handlers/RT-CCM/CB_Handler.h: + * tools/Config_Handlers/RT-CCM/CB_Handler.cpp: + * tools/Config_Handlers/RT-CCM/CIAOServerResources.cpp: + * tools/Config_Handlers/RT-CCM/CIAOServerResources.hpp: + * tools/Config_Handlers/RT-CCM/CLA_Handler.h: + * tools/Config_Handlers/RT-CCM/CLA_Handler.cpp: + * tools/Config_Handlers/RT-CCM/CNPM_Handler.h: + * tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp: + * tools/Config_Handlers/RT-CCM/NPM_Handler.h: + * tools/Config_Handlers/RT-CCM/NPM_Handler.cpp: + * tools/Config_Handlers/RT-CCM/OC_Handler.h: + * tools/Config_Handlers/RT-CCM/OC_Handler.cpp: + * tools/Config_Handlers/RT-CCM/OR_Handler.h: + * tools/Config_Handlers/RT-CCM/OR_Handler.cpp: + * tools/Config_Handlers/RT-CCM/PM_Handler.h: + * tools/Config_Handlers/RT-CCM/PM_Handler.cpp: + * tools/Config_Handlers/RT-CCM/PS_Handler.h: + * tools/Config_Handlers/RT-CCM/PS_Handler.cpp: + * tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc: + * tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h: + * tools/Config_Handlers/RT-CCM/SRD_Handler.h: + * tools/Config_Handlers/RT-CCM/SRD_Handler.cpp: + * tools/Config_Handlers/RT-CCM/TPL_Handler.h: + * tools/Config_Handlers/RT-CCM/TPL_Handler.cpp: + * tools/Config_Handlers/RT-CCM/TP_Handler.h: + * tools/Config_Handlers/RT-CCM/TP_Handler.cpp: + * tools/Config_Handlers/RT-CCM/input.csr: + * tools/Config_Handlers/RT-CCM/test.cpp: + * tools/Config_Handlers/Req_Handler.h: + * tools/Config_Handlers/Req_Handler.cpp: + * tools/Config_Handlers/STD_CID_Handler.h: + * tools/Config_Handlers/STD_CID_Handler.cpp: + * tools/Config_Handlers/STD_CPD_Handler.h: + * tools/Config_Handlers/STD_CPD_Handler.cpp: + * tools/Config_Handlers/STD_IAD_Handler.h: + * tools/Config_Handlers/STD_IAD_Handler.cpp: + * tools/Config_Handlers/STD_PCD_Handler.h: + * tools/Config_Handlers/STD_PCD_Handler.cpp: + * tools/Config_Handlers/STD_PC_Intf.h: + * tools/Config_Handlers/STD_PC_Intf.cpp: + * tools/Config_Handlers/SatisfierProperty_Handler.h: + * tools/Config_Handlers/SatisfierProperty_Handler.cpp: + * tools/Config_Handlers/Utils: + * tools/Config_Handlers/Utils/Exceptions.h: + * tools/Config_Handlers/Utils/Functors.h: + * tools/Config_Handlers/XMI.hpp: + * tools/Config_Handlers/XMI.cpp: + * tools/Config_Handlers/XMLSchema: + * tools/Config_Handlers/XMLSchema/Traversal.hpp: + * tools/Config_Handlers/XMLSchema/Traversal.ipp: + * tools/Config_Handlers/XMLSchema/Traversal.tpp: + * tools/Config_Handlers/XMLSchema/TypeInfo.hpp: + * tools/Config_Handlers/XMLSchema/TypeInfo.ipp: + * tools/Config_Handlers/XMLSchema/TypeInfo.tpp: + * tools/Config_Handlers/XMLSchema/Types.hpp: + * tools/Config_Handlers/XMLSchema/Types.ipp: + * tools/Config_Handlers/XMLSchema/Types.tpp: + * tools/Config_Handlers/XMLSchema/Writer.hpp: + * tools/Config_Handlers/XMLSchema/Writer.ipp: + * tools/Config_Handlers/XMLSchema/Writer.tpp: + * tools/Config_Handlers/XML_File_Intf.h: + * tools/Config_Handlers/XML_File_Intf.cpp: + * tools/Config_Handlers/XML_Typedefs.h: + * tools/Config_Handlers/XML_Typedefs.cpp: + * tools/Config_Handlers/XSCRT: + * tools/Config_Handlers/XSCRT/Elements.hpp: + * tools/Config_Handlers/XSCRT/Elements.ipp: + * tools/Config_Handlers/XSCRT/Elements.tpp: + * tools/Config_Handlers/XSCRT/ExtendedTypeInfo.hpp: + * tools/Config_Handlers/XSCRT/ExtendedTypeInfo.ipp: + * tools/Config_Handlers/XSCRT/Parser.hpp: + * tools/Config_Handlers/XSCRT/Parser.ipp: + * tools/Config_Handlers/XSCRT/Parser.tpp: + * tools/Config_Handlers/XSCRT/Traversal.hpp: + * tools/Config_Handlers/XSCRT/Traversal.ipp: + * tools/Config_Handlers/XSCRT/Traversal.tpp: + * tools/Config_Handlers/XSCRT/Writer.hpp: + * tools/Config_Handlers/XSCRT/Writer.ipp: + * tools/Config_Handlers/XSCRT/Writer.tpp: + * tools/Config_Handlers/XSCRT/XML.hpp: + * tools/Config_Handlers/XSCRT/XML.ipp: + * tools/Config_Handlers/XSCRT/XML.tpp: + * tools/Config_Handlers/XSCRT/XMLSchema.hpp: + * tools/Config_Handlers/XSC_XML_Handlers_Export.h: + * tools/Config_Handlers/ccd.cpp: + * tools/Config_Handlers/ccd.hpp: + * tools/Config_Handlers/cdd.cpp: + * tools/Config_Handlers/cdd.hpp: + * tools/Config_Handlers/cdp.hpp: + * tools/Config_Handlers/cdp.cpp: + * tools/Config_Handlers/cid.cpp: + * tools/Config_Handlers/cid.hpp: + * tools/Config_Handlers/cpd.hpp: + * tools/Config_Handlers/cpd.cpp: + * tools/Config_Handlers/iad.cpp: + * tools/Config_Handlers/iad.hpp: + * tools/Config_Handlers/pcd.hpp: + * tools/Config_Handlers/pcd.cpp: + * tools/Config_Handlers/test.cdp: + * tools/Config_Handlers/test.cpp: + * tools/Config_Handlers/toplevel.cpp: + * tools/Config_Handlers/toplevel.hpp: + * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h: + * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp: + * tools/IDL3_to_XMI/IR_Simulator_visitor.h: + * tools/XML: + * tools/XML/CIAO_XML_Utils_Export.h: + * tools/XML/XML.mpc: + * tools/XML/XML_Error_Handler.h: + * tools/XML/XML_Error_Handler.cpp: + * tools/XML/XML_Helper.h: + * tools/XML/XML_Helper.tpp: + * tools/XML/XML_Schema_Resolver.h: + * tools/XML/XML_Schema_Resolver.tpp: + * tools/XML/XML_Schema_Resolver.cpp: + * tools/XML/XercesString.h: + * tools/XML/XercesString.cpp: + * tools/tools.mwc: + + Merged in from prism_import branch. + + * DAnCE/Deployment/CIAO_NodeApplication_CallBack.idl: + * DAnCE/Deployment/CIAO_ServerResources.idl: + * DAnCE/Deployment/Deployment_Container.idl: + * DAnCE/Deployment/Deployment_Events.idl: + * DAnCE/Deployment/NodeApp_CB_Impl.h: + * DAnCE/Deployment/NodeApp_CB_Impl.cpp: + * DAnCE/DomainApplicationManager/Deployment_Configuration.h: + * DAnCE/DomainApplicationManager/Deployment_Configuration.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.inl: + * DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.inl: + * DAnCE/DomainApplicationManager/Reply_Handler_i.h: + * DAnCE/DomainApplicationManager/Reply_Handler_i.cpp: + * DAnCE/DomainApplicationManager/Task_StartLaunch.h: + * DAnCE/DomainApplicationManager/Task_StartLaunch.cpp: + * DAnCE/ExecutionManager/DAM_Map.h: + * DAnCE/ExecutionManager/DAM_Map.cpp: + * DAnCE/ExecutionManager/Execution_Manager.cpp: + * DAnCE/ExecutionManager/Execution_Manager_Impl.h: + * DAnCE/ExecutionManager/Execution_Manager_Impl.cpp: + * DAnCE/NodeApplication/CIAO_NodeApplication_export.h: + * DAnCE/NodeApplication/Config_Manager.h: + * DAnCE/NodeApplication/Config_Manager.cpp: + * DAnCE/NodeApplication/Config_Manager_export.h: + * DAnCE/NodeApplication/Configurator_Factory.h: + * DAnCE/NodeApplication/Configurator_Factory.inl: + * DAnCE/NodeApplication/Configurator_Factory.cpp: + * DAnCE/NodeApplication/Container_Impl.h: + * DAnCE/NodeApplication/Container_Impl.inl: + * DAnCE/NodeApplication/Container_Impl.cpp: + * DAnCE/NodeApplication/NAConfig_Manager.h: + * DAnCE/NodeApplication/NAConfig_Manager.inl: + * DAnCE/NodeApplication/NAConfig_Manager.cpp: + * DAnCE/NodeApplication/NA_Configurator_Export.h: + * DAnCE/NodeApplication/NoOp_Configurator.h: + * DAnCE/NodeApplication/NoOp_Configurator.cpp: + * DAnCE/NodeApplication/NoOp_Configurator_export.h: + * DAnCE/NodeApplication/NodeApp_Configurator.h: + * DAnCE/NodeApplication/NodeApp_Configurator.cpp: + * DAnCE/NodeApplication/NodeApp_Configurator_Export.h: + * DAnCE/NodeApplication/NodeApplication.cpp: + * DAnCE/NodeApplication/NodeApplication_Core.h: + * DAnCE/NodeApplication/NodeApplication_Core.inl: + * DAnCE/NodeApplication/NodeApplication_Core.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.inl: + * DAnCE/NodeApplication/RTConfig_Manager.h: + * DAnCE/NodeApplication/RTConfig_Manager.inl: + * DAnCE/NodeApplication/RTConfig_Manager.cpp: + * DAnCE/NodeApplication/RTNA_Configurator_Export.h: + * DAnCE/NodeApplication/RTNodeApp_Configurator.h: + * DAnCE/NodeApplication/RTNodeApp_Configurator.cpp: + * DAnCE/NodeApplicationManager/CIAO_NAM_Export.h: + * DAnCE/NodeApplicationManager/Containers_Info_Map.h: + * DAnCE/NodeApplicationManager/Containers_Info_Map.cpp: + * DAnCE/NodeApplicationManager/ImplementationInfo.h: + * DAnCE/NodeApplicationManager/ImplementationInfo.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl: + * DAnCE/NodeApplicationManager/URL_Parser.h: + * DAnCE/NodeApplicationManager/URL_Parser.cpp: + * DAnCE/NodeManager/BaseMonitor.h: + * DAnCE/NodeManager/CIAO_Monitor.h: + * DAnCE/NodeManager/CIAO_Monitor.cpp: + * DAnCE/NodeManager/Monitor.mpc: + * DAnCE/NodeManager/MonitorCB.h: + * DAnCE/NodeManager/MonitorCB.cpp: + * DAnCE/NodeManager/MonitorController.h: + * DAnCE/NodeManager/MonitorController.cpp: + * DAnCE/NodeManager/NAM_Map.h: + * DAnCE/NodeManager/NAM_Map.cpp: + * DAnCE/NodeManager/Node_Manager.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp: + * DAnCE/tests/NodeApplicationTest: + * DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc: + * DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl: + * DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.idl: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp: + * DAnCE/tests/NodeApplicationTest/README: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h: + * DAnCE/tests/NodeApplicationTest/run_test.pl: + * DAnCE/tests/NodeApplicationTest/run_test_ex.pl: + * DAnCE/tests/NodeApplicationTest/run_test_simple.pl: + * DevGuideExamples: + * DevGuideExamples/CIAO.mwc: + * DevGuideExamples/Messenger: + * DevGuideExamples/Messenger/Administrator.cidl: + * DevGuideExamples/Messenger/Administrator.idl: + * DevGuideExamples/Messenger/Administrator.mpc: + * DevGuideExamples/Messenger/Administrator_Client.cpp: + * DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp: + * DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc: + * DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp: + * DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc: + * DevGuideExamples/Messenger/Administrator_exec_export.h: + * DevGuideExamples/Messenger/Administrator_exec_i.h: + * DevGuideExamples/Messenger/Administrator_exec_i.cpp: + * DevGuideExamples/Messenger/Administrator_stub_export.h: + * DevGuideExamples/Messenger/Administrator_svnt_export.h: + * DevGuideExamples/Messenger/History.idl: + * DevGuideExamples/Messenger/History_exec_i.h: + * DevGuideExamples/Messenger/History_exec_i.cpp: + * DevGuideExamples/Messenger/Message.idl: + * DevGuideExamples/Messenger/Messenger.cidl: + * DevGuideExamples/Messenger/Messenger.idl: + * DevGuideExamples/Messenger/Messenger.mpc: + * DevGuideExamples/Messenger/Messenger_exec_export.h: + * DevGuideExamples/Messenger/Messenger_exec_i.h: + * DevGuideExamples/Messenger/Messenger_exec_i.cpp: + * DevGuideExamples/Messenger/Messenger_stub_export.h: + * DevGuideExamples/Messenger/Messenger_svnt_export.h: + * DevGuideExamples/Messenger/Publication.idl: + * DevGuideExamples/Messenger/Publication_exec_i.h: + * DevGuideExamples/Messenger/Publication_exec_i.cpp: + * DevGuideExamples/Messenger/Receiver.cidl: + * DevGuideExamples/Messenger/Receiver.idl: + * DevGuideExamples/Messenger/Receiver.mpc: + * DevGuideExamples/Messenger/Receiver_exec_export.h: + * DevGuideExamples/Messenger/Receiver_exec_i.h: + * DevGuideExamples/Messenger/Receiver_exec_i.cpp: + * DevGuideExamples/Messenger/Receiver_stub_export.h: + * DevGuideExamples/Messenger/Receiver_svnt_export.h: + * DevGuideExamples/Messenger/Runnable.idl: + * DevGuideExamples/Messenger/Runnable_exec_i.h: + * DevGuideExamples/Messenger/Runnable_exec_i.cpp: + * DevGuideExamples/Messenger/StaticDAnCE: + * DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc: + * DevGuideExamples/Messenger/StaticDAnCE/README.txt: + * DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp: + * DevGuideExamples/Messenger/StaticDAnCE/plan.h: + * DevGuideExamples/Messenger/StaticDAnCE/run_test.pl: + * DevGuideExamples/Messenger/descriptors: + * DevGuideExamples/Messenger/descriptors/Administrator.ccd: + * DevGuideExamples/Messenger/descriptors/Administrator.cid: + * DevGuideExamples/Messenger/descriptors/Administrator.cpd: + * DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad: + * DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad: + * DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad: + * DevGuideExamples/Messenger/descriptors/Application-flattened.cdp: + * DevGuideExamples/Messenger/descriptors/Application.cdp: + * DevGuideExamples/Messenger/descriptors/Application.pcd: + * DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat: + * DevGuideExamples/Messenger/descriptors/Deployment.xsd: + * DevGuideExamples/Messenger/descriptors/Domain.cdd: + * DevGuideExamples/Messenger/descriptors/Libraries.iad: + * DevGuideExamples/Messenger/descriptors/Messenger.ccd: + * DevGuideExamples/Messenger/descriptors/Messenger.cid: + * DevGuideExamples/Messenger/descriptors/Messenger.cpd: + * DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd: + * DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid: + * DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd: + * DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad: + * DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad: + * DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad: + * DevGuideExamples/Messenger/descriptors/README_15a: + * DevGuideExamples/Messenger/descriptors/Receiver.ccd: + * DevGuideExamples/Messenger/descriptors/Receiver.cid: + * DevGuideExamples/Messenger/descriptors/Receiver.cpd: + * DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad: + * DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad: + * DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad: + * DevGuideExamples/Messenger/descriptors/XMI.xsd: + * DevGuideExamples/Messenger/descriptors/admin.dat: + * DevGuideExamples/Messenger/descriptors/package.tpd: + * DevGuideExamples/Messenger/descriptors/run_test.pl: + * DevGuideExamples/readme.txt: + * MPC/config/ciao_component_dnc.mpb: + * MPC/config/ciao_container_dnc.mpb: + * MPC/config/ciao_deployment_stub.mpb: + * MPC/config/ciao_deployment_svnt.mpb: + * MPC/config/ciao_server_dnc.mpb: + * ciao/CCM_Base.idl: + * ciao/CCM_CCM2Context.idl: + * ciao/CCM_CCMException.idl: + * ciao/CCM_Component.idl: + * ciao/CCM_ComponentId.idl: + * ciao/CCM_Configurator.idl: + * ciao/CCM_Container.idl: + * ciao/CCM_Container_Ex.idl: + * ciao/CCM_Context.idl: + * ciao/CCM_Cookie.idl: + * ciao/CCM_Core.mpc: + * ciao/CCM_EnterpriseComponent.idl: + * ciao/CCM_Entity2Context.idl: + * ciao/CCM_EntityComponent.idl: + * ciao/CCM_EntityContext.idl: + * ciao/CCM_Enumeration.idl: + * ciao/CCM_EventBase.idl: + * ciao/CCM_EventConsumerBase.idl: + * ciao/CCM_Events.idl: + * ciao/CCM_ExecutorLocator.idl: + * ciao/CCM_Home.idl: + * ciao/CCM_HomeConfiguration.idl: + * ciao/CCM_HomeExecutorBase.idl: + * ciao/CCM_HomeFinder.idl: + * ciao/CCM_HomeRegistration.idl: + * ciao/CCM_KeylessCCMHome.idl: + * ciao/CCM_Navigation.idl: + * ciao/CCM_Object.idl: + * ciao/CCM_PrimaryKeyBase.idl: + * ciao/CCM_ProxyHomeRegistration.idl: + * ciao/CCM_Receptacle.idl: + * ciao/CCM_Session2Context.idl: + * ciao/CCM_SessionComponent.idl: + * ciao/CCM_SessionContext.idl: + * ciao/CCM_SessionSynchronization.idl: + * ciao/CCM_StandardConfigurator.idl: + * ciao/CCM_StateIdFactory.idl: + * ciao/CCM_Transaction.idl: + * ciao/CIAO_SwapExec.idl: + * ciao/CIAO_UpgradeableContext.idl: + * ciao/Components.idl: + * ciao/Container_Base.h: + * ciao/Container_Base.inl: + * ciao/Container_Base.cpp: + * ciao/Context_Impl_Base.h: + * ciao/Context_Impl_Base.inl: + * ciao/Context_Impl_Base.cpp: + * ciao/Context_Impl_T.h: + * ciao/Context_Impl_T.cpp: + * ciao/Cookies.h: + * ciao/Cookies.inl: + * ciao/Cookies.cpp: + * ciao/CosPersistentState.idl: + * ciao/Dynamic_Component_Activator.h: + * ciao/Dynamic_Component_Activator.inl: + * ciao/Dynamic_Component_Activator.cpp: + * ciao/Dynamic_Component_Servant_Base.h: + * ciao/Dynamic_Component_Servant_Base.cpp: + * ciao/Dynamic_Component_Servant_T.h: + * ciao/Dynamic_Component_Servant_T.cpp: + * ciao/Home_Servant_Impl_Base.h: + * ciao/Home_Servant_Impl_Base.cpp: + * ciao/Home_Servant_Impl_T.h: + * ciao/Home_Servant_Impl_T.cpp: + * ciao/Object_Set_T.h: + * ciao/Object_Set_T.inl: + * ciao/Object_Set_T.cpp: + * ciao/Port_Activator.h: + * ciao/Port_Activator.inl: + * ciao/Port_Activator.cpp: + * ciao/Port_Activator_T.h: + * ciao/Port_Activator_T.cpp: + * ciao/Security.idl: + * ciao/Servant_Activator.h: + * ciao/Servant_Activator.cpp: + * ciao/Servant_Impl_Base.h: + * ciao/Servant_Impl_Base.cpp: + * ciao/Servant_Impl_T.h: + * ciao/Servant_Impl_T.cpp: + * ciao/Servant_Impl_Utils_T.cpp: + * ciao/Session_Container.h: + * ciao/Session_Container.inl: + * ciao/Session_Container.cpp: + * ciao/StandardConfigurator_Impl.h: + * ciao/StandardConfigurator_Impl.cpp: + * ciao/Swapping_Container.h: + * ciao/Swapping_Container.inl: + * ciao/Swapping_Container.cpp: + * ciao/Swapping_Servant_Home_Impl_Base.h: + * ciao/Swapping_Servant_Home_Impl_Base.cpp: + * ciao/Swapping_Servant_Home_Impl_T.h: + * ciao/Swapping_Servant_Home_Impl_T.cpp: + * ciao/Upgradeable_Context_Impl_T.h: + * ciao/Upgradeable_Context_Impl_T.cpp: + * ciao/extension: + * ciao/extension/CCM_ClientContainerInterceptor.idl: + * ciao/extension/CCM_ClientContainerInterceptorRegistration.idl: + * ciao/extension/CCM_ContainerClientRequestInfo.idl: + * ciao/extension/CCM_ContainerInterceptor.idl: + * ciao/extension/CCM_ContainerRequestInfo.idl: + * ciao/extension/CCM_ContainerServantRequestInfo.idl: + * ciao/extension/CCM_ContainerServerRequestInfo.idl: + * ciao/extension/CCM_ContainerStubRequestInfo.idl: + * ciao/extension/CCM_ExtensionComponent.idl: + * ciao/extension/CCM_ExtensionContext.idl: + * ciao/extension/CCM_InvalidRegistration.idl: + * ciao/extension/CCM_QoS.idl: + * ciao/extension/CCM_ServantContainerInterceptor.idl: + * ciao/extension/CCM_ServantContainerInterceptorRegistration.idl: + * ciao/extension/CCM_ServerContainerInterceptor.idl: + * ciao/extension/CCM_ServerContainerInterceptorRegistration.idl: + * ciao/extension/CCM_StubContainerInterceptor.idl: + * ciao/extension/CCM_StubContainerInterceptorRegistration.idl: + * ciao/extension/ExtensionContext.h: + * ciao/extension/ExtensionContext.cpp: + * ciaosvcs: + * ciaosvcs/Events: + * ciaosvcs/Events/CIAO_EventService_Factory_impl.h: + * ciaosvcs/Events/CIAO_EventService_Factory_impl.cpp: + * ciaosvcs/Events/CIAO_Events.mpc: + * ciaosvcs/Events/CIAO_Events_Base: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h: + * ciaosvcs/Events/CIAO_Events_Export.h: + * ciaosvcs/Events/CIAO_RTEC: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEVENT_Export.h: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.h: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.mpc: + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h: + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp: + * docs/schema/CIAOEvents.txt: + * examples/BasicSP/descriptors/BasicSP.cdp: + * examples/Hello/ReDaC-Usage.html: + * examples/Hello/descriptors/Hello.cid: + * examples/Hello/descriptors/Hello.cpd: + * examples/Hello/descriptors/Libraries.iad: + * examples/Hello/descriptors/Receiver.ccd: + * examples/Hello/descriptors/Receiver.cid: + * examples/Hello/descriptors/Receiver.cpd: + * examples/Hello/descriptors/Receiver_Exec.iad: + * examples/Hello/descriptors/Receiver_Stub.iad: + * examples/Hello/descriptors/Receiver_Svnt.iad: + * examples/Hello/descriptors/Sender.ccd: + * examples/Hello/descriptors/Sender.cid: + * examples/Hello/descriptors/Sender.cpd: + * examples/Hello/descriptors/Sender_Exec.iad: + * examples/Hello/descriptors/Sender_Stub.iad: + * examples/Hello/descriptors/Sender_Svnt.iad: + * examples/Hello/descriptors_ReDaC: + + * examples/Hello/descriptors_ReDaC/deploymentplan.cdp: + * examples/Hello/descriptors_ReDaC/deploymentplan_add.cdp: + * examples/Hello/descriptors_ReDaC/deploymentplan_remove.cdp: + * examples/Hello/descriptors_events: + * examples/Hello/descriptors_events/NodeManagerMap.dat: + * examples/Hello/descriptors_events/NodeManagerMapTwoHosts.dat: + * examples/Hello/descriptors_events/NodeManagerMap_collocated.dat: + * examples/Hello/descriptors_events/README: + * examples/Hello/descriptors_events/RunEventTest.pm: + * examples/Hello/descriptors_events/ciao-events-example-collocated.ced: + * examples/Hello/descriptors_events/ciao-events-example-with-federation.ced: + * examples/Hello/descriptors_events/ciao-events-example-with-filters.ced: + * examples/Hello/descriptors_events/ciao-events-example.ced: + * examples/Hello/descriptors_events/ciao-events-federation-mcast.ced: + * examples/Hello/descriptors_events/ciao-events-federation-udp-collocated.ced: + * examples/Hello/descriptors_events/ciao-events-federation-udp-two-hosts.ced: + * examples/Hello/descriptors_events/ciao-events-federation-udp.ced: + * examples/Hello/descriptors_events/deploymentplan_events.cdp: + * examples/Hello/descriptors_events/deploymentplan_events_collocated.cdp: + * examples/Hello/descriptors_events/deploymentplan_federation.cdp: + * examples/Hello/descriptors_events/deploymentplan_federation_mcast.cdp: + * examples/Hello/descriptors_events/deploymentplan_federation_udp.cdp: + * examples/Hello/descriptors_events/deploymentplan_federation_udp_collocated.cdp: + * examples/Hello/descriptors_events/deploymentplan_federation_udp_two_hosts.cdp: + * examples/Hello/descriptors_events/deploymentplan_multiple_senders.cdp: + * examples/Hello/descriptors_events/deploymentplan_with_filters.cdp: + * examples/Hello/descriptors_events/rtec.conf: + * examples/Hello/descriptors_events/run_NodeDaemons.pl: + * examples/Hello/descriptors_events/run_NodeDaemons_svc_conf.pl: + * examples/Hello/descriptors_events/run_NodeDaemons_with_ip.pl: + * examples/Hello/descriptors_events/run_test.pl: + * examples/Hello/descriptors_events/run_test_collocated.pl: + * examples/Hello/descriptors_events/run_test_federated.pl: + * examples/Hello/descriptors_events/run_test_filtered.pl: + * examples/Hello/descriptors_events/run_test_multicast.pl: + * examples/Hello/descriptors_events/run_test_multiple_senders.pl: + * examples/Hello/descriptors_events/run_test_simple.pl: + * examples/Hello/descriptors_events/run_test_udp.pl: + * examples/Hello/descriptors_events/run_test_udp_collocated.pl: + * examples/Hello/descriptors_shared_components: + * examples/Hello/descriptors_shared_components/deploymentplan.cdp: + * examples/Hello/descriptors_shared_components/deploymentplan_shared_components.cdp: + * examples/Null_Component/descriptors/Deployment.xsd: + * examples/Null_Component/descriptors/Domain.cdd: + * examples/Null_Component/descriptors/Null_Assembly.cid: + * examples/Null_Component/descriptors/Null_Assembly_Package.cpd: + * examples/Null_Component/descriptors/Null_Component.ccd: + * examples/Null_Component/descriptors/Null_ComponentMonolithicImpl.cid: + * examples/Null_Component/descriptors/Null_Component_Package.cpd: + * examples/Null_Component/descriptors/Null_Component_exec.iad: + * examples/Null_Component/descriptors/Null_Component_stub.iad: + * examples/Null_Component/descriptors/Null_Component_svnt.iad: + * examples/Null_Component/descriptors/PackageConfiguration.pcd: + * examples/Null_Component/descriptors/Plan.cdp: + * examples/Null_Component/descriptors/TopLevelPackage.tpd: + * examples/Null_Component/descriptors/XMI.xsd: + * tools/Config_Handlers/Utils/CIAO_XML_Utils_Export.h: + * tools/Config_Handlers/Utils/Utils.mpc: + * tools/Config_Handlers/Utils/XML_Error_Handler.h: + * tools/Config_Handlers/Utils/XML_Error_Handler.cpp: + * tools/Config_Handlers/Utils/XML_Helper.h: + * tools/Config_Handlers/Utils/XML_Helper.tpp: + * tools/Config_Handlers/Utils/XML_Helper.cpp: + * tools/Config_Handlers/Utils/XML_Schema_Resolver.h: + * tools/Config_Handlers/Utils/XML_Schema_Resolver.cpp: + * tools/Config_Handlers/Utils/XercesString.h: + * tools/Config_Handlers/Utils/XercesString.cpp: + + Removed these files. + +Wed Feb 11 13:35:59 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * Merged in from prism_import branch + + Wed Feb 11 02:15:21 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIAO-INSTALL.html: + * CIAO.mwc: + * CIAO_DAnCE.mwc: + * CIAO_TAO.mwc: + * CIAO_TAO_DAnCE.mwc: + * COPYING: + * ChangeLogs: + * NEWS: + * PROBLEM-REPORT-FORM: + * README: + * Release: + * VERSION: + * bin: + * bin/ciao_tests.lst: + * ciaosvcs: + * examples: + * examples/BasicSP/EC/client.cpp: + * examples/BasicSP/EC/controller.cpp: + * examples/DevGuideExamples: + * examples/Display/GPS/GPS_exec.cpp: + * examples/Display/NavDisplay/NavDisplay_exec.cpp: + * examples/Display/RateGen/controller.cpp: + * examples/Hello/Sender/starter.cpp: + * examples/Null_Component/StaticDAnCEApp.cpp: + * examples/Null_Component/descriptors/run_test.pl: + * examples/Swapping/Sender/starter.cpp: + * performance-tests: + * performance-tests/Benchmark/Multi_Threaded/client.cpp: + * performance-tests/Benchmark/RoundTrip/RoundTripEI.idl: + * performance-tests/Benchmark/RoundTrip/client.cpp: + * performance-tests/Benchmark/RoundTripClient/client.cpp: + * performance-tests/Protocols/Controller/Controller.cpp: + * performance-tests/Protocols/Receiver/Receiver_exec.cpp: + * performance-tests/Protocols/Sender/Sender_exec.cpp: + * performance-tests/mico/mico-thrput-st/client.cc: + * rules.ciao.GNU: + + Merged in changes from HEAD. + + Wed Feb 11 01:36:39 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Logger/Logger.mpc: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc: + * DAnCE/tests/CIAO/NodeManager-Deployments/nm_launcher.mpc: + * MPC/config/dance_logger.mpb: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp: + * examples/Hello/Sender/Sender_exec.h: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/Basic/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tests/Minimum/Receiver/Receiver.mpc: + + Windows fixes. + + Wed Feb 11 00:18:44 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CCF: + * CCF/CCF/CodeGenerationKit/IndentationCxx.hpp: + * CCF/CCF/CodeGenerationKit/IndentationJava.hpp: + * CIDLC: + * CIDLC/AttributeHeaderEmitters.cpp: + * CIDLC/DescriptorGenerator.cpp: + * CIDLC/Literals.cpp: + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/SizeTypeCalculator.cpp: + * CIDLC/cidlc.cpp: + * docs: + * docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp: + * tools/IDL3_to_IDL2: + + Merged changes in from trunk + + Tue Feb 10 23:31:09 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/TargetManager/TargetManager.mpc: + + Disabled this for now. + + Tue Feb 10 19:13:45 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * ciao/Containers/Session/Session_Container.cpp: + + Loffinf changes. + + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + + compile fixes to the last commit. + + * VERSION: + * ciao/Version.h: + + Updated version number to current. + + * examples/DevGuideExamples: + * examples/DevGuideExamples/Messenger/Administrator.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc: + * examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.h: + * examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Messenger.mpc: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.h: + * examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp: + * examples/DevGuideExamples/Messenger/Receiver.mpc: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.h: + * examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp: + * examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc: + * examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat: + * examples/DevGuideExamples/Messenger/descriptors/run_test.pl: + + Partially ported this example. + + Tue Feb 10 18:18:41 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Deployment.idl: + * DAnCE/Deployment/Deployment_Application.idl: + * DAnCE/Deployment/Deployment_ApplicationManager.idl: + * DAnCE/Deployment/Deployment_Base.idl: + * DAnCE/Deployment/Deployment_Connection.idl: + * DAnCE/Deployment/Deployment_Core.idl: + * DAnCE/Deployment/Deployment_Data.idl: + * DAnCE/Deployment/Deployment_DeploymentPlan.idl: + * DAnCE/Deployment/Deployment_DomainApplication.idl: + * DAnCE/Deployment/Deployment_DomainApplicationManager.idl: + * DAnCE/Deployment/Deployment_ExecutionManager.idl: + * DAnCE/Deployment/Deployment_NodeApplication.idl: + * DAnCE/Deployment/Deployment_NodeApplicationManager.idl: + * DAnCE/Deployment/Deployment_NodeManager.idl: + * DAnCE/Deployment/Deployment_Packaging_Data.idl: + * DAnCE/Deployment/Deployment_RepositoryManager.idl: + * DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl: + * DAnCE/Deployment/Deployment_TargetData.idl: + * DAnCE/Deployment/Deployment_TargetManager.idl: + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/DomainApplication/Domain_Application_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/NodeApplication/ComponentInstallation_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h: + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + * DAnCE/RepositoryManager/RMadmin.cpp: + * DAnCE/RepositoryManager/RepositoryManager_Impl.cpp: + * DAnCE/StaticConfigurator/StaticDAnCEParser.cpp: + * DAnCE/Utils/Plan_Handler.h: + * DAnCE/Utils/Plan_Handler.cpp: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp: + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/DeploymentPlanTestReferences/test.cpp: + * DAnCE/tests/DeploymentTest1/test.cpp: + * DAnCE/tests/MocksTest/MocksTest.cpp: + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + * DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp: + * DAnCE/tests/ObjectLocatorTest/Dummy.idl: + * DAnCE/tests/ObjectLocatorTest/clt_main.cpp: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest/Dummy.idl: + * DAnCE/tests/RedirectionServiceTest/clt_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + * ccm/ComponentServer/CCM_ComponentServer.idl: + * ccm/ComponentServer/CCM_ComponentServer_Base.idl: + * ccm/ComponentServer/CCM_ComponentServer_Client.idl: + * ciao/CIAO_FailureReasons.idl: + * ciao/Client_init.h: + * ciao/Client_init.cpp: + * ciao/ComponentServer/CIAO_CS_Client.idl: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_Properties.idl: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp: + * ciao/ComponentServer/Configurators/RT/RTConfig_Manager.h: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Servant_Activator.h: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.idl: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Contexts/Context.mpc: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/Home_Servant_Impl_Base.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_Utils_T.cpp: + * ciao/Server_init.cpp: + * ciao/Valuetype_Factories/Factories.mpc: + * docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp: + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp: + * examples/BasicSP/BMDisplay/BMDisplay_exec.cpp: + * examples/BasicSP/EC/EC_exec.cpp: + * examples/BasicSP/EC/client.cpp: + * examples/BasicSP/EC/controller.cpp: + * examples/Display/GPS/GPS_exec.cpp: + * examples/Display/NavDisplay/NavDisplay_exec.cpp: + * examples/Null_Component/StaticDAnCEApp.cpp: + * examples/Swapping/Sender/starter.cpp: + * ofccm/Cdmw/CDMW_Deployment.idl: + * ofccm/NodeApplication/ComponentInstallation_Impl.h: + * performance-tests/Benchmark/Multi_Threaded/client.cpp: + * performance-tests/Benchmark/RoundTrip/RoundTripEI.idl: + * performance-tests/Benchmark/RoundTrip/client.cpp: + * performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl: + * performance-tests/Benchmark/RoundTripClient/client.cpp: + * performance-tests/Protocols/Receiver/Receiver_exec.cpp: + * performance-tests/Protocols/Sender/Sender_exec.cpp: + * performance-tests/mico/mico-thrput-st/client.cc: + * performance-tests/mico/mico-thrput-st/server.cc: + * tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tools/Config_Handlers/Any_Handler.h: + * tools/Config_Handlers/Any_Handler.cpp: + * tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h: + * tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp: + * tools/Config_Handlers/CIAO_Events/test.cpp: + * tools/Config_Handlers/DD_Handler.h: + * tools/Config_Handlers/DD_Handler.cpp: + * tools/Config_Handlers/DP_Handler.h: + * tools/Config_Handlers/DP_Handler.cpp: + * tools/Config_Handlers/DynAny_Handler/dynany_test.idl: + * tools/Config_Handlers/DynAny_Handler/test.cpp: + * tools/Config_Handlers/DynAny_Handler/test.mpc: + * tools/Config_Handlers/ESD_Handler.h: + * tools/Config_Handlers/ESD_Handler.cpp: + * tools/Config_Handlers/IDD_Handler.h: + * tools/Config_Handlers/IDD_Handler.cpp: + * tools/Config_Handlers/IDREF_Base.h: + * tools/Config_Handlers/IDREF_Base.cpp: + * tools/Config_Handlers/Package_Handlers/test.cpp: + * tools/Config_Handlers/RT-CCM/OR_Handler.h: + * tools/Config_Handlers/RT-CCM/OR_Handler.cpp: + * tools/Config_Handlers/RT-CCM/SRD_Handler.h: + * tools/Config_Handlers/RT-CCM/SRD_Handler.cpp: + * tools/Config_Handlers/RT-CCM/test.cpp: + * tools/Config_Handlers/XML_Typedefs.h: + * tools/Config_Handlers/test.cpp: + * tools/IDL3_to_IDL2/cdmw_idl.cpp: + * tools/XML/XercesString.cpp: + + Fuzz. + + Fri Feb 6 22:06:51 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * bin/ciao_tests.lst: + + Added in tests that have been ported. + + Fri Feb 6 20:28:09 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/bin/PythonDAnCE/generator/comp_impl.py: + + Fixes that should have been in previous commit. + + * examples/Null_Component/Null_Component_exec.h: + * examples/Null_Component/Null_Component_exec.cpp: + * examples/Null_Component/descriptors/NodeMap.dat: + * examples/Null_Component/descriptors/Null_Homed.cdp: + * examples/Null_Component/descriptors/Null_Unhomed.cdp: + * examples/Null_Component/descriptors/run_test.pl: + + Ported this example to new CIAO/DAnCE. + + * examples/Null_Component/descriptors/Deployment.xsd: + * examples/Null_Component/descriptors/Domain.cdd: + * examples/Null_Component/descriptors/Null_Assembly.cid: + * examples/Null_Component/descriptors/Null_Assembly_Package.cpd: + * examples/Null_Component/descriptors/Null_Component.ccd: + * examples/Null_Component/descriptors/Null_ComponentMonolithicImpl.cid: + * examples/Null_Component/descriptors/Null_Component_Package.cpd: + * examples/Null_Component/descriptors/Null_Component_exec.iad: + * examples/Null_Component/descriptors/Null_Component_stub.iad: + * examples/Null_Component/descriptors/Null_Component_svnt.iad: + * examples/Null_Component/descriptors/PackageConfiguration.pcd: + * examples/Null_Component/descriptors/Plan.cdp: + * examples/Null_Component/descriptors/TopLevelPackage.tpd: + * examples/Null_Component/descriptors/XMI.xsd: + + Removed these files. + + Fri Feb 6 19:51:02 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/bin/PythonDAnCE/generator/comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/home_impl.py: + * DAnCE/bin/generate_plan.py: + + Fixes to better handle namespaces components may be declared in. + + * examples/BasicSP/descriptors/run_test.pl: + + Will run plan specified on commad line. + + * examples/BasicSP/descriptors/BasicSP_Homed.cdp: + + Same as the _Unhomed plan, except all components are explicitly homed. + + Fri Feb 6 19:36:03 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp: + * examples/BasicSP/BMDevice/BMDevice_exec.cpp: + * examples/BasicSP/BMDisplay/BMDisplay_exec.cpp: + * examples/BasicSP/EC/EC_exec.cpp: + + Raised the priority of logging messages so they would appear + without CIAO_LOG_LEVEL being set. + + * examples/BasicSP/EC/controller.cpp: + * examples/BasicSP/descriptors/BasicSP_Unhomed.cdp: + * examples/BasicSP/descriptors/run_test.pl: + + Fixes necessary to make this test work. + + Fri Feb 6 19:22:40 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Better exception handling. + + Fri Feb 6 18:26:39 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Better exception handling. + + * DAnCE/bin/PythonDAnCE/generator/artifact.py: + * DAnCE/bin/PythonDAnCE/generator/comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/header.py: + * DAnCE/bin/generate_plan.py: + + Bugfixes for plangenerator. + + * examples/BasicSP/BMClosedED/BMClosedED_exec.h: + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp: + * examples/BasicSP/BMDevice/BMDevice_exec.h: + * examples/BasicSP/BMDevice/BMDevice_exec.cpp: + * examples/BasicSP/BMDisplay/BMDisplay_exec.h: + * examples/BasicSP/BMDisplay/BMDisplay_exec.cpp: + * examples/BasicSP/EC/EC_exec.h: + * examples/BasicSP/EC/EC_exec.cpp: + + Added component servant and executor factory operations. + + * examples/BasicSP/descriptors/BasicSP.dat: + * examples/BasicSP/descriptors/BasicSP_Unhomed.cdp: + * examples/BasicSP/descriptors/run_test.pl: + + Ported to new version of DAnCE. test script still needs to invoke correct controller. + + * examples/BasicSP/descriptors/BasicSP.cdp: + + Removed obsolete plan. + + Fri Feb 6 13:44:54 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/bin/PythonDAnCE: + * DAnCE/bin/PythonDAnCE/__init__.py: + * DAnCE/bin/PythonDAnCE/generator: + * DAnCE/bin/PythonDAnCE/generator/__init__.py: + * DAnCE/bin/PythonDAnCE/generator/_path.py: + * DAnCE/bin/PythonDAnCE/generator/artifact.py: + * DAnCE/bin/PythonDAnCE/generator/comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/comp_inst.py: + * DAnCE/bin/PythonDAnCE/generator/footer.py: + * DAnCE/bin/PythonDAnCE/generator/header.py: + * DAnCE/bin/PythonDAnCE/generator/home_impl.py: + * DAnCE/bin/PythonDAnCE/generator/home_inst.py: + * DAnCE/bin/PythonDAnCE/generator/homed_comp_impl.py: + * DAnCE/bin/PythonDAnCE/generator/homed_comp_inst.py: + * DAnCE/bin/PythonDAnCE/generator/templet.py: + * DAnCE/bin/generate_plan.py: + + First cut implementation of a very simple cdp generator. + + Thu Feb 5 19:36:49 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * ofccm/DAnCE_Scripts: + * ofccm/DAnCE_Scripts/em-log.conf: + * ofccm/DAnCE_Scripts/em.conf: + * ofccm/DAnCE_Scripts/integ_deployment.sh: + * ofccm/DAnCE_Scripts/integ_deployment.xsl: + * ofccm/DAnCE_Scripts/logger.conf: + * ofccm/DAnCE_Scripts/pl-log.conf: + * ofccm/DAnCE_Scripts/pl.conf: + * ofccm/DAnCE_Scripts/plb-log.conf: + * ofccm/DAnCE_Scripts/plb.conf: + * ofccm/DAnCE_Scripts/start_ExecutionManager.sh: + * ofccm/DAnCE_Scripts/start_PlanLauncher.sh: + * ofccm/DAnCE_Scripts/start_PlanLauncherBase.sh: + * ofccm/DAnCE_Scripts/start_demo_1.sh: + + * DAnCE/bin/em-log.conf: + * DAnCE/bin/em.conf: + * DAnCE/bin/integ_deployment.sh: + * DAnCE/bin/integ_deployment.xsl: + * DAnCE/bin/logger.conf: + * DAnCE/bin/pl-log.conf: + * DAnCE/bin/pl.conf: + * DAnCE/bin/plb-log.conf: + * DAnCE/bin/plb.conf: + * DAnCE/bin/start_ExecutionManager.sh: + * DAnCE/bin/start_PlanLauncher.sh: + * DAnCE/bin/start_PlanLauncherBase.sh: + * DAnCE/bin/start_demo_1.sh: + + Moved OFCCM specific scripts over to the ofccm directory. + + Thu Feb 5 19:07:02 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * tests/IDL3_to_XMI: + * tools/IDL3_to_XMI: + * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h: + * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp: + * tools/IDL3_to_XMI/IR_Simulator_visitor.h: + + Ported this tool, and associated tests in from head. + + Thu Feb 5 18:37:55 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * bin/ciao_tests.lst: + + Ported this file in from trunk. + + * DAnCE/tests/NodeApplicationTest: + * DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc: + * DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl: + * DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.idl: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp: + * DAnCE/tests/NodeApplicationTest/README: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h: + * DAnCE/tests/NodeApplicationTest/run_test.pl: + * DAnCE/tests/NodeApplicationTest/run_test_ex.pl: + * DAnCE/tests/NodeApplicationTest/run_test_simple.pl: + + Removed obsolete test. + + Thu Feb 5 18:30:34 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIDLC/ExecImplHeaderGenerator.cpp: + * CIDLC/ExecImplSourceGenerator.cpp: + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/ServantSourceGenerator.cpp: + + Added component factory functions, similar to those already generated for + Homes. + + * DAnCE/tests/CIAO/Components/SimpleNull_exec.h: + * DAnCE/tests/CIAO/Components/SimpleNull_exec.cpp: + + Added in generated factory functions from above. + + * DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl: + * DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl: + + Added ability to run a single plan by passing it as a command line + arguments. + + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentUnhomed.cdp: + + Test for unhomed components. + + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + + Fixes for unhomed components. + + Thu Feb 5 16:03:59 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + + First cut implementation of unhomed component deployment. Untested as yet. + + Thu Feb 5 14:40:18 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome_NS.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl: + * tools/Config_Handlers/ERE_Handler.cpp: + + Fixes to enable external reference connections for non-provider connections. + + Thu Feb 5 00:39:48 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp: + + Fixed a segmentation fault. + + * DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp: + + Tests similar to those in NodeManager-Deployments, except across two nodes. + + Wed Feb 4 22:08:09 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp: + + Removed CLINFO from the logging messages. + + * DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl: + + Test script to execute all deployments in this directory + + * tools/XML/XML_Helper.tpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + + Reduced logging. + + Wed Feb 4 21:18:18 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/Containers/Container_Base.cpp: + + Demoted the logging priority of failure to find a receptacle policy. + + * examples/Hello/descriptors/run_test.pl: + + removed some extraneous logging. + + Wed Feb 4 19:07:27 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * examples/Hello/descriptors/run_test.pl: + + fixing nameservice support. + + Wed Feb 4 01:26:49 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIAO_TAO.mwc: + * CIAO_TAO_DAnCE.mwc: + + Added TAO_ROOT/utils. + + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Logging changes. + + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + + Compile fixes. + + * DAnCE/NodeApplication/Name_Utilities.cpp: + + Fixed segmentation faults. + + * DAnCE/tests/MocksTest/MockTest.mpc: + + Disabled. + + * examples/Hello/descriptors/run_test.pl: + + Fixes to use correct binaries and arguments. This test now runs. + + Tue Feb 3 14:24:17 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * examples/Hello/descriptors/run_test.pl: + + Migrating changes to a new workspace. + + Mon Jan 12 17:41:29 UTC 2009 Abdullah Sowayan <sowayan@gmail.com> + + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + + Use var types to encapsulates memory management instead + of using ptr types. This closes bugzilla 3538. + + Thu Dec 11 5:05:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ccm/CCM_KeylessCCMHome.idl: + Updated include + + * ccm/ComponentServer/CCM_ComponentServer.idl: + * ccm/ComponentServer/CCM_ComponentServer_Client.idl: + * ciao/Containers/Session/Session_Container.h: + Layout changes + + * ciao/Containers/Session/Session_Container.cpp: + const/initialise pointer with 0 + + Fri Nov 28 16:05:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + Added missing include + + Wed Nov 26 16:17:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/NodeApplication/NodeApplication.mpc: + Layout changes + + * DAnCE/NodeManager/Node_Manager_Module.cpp: + Layout changes to the help message + + * examples/Hello/Receiver/Receiver_exec.cpp: + * examples/Hello/Sender/starter.cpp: + Unicode changes + + Wed Nov 26 15:04:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.mpc: + Added dynamic flags + + * ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl: + Updated include + + * CIDLC/ExecutorMappingGenerator.cpp: + Update the include being generated + + * DAnCE/tests/NameServiceTest/clt_main.cpp: + * DAnCE/tests/NameServiceTest/Dummy.idl: + * DAnCE/tests/NameServiceTest/NameServiceTest.mpc: + * DAnCE/tests/NameServiceTest/run_test.pl: + Cleanup and wchar + + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + Fixed warning + + * examples/Swapping/Receiver/Receiver.mpc: + Disabled some projects + + * ofccm/NodeApplication/NodeApplication_Impl.h: + Updated include + + * tests/CIAO_ComponentServer/Basic/client.cpp: + Unicode changes + + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + Updated + + Wed Nov 26 14:22:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/TargetManager/TargetManager.mpc: + Disabled a few projects + + * DAnCE/tests/MocksTest/MocksTest.cpp: + Unicode change + + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + Fixed compile errors with msvc + + * examples/BasicSP/BasicSP.mpc: + Refactored this file a little bit. With msvc I do see that cidl + is each time executed even when nothing changes. This has to be fixed + + * MPC/config/dance_cdmw_idl.mpb: + Fixed after + + * ofccm/Cdmw/CDMW_Deployment.idl: + * ofccm/Cdmw/CDMW_IDL_Ext.idl: + Updated includes + + * ofccm/Cdmw/CDMW_IDL.mpc: + Use seperate idl project + + * ofccm/NodeApplication/ServerActivator_Impl.h: + Updated include + + Tue Nov 25 15:55:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ccm/ComponentServer/CCM_ComponentServer.idl: + * ccm/ComponentServer/CCM_ComponentServer.mpc: + * ccm/ComponentServer/CCM_ComponentServer_Base.idl: + * ccm/ComponentServer/CCM_ComponentServer_Client.idl: + * ccm/ComponentServer/ComponentServer.idl: + * ccm/ComponentServer/ComponentServer.mpc: + * ccm/ComponentServer/ComponentServer_Base.idl: + * ccm/ComponentServer/ComponentServer_Client.idl: + Renamed with CCM prefix + + * ccm/CCM_Enumeration.idl: + * ccm/CCM_Object.idl: + Moved sequence<CCMObject> CCMObjectSeq to CCM_Object + + * ciao/ComponentServer/CIAO_ComponentServer.idl: + Use CCMObjectSeq + + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + Use CCMObjectSeq + + * ciao/ComponentServer/CIAO_CS_Client.idl: + * ciao/Containers/Session/Session_Container.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * ofccm/Cdmw/CDMW_IDL.idl + Updated include + + * examples/Swapping/Sender/Sender.mpc: + Disabled these projects + + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + Explicitly list export header files + + Tue Nov 25 14:30:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ccm/ComponentServer/ComponentServer.mpc: + Only compile the IDL files as part of one project + + * ciao/Servants/Servants.mpc: + Move template files to seperate group + + * DAnCE/NodeApplication/Name_Utilities.cpp: + Fixed warning + + * ofccm/NodeApplication/NodeApplication_Impl.cpp: + Initialise pointers with 0 + + Tue Nov 25 08:30:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Servants/Swapping/CIAO_SwapExec.idl: + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h + * examples/Swapping/Receiver/Receiver_exec.h + * examples/Swapping/Sender/Sender_exec_1.h + * examples/Swapping/Sender/Sender_exec_2.h + * ofccm/NodeApplication/ComponentInstallation_Impl.h + * ofccm/NodeApplication/NodeApplication_Impl.cpp + * ofccm/NodeApplication/NodeApplication_Impl.h + * ofccm/NodeApplication/ServerActivator_Impl.cpp + * ofccm/NodeApplication/ServerActivator_Impl.h + Updated includes + + * ciao/Servants/Swapping/Swapping_Servants.mpc + * ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h + New files + + Mon Nov 24 20:08:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Servants/Home_Servant_Impl_T.cpp: + Fixed compile error + + * ciao/Servants/Port_Activator_T.cpp: + * ciao/Servants/Port_Activator_T.h: + Fixed signature deactivate + + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + Datatype/const changs + + * DAnCE/NodeApplication/Name_Utilities.cpp: + * DAnCE/NodeApplication/Name_Utilities.h: + Unicode changes + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + Layout changes + + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + Datatype changes + + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + Fixed compile error + + * examples/Swapping/Sender/Sender_exec.h: + Fixed include + + Mon Nov 24 19:48:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ccm/ComponentServer/ComponentServer.mpc + Layout change + + * ciao/Containers/Session/Session_Container.cpp: + Catch exceptions as const + + * ciao/Contexts/Context_Impl_Base.h: + Updated include + + * ciao/Servants/Home_Servant_Impl_Base.h: + Include Container_BaseC.h, the forward declaration + gives problems with msvc8 + + * ciao/Servants/Port_Activator.h: + Corrected signature so that we match the base class + + * ciao/Servants/Servant_Impl_T.h: + Removed not needed forward declaration + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + Unicode changes + + * DAnCE/NodeApplication/ServerActivator_Impl.cpp: + Const change + + * DAnCE/NodeManager/Node_Manager_Module.cpp: + Unicode and layout changes + + * DAnCE/NodeManager/NodeManager_Impl.cpp: + Layout changes and initialise pointer with 0 + + * examples/Hello/Sender/Sender_exec.cpp: + Unicode change + + * ofccm/Cdmw/CDMW_Deployment.idl: + * ofccm/Cdmw/CDMW_IDL_Ext.idl: + Updated includes + + Mon Nov 24 16:06:57 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/Name_Utilities.h: + * DAnCE/NodeApplication/Name_Utilities.cpp: + + Files missing from last commit. + + Sun Nov 23 23:59:50 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Properties.idl: + + Rearranged, organized + + * DAnCE/DomainApplicationManager/Node_Locator.h: + * DAnCE/DomainApplicationManager/Node_Locator.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeApplication/NodeApplication.mpc: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp: + + Improved NameService support. + + * examples/Hello/Sender/Sender_exec.cpp: + * examples/Hello/descriptors/DeploymentPlan.cdp: + * examples/Hello/descriptors/run_test.pl: + + Updates to work with new DAnCE. + + * tools/Config_Handlers/XSCRT/Elements.hpp: + * tools/XML/XML_Helper.h: + + Compile fixes. + + * examples/Hello/ReDaC-Usage.html: + * examples/Hello/descriptors/Hello.cid: + * examples/Hello/descriptors/Hello.cpd: + * examples/Hello/descriptors/Libraries.iad: + * examples/Hello/descriptors/Receiver.ccd: + * examples/Hello/descriptors/Receiver.cid: + * examples/Hello/descriptors/Receiver.cpd: + * examples/Hello/descriptors/Receiver_Exec.iad: + * examples/Hello/descriptors/Receiver_Stub.iad: + * examples/Hello/descriptors/Receiver_Svnt.iad: + * examples/Hello/descriptors/Sender.ccd: + * examples/Hello/descriptors/Sender.cid: + * examples/Hello/descriptors/Sender.cpd: + * examples/Hello/descriptors/Sender_Exec.iad: + * examples/Hello/descriptors/Sender_Stub.iad: + * examples/Hello/descriptors/Sender_Svnt.iad: + * examples/Hello/descriptors_ReDaC: + * examples/Hello/descriptors_events: + * examples/Hello/descriptors_shared_components: + + Removed these files. + + Fri Nov 21 16:58:00 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplicationManager/Node_Locator.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp: + + Better support for the naming service. + + * examples/Hello/descriptors/DeploymentPlan.cdp: + * examples/Hello/descriptors/run_test.pl: + + ported to new DAnCE. + + * examples/Hello/descriptors/Hello.cid: + * examples/Hello/descriptors/Hello.cpd: + * examples/Hello/descriptors/Libraries.iad: + * examples/Hello/descriptors/Receiver.ccd: + * examples/Hello/descriptors/Receiver.cid: + * examples/Hello/descriptors/Receiver.cpd: + * examples/Hello/descriptors/Receiver_Exec.iad: + * examples/Hello/descriptors/Receiver_Stub.iad: + * examples/Hello/descriptors/Receiver_Svnt.iad: + * examples/Hello/descriptors/Sender.ccd: + * examples/Hello/descriptors/Sender.cid: + * examples/Hello/descriptors/Sender.cpd: + * examples/Hello/descriptors/Sender_Exec.iad: + * examples/Hello/descriptors/Sender_Stub.iad: + * examples/Hello/descriptors/Sender_Svnt.iad: + + Removed superfluous files. + + * examples/Hello/descriptors_ReDaC: + * examples/Hello/descriptors_events: + * examples/Hello/descriptors_shared_components: + * examples/Hello/ReDaC-Usage.html: + + Removed these files, as these features are no longer supported. + + Tue Nov 18 15:40:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * CIDLC/Literals.cpp: + Generate CIAO version info in the header of the generated file + + Tue Nov 18 15:22:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/Utils/DAnCE_Utils.mpc: + * DAnCE/Utils/Plan_Handler.cpp: + Fixed compilation + + Tue Nov 18 15:15:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Servants/Servant_Impl_Base.h: + * DAnCE/Deployment/Deployment_TargetManager.idl: + * DAnCE/TargetManager/DomainDataManager.h: + Layout changes + + * DAnCE/TargetManager/CmpClient.cpp: + wchar changes + + * DAnCE/TargetManager/DomainEvents.idl: + Updated includes + + * DAnCE/TargetManager/TargetManager.mpc: + * DAnCE/TargetManager/TargetManagerImpl.idl + Updated for all refactoring + + * MPC/config/ciao_nodemanager_stub.mpb: + * MPC/config/ciao_targetmanager_stub.mpb: + * MPC/config/ciao_targetmanager_svnt.mpb: + * MPC/config/dance_nodemanager_stub.mpb: + * MPC/config/dance_nodemanager_svnt.mpb: + Updated these with unique lib names and correct aftes + + Tue Nov 18 14:55:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/Interfaces/Interfaces.mpc: + Added custom idl projects and added DAnCE_NodeManager_svnt + + Tue Nov 18 14:16:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Contexts/Context.mpc: + Added missing dynamicflags + + * ciao/Servants/Servant_Impl_Utils_T.cpp: + Layout change + + * MPC/config/ciao_context_impl.mpb: + New base project + + * MPC/config/ciao_servant.mpb: + Use ciao_context_impl + + Mon Nov 17 16:08:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * CCF/CCF/IDL2/Parser.hpp: + Undef interface when it is defined + + * DAnCE/DomainApplication/Domain_Application_Impl.cpp + * DAnCE/DomainApplication/Domain_Application_Impl.h + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h + * DAnCE/DomainApplicationManager/Node_Locator.cpp + * DAnCE/DomainApplicationManager/Node_Locator.h + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp + * DAnCE/ExecutionManager/ExecutionManager_Module.h + * DAnCE/NodeApplication/ServerActivator_Impl.cpp + * DAnCE/NodeApplication/ServerActivator_Impl.h + * DAnCE/NodeManager/Node_Manager_Exec.cpp + * DAnCE/NodeManager/Node_Manager_Module.cpp + * DAnCE/NodeManager/Node_Manager_Module.h + Various cleanup/layout changes + + Mon Nov 17 15:03:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/ComponentServer/CIAO_ComponentServer.cpp + * ciao/ComponentServer/CIAO_ComponentServer.h + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp + * ciao/ComponentServer/CIAO_Container_Impl.h + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h + * ciao/ComponentServer/CIAO_ServerResources.idl + * ciao/Containers/Container_Base.cpp + * ciao/Containers/Container_Base.h + * ciao/Containers/Servant_Activator.cpp + * ciao/Containers/Servant_Activator.h + * ciao/Containers/Session/Session_Container.cpp + * ciao/Containers/Session/Session_Container.h + Layout changes + + * ciao/ComponentServer/Configurator_Factory.cpp + * ciao/ComponentServer/Configurator_Factory.h + No need to have a member variable + + Mon Nov 17 14:34:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Client_init.cpp + * ciao/ComponentServer/CIAO_ComponentServer.cpp + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp + * ciao/ComponentServer/CIAO_Container_Impl.cpp + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp + * ciao/ComponentServer/Configurators/RT/RTConfig_Manager.cpp + * ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp + * ciao/Containers/Container_Base.cpp + * ciao/Containers/Servant_Activator.cpp + * ciao/Containers/Session/Session_Container.cpp + * ciao/Servants/Servant_Impl_Base.cpp + * ciao/Server_init.cpp + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp + * CIDLC/ServantSourceGenerator.cpp + * DAnCE/DomainApplication/Domain_Application_Impl.cpp + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp + * DAnCE/DomainApplicationManager/Node_Locator.cpp + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp + Layout, %s->%C changes + + Mon Nov 17 14:17:23 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/Deployment/DAnCE_Core.mpc: + Removed -Gos, this has to be enabled in the default.features + file through gen_ostream=1 + + Sun Nov 16 22:12:23 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Properties.idl: + + Added naming service and component IOR properties. + + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/RedirectionService/NameServiceRedirection.cpp: + + Logging/layout changes. + + Fri Nov 14 22:18:16 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Core.mpc: + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + + Support for dumping deployment plan at deployment time based on presence + of the gen_ostream MPC feature. + + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + + Logging improvements. + + * DAnCE/NodeApplication/NodeApplication.mpc: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * examples/Hello/descriptors/DeploymentPlan.cdp: + * examples/Hello/descriptors/NodeManagerMap.dat: + + Porting of the basic Hello example to the new CIAO/DAnCE. + + Fri Nov 14 18:51:35 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/ExecutionManager/ExecutionManager.mpc: + * DAnCE/Starter/Starter.cpp: + * DAnCE/tests/DeploymentTest1/test.cpp: + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + * DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp: + * DAnCE/tests/ObjectLocatorTest/ObjectLocatorTest.mpc: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + * MPC/config/ciao_componentserver_svnt.mpb: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/Containers/Swapping/Swapping_Container.cpp: + + Warning fixes on Linux. + + Thu Nov 13 22:58:42 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplicationManager/DomainApplicationManager.mpc: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/DomainApplicationManager/Node_Locator.h: + * DAnCE/DomainApplicationManager/Node_Locator.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Impl.h: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + + Refactored support for finding IORs of NodeManagers + to support Node Maps and NameService. + + * DAnCE/Plan_Launcher/Plan_Launcher.mpc: + * DAnCE/Plan_Launcher/Plan_Launcher_Exec.cpp: + * DAnCE/Deployment/Module_Main.h: + + dance_plan_launcher executable. + + Wed Nov 12 21:26:14 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + + Log message fixes. + + Wed Nov 12 21:22:43 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Module_Main.h: + + Fix to prevent a segmentation fault. + + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager.mpc: + * DAnCE/ExecutionManager/ExecutionManager_Impl.h: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/ExecutionManager/Execution_Manager_Exec.cpp: + + Fixes to enable running EM as a standalone executable and enable + EM driven deployments. + + * DAnCE/NodeManager/Node_Manager_Module.cpp: + + Minor log message fix. + + * DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc: + * DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp: + + Text excercising EM controlled deployment of a single component to single node. + + Wed Nov 12 19:53:23 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/ExecutionManager-Deployments: + + Destination for EM included tests. + + * DAnCE/tests/CIAO/NodeManager-Deployments/MultiplexConnectionExplicitHome.cdp: + + Test verifying multiplex facet connections. + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components: + * DAnCE/tests/CIAO/Components: + + Moved components directory up one level. + + Wed Nov 12 19:35:47 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + + Improved exception handling. + + Wed Nov 12 19:30:30 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/ComponentAttributesSetter.h: + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Changes necessary to support attribiute initialization. + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute.cidl: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute.idl: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute.mpc: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute_exec.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute_exec_export.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute_stub_export.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleAttribute_svnt_export.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleAttributeExplicitHome.cdp: + + Test that excercises the setting of attributes on homes and components + during deployment. + + Wed Nov 12 18:06:10 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Properties.idl: + + Added naming service integration properties. + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleUser_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp: + + Changes necessary to get simplex facet/receptacle connections working. + + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + + Removed some extra output. + + Wed Nov 12 17:14:28 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleProvider_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleUser_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp: + Changes for facet/receptacle connections, not finished yet - + moving to different machine. + + Fri Nov 7 18:46:09 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleConsumer_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleEmitter_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/EmitsConnectionExplicitHome.cdp: + + Fiexes for enabling connection of a standard emits/sub connection. + + Fri Nov 7 18:28:14 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimplePublisher_exec.cpp: + + Fixes for enabling connection of a standard pub/sub connection. + + Fri Nov 7 15:10:58 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CCF/CCF/CIDL/CIDL.mpc: + * CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp: + * CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp: + * CCF/CCF/IDL2/IDL2.mpc: + * CCF/CCF/IDL2/LexicalAnalyzer.hpp: + * CCF/CCF/IDL2/LexicalAnalyzer.cpp: + * CCF/CCF/IDL2/Parser.hpp: + * CCF/CCF/IDL2/SemanticGraph/Elements.cpp: + * CCF/CCF/IDL2/Traversal/Array.cpp: + * CCF/CCF/IDL3/IDL3.mpc: + * CIDLC/CIDLC.mwc: + + Reverted to revision 80830, as changes proposed in bug #3849 + caused a segmentation fault in Linux. + + Fri Nov 7 14:57:53 UTC 2008 William R. Otte <wotte@william-r-ottes-macbook-pro.local> + + * DAnCE/tests/CIAO/NodeManager-Deployments/PublishConnectionExplicitHome.cdp: + Test plan that will excercise a publish/subscribe connection. + + Thu Nov 6 20:55:19 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CCF/CCF/CIDL/CIDL.mpc: + + Added reference to '.' in Source_Files accidentally (?) removed + by Tue Nov 4 10:10:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>. + + Thu Nov 6 20:25:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * CCF/CCF/IDL2/IDL2.mpc + * CCF/CCF/IDL3/IDL3.mpc + Set /P flag for the archiver with bmake + + Thu Nov 6 19:25:22 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * tools/Config_Handlers/XSCRT/XML.hpp: + * tools/XML/XML_Schema_Resolver.cpp: + + Added support for xerces versions < 3.0. + + Thu Nov 6 18:47:56 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Logger/Log_Macros.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Servants/Servant_Impl_Base.cpp: + + Warning fixes for Linux. + + Thu Nov 6 16:35:22 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.mpc: + + Disabled this build. + + * tests/CIAO_ComponentServer/SimpleComponent/run_test.pl: + + Minor fixes. + + * tools/Config_Handlers/IRDD_Handler.h: + * tools/Config_Handlers/IRDD_Handler.cpp: + * tools/Config_Handlers/XML_Typedefs.h: + * tools/Config_Handlers/XML_Typedefs.cpp: + * tools/XML/XML_Helper.tpp: + + Compilation fixes. + + Thu Nov 6 15:28:10 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleConsumer.idl: + * DAnCE/tests/NameServiceTest/NameServiceTest.mpc: + * DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc: + * ciao/Containers/Swapping/Dynamic_Component_Activator.h: + + Compilation fixes. + + * tests/CIAO_ComponentServer/SimpleComponent/run_test.pl: + + Added a run_test script. + + Wed Nov 5 20:08:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * CCF/CCF/IDL2/LexicalAnalyzer.cpp: + * CCF/CCF/IDL2/LexicalAnalyzer.hpp: + * CCF/CCF/IDL2/Parser.hpp: + * CCF/CCF/IDL2/SemanticGraph/Elements.cpp: + Various changes for CB2009 support + + Tue Nov 4 10:10:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp: + * CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp: + Fixed ambiguity problems with CodeGear C++ Builder 2009 + + * CCF/CCF/CIDL/CIDL.mpc + Set /P flag for the archiver with bmake + + Mon Nov 3 19:56:29 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleConsumer.idl: + * ciao/Containers/Session/Session_Container.mpc: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tools/XML/XML_Error_Handler.cpp: + * tools/XML/XML_Helper.tpp: + + Compile/link fixes on linux. + + Mon Nov 3 18:32:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/NodeApplicationManager/NodeApplicationManager.mpc + * DAnCE/NodeManager/Node_Manager_Module.cpp + * DAnCE/NodeManager/NodeManager.mpc + * DAnCE/Starter/Starter.h + * MPC/config/cidlc.mpb + * MPC/config/dance_node_manager.mpb + * tools/XML/XML.mpc + Fixed various compile/link problems + + Mon Nov 3 17:13:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/NodeApplication/NodeApplication.mpc: + Added missing base project + + Thu Oct 23 09:25:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Containers/Container_Base.h + * ciao/Containers/Servant_Activator.h + * ciao/Containers/Session/Session_Container.h + * ciao/Containers/Swapping/Dynamic_Component_Activator.h + * ciao/Contexts/Context_Impl_T.h + * CIDLC/ExecImplHeaderGenerator.cpp + * DAnCE/TargetManager/TargetManager_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleConsumer_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleEmitter_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleMultipleUser_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleProvider_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimplePublisher_exec.h + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleUser_exec.h + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h + * docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h + * examples/BasicSP/BasicSP_exec.h + * examples/BasicSP/BMClosedED/BMClosedED_exec.h + * examples/BasicSP/BMDevice/BMDevice_exec.h + * examples/BasicSP/BMDisplay/BMDisplay_exec.h + * examples/BasicSP/EC/EC_exec.h + * examples/Display/GPS/GPS_exec.h + * examples/Display/GPS/GPS_tracing_exec.h + * examples/Display/NavDisplay/NavDisplay_exec.h + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h + * examples/Display/RateGen/RateGen_exec.h + * examples/Hello/Receiver/Receiver_exec.h + * examples/Hello/Sender/Sender_exec.h + * examples/Null_Component/Null_Component_exec.h + * examples/Swapping/Receiver/Receiver_exec.h + * examples/Swapping/Sender/Sender_exec.h + * examples/Swapping/Sender/Sender_exec_1.h + * examples/Swapping/Sender/Sender_exec_2.h + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h + * performance-tests/Protocols/Receiver/Receiver_exec.h + * performance-tests/Protocols/Sender/Sender_exec.h + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h + * tests/Minimum/Receiver/Receiver_exec.h + * tests/Minimum/Sender/Sender_exec.h + Use ::CORBA::LocalObject + + Wed Oct 22 13:07:28 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/Servants/Home_Servant_Impl_T.cpp: + + Removed debug change that caused segfault. + + Wed Oct 22 12:48:37 UTC 2008 William R. Otte <wotte@william-r-ottes-macbook-pro.local> + + * DAnCE/Starter/Starter.cpp: + * DAnCE/Starter/Starter.mpc: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + + Compilation fixes. + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Containers.mpc: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Servants/Home_Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.h: + * ciao/Servants/Servant_Impl_T.cpp: + + Fixes to have the container properly manage the lifecycle of + components during the teardown phase, so that the + SimpleComponentExplicitHome plan properly teardown. + + * ciao/Logger/Log_Macros.h: + + Removed non-interpreted flags from CIAO_TRACE macros. + + Tue Oct 21 19:23:20 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * DAnCE/DomainApplication/Domain_Application_Impl.h: + Added missing post.h + + Tue Oct 21 18:51:20 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ccm/CCM.mpc: + Make sure CIAO_ROOT is added to the include dirs + + Fri Oct 10 01:02:20 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Core.mpc: + * DAnCE/Deployment/DAnCE_Properties.idl: + + Codify DAnCE configuration property names in IDL. + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + + Implemented passivation, removal, and destruction logic. + + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + + Added new command line options. + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull.cidl: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull.idl: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull.mpc: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_exec.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_exec.cpp: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_exec_export.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_stub_export.h: + * DAnCE/tests/CIAO/NodeManager-Deployments/Components/SimpleNull_svnt_export.h: + + Component with no ports to test lifecycle operations. + + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleHome.cdp: + * DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp: + + Fixes for test passing. + + * ccm/CCM_Object.idl: + + Removed CIAO-specific interfaces. + + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_Properties.idl: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Servants/Home_Servant_Impl_Base.cpp: + + Fixes for proper component/servant lifecycle management. + + Tue Oct 7 19:20:38 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/NodeManager-Deployments/Components: + * DAnCE/tests/CIAO/Components: + + Moved Components subdirectory to the NodeManager-Deployments + directory. + + Tue Oct 7 19:16:06 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/tests/CIAO/Components: + * DAnCE/tests/CIAO/Components/SimpleCommon.idl: + * DAnCE/tests/CIAO/Components/SimpleCommon.mpc: + * DAnCE/tests/CIAO/Components/SimpleCommon_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleCommon_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer.cidl: + * DAnCE/tests/CIAO/Components/SimpleConsumer.idl: + * DAnCE/tests/CIAO/Components/SimpleConsumer.mpc: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleConsumer_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleConsumer_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter.cidl: + * DAnCE/tests/CIAO/Components/SimpleEmitter.idl: + * DAnCE/tests/CIAO/Components/SimpleEmitter.mpc: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleEmitter_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleEmitter_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.cidl: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.idl: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser.mpc: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleMultipleUser_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider.cidl: + * DAnCE/tests/CIAO/Components/SimpleProvider.idl: + * DAnCE/tests/CIAO/Components/SimpleProvider.mpc: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleProvider_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleProvider_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher.cidl: + * DAnCE/tests/CIAO/Components/SimplePublisher.idl: + * DAnCE/tests/CIAO/Components/SimplePublisher.mpc: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec.cpp: + * DAnCE/tests/CIAO/Components/SimplePublisher_exec_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_stub_export.h: + * DAnCE/tests/CIAO/Components/SimplePublisher_svnt_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser.cidl: + * DAnCE/tests/CIAO/Components/SimpleUser.idl: + * DAnCE/tests/CIAO/Components/SimpleUser.mpc: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.h: + * DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp: + * DAnCE/tests/CIAO/Components/SimpleUser_exec_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser_stub_export.h: + * DAnCE/tests/CIAO/Components/SimpleUser_svnt_export.h: + + Several components that individually test a single port type. + + Tue Oct 7 14:50:57 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Logger/Log_Macros.h: + * DAnCE/Logger/Logger_Service.cpp: + + Missing from previous commit. + + * DAnCE/tests/CIAO: + * tests/DAnCE: + * tests/DAnCE/NodeManager-Deployments: + * tests/DAnCE/NodeManager-Deployments/SimpleHome.cdp: + * tests/DAnCE/NodeManager-Deployments/nm_launcher.mpc: + * tests/DAnCE/NodeManager-Deployments/simple_nm_launcher.cpp: + + Moved test under DAnCE tree. + + Tue Oct 7 14:37:30 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Logger/Log_Macros.h: + * DAnCE/Logger/Logger_Service.cpp: + + Bugfixes. + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + + Fixes necessary to pass NodeManager-Deployments/SimpleHome.cdp. + + * DAnCE/RedirectionService/RedirectionService.cpp: + + Improved logging. + + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp: + * tests/DAnCE/NodeManager-Deployments: + * tests/DAnCE/NodeManager-Deployments/SimpleHome.cdp: + * tests/DAnCE/NodeManager-Deployments/nm_launcher.mpc: + * tests/DAnCE/NodeManager-Deployments/simple_nm_launcher.cpp: + + Simple test to excercise installation of a single home. + + Mon Oct 6 15:12:49 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_Properties.idl: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + + Codified some component server configvalue names in IDL. + + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + + Fixed a couple bugs w.r.t respecting default vs. custom server timeouts. + + Wed Oct 1 20:42:34 UTC 2008 William R. Otte <wotte@70-11-197-37.area7.spcsdns.net> + + * ciao/Logger/Logger_Service.cpp: + + Enabling tracing inadvertantly disabled logging. + + Wed Oct 1 20:27:33 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * tools/Config_Handlers/XML_File_Intf.cpp: + * tools/XML/XML_Helper.h: + * tools/XML/XML_Helper.tpp: + + Fixed some incompatibilities with Xerces 3.0, and improved logging in the + XML_File_Intf. + + Wed Oct 1 02:08:47 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + + Changes necessary for NodeApplicationManager-NodeApplication test to pass. + + Tue Sep 30 14:52:09 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + + Changes necessary to pass NodeManager-NodeApplicationManager test. + + Tue Sep 30 14:32:34 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Loader.h: + * DAnCE/Deployment/Module_Main.h: + * DAnCE/Logger/Log_Macros.h: + * DAnCE/Logger/Logger_Service.h: + * DAnCE/Logger/Logger_Service.cpp: + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Exec.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Starter/Starter.h: + * DAnCE/Starter/Starter.cpp: + + Fixed logging infrastructure, enableed NodeManager binary and ensured + its ability to start up. + + * ciao/Logger/Log_Macros.h: + + Fixed tracing facility. + + Mon Sep 29 17:26:48 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Deployment_Connection.idl: + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/RedirectionService/NameServiceRedirection.h: + * DAnCE/RedirectionService/RedirectionService.h: + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/DeploymentPlanTestReferences/test.cpp: + * DAnCE/tests/DeploymentTest1/test.cpp: + * DAnCE/tests/MocksTest/MocksTest.cpp: + * DAnCE/tests/NameServiceTest/clt_main.cpp: + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + * DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp: + * DAnCE/tests/ObjectLocatorTest/clt_main.cpp: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest/RegistrationPath.h: + * DAnCE/tests/RedirectionServiceTest/clt_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + * MPC/config/ccm_svnt.mpb: + * MPC/config/ciao_executor.mpb: + * MPC/config/ciao_servant.mpb: + * MPC/config/dance_exe.mpb: + * ciao/Client_init.h: + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/ComponentServer/Configurator_Factory.cpp: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/ComponentServer/Configurators/Config_Manager.h: + * ciao/ComponentServer/Configurators/RTConfig_Manager.h: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Servant_Activator.h: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Logger/Logger_Service.cpp: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Server_init.h: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl: + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp: + * examples/Display/NavDisplay/NavDisplay_exec.h: + * examples/Hello/Hello_Base/Hello_Base.mpc: + * ofccm/Cdmw/CDMW_IDL.mpc: + * ofccm/NodeApplication/ComponentAttributesSetter.cpp: + * ofccm/NodeApplication/NodeApplication.mpc: + * ofccm/NodeApplication/ServerActivator_Impl.h: + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp: + * performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp: + * tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/Basic/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tests/Minimum/Sender/Sender.mpc: + * tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc: + + Compile fixes, converted from <> includes to "" includes where appropriate. + + Tue Jun 3 14:01:08 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Deployment_Connection.idl: + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + * DAnCE/NodeApplication/ServerActivator_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/RedirectionService/NameServiceRedirection.h: + * DAnCE/RedirectionService/RedirectionService.h: + * DAnCE/tests/MocksTest/MocksTest.cpp: + * DAnCE/tests/RedirectionServiceTest/RegistrationPath.h: + * ciao/Client_init.h: + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/ComponentServer/Configurator_Factory.cpp: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/ComponentServer/Configurators/Config_Manager.h: + * ciao/ComponentServer/Configurators/RTConfig_Manager.h: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Servant_Activator.h: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Logger/Logger_Service.cpp: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Server_init.h: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl: + * ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp: + * ofccm/NodeApplication/ComponentAttributesSetter.cpp: + * ofccm/NodeApplication/ServerActivator_Impl.h: + * tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/Basic/client.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + * tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc: + + Fixed includes. + + Sun May 25 22:53:30 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Stripped much of the functionality to prepare for CIAO-specific implementation. + + * DAnCE/Deployment/Deployment_common.h: + * DAnCE/NodeApplication/NodeApplication.mpc: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/RedirectionService/CCMObjectLocator.h: + * MPC/config/ciao_servant.mpb: + * MPC/config/cidlc.mpb: + * MPC/config/dance_component_server_svnt.mpb: + * MPC/config/dance_node_application.mpb: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + * tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc: + + compile/link errors. + + Tue May 20 18:43:42 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIDLC/ExecImplSourceGenerator.cpp: + + Fixed spelling error. + + * DAnCE/Deployment/Deployment_common.h: + + Added PROPERTY_MAP typedef, a hash map translating names to property values. + + * MPC/config/ciao_servant.mpb: + * MPC/config/cidlc.mpb: + * MPC/config/dance_component_server_svnt.mpb: + * MPC/config/dance_node_application.mpb: + * ciao/CIAO.mpc: + * ciao/Client_init.cpp: + * ciao/Contexts/Context.mpc: + * ciaosvcs/Events/CIAO_Events.mpc: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc: + * ofccm/NodeApplication/NodeApplication.mpc: + * tests/CIAO_ComponentServer/Activator/Activator.mpc: + + Compile/link fixes. + + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Logger/Logger_Service.h: + * ciao/Logger/Logger_Service.cpp: + + Compile fixes/bugfixes for bugs exposed by SimpleComponent unit test. + + * tests/CIAO_ComponentServer/Basic/run_test.pl: + + slight bugfix. + + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.cidl: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_stub_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_svnt_export.h: + * tests/CIAO_ComponentServer/SimpleComponent/client.cpp: + + Simple unit test which manually deploys a simple component into the + CIAO_ComponentServer. + + * tools/Config_Handlers/XSCRT/XML.hpp: + * tools/XML/XML_Error_Handler.h: + * tools/XML/XML_Error_Handler.cpp: + * tools/XML/XML_Helper.tpp: + * tools/XML/XML_Schema_Resolver.h: + * tools/XML/XML_Schema_Resolver.tpp: + * tools/XML/XML_Schema_Resolver.cpp: + + Updates for Xerces 2.0 + + Thu Apr 10 23:44:01 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ciao_cs_client.mpb: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + + Bugfixes necessary to make the ServerActivator test work. + + * tests/CIAO_ComponentServer/Activator: + * tests/CIAO_ComponentServer/Activator/Activator.mpc: + * tests/CIAO_ComponentServer/Activator/client.cpp: + * tests/CIAO_ComponentServer/Activator/run_test.pl: + + A simple exceercise of the CIAO ServerActivator, that + spawns component servers then uses them to create + containers. + + Wed Apr 9 20:08:07 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ciao_exe.mpb: + + Make sure CIAO executables are installed to CIAO_ROOT/bin + + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/ComponentServer/Configurators/Configurators.mpc: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Logger/Log_Macros.h: + * ciao/Servants/Port_Activator.cpp: + + Fixes to make the Basic component server test work. + + * tests/CIAO_ComponentServer: + * tests/CIAO_ComponentServer/Basic: + * tests/CIAO_ComponentServer/Basic/Basic.mpc: + * tests/CIAO_ComponentServer/Basic/client.cpp: + * tests/CIAO_ComponentServer/Basic/run_test.pl: + + Simple test that excercises creating and removing containers. + + Thu Apr 3 21:14:56 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp: + * ciao/ComponentServer/Configurators/Configurators.mpc: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + + Fixes necessary to allow the componentserver executable to start up + in standalone mode (i.e., without a managing ServerActivator). + + Also, the name of the executable has changed to entirely lower-case. + + * ofccm/NodeApplication/NodeApplication.mpc: + + Renamed a project to avoid a duplicate name. + + Wed Apr 2 21:23:12 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ccm/CCM.mpc: + * ccm/CCM_Exceptions.idl: + * ccm/CCM_Home.idl: + + Moved some exceptions to a new file, CCM_Exceptions.idl. + + * ciao/CIAO.mpc: + * ciao/CIAO_FailureReasons.idl: + + Created IDL representing CIAO failure reasons for inclusion in exceptions + thrown from CIAO. + + * MPC/config/ciao_server.mpb: + * ciao/Client_init.h: + * ciao/Client_init.cpp: + * ciao/Server_init.h: + * ciao/Server_init.cpp: + + Moved a bunch of stuff from Server_init to Client_init, in particular, + the server init funciton is now implemented in terms of the + client's. Also moved the configvalue map functions over. + + * ciao/ComponentServer/CIAO_ServerActivator_Impl.h: + * ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp: + + Fully implemented ServerActivator implementation that spawns new + processes. This class is for the most part implemented using + the template method pattern, with a little effort it could be + extended to support other spawning models. + + * ciao/ComponentServer/CIAO_CS_Client.idl: + * ciao/ComponentServer/CIAO_CS_Client_svnt_export.h: + * ciao/ComponentServer/CIAO_ComponentServer.h: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + + Moved the CIAO-specific derivations of the component + server-related interfaces to CIAO::Deployment module. + + Thu Mar 27 19:26:18 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ofccm/Cdmw: + * DAnCE/Cdmw: + + Moved to ofccm specific directory. + + Thu Mar 27 19:09:00 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + + Compile fixes, runtime functionality not expected. + + Thu Mar 27 18:30:16 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeManager/NodeManager_Impl.cpp: + + Logging/format changes, don't expect this to compile, mostly + a bookmark before I start the real work. + + Thu Mar 27 18:13:07 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplication/Domain_Application_Impl.h: + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + + Logging/format changes, don't expect this to compile, mostly + a bookmark before I start the real work. + + Thu Mar 27 15:09:33 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + + Formatting and logging changes. I don't expect this to compile, + just bookmarking for future reference. + + * MPC/config/ciao_session_container.mpb: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/Servants/Servants.mpc: + * ciao/Server_init.h: + + Linux compile error fixes. + + Mon Mar 24 16:18:46 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Logger/Log_Macros.h: + * ciao/Containers/Session/Session_Container.idl: + * ciao/Logger/Log_Macros.h: + + Files missing from previous commit. + + Thu Mar 20 13:04:53 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/Deployment_RepositoryManager.idl: + * DAnCE/bin/integ_deployment.xsl: + + Added missing newlines at end of file. + + * DAnCE/Logger/Logger_Service.cpp: + + Added DANCE_ logging macros to match ACE_, so we can later have + DAnCE use a log handler that is separate from ACE. + + * DAnCE/Logger/File_Logger_Backend.cpp: + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeApplication/ComponentAttributesSetter.cpp: + * DAnCE/NodeApplication/ComponentInstallation_Impl.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplication/ServerActivator_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Generator/Plan_Generator_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp: + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + * DAnCE/RedirectionService/NameServiceRedirection.cpp: + * DAnCE/RedirectionService/RedirectionService.cpp: + * DAnCE/RepositoryManager/PC_Updater.cpp: + * DAnCE/RepositoryManager/RM_Helper.cpp: + * DAnCE/RepositoryManager/RMadmin.cpp: + * DAnCE/RepositoryManager/RepositoryManager.cpp: + * DAnCE/RepositoryManager/RepositoryManager_Impl.cpp: + * DAnCE/RepositoryManager/URL_Parser.cpp: + * DAnCE/RepositoryManager/ZIP_Wrapper.cpp: + * DAnCE/Starter/Starter.cpp: + * DAnCE/StaticConfigurator/StaticDAnCEApp.cpp.tmpl: + * DAnCE/StaticConfigurator/StaticDAnCEParser.cpp: + * DAnCE/TargetManager/CmpClient.cpp: + * DAnCE/TargetManager/DomainDataManager.cpp: + * DAnCE/Utils/Plan_Handler.cpp: + * DAnCE/tests/DeploymentPlanDump/test.cpp: + * DAnCE/tests/DeploymentPlanTestReferences/test.cpp: + * DAnCE/tests/DeploymentTest1/test.cpp: + * DAnCE/tests/MocksTest/plCommand.In: + * DAnCE/tests/MocksTest/run_test.pl: + * DAnCE/tests/NameServiceTest/clt_main.cpp: + * DAnCE/tests/NameServiceTest/srv_main.cpp: + * DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp: + * DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp: + * DAnCE/tests/ObjectLocatorTest/clt_main.cpp: + * DAnCE/tests/ObjectLocatorTest/srv_main.cpp: + * DAnCE/tests/RedirectionServiceTest/clt_main.cpp: + * DAnCE/tests/RedirectionServiceTest/srv_main.cpp: + + Use DANCE_ debug and error macros for diagnostics. + + * ciao/Logger/Logger_Service.cpp: + + Created CIAO_ debug/error macros, so the ciao logger can be replaced + later to not use the default ACE logger. + + * ciao/Logger/File_Logger_Backend.cpp: + * ciao/CIAO_common.h: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp: + * ciao/ComponentServer/Configurators/RTConfig_Manager.cpp: + * ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Containers/Swapping/Dynamic_Component_Activator.inl: + * ciao/Containers/Swapping/Swapping_Container.cpp: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Server_init.cpp: + + Use CIAO_ error/debug macros instead of ACE. + + Thu Mar 20 10:53:58 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication.mpc: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/Contexts/Context.mpc: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Servants.mpc: + + Linking/compile errors that didn't crop up until a realclean. + + Tue Mar 18 23:08:36 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ofccm: + * ofccm/NodeApplication: + + Copy of the OFCCM compatible NodeApplication logic. + + Tue Mar 18 22:29:19 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIDLC/ExecImplHeaderGenerator.cpp: + * CIDLC/ExecImplSourceGenerator.cpp: + * CIDLC/ServantSourceGenerator.cpp: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Port_Activator.inl: + * ciao/Servants/Port_Activator.cpp: + * ciao/Servants/Port_Activator_T.cpp: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.h: + * ciao/Servants/Servant_Impl_T.cpp: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/Containers/Containers.mpc: + + Removed ciao_{post,pre}activate, and addressed some fallout from the + container refactoring. + + * ccm/CCM_SessionComponent.idl: + + Added configuration_complete to this local interface. The CCM spec does not + have this operation defined, only having it on the executor locator, which is not + a required way to implement executors (and, I believe, excluded by LWCCM!). + + + * DAnCE/TargetManager/TargetManager_exec.h: + * DAnCE/TargetManager/TargetManager_exec.cpp: + * DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h: + * DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp: + * ccm/CCM_Object.idl: + * docs/TODO.html: + * docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h: + * docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp: + * examples/BasicSP/BMClosedED/BMClosedED_exec.h: + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp: + * examples/BasicSP/BMDevice/BMDevice_exec.h: + * examples/BasicSP/BMDevice/BMDevice_exec.cpp: + * examples/BasicSP/BMDisplay/BMDisplay_exec.h: + * examples/BasicSP/BMDisplay/BMDisplay_exec.cpp: + * examples/BasicSP/EC/EC_exec.h: + * examples/BasicSP/EC/EC_exec.cpp: + * examples/Display/GPS/GPS_exec.h: + * examples/Display/GPS/GPS_exec.cpp: + * examples/Display/GPS/GPS_tracing_exec.h: + * examples/Display/GPS/GPS_tracing_exec.cpp: + * examples/Display/NavDisplay/NavDisplay_exec.h: + * examples/Display/NavDisplay/NavDisplay_exec.cpp: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp: + * examples/Display/RateGen/RateGen_exec.h: + * examples/Display/RateGen/RateGen_exec.cpp: + * examples/Hello/Receiver/Receiver_exec.h: + * examples/Hello/Receiver/Receiver_exec.cpp: + * examples/Hello/Sender/Sender_exec.h: + * examples/Hello/Sender/Sender_exec.cpp: + * examples/Null_Component/Null_Component_exec.h: + * examples/Null_Component/Null_Component_exec.cpp: + * examples/Null_Component/StaticDAnCEApp.mpc: + * examples/Swapping/Receiver/Receiver.mpc: + * examples/Swapping/Receiver/Receiver_exec.h: + * examples/Swapping/Receiver/Receiver_exec.cpp: + * examples/Swapping/Sender/Sender.mpc: + * examples/Swapping/Sender/Sender_exec.h: + * examples/Swapping/Sender/Sender_exec.cpp: + * examples/Swapping/Sender/Sender_exec_1.h: + * examples/Swapping/Sender/Sender_exec_1.cpp: + * examples/Swapping/Sender/Sender_exec_2.h: + * examples/Swapping/Sender/Sender_exec_2.cpp: + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h: + * performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp: + * performance-tests/Protocols/Receiver/Receiver_exec.h: + * performance-tests/Protocols/Receiver/Receiver_exec.cpp: + * performance-tests/Protocols/Sender/Sender_exec.h: + * performance-tests/Protocols/Sender/Sender_exec.cpp: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp: + * tests/Minimum/Receiver/Receiver_exec.h: + * tests/Minimum/Receiver/Receiver_exec.cpp: + * tests/Minimum/Sender/Sender_exec.h: + * tests/Minimum/Sender/Sender_exec.cpp: + + Fallout from removing ciao_{pre,post}activate and replacing it with + standards based configuration_complete. + + Mon Mar 17 03:49:06 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ciao_servant_activator.mpb: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Container_Base.inl: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.inl: + * ciao/Containers/Session/Session_Container.cpp: + + Compile error fallout from previous commits. + + * docs/CIAO_Style_Guide.txt: + + Added guidance for allocation and guards. + + Tue Mar 11 06:34:45 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/Containers/CIAO_Servant_Activator.idl: + * ciao/Containers/CIAO_Servant_Activator_export.h: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Container_Base.inl: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Containers.mpc: + * ciao/Containers/Servant_Activator.h: + * ciao/Containers/Servant_Activator.cpp: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.inl: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Contexts/Context_Impl_Base.h: + * ciao/Contexts/Context_Impl_Base.inl: + * ciao/Contexts/Context_Impl_Base.cpp: + * ciao/Contexts/Context_Impl_T.h: + * ciao/Contexts/Context_Impl_T.cpp: + * ciao/Servants/CIAO_Port_Activator.idl: + * ciao/Servants/CIAO_Port_Activator_export.h: + * ciao/Servants/Home_Servant_Impl_Base.h: + * ciao/Servants/Home_Servant_Impl_Base.cpp: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Port_Activator.inl: + * ciao/Servants/Port_Activator.cpp: + * ciao/Servants/Port_Activator_T.h: + * ciao/Servants/Port_Activator_T.cpp: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.h: + * ciao/Servants/Servant_Impl_T.cpp: + * ciao/Servants/Servants.mpc: + + Refactored the container interface in substantial ways. First, the containers should + now be implemented as locality constrained objects based on the Container_Base.idl + interface. This interface now contains _all_ methods that are used by servants during + deployment and teardown, as well as interfaces intended to be used by the external container + interface to initiate copmonent and home installations. + + The goal here is to remove any need to have component servants dependent on specific container + implementation at all. + + Note that there is still quite some implementation required here - new methods and changes to + old ones. Everything at least compiles, which is a start. + + Changes to existing clients of the internal container interface should be plug-n-pray, + modulo changing pointer to vars. + + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/ServantSourceGenerator.cpp: + + Codegen changes for above. Servants for Hello and BasicSP compile. + + * MPC/config/ciao_port_activator_stub.mpb: + * MPC/config/ciao_servant_activator.mpb: + + Base projects for above. + + * ciao/Servants/Servant_Activator.h: + * ciao/Servants/Servant_Activator.cpp: + + Moved to container directory. + + Mon Mar 10 17:41:46 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ccm.mpb: + * MPC/config/ccm_executor.mpb: + * MPC/config/ciao_client_dnc.mpb: + * MPC/config/ciao_executor.mpb: + * MPC/config/ciao_servant.mpb: + * MPC/config/dance_component_server_svnt.mpb: + + MPC files which should have been in previous commit. + + Mon Mar 10 15:45:57 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIAO_TAO_DAnCE.mwc: + + * DAnCE/Cdmw/CDMW_Deployment.idl: + * DAnCE/Cdmw/CDMW_IDL.idl: + * DAnCE/Cdmw/CDMW_IDL.mpc: + * DAnCE/Cdmw/CDMW_IDL_Ext.idl: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/Logger/Logger.mpc: + * DAnCE/NodeApplication/ComponentAttributesSetter.h: + * DAnCE/NodeApplication/ComponentInstallation_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * MPC/config/ccm_componentserver_stub.mpb: + * MPC/config/ccm_componentserver_svnt.mpb: + * ccm/ComponentServer/ComponentServer.mpc: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl: + * ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp: + * tools/XML/XML.mpc: + + Changes to fix compilation from previous refactoring + + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/Containers/Containers.mpc: + + Addidional container implementation. + + * ciao/Server_init.h: + * ciao/Server_init.cpp: + + ditched the CaMelCaSe in the name utility class. + + Mon Mar 10 00:57:38 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/Deployment/DAnCE_Core.mpc: + * DAnCE/Plan_Generator/Plan_Generator.mpc: + * DAnCE/RepositoryManager/RepositoryManager.mpc: + * DAnCE/StaticConfigurator/StaticDAnCEParser.mpc: + * DAnCE/TargetManager/TM_Client.mpc: + * DAnCE/TargetManager/TargetManager.mpc: + * DAnCE/tests/NodeApplicationManager-NodeApplication/NodeApplicationManager-NodeApplication.mpc: + * DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc: + * DAnCE/tests/NodeManager-NodeApplicationManager/NodeManager-NodeApplicationManager.mpc: + * MPC/config/dance_mocks.mpb: + * MPC/config/dance_node_application.mpb: + * bin/generate_component_mpc.pl: + * ccm/ComponentServer/ComponentServer.mpc: + * ciao/CIAO.mpc: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/Containers/Containers.mpc: + * ciao/Contexts/Context.mpc: + * ciao/Servants/Servants.mpc: + * ciao/Valuetype_Factories/Factories.mpc: + * ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc: + * docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc: + * docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc: + * examples/BasicSP/BMClosedED/BMClosedED.mpc: + * examples/BasicSP/BMDevice/BMDevice.mpc: + * examples/BasicSP/BMDisplay/BMDisplay.mpc: + * examples/BasicSP/BasicSP.mpc: + * examples/BasicSP/EC/EC.mpc: + * examples/Display/Display_Base/Display_Base.mpc: + * examples/Display/GPS/GPS.mpc: + * examples/Display/NavDisplay/NavDisplay.mpc: + * examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc: + * examples/Display/RateGen/RateGen.mpc: + * examples/Hello/Hello_Base/Hello_Base.mpc: + * examples/Hello/Receiver/Receiver.mpc: + * examples/Hello/Sender/Sender.mpc: + * examples/Null_Component/Null_Component.mpc: + * examples/Null_Component/Null_Interface.mpc: + * examples/Null_Component/StaticDAnCEApp.mpc: + * examples/Swapping/Hello_Base/Hello_Base.mpc: + * examples/Swapping/Receiver/Receiver.mpc: + * examples/Swapping/Sender/Sender.mpc: + * performance-tests/Benchmark/Benchmark.mpc: + * performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc: + * performance-tests/Benchmark/RoundTrip/RoundTrip.mpc: + * performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc: + * performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc: + * performance-tests/Protocols/Controller/Controller.mpc: + * performance-tests/Protocols/Receiver/Receiver.mpc: + * performance-tests/Protocols/Sender/Sender.mpc: + * performance-tests/Protocols/common/Protocols.mpc: + * tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc: + * tests/Bug_2130_Regression/interfaces/ENW.mpc: + * tests/CIDL/CodeGen/Basic.mpc: + * tests/CIDL/CodeGen/CodeGen.mpc: + * tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc: + * tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc: + * tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc: + * tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc: + * tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc: + * tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc: + * tests/IDL3/Events/Abstract/Abstract.mpc: + * tests/IDL3/Events/Any/Any.mpc: + * tests/IDL3/Events/Regular/Regular.mpc: + * tests/IDL3/Homes/Attributes/HomeAttributes.mpc: + * tests/IDL3/Homes/Basic/Basic.mpc: + * tests/IDL3/Homes/Factory/Factory.mpc: + * tests/IDL3/Homes/Finder/Finder.mpc: + * tests/IDL3/Homes/Inheritance/Inheritance.mpc: + * tests/IDL3/ImpliedIDL/All/all.mpc: + * tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc: + * tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc: + * tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc: + * tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc: + * tests/IDL3/ImpliedIDL/Events/Events.mpc: + * tests/IDL3/ImpliedIDL/Homes/Homes.mpc: + * tests/IDL3/Lookup/lookup_test.mpc: + * tests/Minimum/Minimum_Base/Minimum_Base.mpc: + * tests/Minimum/Receiver/Receiver.mpc: + * tests/Minimum/Sender/Sender.mpc: + * tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc: + * tools/Config_Handlers/Config_Handlers.mpc: + * tools/Config_Handlers/DynAny_Handler.mpc: + * tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc: + * tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc: + * tools/XML/XML.mpc: + + Adjusting for the deep-sixing of ciao_server_dnc, ciao_component_dnc, + and ciao_client_dnc. This probably breaks a bunch of stuff. + + Mon Mar 10 00:37:35 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIDLC/ExecutorMappingGenerator.cpp: + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/ServantSourceGenerator.cpp: + + Updates for ccm refactoring. + + * MPC/config/ccm_stub.mpb: + * MPC/config/ciao_events_base_dnc.mpb: + * MPC/config/ciao_events_dnc.mpb: + * MPC/config/dance_deployment_stub.mpb: + + MPC generation errors. + + Sun Mar 9 22:28:28 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ciao_client.mpb: + * MPC/config/ciao_componentserver_stub.mpb: + * MPC/config/ciao_componentserver_svnt.mpb: + * MPC/config/ciao_config_manager.mpb: + * MPC/config/ciao_container_base.mpb: + * MPC/config/ciao_server.mpb: + * MPC/config/ciao_session_container.mpb: + + MPC build fixes. + + * ciao/CIAO.mpc: + * ciao/Client_init.cpp: + * ciao/ComponentServer/CIAO_CS_Client.idl: + * ciao/ComponentServer/CIAO_ComponentServer.cpp: + * ciao/ComponentServer/CIAO_ComponentServer.idl: + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.h: + * ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp: + * ciao/ComponentServer/CIAO_Container_Impl.h: + * ciao/ComponentServer/CIAO_Container_Impl.cpp: + * ciao/ComponentServer/CIAO_ServerResources.idl: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.h: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.inl: + * ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp: + * ciao/ComponentServer/Configurators/Config_Manager.h: + * ciao/ComponentServer/Configurators/Configurators.mpc: + * ciao/ComponentServer/Configurators/NoOp_Configurator.h: + * ciao/ComponentServer/Configurators/RTConfig_Manager.h: + * ciao/ComponentServer/Configurators/Server_Configurator.h: + * ciao/ComponentServer/Configurators/Server_Configurator.cpp: + * ciao/Valuetype_Factories/Factories.mpc: + + Compile fixes for previous refactoring. + + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Containers.mpc: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + + Updated forward declarations to handle new component server. + + * ciao/Server_init.h: + * ciao/Server_init.cpp: + + Merged functions from CIAO_Utils. + + * MPC/config/ciao_client_dnc.mpb: + * MPC/config/ciao_container_dnc.mpb: + * MPC/config/ciao_server_dnc.mpb: + * MPC/config/ciaodll.mpb: + * ciao/CCM_Core.mpc: + * ciao/CIAO_Core.mpc: + * ciao/CIAO_ServerResources.idl: + * ciao/CIAO_Utils.h: + * ciao/CIAO_Utils.cpp: + * ciao/CIAO_Utils_export.h: + * ciao/ComponentServer/Configurators/NAConfig_Manager.h: + * ciao/ComponentServer/Configurators/NAConfig_Manager.inl: + * ciao/ComponentServer/Configurators/NAConfig_Manager.cpp: + + Removed these files. + + Sun Mar 9 21:12:29 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Container_Base_export.h: + * ciao/Containers/Containers.mpc: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Containers/Session/Session_Container_export.h: + * ciao/Contexts/Context.mpc: + * ciao/Contexts/Context_Impl_Base.h: + * ciao/Contexts/Context_Impl_Base.cpp: + * ciao/Contexts/Context_Impl_export.h: + * MPC/config/ciao_session_container.mpb + * MPC/config/ciao_container_base.mpb + + MPC file, changes to logging, new, and guard macros + to comply with new CIAO style guidelines. + + * ciao/Servants/Servants.mpc: + * MPC/config/ciao_servant_activator.mpb + + Split activator out to its own lib. + + Sun Mar 9 20:38:52 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ccm/ComponentServer: + * ccm/ComponentServer/ComponentServer.idl: + * ccm/ComponentServer/ComponentServer.mpc: + * ccm/ComponentServer/ComponentServer_Base.idl: + * ccm/ComponentServer/ComponentServer_Client.idl: + * MPC/config/ccm_componentserver_stub.mpb: + * MPC/config/ccm_componentserver_svnt.mpb: + + Moved ComponentServer IDLS from DAnCE to CCM. + + * ciao/CIAO_common.h: + + Removed ciao_debug_level, the full range of debug message levels + should be used instead. + + * ciao/ComponentServer/CIAO_ComponentServer.mpc: + + Updated to reflect ComponentServer move above. + + * ciao/Servants/CIAO_Servant_Impl_export.h: + * ciao/Servants/Home_Servant_Impl_Base.h: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Port_Activator_T.h: + * ciao/Servants/Servant_Activator.h: + * ciao/Servants/Servant_Activator.cpp: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.cpp: + * ciao/Servants/Servant_Impl_Utils_T.cpp: + * ciao/Servants/Servants.mpc: + * ciao/Servants/StandardConfigurator_Impl.h: + + MPC file, changes to logging, and updated + to use _THROW_EX versions of new and guard macros. + + * docs/CIAO_Style_Guide.txt: + + Some additional style requirements for CIAO. + + * DAnCE/ComponentServer: + * DAnCE/ComponentServer/ComponentServer.idl: + * DAnCE/ComponentServer/ComponentServer.mpc: + * DAnCE/ComponentServer/ComponentServer_Base.idl: + * DAnCE/ComponentServer/ComponentServer_Client.idl: + * DAnCE/ComponentServer/DAnCE_ComponentServer_stub_export.h: + * DAnCE/ComponentServer/DAnCE_ComponentServer_svnt_export.h: + * MPC/config/dance_component_server_stub.mpb: + * MPC/config/dance_component_server_svnt.mpb: + + Removed these files. + + Sun Mar 9 17:04:55 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ccm_stub.mpb: + + Updated to comply with previous commit. + + Sun Mar 9 16:59:05 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ciao/ComponentServer: + * DAnCE/CIAO_ComponentServer: + + Moved CIAO component server to ciao source tree, where it should be. + + * ciao/ccm + * ccm + + Moved CCM idl directory to root, to better indicate its non-dependency + on CIAO, the CCM implementation. + + Sun Mar 9 16:56:42 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.cpp: + + Additional fleshing of the Container implementation, note this is + not expected to compile, simply being committed to complete the + directory structure refactoring. + + Sun Mar 9 16:47:24 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ccm_configvalue.mpb: + * MPC/config/ccm_cookie.mpb: + * MPC/config/ccm_stub.mpb: + * MPC/config/ccm_svnt.mpb: + + New base projects for the refactord CCM idls and valuetypes. + + * ciao/CIAO_Utils.h: + * ciao/CIAO_Utils.cpp: + * ciao/CIAO_Utils_export.h: + + Utility functions useful just about everywhere. + + * ciao/Logger: + + Renamed from CIAO_Logger + + * ciao/CCM_Core.mpc: + * ciao/CIAO_Core.mpc: + * ciao/Containers: + * ciao/Containers/Container_Base.h: + * ciao/Containers/Container_Base.inl: + * ciao/Containers/Container_Base.cpp: + * ciao/Containers/Session: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.inl: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Containers/Swapping: + * ciao/Containers/Swapping/Dynamic_Component_Activator.h: + * ciao/Containers/Swapping/Dynamic_Component_Activator.inl: + * ciao/Containers/Swapping/Dynamic_Component_Activator.cpp: + * ciao/Containers/Swapping/Swapping_Container.h: + * ciao/Containers/Swapping/Swapping_Container.inl: + * ciao/Containers/Swapping/Swapping_Container.cpp: + * ciao/Contexts: + * ciao/Contexts/Context_Impl_Base.h: + * ciao/Contexts/Context_Impl_Base.inl: + * ciao/Contexts/Context_Impl_Base.cpp: + * ciao/Contexts/Context_Impl_T.h: + * ciao/Contexts/Context_Impl_T.cpp: + * ciao/Contexts/Swapping: + * ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl: + * ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.h: + * ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.cpp: + * ciao/Servants: + * ciao/Servants/Home_Servant_Impl_Base.h: + * ciao/Servants/Home_Servant_Impl_Base.cpp: + * ciao/Servants/Home_Servant_Impl_T.h: + * ciao/Servants/Home_Servant_Impl_T.cpp: + * ciao/Servants/Port_Activator.h: + * ciao/Servants/Port_Activator.inl: + * ciao/Servants/Port_Activator.cpp: + * ciao/Servants/Port_Activator_T.h: + * ciao/Servants/Port_Activator_T.cpp: + * ciao/Servants/Servant_Activator.h: + * ciao/Servants/Servant_Activator.cpp: + * ciao/Servants/Servant_Impl_Base.h: + * ciao/Servants/Servant_Impl_Base.cpp: + * ciao/Servants/Servant_Impl_T.h: + * ciao/Servants/Servant_Impl_T.cpp: + * ciao/Servants/Servant_Impl_Utils_T.cpp: + * ciao/Servants/StandardConfigurator_Impl.h: + * ciao/Servants/StandardConfigurator_Impl.cpp: + * ciao/Servants/Swapping: + * ciao/Servants/Swapping/CIAO_SwapExec.idl: + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h: + * ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp: + * ciao/Servants/Swapping/Dynamic_Component_Servant_T.h: + * ciao/Servants/Swapping/Dynamic_Component_Servant_T.cpp: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.cpp: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.h: + * ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.cpp: + * ciao/Valuetype_Factories: + * ciao/Valuetype_Factories/ConfigValue.h: + * ciao/Valuetype_Factories/ConfigValue.cpp: + * ciao/Valuetype_Factories/ConfigValue_Export.h: + * ciao/Valuetype_Factories/Cookie_Export.h: + * ciao/Valuetype_Factories/Cookies.h: + * ciao/Valuetype_Factories/Cookies.inl: + * ciao/Valuetype_Factories/Cookies.cpp: + * ciao/Valuetype_Factories/Factories.mpc: + + Refactoring of the directory structure bloodbath. MPC files will come in + next commit. + + * ciao/ccm/CCM.mpc: + * ciao/ccm/CCM_Base.idl: + * ciao/ccm/CCM_CCM2Context.idl: + * ciao/ccm/CCM_CCMException.idl: + * ciao/ccm/CCM_Component.idl: + * ciao/ccm/CCM_ComponentId.idl: + * ciao/ccm/CCM_Configurator.idl: + * ciao/ccm/CCM_Container.idl: + * ciao/ccm/CCM_Container_Ex.idl: + * ciao/ccm/CCM_Context.idl: + * ciao/ccm/CCM_Cookie.idl: + * ciao/ccm/CCM_EnterpriseComponent.idl: + * ciao/ccm/CCM_Entity2Context.idl: + * ciao/ccm/CCM_EntityComponent.idl: + * ciao/ccm/CCM_EntityContext.idl: + * ciao/ccm/CCM_Enumeration.idl: + * ciao/ccm/CCM_EventBase.idl: + * ciao/ccm/CCM_EventConsumerBase.idl: + * ciao/ccm/CCM_Events.idl: + * ciao/ccm/CCM_ExecutorLocator.idl: + * ciao/ccm/CCM_Home.idl: + * ciao/ccm/CCM_HomeConfiguration.idl: + * ciao/ccm/CCM_HomeExecutorBase.idl: + * ciao/ccm/CCM_HomeFinder.idl: + * ciao/ccm/CCM_HomeRegistration.idl: + * ciao/ccm/CCM_KeylessCCMHome.idl: + * ciao/ccm/CCM_Navigation.idl: + * ciao/ccm/CCM_Object.idl: + * ciao/ccm/CCM_PrimaryKeyBase.idl: + * ciao/ccm/CCM_ProxyHomeRegistration.idl: + * ciao/ccm/CCM_Receptacle.idl: + * ciao/ccm/CCM_Session2Context.idl: + * ciao/ccm/CCM_SessionComponent.idl: + * ciao/ccm/CCM_SessionContext.idl: + * ciao/ccm/CCM_SessionSynchronization.idl: + * ciao/ccm/CCM_StandardConfigurator.idl: + * ciao/ccm/CCM_StateIdFactory.idl: + * ciao/ccm/CCM_Stub_Export.h: + * ciao/ccm/CCM_Svnt_Export.h: + * ciao/ccm/CCM_Transaction.idl: + * ciao/ccm/Components.idl: + * ciao/ccm/CosPersistentState.idl: + * ciao/ccm/Security.idl: + * ciao/ccm/extension: + + All spec defined IDLs were moved to ccm subdirectory. + + * ciao/CCM_Base.idl: + * ciao/CCM_CCM2Context.idl: + * ciao/CCM_CCMException.idl: + * ciao/CCM_Component.idl: + * ciao/CCM_ComponentId.idl: + * ciao/CCM_Configurator.idl: + * ciao/CCM_Container.idl: + * ciao/CCM_Container_Ex.idl: + * ciao/CCM_Context.idl: + * ciao/CCM_Cookie.idl: + * ciao/CCM_EnterpriseComponent.idl: + * ciao/CCM_Entity2Context.idl: + * ciao/CCM_EntityComponent.idl: + * ciao/CCM_EntityContext.idl: + * ciao/CCM_Enumeration.idl: + * ciao/CCM_EventBase.idl: + * ciao/CCM_EventConsumerBase.idl: + * ciao/CCM_Events.idl: + * ciao/CCM_ExecutorLocator.idl: + * ciao/CCM_Home.idl: + * ciao/CCM_HomeConfiguration.idl: + * ciao/CCM_HomeExecutorBase.idl: + * ciao/CCM_HomeFinder.idl: + * ciao/CCM_HomeRegistration.idl: + * ciao/CCM_KeylessCCMHome.idl: + * ciao/CCM_Navigation.idl: + * ciao/CCM_Object.idl: + * ciao/CCM_PrimaryKeyBase.idl: + * ciao/CCM_ProxyHomeRegistration.idl: + * ciao/CCM_Receptacle.idl: + * ciao/CCM_Session2Context.idl: + * ciao/CCM_SessionComponent.idl: + * ciao/CCM_SessionContext.idl: + * ciao/CCM_SessionSynchronization.idl: + * ciao/CCM_StandardConfigurator.idl: + * ciao/CCM_StateIdFactory.idl: + * ciao/CCM_Transaction.idl: + * ciao/CIAO_Logger: + * ciao/CIAO_Logger/CIAOLoggerFactory.h: + * ciao/CIAO_Logger/CIAO_Logger_Export.h: + * ciao/CIAO_Logger/File_Logger_Backend.h: + * ciao/CIAO_Logger/File_Logger_Backend.cpp: + * ciao/CIAO_Logger/Logger.mpc: + * ciao/CIAO_Logger/Logger_Service.h: + * ciao/CIAO_Logger/Logger_Service.cpp: + * ciao/CIAO_SwapExec.idl: + * ciao/CIAO_UpgradeableContext.idl: + * ciao/Components.idl: + * ciao/ConfigValue.h: + * ciao/ConfigValue.cpp: + * ciao/Container_Base.h: + * ciao/Container_Base.inl: + * ciao/Container_Base.cpp: + * ciao/Context_Impl_Base.h: + * ciao/Context_Impl_Base.inl: + * ciao/Context_Impl_Base.cpp: + * ciao/Context_Impl_T.h: + * ciao/Context_Impl_T.cpp: + * ciao/Cookies.h: + * ciao/Cookies.inl: + * ciao/Cookies.cpp: + * ciao/CosPersistentState.idl: + * ciao/Dynamic_Component_Activator.h: + * ciao/Dynamic_Component_Activator.inl: + * ciao/Dynamic_Component_Activator.cpp: + * ciao/Dynamic_Component_Servant_Base.h: + * ciao/Dynamic_Component_Servant_Base.cpp: + * ciao/Dynamic_Component_Servant_T.h: + * ciao/Dynamic_Component_Servant_T.cpp: + * ciao/Home_Servant_Impl_Base.h: + * ciao/Home_Servant_Impl_Base.cpp: + * ciao/Home_Servant_Impl_T.h: + * ciao/Home_Servant_Impl_T.cpp: + * ciao/Object_Set_T.h: + * ciao/Object_Set_T.inl: + * ciao/Object_Set_T.cpp: + * ciao/Port_Activator.h: + * ciao/Port_Activator.inl: + * ciao/Port_Activator.cpp: + * ciao/Port_Activator_T.h: + * ciao/Port_Activator_T.cpp: + * ciao/Security.idl: + * ciao/Servant_Activator.h: + * ciao/Servant_Activator.cpp: + * ciao/Servant_Impl_Base.h: + * ciao/Servant_Impl_Base.cpp: + * ciao/Servant_Impl_T.h: + * ciao/Servant_Impl_T.cpp: + * ciao/Servant_Impl_Utils_T.cpp: + * ciao/Session_Container.h: + * ciao/Session_Container.inl: + * ciao/Session_Container.cpp: + * ciao/StandardConfigurator_Impl.h: + * ciao/StandardConfigurator_Impl.cpp: + * ciao/Swapping_Container.h: + * ciao/Swapping_Container.inl: + * ciao/Swapping_Container.cpp: + * ciao/Swapping_Servant_Home_Impl_Base.h: + * ciao/Swapping_Servant_Home_Impl_Base.cpp: + * ciao/Swapping_Servant_Home_Impl_T.h: + * ciao/Swapping_Servant_Home_Impl_T.cpp: + * ciao/Upgradeable_Context_Impl_T.h: + * ciao/Upgradeable_Context_Impl_T.cpp: + * ciao/extension: + * ciao/extension/CCM_ClientContainerInterceptor.idl: + * ciao/extension/CCM_ClientContainerInterceptorRegistration.idl: + * ciao/extension/CCM_ContainerClientRequestInfo.idl: + * ciao/extension/CCM_ContainerInterceptor.idl: + * ciao/extension/CCM_ContainerRequestInfo.idl: + * ciao/extension/CCM_ContainerServantRequestInfo.idl: + * ciao/extension/CCM_ContainerServerRequestInfo.idl: + * ciao/extension/CCM_ContainerStubRequestInfo.idl: + * ciao/extension/CCM_ExtensionComponent.idl: + * ciao/extension/CCM_ExtensionContext.idl: + * ciao/extension/CCM_InvalidRegistration.idl: + * ciao/extension/CCM_QoS.idl: + * ciao/extension/CCM_ServantContainerInterceptor.idl: + * ciao/extension/CCM_ServantContainerInterceptorRegistration.idl: + * ciao/extension/CCM_ServerContainerInterceptor.idl: + * ciao/extension/CCM_ServerContainerInterceptorRegistration.idl: + * ciao/extension/CCM_StubContainerInterceptor.idl: + * ciao/extension/CCM_StubContainerInterceptorRegistration.idl: + * ciao/extension/ExtensionContext.h: + * ciao/extension/ExtensionContext.cpp: + + Removed these files. + + Sun Mar 9 05:25:41 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.mpc: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.cpp: + * DAnCE/CIAO_ComponentServer/Configurator_Factory.cpp: + + Updates for moves below. + + * DAnCE/CIAO_ComponentServer/Configurators: + * DAnCE/CIAO_ComponentServer/Configurators/Basic_Config_Manager_export.h: + * DAnCE/CIAO_ComponentServer/Configurators/Basic_Configurator_export.h: + * DAnCE/CIAO_ComponentServer/Configurators/ComponentServer_Configurator_export.h: + * DAnCE/CIAO_ComponentServer/Configurators/Config_Manager.h: + * DAnCE/CIAO_ComponentServer/Configurators/Config_Manager.cpp: + * DAnCE/CIAO_ComponentServer/Configurators/Configurators.mpc: + * DAnCE/CIAO_ComponentServer/Configurators/NAConfig_Manager.h: + * DAnCE/CIAO_ComponentServer/Configurators/NAConfig_Manager.inl: + * DAnCE/CIAO_ComponentServer/Configurators/NAConfig_Manager.cpp: + * DAnCE/CIAO_ComponentServer/Configurators/NoOp_Configurator.h: + * DAnCE/CIAO_ComponentServer/Configurators/NoOp_Configurator.cpp: + * DAnCE/CIAO_ComponentServer/Configurators/NoOp_Configurator_export.h: + * DAnCE/CIAO_ComponentServer/Configurators/RTConfig_Manager.h: + * DAnCE/CIAO_ComponentServer/Configurators/RTConfig_Manager.inl: + * DAnCE/CIAO_ComponentServer/Configurators/RTConfig_Manager.cpp: + * DAnCE/CIAO_ComponentServer/Configurators/RTNA_Configurator_Export.h: + * DAnCE/CIAO_ComponentServer/Configurators/RTNodeApp_Configurator.h: + * DAnCE/CIAO_ComponentServer/Configurators/RTNodeApp_Configurator.cpp: + * DAnCE/CIAO_ComponentServer/Configurators/Server_Configurator.h: + * DAnCE/CIAO_ComponentServer/Configurators/Server_Configurator.cpp: + + Moved all configurator related logic to subdirectory; imported + config managers from trunk. + + * MPC/config/ciao_componentserver_svnt.mpb: + * MPC/config/ciao_config_manager.mpb: + * MPC/config/ciao_servant_dnc.mpb: + * MPC/config/ciao_server_dnc.mpb: + * MPC/config/dance_deployment_stub.mpb: + * MPC/config/dance_deployment_svnt.mpb: + + Removed dependencies on events, as it won't work anyway until it is + re-implemented. + + * ciao/CIAO_ServerResources.idl: + + Renamed DAnCE namespace to Deployment to be consistent. + + * DAnCE/CIAO_ComponentServer/ComponentServer_Configurator_export.h: + * DAnCE/CIAO_ComponentServer/Config_Manager.h: + * DAnCE/CIAO_ComponentServer/Server_Configurator.h: + * DAnCE/CIAO_ComponentServer/Server_Configurator.cpp: + + Removed these files. + + Sat Mar 8 19:45:47 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.mpc: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.cpp: + * DAnCE/CIAO_ComponentServer/ComponentServer_Configurator_export.h: + * DAnCE/CIAO_ComponentServer/Config_Manager.h: + * DAnCE/CIAO_ComponentServer/Configurator_Factory.h: + * DAnCE/CIAO_ComponentServer/Configurator_Factory.cpp: + * DAnCE/CIAO_ComponentServer/Server_Configurator.h: + * DAnCE/CIAO_ComponentServer/Server_Configurator.cpp: + + Fleshed out the container implementation a bit, pulled in some elements for + RTCORBA configuration from the trunk NodeApplication. + + * ciao/CCM_Core.mpc: + * ciao/CIAO_ServerResources.idl: + + Server resources IDL pulled in from trunk. + + Fri Mar 7 03:39:10 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * CIAO_TAO_DAnCE.mwc: + + Added DII libraries for attribute setter. + + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.idl: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.mpc: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.h: + * DAnCE/Cdmw/CDMW_IDL.idl: + * DAnCE/ComponentServer/ComponentServer.idl: + * DAnCE/ComponentServer/ComponentServer_Client.idl: + * DAnCE/DomainApplication/DomainApplication.mpc: + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager.mpc: + * DAnCE/Logger/File_Logger_Backend.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplication/ServerActivator_Impl.cpp: + * DAnCE/NodeManager/NodeManager.mpc: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Starter/Starter.cpp: + * ciao/CIAO_Logger/File_Logger_Backend.h: + * ciao/CIAO_Logger/File_Logger_Backend.cpp: + * tools/Config_Handlers/XML_Typedefs.h: + + VC8 compiler error/warnings. + + Thu Mar 6 18:24:12 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/dance_component_server_svnt.mpb: + + Adding this long missing base project. + + Thu Mar 6 17:45:05 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/CIAO_ComponentServer/CIAO_CS_Client.idl: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.idl: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ServerActivator_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_ServerActivator_Impl.cpp: + + Component Server implementation, no-op implementations + for all servants. + + * DAnCE/ComponentServer/ComponentServer_Client.idl: + + Added newline at end of file. + + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + + Warning fix. + + * MPC/config/ciao.mpb: + * MPC/config/ciao_exe.mpb: + * MPC/config/ciao_lib.mpb: + + Added ciao base projects to mirror dance base projects of similar name. + They are currently identical, but will be changed when the directory + restructuring proposal comes to consensus. + + * ciao/CIAO_Logger: + * ciao/CIAO_Logger/CIAOLoggerFactory.h: + * ciao/CIAO_Logger/CIAO_Logger_Export.h: + * ciao/CIAO_Logger/File_Logger_Backend.h: + * ciao/CIAO_Logger/File_Logger_Backend.cpp: + * ciao/CIAO_Logger/Logger.mpc: + * ciao/CIAO_Logger/Logger_Service.h: + * ciao/CIAO_Logger/Logger_Service.cpp: + + CIAO logger based on logger implemented for DAnCE. + + * ciao/CIAO_common.h: + + Added CLINFO define, which provides the default decorators + for all CIAO logging messages. + + Thu Mar 6 05:52:09 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/CIAO_ComponentServer/CIAO_CS_Client.idl: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.idl: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer.mpc: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_Impl.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_stub_export.h: + * DAnCE/CIAO_ComponentServer/CIAO_ComponentServer_svnt_export.h: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_Container_Impl.cpp: + * DAnCE/CIAO_ComponentServer/CIAO_ServerActivator_Impl.h: + * DAnCE/CIAO_ComponentServer/CIAO_ServerActivator_Impl.cpp: + * MPC/config/ciao_componentserver_stub.mpb + + Implementation skeletons for the CIAO component server. + + * DAnCE/ComponentServer/ComponentServer.idl: + * DAnCE/ComponentServer/ComponentServer.mpc: + * DAnCE/ComponentServer/ComponentServer_Base.idl: + * DAnCE/ComponentServer/ComponentServer_Client.idl: + + Refactored for some preliminary footprint optimizations. + + Wed Mar 5 16:48:16 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * tools/IDL3_to_IDL2/CdmwBE.cpp: + * tools/IDL3_to_IDL2/CdmwBEExtern.hpp: + * tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc: + * tools/IDL3_to_IDL2/be_extern.h: + * tools/IDL3_to_IDL2/be_init.cpp: + + Fixed to comply with new interfaces exptected by the IDL + compiler. Thanks to Jeff Parsons for the fixes. + + Wed Mar 5 16:09:13 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * ChangeLog: + + Cleared out non-branch changelog entries. + + Wed Mar 5 16:06:07 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + * DAnCE/Starter/Starter.cpp: + * tools/Config_Handlers/Basic_Deployment_Data.cpp: + * tools/Config_Handlers/XMI.cpp: + + Warning fixes. + + Tue Mar 4 22:29:37 UTC 2008 William R. Otte <wotte@dre.vanderbilt.eduC> + + * DAnCE/Cdmw/CDMW_Deployment.idl: + * DAnCE/Cdmw/CDMW_IDL.idl: + * DAnCE/Cdmw/CDMW_IDL.mpc: + * DAnCE/Cdmw/CDMW_IDL_Ext.idl: + * DAnCE/ComponentServer: + * DAnCE/ComponentServer/ComponentServer.idl: + * DAnCE/ComponentServer/ComponentServer.mpc: + * DAnCE/ComponentServer/DAnCE_ComponentServer_stub_export.h: + * DAnCE/ComponentServer/DAnCE_ComponentServer_svnt_export.h: + * DAnCE/NodeApplication/NodeApplication.mpc: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/ServerActivator_Impl.h: + * MPC/config/dance_component_server.mpb: + * MPC/config/dance_component_server_stub.mpb: + * ciao/Session_Container.cpp: + + Refactored generic component server interface into its + own directory and IDL files. + + * DAnCE/Logger/File_Logger_Backend.h: + * DAnCE/Logger/File_Logger_Backend.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * tools/Config_Handlers/ADD_Handler.cpp: + * tools/Config_Handlers/Config_Handlers.mpc: + * tools/Config_Handlers/DnC_Dump.h: + * tools/Config_Handlers/DnC_Dump.cpp: + * tools/Config_Handlers/IDD_Handler.cpp: + * tools/Config_Handlers/MDD_Handler.cpp: + * tools/Config_Handlers/Package_Handlers/SID_Handler.cpp: + + Changes necessary to cope with changes in ACE/TAO. + + * MPC/config/dance_deployment_stub.mpb: + * MPC/config/dance_deployment_svnt.mpb: + + Pulled over from OFDAnCE. + + * ciao/CCM_Core.mpc: + * ciao/CCM_Home.idl: + * ciao/ConfigValue.h: + * ciao/ConfigValue.cpp: + + Add an IDL type and config value factory from OFDAnCE. + + + * tools/IDL3_to_IDL2/CdmwBE.cpp: + * tools/IDL3_to_IDL2/CdmwBEExtern.hpp: + * tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc: + + Some changes here I can't figure out, need Jeff to look. + Disabled until then. + + * tools/XML: + * tools/XML/CIAO_XML_Utils_Export.h: + * tools/XML/XML.mpc: + * tools/XML/XML_Error_Handler.h: + * tools/XML/XML_Error_Handler.cpp: + * tools/XML/XML_Helper.h: + * tools/XML/XML_Helper.tpp: + * tools/XML/XML_Schema_Resolver.h: + * tools/XML/XML_Schema_Resolver.cpp: + * tools/XML/XML_Schema_Resolver.tpp: + * tools/XML/XercesString.h: + * tools/XML/XercesString.cpp: + * MPC/config/ciao_config_handlers.mpb: + * MPC/config/ciao_config_handlers_base.mpb: + + Pulled XML utils over from OFDAnCE, missed in initial import. + + Tue Mar 4 05:39:19 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * MPC/config/ciao_config_manager.mpb: + * MPC/config/ciao_domainapplicationmanager_dnc.mpb: + * MPC/config/ciao_executionmanager_stub.mpb: + * MPC/config/ciao_nodeapplication.mpb: + * MPC/config/ciao_nodemanager_stub.mpb: + * MPC/config/ciao_noop_configurator.mpb: + * MPC/config/ciao_servant_dnc.mpb: + * MPC/config/ciao_server_dnc.mpb: + * MPC/config/ciaodll.mpb: + * MPC/config/dance_cdmw_idl.mpb: + * MPC/config/dance_deployment_stub.mpb: + * MPC/config/dance_deployment_svnt.mpb: + * MPC/config/dance_domain_application.mpb: + * MPC/config/dance_domain_application_manager.mpb: + * MPC/config/dance_exe.mpb: + * MPC/config/dance_executionmanager_stub.mpb: + * MPC/config/dance_extension_stub.mpb: + * MPC/config/dance_lib.mpb: + * MPC/config/dance_logger.mpb: + * MPC/config/dance_mocks.mpb: + * MPC/config/dance_node_application.mpb: + * MPC/config/dance_node_application_manager.mpb: + * MPC/config/dance_node_manager.mpb: + * MPC/config/dance_nodemanager_stub.mpb: + * MPC/config/dance_redirection_service.mpb: + * MPC/config/dance_utils.mpb: + + Pulled necessary mpb files from OFDAnCE to allow generation of + makefiles. + + * ciao/CCM_Core.mpc: + + ciao_deployment_*.mpb changes to dance_deployment_*.mpb. + + Tue Mar 4 05:19:46 UTC 2008 William Otte <wotte@william-ottes-macbook-pro.local> + + * MPC/config: + recovered from trunk. + + Tue Mar 4 05:10:21 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu> + + * DAnCE/DomainApplication/Domain_Application_Impl.h: + * DAnCE/DomainApplication/Domain_Application_Impl.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Impl.h: + * DAnCE/ExecutionManager/ExecutionManager_Impl.cpp: + * DAnCE/ExecutionManager/ExecutionManager_Module.h: + * DAnCE/ExecutionManager/ExecutionManager_Module.cpp: + * DAnCE/NodeApplication/ComponentInstallation_Impl.h: + * DAnCE/NodeApplication/ComponentInstallation_Impl.cpp: + * DAnCE/NodeApplication/NodeApplication_Impl.h: + * DAnCE/NodeApplication/NodeApplication_Impl.cpp: + * DAnCE/NodeApplication/ServerActivator_Impl.h: + * DAnCE/NodeApplication/ServerActivator_Impl.cpp: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h: + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp: + * DAnCE/NodeManager/NodeManager_Impl.h: + * DAnCE/NodeManager/NodeManager_Impl.cpp: + * DAnCE/NodeManager/Node_Manager_Module.h: + * DAnCE/NodeManager/Node_Manager_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.h: + * DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp: + * DAnCE/RedirectionService/CCMObjectLocator.h: + * DAnCE/RedirectionService/CCMObjectLocator.cpp: + * DAnCE/tests/MocksTest/MockObjectHome.h: + * DAnCE/tests/MocksTest/MockObjectHome.cpp: + * DAnCE/tests/NameServiceTest/DummyImpl.h: + * DAnCE/tests/NameServiceTest/DummyImpl.cpp: + * DAnCE/tests/ObjectLocatorTest/DummyImpl.h: + * DAnCE/tests/ObjectLocatorTest/DummyImpl.cpp: + * DAnCE/tests/RedirectionServiceTest/DummyImpl.h: + * DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp: + + Removed emulated exception macros using rm_exception_macros.pl + + Tue Mar 4 03:48:11 UTC 2008 William Otte <wotte@william-ottes-macbook-pro.local> + + * DAnCE: + * tools: + * docs/schema: + + Imports from OFDAnCE. + + Tue Mar 4 03:24:45 UTC 2008 William Otte <wotte@william-ottes-macbook-pro.local> + + * DAnCE: + * tools: + * docs/schema: + * MPC/config: + + Remove to make way for versions from OFDAnCE. + Wed Feb 11 07:21:28 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * tools/Config_Handlers/XSCRT/Elements.hpp: @@ -10,7 +4825,7 @@ Tue Feb 10 05:39:28 UTC 2009 Phil Mesnier <mesnier_p@ociweb.com> Mon Feb 09 12:01:28 CST 2009 Phil Mesnier <mesnier_p@ociweb.com> - * CIAO version 0.6.8 released. + * CIAO version 0.6.8 released. Fri Jan 30 11:59:52 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> diff --git a/CIAO/DAnCE/Deployment.mwc b/CIAO/DAnCE/Deployment.mwc index fcf95d10967..88629dd7dd3 100644 --- a/CIAO/DAnCE/Deployment.mwc +++ b/CIAO/DAnCE/Deployment.mwc @@ -1,4 +1,11 @@ // $Id$ workspace { + $(CIAO_ROOT)/ciao/CCM_Client.mpc + $(CIAO_ROOT)/tools/. + ./. + exclude { + ./Mocks + ./tests/MocksTest + } } diff --git a/CIAO/DAnCE/Deployment/CIAO_NodeApplication_CallBack.idl b/CIAO/DAnCE/Deployment/CIAO_NodeApplication_CallBack.idl deleted file mode 100644 index b68fa81bf78..00000000000 --- a/CIAO/DAnCE/Deployment/CIAO_NodeApplication_CallBack.idl +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -/** - * This IDL file is used to combine the NodeApplication - * interface with the NodeApplicationManager interface. - * - * NodeApplicationManager will be spawn NodeApplication. - * The call back object will be used to get the objectref of - * NodeApplication. - */ - -#include "DAnCE/Deployment/Deployment_NodeApplication.idl" -#include "DAnCE/Deployment/Deployment_NodeApplicationManager.idl" - -module CIAO -{ - interface NodeApplication_Callback - { - Deployment::NodeApplicationManager - register_node_application (in Deployment::NodeApplication na, - out Deployment::Properties properties); - }; -}; diff --git a/CIAO/DAnCE/Deployment/CIAO_ServerResources.idl b/CIAO/DAnCE/Deployment/CIAO_ServerResources.idl deleted file mode 100644 index 75eb8880d07..00000000000 --- a/CIAO/DAnCE/Deployment/CIAO_ServerResources.idl +++ /dev/null @@ -1,266 +0,0 @@ -// $Id$ - -/** - * @file CIAO_ServerResources.idl - * - * @brief A collection of IDL data types for - * - * @author Nanbor Wang - */ - -#if !defined (CIAO_SERVERRESOURCES_IDL) -#define CIAO_SERVERRESOURCES_IDL - -#include <orb.idl> - -module CIAO -{ - module DAnCE - { - /** - * @brief A single command line argument corresponds to a string as - * in the case of "argv". - */ - typedef string CommandlineArg; - /** - * @brief A list of command line arguments which a - * NodeApplicationManager will use to start up the NodeApplication - * this list is associated to. The command line arguments will be - * appended to the command line in order. - */ - typedef sequence<CommandlineArg> CommandlineArgs; - - /** - * @brief A string containing the filename of the svc.conf file the - * NodeApplication uses. The current approach of specifying - * svc.conf filename directly some harder problems such as - * distribution of svc.conf files and the relative/absolute path to - * the svc.conf file (the ServerResrouces xml document will have to - * assume the svc.conf file will be available at specific location.) - */ - typedef string SvcconfURI; - - /** - * @brief enumeration of ORB Resource Types (ORT) supported in RT - * extension. - */ - enum ORBResourceType - { - ORT_THREADPOOL, - ORT_THREADPOOLWITHLANES, - ORT_CONNECTIONBANDS - }; - - typedef short Priority; - - /** - * @brief Define a threadpool resource that an ORB must provide - */ - struct ORS_Threadpool - { - string Id; - unsigned long stacksize; - unsigned long static_threads; - unsigned long dynamic_threads; - Priority default_priority; - boolean allow_request_buffering; - unsigned long max_buffered_requests; - unsigned long max_request_buffer_size; - }; - - typedef sequence<ORS_Threadpool> ORS_ThreadpoolSeq; - - /** - * @brief Defines the configuration of a threadpool lane. We need - * to redefine it here to avoid dependency to RTCORBA library. - */ - struct ORS_ThreadpoolLane - { - Priority lane_priority; - unsigned long static_threads; - unsigned long dynamic_threads; - }; - - /** - * @brief Defines a set of threadpool lanes. We need - * to redefine it here to avoid dependency to RTCORBA library. - */ - typedef sequence<ORS_ThreadpoolLane> ORS_ThreadpoolLanes; - - /** - * @brief Defines a Threadpool with Lanes resource that an ORB - * must provide. - */ - struct ORS_ThreadpoolWithLanes - { - string Id; - unsigned long stacksize; - ORS_ThreadpoolLanes threadpool_lanes; - boolean allow_borrowing; - boolean allow_request_buffering; - unsigned long max_buffered_requests; - unsigned long max_request_buffer_size; - }; - - typedef sequence<ORS_ThreadpoolWithLanes> ORS_ThreadpoolWithLanesSeq; - - /** - * @brief Define a priority band for BandedConnection policies. - */ - struct ORS_PriorityBand - { - Priority low; - Priority high; - }; - /** - * @brief Define a list of priority bands for BandedConnection - * policies. - */ - typedef sequence<ORS_PriorityBand> ORS_PriorityBands; - - /** - * @brief Define the information needed to create a - * BandedConnection policy. This info can be referred to via its - * name (Id). - */ - struct ORS_ConnectionBands - { - string Id; - ORS_PriorityBands bands; - }; - - typedef sequence<ORS_ConnectionBands> ORS_ConnectionBandsSeq; - - /** - * @brief Collection of resources managed by the NodeApplication - * ORB. - */ - struct ORBResource - { - ORS_ThreadpoolSeq threadpool_list; - - ORS_ThreadpoolWithLanesSeq threadpool_with_lanes_list; - - ORS_ConnectionBandsSeq connection_bands_list; - }; - - typedef sequence<ORBResource, 1> ORBResources; - - // ================================================================= - - /** - * @brief PolicyType supported by DAnCE extension. Again, we are - * redefining these value to avoid dependencies to various ORB - * modules such as RTCORBA and DiffServ policy libraries. - */ - const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE = 40; - const CORBA::PolicyType THREADPOOL_POLICY_TYPE = 41; - const CORBA::PolicyType PRIORITY_BANDED_CONNECTION_POLICY_TYPE = 45; - const CORBA::PolicyType CLIENT_NETWORK_PRIORITY_TYPE = 86; - const CORBA::PolicyType NETWORK_PRIORITY_TYPE = 87; - - enum PriorityModel - { - CLIENT_PROPAGATED, - SERVER_DECLARED - }; - - enum NWPriorityModel - { - CLIENT_PROPAGATED_NWPRIORITY, - SERVER_DECLARED_NWPRIORITY - }; - - /** - * @brief Defines data required for creating a PriorityModel Policy - */ - struct PriorityModelPolicyDef - { - PriorityModel priority_model; - Priority server_priority; - }; - - /** - * @brief Defines data required for creating a server side DiffServ policy - */ - struct NWPriorityModelPolicyDef - { - NWPriorityModel nw_priority_model; - long request_dscp; - long reply_dscp; - }; - - /** - * @brief Defines data required for creating a client side DiffServ policy - */ - struct CNWPriorityModelPolicyDef - { - long request_dscp; - long reply_dscp; - }; - - /** - * @brief Define data required for creating a Threadpool policy - */ - struct ThreadpoolPolicyDef - { - string Id; // Threadpool name defined in - // ORBResource - }; - - /** - * @brief Define data required for creating a PriorityBandedConnection - * policy - */ - struct PriorityBandedConnectionPolicyDef - { - string Id; // PriorityBands name defined in - // ORBResource - }; - - union PolicyDef switch (CORBA::PolicyType) - { - case 40: PriorityModelPolicyDef PriorityModelDef; - case 41: ThreadpoolPolicyDef ThreadpoolDef; - case 45: PriorityBandedConnectionPolicyDef PriorityBandedConnectionDef; - case 86: CNWPriorityModelPolicyDef CNWPriorityModelDef; - case 87: NWPriorityModelPolicyDef NWPriorityModelDef; - }; - - /** - * @brief Define a set of policy definitions. - */ - typedef sequence<PolicyDef> PolicyDefs; - - /** - * @brief A policy set is named. - */ - struct PolicySet - { - string Id; // Name of this policy set - PolicyDefs policies; - }; - - /** - * @brief A list of all policy sets. - */ - typedef sequence<PolicySet> PolicySets; - - struct ORBConfigs - { - ORBResources orb_resources; - PolicySets policy_set; - }; - - struct ServerResource - { - string Id; - - CommandlineArgs args; - SvcconfURI svcconf; - ORBConfigs orb_config; - }; - }; -}; - -#endif /* CIAO_SERVERRESOURCES_IDL */ diff --git a/CIAO/DAnCE/Deployment/DAnCE_Core.mpc b/CIAO/DAnCE/Deployment/DAnCE_Core.mpc index 092cddb0526..579f948acce 100644 --- a/CIAO/DAnCE/Deployment/DAnCE_Core.mpc +++ b/CIAO/DAnCE/Deployment/DAnCE_Core.mpc @@ -1,26 +1,19 @@ // -*- MPC -*- // $Id$ - -// Valuetype library must be linked for this project. -// Please don't remove. -project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, ciao_events_base_dnc, ciao_client_dnc, messaging { - sharedname = CIAO_Deployment_stub - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - +project(Deployment_IDL) : taolib_with_idl, tao_output, valuetype, gen_ostream { + custom_only = 1 idlflags += -Wb,stub_export_macro=Deployment_stub_Export idlflags += -Wb,stub_export_include=Deployment_stub_export.h idlflags += -Wb,skel_export_macro=Deployment_svnt_Export idlflags += -Wb,skel_export_include=Deployment_svnt_export.h - - dynamicflags = DEPLOYMENT_STUB_BUILD_DLL + idlflags += -I$(CIAO_ROOT) IDL_Files { idlflags += -SS -Sci Deployment_Packaging_Data.idl Deployment_PlanError.idl + DAnCE_Properties.idl } IDL_Files { @@ -30,8 +23,6 @@ project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, c Deployment_Data.idl Deployment_DeploymentPlan.idl Deployment_TargetData.idl - Deployment_Events.idl - CIAO_ServerResources.idl } IDL_Files { @@ -41,25 +32,35 @@ project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, c } IDL_Files { - idlflags += -GH - Deployment_DomainApplicationManager.idl - } - - IDL_Files { Deployment_ResourceCommitmentManager.idl Deployment_TargetManager.idl - CIAO_NodeApplication_CallBack.idl Deployment_Core.idl Deployment_NodeApplication.idl Deployment_Application.idl - Deployment_Container.idl Deployment.idl Deployment_NodeManager.idl + Deployment_DomainApplicationManager.idl Deployment_DomainApplication.idl Deployment_ExecutionManager.idl Deployment_RepositoryManager.idl } +} + +// Valuetype library must be linked for this project. +// Please don't remove. +//project(Deployment_stub) : taolib_with_idl, valuetype, ifr_client, ciao_events_base_dnc, ccm_stub, messaging, ciao_lib { +project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, messaging, dance_lib, dance_logger, gen_ostream { + sharedname = DAnCE_Deployment_stub + after += Deployment_IDL + + // This is necessary for MPC to pull in rules.ciao.GNU + includes += $(CIAO_ROOT) + + dynamicflags = DEPLOYMENT_STUB_BUILD_DLL + + IDL_Files { + } Source_Files { Deployment_CoreC.cpp Deployment_BaseC.cpp @@ -69,7 +70,6 @@ project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, c Deployment_TargetDataC.cpp Deployment_NodeApplicationC.cpp Deployment_ApplicationC.cpp - Deployment_ContainerC.cpp Deployment_Packaging_DataC.cpp Deployment_PlanErrorC.cpp DeploymentC.cpp @@ -82,22 +82,17 @@ project(Deployment_stub) : taolib_with_idl, tao_output, valuetype, ifr_client, c Deployment_ExecutionManagerC.cpp Deployment_RepositoryManagerC.cpp Deployment_ResourceCommitmentManagerC.cpp - CIAO_NodeApplication_CallBackC.cpp - CIAO_ServerResourcesC.cpp - Deployment_EventsC.cpp + DAnCE_PropertiesC.cpp } } // CIAO_DnC_Client library must be linked for this project. -// Please don't remove. -project(Deployment_svnt) : taolib_with_idl, tao_output, portableserver, valuetype, ifr_client, ciao_deployment_stub, ciao_events_dnc, ciao_client_dnc, naming { - sharedname = CIAO_Deployment_svnt +// Please don't remove. dance_deployment_stub, +project(Deployment_svnt) : dance_deployment_stub, tao_output, taolib_with_idl, portableserver, valuetype, ifr_client, naming, dance_lib, dance_logger, messaging, gen_ostream { + sharedname = DAnCE_Deployment_svnt dynamicflags = DEPLOYMENT_SVNT_BUILD_DLL - idlflags += -Wb,stub_export_macro=Deployment_stub_Export - idlflags += -Wb,stub_export_include=Deployment_stub_export.h - idlflags += -Wb,skel_export_macro=Deployment_svnt_Export - idlflags += -Wb,skel_export_include=Deployment_svnt_export.h + after += Deployment_IDL // This is necessary for MPC to pull in rules.ciao.GNU includes += $(CIAO_ROOT) @@ -109,7 +104,6 @@ project(Deployment_svnt) : taolib_with_idl, tao_output, portableserver, valuetyp Deployment_CoreS.cpp Deployment_ApplicationS.cpp Deployment_NodeApplicationS.cpp - Deployment_ContainerS.cpp DeploymentS.cpp Deployment_RepositoryManagerS.cpp Deployment_NodeManagerS.cpp @@ -118,11 +112,8 @@ project(Deployment_svnt) : taolib_with_idl, tao_output, portableserver, valuetyp Deployment_DomainApplicationManagerS.cpp Deployment_DomainApplicationS.cpp Deployment_ExecutionManagerS.cpp - NodeApp_CB_Impl.cpp Deployment_TargetManagerS.cpp - CIAO_NodeApplication_CallBackS.cpp Deployment_ResourceCommitmentManagerS.cpp } } - diff --git a/CIAO/DAnCE/Deployment/DAnCE_Loader.h b/CIAO/DAnCE/Deployment/DAnCE_Loader.h new file mode 100644 index 00000000000..cf40a32c288 --- /dev/null +++ b/CIAO/DAnCE/Deployment/DAnCE_Loader.h @@ -0,0 +1,26 @@ +// $Id$ + +/** + * @file DAnCE_Loader.h + * Abstract class for DAnCE object loaders. + */ + +#ifndef DANCE_LOADDER_H_ +#define DANCE_LOADDER_H_ + +namespace DAnCE +{ + class DAnCE_Object_Loader : public TAO_Object_Loader + { + public: + /// Deliver a usage statement about the object. + virtual const char * usage (void) = 0; + + /// Parse args passed to it; is not destructive + virtual bool parse_args (int argc, ACE_TCHAR *argv []) = 0; + }; + + +} + +#endif diff --git a/CIAO/DAnCE/Deployment/DAnCE_Properties.idl b/CIAO/DAnCE/Deployment/DAnCE_Properties.idl new file mode 100644 index 00000000000..a93fcdc40af --- /dev/null +++ b/CIAO/DAnCE/Deployment/DAnCE_Properties.idl @@ -0,0 +1,43 @@ +/** + * $Id$ + * + * @file DAnCE_Properties.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Codifies properties used to configure the deployment engine. + */ + +module DAnCE +{ + // Home Configuration Properties + /// Describes the entrypoint for the home executor. Property value is string. + const string HOME_FACTORY = "home factory"; + + // Component Configuration Properties + /// Describes the entrypoint for the component executor. Property value is string. + const string COMPONENT_FACTORY = "component factory"; + /// Indicates that the component instance should be deployed using specified home ID. + /// Property value is string. + const string EXPLICIT_HOME = "edu.vanderbilt.dre.DAnCE.ExplicitHome"; + + // Instance (i.e., Home or Component) Properties + /// Indicates that the instance object reference should be registered in the + /// Instance naming context using a specified name. Property value is string. + const string REGISTER_NAMING = "edu.vanderbilt.dre.DAnCE.RegisterNaming"; + /// Indicates that the instance object reference should be printed to a specifid + /// file. Property value is string. + const string INSTANCE_IOR_FILE = "edu.vanderbilt.dre.DAnCE.InstanceIOR"; + // const string REGISTER_PORT_NAMING = "edu.vanderbilt.dre.DAnCE.RegisterPortNaming"; + + // Node Infrastructure Configuration + /// Indicates that the NodeManager is running as a standalone entity. + const string STANDALONE_NM = "edu.vanderbilt.dre.DAnCE.StandaloneNM"; + /// Indicates the naming context for domain objects, which includes infrastructure + /// and redirection. + const string DOMAIN_NC = "edu.vanderbilt.dre.DAnCE.DomainNC"; + /// Indicates the naming context used for instance objects. + const string INSTANCE_NC = "edu.vanderbilt.dre.DAnCE.InstanceNC"; + + +}; + diff --git a/CIAO/DAnCE/Deployment/Deployment.idl b/CIAO/DAnCE/Deployment/Deployment.idl index ee3ea4df782..dabf69a0662 100644 --- a/CIAO/DAnCE/Deployment/Deployment.idl +++ b/CIAO/DAnCE/Deployment/Deployment.idl @@ -7,46 +7,31 @@ #include "DAnCE/Deployment/Deployment_PlanError.idl" module Deployment { - - exception InvalidProperty { - string name; - string reason; - }; - - // @@added - exception InvalidNodeExecParameter { - string name; - string reason; - }; - - // @@added - exception InvalidComponentExecParameter { - string name; - string reason; - }; - - // @@added - exception LastConfiguration { - }; - - exception NoSuchName { - }; - - exception InvalidReference { - }; - - /// Below exception types are CIAO specific - exception PlanNotExist { - }; - - /// CIAO specific struct type used for shared component management - /// mapping the name of component to its plan_uuid - struct ComponentPlan - { - string name; - string plan_uuid; - }; - typedef sequence < ComponentPlan > ComponentPlans; + exception InvalidProperty { + string name; + string reason; + }; + + exception InvalidNodeExecParameter { + string name; + string reason; + }; + + exception InvalidComponentExecParameter { + string name; + string reason; + }; + + exception NoSuchName { + }; + + exception LastConfiguration { + }; + + exception InvalidReference { + }; + //@! in DOCGroup added 1 additional exception and one structure }; #endif /* DEPLOYMENT_IDL */ + diff --git a/CIAO/DAnCE/Deployment/Deployment_Application.idl b/CIAO/DAnCE/Deployment/Deployment_Application.idl index e045d0ca849..4ef117a6546 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Application.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Application.idl @@ -1,39 +1,32 @@ // $Id$ -#if !defined (DEPLOYMENT_APPLICATION_IDL) +#ifndef DEPLOYMENT_APPLICATION_IDL #define DEPLOYMENT_APPLICATION_IDL #include "DAnCE/Deployment/Deployment_Connection.idl" module Deployment { - exception StartError - { - string name; - string reason; - }; + exception StartError { + string name; + string reason; + }; - exception InvalidConnection - { - string name; - string reason; - }; + exception InvalidConnection { + string name; + string reason; + }; - interface Application - { - // @@changed - // void finishLaunch (in Connections providedReference, - // in boolean start) - // raises (StartError, InvalidConnection); - - void finishLaunch (in Connections providedReference, - in boolean start, - in boolean is_ReDAC) - raises (StartError, InvalidConnection); - void start () - raises (StartError); - }; - typedef sequence < Application > Applications; + interface Application { + //@! in DOCGroup has additional parameter + void finishLaunch (in Connections providedReference, in boolean start) + raises (StartError, InvalidConnection); + + void start () + raises (StartError); + }; + + typedef sequence < Application > Applications; }; #endif /* DEPLOYMENT_APPLICATION_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_ApplicationManager.idl b/CIAO/DAnCE/Deployment/Deployment_ApplicationManager.idl index c7f5a1957d1..6f35ae0bcb7 100644 --- a/CIAO/DAnCE/Deployment/Deployment_ApplicationManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_ApplicationManager.idl @@ -6,6 +6,7 @@ #include "DAnCE/Deployment/Deployment.idl" module Deployment { + exception ResourceNotAvailable { string name; string resourceType; @@ -15,13 +16,15 @@ module Deployment { }; interface ApplicationManager { - /// @todo Spec mentions another few exceptions in the raises cluase - // @@changed - Application startLaunch (in Properties configProperty, - out Connections providedReference, - in boolean start) - raises (ResourceNotAvailable, StartError, InvalidProperty, - InvalidNodeExecParameter, InvalidComponentExecParameter); + //@! in DOCGroup has additional parameter + Application startLaunch ( in Properties configProperty, + out Connections providedReference) + raises (ResourceNotAvailable, + StartError, + InvalidProperty, + InvalidNodeExecParameter, + InvalidComponentExecParameter); + void destroyApplication (in Application app) raises (StopError); }; diff --git a/CIAO/DAnCE/Deployment/Deployment_Base.idl b/CIAO/DAnCE/Deployment/Deployment_Base.idl index 0ae4a2748f6..c0db10ecb14 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Base.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Base.idl @@ -5,38 +5,38 @@ module Deployment { - struct Property - { - string name; - any value; - }; - typedef sequence < Property > Properties; - - // @@changed element order - struct Requirement { - string name; - string resourceType; - Properties property; - }; - - typedef sequence < Requirement > Requirements; - - enum SatisfierPropertyKind { - Quantity, - Capacity, - Minimum, - Maximum, - _Attribute, - Selection - }; - - struct SatisfierProperty { - string name; - SatisfierPropertyKind kind; - boolean dynamic; - any value; - }; - typedef sequence < SatisfierProperty > SatisfierProperties; + struct Property { + string name; + any value; + }; + + typedef sequence < Property > Properties; + + struct Requirement { + string name; + string resourceType; + Properties property; + }; + + typedef sequence < Requirement > Requirements; + + enum SatisfierPropertyKind { + Quantity, + Capacity, + Minimum, + Maximum, + _Attribute, + Selection + }; + + struct SatisfierProperty { + string name; + SatisfierPropertyKind kind; + boolean dynamic; + any value; + }; + + typedef sequence < SatisfierProperty > SatisfierProperties; }; #endif /* DEPLOYMENT_BASE_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_Connection.idl b/CIAO/DAnCE/Deployment/Deployment_Connection.idl index 0d6ac886ef1..d054e7e4602 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Connection.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Connection.idl @@ -1,50 +1,21 @@ // $Id$ -#if !defined (DEPLOYMENT_CONNECTION_IDL) +#ifndef DEPLOYMENT_CONNECTION_IDL #define DEPLOYMENT_CONNECTION_IDL #include "DAnCE/Deployment/Deployment_DeploymentPlan.idl" -#include <ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl> +//@! From DOCGroup source +//#include "ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl" -// *************** Packaging and Deployment *************** module Deployment { - typedef sequence < Object > Endpoints; - //typedef Object Endpoint; - - // @@changed - // struct Connection - // { - // string name; - // Endpoints endpoint; - // }; - - // CIAO's specific <Connection> type defition. - // To avoid the connection info in the plan being passed to the - // local node and to make the implementation not very cumbersome - // I changed the connection struct to include some extra informations. - struct Connection - { - string instanceName; - string portName; - CCMComponentPortKind kind; - - string endpointInstanceName; // CIAO specific extension - string endpointPortName; // CIAO specific extension - - // the endpoints member is change to endpoint. - // Since we will not have more than 1 objref in there. - Object endpoint; - - // A wrapper facade interface to provision different event - // communication mechanisms, including RTEC, etc. - CIAO::CIAO_Event_Service event_service; - - // The properties of this connection, particularly useful - // to speicfy QoS properties of pub/sub service connections. - Properties config; - }; - - typedef sequence < Connection > Connections; + typedef sequence < Object > Endpoints; + //@! in DOCGroup this struct seriously extended + struct Connection { + string name; + Endpoints endpoint; + }; + + typedef sequence < Connection > Connections; }; #endif /* DEPLOYMENT_CONNECTION_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_Container.idl b/CIAO/DAnCE/Deployment/Deployment_Container.idl deleted file mode 100644 index 3e35cbae5b3..00000000000 --- a/CIAO/DAnCE/Deployment/Deployment_Container.idl +++ /dev/null @@ -1,93 +0,0 @@ -// $Id$ - -#if !defined (DEPLOYMENT_CONTAINER_IDL) -#define DEPLOYMENT_CONTAINER_IDL - -#include "DAnCE/Deployment/Deployment_Application.idl" -#include "DAnCE/Deployment/Deployment_Core.idl" - -// *************** Packaging and Deployment *************** -module Deployment -{ - interface NodeApplication; // Forward decl. - - /// CIAO specific - struct Component_Info - { - string component_instance_name; - Components::CCMObject component_ref; - }; - - /// CIAO specific - typedef sequence < Component_Info > ComponentInfos; - - /// CIAO specific - struct ComponentImplementationInfo - { - string component_instance_name; - string executor_dll; - string executor_entrypt; - string servant_dll; - string servant_entrypt; - Properties component_config; - // Properties home_config; //ignored for now. - }; - - /// CIAO specific - typedef sequence <ComponentImplementationInfo> ComponentImplementationInfos; - - // ContainerImplementationInfo contains a list of components to be installed and - // policy configuration for the container which hosts these components - /// CIAO specific - struct ContainerImplementationInfo - { - ComponentImplementationInfos impl_infos; - Properties container_config; - }; - - /// CIAO specific - typedef sequence <ContainerImplementationInfo> ContainerImplementationInfos; - - /// CIAO specific interface, which could deal with installing multiple - /// containers into a single NodeApplication. - interface Container - { - readonly attribute ::Deployment::Properties properties; - - /// Get the NodeApplication which created us - NodeApplication get_node_application (); - - /// Initialize the container with policies - // long init (in ::CORBA::PolicyList policies); - - // NW: The following should be component specific info because the - // container has already been created and initialized at this - // time. So there's not much container configuration to be done - // at this stage. - //@@ The container_impl_info will contain - //1 component instance name as the key. - //2 dll/so name of the exec - //3 entry point of the exec - //4 dll/so name of the svnt - //5 entry point of the svnt - //6 Poosible other configuration for container/home/component - - /// Install all homes and components - Deployment::ComponentInfos install (in ContainerImplementationInfo container_impl_info) - raises (UnknownImplId, - ImplEntryPointNotFound, - InstallationFailure, - ::Components::InvalidConfiguration); - - /// Remove all homes and components - void remove () - raises (::Components::RemoveFailure); - - /// Remove a component instance - void remove_component (in string inst_name) - raises (::Components::RemoveFailure); - }; - - typedef sequence<Container> Containers; -}; -#endif /* DEPLOYMENT_CONTAINER_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_Core.idl b/CIAO/DAnCE/Deployment/Deployment_Core.idl index d6c32e010a9..1c1dcddc9ad 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Core.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Core.idl @@ -1,49 +1,20 @@ // $Id$ -#if !defined (DEPLOYMENT_CORE_IDL) +#ifndef DEPLOYMENT_CORE_IDL #define DEPLOYMENT_CORE_IDL -#include "ciao/CCM_Component.idl" +//#include "ciao/CCM_Component.idl" #include "DAnCE/Deployment/Deployment_TargetData.idl" #include "DAnCE/Deployment/Deployment_Data.idl" #include "DAnCE/Deployment/Deployment_Application.idl" -// *************** Packaging and Deployment *************** -module Deployment -{ - // Typeprefix Components "omg.org"; - // OMG threw these things away, didn't it. +module Deployment { - /// CIAO specific - exception UnknownImplId - { - string name; - string reason; - }; - - /// CIAO specific - exception InstallationFailure - { - string name; - string reason; - }; - - /// CIAO specific - exception ImplEntryPointNotFound - { - string name; - string reason; - }; - - /** - * The StopError exception is raised if a problem occurred while terminating - * an application, either during the terminate operation of the - * ApplicationManager or during the destroyManager operation of the - * ExecutionManager. - */ - exception StopError { - string name; - string reason; - }; + //@! in DOCGroup three additional exceptions specified + exception StopError { + string name; + string reason; + }; }; #endif /* DEPLOYMENT_CORE_IDL */ + diff --git a/CIAO/DAnCE/Deployment/Deployment_Data.idl b/CIAO/DAnCE/Deployment/Deployment_Data.idl index b452ebe3ad4..84fa9de5a42 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Data.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Data.idl @@ -6,40 +6,38 @@ #include "DAnCE/Deployment/Deployment_DeploymentPlan.idl" module Deployment { + //@! in DOCGroup requiredType has type string + struct ComponentPackageReference { + string requiredUUID; + string requiredName; + ComponentInterfaceDescription requiredType; + }; + + typedef sequence < ComponentPackageReference > ComponentPackageReferences; + + typedef sequence < ResourceUsageKind > ResourceUsageKinds; + + struct ImplementationRequirement { + ResourceUsageKinds resourceUsage; + string resourcePort; + string componentPort; + string name; + string resourceType; + Properties property; + }; + + typedef sequence < ImplementationRequirement > ImplementationRequirements; + + struct Capability { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; + + typedef sequence < Capability > Capabilities; - struct ComponentPackageReference { - string requiredUUID; - string requiredName; - - // @@changed - //ComponentInterfaceDescription requiredType; - - string requiredType; - }; - - typedef sequence < ComponentPackageReference > ComponentPackageReferences; - - typedef sequence < ResourceUsageKind > ResourceUsageKinds; - - struct ImplementationRequirement { - ResourceUsageKinds resourceUsage; - string resourcePort; - string componentPort; - // @@ changed: order of name and resourceType - string name; - string resourceType; - Properties property; - }; - - typedef sequence < ImplementationRequirement > ImplementationRequirements; - - struct Capability { - string name; - ::CORBA::StringSeq resourceType; - SatisfierProperties property; - }; - - typedef sequence < Capability > Capabilities; }; #endif /* DEPLOYMENT_DATA_IDL */ + + diff --git a/CIAO/DAnCE/Deployment/Deployment_DeploymentPlan.idl b/CIAO/DAnCE/Deployment/Deployment_DeploymentPlan.idl index 248a61b75d2..e56d00f99e8 100644 --- a/CIAO/DAnCE/Deployment/Deployment_DeploymentPlan.idl +++ b/CIAO/DAnCE/Deployment/Deployment_DeploymentPlan.idl @@ -9,220 +9,200 @@ #include "tao/Typecode_types.pidl" module Deployment { - - enum CCMComponentPortKind - { - Facet, - SimplexReceptacle, - MultiplexReceptacle, - EventEmitter, - EventPublisher, - EventConsumer - }; - - struct ComponentPortDescription { - string name; - string specificType; - ::CORBA::StringSeq supportedType; - boolean provider; - boolean exclusiveProvider; - boolean exclusiveUser; - boolean optional; - CCMComponentPortKind kind; - }; - - typedef sequence < ComponentPortDescription > ComponentPortDescriptions; - - struct ComponentPropertyDescription { - string name; - CORBA::TypeCode type; - }; - - typedef sequence < ComponentPropertyDescription > ComponentPropertyDescriptions; - - struct ComponentInterfaceDescription { - string label; - string UUID; - string specificType; - ::CORBA::StringSeq supportedType; - ::CORBA::StringSeq idlFile; - Properties configProperty; - ComponentPortDescriptions port; - ComponentPropertyDescriptions property; - Properties infoProperty; - }; - - struct MonolithicDeploymentDescription { - string name; - ::CORBA::StringSeq source; - ::CORBA::ULongSeq artifactRef; - // @@changed - // Properties nodeExecParameter; - Properties execParameter; - - // @@added - // Properties componentExecParameter; - - // @@delete: - Requirements deployRequirement; - }; - - typedef sequence < MonolithicDeploymentDescription > MonolithicDeploymentDescriptions; - - enum ResourceUsageKind { - None, - InstanceUsesResource, - ResourceUsesInstance, - PortUsesResource, - ResourceUsesPort - }; - - struct InstanceResourceDeploymentDescription { - ResourceUsageKind resourceUsage; - // @@added - //string resourcePort; - // @@added - //string componentPort; - - string requirementName; - string resourceName; - Properties property; - }; - - typedef sequence < InstanceResourceDeploymentDescription > InstanceResourceDeploymentDescriptions; - - struct InstanceDeploymentDescription { - string name; - string node; - ::CORBA::StringSeq source; - unsigned long implementationRef; - Properties configProperty; - InstanceResourceDeploymentDescriptions deployedResource; - InstanceResourceDeploymentDescriptions deployedSharedResource; - }; - - typedef sequence < InstanceDeploymentDescription > InstanceDeploymentDescriptions; - - struct ComponentExternalPortEndpoint { - string portName; - }; - - typedef sequence < ComponentExternalPortEndpoint > ComponentExternalPortEndpoints; - - struct PlanSubcomponentPortEndpoint { - string portName; - boolean provider; - CCMComponentPortKind kind; - unsigned long instanceRef; - }; - - typedef sequence < PlanSubcomponentPortEndpoint > PlanSubcomponentPortEndpoints; - - struct ExternalReferenceEndpoint { - string location; - // @@added - // boolean provider; - // @@added - // string portName; - // @@added - // ::CORBA::StringSeq supportedType; - }; - - typedef sequence < ExternalReferenceEndpoint > ExternalReferenceEndpoints; - - struct ConnectionResourceDeploymentDescription { - string targetName; - string requirementName; - string resourceName; - Properties property; - }; - - typedef sequence < ConnectionResourceDeploymentDescription > ConnectionResourceDeploymentDescriptions; - - struct PlanConnectionDescription { - string name; - ::CORBA::StringSeq source; - Requirements deployRequirement; - ComponentExternalPortEndpoints externalEndpoint; - PlanSubcomponentPortEndpoints internalEndpoint; - ExternalReferenceEndpoints externalReference; - ConnectionResourceDeploymentDescriptions deployedResource; - }; - - typedef sequence < PlanConnectionDescription > PlanConnectionDescriptions; - - struct PlanSubcomponentPropertyReference { - string propertyName; - unsigned long instanceRef; - }; - - typedef sequence < PlanSubcomponentPropertyReference > PlanSubcomponentPropertyReferences; - - struct PlanPropertyMapping { - string name; - ::CORBA::StringSeq source; - string externalName; - PlanSubcomponentPropertyReferences delegatesTo; - }; - - typedef sequence < PlanPropertyMapping > PlanPropertyMappings; - - struct ImplementationDependency { - string requiredType; - }; - - typedef sequence < ImplementationDependency > ImplementationDependencies; - - struct ResourceDeploymentDescription { - string requirementName; - string resourceName; - Properties property; - }; - - typedef sequence < ResourceDeploymentDescription > ResourceDeploymentDescriptions; - - struct ArtifactDeploymentDescription { - string name; - ::CORBA::StringSeq location; - string node; - ::CORBA::StringSeq source; - Properties execParameter; - - // @@delete: - Requirements deployRequirement; - - ResourceDeploymentDescriptions deployedResource; - }; - - typedef sequence < ArtifactDeploymentDescription > ArtifactDeploymentDescriptions; - - // @@added - enum PlanLocalityKind { - PlanSameProcess, - PlanDifferentProcess, - PlanNoConstraint - }; - - // @@added - struct PlanLocality { - PlanLocalityKind constraint; - ::CORBA::ULongSeq constrainedInstanceRef; - }; - - struct DeploymentPlan { - string label; - string UUID; - ComponentInterfaceDescription realizes; - MonolithicDeploymentDescriptions implementation; - InstanceDeploymentDescriptions instance; - PlanConnectionDescriptions connection; - PlanPropertyMappings externalProperty; - ImplementationDependencies dependsOn; - ArtifactDeploymentDescriptions artifact; - Properties infoProperty; - // @added - // PlanLocalities localityConstraint; - }; + enum CCMComponentPortKind { + Facet, + SimplexReceptacle, + MultiplexReceptacle, + EventEmitter, + EventPublisher, + EventConsumer + }; + + struct ComponentPortDescription { + string name; + string specificType; + ::CORBA::StringSeq supportedType; + boolean provider; + boolean exclusiveProvider; + boolean exclusiveUser; + boolean optional; + CCMComponentPortKind kind; + }; + + typedef sequence < ComponentPortDescription > ComponentPortDescriptions; + + struct ComponentPropertyDescription { + string name; + CORBA::TypeCode type; + }; + + typedef sequence < ComponentPropertyDescription > ComponentPropertyDescriptions; + + struct ComponentInterfaceDescription { + string label; + string UUID; + string specificType; + ::CORBA::StringSeq supportedType; + ::CORBA::StringSeq idlFile; + Properties configProperty; + ComponentPortDescriptions port; + ComponentPropertyDescriptions property; + Properties infoProperty; + }; + + struct MonolithicDeploymentDescription { + string name; + ::CORBA::StringSeq source; + ::CORBA::ULongSeq artifactRef; + Properties execParameter; + Requirements deployRequirement; + }; + + typedef sequence < MonolithicDeploymentDescription > MonolithicDeploymentDescriptions; + + enum ResourceUsageKind { + None, + InstanceUsesResource, + ResourceUsesInstance, + PortUsesResource, + ResourceUsesPort + }; + + struct InstanceResourceDeploymentDescription { + ResourceUsageKind resourceUsage; + string requirementName; + string resourceName; + Properties property; + }; + + typedef sequence < InstanceResourceDeploymentDescription > InstanceResourceDeploymentDescriptions; + + struct InstanceDeploymentDescription { + string name; + string node; + ::CORBA::StringSeq source; + unsigned long implementationRef; + Properties configProperty; + InstanceResourceDeploymentDescriptions deployedResource; + InstanceResourceDeploymentDescriptions deployedSharedResource; + }; + + typedef sequence < InstanceDeploymentDescription > InstanceDeploymentDescriptions; + + struct ComponentExternalPortEndpoint { + string portName; + }; + + typedef sequence < ComponentExternalPortEndpoint > ComponentExternalPortEndpoints; + + struct PlanSubcomponentPortEndpoint { + string portName; + boolean provider; + CCMComponentPortKind kind; + unsigned long instanceRef; + }; + + typedef sequence < PlanSubcomponentPortEndpoint > PlanSubcomponentPortEndpoints; + + //@! in DOCGroup provider, portName and supportesType are removed + struct ExternalReferenceEndpoint { + string location; + boolean provider; + string portName; + ::CORBA::StringSeq supportedType; + }; + + typedef sequence < ExternalReferenceEndpoint > ExternalReferenceEndpoints; + + struct ConnectionResourceDeploymentDescription { + string targetName; + string requirementName; + string resourceName; + Properties property; + }; + + typedef sequence < ConnectionResourceDeploymentDescription > ConnectionResourceDeploymentDescriptions; + + struct PlanConnectionDescription { + string name; + ::CORBA::StringSeq source; + Requirements deployRequirement; + ComponentExternalPortEndpoints externalEndpoint; + PlanSubcomponentPortEndpoints internalEndpoint; + ExternalReferenceEndpoints externalReference; + ConnectionResourceDeploymentDescriptions deployedResource; + }; + + typedef sequence < PlanConnectionDescription > PlanConnectionDescriptions; + + struct PlanSubcomponentPropertyReference { + string propertyName; + unsigned long instanceRef; + }; + + typedef sequence < PlanSubcomponentPropertyReference > PlanSubcomponentPropertyReferences; + + struct PlanPropertyMapping { + string name; + ::CORBA::StringSeq source; + string externalName; + PlanSubcomponentPropertyReferences delegatesTo; + }; + + typedef sequence < PlanPropertyMapping > PlanPropertyMappings; + + struct ImplementationDependency { + string requiredType; + }; + + typedef sequence < ImplementationDependency > ImplementationDependencies; + + struct ResourceDeploymentDescription { + string requirementName; + string resourceName; + Properties property; + }; + + typedef sequence < ResourceDeploymentDescription > ResourceDeploymentDescriptions; + + struct ArtifactDeploymentDescription { + string name; + ::CORBA::StringSeq location; + string node; + ::CORBA::StringSeq source; + Properties execParameter; + Requirements deployRequirement; + ResourceDeploymentDescriptions deployedResource; + }; + + typedef sequence < ArtifactDeploymentDescription > ArtifactDeploymentDescriptions; + + enum PlanLocalityKind { + PlanSameProcess, + PlanDifferentProcess, + PlanNoConstraint + }; + + struct PlanLocality { + PlanLocalityKind constraint; + ::CORBA::ULongSeq constrainedInstanceRef; + }; + //@! in DOCGroup not implemented + typedef sequence < PlanLocality > PlanLocalities; + //@! in DOCGroup localityConstraint is commented + struct DeploymentPlan { + string label; + string UUID; + ComponentInterfaceDescription realizes; + MonolithicDeploymentDescriptions implementation; + InstanceDeploymentDescriptions instance; + PlanConnectionDescriptions connection; + PlanPropertyMappings externalProperty; + ImplementationDependencies dependsOn; + ArtifactDeploymentDescriptions artifact; + Properties infoProperty; + PlanLocalities localityConstraint; + }; }; #endif /* DEPLOYMENT_DATA_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_DomainApplication.idl b/CIAO/DAnCE/Deployment/Deployment_DomainApplication.idl index 7781907bafe..5bc0941aca9 100644 --- a/CIAO/DAnCE/Deployment/Deployment_DomainApplication.idl +++ b/CIAO/DAnCE/Deployment/Deployment_DomainApplication.idl @@ -3,17 +3,16 @@ #ifndef DEPLOYMENT_DOMAINAPPLICATION_IDL #define DEPLOYMENT_DOMAINAPPLICATION_IDL -#include "Deployment_Application.idl" -#include "Deployment_Core.idl" +#include "DAnCE/Deployment/Deployment_Application.idl" +#include "DAnCE/Deployment/Deployment_Core.idl" module Deployment { - // @@added - interface DomainApplication : - Application - { - }; + interface DomainApplication : + Application + { + }; }; -#endif +#endif //DEPLOYMENT_DOMAINAPPLICATION_IDL diff --git a/CIAO/DAnCE/Deployment/Deployment_DomainApplicationManager.idl b/CIAO/DAnCE/Deployment/Deployment_DomainApplicationManager.idl index 9e0ab0eab52..37930364044 100644 --- a/CIAO/DAnCE/Deployment/Deployment_DomainApplicationManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_DomainApplicationManager.idl @@ -7,67 +7,17 @@ #include "DAnCE/Deployment/Deployment_ApplicationManager.idl" module Deployment { - // @@changed - // interface DomainApplicationManager : - // ApplicationManager - // { - // Applications getApplications (); - // DeploymentPlan getPlan (); - // }; - - /// CIAO 's DomainApplicationManager interface differs spec-defined interface - /// in the same that it also integrates the spec-defined interface for - /// DomainApplication into itself - /// This should be derived from ApplicationManager - interface DomainApplicationManager - { - DeploymentPlan getPlan (); - - /// This method is missing from CIAO but in the spec - /// Applications getApplications (); - - /// CIAO specific version of startLaunch implementation, this one - /// differs with spec-defined operation in the sense that it doesn't - /// return DomainApplication object reference. - void startLaunch (in Properties configProperty, in boolean start) - raises (ResourceNotAvailable, StartError, InvalidProperty); - - /// This method has CIAO specific arguments and is not spec compliant - void finishLaunch (in boolean start, - in boolean is_ReDAC) - raises (StartError, InvalidConnection); - - /// CIAO specific extension - void start () - raises (StartError); - - /// CIAO specific extention - /// Fetch NodeApplication based on the given node name - NodeApplication get_node_app (in string node_name) - raises (NoSuchName); - - /// CIAO specific extension, it differs with the spec defined one - /// for no input parameter. - void destroyApplication () - raises (StopError); - - /// CIAO specific extension to destroy NodeApplicationManager - void destroyManager () - raises (StopError); - - /// CIAO specific extension - /// Perform the actual redeployment and reconfiguration on the dommain level. - void perform_redeployment (in DeploymentPlan new_plan) - raises (PlanError, - InstallationFailure, - UnknownImplId, - ImplEntryPointNotFound, - InvalidConnection, - InvalidProperty, - ::Components::RemoveFailure); - }; - - typedef sequence < DomainApplicationManager > DomainApplicationManagers; + /// CIAO 's DomainApplicationManager interface differs spec-defined interface + /// in the same that it also integrates the spec-defined interface for + /// DomainApplication into itself + interface DomainApplicationManager : + ApplicationManager + { + Applications getApplications (); + DeploymentPlan getPlan (); + }; + + typedef sequence < DomainApplicationManager > DomainApplicationManagers; }; #endif /* DOMAINAPPLICATIONMANAGER_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_Events.idl b/CIAO/DAnCE/Deployment/Deployment_Events.idl deleted file mode 100644 index b0559dfe164..00000000000 --- a/CIAO/DAnCE/Deployment/Deployment_Events.idl +++ /dev/null @@ -1,95 +0,0 @@ -// $Id$ - -/** - * @file Deployment_Events.idl - * - * @brief A collection of IDL data types for CIAO pub/sub services deployment. - * - * @author Gan Deng - */ - -#if !defined (CIAO_DEPLOYMENT_EVENT_SERVICES_IDL) -#define CIAO_DEPLOYMENT_EVENT_SERVICES_IDL - -#include "tao/StringSeq.pidl" - -// EventServiceType definition -#include <ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl> - -module CIAO -{ - module DAnCE - { - /// Each element in the EventSourceSet denotes a event source id - typedef string EventSourceId; - - typedef sequence<EventSourceId> EventSourceSet; - - /// Event Filters - enum FilterType - { - CONJUNCTION, - DISJUNCTION, - LOGICAL_AND, - NEGATE - }; - - struct EventFilter - { - string name; - FilterType type; - EventSourceSet sources; - }; - typedef sequence<EventFilter> EventFilters; - - struct AddrServer - { - string name; - unsigned short port; - string address; - }; - typedef sequence<AddrServer> AddrServers; - - struct UDPSender - { - string name; - string addr_serv_id; - }; - typedef sequence<UDPSender> UDPSenders; - - struct UPDReceiver - { - string name; - string addr_serv_id; - boolean is_multicast; - unsigned short listen_port; - }; - typedef sequence<UPDReceiver> UPDReceivers; -/* - struct EventHandler - { - string name; - boolean is_multicast; - }; - typedef sequence<EventHandler> EventHandlers; - */ - - /// CIAO specific extension to describe pub/sub services in the deployment - struct EventServiceDeploymentDescription - { - string name; - string node; - EventServiceType type; - string svc_cfg_file; - - EventFilters filters; - AddrServers addr_servs; - UDPSenders senders; - UPDReceivers receivers; - }; - typedef sequence < EventServiceDeploymentDescription > - EventServiceDeploymentDescriptions; - }; -}; - -#endif /* CIAO_DEPLOYMENT_EVENT_SERVICES_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_ExecutionManager.idl b/CIAO/DAnCE/Deployment/Deployment_ExecutionManager.idl index 070b6a99100..00d415fde49 100644 --- a/CIAO/DAnCE/Deployment/Deployment_ExecutionManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_ExecutionManager.idl @@ -4,60 +4,18 @@ #include "DAnCE/Deployment/Deployment.idl" #include "DAnCE/Deployment/Deployment_DomainApplicationManager.idl" +#include "DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl" module Deployment { - // @@changed - // interface ExecutionManager - // { - // DomainApplicationManager preparePlan (in DeploymentPlan plan, - // in ResourceCommitmentManager resourceCommitment) - // raises (ResourceNotAvailable, PlanError, StartError); - // DomainApplicationManagers getManagers (); - // void destroyManager (in DomainApplicationManager manager) - // raises (StopError); - // }; - - interface ExecutionManager { - /// @todo ResourceCommitmentManger is missing - DomainApplicationManager preparePlan (in DeploymentPlan plan, - in boolean commitResources) - raises (ResourceNotAvailable, PlanError, StartError); - - DomainApplicationManagers getManagers (); - - void destroyManager (in DomainApplicationManager manager) - raises (StopError); - - /// CIAO Specific extension - DomainApplicationManager getManager (in string plan_uuid) - raises (PlanNotExist); - - /// CIAO specific extention - /// Destroy ApplicationManagers by plan_uuid, the unique semantics of this - /// operation lies in the fact that if some components are - /// still up and running, then the ApplicationManagers won't be destroyed. - void destroyManagerByPlan (in string plan_uuid) - raises (StopError); - - /// CIAO specific extention - /// "Get" operation, return the DeploymentPlan - DeploymentPlan getPlan (in string plan_uuid); - - /// CIAO specific operation to handle dynamic system redeployment - /// and reconfiguration - /// This operation could handle dynamic redeployment, and this - /// is the operation exposed to clients directly. Other - /// "perform_redeployment" operation defined on DAM and NA - /// are implementaion details within DAnCE. - void perform_redeployment (in DeploymentPlan new_plan) - raises (PlanError, - InstallationFailure, - UnknownImplId, - ImplEntryPointNotFound, - InvalidConnection, - InvalidProperty, - ::Components::RemoveFailure); - }; + //@! in DOCGroup this interface has significant extensions + interface ExecutionManager { + DomainApplicationManager preparePlan (in DeploymentPlan plan, + in ResourceCommitmentManager resourceCommitment) + raises (ResourceNotAvailable, PlanError, StartError); + DomainApplicationManagers getManagers (); + void destroyManager (in DomainApplicationManager manager) + raises (StopError); + }; }; #endif /* EXECUTIONMANAGER_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_NodeApplication.idl b/CIAO/DAnCE/Deployment/Deployment_NodeApplication.idl index f80dda55369..7e3900bd4dd 100644 --- a/CIAO/DAnCE/Deployment/Deployment_NodeApplication.idl +++ b/CIAO/DAnCE/Deployment/Deployment_NodeApplication.idl @@ -1,127 +1,19 @@ // $Id$ -#if !defined (DEPLOYMENT_NODEAPPLICATION_IDL) +#ifndef DEPLOYMENT_NODEAPPLICATION_IDL #define DEPLOYMENT_NODEAPPLICATION_IDL -#include "Deployment_Application.idl" -#include "Deployment_Core.idl" -#include "Deployment_Container.idl" -#include "Deployment_Events.idl" - -// *************** Packaging and Deployment *************** -module Deployment -{ - /// CIAO specific extension - /// This struct captures the installation information of a particular - /// CIAO_Event_Service, as defined in <ciaosvcs/Events/CIAO_Events.idl> - struct ESInstallationInfo - { - string id; - CIAO::EventServiceType type; - string svcconf; - //Properties es_config; - }; - - /// CIAO specific - struct NodeImplementationInfo - { - ContainerImplementationInfos impl_infos; - Properties nodeapp_config; - }; - - /// CIAO specific - typedef sequence<CIAO::CIAO_Event_Service> CIAO_Event_Services; - - /// CIAO specific extension - typedef sequence<ESInstallationInfo> ESInstallationInfos; - - // @@changed - //interface NodeApplication : Application - //{ - //}; - - interface NodeApplication : Application - { - /// CIAO specific extensions - readonly attribute ::Deployment::Properties properties; - - /// CIAO specific operation to handle dynamic system redeployment - /// and reconfiguration - /// @@ Initialize the nodeapplication, so it will know what - /// components it will create and home many of them are - /// there. However the real create action will take place when - /// start launch is called on NodeApplicationManager. - long init (); - - /// @@ This operation will be called by NodeApplicationManager - /// client to really start to create homes and components. - /// CIAO specific extensions - ComponentInfos install (in NodeImplementationInfo node_impl_info) - raises (UnknownImplId, - ImplEntryPointNotFound, - InstallationFailure, - ::Components::InvalidConfiguration, - ::Components::RemoveFailure); - - /// CIAO specific extension - /// This operation will create one or more CIAO_Event_Service objects - /// within the NodeApplication, which will be used to mediate the - /// communication of CCM events - CIAO::CIAO_Event_Service install_es ( - in CIAO::DAnCE::EventServiceDeploymentDescription es_info) - raises (InstallationFailure); - - /// CIAO specific extensions - ///@@ We know that Deployment::NodeApplicationManager will be returned, - /// however to avoid the size of the shared object of CIAO_Server. - /// we return an Object. - Object get_node_application_manager (); - - /// CIAO specific extension - Container create_container (in ::Deployment::Properties properties) - raises (::Components::CreateFailure, - ::Components::InvalidConfiguration); - - /// CIAO specific extension - void remove_container (in Container cref) - raises (::Components::RemoveFailure); - - /// CIAO specific extension - Containers get_containers (); - - /// CIAO specific extension - /// Remove a component instance from the NodeApplication - 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 (::Deployment::StartError); - - /// CIAO specific extensions - /// Passivate a component instance from the NodeApplication - void passivate_component (in string inst_name) - raises (::Components::RemoveFailure); - - /// Remove all containers, components and component homes. - /// Shuts down the ORB of the NodeApplication to terminate the process. - oneway void remove (); - - /// CIAO specific extension. This will enforce the component to - /// be activated (preactivate, activate, postactivated) before the assembly - /// is established - void ciao_preactivate () - raises (StartError); - - /// CIAO specific extension - void ciao_postactivate () - raises (StartError); - - /// CIAO specific extension - void ciao_passivate () - raises (StopError); - }; - +#include "DAnCE/Deployment/Deployment_Application.idl" +#include "DAnCE/Deployment/Deployment_Core.idl" +//#include "DAnCE/Deployment/Deployment_Container.idl" +//#include "DAnCE/Deployment/Deployment_Events.idl" + +module Deployment { + //@! in DOCGroup NodeApplication has a lot extensions and additional types + interface NodeApplication : + Application + { + }; }; -#endif /* DEPLOYMENT_CORE_IDL */ +#endif /* DEPLOYMENT_NODEAPPLICATION_IDL */ + diff --git a/CIAO/DAnCE/Deployment/Deployment_NodeApplicationManager.idl b/CIAO/DAnCE/Deployment/Deployment_NodeApplicationManager.idl index 9fc2aa09581..d0026d8408e 100644 --- a/CIAO/DAnCE/Deployment/Deployment_NodeApplicationManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_NodeApplicationManager.idl @@ -2,62 +2,15 @@ #ifndef NODEAPPLICATIONMANAGER_IDL #define NODEAPPLICATIONMANAGER_IDL -#include "Deployment_Core.idl" -#include "Deployment_ApplicationManager.idl" -#include "Deployment.idl" +#include "DAnCE/Deployment/Deployment_Core.idl" +#include "DAnCE/Deployment/Deployment_ApplicationManager.idl" +#include "DAnCE/Deployment/Deployment.idl" module Deployment { - /** - * CIAO specific structure to carry the scheduling params - * to set the process, required by RACE - * @struct Sched_Params - * @brief Carries Scheduling Params - */ - struct Sched_Params - { - long policy_; - long priority_; - long scope_; - long msec_; - }; - - // @@changed: - // interface NodeApplicationManager : - // ApplicationManager - // { - // }; - - interface NodeApplicationManager : - ApplicationManager - { - /// CIAO specific operation to handle dynamic system redeployment - /// and reconfiguration - /// This operation could handle dynamic redeployment for - /// a node-level deployment plan within a node - /// @param add_or_remove If true, we add new components only, vice vesa. - Application perform_redeployment (in Properties configProperty, - out Connections providedReference, - in boolean add_or_remove, - in boolean start) - raises (PlanError, - InstallationFailure, - UnknownImplId, - ImplEntryPointNotFound, - InvalidConnection, - InvalidProperty, - ::Components::RemoveFailure); - - /// CIAO specific operation to reset deployment plan - void reset_plan (in DeploymentPlan plan); - - /// CIAO specific operation to set the information of - /// "shared components" (through NodeManager) - void set_shared_components (in ComponentPlans components); - - /// CIAO specific function to set priority - /// of component, required by RACE - long set_priority (in string cid , in Sched_Params params); - }; + interface NodeApplicationManager : + ApplicationManager + { + }; }; #endif /* NODEAPPLICATIONMANAGER_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_NodeManager.idl b/CIAO/DAnCE/Deployment/Deployment_NodeManager.idl index 7c15dff0598..f70aca19928 100644 --- a/CIAO/DAnCE/Deployment/Deployment_NodeManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_NodeManager.idl @@ -5,66 +5,30 @@ #include "DAnCE/Deployment/Deployment.idl" #include "DAnCE/Deployment/Deployment_Core.idl" #include "DAnCE/Deployment/Deployment_TargetManager.idl" +#include "DAnCE/Deployment/Deployment_NodeApplicationManager.idl" module Deployment { interface Logger { }; - interface NodeApplicationManager; - - //@@changed -// interface NodeManager { -// void joinDomain (in Domain theDomain, in TargetManager manager, in -// Logger log, in long updateInterval); -// void leaveDomain (); -// NodeApplicationManager preparePlan (in DeploymentPlan plan, in -// ResourceCommitmentManager resourceCommitment) -// raises (StartError, PlanError); -// void destroyManager (in NodeApplicationManager appManager) -// raises (StopError); -// Resources getDynamicResources (); -// }; - + //@! in DOCGroup this interface has a lot extensions interface NodeManager { - /* - * @todo 06-02-01 mentions a 4th argument:in long updateInterval - */ - void joinDomain (in Domain ciao_domain, - in TargetManager manager, - in Logger log); - + void joinDomain ( in Domain theDomain, + in TargetManager manager, + in Logger log, + in long updateInterval); + void leaveDomain (); - - /* - * @todo According to 06-02-01 there should also be a ResourceCommitmentManager - * as second argument - */ - NodeApplicationManager preparePlan (in DeploymentPlan plan) + + NodeApplicationManager preparePlan (in DeploymentPlan plan, + in ResourceCommitmentManager resourceCommitment) raises (StartError, PlanError); - - /* - * @todo According to 06-02-01 InvalidReference shouldn't be here - */ + void destroyManager (in NodeApplicationManager appManager) raises (StopError, InvalidReference); - - /// CIAO specific extension - /// Destroy the NAM and all the associated NAs with this child_plan - /// We can guarantee that the input DeploymentPlan is valid, since it - /// is fetched from the cached DeploymentPlan of DAM, which has been - /// validated before. - void destroyPlan (in DeploymentPlan plan) - raises (StopError); - - /// CIAO specific extension - /// Get all the shared components installed in this node - ComponentPlans get_shared_components (); - - /* - * @todo According to 06-02-01 missing is: - * Resources getDynamicResources (); - */ + + Resources getDynamicResources (); }; }; diff --git a/CIAO/DAnCE/Deployment/Deployment_Packaging_Data.idl b/CIAO/DAnCE/Deployment/Deployment_Packaging_Data.idl index 99619f4699c..e64327168f0 100644 --- a/CIAO/DAnCE/Deployment/Deployment_Packaging_Data.idl +++ b/CIAO/DAnCE/Deployment/Deployment_Packaging_Data.idl @@ -5,167 +5,173 @@ #include "DAnCE/Deployment/Deployment_Data.idl" -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; - - struct NamedImplementationArtifact; - - typedef sequence < NamedImplementationArtifact > NamedImplementationArtifacts; - - struct ImplementationArtifactDescription { - string label; - string UUID; - ::CORBA::StringSeq location; - Properties execParameter; - Requirements deployRequirement; - NamedImplementationArtifacts dependsOn; - Properties infoProperty; - }; - - struct NamedImplementationArtifact { - string name; - ImplementationArtifactDescription referencedArtifact; - }; - - // @@changed: order of members - struct MonolithicImplementationDescription { - Properties nodeExecParameter; - NamedImplementationArtifacts primaryArtifact; - ImplementationRequirements deployRequirement; - Properties componentExecParameter; - }; - - typedef sequence < MonolithicImplementationDescription > MonolithicImplementationDescriptions; - - struct PackageConfiguration; - - typedef sequence < PackageConfiguration > PackageConfigurations; - - struct ComponentPackageDescription; - - typedef sequence < ComponentPackageDescription > ComponentPackageDescriptions; - - struct SubcomponentInstantiationDescription { - string name; - ComponentPackageDescriptions basePackage; - PackageConfigurations specializedConfig; - Requirements selectRequirement; - 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; - - // @@added - enum LocalityKind { - SameNodeAnyProcess, - SameNodeSameProcess, - SameNodeDifferentProcess, - DifferentNode, - DifferentProcess, - NoConstraint - }; - - // @@added - struct Locality { - LocalityKind constraint; - ::CORBA::ULongSeq constrainedInstanceRef; - }; - - struct ComponentAssemblyDescription { - SubcomponentInstantiationDescriptions instance; - AssemblyConnectionDescriptions connection; - AssemblyPropertyMappings externalProperty; - // @@added - // Localities localityConstraint; - }; - - typedef sequence < ComponentAssemblyDescription > ComponentAssemblyDescriptions; - - struct ComponentImplementationDescription { - string label; - string UUID; - ComponentInterfaceDescription implements; - ComponentAssemblyDescriptions assemblyImpl; - MonolithicImplementationDescriptions monolithicImpl; - Properties configProperty; - Capabilities capability; - ImplementationDependencies dependsOn; - Properties infoProperty; - }; - - - struct PackagedComponentImplementation { - string name; - ComponentImplementationDescription referencedImplementation; - }; - - - typedef sequence < PackagedComponentImplementation > PackagedComponentImplementations; - - struct ComponentPackageDescription { - string label; - string UUID; - ComponentInterfaceDescription realizes; - Properties configProperty; - PackagedComponentImplementations implementation; - Properties infoProperty; - }; - - - struct PackageConfiguration { - string label; - string UUID; - ComponentPackageDescriptions basePackage; - PackageConfigurations specializedConfig; - Requirements selectRequirement; - Properties configProperty; - ComponentPackageReferences reference; - // @@changed, delete previous - //ComponentPackageReferences referencedPackage; - // @@add - ComponentPackageImports importedPackage; - }; +module Deployment { + struct ComponentPackageDescription; + typedef sequence < ComponentPackageDescription > ComponentPackageDescriptions; + + struct PackageConfiguration; + + typedef sequence < PackageConfiguration > PackageConfigurations; + + struct ComponentPackageImport { + ::CORBA::StringSeq location; + }; + + typedef sequence < ComponentPackageImport > ComponentPackageImports; + + struct SubcomponentInstantiationDescription { + string name; + ComponentPackageDescriptions basePackage; + PackageConfigurations specializedConfig; + Requirements selectRequirement; + Properties configProperty; + ComponentPackageReferences referencedPackage; + ComponentPackageImports importedPackage; + }; + + typedef sequence < SubcomponentInstantiationDescription > SubcomponentInstantiationDescriptions; + + 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; + + struct NamedImplementationArtifact; + + typedef sequence < NamedImplementationArtifact > NamedImplementationArtifacts; + + struct ImplementationArtifactDescription { + string label; + string UUID; + ::CORBA::StringSeq location; + Properties execParameter; + Requirements deployRequirement; + NamedImplementationArtifacts dependsOn; + Properties infoProperty; + }; + + struct NamedImplementationArtifact { + string name; + ImplementationArtifactDescription referencedArtifact; + }; + + struct MonolithicImplementationDescription { + Properties nodeExecParameter; + NamedImplementationArtifacts primaryArtifact; + ImplementationRequirements deployRequirement; + Properties componentExecParameter; + }; + + typedef sequence < MonolithicImplementationDescription > MonolithicImplementationDescriptions; + + enum LocalityKind { + SameNodeAnyProcess, + SameNodeSameProcess, + SameNodeDifferentProcess, + DifferentNode, + DifferentProcess, + NoConstraint + }; + + struct Locality { + LocalityKind constraint; + ::CORBA::ULongSeq constrainedInstanceRef; + }; + + typedef sequence < Locality > Localities; + + struct ComponentAssemblyDescription { + SubcomponentInstantiationDescriptions instance; + AssemblyConnectionDescriptions connection; + AssemblyPropertyMappings externalProperty; + Localities localityConstraint; + }; + + typedef sequence < ComponentAssemblyDescription > ComponentAssemblyDescriptions; + + struct ComponentImplementationDescription { + string label; + string UUID; + ComponentInterfaceDescription implements; + ComponentAssemblyDescriptions assemblyImpl; + MonolithicImplementationDescriptions monolithicImpl; + Properties configProperty; + Capabilities capability; + ImplementationDependencies dependsOn; + Properties infoProperty; + }; + + struct PackagedComponentImplementation { + string name; + ComponentImplementationDescription referencedImplementation; + }; + + typedef sequence < PackagedComponentImplementation > PackagedComponentImplementations; + + struct ComponentPackageDescription { + string label; + string UUID; + ComponentInterfaceDescription realizes; + Properties configProperty; + PackagedComponentImplementations implementation; + Properties infoProperty; + }; + + struct PackageConfiguration { + string label; + string UUID; + ComponentPackageDescriptions basePackage; + PackageConfigurations specializedConfig; + Requirements selectRequirement; + Properties configProperty; + ComponentPackageReferences referencedPackage; + ComponentPackageImports importedPackage; + }; + + struct ComponentUsageDescription { + ComponentPackageDescriptions basePackage; + PackageConfigurations specializedConfig; + Requirements selectRequirement; + Properties configProperty; + ComponentPackageReferences referencedPackage; + ComponentPackageImports importedPackage; + }; + + struct RequirementSatisfier { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; + }; #endif /* PACKAGING_DATA_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_RepositoryManager.idl b/CIAO/DAnCE/Deployment/Deployment_RepositoryManager.idl index d9201af0702..c0484094017 100644 --- a/CIAO/DAnCE/Deployment/Deployment_RepositoryManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_RepositoryManager.idl @@ -7,34 +7,41 @@ module Deployment { - exception NameExists { - }; + exception NameExists { + }; - exception PackageError { - string source; - string reason; - }; + exception PackageError { + string source; + string reason; + }; - interface RepositoryManager { - void installPackage (in string installationName, - in string location, - in boolean replace) - raises (NameExists, PackageError); - void createPackage (in string installationName, - in PackageConfiguration package, - in string baseLocation, - in boolean replace) - raises (NameExists, PackageError); - PackageConfiguration findPackageByName (in string name) - raises (NoSuchName); - PackageConfiguration findPackageByUUID (in string UUID) - raises (NoSuchName); - ::CORBA::StringSeq findNamesByType (in string type); - ::CORBA::StringSeq getAllNames (); - ::CORBA::StringSeq getAllTypes (); - void deletePackage (in string installationName) - raises (NoSuchName); - }; + interface RepositoryManager { + void installPackage ( in string installationName, + in string location, + in boolean replace) + raises (NameExists, PackageError); + + void createPackage (in string installationName, + in PackageConfiguration package, + in string baseLocation, + in boolean replace) + raises (NameExists, PackageError); + + PackageConfiguration findPackageByName (in string name) + raises (NoSuchName); + + PackageConfiguration findPackageByUUID (in string UUID) + raises (NoSuchName); + + ::CORBA::StringSeq findNamesByType (in string type); + + ::CORBA::StringSeq getAllNames (); + + ::CORBA::StringSeq getAllTypes (); + + void deletePackage (in string installationName) + raises (NoSuchName); + }; }; #endif /* REPOSITOR_MANAGER_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl b/CIAO/DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl index 8c1e9c29776..346c2626950 100644 --- a/CIAO/DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl @@ -8,34 +8,29 @@ module Deployment { - exception ResourceCommitmentFailure { - string reason; - long index; - string propertyName; - ::CORBA::AnySeq propertyValue; - }; - /** - * @struct ResourceAllocation - * @brief Identifies a resource within a domain that is - * allocated from and the amount it is allocated - */ - struct ResourceAllocation - { - string elementName; - string resourceName; - Properties property; - }; - - /// The Resource Allocation Sequence - typedef sequence <ResourceAllocation> ResourceAllocations; - - interface ResourceCommitmentManager { - void commitResources (in ResourceAllocations resources) - raises (ResourceCommitmentFailure); - void releaseResources (in ResourceAllocations resources) - raises (ResourceCommitmentFailure); - }; + struct ResourceAllocation { + string elementName; + string resourceName; + Properties property; + }; + + typedef sequence < ResourceAllocation > ResourceAllocations; + + exception ResourceCommitmentFailure { + string reason; + long index; + string propertyName; + ::CORBA::AnySeq propertyValue; + }; + + interface ResourceCommitmentManager { + void commitResources (in ResourceAllocations resources) + raises (ResourceCommitmentFailure); + void releaseResources (in ResourceAllocations resources) + raises (ResourceCommitmentFailure); + }; + }; +#endif //RESOURCE_COMMITMENT_MANAGER_IDL -#endif diff --git a/CIAO/DAnCE/Deployment/Deployment_TargetData.idl b/CIAO/DAnCE/Deployment/Deployment_TargetData.idl index 877600f93bf..f0ec9732afd 100644 --- a/CIAO/DAnCE/Deployment/Deployment_TargetData.idl +++ b/CIAO/DAnCE/Deployment/Deployment_TargetData.idl @@ -9,57 +9,61 @@ module Deployment { - struct Resource { - string name; - ::CORBA::StringSeq resourceType; - SatisfierProperties property; - }; + struct Resource { + string name; + ::CORBA::StringSeq resourceType; + SatisfierProperties property; + }; - typedef sequence < Resource > Resources; + typedef sequence < Resource > Resources; - struct SharedResource { - string name; - ::CORBA::StringSeq resourceType; - ::CORBA::ULongSeq nodeRef; - SatisfierProperties property; - }; - typedef sequence < SharedResource > SharedResources; + struct SharedResource { + string name; + ::CORBA::StringSeq resourceType; + ::CORBA::ULongSeq nodeRef; + SatisfierProperties property; + }; + + typedef sequence < SharedResource > SharedResources; - struct Node { - string name; - string label; - ::CORBA::ULongSeq sharedResourceRef; - ::CORBA::ULongSeq connectionRef; - Resources resource; - }; - typedef sequence < Node > Nodes; + struct Node { + string name; + string label; + ::CORBA::ULongSeq sharedResourceRef; + ::CORBA::ULongSeq connectionRef; + Resources resource; + }; - struct Interconnect { - string name; - string label; - ::CORBA::ULongSeq connectionRef; - ::CORBA::ULongSeq connectRef; - Resources resource; - }; - typedef sequence < Interconnect > Interconnects; + typedef sequence < Node > Nodes; - struct Bridge { - string name; - string label; - ::CORBA::ULongSeq connectRef; - Resources resource; - }; - typedef sequence < Bridge > Bridges; + struct Interconnect { + string name; + string label; + ::CORBA::ULongSeq connectionRef; + ::CORBA::ULongSeq connectRef; + Resources resource; + }; - struct Domain { - string UUID; - string label; - SharedResources sharedResource; - Nodes node; - Interconnects interconnect; - Bridges bridge; - Properties infoProperty; - }; + typedef sequence < Interconnect > Interconnects; + + struct Bridge { + string name; + string label; + ::CORBA::ULongSeq connectRef; + Resources resource; + }; + + typedef sequence < Bridge > Bridges; + + struct Domain { + string UUID; + string label; + SharedResources sharedResource; + Nodes node; + Interconnects interconnect; + Bridges bridge; + Properties infoProperty; + }; }; #endif /* DEPLOYMENT_TARGETDATA_IDL */ diff --git a/CIAO/DAnCE/Deployment/Deployment_TargetManager.idl b/CIAO/DAnCE/Deployment/Deployment_TargetManager.idl index 91a9c849099..d313227a352 100644 --- a/CIAO/DAnCE/Deployment/Deployment_TargetManager.idl +++ b/CIAO/DAnCE/Deployment/Deployment_TargetManager.idl @@ -11,34 +11,28 @@ #include "DAnCE/Deployment/Deployment_ResourceCommitmentManager.idl" module Deployment { - - /// @todo, UpdateAvailable is not in the spec, must be UpdateDynamic enum DomainUpdateKind { Add, Delete, UpdateAll, - // @@changed UpdateDynamic }; - + interface TargetManager { + Domain getAllResources (); + Domain getAvailableResources (); - // @@changed - ResourceCommitmentManager createResourceCommitment (in ResourceAllocations resources) + //@! in DOCGroup renamed to createResourceCommitment + ResourceCommitmentManager commitResources (in ResourceAllocations resources) raises (ResourceCommitmentFailure); - - // @@added - void destroyResourceCommitment (in ResourceCommitmentManager manager); - /// @todo This is not part of 06-04-01 - // @@delete: - //void releaseResources (in DeploymentPlan argname); + void destroyResourceCommitment (in ResourceCommitmentManager manager); - void updateDomain (in ::CORBA::StringSeq elements, - in Domain domainSubset, - in DomainUpdateKind updateKind); + void updateDomain ( in ::CORBA::StringSeq elements, + in Domain domainSubset, + in DomainUpdateKind updateKind); }; }; diff --git a/CIAO/DAnCE/Deployment/Deployment_common.h b/CIAO/DAnCE/Deployment/Deployment_common.h index 730bd235f6f..dfd44797069 100644 --- a/CIAO/DAnCE/Deployment/Deployment_common.h +++ b/CIAO/DAnCE/Deployment/Deployment_common.h @@ -14,6 +14,9 @@ #include /**/ "ace/pre.h" #include "ace/config-all.h" +#include "ace/Hash_Map_Manager_T.h" +#include "tao/AnyTypeCode/Any.h" +#include "Deployment/Deployment_ConnectionC.h" #if !defined ACE_LACKS_PRAGMA_ONCE #pragma once @@ -21,8 +24,14 @@ /// A struct which captures the binding information about a component -namespace CIAO +namespace DAnCE { + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + CORBA::Any, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> PROPERTY_MAP; + /// A struct which captures the compnent binding information, which /// is useful for inter-assembly connection setup typedef struct _component_binding @@ -38,7 +47,7 @@ namespace CIAO Deployment::Connections_var providedReference_; - bool operator==(const struct _component_binding & comp) const + bool operator==(const struct _component_binding & comp) { if (this->name_ == comp.name_ && this->plan_uuid_ == comp.plan_uuid_ && diff --git a/CIAO/DAnCE/Deployment/Module_Main.h b/CIAO/DAnCE/Deployment/Module_Main.h new file mode 100644 index 00000000000..cba4ba4d5e3 --- /dev/null +++ b/CIAO/DAnCE/Deployment/Module_Main.h @@ -0,0 +1,94 @@ +// $Id$ +/** + * @file Module_Main.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Provides a generic main function used by individual modules. + */ + +#ifndef DANCE_MODULE_MAIN_H_ +#define DANCE_MODULE_MAIN_H_ + +#include "ace/Auto_Ptr.h" +#include "ace/Dynamic_Service.h" +#include "tao/Object.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "DAnCE/Logger/Logger_Service.h" + +#ifndef DANCE_MODULE_MAIN_CLASS_NAME +#error Module_Main.h used without DANCE_MODULE_MAIN_CLASS_NAME defined. +#endif + +//#ifndef DANCE_MODULE_MAIN_INCLUDE_NAME +//#error Module_Main.h used without DANCE_MODULE_MAIN_INCLUDE_NAME defined. +//#endif + +//#include DANCE_MODULE_MAIN_INCLUDE_NAME + +using namespace DAnCE; + +int +ACE_TMAIN (int argc, ACE_TCHAR **argv) +{ + DANCE_DISABLE_TRACE (); + + auto_ptr<Logger_Service> logger; + + try + { + Logger_Service + * dlf = ACE_Dynamic_Service<Logger_Service>::instance ("DAnCE_Logger_Backend_Factory"); + + if (!dlf) + { + dlf = new Logger_Service; + logger.reset (dlf); + } + + dlf->init (argc, argv); + + DANCE_DEBUG ((LM_TRACE, DLINFO + "Module_main.h - initializing ORB\n")); + + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + ACE_Log_Msg_Backend * backend = dlf->get_logger_backend(orb); + + if (backend != 0) + { + backend->open(0); + ACE_Log_Msg::msg_backend (backend); + ACE_Log_Msg * ace = ACE_Log_Msg::instance(); + ace->clr_flags(ace->flags()); + ace->set_flags(ACE_Log_Msg::CUSTOM); + } + + DANCE_DEBUG ((LM_TRACE, DLINFO + "Module_Main.h - initializing module instance")); + DANCE_MODULE_MAIN_CLASS_NAME module_instance; + + CORBA::Object_var obj = module_instance.create_object (orb.in (), + argc, + argv); +#ifndef DANCE_MODULE_MAIN_SKIP_ORB_RUN + if (!CORBA::is_nil (obj.in ())) + orb->run (); + else + DANCE_ERROR ((LM_ERROR, DLINFO "Module_Main.h - " + "Got nil object reference from Module\n")); + + DANCE_DEBUG ((LM_TRACE, DLINFO + "Module_Main.h - ORB event loop finished, exiting.\n")); + + orb->destroy (); +#endif + } + catch (...) + { + return -1; + } + + return 0; +} + +#endif diff --git a/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.cpp b/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.cpp deleted file mode 100644 index af7fc329959..00000000000 --- a/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// $Id$ - -#include "NodeApp_CB_Impl.h" - -CIAO::NodeApplication_Callback_Impl:: -NodeApplication_Callback_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Deployment::NodeApplicationManager_ptr s, - const Deployment::Properties &properties, - ACE_Condition<TAO_SYNCH_MUTEX> &wait, - TAO_SYNCH_MUTEX& mutex) - : is_callback_completed_ (false), - orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - nam_ (Deployment::NodeApplicationManager::_duplicate (s)), - waitCond_ (wait), - mutex_ (mutex) -{ - try - { - //@@ Note: this properties is useless unless - // we have some specific properties for the callback obj. - Deployment::Properties * tmp = 0; - ACE_NEW_THROW_EX (tmp, - Deployment::Properties (properties), - CORBA::NO_MEMORY ()); - this->properties_ = tmp; - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeApp_CB_Impl::Constructor\t\n"); - throw; - } -} - -CIAO::NodeApplication_Callback_Impl::~NodeApplication_Callback_Impl () -{ -} - -PortableServer::POA_ptr -CIAO::NodeApplication_Callback_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - -Deployment::NodeApplicationManager_ptr -CIAO::NodeApplication_Callback_Impl::register_node_application ( - Deployment::NodeApplication_ptr na, - Deployment::Properties_out properties) -{ - this->is_callback_completed_ = true; - properties = this->properties_._retn (); - - this->nodeapp_ = Deployment::NodeApplication::_duplicate (na); - - this->waitCond_.signal (); - return Deployment::NodeApplicationManager::_duplicate (this->nam_.in ()); -} - -Deployment::NodeApplication_ptr -CIAO::NodeApplication_Callback_Impl::get_nodeapp_ref (void) -{ - // @@ (OO) How are you relinquishing ownership here? Since you're - // duplicating the reference you actually maintain - // ownership. Is the below comment wrong, or is the code - // wrong? - - // Relinquish the ownership of the nodeapplication reference. - //This method should only be called from the NodeApplicationManager. - return Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); -} - -bool -CIAO::NodeApplication_Callback_Impl::is_callback_completed () -{ - return this->is_callback_completed_; -} diff --git a/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.h b/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.h deleted file mode 100644 index 68a61d3616e..00000000000 --- a/CIAO/DAnCE/Deployment/NodeApp_CB_Impl.h +++ /dev/null @@ -1,86 +0,0 @@ -// -*- C++ -*- -// $Id$ -//============================================================================= -/** - * @file NodeApp_CB_Impl.h - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * Tao Lu <lu@dre.vanderbilt.edu> - * - //===========================================================================*/ - - -#ifndef NODEAPPLICATION_CALLBACK_IMPL_H -#define NODEAPPLICATION_CALLBACK_IMPL_H -#include /**/ "ace/pre.h" -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_NodeApplication_CallBackS.h" -#include "ace/Synch.h" - -namespace CIAO -{ - /** - * @class NodeApplication_Callback_Impl - * - * @brief A call back interface for NodeApplication - * @Note Here is no need to be thread safe since for every nodeapplication - * we will have an unique callback object. --Tao - */ - class Deployment_svnt_Export NodeApplication_Callback_Impl - : public virtual POA_CIAO::NodeApplication_Callback - { - public: - friend class NodeApplicationManager_Impl; - - /// Constructor. - NodeApplication_Callback_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Deployment::NodeApplicationManager_ptr s, - const Deployment::Properties &properties, - ACE_Condition<TAO_SYNCH_MUTEX> &wait, - TAO_SYNCH_MUTEX& mutex); - - /// Get the containing POA. This operation does *not* increase - /// the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - /// Record the NodeApplication reference returned by the newly - /// spawned NodeApplication and give it back a reference to - /// NodeApplicationManager - Deployment::NodeApplicationManager_ptr - register_node_application (Deployment::NodeApplication_ptr na, - Deployment::Properties_out properties); - - Deployment::NodeApplication_ptr get_nodeapp_ref (void); - - bool is_callback_completed (void); - - protected: - /// Destructor. - ~NodeApplication_Callback_Impl (); - - bool is_callback_completed_; - - CORBA::ORB_var orb_; - - PortableServer::POA_var poa_; - - Deployment::NodeApplicationManager_var nam_; - - Deployment::NodeApplication_var nodeapp_; - - Deployment::Properties_var properties_; - - ACE_Condition<TAO_SYNCH_MUTEX> &waitCond_; - - TAO_SYNCH_MUTEX &mutex_; - }; -} - -#include /**/ "ace/post.h" -#endif /* NODEAPPLICATION_CALLBACK_IMPL_H */ diff --git a/CIAO/DAnCE/DomainApplication/DomainApplication.mpc b/CIAO/DAnCE/DomainApplication/DomainApplication.mpc new file mode 100644 index 00000000000..03946ef98aa --- /dev/null +++ b/CIAO/DAnCE/DomainApplication/DomainApplication.mpc @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + + +project: dance_lib, taolib, tao_output, dance_deployment_stub, dance_deployment_svnt, dance_logger { + sharedname = DAnCE_DomainApplication + dynamicflags = DOMAIN_APPLICATION_BUILD_DLL + + Source_Files { + Domain_Application_Impl.cpp + } +} + diff --git a/CIAO/DAnCE/DomainApplication/Domain_Application_Export.h b/CIAO/DAnCE/DomainApplication/Domain_Application_Export.h new file mode 100644 index 00000000000..fe9b0133ebb --- /dev/null +++ b/CIAO/DAnCE/DomainApplication/Domain_Application_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Domain_Application +// ------------------------------ +#ifndef DOMAIN_APPLICATION_EXPORT_H +#define DOMAIN_APPLICATION_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DOMAIN_APPLICATION_HAS_DLL) +# define DOMAIN_APPLICATION_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DOMAIN_APPLICATION_HAS_DLL */ + +#if !defined (DOMAIN_APPLICATION_HAS_DLL) +# define DOMAIN_APPLICATION_HAS_DLL 1 +#endif /* ! DOMAIN_APPLICATION_HAS_DLL */ + +#if defined (DOMAIN_APPLICATION_HAS_DLL) && (DOMAIN_APPLICATION_HAS_DLL == 1) +# if defined (DOMAIN_APPLICATION_BUILD_DLL) +# define Domain_Application_Export ACE_Proper_Export_Flag +# define DOMAIN_APPLICATION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DOMAIN_APPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DOMAIN_APPLICATION_BUILD_DLL */ +# define Domain_Application_Export ACE_Proper_Import_Flag +# define DOMAIN_APPLICATION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DOMAIN_APPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DOMAIN_APPLICATION_BUILD_DLL */ +#else /* DOMAIN_APPLICATION_HAS_DLL == 1 */ +# define Domain_Application_Export +# define DOMAIN_APPLICATION_SINGLETON_DECLARATION(T) +# define DOMAIN_APPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DOMAIN_APPLICATION_HAS_DLL == 1 */ + +// Set DOMAIN_APPLICATION_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DOMAIN_APPLICATION_NTRACE) +# if (ACE_NTRACE == 1) +# define DOMAIN_APPLICATION_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DOMAIN_APPLICATION_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DOMAIN_APPLICATION_NTRACE */ + +#if (DOMAIN_APPLICATION_NTRACE == 1) +# define DOMAIN_APPLICATION_TRACE(X) +#else /* (DOMAIN_APPLICATION_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DOMAIN_APPLICATION_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DOMAIN_APPLICATION_NTRACE == 1) */ + +#endif /* DOMAIN_APPLICATION_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.cpp b/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.cpp new file mode 100644 index 00000000000..47cabb79cba --- /dev/null +++ b/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.cpp @@ -0,0 +1,118 @@ +// $Id$ + +#include "Domain_Application_Impl.h" +#include "ace/Log_Msg.h" +#include "ace/streams.h" +#include "DAnCE/Logger/Log_Macros.h" + +namespace DAnCE +{ + + DomainApplication_Impl::DomainApplication_Impl ( + TNam2Nm & nams, + const Deployment::Properties & configProperty, + Deployment::Connections& conn) + : nams_ (nams) + { + DANCE_TRACE("DomainApplication_Impl::DomainApplication_Impl"); + this->startLaunch (configProperty); + conn = this->connections_; + } + + DomainApplication_Impl::~DomainApplication_Impl() + { + DANCE_TRACE ("DomainApplication_Impl::~DomainApplication_Impl()"); + + try + { + for (TApp2Mgr::iterator iter = this->node_applications_.begin(); + iter != this->node_applications_.end(); + ++iter) + { + (*iter).int_id_->destroyApplication ( (*iter).ext_id_.in()); + } + this->node_applications_.unbind_all(); + } + catch (CORBA::Exception &e) + { + DANCE_ERROR((LM_ERROR, DLINFO + "DomainApplication_Impl::~DomainApplication_Impl - " + "caught a CORBA exception %C(%C) \"%C\"\n", + e._name(), e._rep_id(), e._info().c_str())); + } + catch(...) + { + DANCE_ERROR((LM_ERROR, DLINFO "DomainApplication_Impl::~DomainApplication_Impl - " + "caught an unknown exception.\n")); + } + } + + void + DomainApplication_Impl::finishLaunch (const Deployment::Connections & connections, + CORBA::Boolean start) + { + DANCE_TRACE ("DomainApplication_Impl::finishLaunch"); + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplication_impl::finishLaunch - " + "connections length is %d\n", connections.length())); + for (TApp2Mgr::iterator iter = this->node_applications_.begin(); + iter != this->node_applications_.end(); + ++iter) + { + (*iter).ext_id_->finishLaunch (connections, start); + } + } + + void + DomainApplication_Impl::start () + { + DANCE_TRACE ("DomainApplication_Impl::start"); + for (TApp2Mgr::iterator iter = this->node_applications_.begin(); + iter != this->node_applications_.end(); + ++iter) + { + (*iter).ext_id_->start (); + } + } + + void + DomainApplication_Impl::startLaunch (const Deployment::Properties & configProperty) + { + DANCE_TRACE ("DomainApplication_Impl::startLaunch"); + + for (TNam2Nm::iterator iter = this->nams_.begin(); + iter != this->nams_.end(); + ++iter) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplication_Impl::startLaunch - " + "Invoking startLaunch on an application\n")); + ::Deployment::Connections_var conn; + Deployment::Application_ptr na = (*iter).ext_id_->startLaunch (configProperty, conn.out()); + //Deployment::NodeApplication_ptr na = Deployment::NodeApplication::_narrow (a); + if (CORBA::is_nil (na)) + { + DANCE_ERROR ((LM_ERROR, DLINFO + "DomainApplication_Impl::startLaunch -" + "Received nil object reference from startLaunch on node managers.\n")); + throw Deployment::StartError(); + } + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplication_Impl::startLaunch - " + "Application startLaunch succeeded, received %u connections \n", + conn->length ())); + + this->node_applications_.bind (na, (*iter).ext_id_); + + size_t before = this->connections_.length(); + this->connections_.length (before + conn->length()); + for (size_t i = 0; i < conn->length(); ++i) + { + this->connections_[before+i] = (*conn) [i]; + } + } + + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplication_Impl::startLaunch - " + "Received %u connections from applications\n", + this->connections_.length ())); + } + +} // DAnCE + diff --git a/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.h b/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.h new file mode 100644 index 00000000000..f03972c983a --- /dev/null +++ b/CIAO/DAnCE/DomainApplication/Domain_Application_Impl.h @@ -0,0 +1,80 @@ +/**======================================================== + * + * @file DomainApplication_Impl_Impl.h + * + * @Brief This file contains the implementation of + * the DomainApplication interface. + * + * @author Vinzenz Tornow <vt@prismtech.com> + *========================================================*/ + +#ifndef DOMAIN_APPLICATION_H +#define DOMAIN_APPLICATION_H +#include /**/ "ace/pre.h" + +#include "Domain_Application_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Deployment/Deployment_DomainApplicationS.h" +#include "ace/Map_Manager.h" +#include "Deployment/Deployment_NodeApplicationC.h" +#include "Deployment/Deployment_NodeApplicationManagerC.h" +#include "Deployment/Deployment_NodeManagerC.h" + +namespace DAnCE + { + + /** + * + * @class DomainApplication_Impl + * + * @brief This class implements the DomainApplication interface. + * + **/ + class Domain_Application_Export DomainApplication_Impl + : public virtual POA_Deployment::DomainApplication + { + public: + typedef ACE_Map_Manager < Deployment::NodeApplicationManager_var, + Deployment::NodeManager_var, + ACE_Null_Mutex > TNam2Nm; + typedef ACE_Map_Manager < Deployment::Application_var, + Deployment::NodeApplicationManager_var, + ACE_Null_Mutex > TApp2Mgr; + + DomainApplication_Impl (TNam2Nm& nams, + const Deployment::Properties & configProperty, + Deployment::Connections& conn); + ~DomainApplication_Impl(); + + /** + * The second step in launching an application in the + * domain-level. If the start parameter is true, the application + * is started as well. Raises the StartError exception if + * launching or starting the application fails. + */ + virtual void + finishLaunch (const Deployment::Connections & connections, + CORBA::Boolean start); + /** + * Starts the application. Raises the StartError exception if + * starting the application fails. + */ + virtual void start (); + + private: + TApp2Mgr node_applications_; + Deployment::Connections connections_; + TNam2Nm & nams_; + Deployment::Application_var na_; + void startLaunch (const Deployment::Properties & configProperty); + }; +}; // DAnCE + +#include /**/ "ace/post.h" +#endif // DOMAIN_APPLICATION_H + + diff --git a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp b/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp deleted file mode 100644 index 2a9d162f158..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// $Id$ - -#include "Deployment_Configuration.h" -#include "ciao/CIAO_common.h" - -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" -#include "ace/Read_Buffer.h" - -CIAO::Deployment_Configuration::Deployment_Configuration (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) -{ -} - -CIAO::Deployment_Configuration::~Deployment_Configuration (void) -{ - this->deployment_info_.unbind_all (); -} - -int -CIAO::Deployment_Configuration::init (const char *filename) -{ - if (filename == 0) - { - ACE_ERROR ((LM_ERROR, "DANCE (%P|%t) Deployment_Configuration.cpp" - ": Unable to identify the file name \n")); - return -1; - } - - FILE *inf = ACE_OS::fopen (filename, "r"); - - if (inf == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "DAnCE (%P|%t) Deployment_Configuration.cpp:" - "Fail to open node manager map data file: <%s>\n", - filename), - -1); - } - - // Get a read buffer, this will close the stream when we are ready - ACE_Read_Buffer reader (inf, true); - - bool first = true; - char* string = 0; - - // Read from the file line by line - while ((string = reader.read ('\n')) != 0) - { - // Search from the right to the first space - const char* ior_start = ACE_OS::strrchr (string, ' '); - // Search from the left to the first space - const char* dest_end = ACE_OS::strchr (string, ' '); - // The destination is first followed by some spaces - ACE_CString destination (string, dest_end - string); - // And then the IOR - - ACE_CString ior (ior_start + 1, ACE_OS::strlen (ior_start + 1)); - int const result = - this->deployment_info_.bind (destination.c_str (), ior.c_str ()); - if (result == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "DAnCE (%P|%t) Deployment_Configuration, " - "failed to bind destination <%s>\n", - destination.c_str ()), - -1); - } - else if (result == 1) - { - if (CIAO::debug_level () > 5) - { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) Deployment_Configuration.cpp, " - "reuse existing node in the cached map: <%s>\n" , - destination.c_str ())); - } - } - else - { - if (CIAO::debug_level () > 5) - { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) Deployment_Configuration, " - "bind <%s> <%s>\n", destination.c_str (), ior.c_str ())); - } - } - - if (first) - { - this->default_node_manager_.IOR_ = ior; - first = false; - } - } - - return 0; -} - -const char * -CIAO::Deployment_Configuration::get_node_manager_ior (const char *name) const -{ - if (name == 0) - return this->get_default_node_manager_ior (); - - ACE_Hash_Map_Entry - <ACE_CString, CIAO::Deployment_Configuration::Node_Manager_Info> *entry = 0; - - if (this->deployment_info_.find (ACE_CString (name), entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) Deployment_Configuration, " - "get_node_manager_ior, failed to find IOR for destination <%s>\n", - name)); - return 0; - } - - return entry->int_id_.IOR_.c_str (); -} - -const char * -CIAO::Deployment_Configuration::get_default_node_manager_ior (void) const -{ - if (this->default_node_manager_.IOR_.length () == 0) - return 0; - return this->default_node_manager_.IOR_.c_str (); -} - -::Deployment::NodeManager_ptr -CIAO::Deployment_Configuration::get_node_manager (const char *name) -{ - if (name == 0) - return get_default_node_manager (); - - ACE_Hash_Map_Entry - <ACE_CString, - CIAO::Deployment_Configuration::Node_Manager_Info> *entry = 0; - - if (this->deployment_info_.find (ACE_CString (name), - entry) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "DAnCE (%P|%t) Deployment_Configuration.cpp:" - "Failed to find IOR for destination <%s>\n", - name), - 0); - } - - if (CORBA::is_nil (entry->int_id_.node_manager_.in ())) - { - try - { - CORBA::Object_var temp = this->orb_->string_to_object - (entry->int_id_.IOR_.c_str ()); - - entry->int_id_.node_manager_ = - ::Deployment::NodeManager::_narrow (temp.in ()); - } - catch (const CORBA::Exception&) - { - ACE_ERROR ((LM_ERROR, "DANCE (%P|%t) Deployment_Configuration.cpp: " - "Error while contacting NodeManager %s\n", name)); - throw; - } - } - return ::Deployment::NodeManager::_duplicate - (entry->int_id_.node_manager_.in ()); -} - -::Deployment::NodeManager_ptr -CIAO::Deployment_Configuration::get_default_node_manager () -{ - if (CORBA::is_nil (this->default_node_manager_.node_manager_.in ())) - { - CORBA::Object_var temp = this->orb_->string_to_object - (this->default_node_manager_.IOR_.c_str ()); - - this->default_node_manager_.node_manager_ = - ::Deployment::NodeManager::_narrow (temp.in ()); - } - return ::Deployment::NodeManager::_duplicate - (this->default_node_manager_.node_manager_.in ()); -} diff --git a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h b/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h deleted file mode 100644 index cd6d13b9f0c..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Deployment_Configuration.h - * - * $Id$ - * - * The Deployment_Configuration provides abstraction for the - * deployment mechanisms. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//============================================================================= -#ifndef CIAO_DEPLOYMENT_CONFIGURATION_H -#define CIAO_DEPLOYMENT_CONFIGURATION_H -#include /**/ "ace/pre.h" - -#include "ace/Hash_Map_Manager_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/Deployment_NodeManagerC.h" -#include "tao/Valuetype/ValueBase.h" -#include "tao/Valuetype/Valuetype_Adapter_Impl.h" -#include "ace/SString.h" - -#include "DomainApplicationManager/DomainApplicationManager_Export.h" - -namespace CIAO -{ - /** - * @class Deployment_Configuration - * - * @brief A class that provides strategies on deployment topology. - * - * This class provides strategies on how the DomainApplicationManager - * should deploy an deployment plan at domain-level. This is achieved - * by providing mappings from deployment destination names to actually - * NodeManager daemon IORs, and the strategy for which default NodeManager - * daemons a deployment mechanism should use. - * - * This is a trivial implementation of the deployment configuration - * strategy. We can enhance this class later on to provide - * different deployment location strategies, such as naming service. - */ - class DomainApplicationManager_Export Deployment_Configuration - { - public: - typedef struct _node_manager_info - { - _node_manager_info (const char *ior = 0) - { - IOR_ = ior; - } - - ACE_CString IOR_; - ::Deployment::NodeManager_var node_manager_; - } Node_Manager_Info; - - Deployment_Configuration (CORBA::ORB_ptr o); - - /// Destructor - ~Deployment_Configuration (void); - - /** - * Init method takes the filename to a configuration file which - * has a simple line format of name, ior string delimited by a - * space in each line. - * - * name IOR-string - * - * @retval 0 on success. - * @retval -1 otherwise. - */ - int init (const char *filename); - - /** - * @retval 0 if no valid name were found. When @c name = 0, then - * this function behave exactly as get_default_activator_ior. - */ - const char *get_node_manager_ior (const char *name) const; - - /** - * Return the default NodeManager the DomainApplicationManager - * should use to deploy a component. In this implementation, the - * first entry in the deployment configuration data file is always - * the entry for default activator. - * - * @retval 0 if no valid daemon is configured. - */ - const char *get_default_node_manager_ior () const; - - /** - * @retval nil if no valid name were found. - */ - ::Deployment::NodeManager_ptr - get_node_manager (const char *name); - - /** - * Return the reference to the default NodeManager the - * DomainApplicationManager should use to deploy a node-level - * deployment plan.. - * - * @retval nil if no valid daemon is configured. - */ - ::Deployment::NodeManager_ptr - get_default_node_manager (); - - protected: - CORBA::ORB_var orb_; - - ACE_Hash_Map_Manager_Ex<ACE_CString, - Node_Manager_Info, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> deployment_info_; - - Node_Manager_Info default_node_manager_; - }; - -} - -#include /**/ "ace/post.h" -#endif /* CIAO_DEPLOYMENT_CONFIGURATION_H */ diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc index 5db236de1e5..86d2cbab3ab 100644 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc +++ b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager.mpc @@ -1,31 +1,19 @@ // -*- MPC -*- // $Id$ -project (DomainApplicationManager): ciao_deployment_svnt, naming, ace_output { - sharedname = DomainApplicationManager - after += ExecutionManager_stub - - dynamicflags = DOMAINAPPLICATIONMANAGER_BUILD_DLL - +project : dance_lib, taolib, tao_output, dance_domain_application, naming { + sharedname = DAnCE_DomainApplicationManager + dynamicflags = DOMAINAPPLICATIONMANAGER_BUILD_DLL + Source_Files { DomainApplicationManager_Impl.cpp - DomainApplicationManager_AMI_Impl.cpp - DomainApplicationManager_AMH_Impl.cpp - DomainApplicationManager_ActiveObject_Impl.cpp - Deployment_Configuration.cpp - Reply_Handler_i.cpp - Task_StartLaunch.cpp + Node_Locator.cpp } Header_Files { + Node_Locator.h DomainApplicationManager_Impl.h - DomainApplicationManager_AMI_Impl.h - DomainApplicationManager_AMH_Impl.h - DomainApplicationManager_ActiveObject_Impl.h - Deployment_Configuration.h DomainApplicationManager_Export.h - Reply_Handler_i.h - Task_StartLaunch.h } } diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.cpp b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.cpp deleted file mode 100644 index 33b30a4cea6..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.cpp +++ /dev/null @@ -1,1965 +0,0 @@ -// $Id$ - -#include "DomainApplicationManager_AMH_Impl.h" -#include "ExecutionManager/Execution_Manager_Impl.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerC.h" -#include "ace/Null_Mutex.h" -#include "ace/OS_NS_string.h" -#include "ace/SString.h" -#include "ace/Assert.h" - -#if !defined (__ACE_INLINE__) -# include "DomainApplicationManager_AMH_Impl.inl" -#endif /* __ACE_INLINE__ */ - -CIAO::DomainApplicationManager_AMH_Impl:: -DomainApplicationManager_AMH_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl * em, - const Deployment::DeploymentPlan & plan, - const char * deployment_file) - : orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - execution_manager_ (em), // a plain C++ pointer - target_manager_ (Deployment::TargetManager::_duplicate (manager)), // object ref - plan_ (plan), - num_child_plans_ (0), - // @@ (OO) The default size for an ACE_Hash_Map_Mapanger is quiet - // large. The maximum size of an ACE_Hash_Map_Manager is - // also fixed, i.e. it does not grow dynamically on demand. - // Make sure the default size of artifact_map_ is - // appropriate for your needs. You may also want to make - // the size configurable at compile-time, at least. - // - // Need to initialize chained artifacts here. - // - deployment_file_ (CORBA::string_dup (deployment_file)), - deployment_config_ (orb), - uuid_ (plan.UUID), - is_redeployment_ (false), - esd_ (0) -{ - ACE_NEW_THROW_EX (this->all_connections_, - Deployment::Connections (), - CORBA::NO_MEMORY ()); - - ACE_NEW_THROW_EX (this->shared_, - Deployment::ComponentPlans (), - CORBA::NO_MEMORY ()); - - ACE_NEW_THROW_EX (this->esd_, - CIAO::DAnCE::EventServiceDeploymentDescriptions (), - CORBA::NO_MEMORY ()); - - for (CORBA::ULong i = 0; i < this->plan_.infoProperty.length (); ++i) - { - if (ACE_OS::strcmp (this->plan_.infoProperty[i].name.in (), - "CIAOEvents") != 0) - continue; - - // Note, we should do a sanity check here to make - // sure we didn't pick up the wrong infoProperty!! - this->plan_.infoProperty[0].value >>= this->esd_; - break; - } - - this->init (); -} - -CIAO::DomainApplicationManager_AMH_Impl::~DomainApplicationManager_AMH_Impl () -{ - if (CIAO::debug_level () > 1) - { - ACE_DEBUG ((LM_DEBUG, "DomainApplicationManager destroyed\n")); - } -} - -void -CIAO::DomainApplicationManager_AMH_Impl::get_node_app ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const char * node_name) -{ - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (node_name, entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::get_node_app -" - "ERROR while finding the node application " - "for the node [%s] \n", - node_name)); - throw Deployment::NoSuchName (); - } - - _tao_rh->get_node_app ( - Deployment::NodeApplication::_duplicate ( - entry->int_id_.node_application_.in ())); -} - -void -CIAO::DomainApplicationManager_AMH_Impl::init () -{ - try - { - // (1) Call get_plan_info() method to get the total number - // of child plans and list of NodeManager names, and - // (2) Check the validity of the global deployment plan. - if (! this->get_plan_info ()) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::init -" - "ERROR while calling get_plan_info () \n")); - throw Deployment::PlanError (); - } - - // Call split_plan() - if (! this->split_plan ()) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::init -" - "ERROR while calling split_plan () \n")); - throw Deployment::PlanError (); - } - - // Invoke preparePlan on each NodeManager by giving child plan. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager object reference. - ::Deployment::NodeManager_var my_node_manager = - this->deployment_config_.get_node_manager - (this->node_manager_names_[i].c_str ()); - - // Get the child deployment plan reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::init -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - throw Deployment::PlanError (); - } - - Chained_Artifacts & artifacts = entry->int_id_; - - // Call preparePlan() method on the NodeManager with the - // corresponding child plan as input, which returns a - // NodeApplicationManager object reference. - Deployment::ApplicationManager_var tmp_app_manager = - my_node_manager->preparePlan (artifacts.child_plan_.in ()); - - Deployment::NodeApplicationManager_var app_manager = - Deployment::NodeApplicationManager::_narrow - (tmp_app_manager.in ()); - - if (CORBA::is_nil (app_manager.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::init -" - "ERROR while narroing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error ("DomainAppMgr::init () received a nil \ - reference for NodeApplicationManager\n"); - - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - throw - (Deployment::StartError ("DomainApplicationManager_AMH_Impl:init", - error.c_str ())); - } - - // Cache the NodeApplicationManager object reference. - artifacts.node_application_manager_ = app_manager._retn (); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("DomainApplicationManager_AMH_Impl::init\t\n"); - throw; - } -} - -bool -CIAO::DomainApplicationManager_AMH_Impl::get_plan_info (void) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::get_plan_info"); - - // Read the deployment.dat file and get to know the different nodes - // that are present in the deployment domain. - // We should be able to replace this way, by parsing the domain - // descriptor to get to know more on the domain. - // - if ( this->deployment_config_.init (this->deployment_file_) == -1 ) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::get_plan_info -" - "ERROR while trying to initialize after reading " - "deployment DAT file \n")); - return 0; - } - - // Error: If there are no nodes in the plan => No nodes to deploy the - // components - CORBA::ULong const length = this->plan_.instance.length (); - - if (length == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::get_plan_info -" - "ERROR while trying to get the total instances to " - "be deployed \n")); - return false; - } - - // Copy the name of the node in the plan on to the node manager - // array, Making sure that duplicates are not added. - // - // OPTIMIZATION: - // We can parse the domain descriptor and the size of the node - // data structure is the size of the num_plans and - // the individual node names need to be entered into the - // node_manager_map. - // - int num_plans = 0; - this->node_manager_names_.clear (); - - for (CORBA::ULong index = 0; index < length; index ++) - { - bool matched = false; - - const CORBA::ULong number_node_managers = - this->node_manager_names_.size (); - - for (CORBA::ULong i = 0; i < number_node_managers; ++i) - // If a match is found do not add it to the list of unique - // node names - if (ACE_OS::strcmp (this->plan_.instance [index].node.in (), - (this->node_manager_names_ [i]).c_str ()) == 0) - { - // Break out -- Duplicates found - matched = true; - break; - } - - if (! matched) - { - // Check if there is a corresponding NodeManager instance existing - // If not present return false - ::Deployment::NodeManager_var mgr = - this->deployment_config_.get_node_manager - (this->plan_.instance [index].node.in ()); - - if (CORBA::is_nil (mgr.in ())) - return false; /* Failure */ - - // Add this unique node_name to the list of NodeManager names - this->node_manager_names_.push_back (this->plan_.instance [index].node.in ()); - - // Increment the number of plans - ++num_plans; - } - } - - // Set the length of the Node Managers - // - // why cannot we use the provate variable in the above "for" loop? - // - this->num_child_plans_ = num_plans; - - // Indicate success - return true; -} - -//@@ We should ask those spec writers to look at the code below, hopefully -// They will realize some thing. -int -CIAO::DomainApplicationManager_AMH_Impl::split_plan (void) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::split_plan"); - - // Initialize the total number of child deployment plans specified - // by the global plan. - CORBA::ULong i; - - for ( i = 0; i < this->num_child_plans_; ++i) - { - ::Deployment::DeploymentPlan_var tmp_plan; - ACE_NEW_RETURN (tmp_plan, - ::Deployment::DeploymentPlan, - 0); - - // Construct the UUID for the child plan. - // Currently, this UUID consists of: - // The global UUID for the parent plan + the name of the node the - // child plan is to be installed on. - ACE_CString child_uuid (this->plan_.UUID.in ()); - child_uuid += "@"; - child_uuid += this->node_manager_names_[i]; - - tmp_plan->UUID = CORBA::string_dup (child_uuid.c_str ()); - tmp_plan->implementation.length (0); - tmp_plan->instance.length (0); - tmp_plan->connection.length (0); - tmp_plan->externalProperty.length (0); - tmp_plan->dependsOn.length (0); - tmp_plan->artifact.length (0); - - // @@ There is an optimization point here, since we really don't have to - // pass the entire CIAOServerResources into each individual child plan. - tmp_plan->infoProperty = this->plan_.infoProperty; - - //tmp_plan->infoProperty[0].name = CORBA::string_dup ("CIAOServerResource"); - //tmp_plan->infoProperty[0].value = this->plan_.infoProperty[0].value; - - Chained_Artifacts artifacts; - - // Fill in the child_plan_ field, relinquishing ownership - artifacts.child_plan_ = tmp_plan._retn (); - - // Fill in the node_manager_ field. - artifacts.node_manager_ = - this->deployment_config_.get_node_manager - (this->node_manager_names_[i].c_str ()); - - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find - (node_manager_names_[i], entry) == 0) - artifacts.old_child_plan_ = (entry->int_id_).child_plan_; - else - artifacts.old_child_plan_ = 0; - - // In case we are doing redeployment, rebind will help replace the - // old child plan with the new child plan. - this->artifact_map_.rebind (node_manager_names_[i], artifacts); - } - - // (1) Iterate over the <instance> field of the global DeploymentPlan - // structure. - // (2) Retrieve the necessary information to contruct the node-level - // plans one by one. - for ( i = 0; i < (this->plan_.instance).length (); ++i) - { - // @@TODO Fill in the child deployment plan in the map. - // If the component instance already exists in the child plan, - // then we overwrite the existing instance, since the new instance - // might have different resource usage requirements. - - - - // Get the instance deployment description - const ::Deployment::InstanceDeploymentDescription & my_instance = - (this->plan_.instance)[i]; - - // Find the corresponding child deployment plan entry in - // the hash map for this instance. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find - (ACE_CString (my_instance.node.in ()), - entry) != 0) - return 0; // no valid name found. - - // Get the child plan. - ::Deployment::DeploymentPlan_var &child_plan = - (entry->int_id_).child_plan_; - - // Fill in the contents of the child plan entry. - - // Append the "MonolithicDeploymentDescriptions implementation" - // field with a new "implementation", which is specified by the - // <implementationRef> field of <my_instance> entry. NOTE: The - // <artifactRef> field needs to be changed accordingly. - const ::Deployment::MonolithicDeploymentDescription & my_implementation = - (this->plan_.implementation)[my_instance.implementationRef]; - - // Deployment::DnC_Dump::dump (this->plan_); - //Deployment::DnC_Dump::dump ( (this->plan_.implementation)[my_instance.implementationRef]); - //ACE_DEBUG ((LM_DEBUG, "My implementation")); - //Deployment::DnC_Dump::dump (my_implementation); - - CORBA::ULong index_imp = child_plan->implementation.length (); - child_plan->implementation.length (++index_imp); - child_plan->implementation[index_imp-1] = my_implementation; - - // Initialize with the correct sequence length. - CORBA::ULongSeq ulong_seq; - ulong_seq.length (my_implementation.artifactRef.length ()); - - // Append the "ArtifactDeploymentDescriptions artifact" field - // with some new "artifacts", which is specified by the - // <artifactRef> sequence of <my_implementation> entry. - const CORBA::ULong impl_length = my_implementation.artifactRef.length (); - for (CORBA::ULong iter = 0; - iter < impl_length; - iter ++) - { - CORBA::ULong artifact_ref = my_implementation.artifactRef[iter]; - - // Fill in the <artifact> field of the child plan - CORBA::ULong index_art = child_plan->artifact.length (); - child_plan->artifact.length (++index_art); - child_plan->artifact[index_art-1] = - (this->plan_.artifact)[artifact_ref]; - - // Fill in the <artifactRef> field of the MonolithicDeploymentDescription - ulong_seq[iter] = index_art-1; - } - - // Change the <artifactRef> field of the "implementation". - child_plan->implementation[index_imp-1].artifactRef = ulong_seq; - - // Append the "InstanceDeploymentDescription instance" field with - // a new "instance", which is almost the same as the "instance" in - // the global plan except the <implementationRef> field. - // NOTE: The <implementationRef> field needs to be changed accordingly. - CORBA::ULong index_ins = child_plan->instance.length (); - child_plan->instance.length (++index_ins); - child_plan->instance[index_ins-1] = my_instance; - - // Change the <implementationRef> field of the "instance". - // @@ The implementationRef starts from 0. - // @@TODO: Below logic needs to be changed once we want to avoid - // duplicate <implementation> for the optimization. - child_plan->instance[index_ins-1].implementationRef = index_ins-1; - } - - return 1; -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -add_connections (const Deployment::Connections & incoming_conn) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::add_connections"); - - CORBA::ULong const old_len = this->all_connections_->length (); - - // Expand the length of the <all_connection_> sequence. - this->all_connections_->length (old_len + incoming_conn.length ()); - - // Store the connections to the <all_conections_> sequence - const CORBA::ULong conn_lenth = incoming_conn.length (); - for (CORBA::ULong i = 0; i < conn_lenth; ++i) - { - (*this->all_connections_)[old_len + i] = incoming_conn[i]; - } -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -startLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::startLaunch"); - ACE_UNUSED_ARG (start); - - try - { - // Clean up all cached connections first - this->all_connections_->length (0); - - // Invoke startLaunch() operations on each cached NodeApplicationManager - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplicationManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl:startLaunch", - error.c_str ())); - } - - ::Deployment::NodeApplicationManager_ptr my_nam = - (entry->int_id_).node_application_manager_.in (); - - if (CORBA::is_nil (my_nam)) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("While starting launch, the DomainApplicationManager\ - has a nil reference for NodeApplicationManager\n"); - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl::startLaunch", - error.c_str ())); - } - - - ::Deployment::Connections_var retn_connections; - - // Obtained the returned NodeApplication object reference - // and the returned Connections variable. - ::Deployment::Application_var temp_application; - if (!is_redeployment_) - { - temp_application = - my_nam->startLaunch (configProperty, - retn_connections.out (), - 0); - } - else - { - //============================================================= - // Add New Components Logic - //============================================================= - // Let's add new components only now, the to-be-removed - // components should be removed AFTER the connections - // are removed. - temp_application = - my_nam->perform_redeployment (configProperty, - retn_connections.out (), - true, // add new components only now - 0); - } - - // Narrow down to NodeApplication object reference - ::Deployment::NodeApplication_var my_na = - ::Deployment::NodeApplication::_narrow (temp_application.in ()); - - if (CORBA::is_nil (my_na.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("The DomainApplicationManager receives a nil " - "reference of NodeApplication after calling " - "startLaunch on NodeApplicationManager.\n"); - ACE_ERROR ((LM_ERROR, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl::startLaunch", - error.c_str ())); - } - - // Cache the returned set of connections into the list. - this->add_connections (retn_connections.in ()); - - // Cache the returned NodeApplication object reference into - // the hash table. - (entry->int_id_).node_application_ = my_na._retn (); - } - - this->synchronize_shared_components_with_node_managers (); - } - catch (const Deployment::StartError& ex) - { - ACE_DEBUG ((LM_DEBUG, "DAM_Impl:StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::startLaunch\t\n"); - throw; - } - - _tao_rh->startLaunch (); - -} - - -void -CIAO::DomainApplicationManager_AMH_Impl::install_all_es (void) -{ - try - { - for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) - { - // Find NA, and then invoke operation on it - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->esd_[j].node.in (), - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::install_all_es -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->esd_[j].node.in ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->esd_[j].node.in (); - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl::install_all_es", - error.c_str ())); - } - - // Invoke install_es () operation on each cached NodeApplication object. - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - ::CIAO::CIAO_Event_Service_var ciao_es = - my_na->install_es (this->esd_[j]); - - // Add these returned ES objects into the cached map - this->add_es_to_map (this->esd_[j].name.in (), ciao_es.in ()); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::install_all_es.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -add_es_to_map (const char * node_name, - CIAO::CIAO_Event_Service * ciao_es) -{ - try - { - this->es_map_.bind ( - node_name, - CIAO::CIAO_Event_Service::_duplicate (ciao_es)); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::add_es_to_map.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -finishLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - CORBA::Boolean start, - CORBA::Boolean is_ReDaC) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::finishLaunch"); - try - { - // Install all the CIAO_Event_Services within the Deployment Plan - this->install_all_es (); - - // Invoke finishLaunch() operation on each cached NodeApplication object. - // This will establish bindings for only those internal components, but - // NOT for those external/shared components, which requires special - // handling, since these components are outside the control of this - // DomainApplicationManager. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::finishLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl::finishLaunch", - error.c_str ())); - } - - //@@ Note: Don't delete the below debugging helpers. - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump incoming connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (this->all_connections_.in ()); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - } - - // Get the Connections variable, if ReDaC is true, then we get - // those new connections only. NOTE: get_outgoing_connections - // by default will get *all* connections. - Deployment::Connections * my_connections = - this->get_outgoing_connections ( - (entry->int_id_).child_plan_.in (), - !is_ReDaC, - true, // we search *new* plan - DomainApplicationManager_AMH_Impl::Internal_Connections); - - if (my_connections == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::finishLaunch -" - "ERROR while getting the outgoing connections " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl::finish_launch", - "There was some error establishing connections.")); - } - - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 1) - { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump outgoing connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (*my_connections); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - } - - // Invoke finishLaunch() operation on NodeApplication. - if (my_connections->length () != 0) - { - entry->int_id_.node_application_->finishLaunch - (*my_connections, - start, - true // "true" => establish new connections only - ); - } - - //============================================================= - // Remove Old Connections Logic - //============================================================= - - if (is_ReDaC) // We should also *REMOVE* unnecessary connections - { - // If this is a brand new child plan, then continue. - if ((entry->int_id_).old_child_plan_ == 0) - continue; - - // Get all the connections in the old deployment plan - Deployment::Connections * connections_in_old_plan = - this->get_outgoing_connections ( - (entry->int_id_).old_child_plan_.in (), - true, // yes, get *all* the connections - false, // search in the *old* plan - DomainApplicationManager_AMH_Impl::Internal_Connections); - - // Pass in the "false" parameter to get *all* the connections in - // the new deployment plan, regardless those in old plan - Deployment::Connections * connections_in_new_plan = - this->get_outgoing_connections ( - (entry->int_id_).child_plan_.in (), - true, // yes, get *all* the connections - true, // search in the *new* plan - DomainApplicationManager_AMH_Impl::Internal_Connections); - - Deployment::Connections * unnecessary_connections = - this->subtract_connections (*connections_in_old_plan, - *connections_in_new_plan); - - delete connections_in_old_plan; - delete connections_in_new_plan; - - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 1) - { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump to-be-removed connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (*unnecessary_connections); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - } - - // Invoke finishLaunch() operation on NodeApplication. - if (unnecessary_connections->length () != 0) - { - if (CORBA::is_nil (entry->int_id_.node_application_.in ())) - throw Deployment::StartError (); - - entry->int_id_.node_application_->finishLaunch - (*unnecessary_connections, - start, - false // false ==> remove unnecessary connections - ); - } - - //============================================================= - // Remove Old Components - //============================================================= - // Finally we need to remove those to-be-removed components - ::Deployment::Properties_var configProperty; - ACE_NEW (configProperty, - Deployment::Properties); - - ::Deployment::Connections_var retn_connections; - - Deployment::Application_var temp_application = - entry->int_id_.node_application_manager_-> - perform_redeployment (configProperty, - retn_connections.out (), - false, // remove old components only - false);// do not "start" - } - } - - // Establish bindings on external/shared components of this deployment plan. - this->post_finishLaunch (); - } - catch (const Deployment::StartError& ex) - { - ACE_ERROR ((LM_ERROR, "DAM_Impl::finishLaunch - StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::finishLaunch: ""Killing NodeApplications.\n"); - - // Invoke destroyManager() operation on each cached - // NodeManager object. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager and NodeApplicationManager object references. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; - this->artifact_map_.find (this->node_manager_names_[i],entry); - - ::Deployment::NodeApplicationManager_ptr - my_node_application_manager = - (entry->int_id_).node_application_manager_.in (); - - // Invoke destoryApplication() operation on the NodeApplicationManger. - // Since we have the first arg is not used by NAM anyway. - my_node_application_manager->destroyApplication - (0); - } - throw; - } - - _tao_rh->finishLaunch (); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -post_finishLaunch (void) -{ - try - { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->finalize_global_binding ( - *binding, true); - - delete binding; - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::post_finishLaunch.\n"); - throw; - } - -} - -CIAO::Component_Binding_Info * -CIAO::DomainApplicationManager_AMH_Impl:: -populate_binding_info (const ACE_CString& name, - const ACE_CString& child_uuid) -{ - CIAO::Component_Binding_Info * retv; - ACE_NEW_RETURN (retv, - CIAO::Component_Binding_Info (), - 0); - - retv->name_ = name; - - // Parse the child_uuid string and populate the "node" name and - // "plan_uuid" fields. Our protocol here is searching for the "@", - // the substring *before* that is the global plan uuid, and the - // substring *after* that is the node name. - ACE_CString::size_type pos = child_uuid.find ('@'); - - retv->plan_uuid_ = - child_uuid.substring (0, pos); - - retv->node_ = - child_uuid.substring (pos + 1, - ACE_CString::npos); // get the rest of the string - - Deployment::Connections_var connections; - ACE_NEW_RETURN (connections, - Deployment::Connections, - 0); - - this->get_outgoing_connections_i (name.c_str (), - connections.inout (), - false, // get *all* connections - true); // search current plan - - retv->providedReference_ = connections._retn (); - - return retv; -} - -CIAO::Component_Binding_Info * -CIAO::DomainApplicationManager_AMH_Impl:: -populate_binding_info (const ACE_CString& name) -{ - CIAO::Component_Binding_Info * retv; - ACE_NEW_RETURN (retv, - CIAO::Component_Binding_Info (), - 0); - - // Looking for the child plan uuid through the shared compoonent list - for (CORBA::ULong i = 0; i < this->shared_->length (); ++i) - { - if (ACE_OS::strcmp (this->shared_[i].name.in (), - name.c_str ()) == 0) - { - ACE_CString child_uuid = this->shared_[i].plan_uuid.in (); - retv = this->populate_binding_info (name, child_uuid); - return retv; - } - } - - return 0; // If no matching is found (should never happen). -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -add_shared_components (const Deployment::ComponentPlans & shared) -{ - for (CORBA::ULong i = 0; i < shared.length (); ++i) - { - CORBA::ULong curr_len = this->shared_->length (); - this->shared_->length (curr_len + 1); - this->shared_[curr_len] = shared[i]; - } -} - -bool -CIAO::DomainApplicationManager_AMH_Impl:: -is_shared_component (const char * name) -{ - for (CORBA::ULong i = 0; i < this->shared_->length (); ++i) - { - if (ACE_OS::strcmp (this->shared_[i].name.in (), - name) == 0) - return true; - } - - return false; -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -synchronize_shared_components_with_node_managers (void) -{ - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_AMH_Impl:startLaunch", - error.c_str ())); - } - - // Update the shared components list - ::Deployment::NodeManager_ptr - my_node_manager = (entry->int_id_).node_manager_.in (); - - Deployment::ComponentPlans_var - shared = my_node_manager->get_shared_components (); - - this->add_shared_components (shared.in ()); - } -} - - -Deployment::Connections * -CIAO::DomainApplicationManager_AMH_Impl:: -get_outgoing_connections (const Deployment::DeploymentPlan &plan, - bool is_getting_all_connections, - bool is_search_new_plan, - Connection_Search_Type t) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::get_outgoing_connections"); - Deployment::Connections_var connections; - ACE_NEW_RETURN (connections, - Deployment::Connections, - 0); - - // For each component instance in the child plan ... - CORBA::ULong number = plan.instance.length (); - for (CORBA::ULong i = 0; i < number; ++i) - { - - if (t == Internal_Connections && - this->is_shared_component (plan.instance[i].name.in ())) - continue; - - // Get the outgoing connections of the component - if (!get_outgoing_connections_i (plan.instance[i].name.in (), - connections.inout (), - is_getting_all_connections, - is_search_new_plan)) - return 0; - } - return connections._retn (); -} - - -// Get outgoing connections for particular instance -bool -CIAO::DomainApplicationManager_AMH_Impl:: -get_outgoing_connections_i (const char * instname, - Deployment::Connections & retv, - bool is_getting_all_connections, - bool is_search_new_plan) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::get_outoing_connections_i"); - - Deployment::DeploymentPlan tmp_plan; - if (is_search_new_plan) - tmp_plan = this->plan_; - else - tmp_plan = this->old_plan_; - - // Search for all the bindings in the plan. - const CORBA::ULong total_length = tmp_plan.connection.length(); - for (CORBA::ULong i = 0; i < total_length; ++i) - { - // Current binding that we are looking at. - const Deployment::PlanConnectionDescription & binding = - tmp_plan.connection[i]; - - // If this is a ReDaC case, then we ignore the connection if it - // already exists in the old_plan - if (already_exists (binding) && - !is_getting_all_connections) - continue; - - this->populate_connection_for_binding (instname, - binding, - tmp_plan, - retv); - } - return true; -} - -// Search the current binding to see whether a connection of this -// component needs to be populated -bool -CIAO::DomainApplicationManager_AMH_Impl:: -populate_connection_for_binding ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - const CORBA::ULong binding_len = binding.internalEndpoint.length (); - - // If only 1 internalEndpoint, then we know it's through event service. - if (binding_len == 1) - { - return - this->handle_es_connection (instname, - binding, - plan, - retv); - } - else if (binding_len == 2) - { - return this->handle_direct_connection (instname, - binding, - plan, - retv); - } - else // invalid binding encounted... - return false; -} - -bool -CIAO::DomainApplicationManager_AMH_Impl:: -handle_es_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - // The initial retv might have something inside - CORBA::ULong len = retv.length (); - - const Deployment::PlanSubcomponentPortEndpoint & endpoint = - binding.internalEndpoint[0]; - - // If the instance name does NOT match one of the names in the binding - // Then thsi binding has nothing related to myself (an instance) - if (ACE_OS::strcmp (instname, - plan.instance[endpoint.instanceRef].name.in ()) != 0) - return false; - - if (binding.externalReference.length () != 1) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::" - "handle_publisher_es_connection -" - "externalReference must have length of 1.\n")); - return false; - } - - retv.length (len+1); - retv[len].instanceName = instname; - retv[len].portName = endpoint.portName.in (); - retv[len].kind = endpoint.kind; - - ACE_CString es_id = binding.externalReference[0].location.in (); - - retv[len].endpointInstanceName = es_id.c_str (); - retv[len].endpointPortName = CORBA::string_dup ("CIAO_ES"); - - // We need to populate the actual filter and store it into - // the <connection.config> field - if (binding.deployRequirement.length () != 0) - { - retv[len].config = - * (this->get_connection_QoS_configuration (binding.deployRequirement[0])); - } - - // If we didnt find the objref of the connection ... - CIAO::CIAO_Event_Service_var es; - - if (this->es_map_.find (es_id.c_str (), es) != 0) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_AMH_Impl::create_connections_i", - error.c_str ()); - } - - retv[len].event_service = es._retn (); - - // One more thing needs to be done if this is a es_consumer connection - // We need to populate the <endpoint> field of this connection, which - // is the object reference of this event consumer port. - if (endpoint.kind == Deployment::EventConsumer) - { - // Now we search in the received connections to get the objRef of event sink - bool found = false; - const CORBA::ULong all_conn_len = this->all_connections_->length (); - for (CORBA::ULong j = 0; j < all_conn_len; ++j) - { - const Deployment::Connection & curr_recv_conn = - this->all_connections_[j]; - - // We need to look at the instance name and the port name to confirm. - if (ACE_OS::strcmp (curr_recv_conn.instanceName.in (), - instname) == 0 && - ACE_OS::strcmp (curr_recv_conn.portName.in (), - endpoint.portName.in ()) == 0) - { - retv[len].endpoint = - CORBA::Object::_duplicate(curr_recv_conn.endpoint.in ()); - found = true; - } - } // End of searching received connections - - if (!found) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_AMH_Impl::handle_es_connection", - error.c_str ()); - } - } - - return true; -} - -bool -CIAO::DomainApplicationManager_AMH_Impl:: -handle_direct_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - // The initial retv might have something inside - CORBA::ULong len = retv.length (); - - const CORBA::ULong binding_len = binding.internalEndpoint.length (); - for (CORBA::ULong i = 0; i < binding_len; ++i) - { - const Deployment::PlanSubcomponentPortEndpoint & endpoint = - binding.internalEndpoint[i]; - - // If the instance name does NOT match one of the names in the binding - if (ACE_OS::strcmp (instname, - plan.instance[endpoint.instanceRef].name.in ()) != 0) - continue; - - // We are only interested when we are the "client" of the endpoint objref - if (endpoint.kind == Deployment::EventPublisher || - endpoint.kind == Deployment::EventEmitter || - endpoint.kind == Deployment::SimplexReceptacle || - endpoint.kind == Deployment::MultiplexReceptacle ) - { - // Obtain the index of the "real" endpoint which has an objref. It - // is the opposite side of myself. - CORBA::ULong e_index = (i + 1) % 2; - - ACE_CString source_port = - binding.internalEndpoint[i].portName.in (); - - ACE_CString endpoint_inst = - plan.instance[binding.internalEndpoint[e_index] - .instanceRef].name.in (); - - ACE_CString endpoint_port = - binding.internalEndpoint[e_index].portName.in (); - - bool found = false; - - // Now we search in the received connections to get the objRef. - const CORBA::ULong all_conn_len = this->all_connections_->length (); - for (CORBA::ULong j = 0; j < all_conn_len; ++j) - { - const Deployment::Connection & curr_recv_conn = - this->all_connections_[j]; - - // We need to look at the instance name and the port name to confirm. - if (ACE_OS::strcmp (curr_recv_conn.instanceName.in (), - endpoint_inst.c_str ()) == 0 && - ACE_OS::strcmp (curr_recv_conn.portName.in (), - endpoint_port.c_str ()) == 0) - { - retv.length (len+1); - retv[len].instanceName = instname; - retv[len].portName = source_port.c_str (); - retv[len].endpointInstanceName = endpoint_inst.c_str (); - retv[len].endpointPortName = endpoint_port.c_str (); - - retv[len].endpoint = - CORBA::Object::_duplicate(curr_recv_conn.endpoint.in ()); - retv[len].kind = binding.internalEndpoint[i].kind; - - ++len; - found = true; - break; - } - } // End of searching received connections - - // We didnt find the objref of the connection ... - if (!found) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_AMH_Impl::create_connections_i", - error.c_str ()); - } - break; - } - } - return true; -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -start ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::start"); - - try - { - CORBA::ULong i; - - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw Deployment::StartError( - "DomainApplicationManager_AMH_Impl:startLaunch", - error.c_str ()); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->ciao_preactivate (); - } - - // Invoke start () operation on each cached NodeApplication object. - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - throw Deployment::StartError (); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->start (); - } - - // Invoke ciao_postctivate () operation on each - // cached NodeApplication object. - - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw Deployment::StartError( - "DomainApplicationManager_AMH_Impl:startLaunch", - error.c_str ()); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->ciao_postactivate (); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("DomainApplicationManager_AMH_Impl::start\t\n"); - throw; - } - - _tao_rh->start (); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -destroyApplication ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::destroyApplication"); - 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 <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_AMH_Impl.cpp -" - "CIAO::DomainApplicationManager_AMH_Impl::destroyApplication -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StopError - ("DomainApplicationManager_AMH_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_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *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, we search the current plan - DomainApplicationManager_AMH_Impl::External_Connections); - - // Invoke finishLaunch() on NodeApplication to remove bindings. - // If this NodeApplication is not within the control of this DAM, - // then we should delegate the call to the correct DAM through EM. - - // Iterave over the returned connection list in <connections>, - // (1) If this is a shared component, then we remove this connection - // from <connections> list, and then populate a "Component_Binding_Info" - // struct for it and send to EM for remove. - // (2) For the rest of the connections, we send them to the NAs - // managed by the local DAM to remove. - - for (CORBA::ULong j = 0; j < connections->length (); ++j) - { - 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 (inst_name.c_str ()); - - this->execution_manager_->finalize_global_binding ( - *binding, false); - - // Remove all the connections whose "source" component - // is this component instance from the <connections> list - this->purge_connections (connections, - inst_name.c_str ()); - } - } - - if (connections->length () > 0) - { - entry->int_id_.node_application_->finishLaunch - (connections.in (), - true, // "true" ==> start the components - false // "false" => remove connections - ); - } - - } - - // After all the connections are removed, we actually destroy - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - this->artifact_map_.find (this->node_manager_names_[i], entry); - - // Invoke destroyPlan() operation on the NodeManager - Deployment::NodeManager_var - my_node_manager = (entry->int_id_).node_manager_; - - my_node_manager->destroyPlan ((entry->int_id_).child_plan_); - } - - // ?? - // Shall we invoke destroyManager () operation on the NodeManager, since we need - // 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 (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::destroyApplication\t\n"); - throw; - } - - _tao_rh->destroyApplication (); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -destroyManager ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::destroyManager"); - try - { - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager and NodeApplicationManager object references. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - throw Deployment::StopError (); // Should never happen! - - ::Deployment::NodeManager_var my_node_manager = - (entry->int_id_).node_manager_; - - ::Deployment::NodeApplicationManager_var my_nam = - (entry->int_id_).node_application_manager_; - - my_node_manager->destroyManager (my_nam.in ()); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::destroyManager\t\n"); - throw; - } - _tao_rh->destroyManager (); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -perform_redeployment ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const Deployment::DeploymentPlan & plan) -{ - // Currently we could dynamically update the NodeManagerMap topology, - // but later maybe we could add another parameter to this operation, - // which allows the user to specify the new NodeManagerMap data file. - this->old_plan_ = this->plan_; - this->is_redeployment_ = true; - this->plan_ = plan; - - try - { - // Call init() on the myself, which will validate/split the plan and - // call preparePlan on each NodeManager, by this, we shall get - // all the object references of NM and NAM associated with each - // component instance populated. - this->init (); - - // Call startLaunch on each NM for each child plan, this should not only - // install all the new components specified, but should also remove - // the components that are no longer in the new deployment plan. - // Meanwhile, we should set up the container configurations appropriately, - // whose information is fully captured in the node-level deployment plan. - ::Deployment::Properties_var properties; - ACE_NEW (properties, - Deployment::Properties); - - this->startLaunch (_tao_rh, properties.in (), false); - - // finishLaunch will (1) establish new connections, and (2) - // get rid of those non-existing connections. As we know, in the - // node level, the connections are cached within the NodeApplication *and* - // Container, then we should modify the implementation of the - // <finishLaunch> on the NodeApplication to accomplish this. - this->finishLaunch (_tao_rh, true, true); // true means start activation also. - // ture means "ReDaC" is desired - - this->start (_tao_rh); - - _tao_rh->perform_redeployment (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::perform_redeployment\t\n"); - this->plan_ = this->old_plan_; - throw; - } -} - - -void -CIAO::DomainApplicationManager_AMH_Impl:: -getPlan (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::getPlan"); - Deployment::DeploymentPlan_var plan = 0; - // Make a deep copy of the Plan - ACE_NEW_THROW_EX (plan, - Deployment::DeploymentPlan (this->plan_), - CORBA::NO_MEMORY ()); - - _tao_rh->getPlan (plan.in ()); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -dump_connections (const ::Deployment::Connections & connections) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMH_Impl::dump_connections"); - const CORBA::ULong conn_len = connections.length (); - for (CORBA::ULong i = 0; i < conn_len; ++i) - { - ACE_DEBUG ((LM_DEBUG, - "instanceName: %s\n", connections[i].instanceName.in ())); - - ACE_DEBUG ((LM_DEBUG, "portName: %s\n", connections[i].portName.in ())); - - ACE_DEBUG ((LM_DEBUG, "portkind: ")); - - switch (connections[i].kind) - { - case Deployment::Facet: - - ACE_DEBUG ((LM_DEBUG, "Facet\n")); - break; - - case Deployment::SimplexReceptacle: - - ACE_DEBUG ((LM_DEBUG, "SimplexReceptacle\n")); - break; - - case Deployment::MultiplexReceptacle: - - ACE_DEBUG ((LM_DEBUG, "MultiplexReceptacle\n")); - break; - - case Deployment::EventEmitter: - - ACE_DEBUG ((LM_DEBUG, "EventEmitter\n")); - break; - - case Deployment::EventPublisher: - - ACE_DEBUG ((LM_DEBUG, "EventPublisher\n")); - break; - - case Deployment::EventConsumer: - - ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); - break; - - default: - ACE_DEBUG ((LM_DEBUG, "Unknown port kind.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "endpointInstanceName: %s\n", - connections[i].endpointInstanceName.in ())); - - ACE_DEBUG ((LM_DEBUG, - "endpointPortName: %s\n", - connections[i].endpointPortName.in ())); - ACE_DEBUG ((LM_DEBUG, "---------------------\n")); - } -} - -bool -CIAO::DomainApplicationManager_AMH_Impl:: -already_exists (const Deployment::PlanConnectionDescription & conn) -{ - const CORBA::ULong conn_len = this->old_plan_.connection.length(); - for(CORBA::ULong i = 0; i < conn_len; ++i) - { - if (ACE_OS::strcmp (this->old_plan_.connection[i].name.in (), - conn.name.in ()) == 0) - return true; - } - - return false; -} - -Deployment::Connections * -CIAO::DomainApplicationManager_AMH_Impl:: -subtract_connections (const Deployment::Connections & left, - const Deployment::Connections & right) -{ - Deployment::Connections_var retv; - ACE_NEW_RETURN (retv, - Deployment::Connections, - 0); - - CORBA::ULong left_length = left.length (); - CORBA::ULong right_length = right.length (); - for (CORBA::ULong i = 0; i < left_length; ++i) - { - bool found = false; - for (CORBA::ULong j = 0; j < right_length; ++j) - { - if (ACE_OS::strcmp (left[i].instanceName.in (), - right[j].instanceName.in ()) == 0 && - ACE_OS::strcmp (left[i].portName.in (), - right[j].portName.in ()) == 0 && - left[i].kind == right[j].kind && - left[i].endpoint->_is_equivalent (right[j].endpoint.in ())) - { - found = true; - break; - } - } - - if (!found) - { - CORBA::ULong curr_length = retv->length (); - retv->length (curr_length + 1); - retv[curr_length] = left[i]; - } - } - return retv._retn (); -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -passivate_shared_components (void) -{ - try - { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->passivate_shared_components ( - *binding); - - delete binding; - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::passivate_shared_components.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_AMH_Impl:: -activate_shared_components (void) -{ - try - { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->activate_shared_components ( - *binding); - - delete binding; - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_AMH_Impl::activate_shared_components.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_AMH_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 <inst> - 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); - } -} - -const Deployment::Properties * -CIAO::DomainApplicationManager_AMH_Impl:: -get_connection_QoS_configuration (const Deployment::Requirement & requirement) -{ - // Get the name/identifier of the filter associated with - // this connection - Deployment::Properties * retv; - ACE_NEW_NORETURN (retv, Deployment::Properties); - - CORBA::ULong len = retv->length (); - - for (CORBA::ULong i = 0; - i < requirement.property.length (); - ++i) - { - const char *filter_name; - if (ACE_OS::strcmp ("EventFilter", - requirement.property[i].name) == 0) - { - - if ((requirement.property[i].value >>= filter_name) == false) - ACE_ERROR ((LM_ERROR, - "ERROR: DomainApplicationManager_AMH_Impl::" - "get_connection_QoS_configuration unable to " - "extract event filter information\n")); - } - - // Search for the desired filter - for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) - { - // Populate the "filters" info, in case this CIAO_Event_Service has - // one or more filters specified through descriptors - for (CORBA::ULong k = 0; k < this->esd_[j].filters.length (); ++k) - { - if (ACE_OS::strcmp (this->esd_[j].filters[k].name.in (), - filter_name) == 0) - { - retv->length (len + 1); - (*retv)[len].name = CORBA::string_dup ("EventFilter"); - (*retv)[len].value <<= this->esd_[j].filters[k]; - break; - } - } - } - } - return retv; -} diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.h b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.h deleted file mode 100644 index af79e1b42ef..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.h +++ /dev/null @@ -1,467 +0,0 @@ -//================================================================== -/** - * @file DomainApplicationManager_AMH_Impl.h - * - * $Id$ - * - * This file contains the AMH implementation for the servant of - * Deployment::DomainApplicationManager. - * - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//===================================================================== - -#ifndef CIAO_DOMAINAPPLICATIONMANAGER_AMH_IMPL_H -#define CIAO_DOMAINAPPLICATIONMANAGER_AMH_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -#include "ace/Hash_Map_Manager.h" -#include "ace/Vector_T.h" -#include "ace/Functor.h" -#include "ace/OS_NS_string.h" - -#include "DAnCE/Deployment/Deployment_DomainApplicationManagerS.h" -#include "DAnCE/Deployment/Deployment_common.h" - -#include "tao/Valuetype/ValueBase.h" -#include "tao/Valuetype/Valuetype_Adapter_Impl.h" - -#include "ciao/CIAO_common.h" -#include "DAnCE/Deployment/Deployment_EventsC.h" - -#include "Deployment_Configuration.h" -#include "DomainApplicationManager_Export.h" - -namespace CIAO -{ - namespace Execution_Manager - { - class Execution_Manager_Impl; - } - - /** - * @class DomainApplicationManager_Impl - * - * @brief A servant for the Deployment::DomainApplicationManager - * interface. The DomainApplicationManager is responsible for - * deploying an application on the domain level, i.e. across - * nodes. It specializes the ApplicationManager abstract interface. - */ - class DomainApplicationManager_Export DomainApplicationManager_AMH_Impl - : public virtual POA_Deployment::AMH_DomainApplicationManager - { - public: - - /// External_Connections means we search all the connections including - /// the connectiosn for external/shared components of this plan which hold - /// port objrefs of components within this plan - enum Connection_Search_Type - { - External_Connections, - Internal_Connections - }; - - /// Define the type which contains a list of DnC artifacts. - /// @@ Assumption: Each NodeApplicationManager create only one - /// NodeApplication when the startLaunch() operation is invoked, - /// which means all the nodes on that child plan are collocated in - /// the same process. - typedef struct _chained_artifacts - { - ::Deployment::NodeManager_var node_manager_; - ::Deployment::DeploymentPlan_var child_plan_; - ::Deployment::NodeApplicationManager_var node_application_manager_; - ::Deployment::NodeApplication_var node_application_; - ::Deployment::DeploymentPlan_var old_child_plan_; - } Chained_Artifacts; - - /// Constructor - DomainApplicationManager_AMH_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl * em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file); - - - /*=========================================================== - * Below are helper methods for the DomainApplicationManager - * - *============================================================*/ - /** - * Initialize the DomainApplicationManager. - * @para em A pointer to the ExecutionManager servant C++ object. - * - * (1) Set the total number of child plans. - * (2) Set the list of NodeManager names, which is an array of strings. - * The <node_manager_names> is a pointer to an array of ACE_CString - * objets, which is allocated by the caller and deallocated by the - * DomainApplicationManager destructor. - * (3) Check the validity of the deployment plan and the deployment - * information data file. - * (4) Call split_plan () member function. - * (5) Invoke all the preparePlan () operations on all the corresponding - * NodeManagers with child plans. - * - * - * @@ What else do we need to initialize here? - */ - void init (); - - /** - * set_uuid method on the DomainApplicationManager assigns the - * UUID of the associated plan to this Manager. This helps in - * reverse lookup operations such as given a manager, obtaining - * the UUID associated. The get_uuid method is used in this case. - */ - void set_uuid (const char * uuid); - - const char * get_uuid () const; - - /*=========================================================== - * Below are operations from the DomainApplicationManager - * - *============================================================*/ - - /** - * Fetch the NodeApplication object reference based on the NodeManager name. - */ - virtual void get_node_app ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const char * node_name); - - /** - * Executes the application, but does not start it yet. Users can - * optionally provide launch-time configuration properties to - * override properties that are part of the plan. Raises the - * InvalidProperty exception if a configuration property is - * invalid. Raises the StartError exception if an error occurs - * during launching. Raises the ResourceNotAvailable exception if - * the commitResources parameter to the prepare operation of the - * ExecutionManager was true, if late resource allocation is used, - * and one of the requested resources is not available. - */ - virtual void startLaunch ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start); - /** - * The second step in launching an application in the - * domain-level. If the start parameter is true, the application - * is started as well. Raises the StartError exception if - * launching or starting the application fails. - */ - virtual void finishLaunch ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - CORBA::Boolean start, - CORBA::Boolean is_ReDAC); - - /** - * The last step in launching an application in the - * domain-level. We establish connection bindings - * for external/shared components of this deployment plan - * components. - * Internally, this operation will invoke some operations - * on ExecutionManager to finish up this task. - */ - virtual void post_finishLaunch (void); - - virtual void passivate_shared_components (void); - - virtual void activate_shared_components (void); - - /** - * Starts the application. Raises the StartError exception if - * starting the application fails. - */ - virtual void start ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh); - - /** - * Terminates a running application. Raises the StopError - * exception if an error occurs during termination. Raises the - * InvalidReference exception if the appliction reference is - * unknown. - */ - virtual void destroyApplication ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh); - - /** - * Returns the DeploymentPlan associated with this ApplicationManager. - */ - virtual void getPlan ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh); - - /** - * This is a helper function to destroy the NodeAppManager. - * Since we don't want to do so in the destructor so we will - * ask the ExecutionManager to do this on us when the same IDL - * op invoked on it. This is part of the result for merging DAM - * with DA. - */ - virtual void destroyManager ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh); - - // The input parameter is a *new_plan* which has the - // same UUID of the existing running plan. - virtual void perform_redeployment ( - Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const Deployment::DeploymentPlan & plan); - - protected: - /// Destructor - virtual ~DomainApplicationManager_AMH_Impl (void); - - /** - * (1) Parse the global deployment plan, get the total number of - * child plans included in the global plan, and get the list of - * names of NodeManagers for each child plan. - * (2) Check whether all the NodeManager names are present in the - * deployment information data file. - */ - bool get_plan_info (void); - - /** - * Split the global (domain-level) deployment plan to a set of - * local (node-level) deployment plans. The set of local plans - * are cached in the ACE hash map member variable. - * Also, fill in the <node_manager_> field of the Chained_Artifacts - * struct. - */ - int split_plan (void); - - /** - * Construct <Component_Binding_Info> struct for the component instance. - * - * @param name component instance name - * @param child_uuid child plan uuid string - */ - CIAO::Component_Binding_Info * - populate_binding_info (const ACE_CString& name, - const ACE_CString& child_uuid); - - /** - * Construct <Component_Binding_Info> struct for the component instance. - * Fetch the plan_uuid info from the internally cached shared component - * list. - * - * @param name component instance name - */ - CIAO::Component_Binding_Info * - populate_binding_info (const ACE_CString& name); - - /** - * Contact each NodeManager to get shared compnents information - * and then update its internal cache. - */ - void synchronize_shared_components_with_node_managers (void); - - /** - * A helper function to add a list of shared components into - * the cached shared component list. - * - * @param shared A list of shared components to be added. - */ - void add_shared_components (const Deployment::ComponentPlans & shared); - - /** - * A private function to check whether a component is in the shared - * component list. - * - * @param name The name of a component instance. - */ - bool is_shared_component (const char * name); - - /** - * Cache the incoming connections, which is a sequence of Connections, - * into the <all_connections_> list. - */ - void add_connections (const Deployment::Connections & incoming_conn); - - /** - * Given a child deployment plan, find the <Connections> sequence - * of the "providedReference" for the component instances in the - * child deployment plan as Receiver side. - * By default, we search in the new plan. - * - * If <is_getting_all_connections> is false, then we only - * search for "new connections" (valid for ReDaC case only). - * Otherwise, we will search for both new connections and those - * already existing connections. - */ - Deployment::Connections * - get_outgoing_connections (const Deployment::DeploymentPlan &plan, - bool is_getting_all_connections = true, - bool is_search_new_plan = true, - Connection_Search_Type t = Internal_Connections); - - /// This is a helper function to find the connection for a component. - bool - get_outgoing_connections_i (const char * instname, - Deployment::Connections & retv, - bool is_ReDAC, - bool is_search_new_plan); - - bool - populate_connection_for_binding ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - bool - handle_es_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - bool - handle_direct_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - /// Dump connections, a static method - void dump_connections (const ::Deployment::Connections & connections); - - /// Check whether a connection already exists in the cached old plan - bool already_exists (const Deployment::PlanConnectionDescription & conn); - - /// Remove those appeared in <right> from the <left> - Deployment::Connections * - subtract_connections (const Deployment::Connections & left, - const Deployment::Connections & right); - - void - purge_connections (Deployment::Connections_var & connections, - const char * inst); - - /** - * The first step in finish_launching an application in the - * domain-level. We install all the CIAO_Event_Service objects - * as specified in the DeploymentPlan. - * Internally, this operation will invoke an operation on each cached - * NodeApplication object. - */ - virtual void install_all_es (void); - - /** - * Add all CIAO_Event_Service objects into the cached map. - */ - virtual void - add_es_to_map (const char* node_name, - CIAO::CIAO_Event_Service * ciao_es); - - /** - * Get the actual event connection QoS properties based on the - * deployment requirement. The deployment requirement only specifies - * an identifier/reference to the EventServiceDeploymentDescriptions. - */ - virtual const Deployment::Properties * - get_connection_QoS_configuration ( - const Deployment::Requirement & requirement); - - protected: - /// location of the Domainapplication - CORBA::String_var domainapp_path_; - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Pointer to the ExecutionManager_Impl "singleton" servant object - /// We could do this because ExecutionManager and DomainApplicationManager - /// are always collocated in the same process, so we don't have - /// to pass CORBA object reference back and forth. - Execution_Manager::Execution_Manager_Impl * execution_manager_; - - /// Cache a list of shared components - Deployment::ComponentPlans_var shared_; - - /// Cache the ior of the previous reference - CORBA::String_var ior_; - - /// Cached TargetManager. - Deployment::TargetManager_var target_manager_; - - /// Cached deployment plan for the particular domain. - /// The plan will be initialized when init is called. - Deployment::DeploymentPlan plan_; - - /// Cached old deployment plan, i.e., before redeployment - Deployment::DeploymentPlan old_plan_; - - /// Cached child plans. - //Deployment::DeploymentPlan * child_plan_; - - /// Total number of child deployment plans. - size_t num_child_plans_; - - /// The list of node manager names, each of them - /// corresponds to one child plan. - ACE_Vector<ACE_CString> node_manager_names_; - - /// Cached information for NodeManager, NodeApplicationManager, - /// NodeApplication, Connections, etc. - /// Key: NodeManager name with CString type. - /// Value: Chained_Artifacts struct type. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Chained_Artifacts, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Chained_Artifacts_Table; - - Chained_Artifacts_Table artifact_map_; - - /// Cached information of all the CIAO_Event_Service objects within - /// the deployment plan - /// Key: the string identifier of the CIAO_Event_Service - /// Value: the object reference of the CIAO_Event_Service - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - CIAO::CIAO_Event_Service_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Event_Service_Table; - - Event_Service_Table es_map_; - - /// The deployment information data file. - const char * deployment_file_; - - /// Deployment Configuration info, which contains the deployment topology. - Deployment_Configuration deployment_config_; - - /// UUID from the Plan - CORBA::String_var uuid_; - - /// Maintain a list of <Connections>, each of which is obtained by - /// calling the startLaunch() method on the NodeApplicationManager object. - ::Deployment::Connections_var all_connections_; - - /// This variable is used to control the execution path of some - /// member function implementations. The reason is because we want - /// to avoid unnecessary code duplicate. The default value is "false". - bool is_redeployment_; - - /// Cache the CIAO_Event_Service deployment description - CIAO::DAnCE::EventServiceDeploymentDescriptions_var esd_; - }; -} - -#if defined (__ACE_INLINE__) -# include "DomainApplicationManager_AMH_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_DOMAINAPPLICATIONMANAGER_AMH_IMPL_H */ diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.inl b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.inl deleted file mode 100644 index d15c5e81a24..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMH_Impl.inl +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -ACE_INLINE const char * -CIAO::DomainApplicationManager_AMH_Impl::get_uuid () const -{ - return this->uuid_; -} - -ACE_INLINE void -CIAO::DomainApplicationManager_AMH_Impl::set_uuid (const char * uuid) -{ - // Copy this uuid reference - this->uuid_ = CORBA::string_dup (uuid); -} diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.cpp b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.cpp deleted file mode 100644 index 38ee26e7c73..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.cpp +++ /dev/null @@ -1,201 +0,0 @@ -// $Id$ - -#include "DomainApplicationManager_AMI_Impl.h" -#include "ace/OS_NS_unistd.h" - -CIAO::DomainApplicationManager_AMI_Impl:: -DomainApplicationManager_AMI_Impl ( - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl *em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file) - : DomainApplicationManager_AMH_Impl (orb, poa, manager, em, plan, deployment_file), - start_launch_reply_count_ (0) -{ -} - -void -CIAO::DomainApplicationManager_AMI_Impl:: -decrease_start_launch_reply_count () -{ - --this->start_launch_reply_count_; -} - -int -CIAO::DomainApplicationManager_AMI_Impl:: -start_launch_reply_count () -{ - return this->start_launch_reply_count_; -} - -void -CIAO::DomainApplicationManager_AMI_Impl:: -startLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMI_Impl::startLaunch"); - ACE_UNUSED_ARG (start); - - ACE_DEBUG ((LM_ERROR, "Enter CIAO::DomainApplicationManager_AMI_Impl::startLaunch\n")); - - this->amh_response_handler_ = - Deployment::AMH_DomainApplicationManagerResponseHandler::_duplicate (_tao_rh); - - try - { - // Clean up all cached connections first - this->all_connections_->length (0); - - this->start_launch_reply_count_ = this->num_child_plans_; - - // Invoke startLaunch() operations on each cached NodeApplicationManager - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplicationManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl:startLaunch", - error.c_str ())); - } - - ::Deployment::NodeApplicationManager_ptr my_nam = - (entry->int_id_).node_application_manager_.in (); - - if (CORBA::is_nil (my_nam)) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("While starting launch, the DomainApplicationManager\ - has a nil reference for NodeApplicationManager\n"); - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::startLaunch", - error.c_str ())); - } - - // Create a reply handler struct - AMI_NAM_Handler ami_nam_handler; - - // Instantiate an reply handler servant object - ACE_NEW (ami_nam_handler.servant_, - Deployment_AMI_NodeApplicationManagerHandler_i (this)); - - ACE_DEBUG ((LM_ERROR, "Step 1\n")); - - PortableServer::ObjectId_var oid = - this->poa_->activate_object (ami_nam_handler.servant_); - - ACE_DEBUG ((LM_ERROR, "Step 2\n")); - - this->rh_oid_.push_back (oid.in ()); - - CORBA::Object_var handler_obj = poa_->id_to_reference (oid.in ()); - - ami_nam_handler.obj_ref_ = - Deployment::AMI_NodeApplicationManagerHandler::_narrow (handler_obj.in ()); - - this->ami_nam_handler_table_.bind (this->node_manager_names_[i], - ami_nam_handler); - - // Invoke operation asynchronously - my_nam->sendc_startLaunch (ami_nam_handler.obj_ref_.in (), - configProperty, 0); - } -/* - while (true) - { - // Check whether the reply has been returned - if (this->orb_->work_pending ()) - { - this->orb_->perform_work (); - - // if (this->start_launch_reply_count_ == 0) - // break; - } - } -*/ - } - catch (const Deployment::StartError& ex) - { - ACE_DEBUG ((LM_DEBUG, "DAM_Impl:StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::startLaunch\t\n"); - throw; - } - ACE_DEBUG ((LM_ERROR, "Exit CIAO::DomainApplicationManager_AMI_Impl::startLaunch\n")); -} - - -void -CIAO::DomainApplicationManager_AMI_Impl:: -post_ami_startLaunch () -{ - CIAO_TRACE("CIAO::DomainApplicationManager_AMI_Impl::post_ami_startLaunch"); - - if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_ERROR, - "CIAO (%P|%t):DomainApplicationManager_AMI_Impl::post_ami_startLaunch called\n")); - - - for (AMI_NAM_Handler_Table_Iterator iter (this->ami_nam_handler_table_.begin ()); - iter != this->ami_nam_handler_table_.end (); - ++iter) - { - // Cache the returned set of connections into the list. - this->add_connections (iter->int_id_.servant_->get_connections ()); - - // Cache the returned NodeApplication object reference into - // the chained artifact table. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - this->artifact_map_.find (iter->ext_id_, // node name - entry); - - (entry->int_id_).node_application_ = - Deployment::NodeApplication::_duplicate ( - iter->int_id_.servant_->get_node_app ()); - } - - this->amh_response_handler_->startLaunch (); - - for (size_t i = 0; i < this->rh_oid_.size (); ++i) - this->poa_->deactivate_object (this->rh_oid_[i].in ()); - - this->rh_oid_.clear (); -} diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.h b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.h deleted file mode 100644 index 50e3cc7c30b..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_AMI_Impl.h +++ /dev/null @@ -1,96 +0,0 @@ -//================================================================== -/** - * @file DomainApplicationManager_AMI_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Deployment::DomainApplicationManager_AMI_Impl. - * - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//===================================================================== - -#ifndef CIAO_DOMAINAPPLICATIONMANAGER_AMI_IMPL_H -#define CIAO_DOMAINAPPLICATIONMANAGER_AMI_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DomainApplicationManager_AMH_Impl.h" -#include "Reply_Handler_i.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerC.h" -#include "DAnCE/Deployment/Deployment_ApplicationC.h" - -namespace CIAO -{ - /** - * @class DomainApplicationManager_AMI_Impl - * - * @brief A subclass of the DomainApplicationManager_Impl servant - * which uses AMI mechanism to handle deployment. - */ - class DomainApplicationManager_Export DomainApplicationManager_AMI_Impl - : public DomainApplicationManager_AMH_Impl - { - public: - /// Constructor - DomainApplicationManager_AMI_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl *em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file); - - virtual void - startLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, - const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start); - - /// This operation will be called after *all* the AMI callbacks - /// are received - void - post_ami_startLaunch (void); - - void decrease_start_launch_reply_count (void); - - int start_launch_reply_count (void); - - private: - typedef struct - { - Deployment_AMI_NodeApplicationManagerHandler_i * servant_; - ::Deployment::AMI_NodeApplicationManagerHandler_var obj_ref_; - } AMI_NAM_Handler; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - AMI_NAM_Handler, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> AMI_NAM_Handler_Table; - typedef AMI_NAM_Handler_Table::iterator AMI_NAM_Handler_Table_Iterator; - - /// A table to trace the AMI reply handler - AMI_NAM_Handler_Table ami_nam_handler_table_; - - /// Disable copy assignment - DomainApplicationManager_AMI_Impl (const DomainApplicationManager_AMI_Impl&); - - /// AMI reply count - volatile int start_launch_reply_count_; - - /// Object reference of the AMH response handler - Deployment::AMH_DomainApplicationManagerResponseHandler_var amh_response_handler_; - - /// Object ID of the AMH response handler - //PortableServer::ObjectId_var rh_oid_; - ACE_Vector<PortableServer::ObjectId_var> rh_oid_; - }; -} - -#include /**/ "ace/post.h" -#endif /* CIAO_DOMAINAPPLICATIONMANAGER_AMI_IMPL_H */ diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.cpp b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.cpp deleted file mode 100644 index cb1d27c305f..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// $Id$ - -#include "DomainApplicationManager_ActiveObject_Impl.h" -#include "ace/OS_NS_unistd.h" - -CIAO::DomainApplicationManager_ActiveObject_Impl:: -DomainApplicationManager_ActiveObject_Impl ( - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl *em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file) - : DomainApplicationManager_Impl (orb, poa, manager, em, plan, deployment_file) -{ -} - -void -CIAO::DomainApplicationManager_ActiveObject_Impl:: -startLaunch (const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_ActiveObject_Impl::startLaunch"); - ACE_UNUSED_ARG (start); - - try - { - // Clean up all cached connections first - this->all_connections_->length (0); - - // Invoke startLaunch() operations on each cached NodeApplicationManager - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplicationManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl:startLaunch", - error.c_str ())); - } - - ::Deployment::NodeApplicationManager_ptr my_nam = - (entry->int_id_).node_application_manager_.in (); - - if (CORBA::is_nil (my_nam)) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("While starting launch, the DomainApplicationManager\ - has a nil reference for NodeApplicationManager\n"); - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::startLaunch", - error.c_str ())); - } - - // Create a startLaunch task - Task_StartLaunch * task; - - ACE_NEW (task, - Task_StartLaunch (this->node_manager_names_[i].c_str (), - my_nam, - configProperty)); - - this->start_launch_task_table_.bind (this->node_manager_names_[i], - task); - - // Activate as an active object - task->activate (THR_NEW_LWP | THR_JOINABLE); - } - - // Wait for the completion of the task - start_launch_task_table_.begin ()->int_id_->thr_mgr()->wait (); - - // Collect the results of each startLaunch task - for (StartLaunch_Task_Table_Iterator iter (this->start_launch_task_table_.begin ()); - iter != this->start_launch_task_table_.end (); - ++iter) - { - ACE_DEBUG ((LM_ERROR, "**********************Table size [%d]\n", - this->start_launch_task_table_.current_size ())); - - ACE_DEBUG ((LM_ERROR, "**********************Step 2.1\n")); - - // Cache the returned set of connections into the list. - this->add_connections (iter->int_id_->get_connections ()); - - // Cache the returned NodeApplication object reference into - // the chained artifact table. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - ACE_DEBUG ((LM_ERROR, "**********************Step 2.2\n")); - this->artifact_map_.find (iter->ext_id_, // node name - entry); - - ACE_DEBUG ((LM_ERROR, "**********************Step 2.3\n")); - (entry->int_id_).node_application_ = - Deployment::NodeApplication::_duplicate ( - iter->int_id_->get_node_app ()); - - ACE_DEBUG ((LM_ERROR, "**********************Step 2.4\n")); - } - - ACE_DEBUG ((LM_ERROR, "******************Step 3\n")); - } - catch (const Deployment::StartError& ex) - { - ACE_DEBUG ((LM_DEBUG, "DAM_Impl:StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_ActiveObject_Impl::startLaunch\t\n"); - throw; - } - -} diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.h b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.h deleted file mode 100644 index 12ce2e69638..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.h +++ /dev/null @@ -1,68 +0,0 @@ -//================================================================== -/** - * @file DomainApplicationManager_ActiveObject_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Deployment::DomainApplicationManager_AMI_Impl. - * - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//===================================================================== - -#ifndef CIAO_DOMAINAPPLICATIONMANAGER_ACTIVE_OBJECT_IMPL_H -#define CIAO_DOMAINAPPLICATIONMANAGER_ACTIVE_OBJECT_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DomainApplicationManager_Impl.h" -#include "Task_StartLaunch.h" - -namespace CIAO -{ - /** - * @class DomainApplicationManager_ActiveObject_Impl - * - * @brief A subclass of the DomainApplicationManager_Impl servant - * which uses active object mechanism to handle deployment. Internally - * it spawns threads with each thread runs an active object - * to invoke the remote invocation, such as invoking startLaunch - * on a corresponding NodeApplicationManager. - */ - class DomainApplicationManager_Export DomainApplicationManager_ActiveObject_Impl - : public DomainApplicationManager_Impl - { - public: - /// Constructor - DomainApplicationManager_ActiveObject_Impl ( - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl *em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file); - - virtual void - startLaunch (const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start); - - private: - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Task_StartLaunch *, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> StartLaunch_Task_Table; - typedef StartLaunch_Task_Table::iterator StartLaunch_Task_Table_Iterator; - - StartLaunch_Task_Table start_launch_task_table_; - }; -} - -#include /**/ "ace/post.h" -#endif /* CIAO_DOMAINAPPLICATIONMANAGER_ACTIVE_OBJECT_IMPL_H */ diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 560f9feec5d..b9956127f84 100644 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -1,408 +1,312 @@ // $Id$ #include "DomainApplicationManager_Impl.h" -#include "ExecutionManager/Execution_Manager_Impl.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerC.h" -#include "ace/Null_Mutex.h" -#include "ace/OS_NS_string.h" -#include "ace/SString.h" -#include "ace/Assert.h" +#include "Deployment/Deployment_ConnectionC.h" +#include "DAnCE/Logger/Log_Macros.h" -#if !defined (__ACE_INLINE__) -# include "DomainApplicationManager_Impl.inl" -#endif /* __ACE_INLINE__ */ +using namespace DAnCE; -CIAO::DomainApplicationManager_Impl:: -DomainApplicationManager_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl * em, - const Deployment::DeploymentPlan & plan, - const char * deployment_file) - : orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)), - execution_manager_ (em), // a plain C++ pointer - target_manager_ (Deployment::TargetManager::_duplicate (manager)), // object ref - plan_ (plan), - num_child_plans_ (0), - // @@ (OO) The default size for an ACE_Hash_Map_Mapanger is quiet - // large. The maximum size of an ACE_Hash_Map_Manager is - // also fixed, i.e. it does not grow dynamically on demand. - // Make sure the default size of artifact_map_ is - // appropriate for your needs. You may also want to make - // the size configurable at compile-time, at least. - // - // Need to initialize chained artifacts here. - // - deployment_file_ (CORBA::string_dup (deployment_file)), - deployment_config_ (orb), - uuid_ (plan.UUID), - is_redeployment_ (false), - esd_ (0) +DomainApplicationManager_Impl::DomainApplicationManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + Node_Locator & nodes) + : orb_ (CORBA::ORB::_duplicate (orb)) + , poa_ (PortableServer::POA::_duplicate (poa)) + , plan_ (plan) + , nodes_ (nodes) { - ACE_NEW_THROW_EX (this->all_connections_, - Deployment::Connections (), - CORBA::NO_MEMORY ()); - - ACE_NEW_THROW_EX (this->shared_, - Deployment::ComponentPlans (), - CORBA::NO_MEMORY ()); - - ACE_NEW_THROW_EX (this->esd_, - CIAO::DAnCE::EventServiceDeploymentDescriptions (), - CORBA::NO_MEMORY ()); - - for (CORBA::ULong i = 0; i < this->plan_.infoProperty.length (); ++i) - { - if (ACE_OS::strcmp (this->plan_.infoProperty[i].name.in (), - "CIAOEvents") != 0) - continue; - - // Note, we should do a sanity check here to make - // sure we didn't pick up the wrong infoProperty!! - this->plan_.infoProperty[0].value >>= this->esd_; - break; - } - - this->init (); + DANCE_TRACE(DLINFO "DomainApplicationManager_Impl::DomainApplicationManager_Impl"); + this->preparePlan(); + DANCE_DEBUG((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::DomainApplicationManager_Impl - " + "Successfully prepared plan : %C\n", this->plan_.UUID.in())); } -CIAO::DomainApplicationManager_Impl::~DomainApplicationManager_Impl () +DomainApplicationManager_Impl::~DomainApplicationManager_Impl() { - if (CIAO::debug_level () > 1) + DANCE_TRACE( "DomainApplicationManager_Impl::~DomainApplicationManager_Impl()"); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::~DomainApplicationManager_Impl - " + "Destroying %u applications\n", this->running_app_.size())); + while (0 < this->running_app_.size()) { - ACE_DEBUG ((LM_DEBUG, "DomainApplicationManager destroyed\n")); + DomainApplication_Impl* p = this->running_app_[this->running_app_.size()-1]; + Deployment::DomainApplication_var app = + Deployment::DomainApplication::_narrow (this->poa_->servant_to_reference (p)); + PortableServer::ObjectId_var id = this->poa_->reference_to_id (app); + DANCE_DEBUG((LM_TRACE, DLINFO "DomainApplicationManager_impl::~DomainApplicationManager_impl - " + "deactivating DomainApplication object...\n")); + this->poa_->deactivate_object (id); + DANCE_DEBUG((LM_DEBUG, DLINFO "DomainApplicationManager_impl::~DomainApplicationManager_impl - " + "deleting DomainApplication.\n")); + this->running_app_.pop_back(); + delete p; } -} - -Deployment::NodeApplication_ptr -CIAO::DomainApplicationManager_Impl::get_node_app (const char * node_name) -{ - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - if (this->artifact_map_.find (node_name, entry) != 0) + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::~DomainApplicationManager_Impl - " + "Destroying %u managers\n", this->sub_app_mgr_.current_size())); + for (DomainApplication_Impl::TNam2Nm::iterator iter = this->sub_app_mgr_.begin(); + iter != this->sub_app_mgr_.end(); + ++iter) { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::get_node_app -" - "ERROR while finding the node application " - "for the node [%s] \n", - node_name)); - throw Deployment::NoSuchName (); + (*iter).int_id_->destroyManager ( (*iter).ext_id_.in()); } - - return - Deployment::NodeApplication::_duplicate ( - entry->int_id_.node_application_.in ()); + this->sub_app_mgr_.unbind_all(); } -void -CIAO::DomainApplicationManager_Impl::init () +Deployment::Application_ptr +DomainApplicationManager_Impl::startLaunch (const Deployment::Properties & configProperty, + Deployment::Connections_out providedReference) { - try - { + DANCE_TRACE( "DomainApplicationManager_impl::startLaunch"); - //Deployment::DnC_Dump::dump (this->plan_); - /* - //====================================== - // Dump the contents of infoProperty to a XML file - if (CIAO::debug_level () > 1) - { - CIAO::DAnCE::ServerResource *sr = 0; - this->plan_.infoProperty[0].value >>= sr; - - Config_Handlers::SRD_Handler reverse_handler (sr); + ::Deployment::Connections_var connections; + ACE_NEW_THROW_EX (connections, + Deployment::Connections (), + CORBA::NO_MEMORY ()); + DomainApplication_Impl* app = 0; + ACE_NEW_THROW_EX (app, + DomainApplication_Impl (this->sub_app_mgr_, + configProperty, + connections.inout()), + CORBA::NO_MEMORY()); - Config_Handlers::XML_Helper the_helper; - xercesc::DOMDocument *the_xsc - (the_helper.create_dom ("CIAO:ServerResources", - "http://www.dre.vanderbilt.edu/ServerResources")); + providedReference = connections._retn(); - ServerResources (*reverse_handler.srd_xsc (), the_xsc); + PortableServer::ObjectId_var id = this->poa_->activate_object (app); + this->running_app_.push_back(app); - // write out the result - the_helper.write_DOM (the_xsc, "output.srd"); - } - */ - //====================================== + DANCE_DEBUG ((LM_TRACE, "DomainApplicationManager_Impl::startLaunch - " + "Successfully created DomainApplication\n")); + DANCE_DEBUG ((LM_TRACE, "DomainApplicationManager_Impl::startLaunch - " + "Created %u provided references\n", + providedReference->length ())); - // (1) Call get_plan_info() method to get the total number - // of child plans and list of NodeManager names, and - // (2) Check the validity of the global deployment plan. - if (! this->get_plan_info ()) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::init -" - "ERROR while calling get_plan_info () \n")); - throw Deployment::PlanError (); - } + CORBA::Object_var ref = this->poa_->id_to_reference (id); + return Deployment::DomainApplication::_narrow (ref.in ()); +} - // Call split_plan() - if (! this->split_plan ()) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::init -" - "ERROR while calling split_plan () \n")); - throw Deployment::PlanError (); - } +void +DomainApplicationManager_Impl::destroyApplication (Deployment::Application_ptr application) +{ + DANCE_TRACE ( "DomainApplicationManager_Impl::destroyApplication"); - // Invoke preparePlan on each NodeManager by giving child plan. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) + try + { + for (size_t i = 0; i < this->running_app_.size(); ++i) { - // Get the NodeManager object reference. - ::Deployment::NodeManager_var my_node_manager = - this->deployment_config_.get_node_manager - (this->node_manager_names_[i].c_str ()); - - // Get the child deployment plan reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) + DomainApplication_Impl* p = this->running_app_[i]; + Deployment::DomainApplication_var app = + Deployment::DomainApplication::_narrow (this->poa_->servant_to_reference (p)); + if (application->_is_equivalent (app.in())) { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::init -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - throw Deployment::PlanError (); - } - - Chained_Artifacts & artifacts = entry->int_id_; - - // Call preparePlan() method on the NodeManager with the - // corresponding child plan as input, which returns a - // NodeApplicationManager object reference. - Deployment::ApplicationManager_var tmp_app_manager = - my_node_manager->preparePlan (artifacts.child_plan_.in ()); - - Deployment::NodeApplicationManager_var app_manager = - Deployment::NodeApplicationManager::_narrow - (tmp_app_manager.in ()); - - if (CORBA::is_nil (app_manager.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::init -" - "ERROR while narroing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error ("DomainAppMgr::init () received a nil \ - reference for NodeApplicationManager\n"); - - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - throw - (Deployment::StartError ("DomainApplicationManager_Impl:init", - error.c_str ())); + PortableServer::ObjectId_var id = this->poa_->reference_to_id (application); + DANCE_DEBUG((LM_TRACE, DLINFO "DomainApplicationManager_impl::destroyApplication - " + "deactivating application object\n")); + this->poa_->deactivate_object (id); + DANCE_DEBUG((LM_TRACE, DLINFO "DomainApplicationManager_impl::destroyApplication - " + "deleting application object\n")); + delete p; + for (size_t j = i + 1; j < this->running_app_.size(); ++j) + { + this->running_app_[j-1] = this->running_app_[j]; + } + this->running_app_.pop_back(); + return; } - - // Cache the NodeApplicationManager object reference. - artifacts.node_application_manager_ = app_manager._retn (); } } - catch (const CORBA::Exception& ex) + catch (const Deployment::StopError &e) { - ex._tao_print_exception ("DomainApplicationManager_Impl::init\t\n"); - throw; + ACE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_impl::destroyApplication - " + "Propagating a received StopError exception\n")); + throw e; } -} - -bool -CIAO::DomainApplicationManager_Impl::get_plan_info (void) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_plan_info"); - - // Read the deployment.dat file and get to know the different nodes - // that are present in the deployment domain. - // We should be able to replace this way, by parsing the domain - // descriptor to get to know more on the domain. - // - if ( this->deployment_config_.init (this->deployment_file_) == -1 ) + catch (...) { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::get_plan_info -" - "ERROR while trying to initialize after reading " - "deployment DAT file \n")); - return 0; + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_impl::destroyApplication - " + "Caught unknown exception.")); + throw Deployment::StopError(); } - // Error: If there are no nodes in the plan => No nodes to deploy the - // components - CORBA::ULong const length = this->plan_.instance.length (); - - if (length == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::get_plan_info -" - "ERROR while trying to get the total instances to " - "be deployed \n")); - return false; - } + ACE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_impl::destroyApplication - " + "Provided application reference unknown\n")); + throw Deployment::StopError(); +} - // Copy the name of the node in the plan on to the node manager - // array, Making sure that duplicates are not added. - // - // OPTIMIZATION: - // We can parse the domain descriptor and the size of the node - // data structure is the size of the num_plans and - // the individual node names need to be entered into the - // node_manager_map. - // - int num_plans = 0; - this->node_manager_names_.clear (); +::Deployment::Applications * +DomainApplicationManager_Impl::getApplications () +{ + DANCE_TRACE ( "DomainApplicationManager_Impl::getApplications ()"); - for (CORBA::ULong index = 0; index < length; index ++) + Deployment::Applications* running_app = 0; + ACE_NEW_THROW_EX (running_app, + Deployment::Applications(), + CORBA::NO_MEMORY()); + running_app->length (this->running_app_.size()); + unsigned int index = 0; + for (size_t i = 0; i < this->running_app_.size(); ++i) { - bool matched = false; + CORBA::Object_var ref = this->poa_->servant_to_reference (this->running_app_[i]); + (*running_app) [index++] = + Deployment::DomainApplication::_narrow (ref.in ()); + } - const CORBA::ULong number_node_managers = - this->node_manager_names_.size (); + DANCE_DEBUG((LM_DEBUG, DLINFO "DomainApplicationManager_impl::getApplications - " + "Returning %u running applications\n", + running_app->length ())); + return running_app; +} - for (CORBA::ULong i = 0; i < number_node_managers; ++i) - // If a match is found do not add it to the list of unique - // node names - if (ACE_OS::strcmp (this->plan_.instance [index].node.in (), - (this->node_manager_names_ [i]).c_str ()) == 0) - { - // Break out -- Duplicates found - matched = true; - break; - } +::Deployment::DeploymentPlan * +DomainApplicationManager_Impl::getPlan () +{ + DANCE_TRACE ( DLINFO "DomainApplicationManager_Impl::getPlan ()"); - if (! matched) - { - // Check if there is a corresponding NodeManager instance existing - // If not present return false - ::Deployment::NodeManager_var mgr = - this->deployment_config_.get_node_manager - (this->plan_.instance [index].node.in ()); + Deployment::DeploymentPlan* plan = 0; - if (CORBA::is_nil (mgr.in ())) - return false; /* Failure */ + ACE_NEW_THROW_EX (plan, + Deployment::DeploymentPlan (this->plan_), + CORBA::NO_MEMORY()); - // Add this unique node_name to the list of NodeManager names - this->node_manager_names_.push_back (this->plan_.instance [index].node.in ()); + return plan; +} - // Increment the number of plans - ++num_plans; - } - } +// This methhod is commented because it requred rework for processing connections +// sequence together with correspondent DeploymentPlan +void +DomainApplicationManager_Impl:: +dump_connections (const ::Deployment::Connections & /*connections*/) const +{ + DANCE_DEBUG((LM_DEBUG, DLINFO "DomainApplicationManager_impl::dump_connections - started\n")); - // Set the length of the Node Managers + // CIAO_TRACE("CIAO::DomainApplicationManager_Impl::dump_connections"); + // const CORBA::ULong conn_len = connections.length (); + // for (CORBA::ULong i = 0; i < conn_len; ++i) + // { + // DANCE_DEBUG((LM_DEBUG, "[%M] instanceName: %C\n", connections[i].instanceName.in ())); + // + // DANCE_DEBUG((LM_DEBUG, "[%M] portName: %C\n", connections[i].portName.in ())); // - // why cannot we use the provate variable in the above "for" loop? + // DANCE_DEBUG((LM_DEBUG, "[%M] portkind: ")); // - this->num_child_plans_ = num_plans; + // switch (connections[i].kind) + // { + // case Deployment::Facet: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] Facet\n")); + // break; + // + // case Deployment::SimplexReceptacle: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] SimplexReceptacle\n")); + // break; + // + // case Deployment::MultiplexReceptacle: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] MultiplexReceptacle\n")); + // break; + // + // case Deployment::EventEmitter: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] EventEmitter\n")); + // break; + // + // case Deployment::EventPublisher: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] EventPublisher\n")); + // break; + // + // case Deployment::EventConsumer: + // + // DANCE_DEBUG((LM_DEBUG, "[%M] EventConsumer\n")); + // break; + // + // default: + // DANCE_DEBUG((LM_DEBUG, "[%M] Unknown port kind.\n")); + // } + // + // DANCE_DEBUG((LM_DEBUG, "[%M] endpointInstanceName: %C\n", + // connections[i].endpointInstanceName.in ())); + // + // DANCE_DEBUG((LM_DEBUG, "[%M] endpointPortName: %C\n", + // connections[i].endpointPortName.in ())); + // DANCE_DEBUG((LM_DEBUG, "[%M] ---------------------\n")); + // } - // Indicate success - return true; + DANCE_DEBUG((LM_DEBUG, DLINFO "DomainApplicationManager_impl::dump_connections - finished\n")); } -//@@ We should ask those spec writers to look at the code below, hopefully -// They will realize some thing. -int -CIAO::DomainApplicationManager_Impl::split_plan (void) +void +DomainApplicationManager_Impl::split_plan (const Deployment::DeploymentPlan & plan, + TNodePlans & sub_plans) { - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::split_plan"); - - // Initialize the total number of child deployment plans specified - // by the global plan. - CORBA::ULong i; - - for ( i = 0; i < this->num_child_plans_; ++i) - { - ::Deployment::DeploymentPlan_var tmp_plan; - ACE_NEW_RETURN (tmp_plan, - ::Deployment::DeploymentPlan, - 0); - - // Construct the UUID for the child plan. - // Currently, this UUID consists of: - // The global UUID for the parent plan + the name of the node the - // child plan is to be installed on. - ACE_CString child_uuid (this->plan_.UUID.in ()); - child_uuid += "@"; - child_uuid += this->node_manager_names_[i]; + DANCE_TRACE ( "DomainApplicationManager_Impl::split_plan"); - tmp_plan->UUID = CORBA::string_dup (child_uuid.c_str ()); - tmp_plan->implementation.length (0); - tmp_plan->instance.length (0); - tmp_plan->connection.length (0); - tmp_plan->externalProperty.length (0); - tmp_plan->dependsOn.length (0); - tmp_plan->artifact.length (0); - - // @@ There is an optimization point here, since we really don't have to - // pass the entire CIAOServerResources into each individual child plan. - tmp_plan->infoProperty = this->plan_.infoProperty; + DANCE_DEBUG ((LM_TRACE, "DomainApplicationManager_Impl::split_plan - " + "Creating sub-plans\n")); + // Create empty sub-plans + for (CORBA::ULong i = 0; i < plan.instance.length(); ++i) + { + ACE_CString node = plan.instance[i].node.in(); + if (0 == sub_plans.find (node)) continue; - //tmp_plan->infoProperty[0].name = CORBA::string_dup ("CIAOServerResource"); - //tmp_plan->infoProperty[0].value = this->plan_.infoProperty[0].value; + ::Deployment::DeploymentPlan tmp_plan; - Chained_Artifacts artifacts; + // Construct the UUID for the child plan. + // Currently, this UUID consists of: + // The global UUID for the parent plan + the name of the node the + // child plan is to be installed on. + ACE_CString child_uuid (plan.UUID.in ()); + // child_uuid += "@"; CCM#61 + // child_uuid += node; - // Fill in the child_plan_ field, relinquishing ownership - artifacts.child_plan_ = tmp_plan._retn (); + tmp_plan.UUID = CORBA::string_dup (child_uuid.c_str()); + tmp_plan.implementation.length (0); + tmp_plan.instance.length (0); + tmp_plan.connection.length (0); + tmp_plan.externalProperty.length (0); + tmp_plan.dependsOn.length (0); + tmp_plan.artifact.length (0); - // Fill in the node_manager_ field. - artifacts.node_manager_ = - this->deployment_config_.get_node_manager - (this->node_manager_names_[i].c_str ()); + // @@ There is an optimization point here, since we really don't have to + // pass the entire CIAOServerResources into each individual child plan. + tmp_plan.infoProperty = plan.infoProperty; - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; + sub_plans.bind (node, tmp_plan); - if (this->artifact_map_.find - (node_manager_names_[i], entry) == 0) - artifacts.old_child_plan_ = (entry->int_id_).child_plan_; - else - artifacts.old_child_plan_ = 0; + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplicationManager_Impl::split_plan - " + "Created sub-plan for node %C with UUID %C\n", + node.c_str (), child_uuid.c_str ())); + } - // In case we are doing redeployment, rebind will help replace the - // old child plan with the new child plan. - this->artifact_map_.rebind (node_manager_names_[i], artifacts); - } + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::split_plan - " + "First phase produced %u child plans, proceeding to second\n")); // (1) Iterate over the <instance> field of the global DeploymentPlan // structure. // (2) Retrieve the necessary information to contruct the node-level // plans one by one. - for ( i = 0; i < (this->plan_.instance).length (); ++i) + for (CORBA::ULong i = 0; i < plan.instance.length (); ++i) { + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplicationManager_Impl::split_plan - " + "Processing instance : %C\n", plan.instance[i].name.in())); // @@TODO Fill in the child deployment plan in the map. // If the component instance already exists in the child plan, // then we overwrite the existing instance, since the new instance // might have different resource usage requirements. - - // Get the instance deployment description - const ::Deployment::InstanceDeploymentDescription & my_instance = - (this->plan_.instance)[i]; - - // Find the corresponding child deployment plan entry in - // the hash map for this instance. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find - (ACE_CString (my_instance.node.in ()), - entry) != 0) - return 0; // no valid name found. + const ::Deployment::InstanceDeploymentDescription & my_instance = plan.instance[i]; // Get the child plan. - ::Deployment::DeploymentPlan_var &child_plan = - (entry->int_id_).child_plan_; + ::Deployment::DeploymentPlan child_plan; + + if (0 != sub_plans.find (ACE_CString (my_instance.node.in()), child_plan)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::split_plan - " + "ERROR: Unable to find sub-plan for instance %C\n", + my_instance.node.in ())); + } // Fill in the contents of the child plan entry. @@ -410,17 +314,12 @@ CIAO::DomainApplicationManager_Impl::split_plan (void) // field with a new "implementation", which is specified by the // <implementationRef> field of <my_instance> entry. NOTE: The // <artifactRef> field needs to be changed accordingly. - const ::Deployment::MonolithicDeploymentDescription & my_implementation = - (this->plan_.implementation)[my_instance.implementationRef]; - - // Deployment::DnC_Dump::dump (this->plan_); - //Deployment::DnC_Dump::dump ( (this->plan_.implementation)[my_instance.implementationRef]); - //ACE_DEBUG ((LM_DEBUG, "My implementation")); - //Deployment::DnC_Dump::dump (my_implementation); + const ::Deployment::MonolithicDeploymentDescription & my_implementation + = plan.implementation[my_instance.implementationRef]; - CORBA::ULong index_imp = child_plan->implementation.length (); - child_plan->implementation.length (++index_imp); - child_plan->implementation[index_imp-1] = my_implementation; + CORBA::ULong index_imp = child_plan.implementation.length (); + child_plan.implementation.length (++index_imp); + child_plan.implementation[index_imp-1] = my_implementation; // Initialize with the correct sequence length. CORBA::ULongSeq ulong_seq; @@ -437,1541 +336,165 @@ CIAO::DomainApplicationManager_Impl::split_plan (void) CORBA::ULong artifact_ref = my_implementation.artifactRef[iter]; // Fill in the <artifact> field of the child plan - CORBA::ULong index_art = child_plan->artifact.length (); - child_plan->artifact.length (++index_art); - child_plan->artifact[index_art-1] = - (this->plan_.artifact)[artifact_ref]; + CORBA::ULong index_art = child_plan.artifact.length (); + child_plan.artifact.length (++index_art); + child_plan.artifact[index_art-1] = plan.artifact[artifact_ref]; // Fill in the <artifactRef> field of the MonolithicDeploymentDescription - ulong_seq[iter] = index_art-1; + ulong_seq[iter] = index_art - 1; } // Change the <artifactRef> field of the "implementation". - child_plan->implementation[index_imp-1].artifactRef = ulong_seq; + child_plan.implementation[index_imp-1].artifactRef = ulong_seq; // Append the "InstanceDeploymentDescription instance" field with // a new "instance", which is almost the same as the "instance" in // the global plan except the <implementationRef> field. // NOTE: The <implementationRef> field needs to be changed accordingly. - CORBA::ULong index_ins = child_plan->instance.length (); - child_plan->instance.length (++index_ins); - child_plan->instance[index_ins-1] = my_instance; + CORBA::ULong index_ins = child_plan.instance.length (); + child_plan.instance.length (++index_ins); + child_plan.instance[index_ins-1] = my_instance; // Change the <implementationRef> field of the "instance". // @@ The implementationRef starts from 0. // @@TODO: Below logic needs to be changed once we want to avoid // duplicate <implementation> for the optimization. - child_plan->instance[index_ins-1].implementationRef = index_ins-1; - } - - return 1; -} - -void -CIAO::DomainApplicationManager_Impl:: -add_connections (const Deployment::Connections & incoming_conn) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::add_connections"); - - CORBA::ULong const old_len = this->all_connections_->length (); + child_plan.instance[index_ins-1].implementationRef = index_imp - 1; - // Expand the length of the <all_connection_> sequence. - this->all_connections_->length (old_len + incoming_conn.length ()); - - // Store the connections to the <all_conections_> sequence - const CORBA::ULong conn_lenth = incoming_conn.length (); - for (CORBA::ULong i = 0; i < conn_lenth; ++i) - { - (*this->all_connections_)[old_len + i] = incoming_conn[i]; - } -} - -void -CIAO::DomainApplicationManager_Impl:: -startLaunch (const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::startLaunch"); - ACE_UNUSED_ARG (start); - - try - { - // Clean up all cached connections first - this->all_connections_->length (0); - - // Invoke startLaunch() operations on each cached NodeApplicationManager - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplicationManager_Impl::split_plan - " + "Processing connections.\n")); + // Copy connections + for (CORBA::ULong j = 0; j < plan.connection.length(); ++j) { - // Get the NodeApplicationManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplicationManager_Impl::split_plan - " + "For connection : %C\n", plan.connection[j].name.in())); + for (CORBA::ULong k = 0; k < plan.connection[j].internalEndpoint.length(); ++k) { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl:startLaunch", - error.c_str ())); - } - - ::Deployment::NodeApplicationManager_ptr my_nam = - (entry->int_id_).node_application_manager_.in (); - - if (CORBA::is_nil (my_nam)) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("While starting launch, the DomainApplicationManager\ - has a nil reference for NodeApplicationManager\n"); - ACE_DEBUG ((LM_DEBUG, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::startLaunch", - error.c_str ())); - } - - - ::Deployment::Connections_var retn_connections; - - // Obtained the returned NodeApplication object reference - // and the returned Connections variable. - ::Deployment::Application_var temp_application; - if (!is_redeployment_) - { - temp_application = - my_nam->startLaunch (configProperty, - retn_connections.out (), - 0); - } - else - { - //============================================================= - // Add New Components Logic - //============================================================= - // Let's add new components only now, the to-be-removed - // components should be removed AFTER the connections - // are removed. - temp_application = - my_nam->perform_redeployment (configProperty, - retn_connections.out (), - true, // add new components only now - 0); - } - - // Narrow down to NodeApplication object reference - ::Deployment::NodeApplication_var my_na = - ::Deployment::NodeApplication::_narrow (temp_application.in ()); - - if (CORBA::is_nil (my_na.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("The DomainApplicationManager receives a nil " - "reference of NodeApplication after calling " - "startLaunch on NodeApplicationManager.\n"); - ACE_ERROR ((LM_ERROR, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::startLaunch", - error.c_str ())); - } - - // Cache the returned set of connections into the list. - this->add_connections (retn_connections.in ()); - - // Cache the returned NodeApplication object reference into - // the hash table. - (entry->int_id_).node_application_ = my_na._retn (); - } - - this->synchronize_shared_components_with_node_managers (); - } - catch (const Deployment::StartError& ex) - { - ACE_DEBUG ((LM_DEBUG, "DAM_Impl:StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::startLaunch\t\n"); - throw; - } - -} - - -void -CIAO::DomainApplicationManager_Impl::install_all_es (void) -{ - try - { - for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) - { - // Find NA, and then invoke operation on it - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->esd_[j].node.in (), - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::install_all_es -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->esd_[j].node.in ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->esd_[j].node.in (); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::install_all_es", - error.c_str ())); - } - - // Invoke install_es () operation on each cached NodeApplication object. - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - ::CIAO::CIAO_Event_Service_var ciao_es = - my_na->install_es (this->esd_[j]); - - // Add these returned ES objects into the cached map - this->add_es_to_map (this->esd_[j].name.in (), ciao_es.in ()); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::install_all_es.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -add_es_to_map (const char * node_name, - CIAO::CIAO_Event_Service * ciao_es) -{ - try - { - this->es_map_.bind ( - node_name, - CIAO::CIAO_Event_Service::_duplicate (ciao_es)); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::add_es_to_map.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -finishLaunch (CORBA::Boolean start, - CORBA::Boolean is_ReDaC) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::finishLaunch"); - try - { - // Install all the CIAO_Event_Services within the Deployment Plan - this->install_all_es (); - - // Invoke finishLaunch() operation on each cached NodeApplication object. - // This will establish bindings for only those internal components, but - // NOT for those external/shared components, which requires special - // handling, since these components are outside the control of this - // DomainApplicationManager. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::finishLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::finishLaunch", - error.c_str ())); - } - - //@@ Note: Don't delete the below debugging helpers. - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump incoming connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (this->all_connections_.in ()); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - } - - // Get the Connections variable, if ReDaC is true, then we get - // those new connections only. NOTE: get_outgoing_connections - // by default will get *all* connections. - Deployment::Connections * my_connections = - this->get_outgoing_connections ( - (entry->int_id_).child_plan_.in (), - !is_ReDaC, - true, // we search *new* plan - DomainApplicationManager_Impl::Internal_Connections); - - if (my_connections == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::finishLaunch -" - "ERROR while getting the outgoing connections " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::finish_launch", - "There was some error establishing connections.")); - } - - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 1) - { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump outgoing connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (*my_connections); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - } - - // Invoke finishLaunch() operation on NodeApplication. - if (my_connections->length () != 0) - { - entry->int_id_.node_application_->finishLaunch - (*my_connections, - start, - true // "true" => establish new connections only - ); - } - - //============================================================= - // Remove Old Connections Logic - //============================================================= - - if (is_ReDaC) // We should also *REMOVE* unnecessary connections - { - // If this is a brand new child plan, then continue. - if ((entry->int_id_).old_child_plan_ == 0) - continue; - - // Get all the connections in the old deployment plan - Deployment::Connections * connections_in_old_plan = - this->get_outgoing_connections ( - (entry->int_id_).old_child_plan_.in (), - true, // yes, get *all* the connections - false, // search in the *old* plan - DomainApplicationManager_Impl::Internal_Connections); - - // Pass in the "false" parameter to get *all* the connections in - // the new deployment plan, regardless those in old plan - Deployment::Connections * connections_in_new_plan = - this->get_outgoing_connections ( - (entry->int_id_).child_plan_.in (), - true, // yes, get *all* the connections - true, // search in the *new* plan - DomainApplicationManager_Impl::Internal_Connections); - - Deployment::Connections * unnecessary_connections = - this->subtract_connections (*connections_in_old_plan, - *connections_in_new_plan); - - delete connections_in_old_plan; - delete connections_in_new_plan; - - // Dump the connections for debug purpose. - if (CIAO::debug_level () > 1) + DANCE_DEBUG ((LM_TRACE, DLINFO "DomainApplicationManager_Impl::split_plan - " + "For endpoint : %C(%C)\n", + plan.connection[j].internalEndpoint[k].portName.in(), + plan.connection[j].internalEndpoint[k].provider ? "provider" : "client")); + if (i == plan.connection[j].internalEndpoint[k].instanceRef) // the instance (i) is referenced by the connection { - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); - ACE_DEBUG ((LM_DEBUG, - "dump to-be-removed connections for child plan:%s\n", - (entry->int_id_).child_plan_->UUID.in ())); - dump_connections (*unnecessary_connections); - ACE_DEBUG ((LM_DEBUG, - "==============================================\n")); + Deployment::PlanConnectionDescription * connection_copied = 0; + for (CORBA::ULong m = 0; m < child_plan.connection.length(); ++m) + { + if (plan.connection[j].name == child_plan.connection[m].name) + { + connection_copied = &child_plan.connection[m]; + break; + } + } + + if (0 == connection_copied) + { + // Copy the connection + CORBA::ULong index_con = child_plan.connection.length(); + child_plan.connection.length (index_con + 1); + child_plan.connection[index_con] = plan.connection[j]; + connection_copied = &child_plan.connection[index_con]; + connection_copied->internalEndpoint.length (0); + } + + // Copy the endpoint + CORBA::ULong index_ep = connection_copied->internalEndpoint.length(); + connection_copied->internalEndpoint.length (index_ep + 1); + connection_copied->internalEndpoint[index_ep] = plan.connection[j].internalEndpoint[k]; + connection_copied->internalEndpoint[index_ep].instanceRef = index_ins - 1; } - - // Invoke finishLaunch() operation on NodeApplication. - if (unnecessary_connections->length () != 0) - { - if (CORBA::is_nil (entry->int_id_.node_application_.in ())) - throw Deployment::StartError (); - - entry->int_id_.node_application_->finishLaunch - (*unnecessary_connections, - start, - false // false ==> remove unnecessary connections - ); - } - - //============================================================= - // Remove Old Components - //============================================================= - // Finally we need to remove those to-be-removed components - ::Deployment::Properties_var configProperty; - ACE_NEW (configProperty, - Deployment::Properties); - - ::Deployment::Connections_var retn_connections; - - Deployment::Application_var temp_application = - entry->int_id_.node_application_manager_-> - perform_redeployment (configProperty, - retn_connections.out (), - false, // remove old components only - false);// do not "start" } } - - // Establish bindings on external/shared components of this deployment plan. - this->post_finishLaunch (); - } - catch (const Deployment::StartError& ex) - { - ACE_ERROR ((LM_ERROR, "DAM_Impl::finishLaunch - StartError: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::finishLaunch: ""Killing NodeApplications.\n"); - - // Invoke destroyManager() operation on each cached - // NodeManager object. - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager and NodeApplicationManager object references. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; - this->artifact_map_.find (this->node_manager_names_[i],entry); - - ::Deployment::NodeApplicationManager_ptr - my_node_application_manager = - (entry->int_id_).node_application_manager_.in (); - - // Invoke destoryApplication() operation on the NodeApplicationManger. - // Since we have the first arg is not used by NAM anyway. - my_node_application_manager->destroyApplication - (0); - } - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -post_finishLaunch (void) -{ - try - { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->finalize_global_binding ( - *binding, true); - - delete binding; - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::post_finishLaunch.\n"); - throw; - } - -} - -CIAO::Component_Binding_Info * -CIAO::DomainApplicationManager_Impl:: -populate_binding_info (const ACE_CString& name, - const ACE_CString& child_uuid) -{ - CIAO::Component_Binding_Info * retv; - ACE_NEW_RETURN (retv, - CIAO::Component_Binding_Info (), - 0); - - retv->name_ = name; - - // Parse the child_uuid string and populate the "node" name and - // "plan_uuid" fields. Our protocol here is searching for the "@", - // the substring *before* that is the global plan uuid, and the - // substring *after* that is the node name. - ACE_CString::size_type pos = child_uuid.find ('@'); - - retv->plan_uuid_ = - child_uuid.substring (0, pos); - - retv->node_ = - child_uuid.substring (pos + 1, - ACE_CString::npos); // get the rest of the string - - Deployment::Connections_var connections; - ACE_NEW_RETURN (connections, - Deployment::Connections, - 0); - - this->get_outgoing_connections_i (name.c_str (), - connections.inout (), - false, // get *all* connections - true); // search current plan - - retv->providedReference_ = connections._retn (); - - return retv; -} - -CIAO::Component_Binding_Info * -CIAO::DomainApplicationManager_Impl:: -populate_binding_info (const ACE_CString& name) -{ - CIAO::Component_Binding_Info * retv; - ACE_NEW_RETURN (retv, - CIAO::Component_Binding_Info (), - 0); - - // Looking for the child plan uuid through the shared compoonent list - for (CORBA::ULong i = 0; i < this->shared_->length (); ++i) - { - if (ACE_OS::strcmp (this->shared_[i].name.in (), - name.c_str ()) == 0) - { - ACE_CString child_uuid = this->shared_[i].plan_uuid.in (); - retv = this->populate_binding_info (name, child_uuid); - return retv; - } + sub_plans.rebind (ACE_CString (my_instance.node.in()), child_plan); } - return 0; // If no matching is found (should never happen). -} - -void -CIAO::DomainApplicationManager_Impl:: -add_shared_components (const Deployment::ComponentPlans & shared) -{ - for (CORBA::ULong i = 0; i < shared.length (); ++i) + //Debug + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::split_plan - " + "Original plan connection count : %u\n", plan.connection.length())); + CORBA::ULong cnt = 0; + for (TNodePlans::iterator it = sub_plans.begin(); it != sub_plans.end(); ++it) { - CORBA::ULong curr_len = this->shared_->length (); - this->shared_->length (curr_len + 1); - this->shared_[curr_len] = shared[i]; + cnt += (*it).int_id_.connection.length(); + // DANCE_DEBUG((LM_DEBUG, "[%M] Dumping deployment plan #%C:\n", (*it).ext_id_.c_str())); + // Deployment::DnC_Dump::dump((*it).int_id_); } -} - -bool -CIAO::DomainApplicationManager_Impl:: -is_shared_component (const char * name) -{ - for (CORBA::ULong i = 0; i < this->shared_->length (); ++i) - { - if (ACE_OS::strcmp (this->shared_[i].name.in (), - name) == 0) - return true; - } - - return false; + DANCE_DEBUG ((LM_DEBUG, DLINFO "DomainApplicationManager_Impl::split_plan - " + "Child plans connection count : %u\n", cnt)); } void -CIAO::DomainApplicationManager_Impl:: -synchronize_shared_components_with_node_managers (void) +DomainApplicationManager_Impl::preparePlan() { - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager object reference. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::startLaunch -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl:startLaunch", - error.c_str ())); - } - - // Update the shared components list - ::Deployment::NodeManager_ptr - my_node_manager = (entry->int_id_).node_manager_.in (); - - Deployment::ComponentPlans_var - shared = my_node_manager->get_shared_components (); + DANCE_TRACE ("DomainApplicationManager_Impl::preparePlan()"); - this->add_shared_components (shared.in ()); - } -} - - -Deployment::Connections * -CIAO::DomainApplicationManager_Impl:: -get_outgoing_connections (const Deployment::DeploymentPlan &plan, - bool is_getting_all_connections, - bool is_search_new_plan, - Connection_Search_Type t) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_outgoing_connections"); - Deployment::Connections_var connections; - ACE_NEW_RETURN (connections, - Deployment::Connections, - 0); - - // For each component instance in the child plan ... - CORBA::ULong number = plan.instance.length (); - for (CORBA::ULong i = 0; i < number; ++i) - { - - if (t == Internal_Connections && - this->is_shared_component (plan.instance[i].name.in ())) - continue; - - // Get the outgoing connections of the component - if (!get_outgoing_connections_i (plan.instance[i].name.in (), - connections.inout (), - is_getting_all_connections, - is_search_new_plan)) - return 0; - } - return connections._retn (); -} - - -// Get outgoing connections for particular instance -bool -CIAO::DomainApplicationManager_Impl:: -get_outgoing_connections_i (const char * instname, - Deployment::Connections & retv, - bool is_getting_all_connections, - bool is_search_new_plan) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_outoing_connections_i"); - - Deployment::DeploymentPlan tmp_plan; - if (is_search_new_plan) - tmp_plan = this->plan_; - else - tmp_plan = this->old_plan_; - - // Search for all the bindings in the plan. - const CORBA::ULong total_length = tmp_plan.connection.length(); - for (CORBA::ULong i = 0; i < total_length; ++i) - { - // Current binding that we are looking at. - const Deployment::PlanConnectionDescription & binding = - tmp_plan.connection[i]; - - // If this is a ReDaC case, then we ignore the connection if it - // already exists in the old_plan - if (already_exists (binding) && - !is_getting_all_connections) - continue; - - this->populate_connection_for_binding (instname, - binding, - tmp_plan, - retv); - } - return true; -} - -// Search the current binding to see whether a connection of this -// component needs to be populated -bool -CIAO::DomainApplicationManager_Impl:: -populate_connection_for_binding ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - const CORBA::ULong binding_len = binding.internalEndpoint.length (); - - // If only 1 internalEndpoint, then we know it's through event service. - if (binding_len == 1) - { - return - this->handle_es_connection (instname, - binding, - plan, - retv); - } - else if (binding_len == 2) - { - return this->handle_direct_connection (instname, - binding, - plan, - retv); - } - else // invalid binding encounted... - return false; -} - -bool -CIAO::DomainApplicationManager_Impl:: -handle_es_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - // The initial retv might have something inside - CORBA::ULong len = retv.length (); - - const Deployment::PlanSubcomponentPortEndpoint & endpoint = - binding.internalEndpoint[0]; - - // If the instance name does NOT match one of the names in the binding - // Then thsi binding has nothing related to myself (an instance) - if (ACE_OS::strcmp (instname, - plan.instance[endpoint.instanceRef].name.in ()) != 0) - return false; - - if (binding.externalReference.length () != 1) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::" - "handle_publisher_es_connection -" - "externalReference must have length of 1.\n")); - return false; - } - - retv.length (len+1); - retv[len].instanceName = instname; - retv[len].portName = endpoint.portName.in (); - retv[len].kind = endpoint.kind; - - ACE_CString es_id = binding.externalReference[0].location.in (); - - retv[len].endpointInstanceName = es_id.c_str (); - retv[len].endpointPortName = CORBA::string_dup ("CIAO_ES"); - - // We need to populate the actual filter and store it into - // the <connection.config> field - if (binding.deployRequirement.length () != 0) - { - retv[len].config = - * (this->get_connection_QoS_configuration (binding.deployRequirement[0])); - } - - // If we didnt find the objref of the connection ... - CIAO::CIAO_Event_Service_var es; - - if (this->es_map_.find (es_id.c_str (), es) != 0) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_Impl::create_connections_i", - error.c_str ()); - } - - retv[len].event_service = es._retn (); - - // One more thing needs to be done if this is a es_consumer connection - // We need to populate the <endpoint> field of this connection, which - // is the object reference of this event consumer port. - if (endpoint.kind == Deployment::EventConsumer) - { - // Now we search in the received connections to get the objRef of event sink - bool found = false; - const CORBA::ULong all_conn_len = this->all_connections_->length (); - for (CORBA::ULong j = 0; j < all_conn_len; ++j) - { - const Deployment::Connection & curr_recv_conn = - this->all_connections_[j]; - - // We need to look at the instance name and the port name to confirm. - if (ACE_OS::strcmp (curr_recv_conn.instanceName.in (), - instname) == 0 && - ACE_OS::strcmp (curr_recv_conn.portName.in (), - endpoint.portName.in ()) == 0) - { - retv[len].endpoint = - CORBA::Object::_duplicate(curr_recv_conn.endpoint.in ()); - found = true; - } - } // End of searching received connections - - if (!found) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_Impl::handle_es_connection", - error.c_str ()); - } - } - - return true; -} - -bool -CIAO::DomainApplicationManager_Impl:: -handle_direct_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv) -{ - // The initial retv might have something inside - CORBA::ULong len = retv.length (); - - const CORBA::ULong binding_len = binding.internalEndpoint.length (); - for (CORBA::ULong i = 0; i < binding_len; ++i) - { - const Deployment::PlanSubcomponentPortEndpoint & endpoint = - binding.internalEndpoint[i]; - - // If the instance name does NOT match one of the names in the binding - if (ACE_OS::strcmp (instname, - plan.instance[endpoint.instanceRef].name.in ()) != 0) - continue; - - // We are only interested when we are the "client" of the endpoint objref - if (endpoint.kind == Deployment::EventPublisher || - endpoint.kind == Deployment::EventEmitter || - endpoint.kind == Deployment::SimplexReceptacle || - endpoint.kind == Deployment::MultiplexReceptacle ) - { - // Obtain the index of the "real" endpoint which has an objref. It - // is the opposite side of myself. - CORBA::ULong e_index = (i + 1) % 2; - - ACE_CString source_port = - binding.internalEndpoint[i].portName.in (); - - ACE_CString endpoint_inst = - plan.instance[binding.internalEndpoint[e_index] - .instanceRef].name.in (); - - ACE_CString endpoint_port = - binding.internalEndpoint[e_index].portName.in (); - - bool found = false; - - // Now we search in the received connections to get the objRef. - const CORBA::ULong all_conn_len = this->all_connections_->length (); - for (CORBA::ULong j = 0; j < all_conn_len; ++j) - { - const Deployment::Connection & curr_recv_conn = - this->all_connections_[j]; - - // We need to look at the instance name and the port name to confirm. - if (ACE_OS::strcmp (curr_recv_conn.instanceName.in (), - endpoint_inst.c_str ()) == 0 && - ACE_OS::strcmp (curr_recv_conn.portName.in (), - endpoint_port.c_str ()) == 0) - { - retv.length (len+1); - retv[len].instanceName = instname; - retv[len].portName = source_port.c_str (); - retv[len].endpointInstanceName = endpoint_inst.c_str (); - retv[len].endpointPortName = endpoint_port.c_str (); - - retv[len].endpoint = - CORBA::Object::_duplicate(curr_recv_conn.endpoint.in ()); - retv[len].kind = binding.internalEndpoint[i].kind; - - ++len; - found = true; - break; - } - } // End of searching received connections - - // We didnt find the objref of the connection ... - if (!found) - { - ACE_CString error ("Creating connections for "); - error += instname; - error += ": unable to find object reference for connection "; - error += binding.name.in (); - throw Deployment::StartError( - "DomainApplicationManager_Impl::create_connections_i", - error.c_str ()); - } - break; - } - } - return true; -} - -void -CIAO::DomainApplicationManager_Impl:: -start () -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::start"); - - try - { - CORBA::ULong i; - - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw Deployment::StartError( - "DomainApplicationManager_Impl:startLaunch", - error.c_str ()); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->ciao_preactivate (); - } - - // Invoke start () operation on each cached NodeApplication object. - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - throw Deployment::StartError (); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->start (); - } - - // Invoke ciao_postctivate () operation on each - // cached NodeApplication object. - - for (i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::start -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to node manager: "); - error += this->node_manager_names_[i]; - - throw Deployment::StartError( - "DomainApplicationManager_Impl:startLaunch", - error.c_str ()); - } - - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); - - my_na->ciao_postactivate (); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("DomainApplicationManager_Impl::start\t\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -destroyApplication () -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::destroyApplication"); 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) + // Map of sub plans for each node + TNodePlans sub_plans; + // Splitting deployment plan on sub plans for each node + DomainApplicationManager_Impl::split_plan (this->plan_, sub_plans); + DANCE_DEBUG((LM_TRACE, DLINFO "DomainApplicationManager_Impl::preparePlan - Plan successfully split\n")); + // Executing preparePlan on each NodeManager described in DeploymentPlan + for (TNodePlans::iterator iter_plans = sub_plans.begin(); + iter_plans != sub_plans.end(); + ++iter_plans) { - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::destroyApplication -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - this->node_manager_names_[i].c_str ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += this->node_manager_names_[i]; - - throw - (Deployment::StopError - ("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_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *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, we search the current plan - DomainApplicationManager_Impl::External_Connections); - - // Invoke finishLaunch() on NodeApplication to remove bindings. - // If this NodeApplication is not within the control of this DAM, - // then we should delegate the call to the correct DAM through EM. - - // Iterave over the returned connection list in <connections>, - // (1) If this is a shared component, then we remove this connection - // from <connections> list, and then populate a "Component_Binding_Info" - // struct for it and send to EM for remove. - // (2) For the rest of the connections, we send them to the NAs - // managed by the local DAM to remove. - - for (CORBA::ULong j = 0; j < connections->length (); ++j) - { - 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 (inst_name.c_str ()); - - this->execution_manager_->finalize_global_binding ( - *binding, false); - - // Remove all the connections whose "source" component - // is this component instance from the <connections> list - this->purge_connections (connections, - inst_name.c_str ()); - } - } - - if (connections->length () > 0) + // Finding correspondent NodeManager + Deployment::NodeManager_var nm = this->nodes_.locate_node ((*iter_plans).ext_id_.c_str ());; + // If NodeManager not found throw StartError exception + if (CORBA::is_nil (nm.in ())) { - entry->int_id_.node_application_->finishLaunch - (connections.in (), - true, // "true" ==> start the components - false // "false" => remove connections - ); + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Deployment::StartError exception. NodeManager %C cannot be found\n", + (*iter_plans).ext_id_.c_str())); + throw Deployment::StartError ( (*iter_plans).ext_id_.c_str(), "NodeManager not found"); } - } - - // After all the connections are removed, we actually destroy - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - - this->artifact_map_.find (this->node_manager_names_[i], entry); - - // Invoke destroyPlan() operation on the NodeManager - Deployment::NodeManager_var - my_node_manager = (entry->int_id_).node_manager_; - - my_node_manager->destroyPlan ((entry->int_id_).child_plan_); - } - - // ?? - // Shall we invoke destroyManager () operation on the NodeManager, since we need - // 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 (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::destroyApplication\t\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -destroyManager () -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::destroyManager"); - try - { - for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) - { - // Get the NodeManager and NodeApplicationManager object references. - ACE_Hash_Map_Entry - <ACE_CString, - Chained_Artifacts> *entry = 0; - - if (this->artifact_map_.find (this->node_manager_names_[i], - entry) != 0) - throw Deployment::StopError (); // Should never happen! - - ::Deployment::NodeManager_var my_node_manager = - (entry->int_id_).node_manager_; - - ::Deployment::NodeApplicationManager_var my_nam = - (entry->int_id_).node_application_manager_; - - my_node_manager->destroyManager (my_nam.in ()); - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::destroyManager\t\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -perform_redeployment ( - const Deployment::DeploymentPlan & plan) -{ - // Currently we could dynamically update the NodeManagerMap topology, - // but later maybe we could add another parameter to this operation, - // which allows the user to specify the new NodeManagerMap data file. - this->old_plan_ = this->plan_; - this->is_redeployment_ = true; - this->plan_ = plan; - - try - { - // Call init() on the myself, which will validate/split the plan and - // call preparePlan on each NodeManager, by this, we shall get - // all the object references of NM and NAM associated with each - // component instance populated. - this->init (); - - // Call startLaunch on each NM for each child plan, this should not only - // install all the new components specified, but should also remove - // the components that are no longer in the new deployment plan. - // Meanwhile, we should set up the container configurations appropriately, - // whose information is fully captured in the node-level deployment plan. - ::Deployment::Properties_var properties; - ACE_NEW (properties, - Deployment::Properties); - - this->startLaunch (properties.in (), false); - - // finishLaunch will (1) establish new connections, and (2) - // get rid of those non-existing connections. As we know, in the - // node level, the connections are cached within the NodeApplication *and* - // Container, then we should modify the implementation of the - // <finishLaunch> on the NodeApplication to accomplish this. - this->finishLaunch (true, true); // true means start activation also. - // ture means "ReDaC" is desired - - this->start (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::perform_redeployment\t\n"); - this->plan_ = this->old_plan_; - throw; - } -} - - -// Returns the DeploymentPlan associated with this ApplicationManager. -::Deployment::DeploymentPlan * -CIAO::DomainApplicationManager_Impl:: -getPlan () -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::getPlan"); - Deployment::DeploymentPlan_var plan = 0; - // Make a deep copy of the Plan - ACE_NEW_THROW_EX (plan, - Deployment::DeploymentPlan (this->plan_), - CORBA::NO_MEMORY ()); - - // Transfer ownership - return plan._retn (); -} - -void -CIAO::DomainApplicationManager_Impl:: -dump_connections (const ::Deployment::Connections & connections) -{ - CIAO_TRACE("CIAO::DomainApplicationManager_Impl::dump_connections"); - const CORBA::ULong conn_len = connections.length (); - for (CORBA::ULong i = 0; i < conn_len; ++i) - { - ACE_DEBUG ((LM_DEBUG, - "instanceName: %s\n", connections[i].instanceName.in ())); - - ACE_DEBUG ((LM_DEBUG, "portName: %s\n", connections[i].portName.in ())); - - ACE_DEBUG ((LM_DEBUG, "portkind: ")); - - switch (connections[i].kind) - { - case Deployment::Facet: - - ACE_DEBUG ((LM_DEBUG, "Facet\n")); - break; - - case Deployment::SimplexReceptacle: - - ACE_DEBUG ((LM_DEBUG, "SimplexReceptacle\n")); - break; - - case Deployment::MultiplexReceptacle: - - ACE_DEBUG ((LM_DEBUG, "MultiplexReceptacle\n")); - break; + // Calling preparePlan for node, specified in current sub plan + DANCE_DEBUG((LM_TRACE, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Calling preparePlan on node %C\n", + (*iter_plans).ext_id_.c_str())); - case Deployment::EventEmitter: + Deployment::NodeApplicationManager_ptr nam + = nm->preparePlan ( (*iter_plans).int_id_, + Deployment::ResourceCommitmentManager::_nil()); - ACE_DEBUG ((LM_DEBUG, "EventEmitter\n")); - break; - - case Deployment::EventPublisher: - - ACE_DEBUG ((LM_DEBUG, "EventPublisher\n")); - break; - - case Deployment::EventConsumer: - - ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); - break; - - default: - ACE_DEBUG ((LM_DEBUG, "Unknown port kind.\n")); - } - - ACE_DEBUG ((LM_DEBUG, - "endpointInstanceName: %s\n", - connections[i].endpointInstanceName.in ())); - - ACE_DEBUG ((LM_DEBUG, - "endpointPortName: %s\n", - connections[i].endpointPortName.in ())); - ACE_DEBUG ((LM_DEBUG, "---------------------\n")); - } -} - -bool -CIAO::DomainApplicationManager_Impl:: -already_exists (const Deployment::PlanConnectionDescription & conn) -{ - const CORBA::ULong conn_len = this->old_plan_.connection.length(); - for(CORBA::ULong i = 0; i < conn_len; ++i) - { - if (ACE_OS::strcmp (this->old_plan_.connection[i].name.in (), - conn.name.in ()) == 0) - return true; - } - - return false; -} - -Deployment::Connections * -CIAO::DomainApplicationManager_Impl:: -subtract_connections (const Deployment::Connections & left, - const Deployment::Connections & right) -{ - Deployment::Connections_var retv; - ACE_NEW_RETURN (retv, - Deployment::Connections, - 0); - - CORBA::ULong left_length = left.length (); - CORBA::ULong right_length = right.length (); - for (CORBA::ULong i = 0; i < left_length; ++i) - { - bool found = false; - for (CORBA::ULong j = 0; j < right_length; ++j) - { - if (ACE_OS::strcmp (left[i].instanceName.in (), - right[j].instanceName.in ()) == 0 && - ACE_OS::strcmp (left[i].portName.in (), - right[j].portName.in ()) == 0 && - left[i].kind == right[j].kind && - left[i].endpoint->_is_equivalent (right[j].endpoint.in ())) + if (CORBA::is_nil (nam)) { - found = true; - break; + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "PreparePlan failed for node %C, returning a nill " + "NodeApplicationManager poiniter.\n", + (*iter_plans).ext_id_.c_str())); + throw ::Deployment::StartError(); } - } + // We save NAM reference ptr in TNodes vector were it places to var variable + this->sub_app_mgr_.bind (nam, nm); - if (!found) - { - CORBA::ULong curr_length = retv->length (); - retv->length (curr_length + 1); - retv[curr_length] = left[i]; - } - } - return retv._retn (); -} - -void -CIAO::DomainApplicationManager_Impl:: -passivate_shared_components (void) -{ - try - { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->passivate_shared_components ( - *binding); - - delete binding; + DANCE_DEBUG ((LM_INFO, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Sucessfully prepared node %C for deployment\n", + (*iter_plans).ext_id_.c_str())); } } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::passivate_shared_components.\n"); - throw; - } - -} - -void -CIAO::DomainApplicationManager_Impl:: -activate_shared_components (void) -{ - try + catch (Deployment::StartError &e) { - // For each "external" component... - CORBA::ULong length = this->shared_->length (); - for (CORBA::ULong j = 0; j < length; ++j) - { - // Construct <Component_Binding_Info> 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 <finalize_global_binding> on ExecutionManager - this->execution_manager_->activate_shared_components ( - *binding); - - delete binding; - } + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Propagating StartError exception caught here\n")); + throw e; } - catch (const CORBA::Exception& ex) + catch (CORBA::Exception &ex) { - ex._tao_print_exception ( - "DomainApplicationManager_Impl::activate_shared_components.\n"); - throw; + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Caught a CORBA exception, propagating StartError: %s\n", + ex._info ().c_str ())); + throw ::Deployment::StartError (); } - -} - -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) + catch (...) { - bool found = false; - - // Remove all the connections whose "source" component - // name is <inst> - 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); + DANCE_ERROR ((LM_ERROR, DLINFO "DomainApplicationManager_Impl::preparePlan - " + "Caught unknown exception. Propagating StartError\n")); + throw ::Deployment::StartError (); } } -const Deployment::Properties * -CIAO::DomainApplicationManager_Impl:: -get_connection_QoS_configuration (const Deployment::Requirement & requirement) -{ - // Get the name/identifier of the filter associated with - // this connection - Deployment::Properties * retv; - ACE_NEW_NORETURN (retv, Deployment::Properties); - CORBA::ULong len = retv->length (); - for (CORBA::ULong i = 0; - i < requirement.property.length (); - ++i) - { - const char *filter_name; - if (ACE_OS::strcmp ("EventFilter", - requirement.property[i].name) == 0) - { - - if ((requirement.property[i].value >>= filter_name) == false) - ACE_ERROR ((LM_ERROR, - "ERROR: DomainApplicationManager_Impl::" - "get_connection_QoS_configuration unable to " - "extract event filter information\n")); - } - // Search for the desired filter - for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) - { - // Populate the "filters" info, in case this CIAO_Event_Service has - // one or more filters specified through descriptors - for (CORBA::ULong k = 0; k < this->esd_[j].filters.length (); ++k) - { - if (ACE_OS::strcmp (this->esd_[j].filters[k].name.in (), - filter_name) == 0) - { - retv->length (len + 1); - (*retv)[len].name = CORBA::string_dup ("EventFilter"); - (*retv)[len].value <<= this->esd_[j].filters[k]; - break; - } - } - } - } - return retv; -} diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h index bc471e2f495..9433693573f 100644 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h +++ b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h @@ -1,462 +1,73 @@ -//================================================================== +// -*- C++ -*- + +//============================================================================= /** - * @file DomainApplicationManager_Impl.h + * @file DomainApplicationManager_Impl.h * * $Id$ * - * This file contains implementation for the servant of - * Deployment::DomainApplicationManager. + * @Brief Implementation of POA_Deployment::DomainApplicationManager * - * @author Gan Deng <gan.deng@vanderbilt.edu> - * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> - * @author Tao Lu <lu@dre.vanderbilt.edu> + * @author Erwin Gottlieb <eg@prismtech.com> */ -//===================================================================== - -#ifndef CIAO_DOMAINAPPLICATIONMANAGER_IMPL_H -#define CIAO_DOMAINAPPLICATIONMANAGER_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +//============================================================================= +#ifndef DOMAINAPPLICATIONMANAGER_IMPL_H_ +#define DOMAINAPPLICATIONMANAGER_IMPL_H_ -#include "ace/Hash_Map_Manager.h" #include "ace/Vector_T.h" -#include "ace/Functor.h" -#include "ace/OS_NS_string.h" - -#include "DAnCE/Deployment/Deployment_DomainApplicationManagerS.h" -#include "DAnCE/Deployment/Deployment_common.h" - -#include "tao/Valuetype/ValueBase.h" -#include "tao/Valuetype/Valuetype_Adapter_Impl.h" - -#include "ciao/CIAO_common.h" -#include "DAnCE/Deployment/Deployment_EventsC.h" - -#include "Deployment_Configuration.h" +#include "ace/SStringfwd.h" +#include "ace/Map_Manager.h" #include "DomainApplicationManager_Export.h" +#include "Deployment/Deployment_DomainApplicationManagerS.h" +#include "Deployment/Deployment_NodeApplicationManagerC.h" +#include "DomainApplication/Domain_Application_Impl.h" +#include "Deployment/Deployment_NodeManagerC.h" +#include "DomainApplicationManager/Node_Locator.h" -namespace CIAO -{ - namespace Execution_Manager +namespace DAnCE { - class Execution_Manager_Impl; - } - - /** - * @class DomainApplicationManager_Impl - * - * @brief A servant for the Deployment::DomainApplicationManager - * interface. The DomainApplicationManager is responsible for - * deploying an application on the domain level, i.e. across - * nodes. It specializes the ApplicationManager abstract interface. - */ class DomainApplicationManager_Export DomainApplicationManager_Impl - : public virtual POA_Deployment::DomainApplicationManager - { - public: - - /// External_Connections means we search all the connections including - /// the connectiosn for external/shared components of this plan which hold - /// port objrefs of components within this plan - enum Connection_Search_Type - { - External_Connections, - Internal_Connections - }; - - /// Define the type which contains a list of DnC artifacts. - /// @@ Assumption: Each NodeApplicationManager create only one - /// NodeApplication when the startLaunch() operation is invoked, - /// which means all the nodes on that child plan are collocated in - /// the same process. - typedef struct _chained_artifacts + : public virtual POA_Deployment::DomainApplicationManager { - ::Deployment::NodeManager_var node_manager_; - ::Deployment::DeploymentPlan_var child_plan_; - ::Deployment::NodeApplicationManager_var node_application_manager_; - ::Deployment::NodeApplication_var node_application_; - ::Deployment::DeploymentPlan_var old_child_plan_; - } Chained_Artifacts; - - /// Constructor - DomainApplicationManager_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Deployment::TargetManager_ptr manager, - Execution_Manager::Execution_Manager_Impl * em, - const Deployment::DeploymentPlan &plan, - const char * deployment_file); - - - /*=========================================================== - * Below are helper methods for the DomainApplicationManager - * - *============================================================*/ - /** - * Initialize the DomainApplicationManager. - * @para em A pointer to the ExecutionManager servant C++ object. - * - * (1) Set the total number of child plans. - * (2) Set the list of NodeManager names, which is an array of strings. - * The <node_manager_names> is a pointer to an array of ACE_CString - * objets, which is allocated by the caller and deallocated by the - * DomainApplicationManager destructor. - * (3) Check the validity of the deployment plan and the deployment - * information data file. - * (4) Call split_plan () member function. - * (5) Invoke all the preparePlan () operations on all the corresponding - * NodeManagers with child plans. - * - * - * @@ What else do we need to initialize here? - */ - void init (); - - /** - * set_uuid method on the DomainApplicationManager assigns the - * UUID of the associated plan to this Manager. This helps in - * reverse lookup operations such as given a manager, obtaining - * the UUID associated. The get_uuid method is used in this case. - */ - void set_uuid (const char * uuid); - - const char * get_uuid () const; - - /*=========================================================== - * Below are operations from the DomainApplicationManager - * - *============================================================*/ - - /** - * Fetch the NodeApplication object reference based on the NodeManager name. - */ - virtual Deployment::NodeApplication_ptr get_node_app ( - const char * node_name); - - /** - * Executes the application, but does not start it yet. Users can - * optionally provide launch-time configuration properties to - * override properties that are part of the plan. Raises the - * InvalidProperty exception if a configuration property is - * invalid. Raises the StartError exception if an error occurs - * during launching. Raises the ResourceNotAvailable exception if - * the commitResources parameter to the prepare operation of the - * ExecutionManager was true, if late resource allocation is used, - * and one of the requested resources is not available. - */ - virtual void - startLaunch (const ::Deployment::Properties & configProperty, - ::CORBA::Boolean start); - - /** - * The second step in launching an application in the - * domain-level. If the start parameter is true, the application - * is started as well. Raises the StartError exception if - * launching or starting the application fails. - */ - virtual void finishLaunch (CORBA::Boolean start, - CORBA::Boolean is_ReDAC); - - /** - * The last step in launching an application in the - * domain-level. We establish connection bindings - * for external/shared components of this deployment plan - * components. - * Internally, this operation will invoke some operations - * on ExecutionManager to finish up this task. - */ - virtual void post_finishLaunch (void); - - virtual void passivate_shared_components (void); - - virtual void activate_shared_components (void); - - /** - * Starts the application. Raises the StartError exception if - * starting the application fails. - */ - virtual void start (); - - /** - * Terminates a running application. Raises the StopError - * exception if an error occurs during termination. Raises the - * InvalidReference exception if the appliction reference is - * unknown. - */ - virtual void destroyApplication (); - - /** - * Returns the DeploymentPlan associated with this ApplicationManager. - */ - virtual ::Deployment::DeploymentPlan * getPlan (); - - /** - * This is a helper function to destroy the NodeAppManager. - * Since we don't want to do so in the destructor so we will - * ask the ExecutionManager to do this on us when the same IDL - * op invoked on it. This is part of the result for merging DAM - * with DA. - */ - virtual void destroyManager (); - - // The input parameter is a *new_plan* which has the - // same UUID of the existing running plan. - virtual void - perform_redeployment ( - const Deployment::DeploymentPlan & plan); - - protected: - /// Destructor - virtual ~DomainApplicationManager_Impl (void); - - /** - * (1) Parse the global deployment plan, get the total number of - * child plans included in the global plan, and get the list of - * names of NodeManagers for each child plan. - * (2) Check whether all the NodeManager names are present in the - * deployment information data file. - */ - bool get_plan_info (void); - - /** - * Split the global (domain-level) deployment plan to a set of - * local (node-level) deployment plans. The set of local plans - * are cached in the ACE hash map member variable. - * Also, fill in the <node_manager_> field of the Chained_Artifacts - * struct. - */ - int split_plan (void); - - /** - * Construct <Component_Binding_Info> struct for the component instance. - * - * @param name component instance name - * @param child_uuid child plan uuid string - */ - CIAO::Component_Binding_Info * - populate_binding_info (const ACE_CString& name, - const ACE_CString& child_uuid); - - /** - * Construct <Component_Binding_Info> struct for the component instance. - * Fetch the plan_uuid info from the internally cached shared component - * list. - * - * @param name component instance name - */ - CIAO::Component_Binding_Info * - populate_binding_info (const ACE_CString& name); - - /** - * Contact each NodeManager to get shared compnents information - * and then update its internal cache. - */ - void synchronize_shared_components_with_node_managers (void); - - /** - * A helper function to add a list of shared components into - * the cached shared component list. - * - * @param shared A list of shared components to be added. - */ - void add_shared_components (const Deployment::ComponentPlans & shared); - - /** - * A private function to check whether a component is in the shared - * component list. - * - * @param name The name of a component instance. - */ - bool is_shared_component (const char * name); - - /** - * Cache the incoming connections, which is a sequence of Connections, - * into the <all_connections_> list. - */ - void add_connections (const Deployment::Connections & incoming_conn); - - /** - * Given a child deployment plan, find the <Connections> sequence - * of the "providedReference" for the component instances in the - * child deployment plan as Receiver side. - * By default, we search in the new plan. - * - * If <is_getting_all_connections> is false, then we only - * search for "new connections" (valid for ReDaC case only). - * Otherwise, we will search for both new connections and those - * already existing connections. - */ - Deployment::Connections * - get_outgoing_connections (const Deployment::DeploymentPlan &plan, - bool is_getting_all_connections = true, - bool is_search_new_plan = true, - Connection_Search_Type t = Internal_Connections); - - /// This is a helper function to find the connection for a component. - bool - get_outgoing_connections_i (const char * instname, - Deployment::Connections & retv, - bool is_ReDAC, - bool is_search_new_plan); - - bool - populate_connection_for_binding ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - bool - handle_es_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - bool - handle_direct_connection ( - const char * instname, - const Deployment::PlanConnectionDescription & binding, - const Deployment::DeploymentPlan & plan, - Deployment::Connections & retv); - - /// Dump connections, a static method - void dump_connections (const ::Deployment::Connections & connections); - - /// Check whether a connection already exists in the cached old plan - bool already_exists (const Deployment::PlanConnectionDescription & conn); - - /// Remove those appeared in <right> from the <left> - Deployment::Connections * - subtract_connections (const Deployment::Connections & left, - const Deployment::Connections & right); - - void - purge_connections (Deployment::Connections_var & connections, - const char * inst); - - /** - * The first step in finish_launching an application in the - * domain-level. We install all the CIAO_Event_Service objects - * as specified in the DeploymentPlan. - * Internally, this operation will invoke an operation on each cached - * NodeApplication object. - */ - virtual void install_all_es (void); - - /** - * Add all CIAO_Event_Service objects into the cached map. - */ - virtual void - add_es_to_map (const char* node_name, - CIAO::CIAO_Event_Service * ciao_es); - - /** - * Get the actual event connection QoS properties based on the - * deployment requirement. The deployment requirement only specifies - * an identifier/reference to the EventServiceDeploymentDescriptions. - */ - virtual const Deployment::Properties * - get_connection_QoS_configuration ( - const Deployment::Requirement & requirement); - - protected: - /// location of the Domainapplication - CORBA::String_var domainapp_path_; - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Pointer to the ExecutionManager_Impl "singleton" servant object - /// We could do this because ExecutionManager and DomainApplicationManager - /// are always collocated in the same process, so we don't have - /// to pass CORBA object reference back and forth. - Execution_Manager::Execution_Manager_Impl * execution_manager_; - - /// Cache a list of shared components - Deployment::ComponentPlans_var shared_; - - /// Cache the ior of the previous reference - CORBA::String_var ior_; - - /// Cached TargetManager. - Deployment::TargetManager_var target_manager_; - - /// Cached deployment plan for the particular domain. - /// The plan will be initialized when init is called. - Deployment::DeploymentPlan plan_; - - /// Cached old deployment plan, i.e., before redeployment - Deployment::DeploymentPlan old_plan_; - - /// Cached child plans. - //Deployment::DeploymentPlan * child_plan_; - - /// Total number of child deployment plans. - size_t num_child_plans_; - - /// The list of node manager names, each of them - /// corresponds to one child plan. - ACE_Vector<ACE_CString> node_manager_names_; + private: + typedef ACE_Map_Manager<ACE_CString, Deployment::DeploymentPlan, ACE_Null_Mutex> TNodePlans; - /// Cached information for NodeManager, NodeApplicationManager, - /// NodeApplication, Connections, etc. - /// Key: NodeManager name with CString type. - /// Value: Chained_Artifacts struct type. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Chained_Artifacts, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Chained_Artifacts_Table; + public: + DomainApplicationManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + Node_Locator &nodes); - Chained_Artifacts_Table artifact_map_; + virtual ~DomainApplicationManager_Impl(); - /// Cached information of all the CIAO_Event_Service objects within - /// the deployment plan - /// Key: the string identifier of the CIAO_Event_Service - /// Value: the object reference of the CIAO_Event_Service - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - CIAO::CIAO_Event_Service_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Event_Service_Table; + virtual Deployment::Application_ptr + startLaunch (const Deployment::Properties & configProperty, + Deployment::Connections_out providedReference); - Event_Service_Table es_map_; + virtual void destroyApplication (Deployment::Application_ptr); - /// The deployment information data file. - const char * deployment_file_; + virtual ::Deployment::Applications * getApplications (void); - /// Deployment Configuration info, which contains the deployment topology. - Deployment_Configuration deployment_config_; + virtual ::Deployment::DeploymentPlan * getPlan (void); - /// UUID from the Plan - CORBA::String_var uuid_; + void dump_connections (const ::Deployment::Connections & connections) const; - /// Maintain a list of <Connections>, each of which is obtained by - /// calling the startLaunch() method on the NodeApplicationManager object. - ::Deployment::Connections_var all_connections_; + private: + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + const Deployment::DeploymentPlan plan_; + DomainApplication_Impl::TNam2Nm sub_app_mgr_; + Node_Locator &nodes_; + typedef ACE_Vector<DomainApplication_Impl*> TApplications; + TApplications running_app_; - /// This variable is used to control the execution path of some - /// member function implementations. The reason is because we want - /// to avoid unnecessary code duplicate. The default value is "false". - bool is_redeployment_; + static void split_plan (const Deployment::DeploymentPlan & plan, + TNodePlans & sub_plans); - /// Cache the CIAO_Event_Service deployment description - CIAO::DAnCE::EventServiceDeploymentDescriptions_var esd_; - }; -} + void preparePlan(); + }; -#if defined (__ACE_INLINE__) -# include "DomainApplicationManager_Impl.inl" -#endif /* __ACE_INLINE__ */ +};//DAnCE -#include /**/ "ace/post.h" -#endif /* CIAO_DOMAINAPPLICATIONMANAGER_IMPL_H */ +#endif /*DOMAINAPPLICATIONMANAGER_IMPL_H_*/ diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.inl b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.inl deleted file mode 100644 index b50adfbc712..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.inl +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -ACE_INLINE const char * -CIAO::DomainApplicationManager_Impl::get_uuid () const -{ - return this->uuid_; -} - -ACE_INLINE void -CIAO::DomainApplicationManager_Impl::set_uuid (const char * uuid) -{ - // Copy this uuid reference - this->uuid_ = CORBA::string_dup (uuid); -} diff --git a/CIAO/DAnCE/DomainApplicationManager/Node_Locator.cpp b/CIAO/DAnCE/DomainApplicationManager/Node_Locator.cpp new file mode 100644 index 00000000000..2f01f5f92d6 --- /dev/null +++ b/CIAO/DAnCE/DomainApplicationManager/Node_Locator.cpp @@ -0,0 +1,170 @@ +// $Id$ + +#include "Node_Locator.h" + +#include "ace/Read_Buffer.h" +#include "DAnCE/Logger/Log_Macros.h" + +namespace DAnCE +{ + Node_Locator::Node_Locator (CORBA::ORB_ptr orb, + CosNaming::NamingContext_ptr nc) + : orb_ (CORBA::ORB::_duplicate (orb)), + nc_ (CosNaming::NamingContext::_duplicate (nc)) + { + } + + ::Deployment::NodeManager_ptr + Node_Locator::locate_node (const ACE_TCHAR *name) + { + ACE_CString ior; + + if (this->nodes_.find (name, ior) == 0) + { + return this->resolve_ior (name, ior.c_str ()); + } + else + { + return this->ns_lookup (name); + } + } + + bool + Node_Locator::process_node_map (const ACE_TCHAR *filename) + { + DANCE_TRACE ("Node_Locator::process_node_map"); + + if (filename == 0) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::process_node_map - " + "Error: Provided with nil filename\n")); + return false; + } + + FILE *inf = ACE_OS::fopen (filename, ACE_TEXT("r")); + + if (inf == 0) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::process_node_map - " + "Fail to open node manager map data file: <%s>\n", + filename)); + return false; + } + + ACE_Read_Buffer reader (inf, true); + + char* string = 0; + // Read from the file line by line + while ((string = reader.read ('\n')) != 0) + { + if (ACE_OS::strlen (string) == 0) continue; + + // Search from the right to the first space + const char* ior_start = ACE_OS::strrchr (string, ' '); + // Search from the left to the first space + const char* dest_end = ACE_OS::strchr (string, ' '); + + // The destination is first followed by some spaces + ACE_CString destination (string, dest_end - string); + // And then the IOR + ACE_CString ior (ior_start + 1, ACE_OS::strlen (ior_start + 1)); + reader.alloc ()->free (string); + + DANCE_DEBUG ((LM_INFO, DLINFO "Node_Locator::process_node_map - " + "Storing IOR %C for destination %C\n", + ior.c_str (), destination.c_str ())); + this->nodes_.bind (destination, ior); + } + + return true; + } + + ::Deployment::NodeManager_ptr + Node_Locator::resolve_ior (const ACE_TCHAR *name, const ACE_TCHAR *ior) + { + DANCE_TRACE ("Node_Locator::resolve_ior"); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Locator::resolve_ior - " + "Resolving ior %s for destination %s\n", + ior, name)); + + CORBA::Object_var obj = this->orb_->string_to_object (ior); + + if (CORBA::is_nil (obj.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::resolve_ior - " + "Error: Unable to resolve object reference for destination " + "%s and ior %s\n", + name, ior)); + return false; + } + + ::Deployment::NodeManager_var nm = ::Deployment::NodeManager::_narrow (obj.in ()); + + if (CORBA::is_nil (nm.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::resolve_ior - " + "Error: Unable to narrow reference for destination " + "%s and ior %s\n", + name, ior)); + return false; + } + + return nm._retn (); + } + + void + Node_Locator::store_ior (const ACE_TCHAR *name, const ACE_TCHAR *ior) + { + DANCE_TRACE ("Node_Locator::store_ior"); + this->nodes_.bind (name, ior); + } + + ::Deployment::NodeManager_ptr + Node_Locator::ns_lookup (const ACE_TCHAR *nodename) + { + DANCE_TRACE ("Node_Locator::ns_lookup"); + + if (CORBA::is_nil (this->nc_.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::ns_lookup - " + "Nameservice lookup of %s failed because there is no naming service.\n", + nodename)); + return ::Deployment::NodeManager::_nil (); + } + + try + { + CosNaming::Name name; + name.length (1); + + name[0].id = nodename; + name[0].kind = ACE_TEXT("NodeManager"); + + CORBA::Object_var obj = this->nc_->resolve (name); + ::Deployment::NodeManager_var nm = ::Deployment::NodeManager::_narrow (obj.in ()); + + if (CORBA::is_nil (nm.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::ns_lookup - " + "Unable to narrow provided reference for node %s\n", + nodename)); + return ::Deployment::NodeManager::_nil (); + } + + return nm._retn (); + } + catch (const CORBA::Exception &e) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Locator::ns_lookup - " + "Caught CORBA exception while looking up name %s:%C\n", + nodename, e._info ().c_str ())); + } + catch (...) + { + } + + return ::Deployment::NodeManager::_nil (); + } +} + diff --git a/CIAO/DAnCE/DomainApplicationManager/Node_Locator.h b/CIAO/DAnCE/DomainApplicationManager/Node_Locator.h new file mode 100644 index 00000000000..f3255d0c230 --- /dev/null +++ b/CIAO/DAnCE/DomainApplicationManager/Node_Locator.h @@ -0,0 +1,55 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Node_Locator.h + * + * $Id$ + * + * @Brief Locates NodeManager instances. + * + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef NODE_LOCATOR_H_ +#define NODE_LOCATOR_H_ + +#include "ace/Map_Manager.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" +#include "tao/ORB.h" +#include "DAnCE/Deployment/Deployment_NodeManagerC.h" +#include "DomainApplicationManager/DomainApplicationManager_Export.h" + +namespace DAnCE +{ + class DomainApplicationManager_Export Node_Locator + { + public: + Node_Locator (CORBA::ORB_ptr orb, + CosNaming::NamingContext_ptr nc); + + ::Deployment::NodeManager_ptr locate_node (const ACE_TCHAR *name); + + bool process_node_map (const ACE_TCHAR *file); + + void store_ior (const ACE_TCHAR *name, const ACE_TCHAR *ior); + + private: + ::Deployment::NodeManager_ptr resolve_ior (const ACE_TCHAR *name, + const ACE_TCHAR *ior); + + ::Deployment::NodeManager_ptr ns_lookup (const ACE_TCHAR *name); + + typedef ACE_Map_Manager<ACE_TString, + ACE_TString, + ACE_Null_Mutex> NODEMAP; + + NODEMAP nodes_; + CORBA::ORB_var orb_; + CosNaming::NamingContext_var nc_; + }; + +} + +#endif /* NODE_LOCATOR_H_ */ diff --git a/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.cpp b/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.cpp deleted file mode 100644 index 6ebe08457da..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "Reply_Handler_i.h" -#include "DomainApplicationManager_AMI_Impl.h" - -// Implementation skeleton constructor -Deployment_AMI_NodeApplicationManagerHandler_i:: -Deployment_AMI_NodeApplicationManagerHandler_i (CIAO::DomainApplicationManager_AMH_Impl *dam) -: retn_node_app_ (0), - retn_connections_ (0), - dam_ (dam) -{ -} - -// Implementation skeleton destructor -Deployment_AMI_NodeApplicationManagerHandler_i::~Deployment_AMI_NodeApplicationManagerHandler_i (void) -{ -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::startLaunch ( - ::Deployment::Application_ptr ami_return_val, - const ::Deployment::Connections & providedReference) -{ - if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_ERROR, - "CIAO (%P|%t): Reply_Handler_i.cpp::AMI startLaunch() returned\n")); - - // Add your implementation here - ACE_Guard<TAO_SYNCH_MUTEX> guard (lock_); - - CIAO::DomainApplicationManager_AMI_Impl * ami_dam = - static_cast<CIAO::DomainApplicationManager_AMI_Impl*> (dam_); - ami_dam->decrease_start_launch_reply_count (); - - // Narrow down to NodeApplication object reference - this->retn_node_app_ = - ::Deployment::NodeApplication::_narrow (ami_return_val); - - this->retn_connections_ = providedReference; - - // Below operation will be called only once, i.e., when the reply count - // drops to zero - if (ami_dam->start_launch_reply_count () == 0) - ami_dam->post_ami_startLaunch (); -} - -::Deployment::NodeApplication_ptr -Deployment_AMI_NodeApplicationManagerHandler_i::get_node_app () -{ - return ::Deployment::NodeApplication::_duplicate ( - this->retn_node_app_.in ()); -} - - -::Deployment::Connections -Deployment_AMI_NodeApplicationManagerHandler_i::get_connections () -{ - return this->retn_connections_; -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::perform_redeployment ( - ::Deployment::Application_ptr, - const ::Deployment::Connections &) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::perform_redeployment_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::reset_plan () -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::reset_plan_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::set_shared_components () -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::set_shared_components_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::set_priority ( - ::CORBA::Long) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::set_priority_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - - - -void Deployment_AMI_NodeApplicationManagerHandler_i::startLaunch_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::destroyApplication () -{ - // Add your implementation here -} - -void Deployment_AMI_NodeApplicationManagerHandler_i::destroyApplication_excep ( - ::Messaging::ExceptionHolder *) -{ - // Add your implementation here -} - diff --git a/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.h b/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.h deleted file mode 100644 index 57649c1c948..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Reply_Handler_i.h +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - - -#ifndef DEPLOYMENT_NODEAPPLICATIONMANAGER_REPLY_HANDLER_H -#define DEPLOYMENT_NODEAPPLICATIONMANAGER_REPLY_HANDLER_H - -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerS.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "DomainApplicationManager_Export.h" -#include "DomainApplicationManager_AMH_Impl.h" // A base class -#include "ace/Thread_Mutex.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class DomainApplicationManager_Export Deployment_AMI_NodeApplicationManagerHandler_i - : public virtual POA_Deployment::AMI_NodeApplicationManagerHandler -{ -public: - /// Constructor - Deployment_AMI_NodeApplicationManagerHandler_i (CIAO::DomainApplicationManager_AMH_Impl *dam); - - /// Destructor - virtual ~Deployment_AMI_NodeApplicationManagerHandler_i (void); - - virtual - void startLaunch ( - ::Deployment::Application_ptr ami_return_val, - const ::Deployment::Connections & providedReference); - - ::Deployment::NodeApplication_ptr get_node_app (void); - - ::Deployment::Connections get_connections (void); - - /// Unused operations - - virtual - void perform_redeployment ( - ::Deployment::Application_ptr ami_return_val, - const ::Deployment::Connections & providedReference); - - virtual - void perform_redeployment_excep (::Messaging::ExceptionHolder *); - - virtual - void reset_plan (void); - - virtual - void reset_plan_excep (::Messaging::ExceptionHolder *); - - virtual - void set_shared_components (void); - - virtual - void set_shared_components_excep (::Messaging::ExceptionHolder *); - - virtual - void set_priority (::CORBA::Long); - - virtual - void set_priority_excep (::Messaging::ExceptionHolder *); - - virtual - void startLaunch_excep (::Messaging::ExceptionHolder *); - - virtual - void destroyApplication (void); - - virtual - void destroyApplication_excep (::Messaging::ExceptionHolder *); - -private: - ::Deployment::NodeApplication_var retn_node_app_; - - ::Deployment::Connections retn_connections_; - - TAO_SYNCH_MUTEX lock_; - - ::CIAO::DomainApplicationManager_AMH_Impl * dam_; -}; - - -#endif /* DEPLOYMENT_NODEAPPLICATIONMANAGER_REPLY_HANDLER_H */ - diff --git a/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.cpp b/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.cpp deleted file mode 100644 index 257a8a4ae37..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// -// $Id$ -// -#include "Task_StartLaunch.h" - -CIAO::Task_StartLaunch:: -Task_StartLaunch ( - const char * node_name, - const ::Deployment::NodeApplicationManager_ptr nam, - const ::Deployment::Properties & configProperty) - : node_name_ (node_name) - , nam_ (::Deployment::NodeApplicationManager::_duplicate (nam)) - , configProperty_ (configProperty) -{ -} - -int -CIAO::Task_StartLaunch::svc (void) -{ - try - { - ::Deployment::Application_var temp_application = - this->nam_->startLaunch (this->configProperty_, - retn_connections_.out (), - 0); - - // Narrow down to NodeApplication object reference - this->retn_node_app_ = - ::Deployment::NodeApplication::_narrow (temp_application.in ()); - - if (CORBA::is_nil (retn_node_app_.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) Task_StartLaunch.cpp -" - "CIAO::Task_StartLaunch::svc -" - "ERROR while narrowing the NAM " - "for the node [%s] \n", - node_name_.c_str ())); - - ACE_CString error - ("The DomainApplicationManager receives a nil " - "reference of NodeApplication after calling " - "startLaunch on NodeApplicationManager.\n"); - ACE_ERROR ((LM_ERROR, error.c_str ())); - - throw - (Deployment::StartError - ("DomainApplicationManager_Impl::startLaunch", - error.c_str ())); - } - } - catch (const CORBA::Exception&) - { - return 0; - } - return 0; -} - -::Deployment::Connections -CIAO::Task_StartLaunch::get_connections () -{ - return this->retn_connections_.in (); -} - -::Deployment::NodeApplication_ptr -CIAO::Task_StartLaunch::get_node_app () -{ - return ::Deployment::NodeApplication::_duplicate ( - this->retn_node_app_.in ()); -} diff --git a/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.h b/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.h deleted file mode 100644 index 5046a75cb29..00000000000 --- a/CIAO/DAnCE/DomainApplicationManager/Task_StartLaunch.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Task_StartLaunch.h - * - * $Id$ - * - * An ACE_Task subclass that implements the <startLaunch> task, which - * basically calls <startLaunch> operation on a NodeApplicationManager. - * - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_TASK_START_LAUNCH_H -#define CIAO_TASK_START_LAUNCH_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB_Core.h" -#include "tao/ORB.h" -#include "ace/Task.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerS.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationS.h" - -namespace CIAO -{ - /** - * @class Task_StartLaunch - * - * @brief An ACE_Task subclass that allow the <startLaunch> invocation - * to be completed in a separate thread than then main thread running - * the DomainApplicationManager. - */ - class Task_StartLaunch - : public virtual ACE_Task_Base - { - public: - Task_StartLaunch (const char * node_name, - const ::Deployment::NodeApplicationManager_ptr nam, - const ::Deployment::Properties & configProperty); - - /// Service entry point - virtual int svc (void); - - /// Accessor method to get returned connections - ::Deployment::Connections get_connections (); - - /// Accessor method to get returned NA - ::Deployment::NodeApplication_ptr get_node_app (); - - protected: - //CORBA::ORB_var orb_; - - /// The node name which hosts the NAM - ACE_CString node_name_; - - /// Input parameter which identifies the NAM to invoke the call - ::Deployment::NodeApplicationManager_var nam_; - - /// Input parameter of the configProperty - const ::Deployment::Properties & configProperty_; - - /// The NA obj ref is a return value by calling startLaunch on NAM - ::Deployment::NodeApplication_var retn_node_app_; - - /// Returned object references of <connections>, i.e., provided ports - ::Deployment::Connections_var retn_connections_; - }; - -} - -#include /**/ "ace/post.h" -#endif /* CIAO_TASK_START_LAUNCH_H */ diff --git a/CIAO/DAnCE/ExecutionManager/DAM_Map.cpp b/CIAO/DAnCE/ExecutionManager/DAM_Map.cpp deleted file mode 100644 index 5d50cc682d0..00000000000 --- a/CIAO/DAnCE/ExecutionManager/DAM_Map.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include "DAM_Map.h" -#include "ciao/CIAO_Config.h" -#include "ciao/CIAO_common.h" - -ACE_RCSID (ExecutionManager, - DAM_Map, - "$Id$") - -namespace CIAO -{ - namespace Execution_Manager - { - DAM_Map::DAM_Map (void) - : map_ (CIAO_DEFAULT_MAP_SIZE) - { - } - - size_t - DAM_Map::size (void) const - { - return this->map_.current_size (); - } - - bool - DAM_Map::is_plan_available (const ACE_CString &str) const - { - CIAO_TRACE("Execution_Manager::DAM_Map::is_plan_available"); - if (this->map_.find (str) == 0) - return true; - - return false; - } - - ::Deployment::DomainApplicationManager_ptr - DAM_Map::fetch_dam_reference (const ACE_CString &str) - { - CIAO_TRACE("Execution_Manager::DAM_Map::fetch_dam_reference"); - if (!this->is_plan_available (str)) - return ::Deployment::DomainApplicationManager::_nil (); - - ::Deployment::DomainApplicationManager_var tmp; - - /// There should be duplicate when assigning a _var to an _var. - int const retval = this->map_.find (str, tmp); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) CIAO_ExecutionManager: fetch_dam_reference, " - "result from find is [%d] \n", - retval)); - } - - return tmp._retn (); - } - - - bool - DAM_Map::bind_dam_reference ( - const ACE_CString &str, - ::Deployment::DomainApplicationManager_ptr dam) - { - CIAO_TRACE("Execution_Manager::DAM_Map::bind_dam_reference"); - - if (this->map_.rebind (str, dam) != 0) - return false; - - return true; - } - - - Deployment::DomainApplicationManagers * - DAM_Map::get_dams () - { - CIAO_TRACE("Execution_Manager::DAM_Map::get_dams"); - CORBA::ULong const sz = this->map_.current_size (); - - // Initialize the list of DomainApplication Managers - Deployment::DomainApplicationManagers_var list; - ACE_NEW_THROW_EX (list, - Deployment::DomainApplicationManagers (sz), - CORBA::NO_MEMORY()); - - // Add the manager to the list - list->length (sz); - - Iterator end = this->map_.end (); - - CORBA::ULong i = 0; - - for (Iterator b = this->map_.begin (); b != end; ++b) - { - list [i] = - Deployment::DomainApplicationManager::_duplicate ((*b).int_id_.in ()); - - ++i; - } - - return list._retn (); - } - - bool - DAM_Map::unbind_dam (const ACE_CString &str) - { - CIAO_TRACE("Execution_Manager::DAM_Map::unbind_dam"); - - if (this->map_.unbind (str) != 0) - return false; - - return true; - } - } -} diff --git a/CIAO/DAnCE/ExecutionManager/DAM_Map.h b/CIAO/DAnCE/ExecutionManager/DAM_Map.h deleted file mode 100644 index 734b953d912..00000000000 --- a/CIAO/DAnCE/ExecutionManager/DAM_Map.h +++ /dev/null @@ -1,71 +0,0 @@ -/*======================================================================= - * - * @file DAM_Map.h - * - * $Id$ - * - * @brief Map of DomainApplicationManager to UUID's - * - * @author Bala Natarajan <bala @ dre.vanderbilt.edu> - * - *======================================================================*/ -#ifndef CIAO_DAM_MAP_H -#define CIAO_DAM_MAP_H -#include /**/ "ace/pre.h" - -#include "DAnCE/Deployment/Deployment_DomainApplicationManagerC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Null_Mutex.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/SString.h" - -namespace CIAO -{ - namespace Execution_Manager - { - /** - * @class DAM_Map - * - * @brief Map of DomainApplicationManager to ACE_CStrings - * - */ - class DAM_Map - { - public: - DAM_Map (void); - - bool is_plan_available (const ACE_CString &str) const; - - ::Deployment::DomainApplicationManager_ptr - fetch_dam_reference (const ACE_CString &str); - - bool bind_dam_reference ( - const ACE_CString &str, - ::Deployment::DomainApplicationManager_ptr tmp); - - Deployment::DomainApplicationManagers *get_dams (); - - bool unbind_dam (const ACE_CString &str); - - size_t size (void) const; - - private: - typedef - ACE_Hash_Map_Manager_Ex < ACE_CString, - ::Deployment::DomainApplicationManager_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> MAP; - typedef MAP::iterator Iterator; - - MAP map_; - }; - } -} - -#include /**/ "ace/post.h" -#endif /*CIAO_DAM_MAP_H*/ diff --git a/CIAO/DAnCE/ExecutionManager/DAnCE_ExecutionManager_Module_Export.h b/CIAO/DAnCE/ExecutionManager/DAnCE_ExecutionManager_Module_Export.h new file mode 100644 index 00000000000..6ab710d4044 --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/DAnCE_ExecutionManager_Module_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_ExecutionManager_Module +// ------------------------------ +#ifndef DANCE_EXECUTIONMANAGER_MODULE_EXPORT_H +#define DANCE_EXECUTIONMANAGER_MODULE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL) +# define DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL */ + +#if !defined (DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL) +# define DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL 1 +#endif /* ! DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL */ + +#if defined (DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL) && (DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL == 1) +# if defined (DANCE_EXECUTIONMANAGER_MODULE_BUILD_DLL) +# define DAnCE_ExecutionManager_Module_Export ACE_Proper_Export_Flag +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_EXECUTIONMANAGER_MODULE_BUILD_DLL */ +# define DAnCE_ExecutionManager_Module_Export ACE_Proper_Import_Flag +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_EXECUTIONMANAGER_MODULE_BUILD_DLL */ +#else /* DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL == 1 */ +# define DAnCE_ExecutionManager_Module_Export +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARATION(T) +# define DANCE_EXECUTIONMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_EXECUTIONMANAGER_MODULE_HAS_DLL == 1 */ + +// Set DANCE_EXECUTIONMANAGER_MODULE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_EXECUTIONMANAGER_MODULE_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_EXECUTIONMANAGER_MODULE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_EXECUTIONMANAGER_MODULE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_EXECUTIONMANAGER_MODULE_NTRACE */ + +#if (DANCE_EXECUTIONMANAGER_MODULE_NTRACE == 1) +# define DANCE_EXECUTIONMANAGER_MODULE_TRACE(X) +#else /* (DANCE_EXECUTIONMANAGER_MODULE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_EXECUTIONMANAGER_MODULE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_EXECUTIONMANAGER_MODULE_NTRACE == 1) */ + +#endif /* DANCE_EXECUTIONMANAGER_MODULE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager.mpc b/CIAO/DAnCE/ExecutionManager/ExecutionManager.mpc index 9e3f54d46ca..948701fc5ad 100644 --- a/CIAO/DAnCE/ExecutionManager/ExecutionManager.mpc +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager.mpc @@ -1,16 +1,23 @@ // -*- MPC -*- // $Id$ -project(ExecutionManager): ciao_server_dnc, dance_extension_stub, ciao_domainapplicationmanager_dnc, ciao_executionmanager_stub, rtcorba, rtportableserver, rt_server, ciaoexe, rtcorba, strategies { - exename = Execution_Manager - - IDL_Files { +project(ExecutionManager_Module): dance_lib, taolib, tao_output, utils, strategies, naming, dance_executionmanager_stub, dance_node_manager, dance_domain_application_manager, dance_deployment_svnt { + sharedname = DAnCE_ExecutionManager + dynamicflags = EXECUTIONMANAGER_BUILD_DLL DANCE_EXECUTIONMANAGER_MODULE_BUILD_DLL + + Source_Files { + $(CIAO_ROOT)/DAnCE/Interfaces/ExecutionManagerDaemonS.cpp + ExecutionManager_Impl.cpp + ExecutionManager_Module.cpp } +} + +project(Execution_Manager_Exec) : dance_exe, dance_domain_application_manager, naming_serv, dance_executionmanager_stub { + exename = dance_execution_manager + after += ExecutionManager_Module + libs += DAnCE_ExecutionManager Source_Files { - ../Interfaces/ExecutionManagerDaemonS.cpp - Execution_Manager.cpp - Execution_Manager_Impl.cpp - DAM_Map.cpp + Execution_Manager_Exec.cpp } -} +}
\ No newline at end of file diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager_Export.h b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Export.h new file mode 100644 index 00000000000..8633f5d5400 --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Export.h @@ -0,0 +1,57 @@ +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ExecutionManager +// ------------------------------ +#ifndef EXECUTIONMANAGER_EXPORT_H +#define EXECUTIONMANAGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (EXECUTIONMANAGER_HAS_DLL) +# define EXECUTIONMANAGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && EXECUTIONMANAGER_HAS_DLL */ + +#if !defined (EXECUTIONMANAGER_HAS_DLL) +# define EXECUTIONMANAGER_HAS_DLL 1 +#endif /* ! EXECUTIONMANAGER_HAS_DLL */ + +#if defined (EXECUTIONMANAGER_HAS_DLL) && (EXECUTIONMANAGER_HAS_DLL == 1) +# if defined (EXECUTIONMANAGER_BUILD_DLL) +# define ExecutionManager_Export ACE_Proper_Export_Flag +# define EXECUTIONMANAGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define EXECUTIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* EXECUTIONMANAGER_BUILD_DLL */ +# define ExecutionManager_Export ACE_Proper_Import_Flag +# define EXECUTIONMANAGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define EXECUTIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* EXECUTIONMANAGER_BUILD_DLL */ +#else /* EXECUTIONMANAGER_HAS_DLL == 1 */ +# define ExecutionManager_Export +# define EXECUTIONMANAGER_SINGLETON_DECLARATION(T) +# define EXECUTIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* EXECUTIONMANAGER_HAS_DLL == 1 */ + +// Set EXECUTIONMANAGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (EXECUTIONMANAGER_NTRACE) +# if (ACE_NTRACE == 1) +# define EXECUTIONMANAGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define EXECUTIONMANAGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !EXECUTIONMANAGER_NTRACE */ + +#if (EXECUTIONMANAGER_NTRACE == 1) +# define EXECUTIONMANAGER_TRACE(X) +#else /* (EXECUTIONMANAGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define EXECUTIONMANAGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (EXECUTIONMANAGER_NTRACE == 1) */ + +#endif /* EXECUTIONMANAGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.cpp b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.cpp new file mode 100644 index 00000000000..7dd4ba032cb --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.cpp @@ -0,0 +1,157 @@ +//--*C++*-- +// $Id$ + +#include "ExecutionManager_Impl.h" +#include "ace/Log_Msg.h" +#include "tools/Config_Handlers/DnC_Dump.h" +#include "DAnCE/Logger/Log_Macros.h" + + +using namespace DAnCE; + +ExecutionManager_Impl::ExecutionManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + CosNaming::NamingContext_ptr nc) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + locator_ (orb, nc) +{ + DANCE_TRACE ( "ExecutionManager_Impl::ExecutionManager_Impl"); +} + +ExecutionManager_Impl::~ExecutionManager_Impl() +{ + DANCE_TRACE ( "ExecutionManager_Impl::~ExecutionManager_Impl"); + for (TDomainManagers::iterator iter = this->managers_.begin(); + iter != this->managers_.end(); + ++iter) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "ExecutionManager_Impl::~ExecutionManager_Impl - " + "deactivating DAM \"%C\"\n", (*iter).ext_id_.c_str())); + PortableServer::ObjectId_var id = this->poa_->servant_to_id ( (*iter).int_id_); + DANCE_DEBUG ((LM_TRACE, DLINFO "ExecutionManager_Impl::~ExecutionManager_Impl - " + "before deactivate_object...\n")); + this->poa_->deactivate_object (id.in()); + DANCE_DEBUG ((LM_TRACE, DLINFO "ExecutionManager_Impl::~ExecutionManager_Impl - " + "deleting DomainApplicationManager\n")); + delete (*iter).int_id_; + DANCE_DEBUG ((LM_TRACE, DLINFO "ExecutionManager_Impl::~ExecutionManager_Impl - " + "DomainApplicationManager deleted\n")); + } +} + +::Deployment::DomainApplicationManager_ptr +ExecutionManager_Impl::preparePlan (const ::Deployment::DeploymentPlan & plan, + ::Deployment::ResourceCommitmentManager_ptr /*resourceCommitment*/) +{ + DANCE_TRACE ( "ExecutionManager_Impl::preparePlan"); + + // Check if plan is already deployed. + DomainApplicationManager_Impl * dam = 0; + if (0 == this->managers_.find (plan.UUID.in(), dam)) + { + DANCE_DEBUG((LM_NOTICE, DLINFO "ExecutionManager_Impl::preparePlan - " + "DomainApplicationManager with specified UUID already exists\n")); + // Should we return on this situation reference on existed DomainApplicationManager or + // we should throw PlanError exception? + CORBA::Object_var ref = this->poa_->servant_to_reference (dam); + return Deployment::DomainApplicationManager::_narrow (ref.in ()); + } + + DomainApplicationManager_Impl* dam_servant = 0; + ACE_NEW_THROW_EX (dam_servant, + DAnCE::DomainApplicationManager_Impl (this->orb_.in (), + this->poa_.in (), + plan, + this->locator_), + CORBA::NO_MEMORY ()); + this->managers_.rebind (plan.UUID.in(), dam_servant); + DANCE_DEBUG((LM_TRACE, DLINFO "ExecutionManager_Impl::preparePlan - " + "Domain Application Manager was successfully created.\n")); + + PortableServer::ObjectId_var id = this->poa_->activate_object (dam_servant); + + DANCE_DEBUG((LM_NOTICE, DLINFO "ExecutionManager_Impl::preparePlan - " + "Plan with UUID %C was successfully prepared.\n")); + CORBA::Object_var ref = this->poa_->id_to_reference (id.in()); + return Deployment::DomainApplicationManager::_narrow (ref.in ()); +} + +::Deployment::DomainApplicationManagers * +ExecutionManager_Impl::getManagers () +{ + DANCE_TRACE ( "ExecutionManager_Impl::getManagers ()"); + + ::Deployment::DomainApplicationManagers * managers = 0; + ACE_NEW_THROW_EX (managers, + ::Deployment::DomainApplicationManagers(), + CORBA::NO_MEMORY()); + + managers->length (this->managers_.current_size()); + unsigned int index = 0; + for (TDomainManagers::iterator iter = this->managers_.begin(); + iter != this->managers_.end(); + ++iter) + { + CORBA::Object_var ref = this->poa_->servant_to_reference ( (*iter).int_id_); + (*managers) [index] + = Deployment::DomainApplicationManager::_narrow (ref.in ()); + ++index; + } + + return managers; +} + +void +ExecutionManager_Impl::destroyManager (::Deployment::DomainApplicationManager_ptr appManager) +{ + DANCE_DEBUG((LM_DEBUG, DLINFO "ExecutionManager_Impl::destroyManager - started\n")); + + for (TDomainManagers::iterator iter = this->managers_.begin(); + iter != this->managers_.end(); + ++iter) + { + CORBA::Object_var app = this->poa_->servant_to_reference ( (*iter).int_id_); + if (appManager->_is_equivalent (app.in ())) + { + this->managers_.unbind ( (*iter).ext_id_); + PortableServer::ObjectId_var id = this->poa_->reference_to_id (appManager); + this->poa_->deactivate_object (id.in()); + DANCE_DEBUG((LM_INFO, DLINFO "ExecutionManager_Impl::destroyManager - deleting DomainApplicationManager\n")); + delete (*iter).int_id_; + (*iter).int_id_ = 0; + DANCE_DEBUG((LM_INFO, DLINFO "ExecutionManager_Impl::destroyManager - DomainApplicationManager deleted\n")); + //this->managers_.unbind ( (*iter).ext_id_); + DANCE_DEBUG((LM_INFO, DLINFO "ExecutionManager_Impl::destroyManager - finished\n")); + return; + } + } + DANCE_ERROR ((LM_ERROR, DLINFO "ExecutionManager_Impl::destroyManager - " + "corresponding DomainApplicationManager cannot be found\n")); + throw ::Deployment::StopError(); +} + +// This one derived from ExecutionManagerDaemon interface +// for shutdowning DAnCE agent +void +ExecutionManager_Impl::shutdown () +{ + DANCE_TRACE ("ExecutionManager_Impl::shutdown"); + this->orb_->shutdown(); +} + + +void +ExecutionManager_Impl::add_node_manager (const ACE_TCHAR *name, + const ACE_TCHAR *ior) +{ + DANCE_TRACE ("ExecutionManager_Impl::add_node_manager"); + this->locator_.store_ior (name, ior); +} + +void +ExecutionManager_Impl::load_node_map (const ACE_TCHAR *filename) +{ + DANCE_TRACE ("ExecutionManager_Impl::add_node_manager"); + this->locator_.process_node_map (filename); +} diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h new file mode 100644 index 00000000000..71032330eda --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Impl.h @@ -0,0 +1,71 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ExecutionManager_Impl.h + * + * $Id$ + * + * @Brief Implementation of Deployment::ExecutionManager and POA_DAnCE::ExecutionManagerDaemon + * + * @author Erwin Gottlieb <eg@prismtech.com> + */ +//============================================================================= + +#ifndef EXECUTIONMANAGER_IMPL_H_ +#define EXECUTIONMANAGER_IMPL_H_ + +#include "ace/Map_Manager.h" +#include "ace/SStringfwd.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" +#include "ExecutionManager_Export.h" +#include "Interfaces/ExecutionManagerDaemonS.h" +#include "Deployment/Deployment_NodeManagerC.h" +#include "DomainApplicationManager/DomainApplicationManager_Impl.h" +#include "DomainApplicationManager/Node_Locator.h" + +namespace DAnCE + { + class ExecutionManager_Export ExecutionManager_Impl + : public virtual POA_DAnCE::ExecutionManagerDaemon + { + private: + typedef ACE_Map_Manager<ACE_CString, DomainApplicationManager_Impl*, ACE_Null_Mutex> TDomainManagers; + + public: + + ExecutionManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + CosNaming::NamingContext_ptr); + + virtual ~ExecutionManager_Impl(); + + virtual ::Deployment::DomainApplicationManager_ptr preparePlan ( + const ::Deployment::DeploymentPlan & plan, + ::Deployment::ResourceCommitmentManager_ptr resourceCommitment + ); + + virtual ::Deployment::DomainApplicationManagers * getManagers ( + ); + + virtual void destroyManager ( + ::Deployment::DomainApplicationManager_ptr manager + ); + + // This one derived from ExecutionManagerDaemon interface + // for shutdowning DAnCE agent + virtual void shutdown (); + + void add_node_manager (const ACE_TCHAR *name, const ACE_TCHAR *ior); + + void load_node_map (const ACE_TCHAR *filename); + + private: + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + TDomainManagers managers_; + Node_Locator locator_; + }; +};//DAnCE + +#endif /*EXECUTIONMANAGER_IMPL_H_*/ diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.cpp b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.cpp new file mode 100644 index 00000000000..13751581223 --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.cpp @@ -0,0 +1,382 @@ +// -*- C++ -*- +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/OS.h" + +#include "tao/TAO_Singleton_Manager.h" +#include "tao/StringSeqC.h" +#include "tao/IORTable/IORTable.h" +#include "tao/Utils/PolicyList_Destroyer.h" +#include "orbsvcs/CosNamingC.h" +#include "ciao/CIAO_common.h" +#include "ciao/Valuetype_Factories/Cookies.h" +#include "ExecutionManager_Module.h" +#include "ExecutionManager_Impl.h" +#include "RedirectionService/RedirectionService.h" +#include "DAnCE/Logger/Log_Macros.h" + +ACE_RCSID (DAnCE, + DAnCE_ExecutionManager_Module, + "$Id$") + +namespace DAnCE +{ + namespace ExecutionManager + { + bool + write_IOR (const char * ior_file_name, const char* ior) + { + FILE* ior_output_file_ = + ACE_OS::fopen (ior_file_name, "w"); + + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, + "%s", + ior); + ACE_OS::fclose (ior_output_file_); + DANCE_DEBUG ( (LM_TRACE, DLINFO "ExectionManager::write_IOR - EM's ior was written into file \"%C\"\n", ior_file_name)); + return true; + } + else + { + DANCE_ERROR ( (LM_ERROR, + "[%M] DAnCE_ExecutionManager::write_ior-file - " + "Unable to open ExecutionManager IOR output file %C : %m\n", + ior_file_name)); + return false; + } + return true; + } + } +} + +DAnCE_ExecutionManager_Module::DAnCE_ExecutionManager_Module (void) + : em_impl_ (0) +{ +} + +DAnCE_ExecutionManager_Module::~DAnCE_ExecutionManager_Module (void) +{ + delete this->em_impl_; +} + +bool +DAnCE_ExecutionManager_Module::parse_args (int argc, char *argv[]) +{ + DANCE_TRACE ("DAnCE_ExecutionManager_Module::parse_args"); + + ACE_Get_Opt get_opts (argc, + argv, + "n:e::p::c::r::ifh", + 0, + 0, + ACE_Get_Opt::RETURN_IN_ORDER); + + get_opts.long_option ("exec-mgr", 'e', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option ("node-mgr", 'n', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option ("process-ns", 'p', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option ("create-plan-ns", 'c', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option ("rebind-plan-ns", 'r', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option ("port-indirection", 'i', ACE_Get_Opt::NO_ARG); + get_opts.long_option ("ignore-failure", 'f', ACE_Get_Opt::NO_ARG); + get_opts.long_option ("help", 'h', ACE_Get_Opt::NO_ARG); + get_opts.long_option ("node-map", ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option ("domain-nc", ACE_Get_Opt::ARG_REQUIRED); + + //get_opts.long_option ("help", '?'); + + char c; + while ( (c = get_opts ()) != -1) + { + switch (c) + { + case 'e': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "Output filename is %C\n", + get_opts.opt_arg ())); + this->options_.exec_mgr_file_ = get_opts.opt_arg (); + break; + case 'n': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--node-mgr option was parsed out for EM\n")); + this->options_.node_managers_.push_back (get_opts.opt_arg ()); + break; + + case 'p': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--process-ns enabled for EM\n")); + this->options_.process_ns_ = true; + this->options_.process_ns_file_ = get_opts.opt_arg (); + break; + + case 'c': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--create-plan-ns enabled for EM\n")); + this->options_.create_plan_ns_ = true; + this->options_.create_plan_ns_ior_ = get_opts.opt_arg (); + break; + + case 'r': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--rebind-plan-ns enabled for EM\n")); + this->options_.rebind_plan_ns_ = true; + this->options_.rebind_plan_ns_ior_ = get_opts.opt_arg (); + break; + + case 'i': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--port-indirection enabled for EM\n")); + this->options_.port_indirection_ = true; + break; + + case 'f': + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::parse_args - " + "--ignore-failure enabled for EM\n")); + this->options_.ignore_failure_ = true; + break; + + case 0: + if (ACE_OS::strcmp (get_opts.long_option (), + "node-map") == 0) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Found Node map filename %C.\n", + get_opts.opt_arg ())); + this->options_.node_map_ = get_opts.opt_arg (); + break; + + } + else if (ACE_OS::strcmp (get_opts.long_option (), + "domain-nc") == 0) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Binding to domain naming context %C.\n", + get_opts.opt_arg ())); + this->options_.domain_nc_ = get_opts.opt_arg (); + break; + } + + case 'h': + //case '?': // Display help for use of the server. + //default: + DANCE_ERROR_RETURN ((LM_ERROR, + "usage: %C\n" + "\t--exec-mgr,-e [execution manager ior file name]\n" + "\t--node-mgr,-n <node name>[=node manager ior file name]\n" + "\t--node-map <file name> \t\tFile containing a node manager map\n" + "\t--domain-nc <nc ior> \t\tIOR for the Domain Naming Context\n" + //"--process-ns,-p [file name] \t\tcreate process name service and store its ior to file name\n" + //"--create-plan-ns,-c [NC] \t\tcreate plan objects (components and ports) representation in name context with ior NC\n" + //"--rebind-plan-ns,-r [NC] \t\tbind plan representation name context to NC\n" + //"-i \t\t\t\tenable plan objects indirection via servant locator\n", + ,argv [0]), + false); + break; + } + } + return true; +} + +CORBA::Object_ptr +DAnCE_ExecutionManager_Module::create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv[]) +{ + DANCE_TRACE ("DAnCE_ExecutionManager_Module::create_object"); + + try + { + if (this->em_impl_ != 0) + { + DANCE_ERROR ( (LM_ERROR, + DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "Error: ExecutionManager already exists.\n")); + return CORBA::Object::_nil (); + } + + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before parsing arguments.\n")); + + if (!this->parse_args (argc, argv)) + return CORBA::Object::_nil (); + + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before creating value factory.\n")); + CORBA::ValueFactory_var vf = new Components::Cookie_init(); + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before registering value factory.\n")); + vf = orb->register_value_factory ("IDL:omg.org/Components/Cookie:1.0", vf.in()); + + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "after creating value factory.\n")); + // Get reference to Root POA. + CORBA::Object_var poa_obj + = orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var poa + = PortableServer::POA::_narrow (poa_obj.in ()); + + PortableServer::POAManager_var mgr = poa->the_POAManager (); + + PortableServer::POA_var persistent_poa; + TAO::Utils::PolicyList_Destroyer policies (2); + policies.length (2); + try + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before creating the \"Managers\" POA.\n")); + + policies[0] = poa->create_id_assignment_policy (PortableServer::USER_ID); + policies[1] = poa->create_lifespan_policy (PortableServer::PERSISTENT); + persistent_poa = poa->create_POA ("Managers", + mgr.in(), + policies); + } + catch (const PortableServer::POA::AdapterAlreadyExists &) + { + persistent_poa = poa->find_POA ("Managers", 0); + } + + CosNaming::NamingContext_var domain_nc; + + // Resolve DomainNC + try + { + if (this->options_.domain_nc_) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before resolving \"DomainNC\".\n")); + CORBA::Object_var domain_obj = orb->string_to_object (this->options_.domain_nc_); + if (!CORBA::is_nil (domain_obj.in ())) + { + domain_nc = CosNaming::NamingContext::_narrow (domain_obj.in()); + if (CORBA::is_nil (domain_nc.in ())) + { + DANCE_ERROR ( (LM_ERROR, + DLINFO "Narrow to NamingContext return nil for DomainNC.\n")); + return CORBA::Object::_nil (); + } + } + } + } + catch (CORBA::Exception&) + { + DANCE_DEBUG ((LM_DEBUG, + DLINFO "DomainNC context not found!\n")); + } + + // Initialize IOR table + CORBA::Object_var table_object + = orb->resolve_initial_references ("IORTable"); + + IORTable::Table_var adapter + = IORTable::Table::_narrow (table_object.in ()); + + if (CORBA::is_nil (adapter.in ())) + { + DANCE_ERROR ( (LM_ERROR, + DLINFO "Nil IORTable\n")); + return CORBA::Object::_nil (); + } + + // Create and install the DAnCE Daemon servant on child POA + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - before creating EM servant.\n")); + ACE_NEW_RETURN (this->em_impl_, + DAnCE::ExecutionManager_Impl (orb, + poa.in (), + domain_nc.in ()), + CORBA::Object::_nil ()); + + // Explicit activation through the persistent POA + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId ("ExecutionManager"); + persistent_poa->activate_object_with_id (oid, this->em_impl_); + + CORBA::Object_var em_obj = persistent_poa->id_to_reference (oid.in ()); + CORBA::String_var em_ior = orb->object_to_string (em_obj.in ()); + + DAnCE::ExecutionManagerDaemon_var em_daemon + = DAnCE::ExecutionManagerDaemon::_narrow (em_obj.in ()); + + // Binding ior to IOR Table + adapter->bind ("ExecutionManager", em_ior.in ()); + + // Saving execution manager ior + if (0 != this->options_.exec_mgr_file_) + { + DAnCE::ExecutionManager::write_IOR (this->options_.exec_mgr_file_, em_ior.in ()); + } + + // Binding execution manager to name service + if (!CORBA::is_nil (domain_nc.in ())) + { + DANCE_DEBUG((LM_TRACE, DLINFO "Registering EM in NC.\n")); + CosNaming::Name name (1); + name.length (1); + name[0].id = CORBA::string_dup ("ExecutionManager"); + domain_nc->rebind (name, em_daemon.in()); + } + + // End ExecutionManager initialization part + + // Initializing NodeManagers + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "before processing --node-mgr options(%u).\n", this->options_.node_managers_.size())); + for (size_t i = 0; i < this->options_.node_managers_.size(); ++i) + { + size_t pos = this->options_.node_managers_[i].find ('='); + ACE_CString node_name = this->options_.node_managers_[i]; + ACE_CString nm_ior; + + if (ACE_CString::npos == pos) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "Execution manager received --node-mgr without IOR\n")); + continue; + } + + node_name = this->options_.node_managers_[i].substring (0, pos); + nm_ior = this->options_.node_managers_[i].substring (pos + 1); + /* + CORBA::Object_var obj = orb->string_to_object (nm_ior.c_str ()); + Deployment::NodeManager_var nm_obj = + Deployment::NodeManager::_narrow (obj.in ()); + + if (CORBA::is_nil (nm_obj)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_ExecutionManager::create_object - " + "Failed to narrow the object to node manager : %C\n", + this->options_.node_managers_[i].c_str())); + continue; + } + */ + DANCE_DEBUG ((LM_TRACE, DLINFO "Placing node \"%C\" to EM's map.\n", node_name.c_str())); + this->em_impl_->add_node_manager (node_name.c_str(), nm_ior.c_str ()); + } + + if (this->options_.node_map_ != 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_ExecutionManager_Module::create_object - " + "Parsing node map %C\n", + this->options_.node_map_)); + this->em_impl_->load_node_map (this->options_.node_map_); + } + + + mgr->activate (); + + return em_obj._retn (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("DAnCE_ExecutionManager::run_main\n"); + return CORBA::Object::_nil (); + } +} + +ACE_FACTORY_DEFINE (DAnCE_ExecutionManager_Module, DAnCE_ExecutionManager_Module) + + + diff --git a/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.h b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.h new file mode 100644 index 00000000000..869c2b093d4 --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/ExecutionManager_Module.h @@ -0,0 +1,102 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ExecutionManager_Module.h + * + * $Id$ + * + * @Brief + * + * @author Vinzenz Tornow <vt@prismtech.com> + */ +//============================================================================= + +#ifndef EXECUTION_MANAGER_MODULE_H +#define EXECUTION_MANAGER_MODULE_H + +#include /**/ "ace/pre.h" + +#include "DAnCE_ExecutionManager_Module_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Service_Config.h" +#include "ace/Vector_T.h" +#include "tao/Object_Loader.h" + +namespace DAnCE +{ + class ExecutionManager_Impl; +} + +/** + * @class Execution_Manager_Module + * + * @brief The shared object that is instantiated when the execution manager + * module/library is dynamically loaded. + * + * This class runs the execution manager instance + */ +class DAnCE_ExecutionManager_Module_Export DAnCE_ExecutionManager_Module + : public TAO_Object_Loader + { + public: + struct SOptions + { + const char* exec_mgr_file_; + bool process_ns_; + const char* process_ns_file_; + bool create_plan_ns_; + const char* create_plan_ns_ior_; + bool rebind_plan_ns_; + const char* rebind_plan_ns_ior_; + bool port_indirection_; + ACE_Vector<ACE_CString> node_managers_; + bool ignore_failure_; + const char *node_map_; + const char *domain_nc_; + + SOptions() + : exec_mgr_file_ (0), + process_ns_ (false), + process_ns_file_ (0), + create_plan_ns_ (false), + create_plan_ns_ior_ (0), + rebind_plan_ns_ (false), + rebind_plan_ns_ior_ (0), + ignore_failure_ (false), + node_map_(0), + domain_nc_ (0) + { + } + }; + + /// Constructor. + DAnCE_ExecutionManager_Module (void); + + /// Destructor. + ~DAnCE_ExecutionManager_Module (void); + + /// Overload the base class method to create a new instance + /// of a DAnCE_NodeManager_Module object. + virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv []); + + virtual bool parse_args (int argc, ACE_TCHAR *argv []); + + SOptions options_; + private: + /// Storage for ExecutionManager servant. + DAnCE::ExecutionManager_Impl * em_impl_; + }; + +ACE_FACTORY_DECLARE (DAnCE_ExecutionManager_Module, DAnCE_ExecutionManager_Module) + +#include /**/ "ace/post.h" + +#endif /* EXECUTION_MANAGER_MODULE_H */ + diff --git a/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp b/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp deleted file mode 100644 index e7b70bc8533..00000000000 --- a/CIAO/DAnCE/ExecutionManager/Execution_Manager.cpp +++ /dev/null @@ -1,323 +0,0 @@ -//--*C++*-- -// $Id$ - -#include "Execution_Manager_Impl.h" - -// Include Name Service header -#include "orbsvcs/CosNamingC.h" -#include "tao/Utils/Implicit_Deactivator.h" - -#include "tao/RTCORBA/RTCORBA.h" -#include "tao/RTCORBA/RT_Policy_i.h" -#include "tao/RTPortableServer/RTPortableServer.h" -#include "tao/Strategies/advanced_resource.h" - -#include "ace/SString.h" -#include "ace/Read_Buffer.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_stdio.h" - -namespace CIAO -{ - namespace Execution_Manager - { - const char *ior_file_name_ = "executionManager.ior"; - const char *init_file_name = "deployment.dat"; - const char *pid_file_name_ = 0; - static bool register_with_ns_ = false; - static bool write_to_ior_ = false; - static bool rt_corba_enabled = false; - static bool is_using_ami = false; - static bool is_using_active_object = false; - - bool - parse_args (int argc, ACE_TCHAR *argv[]) - { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:i:abnrp:")); - 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_ = true; - break; - case 'r': - rt_corba_enabled = true; - break; - case 'p': - pid_file_name_ = get_opts.opt_arg (); - break; - case 'a': - is_using_ami = true; - break; - case 'b': - is_using_active_object = true; - break; - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s\n" - "-a : Using Asynchronous Deployment\n" - "-b : Using Active Object based deployment \n" - "-o <ior_output_file>\n" - "-i <installation data filename>\n" - "-n <use naming service>\n" - "-p <filename to output the process id>\n" - "\n", - argv [0]), - false); - } - - return true; - } - - bool - write_ior_file (CORBA::ORB_ptr orb, CIAO::ExecutionManagerDaemon_ptr obj) - { - CORBA::String_var ior = orb->object_to_string (obj); - - FILE* ior_output_file_ = ACE_OS::fopen (ior_file_name_, "w"); - - if (ior_output_file_) - { - ACE_OS::fprintf (ior_output_file_, - "%s", - ior.in ()); - ACE_OS::fclose (ior_output_file_); - } - else - { - ACE_ERROR ((LM_ERROR, - "Unable to open ExecutionManager IOR output file %s : %m\n", - ior_file_name_)); - return false; - } - return true; - } - - bool - write_pid (void) - { - - FILE* pid_file = ACE_OS::fopen (pid_file_name_, "w"); - - if (!pid_file) - { - ACE_ERROR ( (LM_ERROR, "Unable to open file %s to write the PID : %m", - pid_file_name_)); - return false; - } - ACE_OS::fprintf (pid_file, "%i", ACE_OS::getpid ()); - ACE_OS::fclose (pid_file); - return true; - } - - - bool - register_with_ns (CORBA::ORB_ptr orb, - CIAO::ExecutionManagerDaemon_ptr obj) - { - // Naming Service related operations - CORBA::Object_var naming_context_object = - orb->resolve_initial_references ("NameService"); - - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_context_object.in ()); - - // Initialize the Naming Sequence - CosNaming::Name name (1); - name.length (1); - - name[0].id = CORBA::string_dup ("ExecutionManager"); - - // Register the servant with the Naming Service - try - { - // Register the servant with the Naming Service - naming_context->bind (name, obj); - } - catch (const CosNaming::NamingContext::AlreadyBound &) - { - ACE_DEBUG ((LM_DEBUG, - "Execution_Manager.cpp: Name already bound, rebinding\n")); - naming_context->rebind (name, obj); - } - - return true; - } - - int - run_main (int argc, char *argv[]) - { - - try - { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (!parse_args (argc, argv)) - return -1; - - // RTORB. - CORBA::Object_var object = - orb->resolve_initial_references ("RTORB"); - RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in ()); - - if (CORBA::is_nil (rt_orb.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " - "Nil RT_ORB panic error, returning \n"), - -1); - - // Get reference to Root POA. - CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in ()); - - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " - "Nil Root POA panic error, returning \n"), - -1); - - // POAManager. - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - if (poa_manager.in () == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " - "Nil POA Manager panic error, returning \n"), - -1); - - PortableServer::POA_var child_poa; - if (rt_corba_enabled) - { - // Create child POA with RTCORBA::ClientProtocolPolicy set. - CORBA::PolicyList poa_policy_list; - poa_policy_list.length (1); - poa_policy_list[0] = - rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED, - 0); - - child_poa = - root_poa->create_POA ("Child_POA", - poa_manager.in (), - poa_policy_list); - - - } - else - { - child_poa = - root_poa->create_POA ("Child_POA", - poa_manager.in (), - 0); - } - - if (CORBA::is_nil (child_poa.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " - "Nil Child POA panic error, returning \n"), - -1); - - // Create and install the CIAO Daemon servant on child POA - Execution_Manager_Impl *daemon_servant = 0; - ACE_NEW_RETURN (daemon_servant, - Execution_Manager_Impl(orb.in (), - child_poa.in (), - init_file_name, - is_using_ami, - is_using_active_object), - -1); - - // Explicit activation through the child POA - PortableServer::ServantBase_var safe_daemon (daemon_servant); - TAO::Utils::Implicit_Deactivator de (daemon_servant); - - PortableServer::ObjectId_var id = - child_poa->activate_object (daemon_servant); - - CORBA::Object_var daemon_obj = - child_poa->id_to_reference (id.in ()); - - CIAO::ExecutionManagerDaemon_var daemon = - CIAO::ExecutionManagerDaemon::_narrow (daemon_obj.in ()); - - // Register to naming service - bool retval = false; - - if (register_with_ns_) - { - retval = register_with_ns (orb.in (), daemon.in ()); - if (!retval) - return -1; - } - - - if (write_to_ior_) - { - retval = write_ior_file (orb.in (), daemon.in ()); - if (!retval) - return -1; - } - - // Activate POA manager - PortableServer::POAManager_var mgr = root_poa->the_POAManager (); - - if (CORBA::is_nil (mgr.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) CIAO_ExecutionManager: " - "Nil POA Manager error, returning \n"), - -1); - - mgr->activate (); - - // End Deployment part - ACE_DEBUG ((LM_DEBUG, - "CIAO_ExecutionManager is running...\n")); - - if (pid_file_name_) - { - retval = write_pid (); - if (!retval) - return -1; - } - - // Run the main event loop for the ORB. - orb->run (); - - // Forget the pointer. The POA will take care of it during - // destroy. - (void) de.release (); - - root_poa->destroy (1, 1); - - orb->destroy (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO_ExecutionManager::main\n"); - return -1; - } - - ACE_DEBUG ((LM_DEBUG, - "CIAO_ExecutionManager has closed\n")); - return 0; - } - - } -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - return CIAO::Execution_Manager::run_main (argc, argv); -} diff --git a/CIAO/DAnCE/ExecutionManager/Execution_Manager_Exec.cpp b/CIAO/DAnCE/ExecutionManager/Execution_Manager_Exec.cpp new file mode 100644 index 00000000000..2331ec167df --- /dev/null +++ b/CIAO/DAnCE/ExecutionManager/Execution_Manager_Exec.cpp @@ -0,0 +1,7 @@ +// $Id$ +#include "ExecutionManager_Module.h" + +#define DANCE_MODULE_MAIN_CLASS_NAME DAnCE_ExecutionManager_Module +#include "Deployment/Module_Main.h" + + diff --git a/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp b/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp deleted file mode 100644 index 2b9afabd89f..00000000000 --- a/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp +++ /dev/null @@ -1,541 +0,0 @@ -// $Id$ - -#include "Execution_Manager_Impl.h" -#include "tao/RTCORBA/RTCORBA.h" -#include "ciao/CIAO_common.h" -#include "DomainApplicationManager/DomainApplicationManager_Impl.h" -#include "DomainApplicationManager/DomainApplicationManager_AMI_Impl.h" -#include "DomainApplicationManager/DomainApplicationManager_ActiveObject_Impl.h" - -ACE_RCSID (ExecutionManager, - Execution_Manager_Impl, - "$Id$") - -namespace CIAO -{ - namespace Execution_Manager - { - Execution_Manager_Impl::Execution_Manager_Impl ( - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * init_file, - bool is_using_ami, - bool is_using_active_object) - : orb_ (CORBA::ORB::_duplicate (orb)) - , poa_ (PortableServer::POA::_duplicate (poa)) - , init_file_ (init_file) - , is_using_ami_ (is_using_ami) - , is_using_active_object_ (is_using_active_object) - { - } - - Execution_Manager_Impl::~Execution_Manager_Impl (void) - { - } - - Deployment::DomainApplicationManager_ptr - Execution_Manager_Impl::preparePlan ( - const Deployment::DeploymentPlan &plan, - CORBA::Boolean) - { - CIAO_TRACE("Execution_Manager::Execution_Manager_Impl::preparePlan"); - - if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Execution Manager Running on CORBA Priority <%d> \n", - this->get_current_thread_priority ())); - - if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Domain Application Manager " - "invoked CIAO_Execution_Manager: preparePlan \n")); - - // There is a Domain Application Manager already existing - // for this DeploymentPlan. - // No need to create a new DAM. Hence pass the - // reference that is already created. - // - 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 - // to be sent back to the PlanLauncher. - // - PortableServer::ServantBase_var dam_servant; - - // 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")); - - if (this->is_using_ami_) - { - ACE_NEW_THROW_EX ( - dam_servant, - CIAO::DomainApplicationManager_AMI_Impl ( - this->orb_.in (), - this->poa_.in (), - ::Deployment::TargetManager::_nil (), - this, // a plain C++ pointer - plan, - this->init_file_.c_str ()), - CORBA::NO_MEMORY ()); - - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Instantiated CIAO::DomainApplicationManager_AMI_Impl\n")); - - } - else if (this->is_using_active_object_) - { - ACE_NEW_THROW_EX ( - dam_servant, - CIAO::DomainApplicationManager_ActiveObject_Impl ( - this->orb_.in (), - this->poa_.in (), - ::Deployment::TargetManager::_nil (), - this, // a plain C++ pointer - plan, - this->init_file_.c_str ()), - CORBA::NO_MEMORY ()); - - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Instantiated CIAO::DomainApplicationManager_ActiveObject_Impl\n")); - } - else - { - ACE_NEW_THROW_EX ( - dam_servant, - CIAO::DomainApplicationManager_Impl ( - this->orb_.in (), - this->poa_.in (), - ::Deployment::TargetManager::_nil (), - this, // a plain C++ pointer - 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? - // We have exceptions like PlanError or StartError at - // our disposal already in this function. - - // Calling the init function on the DAM. - // This function will split the plan into node specific - // plans, so that those plans can be sent off to individual - // Node Application Managers. - // - - PortableServer::ObjectId_var oid = poa_->activate_object(dam_servant.in()); - - CORBA::Object_var obj = poa_->id_to_reference( oid.in() ); - - Deployment::DomainApplicationManager_var dam = - Deployment::DomainApplicationManager::_narrow (obj.in ()); - - /// @@ TODO:Need to check the return value...... - /// - 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 (); - } - - Deployment::DomainApplicationManagers * - Execution_Manager_Impl::getManagers () - { - CIAO_TRACE("Execution_Manager::Execution_Manager_Impl::getManagers"); - - // TODO Need to check the return value. - // - return this->map_.get_dams (); - } - - Deployment::DomainApplicationManager_ptr - Execution_Manager_Impl::getManager (const char * plan_uuid) - { - return this->map_.fetch_dam_reference (plan_uuid); - } - - void - Execution_Manager_Impl::destroyManager ( - Deployment::DomainApplicationManager_ptr manager) - { - CIAO_TRACE("Execution_Manager::Execution_Manager_Impl::destroyManagers"); - try - { - ::Deployment::DeploymentPlan_var plan = - manager->getPlan (); - - // What if we still have components running within this plan? - // - (void) this->map_.unbind_dam (plan->UUID.in ()); - - // Where does the POA deactivate happen? - // - manager->destroyManager (); - -#if 0 - PortableServer::ObjectId_var oid = - this->poa_->reference_to_id (manager); - - this->poa_->deactivate_object (oid.in ()); -#endif /*if 0*/ - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Execution_Manager_Impl::destroyManager\n"); - throw Deployment::StopError (); - } - } - - - void - Execution_Manager_Impl::destroyManagerByPlan ( - const char * plan_uuid) - { - CIAO_TRACE("Execution_Manager::Execution_Manager_Impl::destroyManagerByPlan"); - try - { - // Get DomainApplicationManager first - if (! this->map_.is_plan_available (plan_uuid)) - { - ACE_ERROR ((LM_ERROR, - "Execution_Manager_Impl::destroyManagerByPlan - " - "Invalid plan uuid [%s]\n", plan_uuid)); - throw Deployment::StopError (); - } - - Deployment::DomainApplicationManager_var - dam = this->map_.fetch_dam_reference (plan_uuid); - - // Get the plan - Deployment::DeploymentPlan_var plan = dam->getPlan (); - - // If any component is still running, then we return. - CORBA::ULong const inst_lenth = plan->instance.length (); - for (CORBA::ULong i = 0; i < inst_lenth; ++i) - { - if (this->is_component_running (plan->instance[i].name.in (), - plan_uuid)) - return; - } - - (void) this->map_.unbind_dam (plan->UUID.in ()); - - // Where does the POA deactivate happen? - // - dam->destroyManager (); - -#if 0 - PortableServer::ObjectId_var oid = - this->poa_->reference_to_id (manager); - - this->poa_->deactivate_object (oid.in ()); -#endif /*if 0*/ - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Execution_Manager_Impl::destroyManager\n"); - throw Deployment::StopError (); - } - } - - void - Execution_Manager_Impl::shutdown () - { - CIAO_TRACE("Execution_Manager::Execution_Manager_Impl::shutdown"); - // Shutdown the ORB on which it is runing - this->orb_->shutdown (0); - } - - void - Execution_Manager_Impl::perform_redeployment ( - const Deployment::DeploymentPlan & plan) - { - 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")); - - Deployment::DomainApplicationManager_var dam; - - if (this->map_.is_plan_available (plan.UUID.in ())) - { - dam = this->map_.fetch_dam_reference (plan.UUID.in ()); - } - else - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" - "CIAO::Execution_Manager_Impl::perform_redeployment -" - "Invalid plan uuid: %s\n", plan.UUID.in ())); - throw Deployment::PlanError ( - "Execution_Manager_Impl::perform_redeployment", - "Invalid plan uuid specified."); - } - - try - { - // Call perform_redeployment() on the DAM, which will do the - // actual redeployment and reconfiguration on the dommain level. - dam->perform_redeployment (plan); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "Execution_Manager_Impl::perform_redeployment\n"); - throw; - } - } - - Deployment::DeploymentPlan * - Execution_Manager_Impl::getPlan (const char * plan_uuid) - { - Deployment::DomainApplicationManager_var dam; - - if (this->map_.is_plan_available (plan_uuid)) - { - dam = this->map_.fetch_dam_reference (plan_uuid); - } - else - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" - "CIAO::Execution_Manager_Impl::getPlan -" - "Invalid plan uuid: %s\n", plan_uuid)); - throw ::CORBA::BAD_PARAM (); - } - - try - { - return dam->getPlan (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Execution_Manager_Impl::getPlan\n"); - throw; - } - } - - void - Execution_Manager_Impl::finalize_global_binding ( - const Component_Binding_Info & binding, - CORBA::Boolean add_or_remove) - { - ACE_DEBUG ((LM_DEBUG, - "Execution_Manage::finalizing global bindings.\n")); - - // Find the NodeApplication hosting the component, and then call - // <finishLaunch> on it - try - { - Deployment::NodeApplication_var - node_app = this->find_node_application (binding); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR ((LM_ERROR, - "Execution_Manager_Impl::finalize_global_binding - " - "nil NodeApplication object reference.\n")); - throw Deployment::InvalidConnection (); - } - - node_app->finishLaunch (binding.providedReference_.in (), - true, // start - add_or_remove); - - // Update the internal shared component list - if (add_or_remove) - this->add_shared_component (binding); - else - this->remove_shared_component (binding); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "Execution_Manager_Impl::finalize_global_binding\n"); - throw Deployment::InvalidConnection (); - } - } - - void - Execution_Manager_Impl::passivate_shared_components ( - const Component_Binding_Info & binding) - { - ACE_DEBUG ((LM_DEBUG, - "Execution_Manage::passivate shared components.\n")); - - // Find the NodeApplication hosting the component, and then call - // <finishLaunch> on it - try - { - Deployment::NodeApplication_var - node_app = this->find_node_application (binding); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR ((LM_ERROR, - "Execution_Manager_Impl::passivate_shared_components - " - "nil NodeApplication object reference.\n")); - throw Deployment::StartError (); - } - - node_app->passivate_component (binding.name_.c_str ()); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "Execution_Manager_Impl::passivate_shared_components\n"); - throw Deployment::StartError (); - } - } - - void - Execution_Manager_Impl::activate_shared_components ( - const Component_Binding_Info & binding) - { - ACE_DEBUG ((LM_DEBUG, - "Execution_Manage::activate shared components.\n")); - - // Find the NodeApplication hosting the component, and then call - // <ciao_activate> on it - try - { - Deployment::NodeApplication_var - node_app = this->find_node_application (binding); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR ((LM_ERROR, - "Execution_Manager_Impl::activate_shared_components - " - "nil NodeApplication object reference.\n")); - throw Deployment::StartError (); - } - - node_app->activate_component (binding.name_.c_str ()); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ( - "Execution_Manager_Impl::passivate_shared_components\n"); - throw Deployment::StartError (); - } - } - - Deployment::NodeApplication_ptr - Execution_Manager_Impl::find_node_application ( - const Component_Binding_Info & binding) - { - // Find the DAM based on plan_UUID - Deployment::DomainApplicationManager_var dam; - - if (this->map_.is_plan_available (binding.plan_uuid_)) - { - dam = this->map_.fetch_dam_reference (binding.plan_uuid_); - } - else - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" - "CIAO::Execution_Manager_Impl::find_node_application -" - "Invalid plan uuid: %s\n", binding.plan_uuid_.c_str ())); - throw ::CORBA::BAD_PARAM (); - } - - // Find the NA based on the NodeName field of the binding - // This is a CORBA call on the DAM - Deployment::NodeApplication_var node_app = - dam->get_node_app (binding.node_.c_str ()); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" - "CIAO::Execution_Manager_Impl::find_node_application -" - "Invalid node name: %s!\n", binding.node_.c_str ())); - throw ::CORBA::BAD_PARAM (); - } - - return node_app._retn (); - } - - CORBA::Short - Execution_Manager_Impl:: - get_current_thread_priority () - { - // Use RTCurrent to find out the CORBA priority of the current - // thread. - - CORBA::Object_var obj = - this->orb_->resolve_initial_references ("RTCurrent"); - - RTCORBA::Current_var current = - RTCORBA::Current::_narrow (obj.in ()); - - if (CORBA::is_nil (obj.in ())) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" - "CIAO::Execution_Manager_Impl::get_current_thread_priority -" - "Unable to get current thread handld.\n")); - throw CORBA::INTERNAL (); - } - - CORBA::Short servant_thread_priority = - current->the_priority (); - - return servant_thread_priority; - } - - void - Execution_Manager_Impl:: - add_shared_component (const Component_Binding_Info & comp) - { - this->shared_components_.insert (comp); - } - - void - Execution_Manager_Impl:: - remove_shared_component (const Component_Binding_Info & comp) - { - this->shared_components_.remove (comp); - } - - bool - Execution_Manager_Impl::is_component_running ( - const char * name, const char * plan_uuid) - { - for (ACE_Unbounded_Set<Component_Binding_Info>::iterator - iter = this->shared_components_.begin (); - iter != this->shared_components_.end (); - ++iter) - { - if (ACE_OS::strcmp ((*iter).name_.c_str (), name) == 0 && - ACE_OS::strcmp ((*iter).plan_uuid_.c_str (), plan_uuid) == 0) - return true; - } - - return false; - } - } -} diff --git a/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h b/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h deleted file mode 100644 index 4a549f42e19..00000000000 --- a/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h +++ /dev/null @@ -1,150 +0,0 @@ -/*======================================================================= - * - * @file Execution_Manager_Impl.h - * - * $Id$ - * - * @brief This file contains implementation for - * Deployment::ExecutionManager interface. - * - * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> - * @auther Tao Lu <lu@dre.vanderbilt.edu> - * - *======================================================================*/ - -#ifndef CIAO_EXECUTION_MANAGER_IMPL_H -#define CIAO_EXECUTION_MANAGER_IMPL_H -#include /**/ "ace/pre.h" - -#include "Interfaces/ExecutionManagerDaemonS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAM_Map.h" -#include "ace/SString.h" -#include "DAnCE/Deployment/Deployment_common.h" - -namespace CIAO -{ - namespace Execution_Manager - { - /** - * - * @class Execution_Manager_Impl - * - * @brief This class implements the ExecutionManger. ExecutionManager - * starts the execution process after the planning stage. - * - */ - class Execution_Manager_Impl - : public virtual POA_CIAO::ExecutionManagerDaemon - { - public: - /// Constructor - Execution_Manager_Impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * init_file, - bool is_using_ami, - bool is_using_active_object); - - /// Template methods from ExecutionManagerDaemon, please see - /// $CIAO_ROOT/DAnCE/Deployment/Deployment.idl for documentation - virtual Deployment::DomainApplicationManager_ptr - preparePlan (const Deployment::DeploymentPlan & plan, - CORBA::Boolean commitResources); - - virtual Deployment::DomainApplicationManagers *getManagers (); - - // Below method is CIAO specific extension - virtual Deployment::DomainApplicationManager_ptr - getManager (const char * plan_uuid); - - virtual void - destroyManager (Deployment::DomainApplicationManager_ptr manager); - - // Below method is CIAO specific extension, please see the IDL - // definition for more details. - virtual void destroyManagerByPlan (const char * plan_uuid); - - virtual void shutdown (); - - // The input parameter is a *new_plan* which has the - // same UUID of the existing running plan. - virtual void - perform_redeployment (const Deployment::DeploymentPlan & plan); - - virtual Deployment::DeploymentPlan * getPlan (const char * plan_uuid); - - /// ****************** C++ Methods ************************* - - /// If input <add_connection> is true, then it will add new - /// connections which are across different assemblies. Otherwise - /// it will remove the specified connections of this component. - /// - /// @@GD: Later we can add another method which could accept - /// a list of bindings and do the batch job. - virtual void finalize_global_binding ( - const Component_Binding_Info & binding, - CORBA::Boolean add_connection); - - virtual void passivate_shared_components ( - const Component_Binding_Info & binding); - - virtual void activate_shared_components ( - const Component_Binding_Info & binding); - - /// Add shared component information. - /// This call will be made by DomainApplicationManager. - virtual void - add_shared_component (const Component_Binding_Info & binding); - - /// Remove shared component - virtual void - remove_shared_component (const Component_Binding_Info & binding); - - /// If the input component <name> was found in the internal - /// cached shared component list, and the plan_uuid also matches, - /// then this member function returns <true>, otherwise it - /// returns <false>. - virtual bool - is_component_running (const char * name, const char * plan_uuid); - - protected: - /// Return the NodeApplication hosting the given biding - virtual Deployment::NodeApplication_ptr - find_node_application (const Component_Binding_Info & binding); - - CORBA::Short get_current_thread_priority (void); - - protected: - /// Destructor. - virtual ~Execution_Manager_Impl (void); - - /// Cached ORB pointer - CORBA::ORB_var orb_; - - /// Cached POA pointer - PortableServer::POA_var poa_; - - /// Path to the initialization file - ACE_CString const init_file_; - - /// Whether we use AMI - bool is_using_ami_; - - /// Whether we use active object based deployment - bool is_using_active_object_; - - /// A map which caches the DomainApplicationManager object ref. - DAM_Map map_; - - /// A set of shared components and their location info. - ACE_Unbounded_Set<Component_Binding_Info> shared_components_; - }; - } -} - -#include /**/ "ace/post.h" -#endif /* EXECUTIONMANAGER_IMPL_H */ diff --git a/CIAO/DAnCE/Interfaces/ExecutionManagerDaemon.idl b/CIAO/DAnCE/Interfaces/ExecutionManagerDaemon.idl index 6bc330ff25e..ce88a04a818 100644 --- a/CIAO/DAnCE/Interfaces/ExecutionManagerDaemon.idl +++ b/CIAO/DAnCE/Interfaces/ExecutionManagerDaemon.idl @@ -10,7 +10,7 @@ #include "DAnCE/Deployment/Deployment_ExecutionManager.idl" -module CIAO +module DAnCE { /** * @brief CIAO Execution Manager Program diff --git a/CIAO/DAnCE/Interfaces/ExecutionManager_stub_export.h b/CIAO/DAnCE/Interfaces/ExecutionManager_stub_export.h index 248498c5a0e..f32c91c5e6e 100644 --- a/CIAO/DAnCE/Interfaces/ExecutionManager_stub_export.h +++ b/CIAO/DAnCE/Interfaces/ExecutionManager_stub_export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (EXECUTIONMANAGER_STUB_HAS_DLL) -# define EXECUTIONMANAGER_STUB_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && EXECUTIONMANAGER_STUB_HAS_DLL */ - #if !defined (EXECUTIONMANAGER_STUB_HAS_DLL) # define EXECUTIONMANAGER_STUB_HAS_DLL 1 #endif /* ! EXECUTIONMANAGER_STUB_HAS_DLL */ diff --git a/CIAO/DAnCE/Interfaces/Interfaces.mpc b/CIAO/DAnCE/Interfaces/Interfaces.mpc index 753e11ad947..36316bed524 100644 --- a/CIAO/DAnCE/Interfaces/Interfaces.mpc +++ b/CIAO/DAnCE/Interfaces/Interfaces.mpc @@ -1,17 +1,22 @@ // -*- MPC -*- // $Id$ -project (ExecutionManager_stub): ciao_deployment_stub, messaging, ace_output { - - sharedname = ExecutionManager_stub - +project (DAnCE_ExecutionManager_idl): taoidldefaults, anytypecode { + custom_only = 1 idlflags += -Wb,stub_export_macro=ExecutionManager_stub_Export idlflags += -Wb,stub_export_include=ExecutionManager_stub_export.h + idlflags += -I$(CIAO_ROOT) + IDL_Files { + ExecutionManagerDaemon.idl + } +} +project (ExecutionManager_stub): dance_lib, messaging, dance_deployment_stub { + sharedname = DAnCE_ExecutionManager_stub + after += DAnCE_ExecutionManager_idl dynamicflags = EXECUTIONMANAGER_STUB_BUILD_DLL IDL_Files { - ExecutionManagerDaemon.idl } Source_Files { @@ -19,21 +24,42 @@ project (ExecutionManager_stub): ciao_deployment_stub, messaging, ace_output { } } -project (NodeManager_stub): ciao_deployment_stub, messaging, ace_output { - sharedname = NodeManager_stub - +project (DAnCE_NodeManager_idl): taoidldefaults, anytypecode { + custom_only = 1 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 + idlflags += -I$(CIAO_ROOT) + IDL_Files { + NodeManagerDaemon.idl + } +} + +project (DAnCE_NodeManager_stub): dance_lib, messaging, dance_deployment_stub { + after += DAnCE_NodeManager_idl + sharedname = DAnCE_NodeManager_stub dynamicflags = NODEMANAGER_STUB_BUILD_DLL IDL_Files { - NodeManagerDaemon.idl } Source_Files { NodeManagerDaemonC.cpp } } + +project (DAnCE_NodeManager_svnt): dance_lib, messaging, dance_deployment_svnt, dance_nodemanager_stub { + after += DAnCE_NodeManager_idl + sharedname = DAnCE_NodeManager_svnt + + dynamicflags = NODEMANAGER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + NodeManagerDaemonS.cpp + } +} diff --git a/CIAO/DAnCE/Interfaces/NodeManagerDaemon.idl b/CIAO/DAnCE/Interfaces/NodeManagerDaemon.idl index 2daf535031a..540ca31a3c6 100644 --- a/CIAO/DAnCE/Interfaces/NodeManagerDaemon.idl +++ b/CIAO/DAnCE/Interfaces/NodeManagerDaemon.idl @@ -9,7 +9,7 @@ #include "DAnCE/Deployment/Deployment_NodeManager.idl" #include "DAnCE/Deployment/Deployment_NodeApplicationManager.idl" -module CIAO +module DAnCE { /** * @brief CIAO daemon process control program. @@ -28,8 +28,8 @@ module CIAO /// 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); +// long set_priority (in string plan_id, +// in string cid, +// in ::Deployment::Sched_Params nm_params); }; }; diff --git a/CIAO/DAnCE/Interfaces/NodeManager_stub_export.h b/CIAO/DAnCE/Interfaces/NodeManager_stub_export.h index 0a9e320542c..3e708b0ab1f 100644 --- a/CIAO/DAnCE/Interfaces/NodeManager_stub_export.h +++ b/CIAO/DAnCE/Interfaces/NodeManager_stub_export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEMANAGER_STUB_HAS_DLL) -# define NODEMANAGER_STUB_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEMANAGER_STUB_HAS_DLL */ - #if !defined (NODEMANAGER_STUB_HAS_DLL) # define NODEMANAGER_STUB_HAS_DLL 1 #endif /* ! NODEMANAGER_STUB_HAS_DLL */ diff --git a/CIAO/DAnCE/Interfaces/NodeManager_svnt_export.h b/CIAO/DAnCE/Interfaces/NodeManager_svnt_export.h index ed72f96f810..199168ef44d 100644 --- a/CIAO/DAnCE/Interfaces/NodeManager_svnt_export.h +++ b/CIAO/DAnCE/Interfaces/NodeManager_svnt_export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEMANAGER_SVNT_HAS_DLL) -# define NODEMANAGER_SVNT_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEMANAGER_SVNT_HAS_DLL */ - #if !defined (NODEMANAGER_SVNT_HAS_DLL) # define NODEMANAGER_SVNT_HAS_DLL 1 #endif /* ! NODEMANAGER_SVNT_HAS_DLL */ diff --git a/CIAO/DAnCE/Interfaces/README b/CIAO/DAnCE/Interfaces/README index 0118689ad70..e2ca262a62f 100644 --- a/CIAO/DAnCE/Interfaces/README +++ b/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. +files into a separate directory. This directory serves for this purpose. diff --git a/CIAO/DAnCE/Logger/DAnCE_Logger_Export.h b/CIAO/DAnCE/Logger/DAnCE_Logger_Export.h new file mode 100644 index 00000000000..e8e7cb3c81a --- /dev/null +++ b/CIAO/DAnCE/Logger/DAnCE_Logger_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_Logger +// ------------------------------ +#ifndef DANCE_LOGGER_EXPORT_H +#define DANCE_LOGGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_LOGGER_HAS_DLL) +# define DANCE_LOGGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_LOGGER_HAS_DLL */ + +#if !defined (DANCE_LOGGER_HAS_DLL) +# define DANCE_LOGGER_HAS_DLL 1 +#endif /* ! DANCE_LOGGER_HAS_DLL */ + +#if defined (DANCE_LOGGER_HAS_DLL) && (DANCE_LOGGER_HAS_DLL == 1) +# if defined (DANCE_LOGGER_BUILD_DLL) +# define DAnCE_Logger_Export ACE_Proper_Export_Flag +# define DANCE_LOGGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_LOGGER_BUILD_DLL */ +# define DAnCE_Logger_Export ACE_Proper_Import_Flag +# define DANCE_LOGGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_LOGGER_BUILD_DLL */ +#else /* DANCE_LOGGER_HAS_DLL == 1 */ +# define DAnCE_Logger_Export +# define DANCE_LOGGER_SINGLETON_DECLARATION(T) +# define DANCE_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_LOGGER_HAS_DLL == 1 */ + +// Set DANCE_LOGGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_LOGGER_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_LOGGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_LOGGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_LOGGER_NTRACE */ + +#if (DANCE_LOGGER_NTRACE == 1) +# define DANCE_LOGGER_TRACE(X) +#else /* (DANCE_LOGGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_LOGGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_LOGGER_NTRACE == 1) */ + +#endif /* DANCE_LOGGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/Logger/File_Logger_Backend.cpp b/CIAO/DAnCE/Logger/File_Logger_Backend.cpp new file mode 100644 index 00000000000..2741afe830f --- /dev/null +++ b/CIAO/DAnCE/Logger/File_Logger_Backend.cpp @@ -0,0 +1,46 @@ + +#include "File_Logger_Backend.h" +#include "ace/OS.h" +#include "ace/Log_Record.h" +#include "ace/Log_Msg.h" +#include "Log_Macros.h" + +namespace DAnCE + { + + int + File_Logger_Backend::open (const ACE_TCHAR *) + { + DANCE_DEBUG ((LM_DEBUG, "[%M] Setting logger's output to file \"%s\"", this->filename_.c_str())); + this->fh_ = ACE_OS::fopen (this->filename_.c_str(), "w"); + if (0 == this->fh_) + { + ACE_CString s = "Failed to open log file \""; + s += this->filename_; + s += "\""; + throw LoggerError (s.c_str()); + } + return 0; + } + + int + File_Logger_Backend::close (void) + { + if (0 != this->fh_) + { + ACE_OS::fclose (this->fh_); + this->fh_ = 0; + } + return 0; + } + + ssize_t + File_Logger_Backend::log (ACE_Log_Record &log_record) + { + int res = log_record.print (0, ACE_Log_Msg::VERBOSE, this->fh_); + ACE_OS::fflush (this->fh_); + return res; + } + +} + diff --git a/CIAO/DAnCE/Logger/File_Logger_Backend.h b/CIAO/DAnCE/Logger/File_Logger_Backend.h new file mode 100644 index 00000000000..9e247792b08 --- /dev/null +++ b/CIAO/DAnCE/Logger/File_Logger_Backend.h @@ -0,0 +1,49 @@ +#ifndef FILE_LOGGER_BACKEND_H_ +#define FILE_LOGGER_BACKEND_H_ + +#include "ace/Log_Msg_Backend.h" +#include "DAnCE_Logger_Export.h" +#include "ace/SString.h" + +namespace DAnCE + { + + class DAnCE_Logger_Export LoggerError + { + public: + LoggerError (const char * msg) + : errmsg_ (msg) {}; + ACE_CString errmsg_; + }; + + class DAnCE_Logger_Export File_Logger_Backend : public ACE_Log_Msg_Backend + { + public: + File_Logger_Backend (const char * fname) + : fh_ (0), filename_ (fname) {} + + virtual ~File_Logger_Backend (void) + { + this->close(); + }; + + virtual int open (const ACE_TCHAR *logger_key); + + virtual int reset (void) + { + this->close(); + return this->open (0); + }; + + virtual int close (void); + + virtual ssize_t log (ACE_Log_Record &log_record); + + private: + FILE * fh_; + ACE_CString filename_; + }; + +} // DAnCE + +#endif /*FILE_LOGGER_BACKEND_H_*/ diff --git a/CIAO/DAnCE/Logger/Log_Macros.h b/CIAO/DAnCE/Logger/Log_Macros.h new file mode 100644 index 00000000000..a096c4bb3e8 --- /dev/null +++ b/CIAO/DAnCE/Logger/Log_Macros.h @@ -0,0 +1,90 @@ +/** + * @file Log_Macros.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Macros used for logging in DAnCE + */ + + +#ifndef DANCE_LOG_MACROS_H_ +#define DANCE_LOG_MACROS_H_ + +/* +// By default tracing is turned off. +#if !defined (DANCE_NTRACE) +# if !defined (ACE_NTRACE) +# define DANCE_NTRACE 1 +# else +# define DANCE_NTRACE ACE_NTRACE +# endif +#endif DANCE_NTRACE +*/ +#define DLINFO "(%P|%t) [%M] - %T - " + +#if (DANCE_NTRACE == 1) +# if !defined (ACE_NTRACE) +# define DANCE_TRACE(X) do {} while (0) +# define DANCE_ENABLE_TRACE(X) do {} while (0) +# define DANCE_DISABLE_TRACE(X) do {} while (0) +# else +# if (ACE_NTRACE == 0) +# error DANCE_TRACE cannot be disabled if ACE_TRACE is enabled +# else +# define DANCE_TRACE(X) do {} while (0) +# define DANCE_ENABLE_TRACE(X) do {} while (0) +# define DANCE_DISABLE_TRACE(X) do {} while (0) +# endif +# endif +#else +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_TRACE(X) ACE_TRACE_IMPL (X) +# define DANCE_ENABLE_TRACE() ACE_Trace::start_tracing () +# define DANCE_DISABLE_TRACE() ACE_Trace::stop_tracing () +# undef CLINFO // Make log messages indent with tracing. +# define CLINFO "%I(%P|%t) [%M] - %T - " +# include "ace/Trace.h" +#endif /* DANCE_NTRACE */ + +#if defined (DANCE_NLOGGING) +# define DANCE_ERROR(X) do {} while (0) +# define DANCE_DEBUG(X) do {} while (0) +#define DANCE_ERROR_RETURN(X, Y) return (Y) +#define DANCE_ERROR_BREAK(X) { break; } +#else +# if !defined (DANCE_ERROR) +# define DANCE_ERROR(X) \ + do { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \ + ace___->log X; \ + } while (0) +# endif +# if !defined (DANCE_DEBUG) +# define DANCE_DEBUG(X) \ + do { \ + 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 X; \ + } while (0) +# endif +# if !defined (DANCE_ERROR_RETURN) +# define DANCE_ERROR_RETURN(X, Y) \ + do { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, Y, __ace_error); \ + ace___->log X; \ + return Y; \ + } while (0) +# endif +# if !defined (DANCE_ERROR_BREAK) +# define DANCE_ERROR_BREAK(X) { DANCE_ERROR (X); break; } +# endif +#endif + + +#endif diff --git a/CIAO/DAnCE/Logger/Logger.mpc b/CIAO/DAnCE/Logger/Logger.mpc new file mode 100644 index 00000000000..c6e9436b9ac --- /dev/null +++ b/CIAO/DAnCE/Logger/Logger.mpc @@ -0,0 +1,19 @@ +// -*- MPC -*- +// $Id$ + +project(DAnCE_Logger): dance_lib, messaging { + after += ACE + sharedname = DAnCE_Logger + dynamicflags = DANCE_LOGGER_BUILD_DLL + + Source_Files { + File_Logger_Backend.cpp + Logger_Service.cpp + } + Header_Files { + } +} + + + + diff --git a/CIAO/DAnCE/Logger/Logger_Service.cpp b/CIAO/DAnCE/Logger/Logger_Service.cpp new file mode 100644 index 00000000000..2a332b9b5db --- /dev/null +++ b/CIAO/DAnCE/Logger/Logger_Service.cpp @@ -0,0 +1,160 @@ + +#include "Logger_Service.h" +#include "ace/Get_Opt.h" +#include "ace/Env_Value_T.h" +#include "ace/CORBA_macros.h" +#include "tao/SystemException.h" +#include "Log_Macros.h" + +namespace DAnCE + { + Logger_Service::Logger_Service (void) + : filename_ (""), + trace_ (false), + log_level_ (5) + { + } + + int + Logger_Service::init (int argc, ACE_TCHAR * argv[]) + { + // Get prospective values from the environment first, those given on + // command line can override + ACE_Env_Value<int> log ("DANCE_LOG_LEVEL", this->log_level_); + + this->log_level_ = log; + + ACE_Env_Value<int> trace ("DANCE_TRACE_ENABLE", this->trace_); + this->trace_ = trace; + + + ACE_Env_Value<const char *> filename ("DANCE_LOG_FILE", this->filename_.c_str ()); + this->filename_ = filename; + + this->parse_args (argc, argv); + + this->set_levels (); + + return 0; + } + + + void + Logger_Service::parse_args (int argc, char **argv) + { + const ACE_TCHAR *shortl = "-l"; + const ACE_TCHAR *longl = "--log-level"; + const ACE_TCHAR *tracel = "--trace"; + // const ACE_TCHAR *traces = "-t"; + const ACE_TCHAR *lfl = "--log-file"; + const ACE_TCHAR *lfs = "-f"; + + // We need to actually FIND the -l option, as the get_opt won't ignore + // the ORB options and such. + for (int i = 0; i < argc; ++i) + { + if (//ACE_OS::strncmp (argv[i], traces, 2) == 0 || + ACE_OS::strncmp (argv[i], tracel, 7) == 0) + { + this->trace_ = true; + continue; + } + + if (ACE_OS::strncmp (argv[i], shortl, 2) == 0 || + ACE_OS::strncmp (argv[i], longl, 11 ) == 0) + { + if ((i + 1) < argc && *argv[i + 1] != '-') + { + int level = ACE_OS::atoi (argv[i + 1]); + + if (level != 0) + this->log_level_ = level; + } + } + + if (ACE_OS::strncmp (argv[i], lfs, 2) == 0 || + ACE_OS::strncmp (argv[i], lfl, 10 ) == 0) + { + if ((i + 1) < argc && *argv[i + 1] != '-') + { + this->filename_ = argv[i+1]; + } + } + } + } + + void + Logger_Service::set_levels (void) + { + if (this->trace_) + { + DANCE_ENABLE_TRACE (); + this->log_level_ = 10; + } + else + { + DANCE_DISABLE_TRACE (); + } + + u_long new_mask = 0; + + if (this->log_level_ >= 9) + { + new_mask |= LM_TRACE; + } + if (this->log_level_ >= 8) + { + new_mask |= LM_DEBUG; + } + if (this->log_level_ >= 7) + { + new_mask |= LM_INFO; + } + if (this->log_level_ >= 6) + { + new_mask |= LM_NOTICE; + } + if (this->log_level_ >= 5) + { + new_mask |= LM_WARNING; + } + if (this->log_level_ >= 4) + { + new_mask |= LM_ERROR; + } + if (this->log_level_ >= 3) + { + new_mask |= LM_CRITICAL; + } + if (this->log_level_ >= 2) + { + new_mask |= LM_ALERT; + } + if (this->log_level_ >= 1) + { + new_mask |= LM_EMERGENCY; + } + + ACE_Log_Msg::instance()->priority_mask(new_mask, ACE_Log_Msg::PROCESS); + DANCE_DEBUG ( (LM_TRACE, DLINFO "Logging level is set to %i\n", this->log_level_)); + } + + ACE_Log_Msg_Backend * + Logger_Service::get_logger_backend (CORBA::ORB_ptr) + { + if (this->filename_ != "") + { + File_Logger_Backend * the_backend; + ACE_NEW_THROW_EX (the_backend, + File_Logger_Backend (this->filename_.c_str()), + CORBA::NO_MEMORY()); + return the_backend; + } + return 0; + } + +} // DAnCE + +using namespace DAnCE; +ACE_FACTORY_DEFINE (DAnCE_Logger, Logger_Service); + diff --git a/CIAO/DAnCE/Logger/Logger_Service.h b/CIAO/DAnCE/Logger/Logger_Service.h new file mode 100644 index 00000000000..2d5b1050627 --- /dev/null +++ b/CIAO/DAnCE/Logger/Logger_Service.h @@ -0,0 +1,30 @@ +#ifndef LOGGER_SERVICE_H_ +#define LOGGER_SERVICE_H_ + +#include "DAnCE_Logger_Export.h" +#include "Starter/DAnCELoggerFactory.h" +#include "File_Logger_Backend.h" + +namespace DAnCE + { + + class DAnCE_Logger_Export Logger_Service : public DAnCELoggerFactory + { + public: + Logger_Service (void); + virtual int init (int argc, ACE_TCHAR * argv[]); + virtual ACE_Log_Msg_Backend * get_logger_backend (CORBA::ORB_ptr orb); + private: + void parse_args (int argc, ACE_TCHAR **argv); + void set_levels (void); + + ACE_CString filename_; + bool trace_; + int log_level_; + }; + +} // DAnCE + +ACE_FACTORY_DECLARE (DAnCE_Logger, Logger_Service); + +#endif /*LOGGER_SERVICE_H_*/ diff --git a/CIAO/DAnCE/NodeApplication/CIAO_NodeApplication_export.h b/CIAO/DAnCE/NodeApplication/CIAO_NodeApplication_export.h deleted file mode 100644 index 3e4d638957e..00000000000 --- a/CIAO/DAnCE/NodeApplication/CIAO_NodeApplication_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl NODEAPPLICATION -// ------------------------------ -#ifndef NODEAPPLICATION_EXPORT_H -#define NODEAPPLICATION_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPLICATION_HAS_DLL) -# define NODEAPPLICATION_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEAPPLICATION_HAS_DLL */ - -#if !defined (NODEAPPLICATION_HAS_DLL) -# define NODEAPPLICATION_HAS_DLL 1 -#endif /* ! NODEAPPLICATION_HAS_DLL */ - -#if defined (NODEAPPLICATION_HAS_DLL) && (NODEAPPLICATION_HAS_DLL == 1) -# if defined (NODEAPPLICATION_BUILD_DLL) -# define NODEAPPLICATION_Export ACE_Proper_Export_Flag -# define NODEAPPLICATION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* NODEAPPLICATION_BUILD_DLL */ -# define NODEAPPLICATION_Export ACE_Proper_Import_Flag -# define NODEAPPLICATION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* NODEAPPLICATION_BUILD_DLL */ -#else /* NODEAPPLICATION_HAS_DLL == 1 */ -# define NODEAPPLICATION_Export -# define NODEAPPLICATION_SINGLETON_DECLARATION(T) -# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* NODEAPPLICATION_HAS_DLL == 1 */ - -// Set NODEAPPLICATION_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (NODEAPPLICATION_NTRACE) -# if (ACE_NTRACE == 1) -# define NODEAPPLICATION_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define NODEAPPLICATION_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !NODEAPPLICATION_NTRACE */ - -#if (NODEAPPLICATION_NTRACE == 1) -# define NODEAPPLICATION_TRACE(X) -#else /* (NODEAPPLICATION_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define NODEAPPLICATION_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (NODEAPPLICATION_NTRACE == 1) */ - -#endif /* NODEAPPLICATION_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.cpp b/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.cpp new file mode 100644 index 00000000000..a93cbeff4f1 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.cpp @@ -0,0 +1,89 @@ +// $Id$ + +#include "tao/DynamicInterface/Request.h" + +#include "ComponentAttributesSetter.h" +//#include "Cdmw_ccm_dance1_cif.stub.hpp" +#include "tao/DynamicInterface/DII_CORBA_methods.h" +#include "tao/DynamicInterface/Context.h" +#include "tao/AnyTypeCode/NVList.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "Deployment/Deployment_ApplicationC.h" + +//bool read_config_value( const ACE_CString & name, +// const Deployment::Properties & prop, +// CORBA::Any_out value) +// throw() +//{ +// ACE_CString cdmw_name = name; +// bool found = false; +// CORBA::ULong len = prop.length(); +// for (CORBA::ULong count = 0; count < len; ++count) +// { +// if ( cdmw_name.compare(prop[count].name.in()) == 0 ) +// { +// value = new CORBA::Any(prop[count].value); +// found = true; +// break; +// } +// } +// return found; +//} + + +ComponentAttributesSetter::ComponentAttributesSetter() +{ +} + +ComponentAttributesSetter::~ComponentAttributesSetter() +{ +} + +void +ComponentAttributesSetter::SetComponentAttributes (ACE_CString /*componentName*/, + ::CORBA::Object_ptr obj, + const Deployment::Properties& prop, + CORBA::ORB_ptr ) +{ + DANCE_TRACE ("ComponentAttributesSetter::SetComponentAttributes"); + + for (CORBA::ULong i = 0; i < prop.length(); i++) + { + ACE_CString name = prop[i].name.in(); + // Ignore configuration properties, since attributes can't have . in them, this seems like a good method. + if (name.find (".") != ACE_CString::npos) + { + continue; + } + DANCE_DEBUG ((LM_DEBUG, DLINFO + "ComponentAttributesSetter::SetComponentAttributes - " + "Populating attribute name %C\n", name.c_str())); + ACE_CString method = "_set_"; + method += prop[i].name.in(); + + ::CORBA::Request_var req; + + try + { + req = obj->_request (method.c_str ()); + req->add_in_arg ("x") = prop[i].value; + + req->invoke(); + } + catch (const CORBA::BAD_OPERATION &) + { + DANCE_ERROR ((LM_WARNING, DLINFO + "ComponentAttributesSetter::SetComponentAttributes - " + "Caught BAD_OPERATION while trying to set attribute %C\n", + name.c_str ())); + } + catch (const CORBA::Exception &e) + { + CORBA::release (req); + e._tao_print_exception ("ComponentAttributesSetter.cpp::SetComponentAttributes "); + throw ::Deployment::StartError(); + } + //Question - How exceptions will be processed, rised by invoked method + } +} diff --git a/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.h b/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.h new file mode 100644 index 00000000000..2a36da17cfd --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ComponentAttributesSetter.h @@ -0,0 +1,35 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ComponentAttributesSetter.h + * + * $Id$ + * + * @Brief Workaround for component attributes setting + * + * @author Erwin Gottlieb <eg@prismtech.com> + */ +//============================================================================= + +#ifndef COMPONENTATTRIBUTESSETTER_H_ +#define COMPONENTATTRIBUTESSETTER_H_ + +//#include "ComponentAttributesSetter_Export.h" +#include "NodeApplication_Export.h" +#include "Deployment/Deployment_BaseC.h" +#include "ccm/CCM_ObjectC.h" + +class NodeApplication_Export ComponentAttributesSetter + { + public: + ComponentAttributesSetter(); + ~ComponentAttributesSetter(); + + static void SetComponentAttributes (ACE_CString componentName, + CORBA::Object_ptr, + const Deployment::Properties& prop, + CORBA::ORB_ptr orb); + }; + +#endif /*COMPONENTATTRIBUTESSETTER_H_*/ diff --git a/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.cpp b/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.cpp new file mode 100644 index 00000000000..5492df95404 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.cpp @@ -0,0 +1,120 @@ +// $Id$ + +#include "ComponentInstallation_Impl.h" +#include "DAnCE/Logger/Log_Macros.h" + +using namespace DAnCE; + +ComponentInstallation_Impl::ComponentInstallation_Impl() +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::ComponentInstallation_Impl - started\n")); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::ComponentInstallation_Impl - finished\n")); +} + +ComponentInstallation_Impl::~ComponentInstallation_Impl() +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::~ComponentInstallation_Impl - started\n")); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::~ComponentInstallation_Impl - finished\n")); +} + +void +ComponentInstallation_Impl::install (const char * implUUID, const char * component_loc) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::install - started\n")); + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::install - implUUID %s, component_loc %s\n", implUUID, component_loc)); + if (0 != this->locations_.find (implUUID)) + { + ACE_CString location = component_loc; + this->locations_.bind (implUUID, location); + } + else + { + // I don't certaint that we should throw exception here + //throw ::Components::Deployment::InstallationFailure(); + } + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::install - finished\n")); +} + + +void +ComponentInstallation_Impl::replace (const char * , const char *) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::replace - started\n")); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::replace - finished\n")); +} + +void +ComponentInstallation_Impl::remove (const char *) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::remove - started\n")); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::remove - finished\n")); +} + +char * +ComponentInstallation_Impl::get_implementation (const char * implUUID) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_implementation - started\n")); + + ACE_CString s; + if (0 == this->locations_.find (implUUID, s)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_implementation - ComponentInstallation_Impl::get_implementation for UUID %s, location %s\n", implUUID, s.c_str())); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_implementation - finished\n")); + return CORBA::string_dup (s.c_str()); + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] ComponentInstallation_Impl::get_implementation - cannot find location for specified implementation UUID\n")); + throw ::Components::Deployment::UnknownImplId(); + return 0; + } +} + + +char * +ComponentInstallation_Impl::get_valuetypefactory_location ( + const char * implUUID, + const char * repid +) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_valuetypefactory_location - started\n")); + ACE_CString key = ComponentInstallation_Impl::valuefactory_key (implUUID, repid); + ACE_CString s; + if (0 == this->locations_.find (implUUID, s)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_valuetypefactory_location - UUID:\"%s\" repid:\"%s\" -> location:\"%s\"\n", implUUID, repid, s.c_str())); + return CORBA::string_dup (s.c_str()); + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] ComponentInstallation_Impl::get_valuetypefactory_location - cannot find location for specified implementation UUID and repid.\n")); + throw ::Components::Deployment::InstallationFailure(); + return 0; + } + DANCE_DEBUG ( (LM_DEBUG, "[%M] ComponentInstallation_Impl::get_valuetypefactory_location - finished\n")); + return 0; +} + + +void +ComponentInstallation_Impl::install_valuetypefactory_location ( + const char * implUUID, + const char * repid, + const char * loc +) +{ + ACE_CString key = ComponentInstallation_Impl::valuefactory_key (implUUID, repid); + if (0 != this->locations_.find (key)) + { + ACE_CString location = loc; + this->locations_.bind (implUUID, location); + } + else + { + // I don't certaint that we should throw exception here + //throw ::Components::Deployment::InstallationFailure(); + } +} + diff --git a/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.h b/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.h new file mode 100644 index 00000000000..3b3dc1a4246 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ComponentInstallation_Impl.h @@ -0,0 +1,76 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ComponentInstallation_Impl.h + * + * $Id$ + * + * @Brief Return location of component artifact + * + * @author Erwin Gottlieb <eg@prismtech.com> + */ +//============================================================================= + +#ifndef COMPONENTINSTALLATION_IMPL_H_ +#define COMPONENTINSTALLATION_IMPL_H_ + +#include "ace/Map_Manager.h" +#include "ccm/CCM_ComponentC.h" + +#include "Cdmw/CDMW_DeploymentS.h" +#include "tao/ORB.h" +#include "NodeApplication_Export.h" + +namespace DAnCE + { + + class NodeApplication_Export ComponentInstallation_Impl + : public virtual POA_CdmwDeployment::ComponentInstallation + { + public: + ComponentInstallation_Impl(); + + virtual ~ComponentInstallation_Impl(); + + virtual void install ( + const char * implUUID, + const char * component_loc + ); + + virtual void replace ( + const char * implUUID, + const char * component_loc + ); + + virtual void remove ( + const char * implUUID + ); + + virtual char * get_implementation ( + const char * implUUID + ); + + virtual char * get_valuetypefactory_location ( + const char * implUUID, + const char * repid + ); + + void install_valuetypefactory_location ( + const char * implUUID, + const char * repid, + const char * loc + ); + + private: + typedef ACE_Map_Manager< ACE_CString, ACE_CString, ACE_Null_Mutex > TLocations; + TLocations locations_; + + static ACE_CString valuefactory_key (const char* uuid, const char* repid) + { + return ACE_CString (repid) + "@" + uuid; + }; + }; + +}; +#endif /*COMPONENTINSTALLATION_IMPL_H_*/ diff --git a/CIAO/DAnCE/NodeApplication/Config_Manager.cpp b/CIAO/DAnCE/NodeApplication/Config_Manager.cpp deleted file mode 100644 index 4b313662cf5..00000000000 --- a/CIAO/DAnCE/NodeApplication/Config_Manager.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// $Id$ - -#include "Config_Manager.h" - -CIAO::Config_Manager::~Config_Manager (void) -{ -} - diff --git a/CIAO/DAnCE/NodeApplication/Config_Manager.h b/CIAO/DAnCE/NodeApplication/Config_Manager.h deleted file mode 100755 index 8872761d596..00000000000 --- a/CIAO/DAnCE/NodeApplication/Config_Manager.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Config_Manager.h - * - * $Id$ - * - */ -//============================================================================= - - -#ifndef CIAO_CONFIG_MANAGER_H -#define CIAO_CONFIG_MANAGER_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" -#include "Config_Manager_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" - -namespace CIAO -{ - /** - */ - class Config_Manager_Export Config_Manager - { - public: - virtual ~Config_Manager (void); - - virtual int pre_orb_initialize (void) = 0; - - virtual int post_orb_initialize (CORBA::ORB_ptr o) = 0; - - virtual void init_resources (const CIAO::DAnCE::ServerResource &info) = 0; - - virtual void init (CORBA::ORB_ptr orb) = 0; - - virtual CORBA::PolicyList *find_policies_by_name (const char *name)= 0; - - virtual bool policy_exists (const char *name) = 0; - }; -} - -#include /**/ "ace/post.h" -#endif /* CIAO_CONFIG_MANAGER_H */ - diff --git a/CIAO/DAnCE/NodeApplication/Config_Manager_export.h b/CIAO/DAnCE/NodeApplication/Config_Manager_export.h deleted file mode 100644 index 57d17637dde..00000000000 --- a/CIAO/DAnCE/NodeApplication/Config_Manager_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl Config_Manager -// ------------------------------ -#ifndef CONFIG_MANAGER_EXPORT_H -#define CONFIG_MANAGER_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CONFIG_MANAGER_HAS_DLL) -# define CONFIG_MANAGER_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CONFIG_MANAGER_HAS_DLL */ - -#if !defined (CONFIG_MANAGER_HAS_DLL) -# define CONFIG_MANAGER_HAS_DLL 1 -#endif /* ! CONFIG_MANAGER_HAS_DLL */ - -#if defined (CONFIG_MANAGER_HAS_DLL) && (CONFIG_MANAGER_HAS_DLL == 1) -# if defined (CONFIG_MANAGER_BUILD_DLL) -# define Config_Manager_Export ACE_Proper_Export_Flag -# define CONFIG_MANAGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CONFIG_MANAGER_BUILD_DLL */ -# define Config_Manager_Export ACE_Proper_Import_Flag -# define CONFIG_MANAGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CONFIG_MANAGER_BUILD_DLL */ -#else /* CONFIG_MANAGER_HAS_DLL == 1 */ -# define Config_Manager_Export -# define CONFIG_MANAGER_SINGLETON_DECLARATION(T) -# define CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CONFIG_MANAGER_HAS_DLL == 1 */ - -// Set CONFIG_MANAGER_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CONFIG_MANAGER_NTRACE) -# if (ACE_NTRACE == 1) -# define CONFIG_MANAGER_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CONFIG_MANAGER_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CONFIG_MANAGER_NTRACE */ - -#if (CONFIG_MANAGER_NTRACE == 1) -# define CONFIG_MANAGER_TRACE(X) -#else /* (CONFIG_MANAGER_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CONFIG_MANAGER_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CONFIG_MANAGER_NTRACE == 1) */ - -#endif /* CONFIG_MANAGER_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp b/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp deleted file mode 100644 index cebbf738e6c..00000000000 --- a/CIAO/DAnCE/NodeApplication/Configurator_Factory.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// $Id$ - -#include "Configurator_Factory.h" -#include "NodeApp_Configurator.h" -#include "ciao/CIAO_common.h" -#include "ace/Arg_Shifter.h" - -#if !defined (__ACE_INLINE__) -# include "Configurator_Factory.inl" -#endif /* __ACE_INLINE__ */ - -CIAO::NodeApplication_Options::NodeApplication_Options () : - use_callback_ (true), - rt_support_ (false) -{ -} - -int -CIAO::NodeApplication_Options::parse_args (int &argc, char *argv[]) -{ - ACE_Arg_Shifter shifter (argc, argv); - - while (shifter.is_anything_left ()) - { - const char *parm = 0; - - if (shifter.cur_arg_strncasecmp ("-n") == 0) // Use callback. - { - this->use_callback_ = false; - shifter.consume_arg (); - } - else if (shifter.cur_arg_strncasecmp ("-r") == 0) - { - this->rt_support_ = true; - 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 (shifter.cur_arg_strncasecmp ("-o") == 0) - { - // This double checking is necessary to avoid the Arg_Shifter from - // mistaking any -ORBxxx flag as -o flag. - if ((parm = shifter.get_the_parameter ("-o")) !=0) - { - this->ior_output_filename_ = parm; - } - shifter.consume_arg (); - } - else if ((parm = shifter.get_the_parameter ("-k")) !=0) - { - this->callback_ior_ = parm; - shifter.consume_arg (); - } - else if (shifter.cur_arg_strncasecmp ("-h") == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s\n" - "-n Do not use Callback (for testing)\n" - "-o <ior_output_file>\n" - "-k <NodeApplicationManager_callback_ior>\n" - "-r Request RT support\n" - "-h Usage help" - "\n", - argv [0]), - -1); - shifter.consume_arg (); - } - else - { - shifter.ignore_arg (); - } - } - - if (this->use_callback_ && 0 == this->callback_ior_.length ()) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Callback IOR to NodeApplicationManager " - "is required.\n"), - -1); - } - - return 0; -} - -CIAO::NodeApp_Configurator * -CIAO::NodeApplication_Options::create_nodeapp_configurator (void) -{ - CIAO::NodeApp_Configurator* ptr = 0; - ACE_NEW_THROW_EX (ptr, - CIAO::NodeApp_Configurator (), - CORBA::NO_MEMORY (TAO::VMCID, - CORBA::COMPLETED_NO)); - if (this->rt_support_) - { - ptr->set_rt_support (); - } - - return ptr; - /* - typedef CIAO::NodeApp_Configurator * (*intelligent_designer)(void); - CIAO::NodeApp_Configurator* ptr = 0; - - if (this->rt_support_) - { - int const retval = - this->config_dll_.open ( - ACE_DLL_PREFIX ACE_TEXT ("CIAO_RTNA_Configurator"), - ACE_DEFAULT_SHLIB_MODE, - 0); - - if (0 != retval) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "dll.open"), - 0); - } - - - // Cast the void* to non-pointer type first - it's not legal to - // cast a pointer-to-object directly to a pointer-to-function. - void *void_ptr = - this->config_dll_.symbol (ACE_TEXT ("create_nodeapp_configurator")); - ptrdiff_t tmp = reinterpret_cast<ptrdiff_t> (void_ptr); - - // "id" is for intelligent-designer. - intelligent_designer config_id = - reinterpret_cast<intelligent_designer> (tmp); - - if (0 == config_id) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p", - "dll.symbol"), - 0); - } - - ptr = config_id (); - - if (0 == ptr) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Error creating RTNodeApp_Configurator\n"), - 0); - } - } - else - { - ACE_NEW_RETURN (ptr, - CIAO::NoOp_Configurator (), - 0); - } - - return ptr; - */ -} - diff --git a/CIAO/DAnCE/NodeApplication/Configurator_Factory.h b/CIAO/DAnCE/NodeApplication/Configurator_Factory.h deleted file mode 100644 index be9f7bc300b..00000000000 --- a/CIAO/DAnCE/NodeApplication/Configurator_Factory.h +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Configurator_Factory.h - * - * $Id$ - * - * Configurator Factory contains the factory method for creating concret - * NodeApp_Configurator object. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONFIGURATOR_FACTORY_H -#define CIAO_CONFIGURATOR_FACTORY_H -#include /**/ "ace/pre.h" - -#include "CIAO_NodeApplication_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" -//#include "ace/DLL.h" - -namespace CIAO -{ - //forward declaration - class NodeApp_Configurator; - - /** - * @class NodeApplication_Options - * - * @brief An class for managing and extracting command line options - * for NodeApplication. - * - * @note We currently support loading one single external module for - * RT support. Perhaps how this should really be done is to allow - * the NodeApplication_Core to load up a list of external modules - * (in DLLs or otherwise) and call the corresponding init methods in - * sequence. This way, we open up the component server so system - * developers can plug in their own system configuration needs into - * the whole system. - */ - class NODEAPPLICATION_Export NodeApplication_Options - { - public: - // default ctor. - NodeApplication_Options (); - - /// extracting commandline arguments - int parse_args (int &argc, char *argv[]); - - NodeApp_Configurator *create_nodeapp_configurator (void); - - bool use_callback (); - - bool rt_support (); - - int write_ior_file (); - - const char *ior_output_filename (); - - const char *callback_ior (); - - private: - /// The name of the file to write stringified IOR to. - ACE_CString ior_output_filename_; - - /// Stringified IOR of a CIAO's callback object. - ACE_CString callback_ior_; - - /// CIAO ComponentServer uses the callback object to pass it's - /// own object reference back to NodeApplicationManager. - bool use_callback_; - - /// If we need to support RT-CORBA. Currently, this is - /// mandatory, but we can probably allow some sort of - /// "best-effort" RT support. I.e., if the platform/environment - /// doesn't support RT, then we will still deploy the NodeApp but - /// ignore the RT spec. Perhaps something in the future. - bool rt_support_; - - // For managing dynamically loaded configurator library - //ACE_DLL config_dll_; - }; - -} - -#if defined (__ACE_INLINE__) -# include "Configurator_Factory.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_CONFIGURATOR_FACTORY_H */ - diff --git a/CIAO/DAnCE/NodeApplication/Configurator_Factory.inl b/CIAO/DAnCE/NodeApplication/Configurator_Factory.inl deleted file mode 100644 index bde906ae6b5..00000000000 --- a/CIAO/DAnCE/NodeApplication/Configurator_Factory.inl +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE bool -CIAO::NodeApplication_Options::use_callback () -{ - return this->use_callback_; -} - -ACE_INLINE bool -CIAO::NodeApplication_Options::rt_support () -{ - return this->rt_support_; -} - -ACE_INLINE int -CIAO::NodeApplication_Options::write_ior_file () -{ - return (this->ior_output_filename_.length () != 0); -} - -ACE_INLINE const char * -CIAO::NodeApplication_Options::ior_output_filename () -{ - return this->ior_output_filename_.c_str (); -} - -ACE_INLINE const char * -CIAO::NodeApplication_Options::callback_ior () -{ - return this->callback_ior_.c_str (); -} - diff --git a/CIAO/DAnCE/NodeApplication/Container_Impl.cpp b/CIAO/DAnCE/NodeApplication/Container_Impl.cpp deleted file mode 100644 index 8b28f60bc76..00000000000 --- a/CIAO/DAnCE/NodeApplication/Container_Impl.cpp +++ /dev/null @@ -1,617 +0,0 @@ -// $Id$ - -#include "Container_Impl.h" -#include "ciao/CCM_StandardConfiguratorC.h" -#include "ciao/CCM_KeylessCCMHomeC.h" - -#include "orbsvcs/CosNamingC.h" - -#if !defined (__ACE_INLINE__) -# include "Container_Impl.inl" -#endif /* __ACE_INLINE__ */ - -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 ()); -} - - /////////////////////////////////////////////////////////////// - -CORBA::Long -CIAO::Container_Impl::init (const CORBA::PolicyList *policies) -{ - CIAO_TRACE ("CIAO::Container_Impl::init"); - // @@ Initialize container and create the internal container - // implementation that actually interacts with installed - // homes/components. - - // @@ We will need a container factory here later on when we support - // more kinds of container implementations. - - // @@Jai, what is the condition to create an upgradeable container? - // Where is it getting created and how? Need to address that. - - if (this->static_entrypts_maps_ == 0) - { - this->container_.reset (new CIAO::Session_Container (this->orb_.in (), this)); - } - else - { - this->container_.reset (new CIAO::Session_Container (this->orb_.in (), - this, - 1, - this->static_entrypts_maps_)); - } - - return this->container_->init (0, policies); -} - - -Deployment::ComponentInfos * -CIAO::Container_Impl::install ( - const ::Deployment::ContainerImplementationInfo & container_impl_info - ) -{ - CIAO_TRACE ("CIAO::Container_Impl::install"); - Deployment::ComponentInfos_var retv; - try - { - ACE_NEW_THROW_EX (retv, - Deployment::ComponentInfos, - CORBA::NO_MEMORY ()); - - // Get the ComponentImplementationInfos from the - // ContainerImplementationInfo - // to avoid too long syntax representation - const ::Deployment::ComponentImplementationInfos impl_infos = - container_impl_info.impl_infos; - - CORBA::ULong const len = impl_infos.length (); - retv->length (len); - REC_POL_MAP rec_pol_map; - - for (CORBA::ULong i = 0; i < len; ++i) - { - const CORBA::ULong cplen = impl_infos[i].component_config.length (); - for (CORBA::ULong cp_len = 0; cp_len < cplen; ++cp_len) - { - if (impl_infos[i].component_config[cp_len]. - value.type ()->kind () == CORBA::tk_string) - { - const char* policy_set_id; - ACE_CString receptacle_name; - ACE_CString instance_name; - impl_infos[i].component_config[cp_len].value >>= - policy_set_id; - bool result = this->configurator_.policy_exists ( - policy_set_id); - if (result == true) - { - receptacle_name = impl_infos[i].component_config[cp_len]. - name.in (); - instance_name = impl_infos[i]. - component_instance_name.in (); - receptacle_name += "_"; - receptacle_name += instance_name; - CORBA::PolicyList_var policies = - this->configurator_.find_policies_by_name ( - policy_set_id); - CORBA::PolicyList temp_policies (0); - if (policies != 0) - { - temp_policies = *policies; - } - rec_pol_map.bind (receptacle_name, temp_policies); - } - } - } - - // Install home - Components::CCMHome_var home = - this->install_home (impl_infos[i]); - - Components::KeylessCCMHome_var kh = - Components::KeylessCCMHome::_narrow (home.in ()); - - if (CORBA::is_nil (kh.in ())) - throw Deployment::InstallationFailure (); - - // Create component from home - Components::CCMObject_var comp = kh->create_component (); - - if (CORBA::is_nil (comp.in ())) - throw Deployment::InstallationFailure (); - - if (this->component_map_.bind - (impl_infos[i].component_instance_name.in (), - Components::CCMObject::_duplicate (comp.in ()))) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::install -" - "error in binding component " - "instance name [%s] into the component map \n", - impl_infos[i].component_instance_name.in ())); - throw Deployment::InstallationFailure (); - } - - // Set the return value. - (*retv)[i].component_instance_name - = impl_infos[i].component_instance_name.in (); - - (*retv)[i].component_ref = - Components::CCMObject::_duplicate (comp.in ()); - - // Deal with Component instance related Properties. - // Now I am only concerning about the COMPOENTIOR and attribute - // configuration initialization. - - // I need to map Properties to Components::ConfigValues - ::Components::ConfigValues comp_attributes; - comp_attributes.length (0); - - const CORBA::ULong clen = impl_infos[i].component_config.length (); - for (CORBA::ULong prop_len = 0; prop_len < clen; ++prop_len) - { - // Set up the ComponentIOR attribute - if (ACE_OS::strcmp - (impl_infos[i].component_config[prop_len].name.in (), - "ComponentIOR") == 0) - { - const char * path; - impl_infos[i].component_config[prop_len].value >>= path; - - CORBA::String_var ior = - this->orb_->object_to_string (comp.in ()); - - if (CIAO::Utility::write_IOR (path, ior.in ()) != 0) - { - if (CIAO::debug_level () > 1) - ACE_DEBUG ((LM_DEBUG, "Failed to write the IOR.\n")); - - throw CORBA::INTERNAL (); - } - } - - // Set up the naming service attribute - if (ACE_OS::strcmp - (impl_infos[i].component_config[prop_len].name.in (), - "RegisterNaming") == 0) - { - const char * naming_context; - impl_infos[i]. - component_config[prop_len].value >>= naming_context; - - // Register the component with the naming service - ACE_DEBUG ((LM_DEBUG, - "Register component with naming service.\n")); - bool result = - register_with_ns ( - naming_context, - this->orb_.in (), - Components::CCMObject::_duplicate (comp.in ()) - ); - - if (!result) - { - ACE_DEBUG ((LM_DEBUG, - "Failed to register with naming service.\n")); - } - else - { - if (this->naming_map_.bind - (impl_infos[i].component_instance_name.in (), - ACE_CString (naming_context))) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::install -" - "error in binding component " - "instance name [%s] into the naming map \n", - impl_infos[i].component_instance_name.in ())); - throw Deployment::InstallationFailure (); - } - } - - - } - - // Initialize attributes through StandardConfigurator interface - // @@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 (); - comp_attributes.length (cur_len + 1); - - Components::ConfigValue *item = new OBV_Components::ConfigValue (); - item->name (impl_infos[i].component_config[prop_len].name.in ()); - CORBA::Any tmp = impl_infos[i].component_config[prop_len].value; - item->value (tmp); - - comp_attributes[cur_len] = item; - } - - if (comp_attributes.length () != 0) - { - //std_configurator.set_configuration - ::Components::StandardConfigurator_var std_configurator = - comp->get_standard_configurator (); - - std_configurator->set_configuration (comp_attributes); - } - } - this->container_->set_receptacle_policy_map (rec_pol_map); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Container_Impl::install\t\n"); - throw; - } - - return retv._retn (); -} - -::Deployment::Properties * -CIAO::Container_Impl::properties () -{ - CIAO_TRACE ("CIAO::Container_Impl::properties"); - ::Deployment::Properties *retval = 0; - - ACE_NEW_THROW_EX (retval, - ::Deployment::Properties, - CORBA::NO_MEMORY ()); - - *retval = this->properties_; - - return retval; -} - -::Deployment::NodeApplication_ptr -CIAO::Container_Impl::get_node_application () -{ - CIAO_TRACE ("CIAO::Container_Impl::get_node_application"); - return ::Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); -} - -::Components::CCMHome_ptr -CIAO::Container_Impl::install_home ( - const ::Deployment::ComponentImplementationInfo & impl_info) -{ - CIAO_TRACE ("CIAO::Container_Impl::install_home"); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::install_home -" - "installing home for component " - "instance [%s] \n", - impl_info.component_instance_name.in ())); - } - - Components::CCMHome_var newhome = - this->container_->ciao_install_home (impl_info.executor_dll.in (), - impl_info.executor_entrypt.in (), - impl_info.servant_dll.in (), - impl_info.servant_entrypt.in (), - impl_info.component_instance_name.in ()); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::install_home -" - "success in installing home for component " - "instance [%s] \n", - impl_info.component_instance_name.in ())); - } - - // We don't have to do _narrow since the generated code makes sure of - // the object type for us - // Bind the home in the map. - if (this->home_map_.bind (impl_info.component_instance_name.in (), - Components::CCMHome::_duplicate (newhome.in ()))) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::install_home -" - "error in binding home for component " - "instance [%s] \n", - impl_info.component_instance_name.in ())); - throw Deployment::InstallationFailure (); - } - - //Note: If the return value will be discarded, it must be kept in a var or - // release () will have to be called explicitly. - return newhome._retn (); -} - - -void -CIAO::Container_Impl::remove_home (const char * comp_ins_name) -{ - CIAO_TRACE ("CIAO::Container_Impl::remove_home"); - - Components::CCMHome_ptr home; - ACE_CString str (comp_ins_name); - - if (this->home_map_.find (str, home) != 0) - throw CORBA::BAD_PARAM (); - - // @@TODO We should remove all components created by this home as well. - // This is not implemented yet. - - this->container_->ciao_uninstall_home (home); - - // If the previous calls failed, what should we do here?? - CORBA::release (home); - - // @@ Still need to remove the home if the previous operation fails? - if (this->home_map_.unbind (str) == -1) - throw ::Components::RemoveFailure (); -} - -// Remove all homes and components -void -CIAO::Container_Impl::remove () -{ - CIAO_TRACE ("CIAO::Container_Impl::remove"); - - // Remove all components first. - this->remove_components (); - - // Even if above operation failed we should still remove homes. - const Home_Iterator end = this->home_map_.end (); - for (Home_Iterator iter (this->home_map_.begin ()); - iter != end; - ++iter) - { - this->container_->ciao_uninstall_home ( (*iter).int_id_); - - CORBA::release ( (*iter).int_id_); - } - - this->home_map_.unbind_all (); - - if (CIAO::debug_level () > 3) - ACE_DEBUG ((LM_DEBUG, - "Removed all homes and components from this container!\n")); -} - -//////////////////////////////////////////////////////////////////////// -// Internal helper functions. -//////////////////////////////////////////////////////////////////////// - -void -CIAO::Container_Impl::remove_components () -{ - 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 (); - for (Component_Iterator iter (this->component_map_.begin ()); - iter != end; - ++iter) - { - // Find the component home first, then call the remove_component - // on the home. - Components::CCMHome_ptr home; - if (this->home_map_.find ( (*iter).ext_id_, home) != 0) - throw CORBA::BAD_PARAM (); - - // This will call ccm_passivate on the component executor. - home->remove_component (((*iter).int_id_).in ()); - - //CORBA::release (((*iter).int_id_).in ()); - } - - this->component_map_.unbind_all (); - // To this point the servant should have been destroyed. However, - // if someone is still making calls on the servant, terrible thing - // will happen. -} - - -// Below method is not used actually. -void -CIAO::Container_Impl::remove_component (const char * comp_ins_name) -{ - CIAO_TRACE ("CIAO::Container_Impl::remove_component"); - - Components::CCMObject_var comp; - Components::CCMHome_ptr home; - - ACE_CString naming_context; - - 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. - * - * ccm_remove will be called when the poa destroys the servant. - */ - - if (this->component_map_.find (str, comp) != 0) - throw CORBA::BAD_PARAM (); - - if (this->home_map_.find (str, home) != 0) - throw CORBA::BAD_PARAM (); - - // This will call ccm_passivate on the component executor. - home->remove_component (comp.in ()); - - // If the previous calls failed, what should we do here?? - - // @@ Still need to remove the home if the previous operation fails? - if (this->component_map_.unbind (str) == -1) - throw ::Components::RemoveFailure (); - - if (this->naming_map_.find (str, naming_context) == 0) - { - - bool const result = - unregister_with_ns ( - naming_context.c_str (), - this->orb_.in () - ); - - if (!result) - { - ACE_DEBUG ((LM_DEBUG, - "Failed to unregister with naming service.\n")); - } - else - { - if (this->naming_map_.unbind (str) == -1) - throw ::Components::RemoveFailure (); - } - } -} - -bool -CIAO::Container_Impl::register_with_ns (const char * s, - CORBA::ORB_ptr orb, - Components::CCMObject_ptr obj) -{ - CIAO_TRACE ("CIAO::Container_Impl::register_with_ns"); - - try - { - // Obtain the naming service - CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService"); - - if (CORBA::is_nil (naming_obj.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "DAnCE: (%P|%t) Unable to get the Naming Service.\n"), - false); - - CosNaming::NamingContextExt_var root = - CosNaming::NamingContextExt::_narrow (naming_obj.in ()); - - CosNaming::Name name (0); - name.length (0); - - // Get the multicomponent naming context from the <naming_context>. - // The convention of this <naming_context> 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 = 0; - token = ACE_OS::strtok (naming_string, seps); - - for (CORBA::ULong i = 0; token != 0; ++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 ( 0, 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; - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::register_with_ns -" - "NodeApplication: failed to register " - "with naming service."); - return false; - } - return true; -} - -bool -CIAO::Container_Impl::unregister_with_ns (const char * obj_name, - CORBA::ORB_ptr orb) -{ - CIAO_TRACE ("CIAO::Container_Impl::unregister_with_ns"); - - try - { - // Obtain the naming service - CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService"); - - if (CORBA::is_nil (naming_obj.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to get the Naming Service.\n"), - false); - - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in ()); - - CosNaming::Name name (0); - name.length (0); - - // Get the multicomponent naming context from the <naming_context>. - // The convention of this <naming_context> input string is that - // different naming context is separated by character '/', such as - // "create a naming context A/B/C/D". - ACE_CString tmp (obj_name); - char * naming_string = tmp.rep (); - char seps[] = "/:"; - - char *token, *lastToken = 0; - token = ACE_OS::strtok (naming_string, seps); - - for (CORBA::ULong i = 0; token != 0; ++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 ( 0, seps ); - } - - // Unregister with the Name Server - ACE_DEBUG ((LM_DEBUG, - "Unregister component with the name server : %s!\n", - obj_name)); - naming_context->unbind (name); - - return true; - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO (%P|%t) Container_Impl.cpp -" - "CIAO::Container_Impl::unregister_with_ns -" - "NodeApplication: failed to unregister " - "with naming service."); - return false; - } - return true; -} diff --git a/CIAO/DAnCE/NodeApplication/Container_Impl.h b/CIAO/DAnCE/NodeApplication/Container_Impl.h deleted file mode 100644 index 96ec5eb9e6c..00000000000 --- a/CIAO/DAnCE/NodeApplication/Container_Impl.h +++ /dev/null @@ -1,191 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Container_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::Deployment::Container interface. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Gan Deng <gan.deng@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTAINER_IMPL_H -#define CIAO_CONTAINER_IMPL_H -#include /**/ "ace/pre.h" - -#include "CIAO_NodeApplication_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/Deployment_ContainerS.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "DAnCE/Deployment//DeploymentC.h" -#include "ace/SString.h" -#include "ace/Auto_Ptr.h" -#include "ciao/Server_init.h" // write_IOR function & NameUtility -#include "ciao/CIAO_common.h" // CIAO::debug_level -#include "ciao/Session_Container.h" -#include "NodeApp_Configurator.h" - -namespace CIAO -{ - /** - * @class Container_Impl - * - * @brief Servant implementation for the interface Deployment::Container - * - * This class implements the Deployment::Container - * interface which is not defined by the CCM DnC specification. - * As the interface implies, this is actually part of the deployment - * interface and is used to manage the lifecycle of the installed - * components and homes. - */ - class NODEAPPLICATION_Export Container_Impl - : public virtual POA_Deployment::Container - { - public: - /// Constructor - Container_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - ::Deployment::NodeApplication_ptr server, - NodeApp_Configurator &c, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); - - /// Destructor - virtual ~Container_Impl (void); - - /*-------------------------------------------------------------*/ - /*-------------------- IDL operations (idl) ------------------*/ - - /// Initialize the container. - virtual CORBA::Long init (const CORBA::PolicyList *policies); - - /// Install all homes and components - Deployment::ComponentInfos * - install (const ::Deployment::ContainerImplementationInfo & container_impl_info); - - /// Remove all homes and components - virtual void remove (); - - /// Deployment::Container interface defined attributes/operations. - virtual ::Deployment::Properties *properties (); - - virtual ::Deployment::NodeApplication_ptr get_node_application (); - - /*-------------------------------------------------------------*/ - /*------------------- C++ help methods (c++) -----------------*/ - - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); - - // Install the home of this particular component - virtual ::Components::CCMHome_ptr - install_home (const ::Deployment::ComponentImplementationInfo & impl_info); - - /** - * @@Note: I don't know how to remove a home right now. - * I assume that user will only call remove instead. - * This is true at least for DnC run time. - * - * Right now, in this implementation I assumpe that there will be - * same number of homes as the components even if the components - * are of the same type. I don't think that we have the modeling - * side support of this either. So bear me if you think I avoid - * the real thinking for easiness. - */ - // Remove the home of this particular component - virtual void remove_home (const char * comp_ins_name); - - bool - register_with_ns (const char * obj_name, - CORBA::ORB_ptr orb, - Components::CCMObject_ptr obj); - - bool - unregister_with_ns (const char * obj_name, CORBA::ORB_ptr orb); - - // ------------------- CIAO Internal Operations ------------------------ - // These below two are helper methods to clean up components - // should only be called when we are sure that there is no - // active connection on this component. - virtual void remove_components (); - - virtual void remove_component (const char * comp_ins_name); - - /// Set the cached object reference. - void set_objref (Deployment::Container_ptr o); - - /// Get the cached object reference. This operation will invoke - /// _this if there's no cached reference available. Notice that - /// this method does *NOT* increase the reference count of the - /// cached reference. - Deployment::Container_ptr get_objref (); - -protected: - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Internal container implementation. - // @@ Gan/Jai, heard of auto_ptr <>? - //CIAO::Container *container_; - ACE_Auto_Ptr<CIAO::Container> container_; - - /// Cached ConfigValues. - Deployment::Properties properties_; - - /// Cached Container reference (of ourselves.) - Deployment::Container_var objref_; - - /// Cached NodeApplication. - Deployment::NodeApplication_var nodeapp_; - - NodeApp_Configurator &configurator_; - - /// To store all created CCMHome object - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Components::CCMHome_ptr, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMHome_Map; - typedef CCMHome_Map::iterator Home_Iterator; - CCMHome_Map home_map_; - - /// To store all created Component object. - // @@Gan, see how this caching is duplicated.. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Components::CCMObject_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMComponent_Map; - typedef CCMComponent_Map::iterator Component_Iterator; - CCMComponent_Map component_map_; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ACE_CString, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMNaming_Map; - CCMNaming_Map naming_map_; - - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - }; -} - -#if defined (__ACE_INLINE__) -# include "Container_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_CONTAINER_IMPL_H */ diff --git a/CIAO/DAnCE/NodeApplication/Container_Impl.inl b/CIAO/DAnCE/NodeApplication/Container_Impl.inl deleted file mode 100644 index 2bb25421ff0..00000000000 --- a/CIAO/DAnCE/NodeApplication/Container_Impl.inl +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::Container_Impl::Container_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - ::Deployment::NodeApplication_ptr server, - NodeApp_Configurator &c, - const Static_Config_EntryPoints_Maps* static_entrypts_maps) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - nodeapp_ (::Deployment::NodeApplication::_duplicate (server)), - configurator_ (c), - static_entrypts_maps_ (static_entrypts_maps) -{ -} - -ACE_INLINE void -CIAO::Container_Impl::set_objref (Deployment::Container_ptr o) -{ - CIAO_TRACE("CIAO::Container_Imp::set_objref"); - - if (!CORBA::is_nil (this->objref_.in ())) - throw CORBA::BAD_INV_ORDER (); - - this->objref_ = Deployment::Container::_duplicate (o); -} - -ACE_INLINE ::Deployment::Container_ptr -CIAO::Container_Impl::get_objref () -{ - CIAO_TRACE("CIAO::Container_Imp::get_objref"); - - if (CORBA::is_nil (this->objref_.in ())) - { - this->objref_ = this->_this (); - } - return Deployment::Container::_duplicate (this->objref_.in ()); -} diff --git a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.cpp b/CIAO/DAnCE/NodeApplication/NAConfig_Manager.cpp deleted file mode 100755 index e36c8767632..00000000000 --- a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// $Id$ - -#include "NAConfig_Manager.h" -#include "ciao/CIAO_common.h" -#include "ace/SString.h" -#include "tao/SystemException.h" -#include "tao/DiffServPolicy/DiffServPolicy.h" -#include "tao/DiffServPolicy/Client_Network_Priority_Policy.h" -#include "tao/DiffServPolicy/Server_Network_Priority_Policy.h" - -void -CIAO::NAResource_Config_Manager::init (CORBA::ORB_ptr orb) -{ - this->orb_ = CORBA::ORB::_duplicate (orb); -} - -int -CIAO::NAResource_Config_Manager::pre_orb_initialize (void) -{ - return 0; -} - -int -CIAO::NAResource_Config_Manager::post_orb_initialize (CORBA::ORB_ptr) -{ - return 0; -} - -void -CIAO::NAResource_Config_Manager::init_resources -(const CIAO::DAnCE::ServerResource &server_resource) -{ - ACE_DEBUG ((LM_DEBUG,"NAResource_Config_Manager::init_resources\n")); - - if (CORBA::is_nil (this->orb_.in())) - { - ACE_ERROR ((LM_ERROR, - "NAResource_Config_Manager has not been properly initialized\n")); - throw CORBA::INTERNAL (); - } - - const CIAO::DAnCE::PolicySets &sets = server_resource.orb_config.policy_set; - for (CORBA::ULong i = 0; i < sets.length (); ++i) - { - CORBA::ULong np = sets[i].policies.length (); - if (np == 0) - continue; - - CORBA::PolicyList_var policy_list = new CORBA::PolicyList (np); - policy_list->length (np); - CORBA::ULong index = 0; - CORBA::ULong array_index = np; - - // Create a list of policies - for (CORBA::ULong pc = 0; pc < np; ++pc) - { - CORBA::Policy_var temp_policy = - this->create_single_policy (sets[i].policies[pc]); - - if (CORBA::is_nil (temp_policy.in ())) - { - array_index = array_index - 1; - policy_list->length (array_index); - } - else - { - policy_list[index] = temp_policy; - index = index + 1; - } - } - - // Bind the policy list to the name. The bind operation should - // surrender the ownership of the newly created PolicyList - // sequence to the map. - if (array_index != 0) - { - if (this->policy_map_.bind (sets[i].Id.in (), - policy_list) != 0) - { - ACE_ERROR ((LM_ERROR, - "Error binding Policy_Set with name: %s\n", - sets[i].Id.in ())); - throw CORBA::INTERNAL (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "NAResource_Config_Manager::init_resource" - " added policy set : %s with %d policies\n", - sets[i].Id.in (), array_index)); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "NAResource_Config_Manager::init_resource" - " added policy set : %s with %d policies\n", - sets[i].Id.in (), array_index)); - } - } -} - -bool -CIAO::NAResource_Config_Manager::policy_exists (const char *name) -{ - if (name == 0) - { - ACE_ERROR ((LM_ERROR, - "Invalid name string found in " - "CIAO::NAResource_Config_Manager::policy_exists\n")); - throw CORBA::INTERNAL (); - } - - POLICY_MAP::ENTRY *entry = 0; - - if (this->policy_map_.find (name, entry) != 0) - { - return false; - } - - return true; -} - -CORBA::PolicyList * -CIAO::NAResource_Config_Manager::find_policies_by_name (const char *name) -{ - if (name == 0) - { - ACE_DEBUG ((LM_DEBUG, - "Invalid name string found in find_policies_by_name\n")); - throw CORBA::INTERNAL (); - } - - POLICY_MAP::ENTRY *entry = 0; - - CORBA::PolicyList_var retv; - - if (this->policy_map_.find (name, entry) != 0) - { - ACE_DEBUG ((LM_DEBUG, - "Unable to find a PolicyList named %s\n", - name)); - retv = 0; - } - else - { - retv = new CORBA::PolicyList (entry->int_id_.in ()); - } - return retv._retn (); -} - -CORBA::Policy_ptr -CIAO::NAResource_Config_Manager::create_single_policy -(const CIAO::DAnCE::PolicyDef &policy_def) -{ - CORBA::Policy_var retv; - - switch (policy_def._d ()) - { - case TAO::NETWORK_PRIORITY_TYPE: - { - const CIAO::DAnCE::NWPriorityModelPolicyDef &nw_tmp - = policy_def.NWPriorityModelDef (); - retv = this->orb_->_create_policy (TAO::NETWORK_PRIORITY_TYPE); - - TAO::NetworkPriorityPolicy_var nw_priority = - TAO::NetworkPriorityPolicy::_narrow (retv.in ()); - - nw_priority->network_priority_model ( - (TAO::NetworkPriorityModel) nw_tmp.nw_priority_model); - - nw_priority->request_diffserv_codepoint ( - (TAO::DiffservCodepoint) nw_tmp.request_dscp); - - nw_priority->reply_diffserv_codepoint ( - (TAO::DiffservCodepoint) nw_tmp.reply_dscp); - - retv = nw_priority._retn (); - - if (! CORBA::is_nil (retv.in ())) - ACE_DEBUG ((LM_DEBUG, - "NAConfigManager::Create NetworkPriority policy: %d\n", - nw_tmp.nw_priority_model)); - } - break; - - case TAO::CLIENT_NETWORK_PRIORITY_TYPE: - { - const CIAO::DAnCE::CNWPriorityModelPolicyDef &cnw_tmp - = policy_def.CNWPriorityModelDef (); - retv = this->orb_->_create_policy (TAO::CLIENT_NETWORK_PRIORITY_TYPE); - - TAO::NetworkPriorityPolicy_var cnw_priority = - TAO::NetworkPriorityPolicy::_narrow (retv.in ()); - - cnw_priority->request_diffserv_codepoint ( - (TAO::DiffservCodepoint) cnw_tmp.request_dscp); - - cnw_priority->reply_diffserv_codepoint ( - (TAO::DiffservCodepoint) cnw_tmp.reply_dscp); - - retv = cnw_priority._retn (); - - if (! CORBA::is_nil (retv.in ())) - ACE_DEBUG ((LM_DEBUG, - "NAConfigManager::Create NetworkPriority policy \n")); - } - break; - - default: - retv = 0; - } - - return retv._retn (); -} - -extern "C" CIAO_NA_Configurator_Export CIAO::Config_Manager *create_na_config_manager (void); - -CIAO::Config_Manager * -create_na_config_manager (void) -{ - CIAO::NAResource_Config_Manager *config; - ACE_NEW_RETURN (config, CIAO::NAResource_Config_Manager, 0); - return config; -} diff --git a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.h b/CIAO/DAnCE/NodeApplication/NAConfig_Manager.h deleted file mode 100755 index 00248c5c551..00000000000 --- a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file NAConfig_Manager.h - * - * $Id$ - * - */ -//============================================================================= - - -#ifndef CIAO_NACONFIG_MANAGER_H -#define CIAO_NACONFIG_MANAGER_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" -#include "ace/Null_Mutex.h" -#include "ace/SString.h" -#include "ace/Hash_Map_Manager_T.h" -#include "Config_Manager.h" -#include "NA_Configurator_Export.h" - -namespace CIAO -{ - /** - */ - class CIAO_NA_Configurator_Export NAResource_Config_Manager - : public Config_Manager - { - public: - virtual ~NAResource_Config_Manager (void) {} - - virtual int pre_orb_initialize (void); - - virtual int post_orb_initialize (CORBA::ORB_ptr o); - - virtual void init (CORBA::ORB_ptr orb); - - /// Initializing the NAResource_Config_Manager - virtual void init_resources (const CIAO::DAnCE::ServerResource &info); - - /// Query a policy set by name - virtual CORBA::PolicyList *find_policies_by_name (const char *name); - - virtual bool policy_exists (const char *name); - - private: - /// Cached an ORB reference. - CORBA::ORB_var orb_; - - CORBA::Policy_ptr create_single_policy - (const CIAO::DAnCE::PolicyDef &policy_def); - - /// Hash_Map stuff. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - CORBA::PolicyList_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> POLICY_MAP; - - /// Internal TP names to id map. - POLICY_MAP policy_map_; - }; -} - -#include /**/ "ace/post.h" -#endif /* CIAO_NACONFIG_MANAGER_H */ - diff --git a/CIAO/DAnCE/NodeApplication/Name_Utilities.cpp b/CIAO/DAnCE/NodeApplication/Name_Utilities.cpp new file mode 100644 index 00000000000..dd34beee6b7 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/Name_Utilities.cpp @@ -0,0 +1,178 @@ +// $Id$ + +#include "Name_Utilities.h" + +#include "ace/Auto_Ptr.h" +#include "ace/SString.h" +#include "Logger/Log_Macros.h" + +namespace DAnCE +{ + bool + Name_Utilities::write_ior (const ACE_TCHAR *file, + const char *ior) + { + FILE* ior_output_file_ = ACE_OS::fopen (file, "w"); + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, + "%s", + ior); + ACE_OS::fclose (ior_output_file_); + return true; + } + return false; + } + + bool + Name_Utilities::bind_object (const char *name, + CORBA::Object_ptr obj, + CosNaming::NamingContext_ptr ctx) + { + DANCE_TRACE ("Name_Utilities::bind_object"); + + if (CORBA::is_nil (ctx)) + { + DANCE_ERROR ((LM_WARNING, DLINFO "Name_Utilities::bind_object - " + "Provided naming context is nil, component %s will not be registered.", + name)); + return false; + } + + try + { + CosNaming::Name nm; + + Name_Utilities::build_name (name, nm); + + if (nm.length () == 0) + { + DANCE_ERROR ((LM_WARNING, DLINFO "Name_Utilities::bind_object - " + "build_name resulted in an invalid name for string %C\n", + name)); + return false; + } + + Name_Utilities::bind_context (nm, ctx); + + try + { + ctx->bind (nm, obj); + } + catch (const CosNaming::NamingContext::AlreadyBound &) + { + DANCE_ERROR ((LM_WARNING, DLINFO "Name_Utilities::bind_object - " + "Name %C already bound, rebinding....\n", + name)); + ctx->rebind (nm, obj); + } + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Name_Utilities::bind_object - " + "Caught CORBA exception while attempting to bind name %C: %C\n", + name, ex._info ().c_str ())); + return false; + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Name_Utilities::bind_object - " + "Caught unknown C++ exception while attemptint to bind name %C\n", + name)); + return false; + } + + return true; + } + + void + Name_Utilities::bind_context (CosNaming::Name &nm, + CosNaming::NamingContext_ptr ctx) + { + DANCE_TRACE ("Name_Utilities::bind_context"); + + if (CORBA::is_nil (ctx)) + { + DANCE_ERROR ((LM_WARNING, DLINFO "Name_Utilities::bind_context - " + "Provided naming context is nil, the naming context will not be bound.")); + } + + CosNaming::Name newname (nm.length ()); + + for (CORBA::ULong i = 0; + i < (nm.length () - 1); ++i) + { + newname.length (i + 1); + newname[i] = nm[i]; + + try + { + ctx->bind_new_context (newname); + DANCE_DEBUG ((LM_TRACE, DLINFO "Name_Utilities::bind_context - " + "Bound new context %C\n", newname[i].id.in ())); + } + catch (CosNaming::NamingContext::AlreadyBound &) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "Name_Utilities::bind_context - " + "Context %C already bound.\n", newname[i].id.in ())); + } + } + } + + bool + Name_Utilities::unbind_object (const char *name, + CosNaming::NamingContext_ptr ctx) + { + DANCE_TRACE ("Name_Utilities::unbind_object"); + + if (CORBA::is_nil (ctx)) + { + DANCE_ERROR ((LM_WARNING, DLINFO "Name_Utilities::unbind_object - " + "Provided naming context is nil, instance %s will not be unbound\n", + name)); + } + + CosNaming::Name nm; + Name_Utilities::build_name (name, nm); + + try + { + ctx->unbind (nm); + } + catch (CORBA::Exception &e) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Name_Utilities::unbind_object - " + "Caught CORBA exception whilst unbinding name %C: %C\n", + name, e._info ().c_str ())); + return false; + } + return true; + } + + void + Name_Utilities::build_name (const char *name, + CosNaming::Name &nm) + { + DANCE_TRACE ("Name_Utilities::build_name"); + + /*ACE_Auto_Basic_Array_Ptr<ACE_TCHAR>*/ ACE_TCHAR *safe_array (new char[ACE_OS::strlen (name)]); + + ACE_Tokenizer parser (ACE_OS::strcpy (safe_array/*.get ()*/, name)); + parser.delimiter ('/'); + + ACE_TCHAR *next (0); + + while ((next = parser.next ()) != 0) + { + CORBA::ULong i = nm.length (); + nm.length (i + 1); + + DANCE_DEBUG ((LM_TRACE, DLINFO "Name_Utilities::build_name - " + "Found name component %C\n", + next)); + + nm[i].id = CORBA::string_dup (next); + } + } + +} diff --git a/CIAO/DAnCE/NodeApplication/Name_Utilities.h b/CIAO/DAnCE/NodeApplication/Name_Utilities.h new file mode 100644 index 00000000000..5e75249a693 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/Name_Utilities.h @@ -0,0 +1,42 @@ +/** + * @file Name_Utilities.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * A set of utility methods to manages references. + * + */ + +#ifndef NAME_UTILITIES_H +#define NAME_UTILITIES_H + +#include "orbsvcs/CosNamingC.h" + +namespace DAnCE +{ + class Name_Utilities + { + public: + /// Write IOR to named file. Will overwrite file if present. + static bool write_ior (const ACE_TCHAR *file, const char *ior); + + /// Binds object to provided name, which may be formatted with / to indicate + /// naming contexts, e.g. A/B/C. + static bool bind_object (const char *name, + CORBA::Object_ptr obj, + CosNaming::NamingContext_ptr); + + /// Will unbind the provided name. + static bool unbind_object (const char *name, + CosNaming::NamingContext_ptr); + + private: + static void bind_context (CosNaming::Name &nm, + CosNaming::NamingContext_ptr); + + static void build_name (const char *nm, + CosNaming::Name &); + + }; +} + +#endif /* NAME_UTILITIES_H */ diff --git a/CIAO/DAnCE/NodeApplication/NoOp_Configurator.cpp b/CIAO/DAnCE/NodeApplication/NoOp_Configurator.cpp deleted file mode 100644 index 4ffe48cd7d2..00000000000 --- a/CIAO/DAnCE/NodeApplication/NoOp_Configurator.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ - -#include "NoOp_Configurator.h" - -CIAO::NoOp_Configurator::~NoOp_Configurator (void) -{ - // Not much to do. -} - -int -CIAO::NoOp_Configurator::pre_orb_initialize () -{ - return 0; -} - -int -CIAO::NoOp_Configurator::post_orb_initialize (CORBA::ORB_ptr) -{ - return 0; -} - -int -CIAO::NoOp_Configurator::init_resource_manager -(const ::Deployment::Properties & /*properties*/) -{ - // @@ Currently do thing. We should go over the resource struct in - // the future and throw exceptions if there are - // un-recognizable/supported stuff in it. - return 0; -} - -CORBA::PolicyList * -CIAO::NoOp_Configurator::find_container_policies -(const ::Deployment::Properties & /*properties*/) -{ - // Not much to do. - - return 0; -} diff --git a/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h b/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h deleted file mode 100644 index 6c32b83ce0d..00000000000 --- a/CIAO/DAnCE/NodeApplication/NoOp_Configurator.h +++ /dev/null @@ -1,62 +0,0 @@ -/** $Id$ - * @file NoOp_Configurator.h - * @brief This file contains the noop configurator. - */ - -#ifndef NOOP_CONFIGURATOR_H -#define NOOP_CONFIGURATOR_H - -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "NodeApp_Configurator.h" -#include "NoOp_Configurator_export.h" - -namespace CIAO -{ - /** - * @class NoOP_Configurator - * - * @brief The NoOp_Configurator doesn't do anything. - */ - class NoOp_Configurator_Export NoOp_Configurator - : public NodeApp_Configurator - { - public: - /// Default destructor. - virtual ~NoOp_Configurator (void); - - /** - * @brief "pre_orb_initialize" is called before ORB_init. - */ - virtual int pre_orb_initialize (void); - - /** - * @brief "post_orb_initialize" is called after NodeApplication - * get a hold at this object. - */ - virtual int post_orb_initialize (CORBA::ORB_ptr o); - - /** - * @brief "init_resource_manager" is called by NodeApplication when - * it receives an "install" commands. - */ - virtual int - init_resource_manager (const ::Deployment::Properties &properties); - - /** - * @brief get a policyset by its name. - */ - virtual CORBA::PolicyList * - find_container_policies (const ::Deployment::Properties &properties); - }; - -} - -#include /**/ "ace/post.h" -#endif /* NOOP_CONFIGURATOR_H */ diff --git a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.cpp b/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.cpp deleted file mode 100755 index 8b18b66f16b..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.cpp +++ /dev/null @@ -1,322 +0,0 @@ -// $Id$ - -#include "NodeApp_Configurator.h" -#include "Config_Manager.h" -#include "ace/Log_Msg.h" - -CIAO::NodeApp_Configurator::NodeApp_Configurator (void) - : rt_support_ (0) -{ -} - -CIAO::NodeApp_Configurator::~NodeApp_Configurator (void) -{ - // Not much to do. -} - -void -CIAO::NodeApp_Configurator::set_rt_support (void) -{ - this->rt_support_ = 1; -} - -int -CIAO::NodeApp_Configurator::create_config_managers (void) -{ - typedef CIAO::Config_Manager * (*na_intelligent_designer)(void); - typedef CIAO::Config_Manager * (*rtna_intelligent_designer)(void); - CIAO::Config_Manager* ptr = 0; - CIAO::Config_Manager* rt_ptr = 0; - - int retval = this->config_dll_.open ( - ACE_DLL_PREFIX ACE_TEXT ("CIAO_NA_Configurator"), - ACE_DEFAULT_SHLIB_MODE, - 0); - - if (0 != retval) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "dll.open"), - 0); - } - - // Cast the void* to non-pointer type first - it's not legal to - // cast a pointer-to-object directly to a pointer-to-function. - void *void_ptr = - this->config_dll_.symbol (ACE_TEXT ("create_na_config_manager")); - ptrdiff_t tmp = reinterpret_cast<ptrdiff_t> (void_ptr); - - // "id" is for na_intelligent-designer. - na_intelligent_designer config_id = - reinterpret_cast<na_intelligent_designer> (tmp); - - if (0 == config_id) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p", - "dll.symbol"), - 0); - } - - ptr = config_id (); - - if (0 == ptr) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Error creating NodeApp_Configurator\n"), - 0); - } - - this->na_config_manager_.reset (ptr); - - if (this->rt_support_) - { - int rt_retval = this->config_dll_.open ( - ACE_DLL_PREFIX ACE_TEXT ("CIAO_RTNA_Configurator"), - ACE_DEFAULT_SHLIB_MODE, - 0); - - if (0 != rt_retval) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "dll.open"), - 0); - } - - // Cast the void* to non-pointer type first - it's not legal to - // cast a pointer-to-object directly to a pointer-to-function. - void *rt_void_ptr = - this->config_dll_.symbol (ACE_TEXT ("create_rt_config_manager")); - ptrdiff_t rt_tmp = reinterpret_cast<ptrdiff_t> (rt_void_ptr); - - // "id" is for na_intelligent-designer. - rtna_intelligent_designer rt_config_id = - reinterpret_cast<rtna_intelligent_designer> (rt_tmp); - - if (0 == rt_config_id) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p", - "dll.symbol"), - 0); - } - - rt_ptr = rt_config_id (); - - if (0 == rt_ptr) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Error creating RTNodeApp_Configurator\n"), - 0); - } - - this->rt_config_manager_.reset (rt_ptr); - } - - return 0; -} - -int -CIAO::NodeApp_Configurator::pre_orb_initialize () -{ - ACE_DEBUG ((LM_DEBUG, "NodeApp_Configurator::pre_orb_init\n")); - - (*this->na_config_manager_.get ()).pre_orb_initialize (); - if (this->rt_support_) - { - (*this->rt_config_manager_.get ()).pre_orb_initialize (); - } - - return 0; -} - -int -CIAO::NodeApp_Configurator::post_orb_initialize (CORBA::ORB_ptr o) -{ - ACE_DEBUG ((LM_DEBUG, "NodeApp_Configurator::post_orb_init\n")); - this->orb_ = CORBA::ORB::_duplicate (o); - - (*this->na_config_manager_.get ()).init (this->orb_.in ()); - if (this->rt_support_ == 1) - { - (*this->rt_config_manager_.get ()).init (this->orb_.in ()); - } - - (*this->na_config_manager_.get ()).post_orb_initialize (this->orb_.in ()); - if (this->rt_support_ == 1) - { - (*this->rt_config_manager_.get ()).post_orb_initialize (this->orb_.in ()); - } - - return 0; -} - -int -CIAO::NodeApp_Configurator::init_resource_manager -(const ::Deployment::Properties &properties) -{ - for (CORBA::ULong i = 0; i < properties.length (); ++i) - { - if (ACE_OS::strcmp ( - "CIAOServerResources", properties[i].name.in ()) == 0) - { - const CIAO::DAnCE::ServerResource *svr_resource; - if (properties[i].value >>= svr_resource) - { - (*this->na_config_manager_.get ()). - init_resources (*svr_resource); - - if (this->rt_support_ == 1) - { - (*this->rt_config_manager_.get ()). - init_resources (*svr_resource); - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: NodeApp_Configurator::" - "init_resource_manager unable to extract" - "CIAOServerResources\n"), -1); - } - } - } - - return 0; -} - -CORBA::PolicyList * -CIAO::NodeApp_Configurator::find_container_policies -(const ::Deployment::Properties &properties) -{ - if (!this->na_config_manager_.get ()) - return 0; - - CORBA::PolicyList *configured_policies = 0; - CORBA::PolicyList *rt_configured_policies = 0; - - for (CORBA::ULong i = 0; i < properties.length (); ++i) - { - if (ACE_OS::strcmp ("ContainerPolicySet", properties[i].name) == 0) - { - const char *policy_name; - if (properties[i].value >>= policy_name) - { - configured_policies = (*this->na_config_manager_.get ()). - find_policies_by_name (policy_name); - - CORBA::ULong p_length = 0; - if (configured_policies != 0) - { - p_length = configured_policies->length (); - } - - if (this->rt_support_ == 1) - { - rt_configured_policies = (*this->rt_config_manager_.get ()). - find_policies_by_name (policy_name); - } - - CORBA::PolicyList_var temp_policies; - CORBA::ULong rtp_length = 0; - if (rt_configured_policies != 0) - { - rtp_length = rt_configured_policies->length (); - temp_policies = rt_configured_policies; - } - else - { - return configured_policies; - } - - CORBA::ULong final_length = p_length + rtp_length; - temp_policies->length (final_length); - - for (CORBA::ULong i = 0; i < p_length; ++i) - { - temp_policies[i+rtp_length] = - CORBA::Policy::_duplicate ((*configured_policies)[i]); - } - return temp_policies._retn (); - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: NodeApp_Configurator:" - "find_container_policies unable to extract" - "ContainerPolicySet\n"), 0); - } - } - } - return 0; -} - -CORBA::PolicyList * -CIAO::NodeApp_Configurator::find_policies_by_name (const char *policy_name) -{ - if (!this->na_config_manager_.get ()) - return 0; - - CORBA::PolicyList *configured_policies = 0; - CORBA::PolicyList *rt_configured_policies = 0; - - configured_policies = (*this->na_config_manager_.get ()). - find_policies_by_name (policy_name); - - CORBA::ULong p_length = 0; - if (configured_policies != 0) - { - p_length = configured_policies->length (); - } - - if (this->rt_support_ == 1) - { - rt_configured_policies = (*this->rt_config_manager_.get ()). - find_policies_by_name (policy_name); - } - - CORBA::PolicyList_var temp_policies; - CORBA::ULong rtp_length = 0; - if (rt_configured_policies != 0) - { - rtp_length = rt_configured_policies->length (); - temp_policies = rt_configured_policies; - } - else - { - return configured_policies; - } - - CORBA::ULong final_length = p_length + rtp_length; - temp_policies->length (final_length); - - for (CORBA::ULong i = 0; i < p_length; ++i) - { - temp_policies[i+rtp_length] = - CORBA::Policy::_duplicate ((*configured_policies)[i]); - } - return temp_policies._retn (); -} - -bool -CIAO::NodeApp_Configurator::policy_exists (const char *policy_set_id) -{ - if (!this->na_config_manager_.get ()) - return 0; - - bool result; - result = (*this->na_config_manager_.get ()). - policy_exists (policy_set_id); - - if (result == false) - { - if (this->rt_support_ == 1) - { - result = (*this->rt_config_manager_.get ()). - policy_exists (policy_set_id); - } - } - return result; -} diff --git a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.h b/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.h deleted file mode 100644 index 8fb48050806..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator.h +++ /dev/null @@ -1,120 +0,0 @@ -//$Id$ -/**======================================================== - * - * @file NodeApp_Configurator.h - * - * @Brief This file contains the implementation of - * the basic NodeApp_Configurator interface, the one - * that does nothing more - * - * @author Nanbor Wang <nanbor@exothermic.txcorp.com> - *========================================================*/ - -#ifndef NODEAPP_CONFIGURATOR_H -#define NODEAPP_CONFIGURATOR_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/Deployment_CoreC.h" -#include "ace/DLL.h" -#include "ace/Auto_Ptr.h" -#include "NodeApp_Configurator_Export.h" -#include "Config_Manager.h" - -namespace CIAO -{ - /** - * - * @class NodeApp_Configurator - * - * @brief This class defines and implements the default - * NodeApp_Configurator base class that's needed for configuring the - * NodeApplication process. - **/ - class NODEAPP_Configurator_Export NodeApp_Configurator - { - public: - - /// Default constructor. - NodeApp_Configurator (void); - - /// Default destructor. - virtual ~NodeApp_Configurator (void); - - /** - * @brief "pre_orb_initialize" is called before ORB_init. - */ - virtual int pre_orb_initialize (void); - - /** - * @brief "post_orb_initialize" is called after NodeApplication - * get a hold at this object. - */ - virtual int post_orb_initialize (CORBA::ORB_ptr o); - - /** - * @brief "init_resource_manager" is called by NodeApplication when - * it receives an "install" commands. - */ - virtual int - init_resource_manager (const ::Deployment::Properties &properties); - - /** - * @brief get a policyset by its name. - */ - virtual CORBA::PolicyList * - find_container_policies (const ::Deployment::Properties &properties); - - /// @@ Perhaps we also need a finalizer method here. Perhaps we - /// even need to differentiate finalizer before ORB is destroyed - /// and the one after that. - - void set_rt_support (void); - - int create_config_managers (void); - - bool policy_exists (const char *policy_set_id); - - CORBA::PolicyList * - find_policies_by_name (const char *name); - - protected: - - int rt_support_; - - CORBA::ORB_var orb_; - - auto_ptr<Config_Manager> rt_config_manager_; - - auto_ptr<Config_Manager> na_config_manager_; - - ACE_DLL config_dll_; - }; -} - -/** - * For dynamically linkable concrete NodeApp_Configurator - * implementation, remember to create a factory method using "C" - * calling convention in the CPP file as follow: - - extern "C" EXPORT_MACRO CIAO::NodeApp_Configurator *create_nodeapp_configurator (void); - - CIAO::NodeApp_Configurator * - create_nodeapp_configurator (void) - { - concrete_NodeApp_Configurator *config; - ACE_NEW_RETURN (config, concrete_NodeApp_Configurator, 0); - return config; - } - - */ - - -#include /**/ "ace/post.h" -#endif /* NODEAPP_CONFIGURATOR_H */ - diff --git a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator_Export.h b/CIAO/DAnCE/NodeApplication/NodeApp_Configurator_Export.h deleted file mode 100644 index 80bbc03531d..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApp_Configurator_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl NODEAPP_Configurator -// ------------------------------ -#ifndef NODEAPP_CONFIGURATOR_EXPORT_H -#define NODEAPP_CONFIGURATOR_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPP_CONFIGURATOR_HAS_DLL) -# define NODEAPP_CONFIGURATOR_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEAPP_CONFIGURATOR_HAS_DLL */ - -#if !defined (NODEAPP_CONFIGURATOR_HAS_DLL) -# define NODEAPP_CONFIGURATOR_HAS_DLL 1 -#endif /* ! NODEAPP_CONFIGURATOR_HAS_DLL */ - -#if defined (NODEAPP_CONFIGURATOR_HAS_DLL) && (NODEAPP_CONFIGURATOR_HAS_DLL == 1) -# if defined (NODEAPP_CONFIGURATOR_BUILD_DLL) -# define NODEAPP_Configurator_Export ACE_Proper_Export_Flag -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* NODEAPP_CONFIGURATOR_BUILD_DLL */ -# define NODEAPP_Configurator_Export ACE_Proper_Import_Flag -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* NODEAPP_CONFIGURATOR_BUILD_DLL */ -#else /* NODEAPP_CONFIGURATOR_HAS_DLL == 1 */ -# define NODEAPP_Configurator_Export -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARATION(T) -# define NODEAPP_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* NODEAPP_CONFIGURATOR_HAS_DLL == 1 */ - -// Set NODEAPP_CONFIGURATOR_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (NODEAPP_CONFIGURATOR_NTRACE) -# if (ACE_NTRACE == 1) -# define NODEAPP_CONFIGURATOR_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define NODEAPP_CONFIGURATOR_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !NODEAPP_CONFIGURATOR_NTRACE */ - -#if (NODEAPP_CONFIGURATOR_NTRACE == 1) -# define NODEAPP_CONFIGURATOR_TRACE(X) -#else /* (NODEAPP_CONFIGURATOR_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define NODEAPP_CONFIGURATOR_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (NODEAPP_CONFIGURATOR_NTRACE == 1) */ - -#endif /* NODEAPP_CONFIGURATOR_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication.cpp b/CIAO/DAnCE/NodeApplication/NodeApplication.cpp deleted file mode 100644 index 8f26bcc2101..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApplication.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -#include "NodeApplication_Core.h" -#include "ace/Sched_Params.h" -#include "ace/OS_NS_errno.h" -#include "ciao/CIAO_common.h" - -#include <orbsvcs/Event/EC_Default_Factory.h> - -void print_arg (int argc, ACE_TCHAR *argv[]) -{ - for (int i = 0; i < argc; ++i) - ACE_DEBUG ((LM_DEBUG, "NodeApplication ARGV[%d] = %s\n", i, argv [i])); -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - try - { - TAO_EC_Default_Factory::init_svcs (); - - ACE_DEBUG ((LM_DEBUG, "*** Starting NodeApplication\n")); - - CIAO::NodeApplication_Options nodeapp_options; - - if (CIAO::debug_level () > 9) - print_arg (argc, argv); - - if (nodeapp_options.parse_args (argc, argv) != 0) - return -1; - - CIAO::NodeApplication_Core nodeapp_core (nodeapp_options); - - if (nodeapp_core.startup (argc, argv) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to start up the NodeApplication_Core\n"), -1); - - // Run the main event loop for the ORB. - nodeapp_core.run_orb (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeApp::main\t\n"); - return 1; - } - - if (CIAO::debug_level () > 1) - ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) - This NodeApplication is destroyed!\n")); - - return 0; -} diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication.mpc b/CIAO/DAnCE/NodeApplication/NodeApplication.mpc index 8fed7ebd998..9ebd5b13356 100644 --- a/CIAO/DAnCE/NodeApplication/NodeApplication.mpc +++ b/CIAO/DAnCE/NodeApplication/NodeApplication.mpc @@ -1,61 +1,29 @@ // -*- MPC -*- // $Id$ -project(Config_Manager) : ciao_deployment_stub, ace_output { - sharedname = CIAO_Config_Manager - dynamicflags = CONFIG_MANAGER_BUILD_DLL - Source_Files { - Config_Manager.cpp - } -} +project(NodeApplication): dance_lib, dynamicinterface, dance_component_server_svnt, \ + dance_deployment_stub, dance_deployment_svnt, dance_redirection_service, \ + dance_logger, iortable, naming, ccm_configvalue, ciao_cs_client, ccm_componentserver_svnt, \ + gen_ostream { + sharedname = DAnCE_NodeApplication + dynamicflags = NODEAPPLICATION_BUILD_DLL -project(NodeApp_Configurator): ciao_config_manager, ace_output { - sharedname = CIAO_NodeApp_Configurator - dynamicflags = NODEAPP_CONFIGURATOR_BUILD_DLL - Source_Files { - NodeApp_Configurator.cpp - } -} -project(NoOp_Configurator): ciao_nodeapp_configurator, ace_output { - sharedname = CIAO_NoOp_Configurator - dynamicflags = NOOP_CONFIGURATOR_BUILD_DLL - Source_Files { - NoOp_Configurator.cpp +Source_Files { +// ComponentInstallation_Impl.cpp +// ServerActivator_Impl.cpp + NodeApplication_Impl.cpp + ComponentAttributesSetter.cpp + Name_Utilities.cpp } -} - -project(RTNA_Configurator): negotiate_codesets, rtportableserver, rtcorba, ciao_nodeapp_configurator, ace_output { - sharedname = CIAO_RTNA_Configurator - dynamicflags = CIAO_RTNA_CONFIGURATOR_BUILD_DLL - Source_Files { - RTConfig_Manager.cpp + Header_Files { +// ComponentInstallation_Impl.h +// ServerActivator_Impl.h + NodeApplication_Impl.h + ComponentAttributesSetter.h + Name_Utilities.h } } -project(NA_Configurator): ciao_deployment_stub, diffservpolicy, ciao_nodeapp_configurator, ace_output { - sharedname = CIAO_NA_Configurator - dynamicflags = CIAO_NA_CONFIGURATOR_BUILD_DLL - Source_Files { - NAConfig_Manager.cpp - } -} - -project(NodeApplicationLib): ciao_server_dnc, ciao_events_dnc, ciao_nodeapp_configurator, ace_output { - sharedname = CIAO_NodeApplication - dynamicflags = NODEAPPLICATION_BUILD_DLL - Source_Files { - Configurator_Factory.cpp - Container_Impl.cpp - NodeApplication_Core.cpp - NodeApplication_Impl.cpp - } -} -project(NodeApplication): ciao_server_dnc, ciao_events_dnc, ciao_nodeapplication, ciaoexe { - exename = NodeApplication - Source_Files { - NodeApplication.cpp - } -} diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp b/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp deleted file mode 100644 index dc4da51e397..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// $Id$ - -#include "DAnCE/Deployment/CIAO_NodeApplication_CallBackC.h" -#include "ace/Sched_Params.h" -#include "NodeApplication_Impl.h" -#include "NodeApplication_Core.h" -#include "ace/Null_Mutex.h" -#include "ciao/Server_init.h" -#include "ciao/CIAO_common.h" - -#if !defined (__ACE_INLINE__) -# include "NodeApplication_Core.inl" -#endif /* __ACE_INLINE__ */ - -const char * -sched_policy_name (int sched_policy) -{ - const char *name = 0; - - switch (sched_policy) - { - case ACE_SCHED_OTHER: - name = "SCHED_OTHER"; - break; - case ACE_SCHED_RR: - name = "SCHED_RR"; - break; - case ACE_SCHED_FIFO: - name = "SCHED_FIFO"; - break; - } - - return name; -} - - -/// The following check is taken from $(TAO_ROOT)/tests/RTCORBA/ -int -check_supported_priorities (CORBA::ORB_ptr orb) -{ - CIAO_TRACE ("NodeApplication_Core::check_supported_priorities"); - - int const sched_policy = - orb->orb_core ()->orb_params ()->ace_sched_policy (); - - // Check that we have sufficient priority range to run, - // i.e., more than 1 priority level. - int const max_priority = - ACE_Sched_Params::priority_max (sched_policy); - int const min_priority = - ACE_Sched_Params::priority_min (sched_policy); - - if (max_priority == min_priority) - { - ACE_DEBUG ((LM_DEBUG, - "Not enough priority levels with the %s scheduling policy\n" - "on this platform to run, terminating program....\n" - "Check svc.conf options\n", - sched_policy_name (sched_policy))); - - return -1; - } - return 0; -} - -int -CIAO::NodeApplication_Core::svc () -{ - CIAO_TRACE ("CIAO::NodeApplication_Core::svc"); - - try - { - CORBA::Object_var object = - this->orb_->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (object.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - - // ... - CIAO::NodeApplication_Impl *nodeapp_servant = 0; - - ACE_NEW_RETURN (nodeapp_servant, - CIAO::NodeApplication_Impl (this->orb_.in (), - root_poa.in (), - *this->configurator_.get ()), - -1); - - PortableServer::ServantBase_var safe_servant (nodeapp_servant); - - // Configuring NodeApplication. - PortableServer::ObjectId_var nodeapp_oid - = root_poa->activate_object (nodeapp_servant); - - object = root_poa->id_to_reference (nodeapp_oid.in ()); - - Deployment::NodeApplication_var nodeapp_obj = - Deployment::NodeApplication::_narrow (object.in ()); - - if (CORBA::is_nil (nodeapp_obj.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to activate NodeApplication object\n"), - -1); - - /** @@ We need to call NodeApplication servant's init method. - * But it's not sure to me where exactly we can get the - * Properties needed by the init method at this moment. There are two - * ways to set the property of the NodeApplication: - * 1. call init remotely from NodeApplicationManager - * 2. call init locally on the servant of NodeApplication. - */ - bool retval = nodeapp_servant->init (); - - if (retval) - { - ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ - initializing the session container!")); - return 1; - } - - CORBA::String_var str = this->orb_->object_to_string (nodeapp_obj.in ()); - - if (this->options_.write_ior_file ()) - CIAO::Utility::write_IOR (this->options_.ior_output_filename (), - str.in ()); - - // End Deployment part - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_INFO, "NodeApplication IOR: %s\n", str.in ())); - - } - - Deployment::NodeApplicationManager_var nodeapp_man; - Deployment::Properties_var prop = new Deployment::Properties; - - if (this->options_.use_callback ()) - { - object = this->orb_->string_to_object (this->options_.callback_ior ()); - - CIAO::NodeApplication_Callback_var nam_callback - = CIAO::NodeApplication_Callback::_narrow (object.in ()); - - Deployment::Properties_out properties_out (prop.out ()); - - nodeapp_man - = nam_callback->register_node_application (nodeapp_obj.in (), - properties_out); - } - - ACE_DEBUG ((LM_DEBUG, - "Running NodeApplication...\n")); - - this->orb_->run (); - - root_poa->destroy (1, 1); - - this->orb_->destroy (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught"); - return -1; - } - - ACE_DEBUG ((LM_DEBUG, - "Exiting NodeApplication...\n")); - return 0; -} - -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 ()); - - if (this->configurator_->create_config_managers ()) - return -1; - - if (this->configurator_->pre_orb_initialize ()) - return -1; - - // Initialize orb - this->orb_ = - CORBA::ORB_init (argc, argv); - CIAO::Server_init (this->orb_.in ()); - - return this->configurator_->post_orb_initialize (this->orb_.in ()); -} - -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) - { - ACE_ERROR_RETURN ((LM_ERROR, "ERROR: DISABLE RT SUPPORT\n"), -1); - // this->options_.rt_support_ = 0; - } - - if (this->options_.rt_support ()) // RT support reuqested - { - - - // spawn a thread - // Task activation flags. - long flags = - THR_NEW_LWP | - THR_JOINABLE | - this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); - - // Activate task. - int result = - this->activate (flags); - if (result == -1) - { - if (errno == EPERM) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot create thread with scheduling policy %s\n" - "because the user does not have the appropriate privileges, terminating program....\n" - "Check svc.conf options and/or run as root\n", - sched_policy_name (this->orb_->orb_core ()->orb_params ()->ace_sched_policy ())), - 2); - } - else - return -1; - } - - ACE_DEBUG ((LM_DEBUG, "*** Running NodeApplication in RT mode\n")); - - // Wait for task to exit. - result = - this->wait (); - ACE_ASSERT (result != -1); - - ACE_DEBUG ((LM_INFO, "*** Ending NodeApplication\n")); - return 0; - - } - else - return this->svc (); -} - diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h b/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h deleted file mode 100644 index aceef49209c..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.h +++ /dev/null @@ -1,70 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file NodeApplication_Core.h - * - * $Id$ - * - * An ACE_Task subclass that manages the NodeApplication runtime. We - * can run this class as a separate thread, as in the case of RT - * support, or as a event driven ORB. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_NODEAPPLICATION_CORE_H -#define CIAO_NODEAPPLICATION_CORE_H -#include /**/ "ace/pre.h" - -#include "CIAO_NodeApplication_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB_Core.h" -#include "tao/ORB.h" -#include "ace/Task.h" -#include "ace/Auto_Ptr.h" -#include "Configurator_Factory.h" -#include "NoOp_Configurator.h" - -namespace CIAO -{ - /** - * @class NodeApplication_Core - * - * @brief An ACE_Task subclass that allow the ORB thread to be run - * as separate thread when RT behaviors are needed. - */ - class NODEAPPLICATION_Export NodeApplication_Core - : public virtual ACE_Task_Base - { - public: - NodeApplication_Core (NodeApplication_Options &opts); - - virtual int svc (void); - - int startup (int argc, char *argv[]); - - int run_orb (void); - - protected: - CORBA::ORB_var orb_; - - NodeApplication_Options &options_; - - auto_ptr<NodeApp_Configurator> configurator_; - }; - -} - -#if defined (__ACE_INLINE__) -# include "NodeApplication_Core.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_NODEAPPLICAITON_CORE_H */ diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl b/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl deleted file mode 100644 index f1f1e82da0c..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Core.inl +++ /dev/null @@ -1,9 +0,0 @@ -// -*- C++ -*- -// $Id$ - -ACE_INLINE -CIAO::NodeApplication_Core::NodeApplication_Core (CIAO::NodeApplication_Options &opts) - : options_ (opts) -{ -} - diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Export.h b/CIAO/DAnCE/NodeApplication/NodeApplication_Export.h new file mode 100644 index 00000000000..bf2c6d7a5cb --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/NodeApplication_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NodeApplication +// ------------------------------ +#ifndef NODEAPPLICATION_EXPORT_H +#define NODEAPPLICATION_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPLICATION_HAS_DLL) +# define NODEAPPLICATION_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NODEAPPLICATION_HAS_DLL */ + +#if !defined (NODEAPPLICATION_HAS_DLL) +# define NODEAPPLICATION_HAS_DLL 1 +#endif /* ! NODEAPPLICATION_HAS_DLL */ + +#if defined (NODEAPPLICATION_HAS_DLL) && (NODEAPPLICATION_HAS_DLL == 1) +# if defined (NODEAPPLICATION_BUILD_DLL) +# define NodeApplication_Export ACE_Proper_Export_Flag +# define NODEAPPLICATION_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NODEAPPLICATION_BUILD_DLL */ +# define NodeApplication_Export ACE_Proper_Import_Flag +# define NODEAPPLICATION_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NODEAPPLICATION_BUILD_DLL */ +#else /* NODEAPPLICATION_HAS_DLL == 1 */ +# define NodeApplication_Export +# define NODEAPPLICATION_SINGLETON_DECLARATION(T) +# define NODEAPPLICATION_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NODEAPPLICATION_HAS_DLL == 1 */ + +// Set NODEAPPLICATION_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NODEAPPLICATION_NTRACE) +# if (ACE_NTRACE == 1) +# define NODEAPPLICATION_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NODEAPPLICATION_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NODEAPPLICATION_NTRACE */ + +#if (NODEAPPLICATION_NTRACE == 1) +# define NODEAPPLICATION_TRACE(X) +#else /* (NODEAPPLICATION_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NODEAPPLICATION_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NODEAPPLICATION_NTRACE == 1) */ + +#endif /* NODEAPPLICATION_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index 39c773bbee3..b5250b701b0 100644 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -1,1207 +1,2131 @@ // $Id$ - #include "NodeApplication_Impl.h" -#include "ace/SString.h" -#include "Container_Impl.h" -#include "DAnCE/Deployment/Deployment_EventsC.h" -#include "ciaosvcs/Events/CIAO_RTEC/CIAO_RTEventC.h" - -#if !defined (__ACE_INLINE__) -# include "NodeApplication_Impl.inl" -#endif /* __ACE_INLINE__ */ -CIAO::NodeApplication_Impl::~NodeApplication_Impl (void) +#include "ace/OS_Memory.h" +#include "ace/Log_Msg.h" +#include "ace/streams.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/Object.h" +#include "tao/ORB.h" +#include "ccm/CCM_ObjectC.h" +#include "ccm/CCM_SessionComponentC.h" +#include "ciao/Valuetype_Factories/ConfigValue.h" +#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" +#include "ciao/ComponentServer/CIAO_PropertiesC.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "Deployment/Deployment_BaseC.h" +#include "Deployment/Deployment_ApplicationC.h" +#include "Deployment/Deployment_common.h" +#include "Deployment/DAnCE_PropertiesC.h" +#include "ComponentAttributesSetter.h" +#include "Name_Utilities.h" + +//#include "ComponentInstallation_Impl.h" + +#ifdef GEN_OSTREAM_OPS +#include <iostream> +#include <sstream> +#endif /* GEN_OSTREAM_OPS */ + +using namespace DAnCE; + +namespace { -} + template<class T> + bool get_property_value (const char *name, PROPERTY_MAP &properties, T &val) + { + DANCE_TRACE ("NodeApplicion::<anonymous>::get_property_value<T>"); + CORBA::Any any; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Finding property value for name '%C'\n", + name)); -CORBA::Long -CIAO::NodeApplication_Impl::init () -{ - /// @todo initialize this NodeApplication properties - return 0; -} - -CORBA::Long -CIAO::NodeApplication_Impl::create_all_containers ( - const ::Deployment::ContainerImplementationInfos & container_infos - ) -{ - // Create all the containers here based on the input node_impl_info. - CORBA::ULong const len = container_infos.length (); + if (properties.find (name, any) == 0) + { + if (any >>= val) + { + return true; + } + else + { + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Failed to extract property value for %C\n", name)); + return false; + } + } - for (CORBA::ULong i = 0; i < len; ++i) - { - // The factory method <create_container> will intialize the container - // servant with properties, so we don't need to call <init> on the - // container object reference. - // Also, the factory method will add the container object reference - // to the set for us. - ::Deployment::Container_var cref = - this->create_container (container_infos[i].container_config); - - // Build the Component_Container_Map - for (CORBA::ULong j = 0; - j < container_infos[i].impl_infos.length (); - ++j) - { - this->component_container_map_.bind ( - container_infos[i].impl_infos[j].component_instance_name.in (), - ::Deployment::Container::_duplicate (cref.in ())); - } - } + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Property value for name '%C' has no value\n", name)); - return 0; -} + return false; + } -void -CIAO::NodeApplication_Impl::finishLaunch ( - const Deployment::Connections & providedReference, - CORBA::Boolean start, - CORBA::Boolean add_connection) -{ - ACE_UNUSED_ARG (start); + template<> + bool get_property_value (const char *name, PROPERTY_MAP &properties, bool &val) + { + DANCE_TRACE ("NodeApplicion::<anonymous>::get_property_value<bool>"); + CORBA::Any any; - // If parameter "add_connection" is true, then it means we want to "add" - // new connections, other, we remove existing connections - this->finishLaunch_i (providedReference, start, add_connection); -} + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<bool> - " + "Finding property value for name '%C'\n", + name)); -void -CIAO::NodeApplication_Impl::finishLaunch_i ( - const Deployment::Connections & connections, - CORBA::Boolean start, - CORBA::Boolean add_connection) -{ - ACE_UNUSED_ARG (start); + if (properties.find (name, any) == 0) + { + if (any >>= CORBA::Any::to_boolean(val)) + { + return true; + } + else + { + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Failed to extract property value for %C\n", name)); + return false; + } + } - try - { - CORBA::ULong const length = connections.length (); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<bool> - " + "Property value for name '%C' has no value\n", name)); - // For every connection struct we finish the connection. - for (CORBA::ULong i = 0; i < length; ++i) - { - ACE_CString name = connections[i].instanceName.in (); + return false; + } - // For ES_to_Consumer connection, we simply call - // handle_es_consumer_connection method. - //if (connections[i].kind == Deployment::rtecEventConsumer) - if (this->_is_es_consumer_conn (connections[i])) - { - this->handle_es_consumer_connection ( - connections[i], - add_connection); - continue; - } + template<> + bool get_property_value (const char *name, PROPERTY_MAP &properties, const char * &val) + { + DANCE_TRACE ("NodeApplicion::<anonymous>::get_property_value<const char *>"); + CORBA::Any any; - // For other type of connections, we need to fetch the - // objref of the source component - Component_State_Info comp_state; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<bool> - " + "Finding property value for name '%C'\n", + name)); - if (this->component_state_map_.find (name, comp_state) != 0) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::finishLaunch, " - "invalid port name [%s] in instance [%s] \n", - connections[i].portName.in (), - name.c_str ())); - throw Deployment::InvalidConnection (); - } + if (properties.find (name, any) == 0) + { + if (any >>= CORBA::Any::to_string(val, 0)) + { + return true; + } + else + { + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicion::<anonymous>::get_property_value<const char *> - " + "Failed to extract property value for %C\n", name)); + return false; + } + } - Components::EventConsumerBase_var consumer; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<bool> - " + "Property value for name '%C' has no value\n", name)); - Components::CCMObject_var comp = comp_state.objref_; + return false; + } - if (CORBA::is_nil (comp.in ())) - { - ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); - throw Deployment::InvalidConnection (); - } + template<class T> + bool get_property_value (const char *name, const Deployment::Properties &properties, T &val) + { + DANCE_TRACE ("NodeApplicion::<anonymous>::get_property_value<T>"); - switch (connections[i].kind) - { - case Deployment::SimplexReceptacle: - case Deployment::MultiplexReceptacle: - this->handle_facet_receptable_connection ( - comp.in (), - connections[i], - add_connection); - break; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Finding property value for name '%C'\n", + name)); - case Deployment::EventEmitter: - this->handle_emitter_consumer_connection ( - comp.in (), - connections[i], - add_connection); - break; + for (CORBA::ULong i = 0; i < properties.length (); ++i) + { + if (ACE_OS::strcmp (properties[i].name.in (), name) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Found property '%C'\n", name)); + if (properties[i].value >>= val) + return true; + else + { + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Failed to extract property value for %C\n", name)); + return false; + } + } + } - case Deployment::EventPublisher: - if (this->_is_publisher_es_conn (connections[i])) - this->handle_publisher_es_connection ( - comp.in (), - connections[i], - add_connection); - else - this->handle_publisher_consumer_connection ( - comp.in (), - connections[i], - add_connection); - break; - default: - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::finishLaunch_i: " - "Unsupported event port type encounted\n")); - throw CORBA::NO_IMPLEMENT (); - } - } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeApplication_Impl::finishLaunch\t\n"); - throw; - } + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Property value for name '%C' has no value\n", name)); -} + return false; + } -void -CIAO::NodeApplication_Impl::ciao_preactivate () -{ - Component_Iterator end = this->component_state_map_.end (); - for (Component_Iterator iter (this->component_state_map_.begin ()); - iter != end; - ++iter) + template<> + bool get_property_value (const char *name, const Deployment::Properties &properties, const char * &val) { - if (((*iter).int_id_).state_ == NEW_BORN) - { - ((*iter).int_id_).objref_->ciao_preactivate (); - } + DANCE_TRACE ("NodeApplicion::<anonymous>::get_property_value<const char *>"); - ((*iter).int_id_).state_ = PRE_ACTIVE; - } -} + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Finding property value for name '%C'\n", + name)); -void -CIAO::NodeApplication_Impl::start () -{ - Component_Iterator end = this->component_state_map_.end (); - for (Component_Iterator iter (this->component_state_map_.begin ()); - iter != end; - ++iter) - { - if (((*iter).int_id_).state_ == PRE_ACTIVE) + for (CORBA::ULong i = 0; i < properties.length (); ++i) { - ((*iter).int_id_).objref_->ciao_activate (); + if (ACE_OS::strcmp (properties[i].name.in (), name) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Found property '%C'\n", name)); + if (properties[i].value >>= CORBA::Any::to_string (val, 0)) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Value is %C\n", val)); + return true; + } + else + { + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Failed to extract property value for %C\n", name)); + return false; + } + } } - ((*iter).int_id_).state_ = ACTIVE; + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicion::<anonymous>::get_property_value<T> - " + "Unable to find property named %C\n", name)); + + return false; } -} -void -CIAO::NodeApplication_Impl::ciao_postactivate () -{ - Component_Iterator end = this->component_state_map_.end (); - for (Component_Iterator iter (this->component_state_map_.begin ()); - iter != end; - ++iter) + /// Tests flag, if false, sets it to true and replaces the name and + /// reason flags of the exception. + template <typename EXCEPTION> + void test_and_set_exception (bool &flag, EXCEPTION &exception, + const char *name, const char *reason) { - if (((*iter).int_id_).state_ == ACTIVE) + if (!flag) { - ((*iter).int_id_).objref_->ciao_postactivate (); - - ((*iter).int_id_).state_ = POST_ACTIVE; + flag = true; + exception.name = name; + exception.reason = reason; } } } -void -CIAO::NodeApplication_Impl::ciao_passivate () -{ - Component_Iterator end = this->component_state_map_.end (); - for (Component_Iterator iter (this->component_state_map_.begin ()); - iter != end; - ++iter) - { - ((*iter).int_id_).objref_->ciao_passivate (); - ((*iter).int_id_).state_ = PASSIVE; - } - ACE_DEBUG ((LM_DEBUG, "exiting passivate\n")); +NodeApplication_Impl::NodeApplication_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + RedirectionService & redirection, + const ACE_CString& node_name, + const PROPERTY_MAP &properties) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + plan_ (plan), + redirection_ (redirection), + node_name_ (node_name), + properties_ (), + instances_ (plan.instance.length ()) +{ + DANCE_TRACE ("NodeApplication_Impl::NodeApplication_Impl"); + PROPERTY_MAP::const_iterator i = properties.begin (); + while (!i.done ()) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::NodeApplication_Impl - " + "Binding value for property '%C'\n", i->key ().c_str ())); + this->properties_.bind (i->key (), i->item ()); + i.advance (); + } + this->init (); } -Deployment::ComponentInfos * -CIAO::NodeApplication_Impl::install ( - const ::Deployment::NodeImplementationInfo & node_impl_info) +NodeApplication_Impl::~NodeApplication_Impl() { - Deployment::ComponentInfos_var retv; - try - { - // Extract ORB resource def here. - this->configurator_.init_resource_manager (node_impl_info.nodeapp_config); + DANCE_TRACE( "NodeApplication_Impl::~NodeApplication_Impl()"); - const ::Deployment::ContainerImplementationInfos container_infos = - node_impl_info.impl_infos; + using namespace Components; + ConfigValues config_values; + config_values.length (1L); + CORBA::Any feature_any; - ACE_NEW_THROW_EX (retv, - Deployment::ComponentInfos, - CORBA::NO_MEMORY ()); + for (size_t i = 0; + i != this->servers_.size (); + ++i) + { + /* TODO: This is highly suspect. I believe we should be using get_component_server, + not calling create_container. */ + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Deactivating %u ComponentServers\n", + this->servers_.size ())); + for (size_t i = 0; i < this->servers_.size (); ++i) + { + ComponentServer &server = this->servers_[i]; - retv->length (0UL); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "In ComponentServer %u, deactivating %u containers\n", i, server.containers.size ())); + for (size_t j = 0; j < server.containers.size (); ++j) + { + Container &container = server.containers[j]; + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "In container %u hosted in server %u\n", j, i)); + + try + { + server.ref->remove_container (container.ref.in ()); + container.ref = CIAO::Deployment::Container::_nil (); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Caught CORBA exception while removing container %u on server %u: %C\n", + j, i, ex._info ().c_str ())); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Caught unknown C++ exception while removing container %u on server %u.\n", + j, i)); + } + } - // Call create_all_containers to create all the necessary containers.. - // @@(GD): The "create_all_containers" mechanism needs to be refined, so - // we should always try to reuse existing containers as much as possible! - // We need not only factory pattern, but also finder pattern here as well. - if (CIAO::debug_level () > 15) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) NodeApplication_Impl.cpp -" - "CIAO::NodeApplication_Impl::install -" - "creating all the containers. \n")); - } + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Removing component server %u\n", i)); - CORBA::ULong old_set_size = this->container_set_.size (); + try + { + this->activator_->remove_component_server (server.ref.in ()); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Caught CORBA exception while removing server %u: %C\n", + i, ex._info ().c_str ())); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Caught unknown C++ exception while removing server %u.\n", + i)); + } - (void) this->create_all_containers (container_infos); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) NodeApplication_Impl.cpp -" - "CIAO::NodeApplication_Impl::install -" - "create_all_containers() called.\n")); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::~NodeApplication_Impl - " + "Successfully removed container %u on node %C.\n", + i, this->node_name_.c_str ())); } + } +} - // For each container, invoke <install> operation, this will return - // the ComponentInfo for components installed in each container. - // Merge all the returned ComponentInfo, which will be used - // as the return value of this method. - CORBA::ULong const num_containers = container_infos.length (); - for (CORBA::ULong i = 0; i < num_containers; ++i) - { - Deployment::ComponentInfos_var comp_infos = - this->container_set_.at(i+old_set_size)-> - install (container_infos[i]); +void +NodeApplication_Impl::init() +{ + DANCE_TRACE( "NodeApplication_Impl::init()"); + + /* TODO: Lets move this stuff to the constructor, shall we?!? */ + /* TODO: Might be nice to use a component configurator here to load the proper versions + of the serveractivator. */ + + /* ServerActivator configuration */ + CORBA::ULong spawn = 0; + const char *cs_path = 0; + const char *cs_args = 0; + CORBA::Boolean multithread = false; + + get_property_value (CIAO::Deployment::SERVER_EXECUTABLE, this->properties_, cs_path); + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::init - " + "Component server path: %C\n", cs_path)); + get_property_value (CIAO::Deployment::SERVER_ARGUMENTS, this->properties_, cs_args); + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::init - " + "Component server arguments: %C\n", cs_args)); + get_property_value (CIAO::Deployment::SERVER_TIMEOUT, this->properties_, spawn); + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::init - " + "Spawn delay: %u\n", spawn)); + get_property_value (CIAO::Deployment::SERVER_MULTITHREAD, this->properties_, multithread); + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::init - " + "Threading: %C\n", multithread ? "Multi" : "Single")); + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::init - " + "Spawning server activator\n")); + + CIAO::Deployment::CIAO_ServerActivator_i *tmp_act; + ACE_NEW_THROW_EX (tmp_act, + CIAO::Deployment::CIAO_ServerActivator_i (spawn, + cs_path, + cs_args, + multithread, + this->orb_.in(), + this->poa_.in()), + CORBA::NO_MEMORY ()); - // Append the return sequence to the *big* return sequence - CORBA::ULong curr_len = retv->length (); - retv->length (curr_len + comp_infos->length ()); + this->activator_.reset (tmp_act); - for (CORBA::ULong j = curr_len; j < retv->length (); j++) - retv[j] = comp_infos[j-curr_len]; - } + PortableServer::ObjectId_var sa_id = + this->poa_->activate_object (this->activator_.get ()); - // @@ Maybe we can optimize this. We can come up with a decision later. - // Cache a copy of the component object references for all the components - // installed on this NodeApplication. I know we can delegates these to the - // undelying containers, but in that case, we should loop - // all the containers to find the component object reference. - Gan - CORBA::ULong const comp_len = retv->length (); - for (CORBA::ULong len = 0; - len < comp_len; - ++len) - { - Component_State_Info tmp; + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplication_impl::init - ServerActivator object created\n")); - tmp.state_ = NEW_BORN; - tmp.objref_ = - Components::CCMObject::_duplicate (retv[len].component_ref.in ()); + const ACE_TCHAR *ior; - //Since we know the type ahead of time...narrow is omitted here. - if (this->component_state_map_.rebind ( - retv[len].component_instance_name.in(), tmp)) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) NodeApplication_Impl.cpp -" - "CIAO::NodeApplication_Impl::install -" - "error binding component instance [%s] " - "into the map. \n", - retv[len].component_instance_name.in ())); - throw Deployment::InstallationFailure ( - "NodeApplication_Imp::install", - "Duplicate component instance name"); - } - } - } - catch (const CORBA::Exception& ex) + if (get_property_value (DAnCE::INSTANCE_NC, this->properties_, ior) || + get_property_value (DAnCE::DOMAIN_NC, this->properties_, ior)) { - ex._tao_print_exception ("CIAO_NodeApplication::install error\t\n"); - throw; + try + { + CORBA::Object_var obj = this->orb_->string_to_object (ior); + this->instance_nc_ = CosNaming::NamingContext::_narrow (obj); + } + catch (const CORBA::Exception &e) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::init - " + "Unable to resolve the instance naming context:%C\n", + e._info ().c_str ())); + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init - " + "Successfully resolved the instance naming context.\n")); } - - return retv._retn (); + else DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init - " + "No instance NC was provided\n")); } void -CIAO::NodeApplication_Impl::remove_component (const char * inst_name) +NodeApplication_Impl::configuration_complete_components () { - 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) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::remove_component, " - "invalid instance [%s] in the component_container_map.\n", - inst_name)); - throw ::Components::RemoveFailure (); - } - - // Remove this component instance from the node application - ACE_CString name (inst_name); - this->component_container_map_.unbind (name); - this->component_state_map_.unbind (name); - container_ref->remove_component (inst_name); -} + DANCE_TRACE( "NodeApplication_Impl::configuration_complete_components"); -void -CIAO::NodeApplication_Impl::passivate_component (const char * name) -{ - Component_State_Info comp_state; + bool error (false); + Deployment::StartError exception; - if (this->component_state_map_.find (name, comp_state) != 0) + for (size_t k = 0; k < this->instances_.size (); ++k) { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::passivate_component, " - "invalid instance [%s] \n", - name)); - throw Components::RemoveFailure (); - } + if (this->instances_[k]->type == eHome) + { + continue; + } - if (CORBA::is_nil (comp_state.objref_.in ())) - { - ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); - throw Components::RemoveFailure (); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::configuration_complete_components - " + "Invoking configuration_complete on component instance %C on node %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + this->node_name_.c_str ())); + + try + { + Components::CCMObject_var ccmobj = + Components::CCMObject::_narrow (this->instances_[k]->ref.in ()); + if (CORBA::is_nil (this->instances_[k]->ref)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::configuration_complete_components - " + "Failed to narrow object reference for component instance %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + continue; + } + + if (this->instances_[k]->state == eInstalled) + { + ccmobj->configuration_complete (); + this->instances_[k]->state = eConfigured; + } + else + { + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = "Attempting to activate component that has already passed the configure stage.\n"; + continue; + } + } + + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::configuration_complete_components - " + "Component %C successfully configured.\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::configuration_complete_components - " + "Caught CORBA exception from ccm_activate on component %C: %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + ex._info ().c_str ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = ex._info ().c_str (); + } + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::configuration_complete_components - " + "Caught unknown C++ exception from ccm_activate on component %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = "Unknown C++ exception"; + } + } } - comp_state.objref_->ciao_passivate (); + if (error) + throw exception; } void -CIAO::NodeApplication_Impl::activate_component (const char * name) +NodeApplication_Impl::start () { - Component_State_Info comp_state; + DANCE_TRACE( "NodeApplication_Impl::start"); - if (this->component_state_map_.find (name, comp_state) != 0) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::activate_component, " - "invalid instance [%s] \n", - name)); - throw Deployment::StartError (); - } + bool error (false); + Deployment::StartError exception; - if (CORBA::is_nil (comp_state.objref_.in ())) + for (size_t k = 0; k < this->instances_.size (); ++k) { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "comp is nil\n")); - throw Deployment::StartError (); - } + if (this->instances_[k]->type == eHome) + { + continue; + } - comp_state.objref_->ciao_preactivate (); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::start - " + "Invoking start on component instance %C on node %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + this->node_name_.c_str ())); - comp_state.objref_->ciao_activate (); + try + { + CIAO::Deployment::Container_var cont = + CIAO::Deployment::Container::_narrow (this->instances_[k]->container->ref.in()); - comp_state.objref_->ciao_postactivate (); -} + if (CORBA::is_nil (this->instances_[k]->container->ref.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::start - " + "Failed to narrow object reference for container managing " + "component instance %C to a CIAO container reference\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Failed to narrow managing container to CIAO container type"); + continue; + } + + if (this->instances_[k]->state == eConfigured || + this->instances_[k]->state == ePassive) + { + Components::CCMObject_var comp (Components::CCMObject::_narrow (this->instances_[k]->ref)); + cont->activate_component (comp.in ()); + this->instances_[k]->state = eActive; + } + else + { + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = "Attempting to activate component that is not configured or passive.\n"; + } + } + + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::start - " + "Component %C successfully activated.\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::start - " + "Caught CORBA exception from ccm_activate on component %C: %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + ex._info ().c_str ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = ex._info ().c_str (); + } + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::start - " + "Caught unknown C++ exception from ccm_activate on component %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = "Unknown C++ exception"; + } + } + } + if (error) + throw exception; +} void -CIAO::NodeApplication_Impl::remove () +NodeApplication_Impl::install_home (Container &cont, Instance &inst) { - // If we still have components installed, then do nothing + DANCE_TRACE( "NodeApplication_Impl::install_home"); - if (this->component_state_map_.current_size () != 0) - return; + const ::Deployment::MonolithicDeploymentDescription &mdd = this->plan_.implementation[inst.mdd_idx]; + const ::Deployment::InstanceDeploymentDescription &idd = this->plan_.instance[inst.idd_idx]; - // For each container, invoke <remove> operation to remove home and components. - CORBA::ULong const set_size = this->container_set_.size (); - for (CORBA::ULong i = 0; i < set_size; ++i) - { - if (CIAO::debug_level () > 5) - { - ACE_DEBUG ((LM_DEBUG, "NA: calling remove on container %i\n")); - } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_home - " + "Starting installation of home %C on node %C\n", + idd.name.in (), idd.node.in ())); - this->container_set_.at(i)->remove (); - } + this->instances_[inst.idd_idx] = &inst; + + // need to get significant property values + const char *entrypt = 0; + get_property_value (DAnCE::HOME_FACTORY, mdd.execParameter, entrypt); - // Remove all containers - // Maybe we should also deactivate container object reference. - if (CIAO::debug_level () > 5) + if (entrypt == 0) { - ACE_DEBUG ((LM_DEBUG, "NA: remove all\n")); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_home - " + "Unable to find home factory property on home %C\n", + idd.name.in ())); + throw ::Deployment::InvalidComponentExecParameter (mdd.name.in (), + "No 'home factory' property present on MDD\n"); } - this->container_set_.remove_all (); + // @@TODO: Perhaps need better way to do this. + Components::ConfigValues config; + config.length (mdd.execParameter.length () + idd.configProperty.length ()); + CORBA::ULong pos (0); - if (CIAO::debug_level () > 1) + for (CORBA::ULong i = 0; i < mdd.execParameter.length (); ++i) { - ACE_DEBUG ((LM_DEBUG, "Removed all containers from this NodeApplication!\n")); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_home - " + "Inserting value for execParameter %C\n", mdd.execParameter[i].name.in ())); + config[pos++] = new CIAO::ConfigValue_impl (mdd.execParameter[i].name.in (), + mdd.execParameter[i].value); } - // For static deployment, ORB will be shutdown in the Static_NodeManager - if (this->static_entrypts_maps_ == 0) + for (CORBA::ULong i = 0; i < idd.configProperty.length (); ++i) { - this->orb_->shutdown (0); - ACE_DEBUG ((LM_DEBUG, "NA: shutdown\n")); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_home - " + "Inserting value for configProperty %C\n", idd.configProperty[i].name.in ())); + config[pos++] = new CIAO::ConfigValue_impl (idd.configProperty[i].name.in (), + idd.configProperty[i].value); } -} + try + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_home - " + "Calling install_home on container. Home id '%C', entrypt '%C', " + "length of config values is %u\n", + idd.name.in (), entrypt, config.length ())); -// Create a container interface, which will be hosted in this NodeApplication. -::Deployment::Container_ptr -CIAO::NodeApplication_Impl::create_container ( - const ::Deployment::Properties &properties) -{ - //if (CIAO::debug_level () > 1) - // ACE_DEBUG ((LM_DEBUG, "ENTERING: NodeApplication_Impl::create_container()\n")); + ::Components::CCMHome_var home = cont.ref->install_home (idd.name.in (), + entrypt, + config); - CORBA::PolicyList_var policies - = this->configurator_.find_container_policies (properties); + if (CORBA::is_nil (home)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_home - " + "Got nil object reference from container while installing home %C on node %C," + "throwing PlanError\n", + idd.name.in (), idd.node.in ())); + throw ::Deployment::PlanError (idd.name.in (), + "Nil object reference returned from conainer"); + } - CIAO::Container_Impl *container_servant = 0; + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::install_home - " + "Home '%C' on node '%C' successfully installed\n", + idd.name.in (), idd.node.in ())); - ACE_NEW_THROW_EX (container_servant, - CIAO::Container_Impl (this->orb_.in (), - this->poa_.in (), - this->get_objref (), - this->configurator_, - this->static_entrypts_maps_), - CORBA::NO_MEMORY ()); + inst.ref = CORBA::Object::_narrow (home); + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_home - " + "Populating attributes for home %C\n", + idd.name.in ())); - PortableServer::ServantBase_var safe_servant (container_servant); - // @TODO: Need to decide a "component_installation" equivalent data - // structure to pass to the container, which will be used to - // suggest how to install the components. Each such data stucture - // should be correspond to one <process_collocation> tag in the XML - // file to describe the deployment plan. - container_servant->init (policies.ptr ()); + ComponentAttributesSetter::SetComponentAttributes (idd.name.in (), + inst.ref.in (), + idd.configProperty, + this->orb_.in ()); + + inst.state = eInstalled; + } + catch (const Components::InvalidConfiguration &) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_home - " + "Error creating home %C on node %C, caught InvalidConfiguration. Throwing exception\n", + idd.name.in (), idd.node.in ())); + throw ::Deployment::InvalidProperty (idd.name.in (), + "Invalid configuration exception from container"); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_home - " + "Caught CORBA exception while installing home %C: %C\n", + idd.name.in (), + ex._info ().c_str ())); + throw ::Deployment::StartError (idd.name.in (), + ex._info ().c_str ()); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_home - " + "Caught unknown C++ exception while installing home %C\n", + idd.name.in ())); + throw ::Deployment::StartError (idd.name.in (), + "Unknown C++ exception"); + } +} - PortableServer::ObjectId_var oid - = this->poa_->activate_object (container_servant); +void +NodeApplication_Impl::install_component (Container &cont, Instance &inst) +{ + DANCE_TRACE( "NodeApplication_Impl::install_component"); + + const ::Deployment::MonolithicDeploymentDescription &mdd = this->plan_.implementation[inst.mdd_idx]; + const ::Deployment::InstanceDeploymentDescription &idd = this->plan_.instance[inst.idd_idx]; + + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_home - " + "Starting installation of home %C on node %C\n", + idd.name.in (), idd.node.in ())); + + this->instances_[inst.idd_idx] = &inst; + + const char *entrypt = 0; + get_property_value (DAnCE::COMPONENT_FACTORY, mdd.execParameter, entrypt); + + if (entrypt == 0) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Unable to find component factory property on component %C\n", + idd.name.in ())); + throw ::Deployment::InvalidComponentExecParameter (mdd.name.in (), + "No 'component factory' property present on MDD\n"); + } + + // @@TODO: Perhaps need better way to do this. + Components::ConfigValues config; + config.length (mdd.execParameter.length () + idd.configProperty.length ()); + CORBA::ULong pos (0); + + for (CORBA::ULong i = 0; i < mdd.execParameter.length (); ++i) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_component - " + "Inserting value for execParameter %C\n", mdd.execParameter[i].name.in ())); + config[pos++] = new CIAO::ConfigValue_impl (mdd.execParameter[i].name.in (), + mdd.execParameter[i].value); + } - CORBA::Object_var obj - = this->poa_->id_to_reference (oid.in ()); + for (CORBA::ULong i = 0; i < idd.configProperty.length (); ++i) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_component - " + "Inserting value for configProperty %C\n", idd.configProperty[i].name.in ())); + config[pos++] = new CIAO::ConfigValue_impl (idd.configProperty[i].name.in (), + idd.configProperty[i].value); + } + + ::CIAO::Deployment::Container_var ciao_cont = ::CIAO::Deployment::Container::_narrow (cont.ref.in ()); - ::Deployment::Container_var ci - = ::Deployment::Container::_narrow (obj.in ()); + if (CORBA::is_nil (ciao_cont.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Unable to narrow container assigned for component instance %C to one that supports " + "un-homed components.\n")); + throw ::Deployment::PlanError (idd.name.in (), + "Hosting container does not support unhomed components.\n"); + } + + try + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_component - " + "Calling install_component on container. Component id '%C', entrypt '%C', " + "length of config values is %u\n", + idd.name.in (), entrypt, config.length ())); + + ::Components::CCMObject_var comp = ciao_cont->install_component (idd.name.in (), + entrypt, + config); + + if (CORBA::is_nil (comp)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Got nil object reference from container while installing component %C on node %C," + "throwing PlanError\n", + idd.name.in (), idd.node.in ())); + throw ::Deployment::PlanError (idd.name.in (), + "Nil object reference returned from install_component on conainer"); + } - // Cached the objref in its servant. - container_servant->set_objref (ci.in ()); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::install_component - " + "Component '%C' on node '%C' successfully installed\n", + idd.name.in (), idd.node.in ())); + + inst.ref = CORBA::Object::_narrow (comp); + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_component - " + "Populating attributes for home %C\n", + idd.name.in ())); - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - this->container_set_.add (ci.in ()); - } + ComponentAttributesSetter::SetComponentAttributes (idd.name.in (), + inst.ref.in (), + idd.configProperty, + this->orb_.in ()); - //if (CIAO::debug_level () > 1) - // ACE_DEBUG ((LM_DEBUG, - // "LEAVING: NodeApplication_Impl::create_container()\n")); - return ci._retn (); + inst.state = eInstalled; + } + catch (const Components::InvalidConfiguration &) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Error creating component %C on node %C, caught InvalidConfiguration. Throwing exception\n", + idd.name.in (), idd.node.in ())); + throw ::Deployment::InvalidProperty (idd.name.in (), + "Invalid configuration exception from container"); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Caught CORBA exception while installing component %C: %C\n", + idd.name.in (), + ex._info ().c_str ())); + throw ::Deployment::StartError (idd.name.in (), + ex._info ().c_str ()); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_component - " + "Caught unknown C++ exception while installing component %C\n", + idd.name.in ())); + throw ::Deployment::StartError (idd.name.in (), + "Unknown C++ exception"); + } } -// Remove a container interface. void -CIAO::NodeApplication_Impl::remove_container (::Deployment::Container_ptr cref) +NodeApplication_Impl::install_homed_component (Container &cont, Instance &inst) { - ACE_DEBUG ((LM_DEBUG, "ENTERING: NodeApplication_Impl::remove_container()\n")); - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); + DANCE_TRACE("NodeApplication_Impl::install_homed_component (unsigned int index)"); + + //const ::Deployment::MonolithicDeploymentDescription &mdd = this->plan_.implementation[inst.mdd_idx]; + const ::Deployment::InstanceDeploymentDescription &idd = this->plan_.instance[inst.idd_idx]; + this->instances_[inst.idd_idx] = &inst; + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_homed_component - " + "Starting installation of homed component %C on node %C\n", + idd.name.in (), + idd.node.in ())); - if (this->container_set_.object_in_set (cref) == 0) + const char *home_id = 0; + get_property_value (DAnCE::EXPLICIT_HOME, idd.configProperty, home_id); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_homed_component - " + "Property %C has value %C\n", + DAnCE::EXPLICIT_HOME, home_id)); + + + if (home_id == 0) { - throw Components::RemoveFailure(); + DANCE_ERROR ((LM_ERROR, DLINFO "Nodeapplication_Impl::install_homed_component - " + "Apparent homed component %C lacks a %C configProperty, aborting installation\n", + idd.name.in (), DAnCE::EXPLICIT_HOME)); + throw ::Deployment::PlanError (idd.name.in (), + "No explicit home property on component requiring explicit home."); } - cref->remove (); + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::install_homed_component - " + "Found explicit home property '%C' for component '%C'\n", + home_id, + idd.name.in ())); - // @@ Deactivate object. - PortableServer::ObjectId_var oid - = this->poa_->reference_to_id (cref); + Instance *home_inst (0); - this->poa_->deactivate_object (oid.in ()); + for (size_t i = 0; i < cont.homes.size (); ++i) + { + if (ACE_OS::strcmp (home_id, + this->plan_.instance[cont.homes[i].idd_idx].name.in ()) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_homed_component - " + "Found home designated for component '%C'\n", + idd.name.in ())); + home_inst = &cont.homes[i]; + break; + } + } - // Should we remove the server still, even if the previous call failed. - if (this->container_set_.remove (cref) == -1) + if (home_inst == 0) { - throw ::Components::RemoveFailure (); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Unable to find home instance matching %C allocated to same container as component %C\n", + home_id, + idd.name.in ())); + throw Deployment::InvalidProperty (idd.name.in (), + "Unable to find valid home allocated to same container."); } - ACE_DEBUG ((LM_DEBUG, "LEAVING: NodeApplication_Impl::remove_container()\n")); -} + Components::KeylessCCMHome_var home = + Components::KeylessCCMHome::_narrow (home_inst->ref.in ()); -// Get containers -::Deployment::Containers * -CIAO::NodeApplication_Impl::get_containers () -{ - return 0; -} + if (CORBA::is_nil (home.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Object reference for home '%C' for homed component '%C' is nil\n", + home_id, + idd.name.in ())); + throw Deployment::PlanError (idd.name.in (), + "Installed home for explicitly homed component has nil object reference\n"); + } -CIAO::CIAO_Event_Service * -CIAO::NodeApplication_Impl:: -install_es (const ::CIAO::DAnCE::EventServiceDeploymentDescription & es_info) -{ try { - ACE_DEBUG ((LM_DEBUG, "\nNodeApplication_Impl::install_es() called.\n\n")); + inst.home = home_inst; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_homed_component - " + "Invoking create_component on home %C for component %C\n", + home_id, + idd.name.in ())); - CIAO_Event_Service_var ciao_es = - es_factory_.create (es_info.type, es_info.name.in ()); + Components::CCMObject_var ccm_obj = home->create_component (); - // Set up the event channel federations - if (es_info.type == CIAO::RTEC) + if (CORBA::is_nil (ccm_obj)) { - // Narrow the event service to CIAO_RT_Event_Service - ::CIAO::CIAO_RT_Event_Service_var ciao_rtes = - ::CIAO::CIAO_RT_Event_Service::_narrow (ciao_es.in ()); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Received nil component reference from create_component on home %C " + " while creating component %C\n", + home_id, idd.name.in ())); + throw Deployment::StartError (idd.name.in (), + "Home for explicitly homed component returned nil"); + } - if (CORBA::is_nil (ciao_rtes.in ())) - throw ::Deployment::InstallationFailure (); + inst.ref = CORBA::Object::_narrow (ccm_obj.in ()); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::install_homed_component - " + "Component %C successfully installed in home %C\n", + idd.name.in (), + home_id)); + + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::install_home - " + "Populating attributes for component %C\n", + idd.name.in ())); + ComponentAttributesSetter::SetComponentAttributes (idd.name.in (), + inst.ref.in (), + idd.configProperty, + this->orb_.in ()); + inst.state = eInstalled; + } + catch (const Components::CreateFailure &) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Caught CreateFailure exception from home '%C' while installing component '%C'\n", + home_inst, + idd.name.in ())); + throw Deployment::StartError (idd.name.in (), + "Caught CreateFailure exception"); + } + catch (const CORBA::Exception &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Caught CORBA exception while installing component %C in home %C: %C\n", + idd.name.in (), + home_id, + ex._info ().c_str ())); + throw ::Deployment::StartError (idd.name.in (), + ex._info ().c_str ()); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::install_homed_component - " + "Caught unknown C++ exception while installing component %C in home %C\n", + idd.name.in (), + home_id)); + throw ::Deployment::StartError (idd.name.in (), + "Unknown C++ exception"); + } +} - // Set up the event channel federations - for (CORBA::ULong j = 0; j < es_info.addr_servs.length (); ++j) - { - bool retv = - ciao_rtes->create_addr_serv ( - es_info.addr_servs[j].name.in (), - es_info.addr_servs[j].port, - es_info.addr_servs[j].address); +void +NodeApplication_Impl::create_component_server (size_t index) +{ + DANCE_TRACE ("NodeApplication_Impl::create_component_server"); - if (retv == false) - { - ACE_DEBUG ((LM_ERROR, "RTEC failed to create addr serv object\t\n")); - throw ::Deployment::InstallationFailure (); - } - } + ComponentServer &server = this->servers_[index]; - for (CORBA::ULong j = 0; j < es_info.senders.length (); ++j) - { - bool retv = - ciao_rtes->create_sender ( - es_info.senders[j].addr_serv_id.in ()); + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_component_Server - " + "creating component server %u\n", index)); + ::Components::ConfigValues config_values; + server.ref = this->activator_->create_component_server (config_values); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_component_server - " + "component server created\n")); + } + catch (const ::Components::CreateFailure& ) + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplication_impl::create_container - " + "Components::Deployment::ServerActivator_var::create_component_server() " + "returned ::Components::CreateFailure exception\n")); + throw ::Deployment::StartError("", + "Received a ::Components::CreateFailure exception while creating component server."); + } + catch (const ::Components::Deployment::InvalidConfiguration& ) + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplication_impl::create_container - " + "Components::Deployment::ServerActivator_var::create_component_server() " + "returned ::Components::Deployment::InvalidConfiguration exception\n")); + throw ::Deployment::InvalidProperty("", + "::Components::Deployment::InvalidConfiguration exception caught while creating server"); + } - if (retv == false) - { - ACE_DEBUG ((LM_ERROR, "RTEC failed to create UDP sender object\t\n")); - throw ::Deployment::InstallationFailure (); - } + try + { + for (size_t i = 0; i < server.containers.size (); ++i) + { + this->create_container (index, i); } + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::create_container - " + "Caught exception whilst creating container; re-throwing.\n")); + throw; + } +} - for (CORBA::ULong j = 0; j < es_info.receivers.length (); ++j) - { - bool retv = - ciao_rtes->create_receiver ( - es_info.receivers[j].addr_serv_id.in (), - es_info.receivers[j].is_multicast, - es_info.receivers[j].listen_port); +void +NodeApplication_Impl::store_instance_ior (Instance &inst) +{ + DANCE_TRACE ("NodeApplication_impl::store_instance_ior"); - if (retv == false) - { - ACE_DEBUG ((LM_ERROR, "RTEC failed to create UDP receiver object\t\n")); - throw ::Deployment::InstallationFailure (); - } - } - } + const char *name = 0; + + if (get_property_value (DAnCE::REGISTER_NAMING, + this->plan_.instance[inst.idd_idx].configProperty, + name)) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::store_instance_ior - " + "Storing instance '%C' object reference in Naming Service as %C", + this->plan_.instance[inst.idd_idx].name.in (), + name)); - return ciao_es._retn (); + Name_Utilities::bind_object (name, inst.ref.in (), this->instance_nc_.in ()); } - catch (const CORBA::Exception& ex) + + if (get_property_value (DAnCE::INSTANCE_IOR_FILE, + this->plan_.instance[inst.idd_idx].configProperty, + name)) { - ex._tao_print_exception ("NodeApplication_Impl::finishLaunch\t\n"); - throw ::Deployment::InstallationFailure (); + CORBA::String_var ior = this->orb_->object_to_string (inst.ref.in ()); + Name_Utilities::write_ior (name, ior.in ()); } } -ACE_CString * -CIAO::NodeApplication_Impl:: -create_connection_key (const Deployment::Connection & connection) +void +NodeApplication_Impl::create_container (size_t server, size_t cont_idx) { - ACE_CString * retv; - ACE_NEW_RETURN (retv, ACE_CString, 0); + DANCE_TRACE ("NodeApplication_impl::create_container"); - (*retv) += connection.instanceName.in (); - (*retv) += connection.portName.in (); - (*retv) += connection.endpointInstanceName.in (); - (*retv) += connection.endpointPortName.in (); + Container &container = this->servers_[server].containers[cont_idx]; - if (CIAO::debug_level () > 3) - ACE_ERROR ((LM_ERROR, "The key is: %s\n", (*retv).c_str ())); + DANCE_DEBUG ((LM_TRACE, "NodeApplication_impl::create_container - " + "Creating container\n")); + // TODO: Need to create configvalues + Components::ConfigValues cvs; - return retv; -} + container.ref = this->servers_[server].ref->create_container (cvs); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::create_container - " + "Configuring %u homes on container %u on server %u\n", + container.homes.size (), + server, cont_idx)); -void -CIAO::NodeApplication_Impl:: -handle_facet_receptable_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection) -{ - if (CIAO::debug_level () > 11) + // Configure homes first + for (size_t i = 0; i < container.homes.size (); ++i) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::finishLaunch, " - "working on port name [%s] in instance [%s] \n", - connection.portName.in (), - connection.instanceName.in ())); + this->install_home (container, container.homes[i]); + this->store_instance_ior (container.homes[i]); } - if (add_connection) - { - ::Components::Cookie_var cookie = - comp->connect (connection.portName.in (), - connection.endpoint.in ()); - - ACE_CString key = (*create_connection_key (connection)); - if (CIAO::debug_level () > 10) - { - ACE_ERROR ((LM_ERROR, "[BINDING KEY]: %s\n", key.c_str ())); - } - this->cookie_map_.rebind (key, cookie); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::create_container - " + "Configuring %u components on container %u on server %u\n", + container.components.size (), + server, cont_idx)); - if (CIAO::debug_level () > 6) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::finishLaunch\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); - } - } - else + // Configure components + for (size_t i = 0; i < container.components.size (); ++i) { - ACE_CString key = (*create_connection_key (connection)); - ::Components::Cookie_var cookie; - if (CIAO::debug_level () > 6) - { - ACE_ERROR ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); - } - if (this->cookie_map_.find (key, cookie) != 0) - { - ACE_ERROR ((LM_ERROR, "Error: Cookie Not Found!\n")); - throw Deployment::InvalidConnection (); - } - - comp->disconnect (connection.portName.in (), - cookie.in ()); - this->cookie_map_.unbind (key); - if (CIAO::debug_level () > 6) + switch (container.components[i].type) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::finishLaunch\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] disconnected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); + case eComponent: + this->install_component (container, container.components[i]); + break; + case eHomedComponent: + this->install_homed_component (container, container.components[i]); + break; + default: + break; } + this->store_instance_ior (container.components[i]); } } - +/* void -CIAO::NodeApplication_Impl:: -handle_emitter_consumer_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection) +NodeApplication_Impl::create_container (unsigned int index) { - Components::EventConsumerBase_var consumer = - Components::EventConsumerBase::_narrow (connection.endpoint.in ()); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_container - started\n")); - if (CORBA::is_nil (consumer.in ())) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_emitter_consumer_connection, " - "for port name [%s] in instance [%s] ," - "there is an invalid endPoint. \n", - connection.portName.in (), - connection.instanceName.in ())); - throw Deployment::InvalidConnection (); - } + Components::ConfigValues config_values; + ACE_CString processDest; + CORBA::Any_var feature_any; + + this->create_config_values (this->plan_.instance[index].configProperty, + eCreateComponentServer, + config_values); - if (CIAO::debug_level () > 11) + ::Components::Deployment::ComponentServer_var compServer; + + + // COMPONENT_KIND + this->create_config_values (this->plan_.implementation[this->plan_.instance[index].implementationRef].execParameter, + eCreateContainer, + config_values); + try { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_emitter_consumer_connection, " - "working on port name [%s] in instance [%s] \n", - connection.portName.in (), - connection.instanceName.in ())); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_container - " + "creating container for destination: %C\n", processDest.c_str())); + this->containers_.rebind (processDest.c_str(), compServer->create_container (config_values)); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_container - container created\n")); } - - if (add_connection) + catch (::Components::CreateFailure& ) { - comp->connect_consumer (connection.portName.in (), - consumer.in ()); - - if (CIAO::debug_level () > 6) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_emitter_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); - } + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::create_container - " + "::Components::Deployment::ComponentServer_var::create_container() " + "returned ::Components::CreateFailure exception\n")); + throw Deployment::StartError(); } - else + catch (::Components::Deployment::InvalidConfiguration& ) { -// Operation not implemented by the CIDLC. -// comp->disconnect_consumer (connection.portName.in (), -// 0 -//); - - if (CIAO::debug_level () > 6) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_emitter_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] disconnected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); - } + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::create_container - " + "::Components::Deployment::ComponentServer_var::create_container() " + "returned ::Components::Deployment::InvalidConfiguration exception\n")); + throw ::Deployment::InvalidProperty(); } -} + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::create_container - finished\n")); +} +*/ void -CIAO::NodeApplication_Impl:: -handle_publisher_consumer_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection) +NodeApplication_Impl::init_components() { - Components::EventConsumerBase_var consumer = - Components::EventConsumerBase::_narrow (connection.endpoint.in ()); + DANCE_TRACE ("NodeApplication_impl::init_components"); - if (CORBA::is_nil (consumer.in ())) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_consumer_connection, " - "for port name [%s] in instance [%s] ," - "there is an invalid endPoint. \n", - connection.portName.in (), - connection.instanceName.in ())); - throw Deployment::InvalidConnection (); - } + Components::ConfigValues config_values; + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - " + "Configuring %u component/home instances\n", + this->plan_.instance.length())); - if (CIAO::debug_level () > 11) + // @@TODO: For the moment, we are only going to support a single component server and container. + // in the future, we will need to determine how many component servers we need. + if (this->plan_.instance.length () > 0) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_consumer_connection, " - "working on port name [%s] in instance [%s] \n", - connection.portName.in (), - connection.instanceName.in ())); + ComponentServer server; + server.containers.size (1); + this->servers_.size (1); + this->servers_[0] = server; } - if (add_connection) + for (unsigned int i = 0; i < this->plan_.instance.length(); i++) { - ::Components::Cookie_var cookie = - comp->subscribe (connection.portName.in (), - consumer.in ()); - - ACE_CString key = (*create_connection_key (connection)); - this->cookie_map_.rebind (key, cookie); - if (CIAO::debug_level () > 6) + try { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); + CORBA::ULong impl = this->plan_.instance[i].implementationRef; + // Determine type from implementation properties, then from instance properties. + EInstanceType type = + this->get_instance_type (this->plan_.implementation[impl].execParameter); + if (type == eInvalid) + type = this->get_instance_type (this->plan_.instance[i].configProperty); + + switch (type) + { + case eHome: + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - " + "Allocating instance %C as a home\n", + this->plan_.instance[i].name.in ())); + + size_t pos = this->servers_[0].containers[0].homes.size (); + this->servers_[0].containers[0].homes.size (pos + 1); + this->servers_[0].containers[0].homes[pos] = Instance (eHome, + &this->servers_[0].containers[0], + i, + this->plan_.instance[i].implementationRef); + //this->instances_[i] = &this->servers_[0].containers[0].homes[pos]; + break; + } + case eComponent: + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - " + "Allocating instance %C as a standalone component\n", + this->plan_.instance[i].name.in ())); + size_t pos = this->servers_[0].containers[0].homes.size (); + this->servers_[0].containers[0].components.size (pos + 1); + this->servers_[0].containers[0].components[pos] = Instance (eComponent, + &this->servers_[0].containers[0], + i, + this->plan_.instance[i].implementationRef); + //this->instances_[i] = &this->servers_[0].containers[0].components[pos]; + break; + } + case eHomedComponent: + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - " + "Allocating instance %C as a home managed component\n", + this->plan_.instance[i].name.in ())); + size_t pos = this->servers_[0].containers[0].components.size (); + this->servers_[0].containers[0].components.size (pos + 1); + this->servers_[0].containers[0].components[pos] = Instance (eHomedComponent, + &this->servers_[0].containers[0], + i, + this->plan_.instance[i].implementationRef); + //this->instances_[i] = &this->servers_[0].containers[0].components[pos]; + break; + } + default: + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::init_components - " + "get_instance_type function returned invalid instance type\n")); + throw ::Deployment::InvalidProperty (this->plan_.instance[i].name.in (), + "Unable to affirmatively determine instance type"); + } + } // switch + } catch (...) + { + DANCE_ERROR((LM_ERROR, DLINFO "Exception was thrown while sorting instance \"%C\".\n", this->plan_.instance[i].name.in())); + throw; } } - else // remove the connection - { - ACE_CString key = (*create_connection_key (connection)); - ::Components::Cookie_var cookie; - if (CIAO::debug_level () > 6) - { - ACE_ERROR ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); - } - if (this->cookie_map_.find (key, cookie) != 0) - { - ACE_ERROR ((LM_ERROR, "Error: Cookie Not Found!\n")); - throw Deployment::InvalidConnection (); - } + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::init_components - " + "Creating component servers and installing components.\n")); + for (size_t i = 0; i < this->servers_.size (); ++i) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::init_components - " + "Creating component server with index %u\n", i)); + this->create_component_server (i); + } - comp->unsubscribe (connection.portName.in (), - cookie.in ()); - this->cookie_map_.unbind (key); - if (CIAO::debug_level () > 6) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] disconnected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); - } - } + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - finished\n")); } - void -CIAO::NodeApplication_Impl:: -handle_publisher_es_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection) +NodeApplication_Impl::passivate_components() { - if (! this->_is_publisher_es_conn (connection)) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_es_connection: " - "Unsupported event connection type\n")); - throw CORBA::NO_IMPLEMENT (); - } - - const CIAO::CIAO_Event_Service_ptr event_service = - connection.event_service; - - if (CORBA::is_nil (event_service)) - { - ACE_DEBUG ((LM_DEBUG, "Nil event_service\n")); - throw Deployment::InvalidConnection (); - } + DANCE_TRACE ("NodeApplication_Impl::passivate_components()"); - // supplier ID - ACE_CString sid (connection.instanceName.in ()); - sid += "_"; - sid += connection.portName.in (); + bool error (false); + Deployment::StopError exception ("unfilled", "unfilled passivate components"); - if (add_connection) + for (size_t k = 0; k < this->instances_.size (); ++k) { - ::Components::Cookie_var cookie = - comp->subscribe (connection.portName.in (), - event_service); + if (this->instances_[k]->type == eHome || + this->instances_[k]->type == eInvalid) + continue; - ACE_CString key = (*create_connection_key (connection)); - this->cookie_map_.rebind (key, cookie); - // Create a supplier_config and register it to ES - CIAO::Supplier_Config_var supplier_config = - event_service->create_supplier_config (); + try + { + CIAO::Deployment::Container_var cont = + CIAO::Deployment::Container::_narrow (this->instances_[k]->container->ref.in()); - supplier_config->supplier_id (sid.c_str ()); - event_service->connect_event_supplier (supplier_config.in ()); - supplier_config->destroy (); + if (CORBA::is_nil (this->instances_[k]->container->ref.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::start - " + "Failed to narrow object reference for container managing " + "component instance %C to a CIAO container reference\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Failed to narrow managing container to CIAO container type"); + continue; + } - if (CIAO::debug_level () > 6) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_es_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); - } - } - else // remove the connection - { - ACE_CString key = (*create_connection_key (connection)); - ::Components::Cookie_var cookie; + if (this->instances_[k]->state == eActive) + { + Components::CCMObject_var comp (Components::CCMObject::_narrow (this->instances_[k]->ref)); + cont->passivate_component (comp.in ()); + this->instances_[k]->state = ePassive; + } + else + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::start - " + "Attempting to passivate non-active component %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Attempting to passivate non-active component."); + continue; + } - if (CIAO::debug_level () > 6) - { - ACE_ERROR ((LM_ERROR, "[FINDING KEY]: %s\n", key.c_str ())); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::passivate_components - " + "Component %C successfully passivated.\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); } - if (this->cookie_map_.find (key, cookie) != 0) + catch (const CORBA::Exception &ex) { - ACE_ERROR ((LM_ERROR, "Error: Cookie Not Found!\n")); - throw Deployment::InvalidConnection (); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::passivate_components - " + "Caught CORBA exception from ccm_passivate on component %C: %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + ex._info ().c_str ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = ex._info ().c_str (); + } } - - comp->unsubscribe (connection.portName.in (), - cookie.in ()); - this->cookie_map_.unbind (key); - event_service->disconnect_event_supplier (sid.c_str ()); - - if (CIAO::debug_level () > 6) + catch (...) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_publisher_es_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] disconnected.\n", - connection.instanceName.in (), - connection.portName.in (), - connection.endpointInstanceName.in (), - connection.endpointPortName.in ())); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::passivate_components - " + "Caught unknown C++ exception from ccm_passivate on component %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + if (!error) + { + error = true; + exception.name = this->plan_.instance[this->instances_[k]->idd_idx].name.in (); + exception.reason = "Unknown C++ exception"; + } } } -} + if (error) + throw exception; +} void -CIAO::NodeApplication_Impl:: -handle_es_consumer_connection ( - const Deployment::Connection & connection, - CORBA::Boolean add_connection) +NodeApplication_Impl::remove_components() { - if (! this->_is_es_consumer_conn (connection)) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_es_consumer_connection: " - "Unsupported event connection type\n")); - throw CORBA::NO_IMPLEMENT (); - } + DANCE_TRACE ("NodeApplication_Impl::remove_components()"); - // Get ES object - const CIAO::CIAO_Event_Service_ptr event_service = - connection.event_service; + bool error (false); + Deployment::StopError exception ("unfilled", "unfilled remove_components"); - if (CORBA::is_nil (event_service)) + // Removing components first. + for (size_t k = 0; k < this->instances_.size (); ++k) { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_es_consumer_connection: " - "NIL event_service\n")); - throw Deployment::InvalidConnection (); - } + try + { + if (this->instances_[k]->type == eInvalid || + this->instances_[k]->type == eHome) + continue; - // Get consumer object - Components::EventConsumerBase_var consumer = - Components::EventConsumerBase::_narrow (connection.endpoint.in ()); + if (this->instances_[k]->state != ePassive) + DANCE_DEBUG ((LM_WARNING, DLINFO "NodeApplication_Impl::remove_components - " + "Attempting to remove component that is not passive.\n")); - if (CORBA::is_nil (consumer.in ())) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_es_consumer_connection: " - "Nil consumer port object reference\n")); - throw Deployment::InvalidConnection (); - } + if (this->instances_[k]->type == eComponent) + { + if (this->instances_[k]->container == 0) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Container element in component data structure for '%C' is nill\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in () + )); + + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Container element in component data structure is nil\n"); + this->instances_[k]->state = eInvalidState; + continue; + } + + CIAO::Deployment::Container_var ciao_container = + CIAO::Deployment::Container::_narrow (this->instances_[k]->container->ref.in ()); + + if (CORBA::is_nil (ciao_container.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Attempted to remove un-homed component from unsupported container\n")); + + test_and_set_exception (error, exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Attempted to remove un-homed component from unsupported container\n"); + this->instances_[k]->state = eInvalidState; + continue; + } + + ciao_container->remove_component (Components::CCMObject::_narrow (this->instances_[k]->ref.in ())); + } + else + { + Components::CCMHome_var home = + Components::CCMHome::_narrow (this->instances_[k]->home->ref.in ()); + + if (CORBA::is_nil (home)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Object reference for home %C, managing component %C is nil.\n", + this->plan_.instance[this->instances_[k]->home->idd_idx].name.in (), + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Managing home's object reference is invalid."); + this->instances_[k]->state = eInvalidState; + continue; + } + + home->remove_component (Components::CCMObject::_narrow (this->instances_[k]->ref.in ())); + } - // consumer ID - ACE_CString cid (connection.instanceName.in ()); - cid += "_"; - cid += connection.portName.in (); - cid += "_consumer"; - if (add_connection) - { - CIAO::Consumer_Config_var consumer_config = - event_service->create_consumer_config (); + this->instances_[k]->state = eRemoved; - consumer_config->consumer_id (cid.c_str ()); - consumer_config->consumer (consumer.in ()); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::remove_components - " + "Component %C successfully removed.\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); - // Need to setup a filter, if it's specified in the descriptor - for (CORBA::ULong i = 0; i < connection.config.length (); ++i) + } + catch (const CORBA::Exception &ex) { - if (ACE_OS::strcmp (connection.config[i].name.in (), - "EventFilter") != 0) - continue; - - // Extract the filter information - CIAO::DAnCE::EventFilter *filter = 0; - connection.config[i].value >>= filter; + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Caught CORBA exception removing on component %C: %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + ex._info ().c_str ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + exception.reason = ex._info ().c_str ()); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Caught unknown C++ exception from ccm_remove on component %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Unknown C++ exception"); + } + } - CORBA::ULong size = (*filter).sources.length (); + for (size_t k = 0; k < this->instances_.size (); ++k) + { + try + { + if (this->instances_[k]->type != eHome) + continue; - if ((*filter).type == DAnCE::CONJUNCTION) - consumer_config->start_conjunction_group (size); - else if ((*filter).type == DAnCE::DISJUNCTION) - consumer_config->start_disjunction_group (size); + DANCE_ERROR ((LM_TRACE, DLINFO "NodeApplication_Impl::remove_components - " + "Removing home %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); - for (CORBA::ULong j = 0; j < size; ++j) + if (this->instances_[k]->container == 0 || + CORBA::is_nil (this->instances_[k]->container->ref.in ())) { - consumer_config->insert_source ((*filter).sources[j]); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Home %C lacks an associated container reference\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Didn't have a valid container reference"); + continue; } - } - event_service->connect_event_consumer (consumer_config.in ()); - consumer_config->destroy (); + Components::CCMHome_var home = Components::CCMHome::_narrow (this->instances_[k]->ref.in ()); + this->instances_[k]->container->ref->remove_home (home.in ()); - if (CIAO::debug_level () > 6) + DANCE_DEBUG ((LM_INFO, DLINFO "NodeApplication_Impl::remove_components - " + "Successfully uninstalled home %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + } + catch (const CORBA::Exception &ex) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_es_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] connected.\n", - connection.endpointInstanceName.in (), - connection.endpointPortName.in (), - connection.instanceName.in (), - connection.portName.in ())); + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Caught CORBA exception removing home %C: %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + ex._info ().c_str ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + exception.reason = ex._info ().c_str ()); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::remove_components - " + "Caught unknown C++ exception from while removing home %C\n", + this->plan_.instance[this->instances_[k]->idd_idx].name.in ())); + test_and_set_exception (error, + exception, + this->plan_.instance[this->instances_[k]->idd_idx].name.in (), + "Unknown C++ exception"); } } - else // remove the connection + +if (error) + throw exception; +} + +NodeApplication_Impl::EInstanceType +NodeApplication_Impl::get_instance_type (const Deployment::Properties& prop) const +{ + DANCE_TRACE ("NodeApplication_Impl::get_instance_type"); + + for (CORBA::ULong i = 0; i < prop.length (); ++i) { - event_service->disconnect_event_consumer (cid.c_str ()); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::get_instance_type - " + "Checking property %C\n", + prop[i].name.in ())); - if (CIAO::debug_level () > 6) + if (ACE_OS::strcmp (prop[i].name.in (), + DAnCE::HOME_FACTORY) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::get_instance_type - " + "Found Home type\n")); + return eHome; + } + if (ACE_OS::strcmp (prop[i].name.in (), + DAnCE::COMPONENT_FACTORY) == 0) { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - NodeApplication_Impl.cpp, " - "CIAO::NodeApplication_Impl::handle_es_consumer_connection\n" - "[INSTANCE:PORT] : [%s:%s] --> [%s:%s] disconnected.\n", - connection.endpointInstanceName.in (), - connection.endpointPortName.in (), - connection.instanceName.in (), - connection.portName.in ())); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::get_instance_type - " + "Found unmanaged component type.\n")); + return eComponent; + } + if (ACE_OS::strcmp (prop[i].name.in (), + DAnCE::EXPLICIT_HOME) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_Impl::get_instance_type - " + "Found explicit home component type.\n")); + return eHomedComponent; } } + + DANCE_ERROR ((LM_INFO, DLINFO "NodeApplication_Impl::get_instance_type - " + "Unable to determine instance type\n")); + return eInvalid; } -// Below code is not used at this time. void -CIAO::NodeApplication_Impl::build_event_connection ( - const Deployment::Connection & connection, - bool add_or_remove) +NodeApplication_Impl::create_config_values (const Deployment::Properties& /*prop*/, + const ERequestType request, + Components::ConfigValues& /*cfg*/) const { - ACE_DEBUG ((LM_DEBUG, "CIAO::NodeApplication_Impl::build_connection ()!!!\n")); - - ACE_DEBUG ((LM_DEBUG, "instanceName: %s\n", connection.instanceName.in ())); - ACE_DEBUG ((LM_DEBUG, "portName: %s\n", connection.portName.in ())); - - ACE_DEBUG ((LM_DEBUG, "consumer Component Name: %s\n", connection.endpointInstanceName.in ())); - ACE_DEBUG ((LM_DEBUG, "consumer Port Name: %s\n", connection.endpointPortName.in ())); - - ACE_DEBUG ((LM_DEBUG, "portkind: ")); - switch (connection.kind) { - case Deployment::Facet: ACE_DEBUG ((LM_DEBUG, "Facet\n")); break; - case Deployment::SimplexReceptacle: ACE_DEBUG ((LM_DEBUG, "SimplexReceptacle\n")); break; - case Deployment::MultiplexReceptacle: ACE_DEBUG ((LM_DEBUG, "MultiplexReceptacle\n")); break; - case Deployment::EventEmitter: ACE_DEBUG ((LM_DEBUG, "EventEmitter\n")); break; - case Deployment::EventPublisher: ACE_DEBUG ((LM_DEBUG, "EventPublisher\n")); break; - case Deployment::EventConsumer: ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); break; + DANCE_TRACE ("NodeApplication_Impl::create_config_values"); + + //unsigned int ind = 0; + CORBA::Any_var feature_any; + switch (request) + { + case eCreateComponentServer: + { + break; + } + case eCreateContainer: + { + + break; + } + case eInstallHome: + { + break; + } default: - ACE_DEBUG ((LM_DEBUG, "Unknow\n")); break; + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::create_config_values - " + "request is not a know type: eCreateComponentServer, eCreateContainer, " + "eInstallHome, eCreateComponentWithConfigValues\n")); + throw ::Deployment::InvalidProperty("", + "Invalid creation type for filling in config values"); + } } +} - const CIAO::CIAO_Event_Service_ptr event_service = - connection.event_service; +Deployment::Connections* +NodeApplication_Impl::getAllConnections() +{ + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - started\n")); + Deployment::Connections_var conn; + ACE_NEW_THROW_EX (conn, + Deployment::Connections (), + CORBA::NO_MEMORY ()); + unsigned int index = 0; + /* + this->redirection_.registration_start (this->node_name_, this->plan_.UUID.in()); + + CCMObjects registration + for (TComponents::iterator it = this->components_.begin(); + !it.done(); + ++it) + { + this->redirection_.registration (this->node_name_, + this->plan_.UUID.in(), + (*it).ext_id_, + (*it).int_id_.in()); - // Get the consumer port object reference and put it into "consumer" - Components::EventConsumerBase_var consumer = - Components::EventConsumerBase::_narrow (connection.endpoint.in ()); + }*/ + for (unsigned int i = 0; i < this->plan_.connection.length(); i++) + { + for (unsigned int j = 0; j < this->plan_.connection[i].internalEndpoint.length(); j++) + { + if (this->plan_.connection[i].internalEndpoint[j].provider) + { + index = conn->length (); + conn->length (index + 1); + (*conn) [index].name = CORBA::string_dup (this->plan_.connection[i].name.in()); + + ACE_CString inst_name = + this->plan_.instance[this->plan_.connection[i].internalEndpoint[j].instanceRef].name.in(); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_Impl::getAllConnections() - " + "Found provider '%C' for connection '%C'\n", + this->plan_.connection[i].name.in (), + inst_name.c_str ())); + + Components::CCMObject_var obj = + Components::CCMObject:: + _narrow (this->instances_[this->plan_.connection[i].internalEndpoint[j].instanceRef]->ref.in ()); + + (*conn) [index].endpoint.length (1L); + // ACE_CString path = CCMObjectLocator::TreeNode::mergePath (inst_name.c_str() + // , this->plan_.connection[i].internalEndpoint[j].portName.in()); + switch (this->plan_.connection[i].internalEndpoint[j].kind) + { + case Deployment::Facet: + { + try + { + ACE_CString name = this->plan_.connection[i].internalEndpoint[j].portName.in(); + if (name.compare ("supports") != 0) + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - " + "provide_facet for connection %C endpoint %C started\n", + this->plan_.connection[i].name.in(), + this->plan_.connection[i].internalEndpoint[j].portName.in())); + CORBA::String_var facet_name = CORBA::string_dup (name.c_str()); + (*conn) [index].endpoint[0] = obj->provide_facet (facet_name.in()); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - " + "provide_facet for connection %C endpoint %C finished\n", + this->plan_.connection[i].name.in(), + this->plan_.connection[i].internalEndpoint[j].portName.in())); + } + else + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - " + "provide_facet for connection %C endpoint %C started\n", + this->plan_.connection[i].name.in(), + this->plan_.connection[i].internalEndpoint[j].portName.in())); + (*conn) [index].endpoint[0] = CORBA::Object::_duplicate (obj.in()); + } + /* this->redirection_.registration (this->node_name_, + this->plan_.UUID.in(), + inst_name, + name, + (*conn) [index].endpoint[0].in());*/ + //app_node.addChild(path.c_str(), obj->provide_facet(facet_name)); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - provide_facet finished\n")); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::getAllConnections - " + "Components::CCMObject_var::provide_facet() returned " + "::Components::InvalidName exception for connection %C and port %C\n", + this->plan_.connection[i].name.in (), + this->plan_.connection[i].internalEndpoint[j].portName.in ())); + throw ::Deployment::InvalidProperty(this->plan_.connection[i].name.in (), + "Container returned InvalidName"); + } + break; + } + case Deployment::EventConsumer: + { + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - " + "get_consumer for connection %C endpoint %C started\n", + this->plan_.connection[i].name.in(), + this->plan_.connection[i].internalEndpoint[j].portName.in())); + (*conn) [index].endpoint[0] = obj->get_consumer (this->plan_.connection[i].internalEndpoint[j].portName.in()); + /*this->redirection_.registration (this->node_name_, + this->plan_.UUID.in(), + inst_name, + this->plan_.connection[i].internalEndpoint[j].portName.in(), + (*conn) [index].endpoint[0].in());*/ + + //app_node.addChild(path.c_str(), obj->get_consumer(this->plan_.connection[i].internalEndpoint[j].portName)); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - " + "get_consumer finished\n")); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::getAllConnections - " + "Components::CCMObject_var::get_consumer() returned " + "::Components::InvalidName exception for connection %C and port %C\n", + this->plan_.connection[i].name.in (), + this->plan_.connection[i].internalEndpoint[j].portName.in ())); + throw ::Deployment::InvalidProperty(this->plan_.connection[i].name.in (), + "Container returned InvalidName exception"); + } + break; + } + default: + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::getAllConnections - " + "Connection.InternalEndPoint.Kind is not a " + "Deployment::Facet or Deployment::EventConsumer\n")); + throw ::Deployment::InvalidProperty(this->plan_.connection[i].name.in (), + "Invalid connection type, should be Facet or EventConsumer"); + } + } + // index++; + } + } + } + /*this->redirection_.registration_finish (this->node_name_, this->plan_.UUID.in());*/ + //this->node_.registerObjects(this->plan_.UUID.in(), app_node); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::getAllConnections - finished\n")); + return conn._retn(); +} - if (CORBA::is_nil (consumer.in ())) - { - ACE_DEBUG ((LM_DEBUG, "Nil consumer port object reference\n")); - throw Deployment::InvalidConnection (); - } +void +NodeApplication_Impl::finishLaunch (const Deployment::Connections & providedReference, + ::CORBA::Boolean start) +{ + DANCE_TRACE ("NodeApplication_Impl::finishLaunch"); - // Get the supplier component object reference. - ACE_CString supplier_comp_name = connection.instanceName.in (); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "started for connections sequence with length: %d\n", + providedReference.length())); - ACE_DEBUG ((LM_DEBUG, "source component name is: %s\n", supplier_comp_name.c_str ())); - Component_State_Info comp_state; - if (this->component_state_map_.find (supplier_comp_name, comp_state) != 0) - { - ACE_DEBUG ((LM_DEBUG, "Nil source component object reference\n")); - throw Deployment::InvalidConnection (); - } +#ifdef GEN_OSTREAM_OPS + { + std::ostringstream pr_stream; + pr_stream << providedReference << std::endl; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::finishLaunch - Provided references: %s", + pr_stream.str ().c_str ())); + } +#endif /* GEN_OSTREAM_OPS */ - // Get the consumer component object reference. - ACE_CString consumer_comp_name = connection.endpointInstanceName.in (); + for (unsigned int j = 0; j < this->plan_.connection.length(); ++j) + { + CORBA::ULong inst (this->plan_.connection[j].internalEndpoint[0].instanceRef); - ACE_DEBUG ((LM_DEBUG, "consumer component name is: %s\n", consumer_comp_name.c_str ())); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplication_impl::finishLaunch - " + "Connection %C, instance %u\n", + this->plan_.connection[j].name.in (), + inst)); - if (CORBA::is_nil (event_service)) +#ifdef GEN_OSTREAM_OPS { - ACE_DEBUG ((LM_DEBUG, "Nil event_service\n")); - throw Deployment::InvalidConnection (); + std::ostringstream conn_stream; + conn_stream << this->plan_.connection[j] << std::endl; + DANCE_DEBUG ((LM_TRACE, "NodeApplication_impl::finishLaunch - Local connections: %s", conn_stream.str ().c_str ())); } +#endif /* GEN_OSTREAM_OPS */ - // supplier ID - ACE_CString sid (connection.instanceName.in ()); - sid += "_"; - sid += connection.portName.in (); + Components::CCMObject_var obj = + Components::CCMObject:: + _narrow (this->instances_[inst]->ref.in ()); - // consumer ID - ACE_CString cid (connection.endpointInstanceName.in ()); - cid += "_"; - cid += connection.endpointPortName.in (); - cid += "_consumer"; + if (CORBA::is_nil (obj.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - " + "Unable to narrow apparent component instance reference to CCMObject for instance '%C'\n", + this->plan_.instance[inst].name.in ())); + throw Deployment::InvalidConnection (this->plan_.instance[inst].name.in (), + "Unable to narrow apparent component instance reference to CCMObject\n"); + } - //ACE_DEBUG ((LM_DEBUG, "Publisher: %s\n", sid.c_str ())); - ACE_DEBUG ((LM_DEBUG, "Subscriber: %s\n", cid.c_str ())); + const ::Deployment::PlanConnectionDescription &conn = this->plan_.connection[j]; + ACE_CString name = conn.name.in(); - if (add_or_remove == true) - { - CIAO::Supplier_Config_var supplier_config = - event_service->create_supplier_config (); + for (unsigned int i = 0; i < providedReference.length(); ++i) + { + /*DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "loop on all connections iteration %d for connection %C\n", + i, + providedReference[i].name.in()));*/ - supplier_config->supplier_id (sid.c_str ()); - event_service->connect_event_supplier (supplier_config.in ()); - supplier_config->destroy (); + if (name.compare (providedReference[i].name.in()) == 0) + { + try + { + switch (conn.internalEndpoint[0].kind) + { + case Deployment::Facet: + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "set for facet %C \n", name.c_str ())); + Components::CCMObject_var ext_inst; + try + { + if (0 == conn.externalReference.length()) + { + if (conn.internalEndpoint.length () == 2 && + (conn.internalEndpoint[1].kind == Deployment::MultiplexReceptacle || + conn.internalEndpoint[1].kind == Deployment::SimplexReceptacle)) + { + obj = Components::CCMObject:: + _narrow (this->instances_[conn.internalEndpoint[1].instanceRef]->ref.in ()); + + this->connect_receptacle (obj.in (), + conn.internalEndpoint[1].portName.in(), + providedReference[i].endpoint[0].in()); + } + /* + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - " + "Unsupported facet connection; lacks either external reference or " + "multiple internalEndpoints.\n")); + throw ::Deployment::StartError (name.c_str (), + "Unsupported facet connection; lacks either external reference " + "or multiple internalEndpoints.\n"); + */ + break; + } + CORBA::Object_var tmp = + this->orb_->string_to_object (conn.externalReference[0].location.in()); + ext_inst = Components::CCMObject::_narrow (tmp); + if (CORBA::is_nil (ext_inst.in())) + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - " + "facet for %C can't be narrowed \n", name.c_str ())); + break; + } + this->connect_receptacle_ext (ext_inst, + conn.externalReference[0].portName.in(), + providedReference[i].endpoint[0].in()); + } + catch (const CORBA::OBJECT_NOT_EXIST&) + { + // @@TODO: Shouldn't this be an error?!? + break; + } + catch (const CORBA::TRANSIENT&) + { + // @@TODO: Shouldn't this be an error?!? + break; + } + + break; + } + case Deployment::EventConsumer: + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - set for consumer \n")); + Components::CCMObject_var ext_inst; + try + { + if (0 == conn.externalReference.length()) + { + break; + } + CORBA::Object_var tmp = + this->orb_->string_to_object (conn.externalReference[0].location.in()); + ext_inst = Components::CCMObject::_narrow (tmp); + if (CORBA::is_nil (ext_inst.in())) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "reference for %C can't be narrowed \n", name.c_str ())); + throw ::Deployment::InvalidConnection(conn.name.in (), + "Couldn't narrow reference for external reference"); + break; + } + try + { + // Check is connection kind is consumer to emitter? + this->connect_emitter_ext (ext_inst, + conn.externalReference[0].portName.in(), + providedReference[i].endpoint[0].in()); + } + catch (const ::Components::InvalidName&) + { + // No this is consumer to publisher + this->connect_publisher (ext_inst, + conn.externalReference[0].portName.in(), + providedReference[i].endpoint[0].in()); + } + } + catch (const CORBA::OBJECT_NOT_EXIST&) + { + break; + } + catch (const CORBA::TRANSIENT&) + { + break; + } + break; + } + case Deployment::MultiplexReceptacle: + case Deployment::SimplexReceptacle: + { + // What we should do with Cookie, returned from connect call??? + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - set for receptacle \n")); + this->connect_receptacle (obj.in(), + conn.internalEndpoint[0].portName.in(), + providedReference[i].endpoint[0].in()); + break; + } + case Deployment::EventEmitter: + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - set for emitter \n")); + this->connect_emitter (obj.in(), + conn.internalEndpoint[0].portName.in(), + providedReference[i].endpoint[0].in()); + break; + } + case Deployment::EventPublisher: + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - set for publisher \n")); + this->connect_publisher (obj.in(), + conn.internalEndpoint[0].portName.in(), + providedReference[i].endpoint[0].in()); + break; + } + default: + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - currect Connection.InternalEndPoint.Kind " + "is not a Deployment::SimplexReceptacle, Deployment::EventEmitter, Deployment::EventPublisher " + "(Connection:%C Kind:%i PortName:%C)\n", + conn.name.in(), + conn.internalEndpoint[0].kind, + conn.internalEndpoint[0].portName.in() + )); + throw ::Deployment::InvalidConnection(conn.name.in (), + "Invalid connection type, should be Receptacle or even producer."); + }//default + }//switch + } + catch (::Deployment::StartError &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - " + "Intercepted StartError exception while configuring %C conneciton, rethrowing\n", + name.c_str ())); + ex.name = name.c_str (); + throw; + } + catch (::Deployment::InvalidConnection &ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_impl::finishLaunch - " + "Intercepted InvalidConnection exception while configuring %C conneciton, rethrowing\n", + name.c_str ())); + ex.name = name.c_str (); + throw; + } + }//if(name.compare(providedReference[i].name.in()) == 0) + }//for ( unsigned int i = 0; i < providedReference.length(); ++i ) + }//for ( unsigned int j = 0; j < this->plan_.connection.length(); ++j ) + + this->configuration_complete_components (); + + if (start) + { + this->start(); + } - CIAO::Consumer_Config_var consumer_config = - event_service->create_consumer_config (); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - finished\n")); +} - consumer_config->consumer_id (cid.c_str ()); - consumer_config->consumer (consumer.in ()); +Components::Cookie* +NodeApplication_Impl::connect_receptacle (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr facet) +{ + Components::Cookie* res = 0; + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "connect SimplexReceptacle for %C started\n", port_name.c_str())); + res = inst->connect (port_name.c_str(), facet); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - connect finished\n")); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::InvalidName exception\n")); + throw ::Deployment::StartError("", + "Received InvalidName exception while connecting receptacle."); + } + catch (const ::Components::InvalidConnection& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::InvalidConnection exception\n")); + throw ::Deployment::InvalidConnection("", + "InvalidConnection caught while connecting receptacle."); + } + catch (const ::Components::AlreadyConnected& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::AlreadyConnected exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught AlredyConnected exception while connecting receptacle"); + } + catch (const ::Components::ExceededConnectionLimit& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::ExceededConnectionLimit exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught ExceededConnectionLimit exception while connecting receptacle."); + } + return res; +} - event_service->connect_event_consumer (consumer_config.in ()); +Components::Cookie* +NodeApplication_Impl::connect_receptacle_ext (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr facet) +{ + Components::Cookie* res = 0; + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "connect SimplexReceptacle for %C started\n", port_name.c_str())); + res = inst->connect (port_name.c_str(), facet); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - connect finished\n")); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::InvalidName exception\n")); + throw ::Deployment::StartError("", + "Caught InvalidName exception while connecting external receptacle."); + } + catch (const ::Components::InvalidConnection& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::InvalidConnection exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught InvalidConnection exception while connecting external receptacle."); + } + catch (const ::Components::AlreadyConnected& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::AlreadyConnected exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught AlreadyConnected exception while connecting external receptacle."); + } + catch (const ::Components::ExceededConnectionLimit& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect() returned ::Components::ExceededConnectionLimit exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught ExceededConnectionLimit while connecting external receptacle."); + } + return res; +} - consumer_config->destroy (); - } - else - { - event_service->disconnect_event_supplier (sid.c_str ()); - event_service->disconnect_event_consumer (cid.c_str ()); - } +void +NodeApplication_Impl::connect_emitter (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer) +{ + Components::EventConsumerBase_var event = Components::EventConsumerBase::_unchecked_narrow (consumer); + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "connect_consumer for %C started\n", port_name.c_str())); + inst->connect_consumer (port_name.c_str(), event); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "connect_consumer finished\n")); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect_consumer() returned ::Components::InvalidName exception\n")); + throw ::Deployment::StartError("", + "Caught InvalidName while connecting emitter."); + } + catch (const ::Components::AlreadyConnected& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect_consumer() returned ::Components::AlreadyConnected exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught AlreadyConnected exception while connecting emitter"); + } + catch (const ::Components::InvalidConnection& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect_consumer() returned ::Components::InvalidConnection exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught InvalidConnection while connecting emitter."); + } +} - ACE_DEBUG ((LM_DEBUG, "CIAO::NodeApplication_Impl::build_connection () completed!!!!\n")); +void +NodeApplication_Impl::connect_emitter_ext (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer) +{ + Components::EventConsumerBase_var event = Components::EventConsumerBase::_unchecked_narrow (consumer); + try + { + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - " + "connect_emitter_ext for %C started\n", port_name.c_str())); + inst->connect_consumer (port_name.c_str(), event); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - connect_emitter_ext finished\n")); + } + catch (const ::Components::AlreadyConnected& ) + { + DANCE_DEBUG ( (LM_WARNING, "NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect_consumer() returned ::Components::AlreadyConnected exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught AlreadyConnected exception while connecting external emitter."); + } + catch (const ::Components::InvalidConnection& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::connect_consumer() returned ::Components::InvalidConnection exception\n")); + throw ::Deployment::InvalidConnection("", + "Caught InvalidConnection exception while connecting external emitter."); + } } -bool -CIAO::NodeApplication_Impl:: -_is_es_consumer_conn (Deployment::Connection conn) +Components::Cookie* +NodeApplication_Impl::connect_publisher (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer) { - if (conn.kind == Deployment::EventConsumer && - ACE_OS::strcmp (conn.endpointPortName, "CIAO_ES") == 0) - return true; - else - return false; + DANCE_TRACE ("NodeApplication_Impl::connect_publisher"); + + if (CORBA::is_nil (inst)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NodeApplication_Impl::connect_publisher - " + "Provided a nil CCMObject reference while connecting port %C\n", + port_name.c_str ())); + throw ::Deployment::InvalidConnection (); + } + Components::Cookie* res = 0; + Components::EventConsumerBase_var event = Components::EventConsumerBase::_unchecked_narrow (consumer); + try + { + res = inst->subscribe (port_name.c_str(), event); + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplication_impl::finishLaunch - successfully subscribed %C\n", + port_name.c_str ())); + } + catch (const ::Components::InvalidName& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::subscribe() returned ::Components::InvalidName exception\n")); + throw ::Deployment::StartError("", "Caught InvalidName exception while connecting publisher"); + } + catch (const ::Components::InvalidConnection& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::subscribe() returned ::Components::InvalidConnection exception\n")); + throw ::Deployment::InvalidConnection("", "Caught InvalidConnection exception while connecting publisher."); + } + catch (const ::Components::ExceededConnectionLimit& ) + { + DANCE_ERROR((LM_ERROR, DLINFO " NodeApplication_impl::finishLaunch - " + "Components::CCMObject_var::subscribe() returned ::Components::ExceededCOnnectionLimit exception\n")); + throw ::Deployment::InvalidConnection("", "Caught ExceededConnectionLimit exception while connecting publisher."); + } + return res; } -bool -CIAO::NodeApplication_Impl:: -_is_publisher_es_conn (Deployment::Connection conn) +void NodeApplication_Impl::create_config_values(const Deployment::Properties& prop, + Components::ConfigValues& cfg) const { - if (conn.kind == Deployment::EventPublisher && - ACE_OS::strcmp (conn.endpointPortName, "CIAO_ES") == 0) - return true; - else - return false; + ACE_CString cdmw_name = "cdmw.config."; + CORBA::ULong len = prop.length(); + unsigned int ind = 0; + for (CORBA::ULong i = 0; i < len; ++i) + { + ACE_CString s = prop[i].name.in(); + if (0 == s.find(cdmw_name)) + { + cfg.length(ind+1); + cfg[ind++] = new CIAO::ConfigValue_impl (s.substring(cdmw_name.length()).c_str(), prop[i].value); + } + } } + diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h index 70d5c1ee0fd..4bc3246d3a2 100644 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h +++ b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h @@ -1,315 +1,212 @@ -//$Id$ +// -*- C++ -*- -/**======================================================== +//============================================================================= +/** + * @file NodeApplication_Impl.h * - * @file NodeApplication_Impl.h + * $Id$ * - * @Brief This file contains the implementation of - * the NodeApplication interface. + * @Brief Implementation of Deployment::NodeApplication * - * @author Tao Lu <lu@dre.vanderbilt.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> - *========================================================*/ + * @author Erwin Gottlieb <eg@prismtech.com> + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ +//============================================================================= -#ifndef NODEAPPLICATION_IMPL_H -#define NODEAPPLICATION_IMPL_H -#include /**/ "ace/pre.h" -#include "CIAO_NodeApplication_export.h" +#ifndef NODEAPPLICATION_IMPL_H_ +#define NODEAPPLICATION_IMPL_H_ -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "NodeApplication_Export.h" -#include "ace/Synch.h" -#include "ace/Synch_Traits.h" -#include "ace/SString.h" -#include "ace/Hash_Map_Manager_T.h" +#include "ace/Map_Manager.h" +#include "ace/Containers_T.h" #include "tao/ORB.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationS.h" -#include "ciao/Server_init.h" -#include "ciao/CIAO_common.h" -#include "ciao/Object_Set_T.h" -#include "ciaosvcs/Events/CIAO_EventService_Factory_impl.h" -#include "ciaosvcs/Events/CIAO_Events_Base/CIAO_EventsS.h" - -#include "NodeApp_Configurator.h" -#include "Session_Container.h" +#include "tao/Object.h" +#include "ccm/CCM_KeylessCCMHomeC.h" +#include "ccm/ComponentsC.h" +#include "RedirectionService/RedirectionService.h" +#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" +//#include "Cdmw/CDMW_IDLC.h" + +#include "ccm/ComponentServer/CCM_ComponentServerC.h" +#include "Deployment/Deployment_NodeApplicationS.h" +#include "Deployment/Deployment_DeploymentPlanC.h" +#include "Deployment/DeploymentC.h" +#include "Deployment/Deployment_common.h" + +//#include "ComponentInstallation_Impl.h" +namespace DAnCE +{ -using CIAO::Utility::write_IOR; + class NodeManager_Impl; -/** - * - * @class NodeApplication_Impl - * - * @brief This class implements the NodeApplication interface. - * This interface is semantically very simillar to container - * in the old DnC spec. However this class will also be used - * as a Server for hosting home/component. This way we reduce the - * complexity of the framework by omitting the componentserver layer. - * - * @@TODO add configuration capabilities. Threading is one of them. - * - * @@Assumptions: - * 1. Now the implementation is not thread safe. - * // @@Gan, the above assumption is _really_ bad. Could you please - * use the lock in the imeplementation to do some simple - * prootections. - **/ - -namespace CIAO -{ - // @@ Gan, as we discussed before can you please wrap this - // implementation in a namespace Node_Application or whatever to - // signify that it belongs to another software piece of CIAO? - class NODEAPPLICATION_Export NodeApplication_Impl - : public virtual POA_Deployment::NodeApplication + class NodeApplication_Export NodeApplication_Impl : public virtual POA_Deployment::NodeApplication { public: - enum Component_State - { - NEW_BORN, PRE_ACTIVE, ACTIVE, POST_ACTIVE, PASSIVE, DEACTIVATED - }; + NodeApplication_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + RedirectionService & redirection, + const ACE_CString& node_name, + const PROPERTY_MAP &properties); - typedef struct _component_state_info - { - Components::CCMObject_var objref_; - Component_State state_; - } Component_State_Info; - - NodeApplication_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - NodeApp_Configurator &c, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); - - /// Default destructor. - virtual ~NodeApplication_Impl (void); - - /** - * @brief This operation dose 2 things. - * 1. Get the external connction (facet and Event source) - * and connect them to the local receptacle/event sink. - * 2. If the start augment is true, start the Components. - * @Note: - * The connection containes the object ref of the provided object - * reference (facet/event consumer) of components from other NodeApplications. - * However the name field stores the name of the port on the local component. - */ - virtual void - finishLaunch (const Deployment::Connections & connections, - CORBA::Boolean start, - CORBA::Boolean add_connection); + virtual ~NodeApplication_Impl(); + + virtual void finishLaunch (const Deployment::Connections & providedReference, + ::CORBA::Boolean start); virtual void start (); - /*------------- CIAO specific IDL operations (idl)---------- - * - *-----------------------------------------------------------*/ + Deployment::Connections * getAllConnections(); - virtual void ciao_preactivate (); + //TODO Exception specification should be customized + void init_components(); - virtual void ciao_postactivate (); + void configuration_complete_components (); - virtual void ciao_passivate (); + void passivate_components (); - /// Initialize the NodeApplication - virtual CORBA::Long init (); + void remove_components (); - /// Start install homes and components. - virtual ::Deployment::ComponentInfos * - install (const ::Deployment::NodeImplementationInfo & node_impl_info); + enum ERequestType + { + eCreateComponentServer, + eCreateContainer, + eInstallHome, + eCreateComponentWithConfigValues + }; - /// Install a number of CIAO_Event_Service objects within the NA - virtual ::CIAO::CIAO_Event_Service * - install_es (const ::CIAO::DAnCE::EventServiceDeploymentDescription & es_info); + enum EInstanceType + { + eHome, + eComponent, + eHomedComponent, + eInvalid + }; - /// Get the object reference of the NodeApplicationManager. - /// This might come in handy later. - virtual ::CORBA::Object_ptr get_node_application_manager (); + enum EComponentState + { + eUninstalled, + eInstalled, + eConfigured, + eActive, + ePassive, + eRemoved, + eInvalidState + }; + + + protected: + //TODO Add throw specification + void init(); - /// Access the readonly attribute. - virtual ::Deployment::Properties * properties (); + struct Container; - /// Remove a component instance from the NodeApplication - virtual void remove_component (const char * inst_name); + struct Instance + { + Instance (EInstanceType type = eInvalid, + Container *cont = 0, + CORBA::ULong idd = 0, + CORBA::ULong mdd = 0) : + state (eUninstalled), + type (type), idd_idx (idd), mdd_idx (mdd), home(0), + container (cont) + { + } + + EComponentState state; + EInstanceType type; + CORBA::ULong idd_idx; + CORBA::ULong mdd_idx; + CORBA::Object_var ref; + Instance *home; + Container *container; + }; - virtual void activate_component (const char * name); + typedef ACE_Array<Instance> INSTANCES; + typedef ACE_Array<Instance *> INSTANCE_PTRS; - virtual void passivate_component (const char * name); + struct Container + { + INSTANCES homes; + INSTANCES components; + Deployment::Properties properties; + Components::Deployment::Container_var ref; + }; - /// Remove everything inside including all components and homes. - virtual void remove (); + typedef ACE_Array<Container> CONTAINERS; - /// Create a container interface, which will be hosted in this NodeApplication. - virtual ::Deployment::Container_ptr - create_container (const ::Deployment::Properties &properties); + struct ComponentServer + { + CONTAINERS containers; + Deployment::Properties properties; + Components::Deployment::ComponentServer_var ref; + }; - /// Remove a container interface. - virtual void remove_container (::Deployment::Container_ptr cref); + typedef ACE_Array<ComponentServer> COMPONENTSERVERS; - /// Get all container object refs - virtual ::Deployment::Containers * get_containers (); + EInstanceType get_instance_type (const Deployment::Properties& prop) const; - /*------------- CIAO specific helper functions (C++)--------- - * - *-----------------------------------------------------------*/ + void create_config_values (const Deployment::Properties& prop, + const ERequestType request, + Components::ConfigValues& cfg) const; - /// Get the containing POA. This operation does *not* - /// increase the reference count of the POA. - virtual PortableServer::POA_ptr _default_POA (void); + void create_config_values(const Deployment::Properties& prop, + Components::ConfigValues& cfg) const; - /// Return the cached object reference of this NodeApplication object. - /// This operation does *NOT* increase the reference count. - ::Deployment::NodeApplication_ptr - get_objref (); + void create_component_server (size_t index); - /*------- CIAO helper functions for pub/sub service ------- - * - *--------------------------------------------------------*/ + void create_container (size_t server, size_t container); - /// Set up a connection using the CIAO_Event_Service, which - /// is available as a field in the <Deployment::Connection> - /// struct type. - /// If <add_or_remove> input parameter is true, then we will - /// add the event connection, otherwise we will remove the - /// event connection. - void build_event_connection ( - const Deployment::Connection & connection, - bool add_or_remove); + void install_home (Container &cont, Instance &inst); - protected: - /// If <add_connection> is "false", then we shall "remove" - /// the connections, otherwise we will add these connections. - virtual void - finishLaunch_i (const Deployment::Connections & connections, - CORBA::Boolean start, - CORBA::Boolean add_connection); - virtual void - handle_facet_receptable_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection); - - virtual void - handle_emitter_consumer_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection); - - virtual void - handle_publisher_consumer_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection); - - virtual bool - _is_es_consumer_conn (Deployment::Connection conn); - - virtual bool - _is_publisher_es_conn (Deployment::Connection conn); - - /// Register the publisher to the CIAO event service - /// The only fields of <connection> struct used in this method - /// are: <type>, <event_service>, <instanceName>, <portName>. - virtual void - handle_publisher_es_connection ( - Components::CCMObject_ptr comp, - const Deployment::Connection & connection, - CORBA::Boolean add_connection); - - /// Register the consumer to the CIAO event service - virtual void - handle_es_consumer_connection ( - const Deployment::Connection & connection, - CORBA::Boolean add_connection); - - /// Create and initialize all the containers - virtual CORBA::Long create_all_containers ( - const ::Deployment::ContainerImplementationInfos & container_infos); - - /// Create a "key" for the connection - virtual ACE_CString * - create_connection_key (const Deployment::Connection & connection); - - /// To build a map between a component instance and its container - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Deployment::Container_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Component_Container_Map; - typedef Component_Container_Map::iterator Component_Container_Iterator; - Component_Container_Map component_container_map_; - - - /// To store all created Component objects as well as their lifecycle - /// states.. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Component_State_Info, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMComponent_Map; - typedef CCMComponent_Map::iterator Component_Iterator; - CCMComponent_Map component_state_map_; - - /// A Map which stores all the connection cookies - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ::Components::Cookie_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Cookie_Map; - typedef Cookie_Map::iterator Cookie_Map_Iterator; - Cookie_Map cookie_map_; - - /// Synchronize access to the object set. - TAO_SYNCH_MUTEX lock_; - - /// Keep a list of managed Container objects. - Object_Set<Deployment::Container, Deployment::Container_var> container_set_; - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; + void install_component (Container &cont, Instance &inst); - /// Keep a pointer to the managing POA. - // @@Gan/Jai, which POA is this? Same as the component POA or a - // different one. My sense is that its different. Could you please - //document it? - PortableServer::POA_var poa_; + void install_homed_component (Container &cont, Instance &inst); + + void store_instance_ior (Instance &inst); + + Components::Cookie* connect_receptacle (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr facet); + + Components::Cookie* connect_receptacle_ext (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr facet); + + void connect_emitter (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer); - // Configurator for allocating NodeApp resources and policies - NodeApp_Configurator &configurator_; + void connect_emitter_ext (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer); - /// Cached properties - Deployment::Properties properties_; + Components::Cookie* connect_publisher (Components::CCMObject_ptr inst, + const ACE_CString& port_name, + CORBA::Object_ptr consumer); - /// And a reference to the NodeApplicationManager that created us. - ::CORBA::Object_var node_app_manager_; + CORBA::ORB_var orb_; - /// Cache the object reference (of ourselves). - ::Deployment::NodeApplication_var objref_; + PortableServer::POA_var poa_; - /// A factory to create CIAO event services - EventService_Factory_impl es_factory_; + const Deployment::DeploymentPlan& plan_; - /// Cache the (NA specific) installation info of all the - /// CIAO_Event_Services - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - DAnCE::EventServiceDeploymentDescriptions_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> ES_Installation_Map; - typedef ES_Installation_Map::iterator ES_Installation_Map_Iterator; - ES_Installation_Map es_info_map_; + //ComponentInstallation_Impl* installation_; + auto_ptr<CIAO::Deployment::CIAO_ServerActivator_i> activator_; - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - private: - /// Default constructor, noop - NodeApplication_Impl(void); - }; -} + RedirectionService & redirection_; -#if defined (__ACE_INLINE__) -# include "NodeApplication_Impl.inl" -#endif /* __ACE_INLINE__ */ + ACE_CString node_name_; -#include /**/ "ace/post.h" -#endif /* NODEAPPLICATION_IMPL_H */ + PROPERTY_MAP properties_; + + COMPONENTSERVERS servers_; + + INSTANCE_PTRS instances_; + + CosNaming::NamingContext_var instance_nc_; + }; +}; +#endif /*NODEAPPLICATION_IMPL_H_*/ diff --git a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.inl b/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.inl deleted file mode 100644 index 07438304994..00000000000 --- a/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.inl +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -#include "Configurator_Factory.h" - -ACE_INLINE -CIAO::NodeApplication_Impl:: -NodeApplication_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - NodeApp_Configurator &c, - const Static_Config_EntryPoints_Maps* static_entrypts_maps) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - configurator_ (c), - es_factory_ (o, p), - static_entrypts_maps_ (static_entrypts_maps) -{ -} - -// Access the readonly attribute -ACE_INLINE -Deployment::Properties * -CIAO::NodeApplication_Impl::properties () -{ - Deployment::Properties * tmp = 0; - - ACE_NEW_THROW_EX (tmp, - Deployment::Properties (this->properties_), - CORBA::NO_MEMORY ()); - - return tmp; -} - -ACE_INLINE -PortableServer::POA_ptr -CIAO::NodeApplication_Impl::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - - -ACE_INLINE -CORBA::Object_ptr -CIAO::NodeApplication_Impl::get_node_application_manager () -{ - return ::CORBA::Object::_duplicate (this->node_app_manager_.in ()); -} - -/* -ACE_INLINE void -CIAO::NodeApplication_Impl:: -set_objref (Components::Deployment::ServerActivator_ptr act, - const Components::ConfigValues &config, - Components::Deployment::ComponentServer_ptr cs) -{ - if (!CORBA::is_nil (this->node_app_manager_.in ()) || - !CORBA::is_nil (this->objref_.in ())) - throw CORBA::BAD_INV_ORDER (); - - this->config_ = new Components::ConfigValues (config); - this->activator_ = Components::Deployment::ServerActivator::_duplicate (act); - this->objref_ = Components::Deployment::ComponentServer::_duplicate (cs); -} -*/ - -ACE_INLINE ::Deployment::NodeApplication_ptr -CIAO::NodeApplication_Impl:: -get_objref () -{ - if (CORBA::is_nil (this->objref_.in ())) - { - this->objref_ = this->_this (); - } - - return this->objref_.in (); -} diff --git a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp b/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp deleted file mode 100644 index 0f400349237..00000000000 --- a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp +++ /dev/null @@ -1,513 +0,0 @@ -// $Id$ - -#include "RTConfig_Manager.h" -#include "ciao/CIAO_common.h" -#include "ace/SString.h" - -#if !defined (__ACE_INLINE__) -# include "RTConfig_Manager.inl" -#endif /* __ACE_INLINE__ */ - -void -CIAO::RTResource_Config_Manager::init (CORBA::ORB_ptr orb) -{ - CORBA::Object_var object = - orb->resolve_initial_references ("RTORB"); - this->rtorb_ = RTCORBA::RTORB::_narrow (object.in ()); -} - -int -CIAO::RTResource_Config_Manager::pre_orb_initialize (void) -{ - return 0; -} - -int -CIAO::RTResource_Config_Manager::post_orb_initialize (CORBA::ORB_ptr) -{ - return 0; -} - -void -CIAO::RTResource_Config_Manager::print_resources -(const CIAO::DAnCE::ServerResource &server_resource) -{ - const CIAO::DAnCE::ORBResource &orb_resource - = server_resource.orb_config.orb_resources[0]; - - CORBA::ULong i; - - // Creating and binding name with RT Threadpool - for (i = 0; i < orb_resource.threadpool_list.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, - "-RTResource_Config_Manager::print_resource threadpool: %s\n" - "\tStack size: %d\n" - "\tStatic: %d\n" - "\tDynamic %d\n" - "\tDefault Prio: %d\n" - "\tBuffering %s\n" - "\tMax Buffered: %d\n" - "\tBuffer Size %d\n", - orb_resource.threadpool_list[i].Id.in (), - orb_resource.threadpool_list[i].stacksize, - orb_resource.threadpool_list[i].static_threads, - orb_resource.threadpool_list[i].dynamic_threads, - orb_resource.threadpool_list[i].default_priority, - (orb_resource.threadpool_list[i].allow_request_buffering ? "Y" : "N"), - orb_resource.threadpool_list[i].max_buffered_requests, - orb_resource.threadpool_list[i].max_request_buffer_size)); - } - - for (i = 0; i < orb_resource.threadpool_with_lanes_list.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, - "-RTResource_Config_Manager::print_resource threadpool_with %d, lanes: %s\n", - orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (), - orb_resource.threadpool_with_lanes_list[i].Id.in ())); - - for (CORBA::ULong l = 0; - l < orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (); - ++l) - { - ACE_DEBUG ((LM_DEBUG, - "\tLane %d:\n" - "\t\tPriority: %d\n" - "\t\tStatic: %d\n" - "\t\tDynamic: %d\n", - l, - orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].lane_priority, - orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].static_threads, - orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].dynamic_threads)); - } - ACE_DEBUG ((LM_DEBUG, - "\tStack size: %d\n" - "\tBorrowing: %s\n" - "\tBuffering %s\n" - "\tMax Buffered: %d\n" - "\tBuffer Size %d\n", - orb_resource.threadpool_with_lanes_list[i].stacksize, - (orb_resource.threadpool_with_lanes_list[i].allow_borrowing ? "Y" : "N"), - (orb_resource.threadpool_with_lanes_list[i].allow_request_buffering ? "Y" : "N"), - orb_resource.threadpool_with_lanes_list[i].max_buffered_requests, - orb_resource.threadpool_with_lanes_list[i].max_request_buffer_size)); - } - - for (i = 0; i < orb_resource.connection_bands_list.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, - "-RTResource_Config_Manager::print_resource connection %d bands: %s\n", - orb_resource.connection_bands_list[i].bands.length (), - orb_resource.connection_bands_list[i].Id.in ())); - - for (CORBA::ULong l = 0; - l < orb_resource.connection_bands_list[i].bands.length (); - ++l) - { - ACE_DEBUG ((LM_DEBUG, - "\tBand %d Prio: %d -- %d\n", - l, - orb_resource.connection_bands_list[i].bands[l].low, - orb_resource.connection_bands_list[i].bands[l].high)); - } - } -} - -void -CIAO::RTResource_Config_Manager::init_resources -(const CIAO::DAnCE::ServerResource &server_resource) -{ - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource.\n")); - - if (CORBA::is_nil (this->rtorb_.in())) - { - ACE_ERROR ((LM_ERROR, - "RTResource_Config_Manager has not been properly initialized.\n")); - throw CORBA::INTERNAL (); - } - - this->print_resources (server_resource); - // return; - - const CIAO::DAnCE::ORBResource &orb_resource - = server_resource.orb_config.orb_resources[0]; - - CORBA::ULong i; - - // Creating and binding name with RT Threadpool - for (i = 0; i < orb_resource.threadpool_list.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource threadpool: %s\n", - orb_resource.threadpool_list[i].Id.in ())); - RTCORBA::ThreadpoolId thr_id = - this->rtorb_->create_threadpool - (orb_resource.threadpool_list[i].stacksize, - orb_resource.threadpool_list[i].static_threads, - orb_resource.threadpool_list[i].dynamic_threads, - orb_resource.threadpool_list[i].default_priority, - orb_resource.threadpool_list[i].allow_request_buffering, - orb_resource.threadpool_list[i].max_buffered_requests, - orb_resource.threadpool_list[i].max_request_buffer_size); - // Simply pass back the exception here - // for now. We need to have a better way - // to handle execption here. - if (this->threadpool_map_.bind (orb_resource.threadpool_list[i].Id.in (), - thr_id) != 0) - { - ACE_ERROR ((LM_ERROR, "Error binding thread pool Id: %s to map when initializing RTNodeApplication resources.\n", orb_resource.threadpool_list[i].Id.in ())); - throw CORBA::INTERNAL (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource added thread pool: %s\n", - orb_resource.threadpool_list[i].Id.in ())); - } - } - - for (i = 0; i < orb_resource.threadpool_with_lanes_list.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource threadpool_with %d, lanes: %s\n", - orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (), - orb_resource.threadpool_with_lanes_list[i].Id.in ())); - - // Duplicate RTCORBA lanes - RTCORBA::ThreadpoolLanes lanes - (orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length ()); - lanes.length (orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length ()); - - for (CORBA::ULong l = 0; - l < orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (); - ++l) - { - lanes[l].lane_priority - = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].lane_priority; - lanes[l].static_threads - = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].static_threads; - lanes[l].dynamic_threads - = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].dynamic_threads; - } - - RTCORBA::ThreadpoolId thr_id = - this->rtorb_->create_threadpool_with_lanes - (orb_resource.threadpool_with_lanes_list[i].stacksize, - lanes, - orb_resource.threadpool_with_lanes_list[i].allow_borrowing, - orb_resource.threadpool_with_lanes_list[i].allow_request_buffering, - orb_resource.threadpool_with_lanes_list[i].max_buffered_requests, - orb_resource.threadpool_with_lanes_list[i].max_request_buffer_size); - // Simply pass back the exception here - // for now. We need to have a better way - // to handle execption here. - - if (this->threadpool_map_.bind (orb_resource.threadpool_with_lanes_list[i].Id.in (), - thr_id) != 0) - { - ACE_ERROR ((LM_ERROR, - "Error binding thread pool name: %s to map when " - "initializing RTNodeApplication resources.\n", - orb_resource.threadpool_with_lanes_list[i].Id.in ())); - throw CORBA::INTERNAL (); - } - - else - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource added thread pool with lanes: %s\n", - orb_resource.threadpool_with_lanes_list[i].Id.in ())); - } - } - - for (i = 0; i < orb_resource.connection_bands_list.length (); ++i) - { - RTCORBA::PriorityBands - safebands(orb_resource.connection_bands_list[i].bands.length ()); - safebands.length (orb_resource.connection_bands_list[i].bands.length ()); - - for (CORBA::ULong l = 0; - l < orb_resource.connection_bands_list[i].bands.length (); - ++l) - { - safebands[l].low = orb_resource.connection_bands_list[i].bands[l].low; - safebands[l].high = orb_resource.connection_bands_list[i].bands[l].high; - } - - if (this->priority_bands_map_.bind (orb_resource.connection_bands_list[i].Id.in (), - safebands) != 0) - { - ACE_ERROR ((LM_ERROR, - "Error binding priority bands name: %s to map " - "when initializing RTNodeApplication resources.\n", - orb_resource.connection_bands_list[i].Id.in ())); - throw CORBA::INTERNAL (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource added connection bands: %s\n", - orb_resource.connection_bands_list[i].Id.in ())); - } - } - - // now initialize the policy set part of it. - // server_resource.orb_config.policy_set - const CIAO::DAnCE::PolicySets &sets = server_resource.orb_config.policy_set; - for (CORBA::ULong i = 0; i < sets.length (); ++i) - { - CORBA::ULong const np = sets[i].policies.length (); - if (np == 0) - continue; - - CORBA::PolicyList_var policy_list = new CORBA::PolicyList (np); - policy_list->length (np); - CORBA::ULong index = 0; - CORBA::ULong array_index = np; - - // Create a list of policies - for (CORBA::ULong pc = 0; pc < np; ++pc) - { - CORBA::Policy_var temp_policy = - this->create_single_policy (sets[i].policies[pc]); - if (CORBA::is_nil (temp_policy.in ())) - { - array_index = array_index - 1; - policy_list->length (array_index); - } - else - { - policy_list[index] = CORBA::Policy::_duplicate (temp_policy.in ()); - index = index + 1; - } - } - - // Bind the policy list to the name. The bind operation should - // surrender the ownership of the newly created PolicyList - // sequence to the map. - if (array_index != 0) - { - if (this->policy_map_.bind (sets[i].Id.in (), - policy_list._retn ()) != 0) - { - ACE_ERROR ((LM_ERROR, - "Error binding Policy_Set with name: %s\n", - sets[i].Id.in ())); - throw CORBA::INTERNAL (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource " - "added policy set: %s with %d policies\n", - sets[i].Id.in (), array_index)); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::init_resource " - "added policy set: %s with %d policies\n", - sets[i].Id.in (), array_index)); - } - } -} - -void -CIAO::RTResource_Config_Manager::fini () -{ - TP_MAP::ITERATOR iter = this->threadpool_map_.begin (); - TP_MAP::ITERATOR end = this->threadpool_map_.end (); - - for (; iter != end; ++iter) - { - this->rtorb_->destroy_threadpool ((*iter).int_id_); - } - -} - -RTCORBA::ThreadpoolId -CIAO::RTResource_Config_Manager::find_threadpool_by_name (const char *name) -{ - if (name == 0) - { - ACE_ERROR ((LM_ERROR, - "Invalid name string found in \"find_threadpool_by_name\"\n")); - throw CORBA::BAD_PARAM (); - } - - - RTCORBA::ThreadpoolId ret_id = 0; // return id - - if (this->threadpool_map_.find (name, ret_id) != 0) - { - ACE_ERROR ((LM_ERROR, - "Unable to find a threadpool named %s\n", - name)); - throw CORBA::INTERNAL (); - } - - return ret_id; -} - -RTCORBA::PriorityBands * -CIAO::RTResource_Config_Manager::find_priority_bands_by_name (const char *name) -{ - if (name == 0) - { - ACE_ERROR ((LM_ERROR, - "Invalid name string found in \"find_priority_bands_by_name\"\n")); - throw CORBA::BAD_PARAM (); - } - - PB_MAP::ENTRY *entry = 0; - - if (this->priority_bands_map_.find (name, entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "Unable to find a connection bands named %s\n", - name)); - throw CORBA::INTERNAL (); - } - - RTCORBA::PriorityBands_var retv = new RTCORBA::PriorityBands; - (*retv.ptr ()) = (*entry->int_id_.ptr ()); - return retv._retn (); -} - -bool -CIAO::RTResource_Config_Manager::policy_exists (const char *name) -{ - if (name == 0) - { - ACE_DEBUG ((LM_DEBUG, - "Invalid name string found in " - "CIAO::NAResource_Config_Manager::policy_exists\n")); - throw CORBA::INTERNAL (); - } - - POLICY_MAP::ENTRY *entry = 0; - - if (this->policy_map_.find (name, entry) != 0) - { - return false; - } - - return true; -} - -CORBA::PolicyList * -CIAO::RTResource_Config_Manager::find_policies_by_name (const char *name) -{ - if (name == 0) - { - ACE_ERROR ((LM_ERROR, - "Invalid name string found in \"find_policies_by_name\"\n")); - throw CORBA::BAD_PARAM (); - } - - - 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) - { - ACE_ERROR ((LM_ERROR, - "Unable to find a PolicyList named %s\n", - name)); - throw CORBA::INTERNAL (); - } - - // duplicate the sequence PolicyList. - CORBA::PolicyList_var retv = - new CORBA::PolicyList (entry->int_id_.in ()); - - ACE_DEBUG ((LM_DEBUG, "RTResource_Config_Manager::find_policies_by_name ok.\n")); - - return retv._retn (); -} - -CORBA::Policy_ptr -CIAO::RTResource_Config_Manager::create_single_policy -(const CIAO::DAnCE::PolicyDef &policy_def) -{ - // if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_DEBUG, - "RTResource_Config_Manager::create_single_policy: %d\n", - policy_def._d ())); - - CORBA::Policy_var retv; - - switch (policy_def._d ()) - { - case RTCORBA::PRIORITY_MODEL_POLICY_TYPE: - { - const CIAO::DAnCE::PriorityModelPolicyDef &tmp - = policy_def.PriorityModelDef (); - - retv = this->rtorb_->create_priority_model_policy ((RTCORBA::PriorityModel) tmp.priority_model, - tmp.server_priority); - - if (! CORBA::is_nil (retv.in ())) - ACE_DEBUG ((LM_DEBUG, - "Create PriorityModel policy: %d - %d\n", - tmp.priority_model, tmp.server_priority)); - } - break; - - case RTCORBA::THREADPOOL_POLICY_TYPE: - { - RTCORBA::ThreadpoolId tpid = - this->find_threadpool_by_name (policy_def.ThreadpoolDef().Id.in ()); - - retv = this->rtorb_->create_threadpool_policy (tpid); - - if (! CORBA::is_nil (retv.in ())) - ACE_DEBUG ((LM_DEBUG, - "Create Threadpool policy: %s, TPid: %d\n", - policy_def.ThreadpoolDef().Id.in (), tpid)); - } - break; - - case RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE: - { - RTCORBA::PriorityBands_var bands = - this->find_priority_bands_by_name (policy_def.PriorityBandedConnectionDef().Id.in ()); - - retv = - this->rtorb_->create_priority_banded_connection_policy (bands.in ()); - - if (! CORBA::is_nil (retv.in ())) - { - ACE_DEBUG ((LM_DEBUG, - "Created Banded Connection policy: %s\n", - policy_def.PriorityBandedConnectionDef().Id.in ())); - } - } - break; - - default: - retv = 0; - } - - return retv._retn (); -} - -CIAO::RTResource_Config_Manager::~RTResource_Config_Manager () -{ - this->fini (); -} - -extern "C" CIAO_RTNA_Configurator_Export CIAO::Config_Manager -*create_rt_config_manager (void); - -CIAO::Config_Manager * -create_rt_config_manager (void) -{ - CIAO::RTResource_Config_Manager *config; - ACE_NEW_RETURN (config, CIAO::RTResource_Config_Manager, 0); - return config; -} diff --git a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h b/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h deleted file mode 100644 index 53ca9de018a..00000000000 --- a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h +++ /dev/null @@ -1,134 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RTConfig_Manager.h - * - * $Id$ - * - * This file contains classes that manage name to configuration - * mapping info in a RTComponentServer. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - - -#ifndef CIAO_RTCONFIG_MANAGER_H -#define CIAO_RTCONFIG_MANAGER_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/RTCORBA/RTCORBA.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" -#include "ace/Null_Mutex.h" -#include "ace/SString.h" -#include "ace/Hash_Map_Manager_T.h" -#include "Config_Manager.h" -#include "RTNA_Configurator_Export.h" - -namespace CIAO -{ - /** - * @brief RTResource_Config_Manager maintains a collection of - * RTCORBA related resources. - * - * This class is responsible to create and manage a list of RTCORBA - * related resources that are global to an RT ComponentServer. The - * information required to create and configure these resources are - * passed in via the @a info argument in the @c init method. These - * resources are identified by names and can be used to associate - * these resources with related RTPolicies. These resources are - * destoryed along with this class. - * - * Currently, the only resources supported (and managed) by this - * class are Threadpool and Threadpool_with_Lanes. - */ - class RTResource_Config_Manager : public Config_Manager - { - public: - RTResource_Config_Manager (void); - ~RTResource_Config_Manager (void); - - virtual void init (CORBA::ORB_ptr orb); - - virtual int pre_orb_initialize (void); - - virtual int post_orb_initialize (CORBA::ORB_ptr o); - - /// Initializing the RTResource_Config_Manager - virtual void init_resources (const CIAO::DAnCE::ServerResource &info); - - /// Finalizing the RTResource_Config_Manager and the resources it - /// manages. - void fini (); - - /// Query a policy set by name - virtual CORBA::PolicyList *find_policies_by_name (const char *name); - - virtual bool policy_exists (const char *name); - - protected: - void print_resources (const CIAO::DAnCE::ServerResource &info); - - /// Query a thread pool by name. - RTCORBA::ThreadpoolId find_threadpool_by_name (const char *name); - - - /// Query a priority bands info by name. - RTCORBA::PriorityBands *find_priority_bands_by_name (const char *name); - - private: - /// Cached an ORB reference. - CORBA::ORB_var orb_; - - // Cached an RTORB reference. - RTCORBA::RTORB_var rtorb_; - - /// Hash_Map stuff. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - RTCORBA::ThreadpoolId, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> TP_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - RTCORBA::PriorityBands_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> PB_MAP; - - /// Internal TP name to id map. - TP_MAP threadpool_map_; - - /// Internal PB name to priority bands map. - PB_MAP priority_bands_map_; - - /// create a single policy - CORBA::Policy_ptr create_single_policy - (const CIAO::DAnCE::PolicyDef &policy_def); - - /// Hash_Map stuff. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - CORBA::PolicyList_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> POLICY_MAP; - - /// Internal TP names to id map. - POLICY_MAP policy_map_; - }; -} - -#if defined (__ACE_INLINE__) -# include "RTConfig_Manager.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_RTCONFIG_MANAGER_H */ - diff --git a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl b/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl deleted file mode 100644 index 7962506555d..00000000000 --- a/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl +++ /dev/null @@ -1,7 +0,0 @@ -// $Id$ - -ACE_INLINE -CIAO::RTResource_Config_Manager::RTResource_Config_Manager () -{ -} - diff --git a/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp b/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp deleted file mode 100644 index 04e7bd91f74..00000000000 --- a/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// $Id$ - -#include "RTNodeApp_Configurator.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" -#include "tao/RTPortableServer/RTPortableServer.h" - -CIAO::RTNodeApp_Configurator::~RTNodeApp_Configurator () -{ -} - -int -CIAO::RTNodeApp_Configurator::pre_orb_initialize () -{ - ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::pre_orb_init\n")); - - return 0; -} - -int -CIAO::RTNodeApp_Configurator::post_orb_initialize (CORBA::ORB_ptr o) -{ - ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::post_orb_init\n")); - - this->orb_ = CORBA::ORB::_duplicate (o); - - CORBA::Object_var object = - this->orb_->resolve_initial_references ("RTORB"); - - this->rtorb_ = - RTCORBA::RTORB::_narrow (object.in ()); - - this->config_manager_.init (this->rtorb_.in ()); - - return 0; -} - -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? - - for (CORBA::ULong i = 0; i < properties.length (); ++i) - { - // if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::init_resource_manager processing property: %s\n", - properties[i].name.in ())); - - if (ACE_OS::strcmp ("CIAOServerResources", properties[i].name.in ()) == 0) - { - const CIAO::DAnCE::ServerResource *svr_resource; - if (properties[i].value >>= svr_resource) - { - this->config_manager_.init_resources (*svr_resource); - // Now we have the information to initialize the manager. - } - else - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: RTNodeApp_Configurator::init_resource_manager unable to extract CIAOServerResources\n"), -1); - } - - // Ignore other stuff - } - - return 0; -} - -CORBA::PolicyList * -CIAO::RTNodeApp_Configurator::find_container_policies -(const ::Deployment::Properties &properties) -{ - ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::find_container_policies\n")); - // @@ Should we cache the properties that we consumed here? - - for (CORBA::ULong i = 0; i < properties.length (); ++i) - { - ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::find_container_policies processing property: %s\n", - properties[i].name.in ())); - - if (ACE_OS::strcmp ("ContainerPolicySet", properties[i].name) == 0) - { - const char *policy_name = 0; - if (properties[i].value >>= policy_name) - { - return this->config_manager_.find_policies_by_name (policy_name); - } - else - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: RTNodeApp_Configurator::find_container_policies unable to extract ContainerPolicySet\n"), 0); - } - } - - return 0; -} - - -extern "C" CIAO_RTNA_Configurator_Export CIAO::NodeApp_Configurator *create_nodeapp_configurator (void); - -CIAO::NodeApp_Configurator * -create_nodeapp_configurator (void) -{ - CIAO::RTNodeApp_Configurator *config = 0; - ACE_NEW_RETURN (config, CIAO::RTNodeApp_Configurator, 0); - return config; -} diff --git a/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.cpp b/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.cpp new file mode 100644 index 00000000000..541457a9afe --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.cpp @@ -0,0 +1,249 @@ +// $Id$ + +#include "ServerActivator_Impl.h" +#include "Cdmw/CDMW_IDL_ExtC.h" +#include "DAnCE/Logger/Log_Macros.h" + +const char* COMPONENT_SERVER_NAME = "ComponentServer"; + +bool read_config_value (const ACE_CString & name, + const Components::ConfigValues & config, + CORBA::Any_out value) +{ + bool found = false; + CORBA::ULong const len = config.length(); + for (CORBA::ULong count = 0; count < len; ++count) + { + if (name.compare (config[count]->name()) == 0) + { + value = new CORBA::Any (config[count]->value()); + found = true; + break; + } + } + + return found; +} + +using namespace DAnCE; + +ServerActivator_Impl::ServerActivator_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + Components::Deployment::ComponentInstallation_ptr compInst) + : orb_ (CORBA::ORB::_duplicate (orb)) + , poa_ (PortableServer::POA::_duplicate (poa)) + , compInst_ (Components::Deployment::ComponentInstallation::_duplicate (compInst)) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::ServerActivator_Impl - started\n")); + + CORBA::Object_var obj = + this->orb_->resolve_initial_references ("ProcessDestinationNC"); + if (CORBA::is_nil(obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] ServerActivator_Impl::ServerActivator_Impl - Failed to retrieve the \"ProcessDestinationNC\" object.\n")); + throw CORBA::ORB::InvalidName(); + } + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::ServerActivator_Impl name service reference received\n")); + try + { + this->naming_ = CosNaming::NamingContext::_narrow (obj); + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] ServerActivator_Impl::ServerActivator_Impl - failed to narrow the \"ProcessDestinationNC\" NC.\n")); + throw; + } + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::ServerActivator_Impl - finished\n")); +} + +ServerActivator_Impl::~ServerActivator_Impl() +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::~ServerActivator_Impl - started\n")); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::~ServerActivator_Impl - finished\n")); +} + +::Components::Deployment::ComponentServer_ptr +ServerActivator_Impl::create_component_server (const ::Components::ConfigValues & config) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::create_component_server - started\n")); + + // NOTA: These are the configuration values understood by the server activator + // for component server creation + // + // +====================================+=============================+ + // | Config Name | Type | + // +====================================+=============================+ + // | PROCESS_DESTINATION (*) | string | + // +------------------------------------+-----------------------------+ + // + // (*) compulsory + // + //Extracting process destination + ACE_CString processDest; + { + CORBA::Any_var processDestAny; + + if (read_config_value (Components::PROCESS_DESTINATION, config, processDestAny)) + { + const char* szProcessDest = 0; + processDestAny.in() >>= szProcessDest; + processDest = szProcessDest; + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - read_config_value() function fails\n")); + throw ::Components::Deployment::InvalidConfiguration(); + } + } + ::Components::Deployment::ComponentServer_var srv; + if (0 == this->servers_.find (processDest, srv)) + { + return srv._retn();//::Components::Deployment::ComponentServer::_duplicate (srv.in()); + } + //Looking for ComponentServer + ACE_CString processName = processDest + "." + COMPONENT_SERVER_NAME; + CosNaming::Name name (1); + name.length (1); + name[0].id = CORBA::string_dup (processDest.c_str()); + name[0].kind = CORBA::string_dup (COMPONENT_SERVER_NAME); + CORBA::Object_var obj; + CosNaming::NamingContext_var naming; + try + { + obj = this->naming_->resolve (name); + } + catch (const CosNaming::NamingContext::NotFound& ) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - NotFound exception rised." + "(Name : CDMW/SERVICES/ASSEMBLYANDDEPLOYMENT/%C)\n" + , processDest.c_str())); + throw ::Components::CreateFailure(); + } + catch (const CosNaming::NamingContext::CannotProceed& ) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - NotFound exception rised." + "(Name : CDMW/SERVICES/ASSEMBLYANDDEPLOYMENT/%C)\n" + , processDest.c_str())); + throw ::Components::CreateFailure(); + } + catch (const CosNaming::NamingContext::InvalidName& ) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - NotFound exception rised." + "(Name : CDMW/SERVICES/ASSEMBLYANDDEPLOYMENT/%C)\n" + , processDest.c_str())); + throw ::Components::CreateFailure(); + } + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::create_component_server - ComponentServer object resolved\n")); + //Casting founded object + ::Components::Deployment::ComponentServer_var server + = ::Components::Deployment::ComponentServer::_narrow (obj); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::create_component_server - ComponentServer object narrowed\n")); + if (CORBA::is_nil (server)) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - ComponentServer in process destination %s could not be contacted\n", processDest.c_str())); + throw ::Components::CreateFailure (::Components::COMPONENT_SERVER_NOT_FOUND); + } + + //ComponentServer initialization by ServerActivator and ComponentInstallation references + this->initializeComponentServer (server.in()); + + //Saving server reference + //TODO add checking on already present component server with exception CdmwDeployment::COMPONENT_SERVER_ALREADY_CREATED + if (0 != this->servers_.bind (processDest, ::Components::Deployment::ComponentServer::_duplicate (server.in()))) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::create_component_server - ComponentServer in process destination %s already exists.\n", processDest.c_str())); + throw ::Components::CreateFailure (::Components::COMPONENT_SERVER_ALREADY_CREATED); + } + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::create_component_server - finished\n")); + return server._retn (); +} + +void +ServerActivator_Impl::remove_component_server (::Components::Deployment::ComponentServer_ptr server) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::remove_component_server - started\n")); + + // Checking input parameters + if (CORBA::is_nil (server)) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::remove_component_server - Wrong input parameter\n")); + throw CORBA::BAD_PARAM(); + } + + // find equivalent server in servers list + bool bFound = false; + for (TCompServers::iterator iter = this->servers_.begin(); + iter != this->servers_.end(); + ++iter) + { + if (server->_is_equivalent ( (*iter).int_id_.in())) + { + // remove ComponentServer from list + this->servers_.unbind ( (*iter).ext_id_); + bFound = true; + break; + } + } + + // if no equivalent found, throw exception + if (!bFound) + { + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::remove_component_server - equivalent server cannot be found in servers list\n")); + throw ::Components::RemoveFailure (::Components::UNKNOWN_COMPONENT_SERVER); + } + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::remove_component_server - finished\n")); +} + +::Components::Deployment::ComponentServers * +ServerActivator_Impl::get_component_servers () +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::get_component_servers - started\n")); + + ::Components::Deployment::ComponentServers* pServers = 0; + ACE_NEW_THROW_EX (pServers, + ::Components::Deployment::ComponentServers (this->servers_.current_size()), + CORBA::NO_MEMORY()); + int i = 0; + for (TCompServers::iterator iter = this->servers_.begin(); + iter != this->servers_.end(); + ++iter) + { + (*pServers) [i] = ::Components::Deployment::ComponentServer::_duplicate ( (*iter).int_id_.in()); + i++; + } + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::get_component_servers - finished\n")); + return pServers; +} + +void +ServerActivator_Impl::initializeComponentServer (::Components::Deployment::ComponentServer_ptr server) +{ + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::initializeComponentServer - started\n")); + + // the ComponentServer should be a Cdmw ComponentServer + Components::Deployment::ComponentServer_var cdmwServer = + Components::Deployment::ComponentServer::_narrow (server); + + if (CORBA::is_nil (cdmwServer.in ()) + { + // Component server is not Cdmw ComponentServer + DANCE_ERROR ( (LM_ERROR, "[%M] ServerActivator_Impl::initializeComponentServer - ComponentServer is not CdmwComponentServer\n")); + throw ::Components::CreateFailure (::Components::COMPONENT_SERVER_NOT_FOUND); + } + if (CORBA::is_nil (this->compInst_.in())) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::initializeComponentServer - Reference on ComponentInstallation is nil!!!!\n")); + } + CdmwCcmComponentServer::ComponentServer_var proprietary_svr = + CdmwCcmComponentServer::ComponentServer::_narrow (cdmwServer); + + // give it the ComponentInstallation + proprietary_svr->set_component_installation (this->compInst_.in()); + // give it the ServerActivator + proprietary_svr->set_server_activator (Components::Deployment::ServerActivator::_narrow (this->poa_->servant_to_reference (this))); + + DANCE_DEBUG ( (LM_DEBUG, "[%M] ServerActivator_Impl::initializeComponentServer - finished\n")); +} diff --git a/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.h b/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.h new file mode 100644 index 00000000000..8ce81ca1db6 --- /dev/null +++ b/CIAO/DAnCE/NodeApplication/ServerActivator_Impl.h @@ -0,0 +1,93 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ServerActivator_Impl.h + * + * $Id$ + * + * @Brief Implementation of Deployment::ServerActivator + * + * @author Erwin Gottlieb <eg@prismtech.com> + */ +//============================================================================= + +#ifndef SERVERACTIVATOR_IMPL_H_ +#define SERVERACTIVATOR_IMPL_H_ + +#include "ace/Map_Manager.h" +#include "tao/ORB.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" + +#include "Cdmw/CDMW_IDLS.h" +#include "ComponentServer/ComponentServerS.h" +#include "NodeApplication_Export.h" + +namespace DAnCE + { + + class NodeApplication_Export ServerActivator_Impl : public virtual POA_Components::Deployment::ServerActivator + { + public: + ServerActivator_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa_, + Components::Deployment::ComponentInstallation_ptr compInst); + virtual ~ServerActivator_Impl(); + + + // + // IDL:omg.org/Components/Deployment/ServerActivator/create_component_server:1.0 + // + /** + * Creates a ComponentServer object on the host on which the + * ServerActivator is located. + * + * @param config ConfigValues for creation of ComponentServer. + * For CDMW CCM, this sequence should contain a + * PROCESS_DESTINATION ConfigValue which specify the + * destination of an already started ComponentServer process. + * + * @throws CreateFailure + * INVALID_PROCESS_DESTINATION: raised if the destination + * specified in PROCESS_DESTINATION ConfigValue is not valid.<br> + * COMPONENT_SERVER_NOT_CREATED: raised if the ComponentServer could + * not be contacted (it should be started by PlatformManagement before + * the call to ServerActivator).<br> + * COMPONENT_SERVER_ALREADY_CREATED: raised if this method has already + * been called with the same PROCESS_DESTINATION ConfigValue. + * @throws InvalidConfiguration + * raised if the config parameter doesn't contain a single + * PROCESS_DESTINATION ConfigValue. + */ + virtual ::Components::Deployment::ComponentServer_ptr create_component_server ( + const ::Components::ConfigValues & config + ); + + // + // IDL:omg.org/Components/Deployment/ServerActivator/remove_component_server:1.0 + // + virtual void remove_component_server ( + ::Components::Deployment::ComponentServer_ptr server + ); + + // + // IDL:omg.org/Components/Deployment/ServerActivator/get_component_servers:1.0 + // + virtual ::Components::Deployment::ComponentServers * get_component_servers ( + ); + + private: + typedef ACE_Map_Manager<ACE_CString, ::Components::Deployment::ComponentServer_var, ACE_Null_Mutex > TCompServers; + TCompServers servers_; + + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + CosNaming::NamingContext_var naming_; + Components::Deployment::ComponentInstallation_var compInst_; + + private: + void initializeComponentServer (::Components::Deployment::ComponentServer_ptr server); + }; +}; + +#endif /*SERVERACTIVATOR_IMPL_H_*/ diff --git a/CIAO/DAnCE/NodeApplicationManager/CIAO_NAM_Export.h b/CIAO/DAnCE/NodeApplicationManager/CIAO_NAM_Export.h deleted file mode 100644 index 1a506292ef7..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/CIAO_NAM_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_NAM -// ------------------------------ -#ifndef CIAO_NAM_EXPORT_H -#define CIAO_NAM_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_NAM_HAS_DLL) -# define CIAO_NAM_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_NAM_HAS_DLL */ - -#if !defined (CIAO_NAM_HAS_DLL) -# define CIAO_NAM_HAS_DLL 1 -#endif /* ! CIAO_NAM_HAS_DLL */ - -#if defined (CIAO_NAM_HAS_DLL) && (CIAO_NAM_HAS_DLL == 1) -# if defined (CIAO_NAM_BUILD_DLL) -# define CIAO_NAM_Export ACE_Proper_Export_Flag -# define CIAO_NAM_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_NAM_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_NAM_BUILD_DLL */ -# define CIAO_NAM_Export ACE_Proper_Import_Flag -# define CIAO_NAM_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_NAM_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_NAM_BUILD_DLL */ -#else /* CIAO_NAM_HAS_DLL == 1 */ -# define CIAO_NAM_Export -# define CIAO_NAM_SINGLETON_DECLARATION(T) -# define CIAO_NAM_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_NAM_HAS_DLL == 1 */ - -// Set CIAO_NAM_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_NAM_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_NAM_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_NAM_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_NAM_NTRACE */ - -#if (CIAO_NAM_NTRACE == 1) -# define CIAO_NAM_TRACE(X) -#else /* (CIAO_NAM_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_NAM_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_NAM_NTRACE == 1) */ - -#endif /* CIAO_NAM_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp b/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp deleted file mode 100644 index 1472f598751..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.cpp +++ /dev/null @@ -1,779 +0,0 @@ -// $Id$ - -#include "Containers_Info_Map.h" -#include "ciao/CIAO_Config.h" -#include "ciao/CIAO_common.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" - -//Added for HTTP -#include "URL_Parser.h" //for parsing the URL -#include "tao/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 -#include "ace/streams.h" - -namespace CIAO -{ - Containers_Info_Map:: - Containers_Info_Map (const Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components) - : map_ (CIAO_DEFAULT_MAP_SIZE), - plan_ (plan), - shared_components_ (shared_components), - HTTP_DOWNLOAD_PATH () - { - char* temp = ACE_OS::getenv ("CIAO_ROOT"); - HTTP_DOWNLOAD_PATH += temp; - -#if defined (ACE_WIN32) - 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 - - this->initialize_map (); - this->build_map (); - } - - Deployment::ContainerImplementationInfos * - Containers_Info_Map::containers_info (void) - { - // Fetch the information from the <containers_info_map_> - // and return the corresponding sequence - Deployment::ContainerImplementationInfos_var retv; - - ACE_NEW_RETURN (retv, - Deployment::ContainerImplementationInfos, - 0); - - Iterator end = this->map_.end (); - CORBA::ULong i = 0; - - for (Iterator b = this->map_.begin (); - b != end; - ++b) - { - retv->length (i + 1); - (*retv)[i] = *((*b).int_id_); - - ++i; - } - return retv._retn (); - } - - void - Containers_Info_Map:: - initialize_map (void) - { - const CORBA::ULong instance_len = this->plan_.instance.length (); - - // Iterate over the instance list and look at the policy set id of each - // component instance. For each policy set, we create a separate container - // to host all the components with such policy set. - // NOTE: all the component instances without policies are specified should - // be hosted in the same container, and in our map the key is an empty - // string "" - int first_time = 0; - for (CORBA::ULong i = 0; i < instance_len; ++i) - { - CORBA::String_var my_resource_id (""); - const char *diff_policy_set_id = ""; - bool found = false; - - // @@ super hack here. we are assuming RT policy set is - // the only thing that will be specified. - CORBA::ULong dp_length = - this->plan_.instance[i].deployedResource.length (); - - if (dp_length == 0) - { - found = true; - } - - for (CORBA::ULong x = 0; x < dp_length; ++x) - { - my_resource_id = - this->plan_.instance[i].deployedResource[x].resourceName.in (); - - CORBA::ULong property_length = - this->plan_.instance[i].deployedResource[x].property.length (); - - found = true; - - for (CORBA::ULong p = 0; p < property_length; ++p) - { - if (ACE_OS::strcmp ( - this->plan_.instance[i].deployedResource[x]. - property[p].name.in (), - "CIAO:InstancePolicy") == 0) - { // should be only one of them. - // each instance will have one one CIAO:InstancePolicy - // definition. - this->plan_.instance[i].deployedResource[x].property[p]. - value >>= diff_policy_set_id; - if (this->map_.find (diff_policy_set_id) != 0) - { - // we found a policy that is different from what - // we have seen before. - found = true; - } - else - { - found = false; - } - } - } - } - - // If we find a existing policy_set_id, then do nothing. - if (found == false) - { - // we did not find a new instance policy. - // but the instance's receptacles could have their - // own policies. - continue; - } - - if (ACE_OS::strcmp (diff_policy_set_id, "") == 0) - { - // no policy set id has been specified - // but we could have some receptacle policies around. - // - if (first_time == 0) - { - Deployment::ContainerImplementationInfo * info; - ACE_NEW (info, Deployment::ContainerImplementationInfo); - this->map_.bind (diff_policy_set_id, info); - first_time = 1; - continue; - } - } - else - { - Deployment::ContainerImplementationInfo * info; - ACE_NEW (info, Deployment::ContainerImplementationInfo); - - // Fetch the actual policy_set_def from the infoProperty - // Ugly due to the IDL data structure definition! :( - CORBA::ULong j; - CORBA::ULong infoProperty_length = - this->plan_.infoProperty.length (); - - for (j = 0; j < infoProperty_length; ++j) - { - if (ACE_OS::strcmp (this->plan_.infoProperty[j].name.in (), - "CIAOServerResources") != 0) - continue; - - CIAO::DAnCE::ServerResource *server_resource_def = 0; - this->plan_.infoProperty[j].value >>= server_resource_def; - - if (ACE_OS::strcmp ((*server_resource_def).Id, - my_resource_id.in ()) == 0) - { - // Iterate over the policy_sets - CORBA::ULong k; - CORBA::ULong policy_sets_length = - (*server_resource_def).orb_config.policy_set.length (); - const char *comparing_policy_set_id; - CORBA::ULong config_length; - CORBA::ULong new_config_length; - for (k = 0; k < policy_sets_length; ++k) - { - CORBA::ULong new_dp_length = - this->plan_.instance[i].deployedResource.length (); - - for (CORBA::ULong z = 0; z < new_dp_length; - ++z) - { - CORBA::ULong new_property_length = - this->plan_.instance[i].deployedResource[z]. - property.length (); - for (CORBA::ULong s = 0; - s < new_property_length; ++s) - { - this->plan_.instance[i].deployedResource[z]. - property[s].value >>= comparing_policy_set_id; - if (ACE_OS::strcmp (comparing_policy_set_id, - (*server_resource_def). - orb_config.policy_set[k].Id) == 0) - { - config_length = - info->container_config.length (); - new_config_length = - config_length + 1; - info->container_config.length ( - new_config_length); - if (ACE_OS::strcmp ( - this->plan_.instance[i]. - deployedResource[z]. - property[s].name.in (), - "CIAO:InstancePolicy") == 0) - { - info-> - container_config[config_length].name = - CORBA::string_dup - ("ContainerPolicySet"); - } - else if (ACE_OS::strcmp ( - this->plan_.instance[i]. - deployedResource[z]. - property[s].name.in (), - "CIAO:ReceptaclePolicy") == 0) - { - info-> - container_config[config_length].name = - CORBA::string_dup - ("ReceptaclePolicySet"); - } - else - { - info-> - container_config[config_length].name = - this->plan_.instance[i]. - deployedResource[z]. - property[s].name.in (); - } - info-> - container_config[config_length].value <<= - comparing_policy_set_id; - } - } - } - } - this->map_.bind (diff_policy_set_id, info); - } - } - } - } - } - - bool - Containers_Info_Map:: - build_map (void) - { - const CORBA::ULong instance_len = this->plan_.instance.length (); - - for (CORBA::ULong i = 0; i < instance_len; ++i) - { - const Deployment::InstanceDeploymentDescription & instance = - this->plan_.instance[i]; - - // 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; - } - - return true; - } - - bool - Containers_Info_Map::insert_instance_into_map ( - const Deployment::InstanceDeploymentDescription & instance) - { - Deployment::ContainerImplementationInfo container_info; - - const char * policy_set_id = ""; - - CORBA::ULong dp_length = - instance.deployedResource.length (); - - for (CORBA::ULong x = 0; x < dp_length; ++x) - { - CORBA::ULong property_length = - instance.deployedResource[x].property.length (); - - for (CORBA::ULong p = 0; p < property_length; ++p) - { - if (ACE_OS::strcmp ( - instance.deployedResource[x]. - property[p].name.in (), - "CIAO:InstancePolicy") == 0) - { - instance.deployedResource[x].property[p].value >>= - policy_set_id; - } - } - } - - // Find the ContainerImplementationInfo entry from the map - MAP::ENTRY *entry = 0; - if (this->map_.find (policy_set_id, entry) != 0) - { - return false; //should never happen - } - else - { - this->insert_instance_into_container ( - instance, - entry->int_id_->impl_infos); - } - - return true; - } - - bool - Containers_Info_Map::insert_instance_into_container ( - const Deployment::InstanceDeploymentDescription & instance, - Deployment::ComponentImplementationInfos & impl_infos) - { - // Increase the length of the ComponentImplementationInfos by one - CORBA::ULong i = impl_infos.length (); - impl_infos.length (i + 1); - - // Fill in the information about this component instance - // Get the component instance name. - impl_infos[i].component_instance_name = instance.name.in (); - - const Deployment::MonolithicDeploymentDescription & impl = - this->plan_.implementation[instance.implementationRef]; - - const CORBA::ULong artifact_num = impl.artifactRef.length (); - - // Copy Component instance related Properties if there is any. - if (instance.configProperty.length () > 0) - { - impl_infos[i].component_config = instance.configProperty; - } - - CORBA::ULong config_length = - impl_infos[i].component_config.length (); - - CORBA::ULong dp_length = - instance.deployedResource.length (); - - const char* policy_set_id = ""; - - for (CORBA::ULong x = 0; x < dp_length; ++x) - { - CORBA::ULong property_length = - instance.deployedResource[x].property.length (); - - for (CORBA::ULong p = 0; p < property_length; ++p) - { - if (ACE_OS::strcmp ( - instance.deployedResource[x]. - property[p].name.in (), - "CIAO:InstancePolicy") != 0) - { - if (ACE_OS::strcmp ( - instance.deployedResource[x]. - property[p].name.in (), - "CIAO:ReceptaclePolicy") != 0) - { - config_length = - impl_infos[i].component_config.length (); - impl_infos[i].component_config.length (config_length + 1); - impl_infos[i].component_config[config_length].name = - instance.deployedResource[x].property[p].name.in (); - instance.deployedResource[x].property[p].value >>= - policy_set_id; - impl_infos[i].component_config[config_length].value <<= - policy_set_id; - } - } - } - } - - bool svnt_found = false; - bool exec_found = false; - - // For svnt/exec artifacts - for (CORBA::ULong j = 0; j < artifact_num; ++j) - { - Deployment::ArtifactDeploymentDescription arti = - this->plan_.artifact[ impl.artifactRef[j] ]; - - 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; - ACE_CString arti_name; - if (!this->resolve_http_reference (arti.location[loc_num], - arti_name, - 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 ())); - - //No need to throw an exception here! - //Actually it is not desirable. - //This is handled in a different part of DAnCE - arti.location[loc_num] = "HTTP_failure"; - } - else - { - arti.location[loc_num] = arti_name.c_str (); - //enque for cleanup - } - } - } - - ACE_CString tmp = arti.name.in (); - ACE_CString::size_type pos; - - //@@ Note: I am not checking for redundancy here. Maybe - // 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)) - { - if (arti.location.length() < 1 ) - { - ACE_DEBUG ((LM_DEBUG, "Servant Artifact must have a location!\n")); - return 0; - } - - svnt_found = true; - // Copy the servant dll/so name. - // @@ Note: I ignore all the other locations except the first one. - impl_infos[i].servant_dll = - CORBA::string_dup (arti.location[0]); - - // Get the entry point. - const CORBA::ULong prop_length = arti.execParameter.length (); - - for (CORBA::ULong prop_num = 0; - prop_num < prop_length; - ++prop_num) - { - ACE_CString name (arti.execParameter[prop_num].name.in ()); - if (name == ACE_CString ("entryPoint")) - { - const char * entry = 0; - (arti.execParameter[prop_num].value) >>= entry; - impl_infos[i].servant_entrypt = CORBA::string_dup (entry); - } - else - { - ACE_DEBUG ((LM_DEBUG, "Found unknown property in the artifact!\n")); - ACE_DEBUG ((LM_DEBUG, "We only support entrypoint at this point in CIAO.\n")); - } - } - - continue; // continue for the next artifact - } - - // As one can see, code is duplicated here. I will come back for this later. - // For exec artifact - if (!exec_found && - ((pos = tmp.find ("_exec")) != ACE_CString::npos || - (pos = tmp.find ("_Exec")) != ACE_CString::npos)) - { - if (arti.location.length() < 1 ) - { - ACE_DEBUG ((LM_DEBUG, "Executor Artifact must have a location!\n")); - return 0; - } - - exec_found = true; - // 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 = - CORBA::string_dup (arti.location[0]); - - // Get the entry point. - const CORBA::ULong prop_length = arti.execParameter.length (); - for (CORBA::ULong prop_num = 0; - prop_num < prop_length; - ++prop_num) - { - ACE_CString name (arti.execParameter[prop_num].name.in ()); - if (name == ACE_CString ("entryPoint")) - { - const char * entry = 0; - (arti.execParameter[prop_num].value) >>= entry; - impl_infos[i].executor_entrypt = CORBA::string_dup (entry); - } - else - { - ACE_DEBUG ((LM_DEBUG, "Found unknown property in the artifact!\n")); - ACE_DEBUG ((LM_DEBUG, "We only support entrypoint at this point in CIAO.\n")); - } - } - } - else - // We see artifact other than servant/executor and we ignore them. - continue; - } - return true; - } -} - -bool -CIAO::Containers_Info_Map:: -is_shared_component (ACE_CString & name) -{ - for (CORBA::ULong i = 0; i < this->shared_components_.length (); ++i) - { - if (ACE_OS::strcmp (this->shared_components_[i].name.in (), - name.c_str ()) == 0) - return true; - } - - 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) - 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) - ACE_CString new_path = "PATH="; -#else - ACE_CString new_path = "LD_LIBRARY_PATH="; -#endif - - new_path += this->HTTP_DOWNLOAD_PATH; - -#if defined (ACE_WIN32) - new_path += ";"; -#else - new_path += ":"; -#endif - - new_path += path; - - ACE_OS::putenv (new_path.c_str ()); - - } - - //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 &arti_name, - ACE_CString &path) - { - // Figure out the file name. - char* name = const_cast<char*> (location); - char* p = 0; - - while (true) - { - p = ACE_OS::strstr (name, "/"); - - if (0 == p) - { - p = ACE_OS::strstr (name, "\\"); - } - - if (0 == p) - { - break; - } - else - { - name = ++p; - continue; - } - } - - arti_name = name; - - // 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; - } - -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - ACE_TString decorator (ACE_LD_DECORATOR_STR); -#endif - ACE_TString prefix (ACE_DLL_PREFIX); - ACE_TString suffix (ACE_DLL_SUFFIX); - - ACE_CString new_name (name); - new_name = prefix + new_name; -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - new_name += decorator; -#endif - new_name += suffix; - - path = HTTP_DOWNLOAD_PATH; - path += "/"; - path += new_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) - { - ACE_CString loc (URL); - - // Figure out the file name. - char* name_ = const_cast<char*> (URL); - char* p = 0; - - while (true) - { - p = ACE_OS::strstr (name_, "/"); - - if (0 == p) - { - p = ACE_OS::strstr (name_, "\\"); - } - - if (0 == p) - { - break; - } - else - { - name_ = ++p; - continue; - } - } - - ACE_CString name (name_); - loc = loc.substr (0, loc.length() - name.length ()); - -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - ACE_TString decorator (ACE_LD_DECORATOR_STR); -#endif - ACE_TString prefix (ACE_DLL_PREFIX); - ACE_TString suffix (ACE_DLL_SUFFIX); - - ACE_CString new_name (name); - new_name = prefix + new_name; -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - new_name += decorator; -#endif - new_name += suffix; - - loc = loc + new_name; - - ACE_DEBUG ((LM_INFO, - "Attempting to download %s\n", - loc.c_str ())); - - URL_Parser *parser = TheURL_Parser::instance (); - if (!parser->parseURL (const_cast<char*> (loc.c_str ()))) - return false; - - // Create a client - TAO_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/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h b/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h deleted file mode 100644 index 237ecf07c86..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/Containers_Info_Map.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * - * @file Containers_Info_Map.h - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * - * Map of ContainerImplementationInfo sequences. - * - * $Id$ - */ - -#ifndef CIAO_CONTAINERS_INFO_MAP_H -#define CIAO_CONTAINERS_INFO_MAP_H - -#include /**/ "ace/pre.h" - -#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 "DAnCE/Deployment/Deployment_ContainerC.h" -#include "DAnCE/Deployment/DeploymentC.h" -#include "ace/SString.h" -#include "CIAO_NAM_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - /** - * @class Container_Infos_Map - * @brief Implementation of a map of ContainerImplementationInfo sequences. - * - * This is a helper class to populate the NodeImplementationInfo struct from - * a deployment plan.. - */ - class CIAO_NAM_Export Containers_Info_Map - { - public: - - Containers_Info_Map (const Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components); - - Deployment::ContainerImplementationInfos * - containers_info (void); - - private: - void initialize_map (void); - bool build_map (void); - - bool insert_instance_into_map ( - const Deployment::InstanceDeploymentDescription & instance); - - bool insert_instance_into_container ( - const Deployment::InstanceDeploymentDescription & instance, - Deployment::ComponentImplementationInfos & impl_infos); - - /// Helper function to check wheather a component instance - /// is in the "shared components list". - bool is_shared_component (ACE_CString & name); - - //Deployment::ContainerImplementationInfos_var containers_info_; - - typedef - ACE_Hash_Map_Manager_Ex <ACE_CString, - Deployment::ContainerImplementationInfo *, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> MAP; - - typedef MAP::iterator Iterator; - MAP map_; - - const Deployment::DeploymentPlan & plan_; - - /// 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: - - // @Stoyan - Please follow ACE coding guideines when naming your - //member variables. In particular, please use lower case and - //follow the name with a trailing underscore. - //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 &arti_name, - 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 - - }; -} - -#include /**/ "ace/post.h" - -#endif /*CIAO_CONTAINERS_INFO_MAP_H*/ diff --git a/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp b/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp deleted file mode 100644 index 0ae9f9b0175..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp +++ /dev/null @@ -1,95 +0,0 @@ -//$Id$ -#ifndef CIAO_IMPLEMENTATION_INFO_CPP -#define CIAO_IMPLEMENTATION_INFO_CPP - -#include "ImplementationInfo.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" -#include "ace/SString.h" - -CIAO::NodeImplementationInfoHandler:: -NodeImplementationInfoHandler (const ::Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components) : - plan_ (plan), - node_info_ (0), - containers_info_map_ (plan, shared_components) -{ - ACE_NEW (node_info_, ::Deployment::NodeImplementationInfo); - this->populate_server_resource_def (); - this->populate_container_impl_infos (); -} - -Deployment::NodeImplementationInfo * -CIAO::NodeImplementationInfoHandler::node_impl_info (void) const -{ - Deployment::NodeImplementationInfo_var retv; - ACE_NEW_RETURN (retv, - Deployment::NodeImplementationInfo (this->node_info_.in ()), - 0); - return retv._retn (); -} - -void -CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) -{ - CORBA::ULong const instance_len = plan_.instance.length (); - const char * target_resource_id = 0; - - // Iterate over the instance list to find whether any server resource - // 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 - // users to specify some self-conflicting configuration in the descriptor. - - // NW: this stuff is broken because it assumes all component - // instances in a node will use the same ServerResource file. This - // is not the case. Component instances using the same - // ServerResource file will be deployed in the same NA. However, - // those using different ServerResource files should be deployed to - // different NAs. Something to be fixed later. - for (CORBA::ULong i = 0; i < instance_len; ++i) - { - if (this->plan_.instance[i].deployedResource.length () != 0) - { - target_resource_id = - this->plan_.instance[i].deployedResource[0].resourceName.in (); - - // Some component instance has server resource usage defined, so we - // set the <nodeapp_config> field of the NodeImplementationInfo struct. - for (CORBA::ULong j = 0; j < this->plan_.infoProperty.length (); ++j) - { - CIAO::DAnCE::ServerResource *server_resource_def = 0; - this->plan_.infoProperty[j].value >>= server_resource_def; - - 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 = - CORBA::string_dup ("CIAOServerResources"); - - this->node_info_->nodeapp_config[0].value <<= - *server_resource_def; - break; - } - } - } - } -} - -void -CIAO::NodeImplementationInfoHandler::populate_container_impl_infos (void) -{ - CORBA::ULong const curr_len = - this->containers_info_map_.containers_info ()->length (); - - ACE_UNUSED_ARG (curr_len); - - // assignment operation - this->node_info_->impl_infos = - *(this->containers_info_map_.containers_info ()); -} - -#endif /* CIAO_IMPLEMENTATION_INFO_CPP */ diff --git a/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h b/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h deleted file mode 100644 index 4109fee1a21..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h +++ /dev/null @@ -1,60 +0,0 @@ -//$Id$ -/* -*- C++ -*- */ -/*************************************************************** - * @file ImplementationInfo.h - * - * @brief This file defines some helper functions for preparing the - * Component ImplementationInfo and properties from - * the plan. - * - * @author Tao Lu <lu@dre.vanderbilt.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> - ***************************************************************/ - -#ifndef IMPLEMENTATIONIFO_H -#define IMPLEMENTATIONIFO_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "ace/SString.h" -#include "ace/Hash_Map_Manager.h" -#include "Containers_Info_Map.h" -#include "CIAO_NAM_Export.h" - -namespace CIAO -{ - /// This class is a helper class to parse the local deployment plan into the - /// NodeImplementationInfo struct. - class CIAO_NAM_Export NodeImplementationInfoHandler - { - public: - NodeImplementationInfoHandler ( - const ::Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components); - - Deployment::NodeImplementationInfo * - node_impl_info (void) const; - - private: - Deployment::DeploymentPlan plan_; - - Deployment::NodeImplementationInfo_var node_info_; - - void populate_server_resource_def (void); - - void populate_container_impl_infos (void); - - /// Helper class that helps populate the container_impl_infos - /// field. - Containers_Info_Map containers_info_map_; - }; -} - -#include /**/ "ace/post.h" -#endif /* IMPLEMENTATIONIFO_H */ diff --git a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc index caa5b8ffbad..c07575ef68a 100644 --- a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc +++ b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager.mpc @@ -1,24 +1,11 @@ // -*- MPC -*- // $Id$ -project(NodeApplicationManager): ciao_server_dnc, ciao_deployment_svnt, dance_extension_stub, ciao_nodeapplication, ace_output { - - sharedname = NodeApplicationManager - after += NodeManager_stub CIAO_TargetManager_stub - dynamicflags = CIAO_NAM_BUILD_DLL +project: dance_lib, naming, dance_node_application, dance_deployment_svnt, dance_deployment_stub, dynamicinterface, ccm_componentserver_svnt, ciao_cs_client { + sharedname = DAnCE_NodeApplicationManager + dynamicflags = NODEAPPLICATIONMANAGER_BUILD_DLL Source_Files { NodeApplicationManager_Impl.cpp - ImplementationInfo.cpp - Containers_Info_Map.cpp - URL_Parser.cpp - } - - Header_Files { - NodeApplicationManager_Impl.h - ImplementationInfo.h - Containers_Info_Map.h - URL_Parser.h - CIAO_NAM_Export.h } } diff --git a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Export.h b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Export.h new file mode 100644 index 00000000000..b86e93b49ab --- /dev/null +++ b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NodeApplicationManager +// ------------------------------ +#ifndef NODEAPPLICATIONMANAGER_EXPORT_H +#define NODEAPPLICATIONMANAGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPLICATIONMANAGER_HAS_DLL) +# define NODEAPPLICATIONMANAGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NODEAPPLICATIONMANAGER_HAS_DLL */ + +#if !defined (NODEAPPLICATIONMANAGER_HAS_DLL) +# define NODEAPPLICATIONMANAGER_HAS_DLL 1 +#endif /* ! NODEAPPLICATIONMANAGER_HAS_DLL */ + +#if defined (NODEAPPLICATIONMANAGER_HAS_DLL) && (NODEAPPLICATIONMANAGER_HAS_DLL == 1) +# if defined (NODEAPPLICATIONMANAGER_BUILD_DLL) +# define NodeApplicationManager_Export ACE_Proper_Export_Flag +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NODEAPPLICATIONMANAGER_BUILD_DLL */ +# define NodeApplicationManager_Export ACE_Proper_Import_Flag +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NODEAPPLICATIONMANAGER_BUILD_DLL */ +#else /* NODEAPPLICATIONMANAGER_HAS_DLL == 1 */ +# define NodeApplicationManager_Export +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARATION(T) +# define NODEAPPLICATIONMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NODEAPPLICATIONMANAGER_HAS_DLL == 1 */ + +// Set NODEAPPLICATIONMANAGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NODEAPPLICATIONMANAGER_NTRACE) +# if (ACE_NTRACE == 1) +# define NODEAPPLICATIONMANAGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NODEAPPLICATIONMANAGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NODEAPPLICATIONMANAGER_NTRACE */ + +#if (NODEAPPLICATIONMANAGER_NTRACE == 1) +# define NODEAPPLICATIONMANAGER_TRACE(X) +#else /* (NODEAPPLICATIONMANAGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NODEAPPLICATIONMANAGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NODEAPPLICATIONMANAGER_NTRACE == 1) */ + +#endif /* NODEAPPLICATIONMANAGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index f65379d11c7..deb395ceccc 100644 --- a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -1,1110 +1,209 @@ // $Id$ -#include "NodeApplicationManager_Impl.h" +#include "ace/Log_Msg.h" +#include "ace/streams.h" +#include "DAnCE/Deployment/DAnCE_PropertiesC.h" +#include "DAnCE/Logger/Log_Macros.h" -#include "ace/Process.h" -#include "ace/Process_Manager.h" -#include "ace/Reactor.h" -#include "ace/OS_NS_stdio.h" -#include "ace/Sched_Params.h" -#include "ace/Vector_T.h" -#include "ciao/Container_Base.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" +#include "NodeApplicationManager_Impl.h" #include "NodeApplication/NodeApplication_Impl.h" -#include "NodeApplication/NodeApp_Configurator.h" -#include "ace/Reactor.h" - -#if !defined (__ACE_INLINE__) -# include "NodeApplicationManager_Impl.inl" -#endif /* __ACE_INLINE__ */ - - -bool -CIAO::NodeApplicationManager_Impl_Base:: -is_shared_component (ACE_CString & name) -{ - for (CORBA::ULong i = 0; i < this->shared_components_.length (); ++i) - { - if (ACE_OS::strcmp (this->shared_components_[i].name.in (), - name.c_str ()) == 0) - return true; - } - - return false; -} - -bool -CIAO::NodeApplicationManager_Impl_Base:: -is_external_component (ACE_CString & name) -{ - for (CORBA::ULong i = 0; i < this->external_components_.length (); ++i) - { - if (ACE_OS::strcmp (this->external_components_[i].name.in (), - name.c_str ()) == 0 && - ACE_OS::strcmp (this->external_components_[i].plan_uuid.in (), - this->plan_.UUID.in ())) - return true; - } - - return false; -} - -Deployment::Connections * -CIAO::NodeApplicationManager_Impl_Base:: -create_connections () -{ - CIAO_TRACE("CIAO::NodeApplicationManager_Impl_Base::create_connections"); - Deployment::Connections_var retv; - - ACE_NEW_THROW_EX (retv, - Deployment::Connections (), - CORBA::NO_MEMORY ()); - - CORBA::ULong len = retv->length (); - - const Component_Iterator end (this->component_map_.end ()); - 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 (this->is_shared_component (comp_name)) - { - ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Component %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 (); - 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 facets for the component " - "instance [%s] \n", - comp_name.c_str ())); - } - - // Get all the event consumers - Components::ConsumerDescriptions_var consumers; - - if (this->is_shared_component (comp_name)) - { - ACE_DEBUG ((LM_DEBUG, "NAMImpl::create_connections: Component %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 (); - this->node_manager_->set_all_consumers (comp_name, consumers); - } - - 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 ())); - } - - CORBA::ULong const facet_len = facets->length (); - CORBA::ULong const consumer_len = consumers->length (); - - CORBA::ULong const curr_len = retv->length (); - retv->length (curr_len + facet_len + consumer_len); - - 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 ())); - } - 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; - } - } - return retv._retn (); -} - -Deployment::Application_ptr -CIAO::NodeApplicationManager_Impl_Base:: -startLaunch (const Deployment::Properties & configProperty, - Deployment::Connections_out providedReference, - CORBA::Boolean start) -{ +#include "NodeManager/NodeManager_Impl.h" + +using namespace DAnCE; + +NodeApplicationManager_Impl::NodeApplicationManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + RedirectionService & redirection, + const ACE_CString& node_name, + const PROPERTY_MAP &properties) + : plan_ (plan), + orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + application_ (0), + redirection_ (redirection), + node_name_ (node_name), + properties_ () +{ + DANCE_TRACE (DLINFO "NodeApplicationManager_Impl::NodeApplicationManager_Impl"); + + DANCE_DEBUG((LM_DEBUG, DLINFO " NodeApplicationManager_Impl::NodeApplicationManager_Impl - " + "Initializing for node '%s' and plan '%s' starting...\n", + node_name.c_str(), + plan_.UUID.in())); + this->register_plan(); + + PROPERTY_MAP::const_iterator i = properties.begin (); + while (!i.done ()) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplicationManager_Impl::NodeApplicationManager_Impl - " + "Binding value for property %s\n", i->key ().c_str ())); + this->properties_.bind (i->key (), i->item ()); + i.advance (); + } +} + +NodeApplicationManager_Impl::~NodeApplicationManager_Impl() +{ + DANCE_TRACE (DLINFO "NodeApplicationManager_Impl::~NodeApplicationManager_Impl"); + try { - CIAO_TRACE("CIAO::NodeApplicationManager_Impl::startLaunch"); - ACE_UNUSED_ARG (configProperty); - ACE_UNUSED_ARG (start); - - // In this step, we know all the "shared components" are - // the external components to ourself. - this->external_components_ = this->shared_components_; - - // If no additional components need to be installed, then we simply - // create a NA, but doesn't install any components on it. - if (this->plan_.instance.length () == this->shared_components_.length ()) - { - ACE_DEBUG ((LM_DEBUG, "Prespawn a NodeApplication process without " - "installing any components.\n")); - } - - /** - * 1. First Map properties to TAO/CIAO specific property/configurations - * 2. Necessary property checking (needed?) - * 3. Call create_nade_application to spawn new process. - * 4. Initialize the NodeApplication. - * 5. get the provided connection endpoints back and return them. - */ - - NodeImplementationInfoHandler handler (this->plan_, this->shared_components_); - - Deployment::NodeImplementationInfo * node_info = - handler.node_impl_info (); - - if (!node_info) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) NodeApplicationManager.cpp -" - "CIAO::NodeApplicationManager_Impl::startLaunch -" - "Failed to create Node Implementation Infos!\n")); - - throw - (Deployment::StartError ("NodeApplicationManager_Imp::startLaunch", - "Unable to get node level infos")); - } - - CIAO::DAnCE::ServerResource *server_resource = 0; - for (CORBA::ULong k = 0; k < node_info->nodeapp_config.length (); ++k) - { - if (ACE_OS::strcmp (node_info->nodeapp_config[k].name.in (), - "CIAOServerResources") == 0) - { - node_info->nodeapp_config[0].value >>= server_resource; - break; // Ignore the rest of the NodeApp_Config values - } - } - - // Now spawn the NodeApplication process. - // @@TODO: we need to pass arguments to the nodeapplication, ie - // naming service endpoints, if necessary - // (will) - ACE_CString cmd_option (this->nodeapp_command_op_.in ()); - - if (server_resource) - { - // If command line options are specified through RTCCM descriptors, - // then we should honor these command line options as well. - for (CORBA::ULong arg_i = 0; - arg_i < (*server_resource).args.length (); - ++arg_i) - { - cmd_option += " "; // space between command line args - cmd_option += (*server_resource).args[arg_i]; - } - - // If service configuration file is specified through RTCCM - // descriptors, then we should honor it as well. - if (ACE_OS::strcmp ((*server_resource).svcconf.in (), - "") != 0) - { - cmd_option += " -ORBSvcConf "; - cmd_option += (*server_resource).svcconf; - } - } - - Deployment::NodeApplication_var tmp = - create_node_application (cmd_option.c_str ()); - - if (CIAO::debug_level () > 9) - { - CORBA::ULong curr_len = node_info->impl_infos.length (); - ACE_UNUSED_ARG (curr_len); - - Deployment::ComponentImplementationInfos infos = - ((node_info->impl_infos)[0]).impl_infos; - - const CORBA::ULong info_len = infos.length (); - for (CORBA::ULong i = 0; i < info_len; ++i) - { - ACE_DEBUG ((LM_DEBUG, - "DAnCE (%P|%t) NodeApplicationManager.cpp -" - "CIAO::NodeApplicationManager_Impl::startLaunch -" - "The info for installation: " - "\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", - infos[i].component_instance_name.in (), - infos[i].executor_dll.in (), - infos[i].executor_entrypt.in (), - infos[i].servant_dll.in (), - infos[i].servant_entrypt.in () )); - } - } - - // This is what we will get back, a sequence of component object refs. - Deployment::ComponentInfos_var comp_info; - - // This will install all homes and components. - comp_info = this->nodeapp_->install (*node_info); - - - // 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; - len < comp_len; - ++len) - { - //FUZZ: disable check_for_lack_ACE_OS - //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()))) - //FUZZ: enable check_for_lack_ACE_OS - { - ACE_CString error ("Duplicate component instance name "); - error += comp_info[len].component_instance_name.in(); - - throw - (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); - } - } - - // Also, we need to fill in the map about those "shared components" - // For now, we could use "NIL" component object reference for these - // shared components since they are not used anyway. - CORBA::ULong shared_comp_length = this->shared_components_.length (); - for (CORBA::ULong j = 0; j < shared_comp_length; ++j) - { - //FUZZ: disable check_for_lack_ACE_OS - if (this->component_map_. - bind (this->shared_components_[j].name.in (), - Components::CCMObject::_nil ())) - //FUZZ: enable check_for_lack_ACE_OS - { - ACE_CString error ("Duplicate component instance name "); - error += this->shared_components_[j].name.in(); - - throw - (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); - } - } - - - providedReference = - this->create_connections (); - - if (providedReference == 0) + if (this->application_ != 0) { - throw - (Deployment::StartError - ("NodeApplicationManager_Impl::startLaunch", - "Error creating connections for components during startLaunch.")); + CORBA::Object_var app = this->poa_->servant_to_reference (this->application_); + PortableServer::ObjectId_var id = this->poa_->reference_to_id (app); + this->poa_->deactivate_object (id); + + delete this->application_; + this->application_ = 0; } } - catch (const Deployment::UnknownImplId& e) - { - throw Deployment::StartError (e.name.in (), e.reason.in ()); - } - catch (const Deployment::ImplEntryPointNotFound& e) + catch (...) { - throw Deployment::StartError (e.name.in (), e.reason.in ()); + DANCE_ERROR ((LM_WARNING, DLINFO "NodeApplicationManager_Impl::~NodeApplicationManager_Impl - " + "Caught exception in NodeApplicationManager destructor\n")); } - catch (const Deployment::InstallationFailure& e) - { - throw Deployment::StartError (e.name.in (), e.reason.in ()); - } - - return Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); } - Deployment::Application_ptr -CIAO::NodeApplicationManager_Impl_Base:: -perform_redeployment (const Deployment::Properties & configProperty, - Deployment::Connections_out providedReference, - CORBA::Boolean add_or_remove, // true means "add" only - CORBA::Boolean start) -{ - // Prerequisite: - // (1) If this is an existiing old NAM, then <nodeapp_> is ready to use. - // We also got a copy of <plan_> as well as all the installed components - // in the <component_map_>. - // (2) Then we should call <install> operation on the NA, but in order to do this, - // we must pack all the to-be-added components into some appropriate - // data structure called "NodeImplementationInfo". - // (3) We should also call <remove> operation on the NA to remove those - // to-be-removed components, and the "comp_inst_name" could be as input. - // (4) We should also consider removing all the unneeded "connections", but - // this should be driven by the DAM, so it looks like that we need to - // add another operation on the NA interface which is a counterpart of - // <finishLaunch>, something like <finishLaunch_remove_only>. - // - // - // - // (1) If this is an brand new NAM, then only new installation is needed. - // (2) Then we could pretty much replicate the "startLaunch" implementation. - // This capability is useful to install a set of new components into - // some totally new nodes. - - - CIAO_TRACE ("CIAO::NodeApplicationManager_Impl_Base::perform_redeployment"); - - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) NodeApplicationManager_Impl_Base: " - "invoked CIAO::NodeApplicationManager_Impl_Base::perform_redeployment \n")); - try - { - if (! CORBA::is_nil (this->nodeapp_.in ())) - { - if (add_or_remove == true) - { - this->add_new_components (); - } - else - { - this->remove_existing_components (); - } - - // NOTE: We are propogating back "all" the facets/consumers object - // references to the DAM, including the previous existing ones. - providedReference = - this->create_connections (); - - if (providedReference == 0) - { - throw Deployment::InstallationFailure ("NodeApplicationManager_Impl::startLaunch", - "Error creating connections during startLaunch."); - } - } - 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); - } - } - catch (const Deployment::UnknownImplId& e) - { - throw Deployment::UnknownImplId (e.name.in (), e.reason.in ()); - } - catch (const Deployment::ImplEntryPointNotFound& e) - { - throw Deployment::ImplEntryPointNotFound (e.name.in (), e.reason.in ()); - } - catch (const Deployment::InstallationFailure& e) - { - throw Deployment::InstallationFailure (e.name.in (), e.reason.in ()); - } - - return Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); -} - - -void -CIAO::NodeApplicationManager_Impl_Base:: -add_new_components () -{ - try - { - // We ignored those components that are already in the <component_map_>, for - // the rest ones, we pack them into NodeImplementationInfo. - Deployment::DeploymentPlan tmp_plan = this->plan_; - tmp_plan.instance.length (0); - - const CORBA::ULong length = this->plan_.instance.length (); - for (CORBA::ULong i = 0; i < length; ++i) - { - // add the new components into the tmp_plan - if (this->component_map_.find (this->plan_.instance[i].name.in ()) != 0) - { - CORBA::ULong cur_len = tmp_plan.instance.length (); - tmp_plan.instance.length (cur_len + 1); - tmp_plan.instance[cur_len] = this->plan_.instance[i]; - } - } - - // If there are no new components to be installed ... - if (tmp_plan.instance.length () == 0) - return; +NodeApplicationManager_Impl::startLaunch (const Deployment::Properties &, + Deployment::Connections_out providedReference) +{ + DANCE_TRACE (DLINFO "NodeApplicationManager_Impl::startLaunch"); + + // Creating NodeApplication object + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplicationManager_impl::startLaunch - " + "Initializing NodeApplication\n")); + ACE_NEW_THROW_EX (this->application_, + NodeApplication_Impl (this->orb_.in(), + this->poa_.in(), + this->plan_, + this->redirection_, + this->node_name_, + this->properties_), + CORBA::NO_MEMORY ()); - // package the components - NodeImplementationInfoHandler handler (tmp_plan, - this->shared_components_); - Deployment::NodeImplementationInfo * node_info = - handler.node_impl_info (); + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplicationManager_impl::startLaunch - " + "Instructing NodeApplication to initialize components. \n")); + this->application_->init_components(); - if (!node_info) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) NodeApplicationManager.cpp -" - "CIAO::NodeApplicationManager_Impl::perform_redeployment -" - "Failed to create Node Implementation Infos!\n")); + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplicationManager_impl::startLaunch - " + "Collecting connection references\n")); + providedReference = this->application_->getAllConnections(); + //this->parent_.registerConnections(this->plan_.UUID.in(), *providedReference); - throw - (Deployment::PlanError ("NodeApplicationManager_Imp::perform_redeployment", - "Unable to get node level infos")); - } + DANCE_DEBUG((LM_DEBUG, DLINFO "NodeApplicationManager_impl::startLaunch - " + "Activating NodeApplication servant\n")); + PortableServer::ObjectId_var as_id = + this->poa_->activate_object (this->application_); - // Install the components - // This is what we will get back, a sequence of component object refs. - Deployment::ComponentInfos_var comp_info; - comp_info = this->nodeapp_->install (*node_info); + CORBA::Object_var as_obj = this->poa_->id_to_reference (as_id.in ()); + Deployment::Application_var app = Deployment::Application::_narrow (as_obj.in ()); - // 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) - { - //FUZZ: disable check_for_lack_ACE_OS - //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()))) - { - //FUZZ: enable check_for_lack_ACE_OS - ACE_CString error ("Duplicate component instance name "); - error += comp_info[len].component_instance_name.in(); - - throw - (Deployment::PlanError - ("NodeApplicationManager_Impl::startLaunch", - error.c_str ())); - } - } - } - catch (const CORBA::Exception&) - { - ACE_ERROR ((LM_ERROR, "NodeApplicationManager_Impl_Base::" - "add_new_components () exception caught.\n")); - throw; - } + return app._retn (); } - void -CIAO::NodeApplicationManager_Impl_Base:: -remove_existing_components () +NodeApplicationManager_Impl::destroyApplication (Deployment::Application_ptr application) { + DANCE_TRACE (DLINFO "NodeApplicationManager_Impl::destroyApplication"); + try - { - ACE_Vector<ACE_CString> gone_component_list; - - for (Component_Iterator iter (this->component_map_.begin ()); - iter != this->component_map_.end (); - ++iter) - { - ACE_CString comp_name ((*iter).ext_id_.c_str ()); - - // If this component is not in the new deployment plan, then we - // should destroy this component and unbind from the map. - if (this->is_to_be_removed (comp_name.c_str ())) - { - ((*iter).int_id_)->ciao_passivate (); - this->nodeapp_->remove_component (comp_name.c_str ()); - gone_component_list.push_back (comp_name); - } - } - - for (size_t i = 0; i < gone_component_list.size (); ++i) - this->component_map_.unbind (gone_component_list[i]); - } - catch (const CORBA::Exception&) - { - ACE_ERROR ((LM_ERROR, "NodeApplicationManager_Impl_Base::" - "remove_existing_components () exception caught.\n")); - throw; - } -} - -bool -CIAO::NodeApplicationManager_Impl_Base:: -is_to_be_removed (const char * name) -{ - const CORBA::ULong length = this->plan_.instance.length (); - for (CORBA::ULong i = 0; i < length; ++i) - { - if (ACE_OS::strcmp (name, - this->plan_.instance[i].name.in ()) == 0) - { - // If we have found it in the new plan, then this component - // needs to be kept, and should not be removed. - return false; - } - } - return true; -} - -void -CIAO::NodeApplicationManager_Impl_Base:: -set_shared_components (const Deployment::ComponentPlans & shared) -{ - this->shared_components_ = shared; -} - -void -CIAO::NodeApplicationManager_Impl_Base:: -destroyApplication (Deployment::Application_ptr app) -{ - CIAO_TRACE("CIAO::NodeApplicationManager_Impl::destroyApplication"); - ACE_UNUSED_ARG (app); - - 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. - if (CORBA::is_nil (this->nodeapp_.in () )) - throw Deployment::StopError (); - - // Iterate over all the components within this NAM, and if it's - // not a shared component, then remove it. If all the components - // 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)) - { - 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 ()); - 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_DEBUG ((LM_DEBUG, "NAM: remove returned\n")); - - return; -} - -// The set priority method -::CORBA::Long -CIAO::NodeApplicationManager_Impl_Base::set_priority ( - const char * cid, - const ::Deployment::Sched_Params & params) -{ - 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; - } - - // FUZZ: disable check_for_lack_ACE_OS - // 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); - // FUZZ: enable check_for_lack_ACE_OS - - // 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) -{ -} - -CIAO::NodeApplicationManager_Impl:: -NodeApplicationManager_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - bool is_multi_threaded) - : NodeApplicationManager_Impl_Base (o, p) - , is_multi_threaded_ (is_multi_threaded) -{ -} - -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) -{ - PortableServer::ObjectId_var oid; - - try - { - if (nodeapp_location == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::init -" - "NULL NodeApplication location. \n")); - throw CORBA::BAD_PARAM (); - } - - if (delay == 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) NodeApplicationManager_Impl.cpp -" - "CIAO::NodeApplicationManager_Impl::init -" - "NodeManager must be started with a -d " - "of greter than zero.\n")); - throw CORBA::BAD_PARAM (); - } - - this->nodeapp_path_.set (nodeapp_location); - this->spawn_delay_ = delay; - this->nodeapp_command_op_ = CORBA::string_dup (nodeapp_op); - this->node_manager_ = nm; - - // Make a copy of the plan for later usage. - this->plan_ = plan; - - // Cache the call back POA for callback object. - this->callback_poa_ = PortableServer::POA::_duplicate (callback_poa); - - // Activate the ourself. - oid = this->poa_->activate_object (this); - - CORBA::Object_var obj = - this->poa_->id_to_reference (oid.in ()); - - // And cache the object reference. - this->objref_ = - Deployment::NodeApplicationManager::_narrow (obj.in ()); - - // 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")); - } - */ - } - - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeApplicationManager_Impl_Base::init\t\n"); - throw; - } - - //return this object reference - return oid.in (); -} - -Deployment::NodeApplication_ptr -CIAO::NodeApplicationManager_Impl:: -create_node_application (const ACE_CString & options) -{ - CIAO_TRACE("CIAO::NodeApplicationManager_Impl::create_node_application"); - Deployment::NodeApplication_var retval; - Deployment::Properties_var prop; - - ACE_NEW_THROW_EX (prop, - Deployment::Properties, - CORBA::NO_MEMORY ()); - - // @@ Create a new callback servant. - 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 (), - this->waitCond_, - this->mutex_), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var servant_var (callback_servant); - PortableServer::ObjectId_var cb_id - = this->callback_poa_->activate_object (callback_servant); - - ACE_Process_Options p_options; - ACE_Process_Manager process_manager; - - process_manager.open (10, ACE_Reactor::instance ()); - - try - { - CORBA::Object_var cb_obj = - this->callback_poa_->id_to_reference (cb_id.in ()); - - CIAO::NodeApplication_Callback_var cb = - CIAO::NodeApplication_Callback::_narrow (cb_obj.in ()); - - CORBA::String_var cb_ior = - this->orb_->object_to_string (cb.in ()); - - // spawn the new NodeApplication. - p_options.command_line ("%s -k %s " - "%s", - this->nodeapp_path_.c_str (), - cb_ior.in (), - options.c_str ()); - - p_options.avoid_zombies (0); - - process_id_ = node_app_process_manager_.spawn (p_options, - &child_handler_); - - if (process_id_ == ACE_INVALID_PID) - { - if (CIAO::debug_level () > 1) - { - ACE_ERROR ((LM_ERROR, - "Fail to spawn a NodeApplication process\n")); - } - - throw - (Deployment::ResourceNotAvailable - ("Failed to spawn process", - "NodeApplication", - "", - "", - "")); - } - - // wait for nodeApp to pass back its object reference. with a - // timeout value. using perform_work and stuff. - ACE_Time_Value timeout (this->spawn_delay_, 0); - - if (this->is_multi_threaded_) - retval = multi_threaded_wait_for_callback (callback_servant, timeout); - else - retval = single_threaded_wait_for_callback (callback_servant, timeout); - - if (CORBA::is_nil (retval.in ())) - { - if (CIAO::debug_level () > 1) - { - ACE_ERROR ((LM_ERROR, - "Fail to acquire the NodeApplication object\n")); - } - - throw Deployment::ResourceNotAvailable (); - } - + { + if (!application->_is_equivalent (this->poa_->servant_to_reference (this->application_))) { - //ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - this->nodeapp_ = - Deployment::NodeApplication::_duplicate (retval.in ()); + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplicationManager_Impl::destroyApplication - " + "application is equivalent to current application \n")); + throw ::Deployment::StopError(); } - } - catch (const CORBA::Exception&) - { - this->callback_poa_->deactivate_object (cb_id.in ()); - - throw; - } - - this->callback_poa_->deactivate_object (cb_id.in ()); - - if (CIAO::debug_level () > 1) - { - ACE_DEBUG ((LM_DEBUG, - "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 (); -} - - -Deployment::NodeApplication_ptr -CIAO::NodeApplicationManager_Impl:: -single_threaded_wait_for_callback ( - CIAO::NodeApplication_Callback_Impl * cb_servant, - ACE_Time_Value &timeout) -{ - // Below code is broken for thread-per-connection concurrency model, - // since the main thread is running ORB event loop and will spawn - // a different thread to handle the call <register_node_application>, - // the <perform_work> operation will not be invoked and finally - // a timeout will occur. For a similar reason, it won't work - // for thread-pool concurrency model. - Deployment::NodeApplication_var retv; - while (true) - { - this->orb_->perform_work (timeout); - - retv = cb_servant->get_nodeapp_ref (); - - if ((timeout == ACE_Time_Value::zero) || !CORBA::is_nil (retv.in ())) - break; - } - - return retv._retn (); -} - -Deployment::NodeApplication_ptr -CIAO::NodeApplicationManager_Impl:: -multi_threaded_wait_for_callback ( - CIAO::NodeApplication_Callback_Impl* cb_servant, - ACE_Time_Value &timeout) -{ - Deployment::NodeApplication_var retv; - - // Wait for a conditional variable - this->mutex_.acquire (); - while (! cb_servant->is_callback_completed ()) - this->waitCond_.wait (&timeout); - retv = cb_servant->get_nodeapp_ref (); - this->mutex_.release (); - - return retv._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) - : NodeApplicationManager_Impl_Base (o, p), - static_config_entrypoints_maps_ (static_config_entrypoints_maps) -{ -} - -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) -{ - PortableServer::ObjectId_var oid; - - ACE_UNUSED_ARG (nodeapp_location); - ACE_UNUSED_ARG (nodeapp_op); - ACE_UNUSED_ARG (delay); - ACE_UNUSED_ARG (callback_poa); - - try - { - this->node_manager_ = nm; - - // Make a copy of the plan for later usage. - this->plan_ = plan; - - // Activate the ourself. - oid = this->poa_->activate_object (this); - - CORBA::Object_var obj = - this->poa_->id_to_reference (oid.in ()); - - // And cache the object reference. - this->objref_ = - Deployment::NodeApplicationManager::_narrow (obj.in ()); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeApplicationManager_Impl_Base::init\t\n"); - throw; - } - - //return this object reference - return oid.in (); -} - -Deployment::NodeApplication_ptr -CIAO::Static_NodeApplicationManager_Impl:: -create_node_application (const ACE_CString & options) -{ - ACE_UNUSED_ARG(options); - - CIAO::NodeApplication_Impl *nodeapp_servant; - - 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_), - Deployment::NodeApplication::_nil () - ); - if (nodeapp_servant->init ()) - { - ACE_DEBUG ((LM_DEBUG, "NodeApplication Failed on creating and\ - initializing the session container!")); - return Deployment::NodeApplication::_nil (); - } - - // CONFIGURING NodeApplication - PortableServer::ObjectId_var nodeapp_oid - = poa_->activate_object (nodeapp_servant); + this->redirection_.unregister (this->node_name_, this->plan_.UUID.in()); + + CORBA::Any val; - CORBA::Object_var - obj = poa_->id_to_reference (nodeapp_oid.in ()); - - Deployment::NodeApplication_var nodeapp_obj = - Deployment::NodeApplication::_narrow (obj.in ()); - - if (CORBA::is_nil (nodeapp_obj.in ())) - { - ACE_ERROR ((LM_ERROR, "Unable to activate NodeApplication object\n")); - return Deployment::NodeApplication::_nil (); - } - - this->nodeapp_ = Deployment::NodeApplication::_duplicate (nodeapp_obj.in ()); - - return nodeapp_obj._retn (); -} - -CIAO::NodeApplicationManager_Impl_Base::~NodeApplicationManager_Impl_Base (void) -{ + if (this->properties_.find (DAnCE::STANDALONE_NM, + val) == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicationManager_Impl::destroyApplication - " + "Found STANDALONE_NM property\n")); + + CORBA::Boolean standalone (false); + + val >>= CORBA::Any::to_boolean (standalone); + if (standalone) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplicationManager_Impl::destroyApplication - " + "Acting as a standalone NM, passivating and removing installed components\n")); + + this->application_->passivate_components (); + this->application_->remove_components (); + } + } + + + PortableServer::ObjectId_var id = this->poa_->reference_to_id (application); + this->poa_->deactivate_object (id); + + delete this->application_; + this->application_ = 0; + } + catch (CORBA::SystemException &) + { + throw; + } + catch (Deployment::StopError &) + { + throw; + } + catch (CORBA::UserException &e) + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplicationManager_Impl::destroyApplication failed with UserException %s(%s) \"%s\"\n", + e._name(), e._rep_id(), e._info().c_str())); + throw Deployment::StopError(e._name(), e._info().c_str()); + } + catch (...) + { + DANCE_ERROR((LM_ERROR, DLINFO "NodeApplicationManager_Impl::destroyApplication failed with unknown exception.\n")); + throw Deployment::StopError(); + } +} + +void +NodeApplicationManager_Impl::register_plan(void) +{ + DANCE_TRACE(DLINFO "NodeApplicationManager_Impl::register_plan()"); + + this->redirection_.registration_start (this->node_name_, this->plan_.UUID.in()); + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplicationManager_Impl::register_plan - registering objects...\n")); + for (unsigned int i = 0; i < this->plan_.instance.length(); i++) + { + this->redirection_.registration (this->node_name_, + this->plan_.UUID.in(), + this->plan_.instance[i].name.in(), + CORBA::Object::_nil()); + } + + DANCE_DEBUG((LM_TRACE, DLINFO "NodeApplicationManager_Impl::register_plan - registering endpoints...\n")); + for (unsigned int i = 0; i < this->plan_.connection.length(); i++) + { + for (unsigned int j = 0; j < this->plan_.connection[i].internalEndpoint.length(); j++) + { + if (this->plan_.connection[i].internalEndpoint[j].provider) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicationManager_Impl::register_plan - ", + "Registering Port '%s' on instance '%s' on node '%s'\n", + this->plan_.connection[i].internalEndpoint[j].portName.in(), + this->plan_.instance[this->plan_.connection[i].internalEndpoint[j].instanceRef].name.in(), + this->node_name_.c_str ())); + this->redirection_.registration (this->node_name_, + this->plan_.UUID.in(), + this->plan_.instance[this->plan_.connection[i].internalEndpoint[j].instanceRef].name.in(), + this->plan_.connection[i].internalEndpoint[j].portName.in(), + CORBA::Object::_nil()); + } + } + } + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeApplicationManager_Impl::register_plan - " + "Finishing registration\n")); + this->redirection_.registration_finish (this->node_name_, this->plan_.UUID.in()); } diff --git a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h index 50cfb3476e0..73b70010e52 100644 --- a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h +++ b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h @@ -1,380 +1,59 @@ -// $Id$ - // -*- C++ -*- //============================================================================= /** * @file NodeApplicationManager_Impl.h * - * @author Tao Lu <lu@dre.vanderbilt.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> + * $Id$ + * + * @Brief Implementation of POA_Deployment::NodeApplicationManager * - * This file contains implementation for the servant of - * Deployment::NodeApplicationManager. + * @author Erwin Gottlieb <eg@prismtech.com> */ //============================================================================= +#ifndef NODEAPPLICATIONMANAGER_IMPL_H_ +#define NODEAPPLICATIONMANAGER_IMPL_H_ -#ifndef CIAO_NODEAPPLICATIONMANAGER_IMPL_H -#define CIAO_NODEAPPLICATIONMANAGER_IMPL_H -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" -#include "ace/Hash_Map_Manager_T.h" -#include "ace/OS_NS_sys_wait.h" -#include "ace/Process_Manager.h" -#include "ace/Synch.h" -#include "DAnCE/Deployment/NodeApp_CB_Impl.h" -#include "DAnCE/Deployment/Deployment_NodeApplicationManagerS.h" -#include "ciao/CIAO_common.h" -#include "CIAO_NAM_Export.h" -#include "ImplementationInfo.h" -#include "NodeManager/NodeManager_Impl.h" -#include "NodeApplication/NodeApplication_Core.h" +#include "NodeApplicationManager_Export.h" +#include "Deployment/Deployment_DeploymentPlanC.h" +#include "Deployment/Deployment_NodeApplicationManagerS.h" +#include "Deployment/Deployment_NodeApplicationC.h" +#include "NodeApplication/NodeApplication_Impl.h" +#include "RedirectionService/RedirectionService.h" -namespace CIAO -{ - - /** - * @class NodeApplicationManager_Impl_Base - */ - class CIAO_NAM_Export NodeApplicationManager_Impl_Base - : public virtual POA_Deployment::NodeApplicationManager +namespace DAnCE { - public: - /// Constructor - NodeApplicationManager_Impl_Base (CORBA::ORB_ptr o, - PortableServer::POA_ptr p); - - /*=========================================================== - * Below are operations from the NodeApplicationManager - * - *============================================================*/ - - /// The return type is NodeApplication_ptr actually. - /// For "external/shared" components of this child plan, they are - /// not actaully installed, however, the object references - /// of the ports of these external components are returned - /// through <providedReference>. - virtual Deployment::Application_ptr - startLaunch (const Deployment::Properties & configProperty, - Deployment::Connections_out providedReference, - CORBA::Boolean start); - - //@@ Destroy the whole applicaton. - virtual void destroyApplication (Deployment::Application_ptr); - - virtual Deployment::Application_ptr - perform_redeployment (const Deployment::Properties & configProperty, - Deployment::Connections_out providedReference, - CORBA::Boolean add_or_remove, - CORBA::Boolean start); - - virtual void - reset_plan (const ::Deployment::DeploymentPlan & plan); - - virtual void - set_shared_components (const Deployment::ComponentPlans & shared); - - /** - * A factory operation to create NodeApplicationManager interface, and return - * the object reference. - * Initialize the NodeApplicationManager. The current implementation - * of CIAO_NodeApplicationManager can only activate CIAO's own - * NodeApplication processes. You should specify the location - * (pathname) of the NodeApplication and the delay. - * CIAO_NodeApplicationManager should wait (in second) for NodeApplication to - * call back. - * - * @param nodeapp_location A null-termiated char * string pointing - * to the pathname of a NodeApplication executable. - * - * @param nodeapp_options A null-terminated char * string - * containing command line options to be passed to the - * NodeApplication. - * - * @param delay instructs how long (in second) a CIAO_NodeApplicationManager - * should wait for a newly spawned NodeApplication to pass back - * its IOR. - * - * @param plan has all the information needed for the NodeAppManager to - * construct the application locally. Note, this includes the properties - * of the NodeApplication. For example, ORB config options etc. - * - * @param callback_poa contains child poa created for the callback interface. - * - * @para nm Pointer to the NodeManager_Impl servant object - * - * @return NodeApplicationManager_ptr. - **/ - virtual PortableServer::ObjectId - init (const char *nodeapp_location, - const char *nodeapp_options, - const CORBA::ULong delay, - const Deployment::DeploymentPlan & plan, - const PortableServer::POA_ptr callback_poa, - NodeManager_Impl_Base * nm) - =0; - - /// @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); - - protected: - /// Destructor - virtual ~NodeApplicationManager_Impl_Base (void); - - /// Add new components - virtual void - add_new_components (void); - - /// Remove existing components - virtual void - remove_existing_components (void); - - /// Determine whether a component is absent in the new_plan - /// Return true if absent - virtual bool - is_to_be_removed (const char * name); - - /// Internal help function to create new NodeApplicationProcess - virtual Deployment::NodeApplication_ptr - create_node_application (const ACE_CString & options) = 0; - - /// Helper function to get the connection. - virtual Deployment::Connections * create_connections (); - - /** - * Find the configurations in the plan and prepare them to pass to the - * NodeApplication, from command line probably. - */ - void parse_config_value (ACE_CString & str); - - /// Helper function to check wheather a component instance - /// is in the "shared components list". - bool is_shared_component (ACE_CString & name); - - /// Helper function to check wheather a component instance - /// is in the "shared components list". - bool is_external_component (ACE_CString & name); - - protected: - /// location of the Nodeapplication - ACE_CString nodeapp_path_; - - /// Keep a pointer to the managing ORB serving this servant. - CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. - PortableServer::POA_var poa_; - - /// Pointer to the NodeManager_Impl servant object - /// We could do this because NodeManager and NodeApplicationManager - /// are always collocated in the same process, so we don't have - /// to pass CORBA object reference back and forth. - NodeManager_Impl_Base * node_manager_; - - /// ObjectRef of ourself which will be needed by the callback - Deployment::NodeApplicationManager_var objref_; - - /// Child poa that uses active object map. - PortableServer::POA_var callback_poa_; - - /// Cache a object reference of the underlying NodeApplication - /// Since I have decided to have only 1 NA in NAM so no map is needed. - Deployment::NodeApplication_var nodeapp_; - - /// Cached plan (This should be the part of the whole plan local to this node) - /// The plan will be initialized when init is called. - Deployment::DeploymentPlan plan_; - - /// Specify the time in second NodeApplicationManager will wait for a - /// child NodeApplication to callback. Default is 5 second. - CORBA::ULong spawn_delay_; - - /// Extracted commandline options to pass to the NodeApplication. - CORBA::String_var nodeapp_command_op_; - /// A list of components shared across deployment plans - Deployment::ComponentPlans shared_components_; + class NodeManager_Impl; - /// A list of components that are "external" to this plan - Deployment::ComponentPlans external_components_; - - /// A map of the component created on this node. - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - Components::CCMObject_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> CCMComponent_Map; - typedef CCMComponent_Map::iterator Component_Iterator; - CCMComponent_Map component_map_; - - /// 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_; - - /// For synchronization between multiple threads - ACE_Condition<TAO_SYNCH_MUTEX> waitCond_; - TAO_SYNCH_MUTEX mutex_; - }; - - - /** - * @class NAM_Handler - * @brief The signal handler class for the SIGCHLD - * handling to avoid zombies - * - */ - class NAM_Handler : public ACE_Event_Handler + class NodeApplicationManager_Export NodeApplicationManager_Impl : public virtual POA_Deployment::NodeApplicationManager { 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; - } + NodeApplicationManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const Deployment::DeploymentPlan& plan, + RedirectionService & redirection, + const ACE_CString& name, + const PROPERTY_MAP &properties); + + virtual ~NodeApplicationManager_Impl(); + + virtual Deployment::Application_ptr + startLaunch (const Deployment::Properties & configProperty, + Deployment::Connections_out providedReference); + + virtual void destroyApplication (Deployment::Application_ptr); + private: + void register_plan(); + + Deployment::DeploymentPlan plan_; + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + NodeApplication_Impl* application_; + RedirectionService & redirection_; + ACE_CString node_name_; + PROPERTY_MAP properties_; }; - - - /** - * @class NodeApplicationManager_Impl - */ - class CIAO_NAM_Export NodeApplicationManager_Impl - : public virtual NodeApplicationManager_Impl_Base - { - public: - /// Constructor - NodeApplicationManager_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - bool is_multi_threaded); - - virtual PortableServer::ObjectId - init (const char *nodeapp_location, - const char *nodeapp_options, - const CORBA::ULong delay, - const Deployment::DeploymentPlan & plan, - const PortableServer::POA_ptr callback_poa, - NodeManager_Impl_Base * nm); - - protected: - /// Destructor - virtual ~NodeApplicationManager_Impl (void); - - // Internal help function to create new NodeApplicationProcess - // Here we override it to create an in-process NodeApplication object - virtual Deployment::NodeApplication_ptr - create_node_application (const ACE_CString & options); - - /// This method is only applicable when our program is configured as - /// singled threaded . Internally it uses a <perform_work> blocking - /// call to wait for NA object to call back - Deployment::NodeApplication_ptr - single_threaded_wait_for_callback ( - CIAO::NodeApplication_Callback_Impl* cb_servant, - ACE_Time_Value &timeout); - - /// This method is only applicable when our program is configured as - /// multiple threaded. Internally it waits on a conditional variable - /// that could be modified by the callback servant which runs in - /// another thread - Deployment::NodeApplication_ptr - multi_threaded_wait_for_callback ( - CIAO::NodeApplication_Callback_Impl* cb_servant, - ACE_Time_Value &timeout); - - /** - * @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_; - - private: - /// Whether we run ourselves in multi threaded configuration or not - /// By default, we run in single threaded configuration. - bool is_multi_threaded_; - }; - - - struct Static_Config_EntryPoints_Maps; - - /** - * @class Static_NodeApplicationManager_Impl - */ - class CIAO_NAM_Export Static_NodeApplicationManager_Impl - : public virtual NodeApplicationManager_Impl_Base - { - public: - /// Constructor - Static_NodeApplicationManager_Impl (CORBA::ORB_ptr o, - PortableServer::POA_ptr p, - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps); - - virtual PortableServer::ObjectId - init (const char *nodeapp_location, - const char *nodeapp_options, - const CORBA::ULong delay, - const Deployment::DeploymentPlan & plan, - const PortableServer::POA_ptr callback_poa, - NodeManager_Impl_Base * nm); - - protected: - /// Destructor - virtual ~Static_NodeApplicationManager_Impl (void); - - /// Internal help function to create new NodeApplicationProcess - /// Here we override it to create an in-process NodeApplication object - virtual Deployment::NodeApplication_ptr - create_node_application (const ACE_CString & options); - - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps_; - - CIAO::NodeApp_Configurator configurator_; - }; -} - -#if defined (__ACE_INLINE__) -# include "NodeApplicationManager_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* CIAO_NODEAPPLICATIONMANAGER_IMPL_H */ +}; +#endif /*NODEAPPLICATIONMANAGER_IMPL_H_*/ diff --git a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl b/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl deleted file mode 100644 index 14853100039..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -ACE_INLINE -CIAO::NodeApplicationManager_Impl_Base:: -NodeApplicationManager_Impl_Base (CORBA::ORB_ptr o, - PortableServer::POA_ptr p) - : orb_ (CORBA::ORB::_duplicate (o)), - poa_ (PortableServer::POA::_duplicate (p)), - callback_poa_ (PortableServer::POA::_nil ()), - nodeapp_ (Deployment::NodeApplication::_nil ()), - spawn_delay_ (5), - waitCond_ (this->mutex_) - // @@ (OO) The default size for an ACE_Hash_Map_Mapanger is quiet - // large. The maximum size of an ACE_Hash_Map_Manager is - // also fixed, i.e. it does not grow dynamically on demand. - // Make sure the default size of component_map_ is - // appropriate for your needs. You may also want to make - // the size configurable at compile-time, at least. -{ -} - -ACE_INLINE -void -CIAO::NodeApplicationManager_Impl_Base:: -parse_config_value (ACE_CString &) -{ - throw CORBA::NO_IMPLEMENT(); -} - -ACE_INLINE -Deployment::NodeApplicationManager_ptr -CIAO::NodeApplicationManager_Impl_Base::get_nodeapp_manager (void) -{ - return this->objref_.in (); -} - -ACE_INLINE void -CIAO::NodeApplicationManager_Impl_Base:: -reset_plan (const ::Deployment::DeploymentPlan & plan) -{ - this->plan_ = plan; -} - diff --git a/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp b/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp deleted file mode 100644 index 5d211603614..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/URL_Parser.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// $Id$ - -#include "URL_Parser.h" - -#include "ace/ACE.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; - break; - } - } - - if (this->hostname_ == 0 || this->filename_ == 0) - { - success = false; - } - - return success; -} - -URL_Parser::URL_Parser (void) - : hostname_ (ACE::strnew ("127.0.0.1")), - port_ (ACE_DEFAULT_HTTP_SERVER_PORT), - filename_ (0), - debug_ (0) -{ -} - -bool URL_Parser::parseURL (char* url) -{ - char* ptr = ACE_OS::strstr (url, "http://"); - bool success = true; - - if (0 != ptr) - { - url += ACE_OS::strlen ("http://"); - } - - if (url[0] == '/') - { - this->filename_ = ACE_OS::strdup (url); - } - else - { - ptr = ACE_OS::strstr (url, ":"); - - if (0 != ptr) - { - this->port_ = ACE_OS::atoi (ptr + 1); - } - else - { - ptr = ACE_OS::strstr (url, "/"); - } - - if (0 == ptr) - { - success = false; - } - else - { - size_t host_len = ptr - url; - ACE::strdelete (this->hostname_); - ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false); - ACE_OS::strncpy (this->hostname_, url, host_len); - this->hostname_ [host_len] = '\0'; - ptr = ACE_OS::strstr (ptr, "/"); - - if (0 != 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 (void) -{ - delete [] this->hostname_; - ACE_OS::free (this->filename_); -} diff --git a/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h b/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h deleted file mode 100644 index 0aec98cec65..00000000000 --- a/CIAO/DAnCE/NodeApplicationManager/URL_Parser.h +++ /dev/null @@ -1,67 +0,0 @@ - -/* -*- 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 <URL_Parser, ACE_Null_Mutex> TheURL_Parser; - - -class URL_Parser -{ -public: - - friend class ACE_Singleton <URL_Parser, ACE_Null_Mutex>; - - /// 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: - /// protected constructor, singleton - URL_Parser (void); -}; - - - -#endif /* URL_PARSER_H */ diff --git a/CIAO/DAnCE/NodeManager/BaseMonitor.h b/CIAO/DAnCE/NodeManager/BaseMonitor.h deleted file mode 100644 index 5fe6a950908..00000000000 --- a/CIAO/DAnCE/NodeManager/BaseMonitor.h +++ /dev/null @@ -1,63 +0,0 @@ -// $Id$ -//---------------------------------------------------------------------------------- -/// Monitor Interface -/* - * @file BaseMonitor.h - * @brief The BaseMonitor.h file. - * This is an abstract class containing the interface to the Monitor plug-in - * - * @author Nilabja R <nilabjar@dre.vanderbilt.edu> - */ -//---------------------------------------------------------------------------------- - -#ifndef MONITOR_BASEH -#define MONITOR_BASEH -#include "tao/ORB.h" -#include "DAnCE/Deployment/Deployment_TargetManagerC.h" - -namespace CIAO -{ - - class MonitorBase - { - public: - virtual ~MonitorBase () {}; - - /** - * This function is called by the controller to initialize - * parameters. - * @param domain The Initital domain for this host - * @param target_manager TargetManager_ptr - * @param interval The time interval after which updates need to be send. - */ - virtual int initialize_params ( - ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target_manager, - int interval - )=0; - /** - * This function is called by the controller - * to start up the monitor. - * @param orb The ORB pointer - */ - virtual int start (CORBA::ORB_ptr orb) = 0; - /** - * This function is called by the controller - * to stop the monitor. - */ - virtual int stop ()=0; - /** - * This function is called by the controller - * to get the current data. - * @return The current Domain data - */ - virtual ::Deployment::Domain* get_current_data ()=0; - }; - - extern "C" ACE_Proper_Export_Flag CIAO::MonitorBase * - createMonitor (void); - -} // CIAO - - -#endif /* MONITOR_BASEH */ diff --git a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp b/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp deleted file mode 100644 index 9d9417da520..00000000000 --- a/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// $Id$ -//========================================================================== -/// The RSS Monitor class defination -/** - * @file CIAO_Monitor.cpp - * - * @brief The Monitor class defination - * - * @author Nilabja Roy <nilabjar@dre.vanderbilt.edu> - */ -//========================================================================== - -#include "CIAO_Monitor.h" -#include "CIAO_common.h" -#include "ace/OS_NS_stdio.h" - -extern "C" ACE_Proper_Export_Flag CIAO::MonitorBase * CIAO::createMonitor () -{ - CIAO::CIAO_Monitor* monitor = 0; - ACE_NEW_RETURN (monitor, CIAO::CIAO_Monitor, 0); - return monitor; -} - -CIAO::CIAO_Monitor::CIAO_Monitor () -{ -} - -/// The Desctructor -CIAO::CIAO_Monitor::~CIAO_Monitor () -{ -} - -int CIAO::CIAO_Monitor::initialize_params ( - ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target_manager, - int interval - ) -{ - current_domain_.reset (new ::Deployment::Domain (domain)); - target_ptr_= target_manager; - this->interval_=interval; - - return 0; -} - -int CIAO::CIAO_Monitor::start (CORBA::ORB_ptr) -{ - return 0; -} - -int CIAO::CIAO_Monitor::stop () -{ - return 0; -} - -::Deployment::Domain* CIAO::CIAO_Monitor::get_current_data () -{ - if (CIAO::debug_level () > 9) - { - // ACE_DEBUG ((LM_DEBUG , - // "CIAO_Monitor::Inside the get_current_data of[%s]\n", - // current_domain_->node[0].name.in ())); - } - - 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 = 0; - - load_file = ACE_OS::fopen ("/proc/stat", "r"); - - if (load_file == 0) - { - // load file cannot be opened .. - current_load = 0; - } - else - { - 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); - - ACE_OS::fclose (load_file); - - // Calculate the percent CPU - long const current_user_cpu = user_cpu - prev_user_cpu_; - long const 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; - - } - - - 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 (!ACE_OS::strcmp (current_domain_->node[0].resource[i].name, "Processor")) - { - for (unsigned int j = 0; - j < current_domain_->node[0].resource[i].property.length (); - j++) - { - if (!ACE_OS::strcmp ( - current_domain_ - ->node[0].resource[i].property[j].name.in (), - "LoadAverage")) - { - current_domain_->node[0].resource[i].property[j].kind = - ::Deployment::Quantity; - current_domain_->node[0].resource[i].property[j].value = - any; - } - } - } - } - - return current_domain_.get (); -} diff --git a/CIAO/DAnCE/NodeManager/CIAO_Monitor.h b/CIAO/DAnCE/NodeManager/CIAO_Monitor.h deleted file mode 100644 index 5a134538701..00000000000 --- a/CIAO/DAnCE/NodeManager/CIAO_Monitor.h +++ /dev/null @@ -1,107 +0,0 @@ -// $Id$ -//========================================================================== -/** - * @file CIAO_Monitor.h - * - * @brief The Monitor class. - * - * This class periodically records the loadavg value of the machine in which it - * loaded - * - * @author Nilabja Roy <nilabjar@dre.vanderbilt.edu> - */ -//========================================================================== - - -#ifndef CIAO_MONITORH -#define CIAO_MONITORH - -#include "BaseMonitor.h" -#include "ace/Auto_Ptr.h" - -/** - * @namespace CIAO - * - * @brief The top level CIAO namespace - * - */ -namespace CIAO -{ - class ReceiverThread; - - /** - * @class CIAO_Monitor - * - * @brief The Monitor class - * - */ - class CIAO_Monitor : public MonitorBase - { - public: - - /** @function Constructor - */ - CIAO_Monitor (); - - /** - * This function is called by the controller to initialize - * parameters. - * @param domain The Initial Domain for this host - * @param target_manager TargetManager_ptr - * @param interval The time interval after whic updates need to be send. - */ - virtual int initialize_params ( - ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target_manager, - int interval - ); - /** - * Destructor - */ - virtual ~CIAO_Monitor (); - - /** - * This method will starts up the Monitor in this case, - * @param orb The orb needed for resolving. - * @return -1 on error - */ - int start (CORBA::ORB_ptr orb); - - /** - * This method will stop the Monitor in this case - * @return -1 on error - */ - int stop (); - - /** - * This function retrieves the current Domain data - * @return -1 on error - */ - ::Deployment::Domain* get_current_data (); - - protected: - - /// The TargetManager Object to be sent to the RSSSubscriber .. - ::Deployment::TargetManager_ptr target_ptr_; - - /// The interval after which update is to be returned. - int interval_; - - /// The Domain data structure - auto_ptr <Deployment::Domain> 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 -#endif /* CIAO_MONITORH */ diff --git a/CIAO/DAnCE/NodeManager/DAnCE_NodeManager_Module_Export.h b/CIAO/DAnCE/NodeManager/DAnCE_NodeManager_Module_Export.h new file mode 100644 index 00000000000..4eaf82f6fee --- /dev/null +++ b/CIAO/DAnCE/NodeManager/DAnCE_NodeManager_Module_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_NodeManager_Module +// ------------------------------ +#ifndef DANCE_NODEMANAGER_MODULE_EXPORT_H +#define DANCE_NODEMANAGER_MODULE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_NODEMANAGER_MODULE_HAS_DLL) +# define DANCE_NODEMANAGER_MODULE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_NODEMANAGER_MODULE_HAS_DLL */ + +#if !defined (DANCE_NODEMANAGER_MODULE_HAS_DLL) +# define DANCE_NODEMANAGER_MODULE_HAS_DLL 1 +#endif /* ! DANCE_NODEMANAGER_MODULE_HAS_DLL */ + +#if defined (DANCE_NODEMANAGER_MODULE_HAS_DLL) && (DANCE_NODEMANAGER_MODULE_HAS_DLL == 1) +# if defined (DANCE_NODEMANAGER_MODULE_BUILD_DLL) +# define DAnCE_NodeManager_Module_Export ACE_Proper_Export_Flag +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_NODEMANAGER_MODULE_BUILD_DLL */ +# define DAnCE_NodeManager_Module_Export ACE_Proper_Import_Flag +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_NODEMANAGER_MODULE_BUILD_DLL */ +#else /* DANCE_NODEMANAGER_MODULE_HAS_DLL == 1 */ +# define DAnCE_NodeManager_Module_Export +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARATION(T) +# define DANCE_NODEMANAGER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_NODEMANAGER_MODULE_HAS_DLL == 1 */ + +// Set DANCE_NODEMANAGER_MODULE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_NODEMANAGER_MODULE_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_NODEMANAGER_MODULE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_NODEMANAGER_MODULE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_NODEMANAGER_MODULE_NTRACE */ + +#if (DANCE_NODEMANAGER_MODULE_NTRACE == 1) +# define DANCE_NODEMANAGER_MODULE_TRACE(X) +#else /* (DANCE_NODEMANAGER_MODULE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_NODEMANAGER_MODULE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_NODEMANAGER_MODULE_NTRACE == 1) */ + +#endif /* DANCE_NODEMANAGER_MODULE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/NodeManager/Monitor.mpc b/CIAO/DAnCE/NodeManager/Monitor.mpc deleted file mode 100644 index c14776f773f..00000000000 --- a/CIAO/DAnCE/NodeManager/Monitor.mpc +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ - - -// MPC file for the Monitor - -project(*monitorlib): ciao_deployment_stub, ciao_events_base_dnc, ace_output { - after += CIAO_TargetManager_stub - includes += $(CIAO_ROOT)/DAnCE/TargetManager - sharedname = ciaomonlib - - libs += TargetManager_stub CIAO_Deployment_stub NodeManager_stub - - IDL_Files { - } - - Header_Files { - } - - Inline_Files { - } - - Template_Files { - } - - Source_Files { - CIAO_Monitor.cpp - } -} diff --git a/CIAO/DAnCE/NodeManager/MonitorCB.cpp b/CIAO/DAnCE/NodeManager/MonitorCB.cpp deleted file mode 100644 index 538b7262fa8..00000000000 --- a/CIAO/DAnCE/NodeManager/MonitorCB.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// $Id$ -//---------------------------------------------------------------------------------- -/** - * @file MonitorCB.cpp - * - * @brief The Monitor Update class - * - * The class which updates the resource data - * - * @author Nilabja Roy <nilabjar@dre.vanderbilt.edu> - */ -//---------------------------------------------------------------------------------- - -#include "MonitorCB.h" -#include "CIAO_common.h" - - -CIAO::MonitorCB::MonitorCB ( - CORBA::ORB_ptr orb, - Deployment::TargetManager_ptr target, - int interval) : - orb_ (orb), - target_mgr_ (target), - interval_ (interval) -{ -} - -int CIAO::MonitorCB::update_data (::Deployment::Domain& data) -{ - CORBA::StringSeq elements; - elements.length (0); - - // data to be updated ... - ::Deployment::DomainUpdateKind update_kind - = ::Deployment::UpdateDynamic; - - // The copy of the domain variable - ::Deployment::Domain_var domain - = new ::Deployment::Domain (data); - - try - { - if (CIAO::debug_level () > 20) - { - ACE_DEBUG ((LM_DEBUG , "CIAO::NM::MonitorCB::Making a call to update\n")); - } - target_mgr_->updateDomain (elements , domain , update_kind); - } - catch (CORBA::Exception& ) - { - //ACE_DEBUG ((LM_DEBUG, "CIAO::NM::MonitorCB::Unknown Exception\n")); - //ex._tao_print_exception ("NM::MonitorCB::updateDomain"); - } - catch (...) - { - // ignore - } - return 0; -} diff --git a/CIAO/DAnCE/NodeManager/MonitorCB.h b/CIAO/DAnCE/NodeManager/MonitorCB.h deleted file mode 100644 index 5d4f2d8a58a..00000000000 --- a/CIAO/DAnCE/NodeManager/MonitorCB.h +++ /dev/null @@ -1,73 +0,0 @@ -// $Id$ -//============================================================== -/** - * @file MonitorCB.h - * - * @brief The Monitor Callback Function - * - * This class updates data back to the Target Manager - * - * @author Nilabja Roy <nilabjar.vanderbilt.edu> -*/ -//============================================================== - -#ifndef MONITOR_CBH -#define MONITOR_CBH - -#include "DAnCE/Deployment/Deployment_TargetManagerC.h" - -/** - * @namespace CIAO - * - * @brief The top level CIAO namespace - * - */ - -namespace CIAO -{ - /** - * @class MonitorCB - * - * @brief Updates data back to the TM. - * - */ - - class MonitorCB - { - public: - /** - * @param orb The ORB pointer - * @param target The TargetManager reference - * @param interval The time interval to sent update - */ - MonitorCB (CORBA::ORB_ptr orb, Deployment::TargetManager_ptr target, int interval); - /** - * This function is called by the monitor to - * update Domain data, which is then sent to - * TM. - * @param data Contains the updated Domain data - * @return int indicates success. - * @todo Check return value, seems not used at this moment - */ - int update_data (::Deployment::Domain& data); - private: - /// The ORB pointer - /// @todo Make this a _var - CORBA::ORB_ptr orb_; - - /// The Target Manager pointer to send back the - /// update - /// @todo Make this a _var - ::Deployment::TargetManager_ptr target_mgr_; - - /// The interval after which updates need to be send - int interval_; - - }; - - /// The Callback function pointer - typedef int (MonitorCB::*CallBack) (::Deployment::Domain &); - -} // CIAO namespace - -#endif /* MONITOR_CBH */ diff --git a/CIAO/DAnCE/NodeManager/MonitorController.cpp b/CIAO/DAnCE/NodeManager/MonitorController.cpp deleted file mode 100644 index 774d9a022f9..00000000000 --- a/CIAO/DAnCE/NodeManager/MonitorController.cpp +++ /dev/null @@ -1,234 +0,0 @@ -// $Id$ - -//---------------------------------------------------------------------------------- -/** - * @file MonitorController.cpp - * - * @brief The Monitor Controller implementation. - * - * This is the facade class for Monitor - * - * @author Nilabja Roy <nilabjar@dre.vanderbilt.edu> - */ -//---------------------------------------------------------------------------------- - -#include "MonitorController.h" -#include "BaseMonitor.h" -#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); - - /// for the CIAO monitor - const char* monitor_lib_name = "ciaomonlib"; - - // The interval after which update will be sent. - // This value will sent by the EM in the later implementation - const int interval = 10; - - static const char* factory_func = "createMonitor"; -} - -CIAO::MonitorController::MonitorController ( - ::CORBA::ORB_ptr orb, - ::Deployment::Domain& domain, - ::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), - node_mgr_ (node_mgr), - monitor_cpu_usage_ (false), - add_component_pid_ (true) -{ -} - -int -CIAO::MonitorController::svc (void) -{ - // @todo. Investigate whether we can't use the reactor with a timer - // eventhandler for this monitor controller, would safe us a thread - ACE_DLL dll; - - // Forming the library name. - ACE_CString lib_name = ACE_DLL_PREFIX; - lib_name += monitor_lib_name; - int retval = dll.open (lib_name.c_str ()); - - if (retval != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p", - "dll.open"), - -1); - } - - // Cast the void* to non-pointer type first - it's not legal to - // cast a pointer-to-object directly to a pointer-to-function. - void *void_ptr = dll.symbol (factory_func); - ptrdiff_t tmp = reinterpret_cast<ptrdiff_t> (void_ptr); - MonitorFactory factory = reinterpret_cast<MonitorFactory> (tmp); - - if (factory == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "%p", - "dll.symbol"), - -1); - } - - { - ACE_TRACE ((LM_DEBUG, "Inside the init call\n")); - - // Creating the monitor object. - monitor_.reset ((MonitorBase*) factory ()); - monitor_->initialize_params (initial_domain_, - target_facet_i_.in (), - interval); - - - // Start the Monitor. - monitor_->start (orb_); - auto_ptr <CIAO::MonitorCB> monitor_callback (new CIAO::MonitorCB (orb_, - 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 (!ACE_OS::strcmp (initial_domain_.node[0].resource[i].name, "Processor")) - monitor_cpu_usage_ = true; - } - - // 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 = 0; - - 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<ACE_CString> 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_ = false; - } - - //******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); - - } - - 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 , "CIAO::Monitor::Terminating Monitor\n")); - } - - return 0; -} - -CIAO::MonitorController::~MonitorController () -{ - this->terminate (); - this->wait (); -} - -void -CIAO::MonitorController::terminate () -{ - // make the terminate flag false - ACE_GUARD (TAO_SYNCH_MUTEX, - guard, - lock_); - - terminate_flag_ = true; -} - -bool -CIAO::MonitorController::terminating () -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - lock_, - 0); - - return terminate_flag_; -} diff --git a/CIAO/DAnCE/NodeManager/MonitorController.h b/CIAO/DAnCE/NodeManager/MonitorController.h deleted file mode 100644 index c6cbbcf5255..00000000000 --- a/CIAO/DAnCE/NodeManager/MonitorController.h +++ /dev/null @@ -1,123 +0,0 @@ -// $Id$ - -//--------------------------------------------------------------------------------- -/** - * @file MonitorController.h - * - * @brief The Monitor Controller class. - * - * This class is invoked by the Nodemanager object and it - * in turn loads the proper Monitor which is strategised. - * - * @author Nilabja Roy - */ -//---------------------------------------------------------------------------------- -#ifndef MONITOR_CONTROLLER_H -#define MONITOR_CONTROLLER_H - -#include "NodeManager_svnt_export.h" -#include "DAnCE/Deployment/Deployment_BaseC.h" - -#include "DAnCE/TargetManager/TargetManagerImplC.h" -#include "ace/Task.h" -#include "ace/Auto_Ptr.h" - -#include "ace/Synch_Traits.h" -#include "ace/Synch.h" - - -/** - * @namespace CIAO - * - * @brief The top level CIAO namespace - * - */ - -namespace CIAO -{ - - class MonitorBase; - - class NodeManager_Impl_Base; - - /** - * @class MonitorController - * - * @brief The Controller class - * - * Acts as a facade to the Monitor - * module - * - */ - class NodeManager_svnt_Export MonitorController : public ACE_Task_Base - { - public: - /** - * @brief The main function containing the - * entire activity. - * - * This function runs in the context of the - * thread - * @return int The status of the function - */ - int svc (void); - /** - * @brief The terminate function - * - * This function is called to terminate the - * thread - */ - void terminate (); - - - /// The Constructor. - MonitorController (CORBA::ORB_ptr orb, - ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target, - ::CIAO::NodeManager_Impl_Base* node_mgr - ); - - ~MonitorController (); - protected: - - /** - * @brief returns the terminating flag - * @return bool The terminating state of the thread - */ - bool terminating (); - - /// The monitor object - auto_ptr <MonitorBase> 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 - TAO_SYNCH_MUTEX lock_; - - /// the ORB pointer .. - /// @todo Make this a _var - 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/CIAO/DAnCE/NodeManager/NAM_Map.cpp b/CIAO/DAnCE/NodeManager/NAM_Map.cpp deleted file mode 100644 index f3aebb307a2..00000000000 --- a/CIAO/DAnCE/NodeManager/NAM_Map.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ -#include "NAM_Map.h" -#include "ciao/CIAO_Config.h" -#include "ciao/CIAO_common.h" - -namespace CIAO -{ - NAM_Map::NAM_Map (void) - : map_ (CIAO_DEFAULT_MAP_SIZE) - { - } - - bool - NAM_Map::is_available (const ACE_CString &str) const - { - if (this->map_.find (str) == 0) - return true; - - return false; - } - - bool - NAM_Map::insert_nam (const ACE_CString &str, - const PortableServer::ObjectId &oid) - { - return (this->map_.bind (str, oid) == 0); - } - - ::PortableServer::ObjectId - NAM_Map::get_nam (const ACE_CString &str) - { - MAP::ENTRY *entry = 0; - - if (this->map_.find (str, entry) != 0) - return ::PortableServer::ObjectId (); - - return entry->int_id_.in (); - } - - bool - NAM_Map::remove_nam (const PortableServer::ObjectId &oid) - { - for (Iterator i = this->map_.begin (); - i != this->map_.end (); - ++i) - { - if ((*i).int_id_.in() == oid) - return this->map_.unbind ((*i).ext_id_) == 0; - } - return false; - } -} diff --git a/CIAO/DAnCE/NodeManager/NAM_Map.h b/CIAO/DAnCE/NodeManager/NAM_Map.h deleted file mode 100644 index 4b398d51927..00000000000 --- a/CIAO/DAnCE/NodeManager/NAM_Map.h +++ /dev/null @@ -1,72 +0,0 @@ - /** - * @file NAM_Map.h - * @author Will Otte <wotte@dre.vanderbilt.edu> - * - * Map of NodeApplicationManagers, inspired by the DAM_Map - * class. - * - * $Id$ - */ - -#ifndef CIAO_NAM_MAP_H -#define CIAO_NAM_MAP_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/PortableServer.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Null_Mutex.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/SString.h" - -namespace CIAO -{ - /** - * @class NAM_Map - * @brief Implementation of a map of NodeApplicationManagers. - * - * This table is used by the NodeManager to keep track of - * NAMs started for multiple assemblies. - */ - class NAM_Map - { - public: - /// Constructor - NAM_Map (void); - - /// Determine if there is a NAM associated with a UUID - bool is_available (const ACE_CString &str) const; - - /// Insert a NAM OID into the collection - bool insert_nam (const ACE_CString &str, - const PortableServer::ObjectId &oid); - - /// Get a specified NAM. - ::PortableServer::ObjectId - get_nam (const ACE_CString &str); - - /// Remove a nam from the map, given its oid. - bool remove_nam (const PortableServer::ObjectId &oid); - - private: - typedef - ACE_Hash_Map_Manager_Ex <ACE_CString, - ::PortableServer::ObjectId_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> MAP; - - typedef MAP::iterator Iterator; - - MAP map_; - - }; -} - -#include /**/ "ace/post.h" - -#endif /*CIAO_NAM_MAP_H*/ diff --git a/CIAO/DAnCE/NodeManager/NodeManager.mpc b/CIAO/DAnCE/NodeManager/NodeManager.mpc index 29bdefabdd6..495602554af 100644 --- a/CIAO/DAnCE/NodeManager/NodeManager.mpc +++ b/CIAO/DAnCE/NodeManager/NodeManager.mpc @@ -1,33 +1,22 @@ // -*- MPC -*- // $Id$ -//For static D&C, the NodeManager should be available as a linkable library -project(NodeManager_svnt): ciao_component_dnc, ciao_deployment_svnt, iortable, ifr_client, dance_extension_stub, ciao_server_dnc, ciao_nodeapplicationmanager, ciao_nodemanager_stub, ace_output { - sharedname = NodeManager - dynamicflags = NODEMANAGER_SVNT_BUILD_DLL - - IDL_Files { - } +project(Node_Manager_Module) : dance_lib, naming_serv, dance_node_application_manager, dance_node_application, dance_deployment_svnt, dance_deployment_stub, dynamicinterface, utils, gen_ostream { + sharedname = DAnCE_NodeManager + dynamicflags = NODEMANAGER_BUILD_DLL DANCE_NODEMANAGER_MODULE_BUILD_DLL Source_Files { - ../Interfaces/NodeManagerDaemonS.cpp NodeManager_Impl.cpp - NAM_Map.cpp - MonitorController.cpp - MonitorCB.cpp + Node_Manager_Module.cpp } } -project(NodeManager): ciao_server_dnc, iortable, ifr_client, dance_extension_stub, ciao_nodeapplicationmanager, ciao_targetmanager_stub, ciao_nodemanager_stub, ciaoexe { - after += NodeManager_svnt - libs += NodeManager - exename = NodeManager - - IDL_Files { - } +project(Node_Manager_Exec) : dance_exe, dance_node_manager, naming_serv { + exename = dance_node_manager + after += Node_Manager_Module + libs += DAnCE_NodeManager Source_Files { - Node_Manager.cpp + Node_Manager_Exec.cpp } } - diff --git a/CIAO/DAnCE/NodeManager/NodeManager_Export.h b/CIAO/DAnCE/NodeManager/NodeManager_Export.h new file mode 100644 index 00000000000..b7240baeb80 --- /dev/null +++ b/CIAO/DAnCE/NodeManager/NodeManager_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl NodeManager +// ------------------------------ +#ifndef NODEMANAGER_EXPORT_H +#define NODEMANAGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEMANAGER_HAS_DLL) +# define NODEMANAGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && NODEMANAGER_HAS_DLL */ + +#if !defined (NODEMANAGER_HAS_DLL) +# define NODEMANAGER_HAS_DLL 1 +#endif /* ! NODEMANAGER_HAS_DLL */ + +#if defined (NODEMANAGER_HAS_DLL) && (NODEMANAGER_HAS_DLL == 1) +# if defined (NODEMANAGER_BUILD_DLL) +# define NodeManager_Export ACE_Proper_Export_Flag +# define NODEMANAGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define NODEMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* NODEMANAGER_BUILD_DLL */ +# define NodeManager_Export ACE_Proper_Import_Flag +# define NODEMANAGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define NODEMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* NODEMANAGER_BUILD_DLL */ +#else /* NODEMANAGER_HAS_DLL == 1 */ +# define NodeManager_Export +# define NODEMANAGER_SINGLETON_DECLARATION(T) +# define NODEMANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* NODEMANAGER_HAS_DLL == 1 */ + +// Set NODEMANAGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (NODEMANAGER_NTRACE) +# if (ACE_NTRACE == 1) +# define NODEMANAGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define NODEMANAGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !NODEMANAGER_NTRACE */ + +#if (NODEMANAGER_NTRACE == 1) +# define NODEMANAGER_TRACE(X) +#else /* (NODEMANAGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define NODEMANAGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (NODEMANAGER_NTRACE == 1) */ + +#endif /* NODEMANAGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp b/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp index bb8a90e5112..2c84c84ceb9 100644 --- a/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp +++ b/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp @@ -1,679 +1,183 @@ // $Id$ #include "NodeManager_Impl.h" -#include "DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h" -#include "ace/Log_Msg.h" - -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) - : 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) -{ -} - -CIAO::NodeManager_Impl_Base::~NodeManager_Impl_Base () -{ -} - -void -CIAO::NodeManager_Impl_Base::init () -{ - try - { - // Create the call back poa for NAM. - PortableServer::POAManager_var mgr - = this->poa_->the_POAManager (); - - this->callback_poa_ = - this->poa_->create_POA ("callback_poa", - mgr.in (), - 0); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeManager_Impl::init\t\n"); - throw; - } -} - -PortableServer::POA_ptr -CIAO::NodeManager_Impl_Base::_default_POA (void) -{ - return PortableServer::POA::_duplicate (this->poa_.in ()); -} - - -char * -CIAO::NodeManager_Impl_Base::name () -{ - return CORBA::string_dup (this->name_.in ()); -} - -void -CIAO::NodeManager_Impl_Base::shutdown () -{ - - this->orb_->shutdown (0); -} - -void -CIAO::NodeManager_Impl_Base::joinDomain (const Deployment::Domain & domain, - Deployment::TargetManager_ptr target, - Deployment::Logger_ptr) -{ - // 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 (); +#include "ace/Log_Msg.h" +#include "ace/streams.h" - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "Monitor Activated\n")); - } -} +#include "DAnCE/Logger/Log_Macros.h" -void -CIAO::NodeManager_Impl_Base::leaveDomain () -{ - // Delete the monitor , this will also terminate the thread - monitor_controller_.reset (); -} +#include "ace/OS_Memory.h" -CORBA::Long -CIAO::NodeManager_Impl_Base::set_priority ( - const char * plan_id, - const char * cid, - const ::Deployment::Sched_Params & nm_params - ) +#ifdef GEN_OSTREAM_OPS +#include <iostream> +#include <sstream> +#endif /* GEN_OSTREAM_OPS */ +namespace DAnCE { - 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); + NodeManager_Impl::NodeManager_Impl(CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char* name, + RedirectionService& redirection, + const PROPERTY_MAP &properties) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + name_ (name), + redirection_ (redirection), + properties_ (properties.current_size ()) + { + DANCE_TRACE ( "NodeManager_Impl::NodeManager_Impl"); + redirection.add_node (name); + DANCE_DEBUG ((LM_INFO, DLINFO "NodeManager_impl::NodeManager_impl has been created\n")); + + PROPERTY_MAP::const_iterator i = properties.begin (); + while (!i.done ()) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_Impl::NodeManager_Impl - " + "Binding property %s provided by caller.\n", i->key ().c_str ())); + this->properties_.bind (i->key (), i->item ()); + i.advance (); + } } - catch (CORBA::Exception& ex) - { - - ex._tao_print_exception ("(%P|%t) NodeManager_Impl::set_priority ()\t\n"); - throw; - } -} - -::Components::FacetDescriptions * -CIAO::NodeManager_Impl_Base:: -get_all_facets (ACE_CString & name) -{ - Component_Facets_Map::ENTRY *entry = 0; - - if (this->comp_facets_map_.find (name.c_str (), entry) != 0) - { - ACE_ERROR ((LM_ERROR, "(%P|%t) - NodeManager_Impl_Base::get_all_facets - " - "No component with name [%s] was found in the NodeManager\n", name.c_str ())); - } - - CORBA::ULong const facet_len = entry->int_id_->length (); - - Components::FacetDescriptions_var retv; - ACE_NEW_RETURN (retv, - Components::FacetDescriptions, - 0); - - retv->length (facet_len); - - for (CORBA::ULong i = 0; i < facet_len; ++i) - { - retv[i] = entry->int_id_[i]; - } - - return retv._retn (); -} - -::Components::ConsumerDescriptions * -CIAO::NodeManager_Impl_Base:: -get_all_consumers (ACE_CString & name) -{ - Component_Consumers_Map::ENTRY *entry = 0; - - if (this->comp_consumers_map_.find (name.c_str (), entry) != 0) - { - ACE_ERROR ((LM_ERROR, "(%P|%t) - NodeManager_Impl_Base::get_all_facets - " - "Component [%s] was not found in the NodeManager\n", name.c_str ())); - } - - CORBA::ULong const consumer_len = entry->int_id_->length (); - - Components::ConsumerDescriptions_var retv; - ACE_NEW_RETURN (retv, - Components::ConsumerDescriptions, - 0); - - retv->length (consumer_len); - - for (CORBA::ULong i = 0; i < consumer_len; ++i) - { - retv[i] = entry->int_id_[i]; - } - - return retv._retn (); -} - -void -CIAO::NodeManager_Impl_Base:: -set_all_facets (ACE_CString &name, - const ::Components::FacetDescriptions_var & facets) -{ - this->comp_facets_map_.rebind (name, facets); -} - -void -CIAO::NodeManager_Impl_Base:: -set_all_consumers (ACE_CString &name, - const ::Components::ConsumerDescriptions_var & consumers) -{ - this->comp_consumers_map_.rebind (name, consumers); -} - - -Deployment::NodeApplicationManager_ptr -CIAO::NodeManager_Impl_Base:: -preparePlan (const Deployment::DeploymentPlan &plan) -{ - CIAO_TRACE("CIAO::NodeManager_Impl::preparePlan"); - - if (! this->validate_plan (plan)) - { - ACE_ERROR ((LM_ERROR, "(%P|%t) NodeManager <%s>:prepare_plan:Plan_Error.\n", - plan.instance[0].node.in ())); - ACE_ERROR ((LM_ERROR, "(%P|%t) All component instances hosted in the " - "same component server must have the " - "same \"resourceName\" defined.\n")); - - throw Deployment::PlanError (); - } - - // Update the reference count map based on the deployment plan input - for (CORBA::ULong i = 0; i < plan.instance.length (); ++i) - { - Reference_Count_Map::ENTRY *entry = 0; - if (this->ref_count_map_.find (plan.instance[i].name.in (), entry) != 0) - { - // Create a new entry, set the initial ref count "1", and insert to the map. - Ref_Count_Info new_entry; - new_entry.plan_uuid_ = plan.UUID.in (); - new_entry.count_ = 1; - this->ref_count_map_.bind (plan.instance[i].name.in (), new_entry); - } - else - { - // If the instance is within the same deployment plan, e.g., - // when ReDaC service is used, then just do nothing since it is NOT - // actually a shared component at all. - if (ACE_OS::strcmp (plan.UUID.in (), - entry->int_id_.plan_uuid_.c_str ()) == 0) - continue; - - // Otherwise, it is really a shared component, so let's increase - // the ref count by 1 - this->shared_components_.insert (plan.instance[i].name.in ()); - ++ entry->int_id_.count_; - } - } - - // Create/find NodeApplicationManager and set/reset plan on it - try - { - if (!this->map_.is_available (plan.UUID.in ())) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "NM:prepare_plan: " - "creating a new NAM with UUID: %s\n", - plan.UUID.in ())); - } - - // Implementation undefined. - CIAO::NodeApplicationManager_Impl_Base *node_app_mgr = - this->create_node_app_manager (this->orb_.in (), this->poa_.in ()); - - PortableServer::ServantBase_var safe (node_app_mgr); - - //@@ Note: after the init call the servant ref count would - // become 2. so we can leave the safeservant along and be - // dead. Also note that I added - PortableServer::ObjectId_var oid = - node_app_mgr->init (this->nodeapp_location_.in (), - this->nodeapp_options_.in (), - this->spawn_delay_, - plan, - this->callback_poa_.in (), - this // pass in a copy of ourself (servant object) - ); - - this->map_.insert_nam (plan.UUID.in (), oid.in ()); - - CORBA::Object_var obj = - this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ())); - - // We should inform NAM about "shared" components, so they - // won't be instantiated again - Deployment::NodeApplicationManager_var nam = - Deployment::NodeApplicationManager::_narrow (obj.in ()); - - // Convert the ACE Set into CORBA sequence, and make the remote invocation - Deployment::ComponentPlans_var shared = - this->get_shared_components_i (); - nam->set_shared_components (shared.in ()); - - // narrow should return a nil reference if it fails. - return Deployment::NodeApplicationManager::_narrow (nam.in ()); - } - else - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "NM:prepare_plan: reusing an old NAM " - "with UUID: %s\n", - plan.UUID.in ())); - } - - CORBA::Object_var obj = - this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ())); - Deployment::NodeApplicationManager_var nam = - Deployment::NodeApplicationManager::_narrow (obj.in ()); - - nam->reset_plan (plan); - - // Similarly, we should inform NAM about "shared" components, so - // they won't be instantiated again - Deployment::ComponentPlans_var shared = - this->get_shared_components_i (); - nam->set_shared_components (shared.in ()); - - // Potentially we could reset many other configuration settings - // such as command line options, service configuration file, etc. - return nam._retn (); - } - } - catch (const PortableServer::POA::ObjectNotActive&) - { - throw Deployment::StartError (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("(%P|%t) NodeManager_Impl::preparePlan\t\n"); - throw; - } - - return Deployment::NodeApplicationManager::_nil (); -} - -void -CIAO::NodeManager_Impl_Base::destroyManager -(Deployment::NodeApplicationManager_ptr manager) -{ - CIAO_TRACE("CIAO::NodeManager_Impl::destroyManager"); - try - { - // Deactivate this object - PortableServer::ObjectId_var id = - this->poa_->reference_to_id (manager); - - if (!this->map_.remove_nam (id.in ())) - { - ACE_ERROR ((LM_ERROR, - "NodeManager_Impl::destroyManager: " - "Unable to remove object from map!\n")); - } - - this->poa_->deactivate_object (id.in ()); - } - catch (const PortableServer::POA::WrongAdapter&) - { - ACE_ERROR ((LM_ERROR, - "NodeManager_Impl::destroyManager: EXCEPTION - " - "Invalid reference passed to destroyManager\n")); - - throw ::Deployment::InvalidReference (); - } - catch (const PortableServer::POA::ObjectNotActive&) - { - ACE_ERROR ((LM_ERROR, - "NodeManager_Impl::destroyManager: EXCEPTION - " - " asked to destroy an already inactive object.\n")); - throw ::Deployment::InvalidReference (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("NodeManager_Impl::destroyManager\t\n"); - throw; - } -} - -void -CIAO::NodeManager_Impl_Base:: -destroyPlan (const Deployment::DeploymentPlan & plan) -{ - // Update the reference counting map (subtract by 1 for each instance) - // If the ref count becomes 0, then remove this component, otherwise, - // we should remove the necesary bindings on this component specified - // in the deployment plan. - - // Clean up the cached "Facets" and "Consumers" map of the components - // if their ref count become 0 - 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) - { - --entry->int_id_.count_; // decrease ref count by 1 - - 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 || - this->comp_consumers_map_.unbind ( - plan.instance[i].name.in ()) != 0) - { - throw - (Deployment::StopError ("NodeManager_Impl_Base::destroyPlan ", - "Unable to find component instance")); - } - } - } - } - - // Find the NAM from the map and invoke the destroyPlan() operation on - // it, which will actuall remove components and connections in this plan. - // If - CORBA::Object_var obj = - this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ())); - - 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 (); - nam->set_shared_components (shared.in ()); - - nam->destroyApplication (0); - - // @@ The problem is that we should NOT actually kill the NA process if - // there are some components that are shared by other plans. -} - -Deployment::ComponentPlans * -CIAO::NodeManager_Impl_Base:: -get_shared_components () -{ - return this->get_shared_components_i (); -} - -Deployment::ComponentPlans * -CIAO::NodeManager_Impl_Base::get_shared_components_i (void) -{ - Deployment::ComponentPlans_var retv; - ACE_NEW_RETURN (retv, - Deployment::ComponentPlans, - 0); - retv->length (0); - - ACE_Unbounded_Set<ACE_CString>::iterator - end = this->shared_components_.end (); - - for (ACE_Unbounded_Set<ACE_CString>::iterator - iter = this->shared_components_.begin (); - iter != end; - ++iter) - { - CORBA::ULong const curr_len = retv->length (); - retv->length (curr_len + 1); - (*retv)[curr_len].name = (*iter).c_str (); - - // Fill in the plan_uuid information about this component, by - // searching in the ref_count_map_ - Reference_Count_Map::ENTRY *entry = 0; - if (this->ref_count_map_.find ((*iter).c_str (), entry) == 0) - { - // Get the plan_uuid_ info and populate the field - (*retv)[curr_len].plan_uuid = entry->int_id_.plan_uuid_.c_str (); - } - else - { - // should never happen - ACE_ERROR ((LM_ERROR, "Component [%s] in the list of shared component, " - "was not found in the NodeManager ref count map.\n", - (*iter).c_str ())); - } - } - - return retv._retn (); -} - - -CORBA::StringSeq * -CIAO::NodeManager_Impl_Base::shared_components_seq (void) -{ - CORBA::StringSeq * retv = 0; - ACE_NEW_RETURN (retv, CORBA::StringSeq, 0); - retv->length (0); - - // @todo rewrite to just set the length once and then copy the strings - // to reduce allocations - - ACE_Unbounded_Set<ACE_CString>::iterator end = this->shared_components_.end (); - for (ACE_Unbounded_Set<ACE_CString>::iterator - iter = this->shared_components_.begin (); - iter != end; - ++iter) - { - CORBA::ULong const curr_len = retv->length (); - retv->length (curr_len + 1); - (*retv)[curr_len] = (*iter).c_str (); - } - - return retv; -} - -bool -CIAO::NodeManager_Impl_Base:: -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) - { - // Since the "name" field represents the server_resource_id, and - // 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; - } - } - if (i == plan.instance.length ()) // No server resource id has been set for any instance - return true; - - for (i = 0; i < plan.instance.length (); ++i) - { - const char * my_resource_id = 0; - if (plan.instance[i].deployedResource.length () == 0) - { - continue; - } - else - { - my_resource_id = - plan.instance[i].deployedResource[0].resourceName.in ();; - if (ACE_OS::strcmp (resource_id, my_resource_id) != 0) - { - // Error, inconsistent server resource id found. - return false; - } - } - } - 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, - bool is_multi_threaded) - : NodeManager_Impl_Base (name, orb, poa, nodeapp_loc, nodeapp_options, spawn_delay) - , is_multi_threaded_ (is_multi_threaded) -{} - - -::CIAO::NodeApplicationManager_Impl_Base * -CIAO::NodeManager_Impl:: -create_node_app_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) -{ - CIAO::NodeApplicationManager_Impl_Base *app_mgr = 0; - ACE_NEW_THROW_EX (app_mgr, - CIAO::NodeApplicationManager_Impl (orb, - poa, - this->is_multi_threaded_), - CORBA::NO_MEMORY ()); - return app_mgr; -} - -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) - : NodeManager_Impl_Base (name, orb, poa, nodeapp_loc, nodeapp_options, spawn_delay), - static_config_entrypoints_maps_ (static_config_entrypoints_maps) -{} + NodeManager_Impl::~NodeManager_Impl() + { + DANCE_TRACE ( "NodeManager_Impl::~NodeManager_Impl()"); + for (TManagers::iterator iter = this->managers_.begin(); + iter != this->managers_.end(); + ++iter) + { + try + { + PortableServer::ObjectId_var id = this->poa_->servant_to_id ( (*iter).int_id_); + DANCE_DEBUG ((LM_TRACE, DLINFO + "NodeManager_impl::~NodeManager_impl - Deactivating NodeApplicationManager %s\n", + (*iter).ext_id_.c_str ())); + this->poa_->deactivate_object (id.in()); + DANCE_DEBUG ((LM_TRACE, DLINFO + "NodeManager_impl::~NodeManager_impl - deleting NodeApplicationManager\n")); + delete (*iter).int_id_; + DANCE_DEBUG ((LM_DEBUG, DLINFO + "NodeManager_impl::~NodeManager_impl - NodeApplicationManager deleted\n")); + } + catch (...) + { + DANCE_ERROR ((LM_WARNING, DLINFO + "NodeManager_impl::~NodeManager_impl - Caught exception while removing " + "NodeApplicationManager %s\n", (*iter).ext_id_.c_str ())); + } + } + } -::CIAO::NodeApplicationManager_Impl_Base * -CIAO::Static_NodeManager_Impl:: -create_node_app_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) -{ - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "creating static_node_app_manager\n")); - } + void + NodeManager_Impl::joinDomain (const ::Deployment::Domain & /*theDomain*/, + ::Deployment::TargetManager_ptr /*manager*/, + ::Deployment::Logger_ptr /*log*/, + ::CORBA::Long /*updateInterval*/) + { + DANCE_TRACE ( "NodeManager_Impl::joinDomain"); + ACE_DEBUG ((LM_ERROR, DLINFO "NodeManager_Impl::joinDomain - " + "joinDomain not implemented\n")); + throw CORBA::NO_IMPLEMENT (); + } - CIAO::NodeApplicationManager_Impl_Base *app_mgr = 0; - ACE_NEW_THROW_EX (app_mgr, - CIAO::Static_NodeApplicationManager_Impl (orb, - poa, - this->static_config_entrypoints_maps_), - CORBA::NO_MEMORY ()); - return app_mgr; -} + void + NodeManager_Impl::leaveDomain () + { + DANCE_TRACE ( "NodeManager_Impl::leaveDomain"); + ACE_DEBUG ((LM_ERROR, DLINFO "NodeManager_Impl::leaveDomain - " + "leave not implemented\n")); + throw CORBA::NO_IMPLEMENT (); + } -void -CIAO::Static_NodeManager_Impl::destroyManager -(Deployment::NodeApplicationManager_ptr manager) -{ - CIAO_TRACE("CIAO::Static_NodeManager_Impl::destroyManager"); - try - { - CIAO::NodeManager_Impl_Base::destroyManager (manager); + ::Deployment::NodeApplicationManager_ptr + NodeManager_Impl::preparePlan (const ::Deployment::DeploymentPlan & plan, + ::Deployment::ResourceCommitmentManager_ptr /*resourceCommitment*/) + { + DANCE_TRACE ( "NodeManager_Impl::preparePlan"); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeManager_impl::preparePlan - " + "started for node %s and plan %s\n", this->name_.c_str(), plan.UUID.in())); + +#ifdef GEN_OSTREAM_OPS + { + std::ostringstream plan_stream; + plan_stream << plan << std::endl; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::preparePlan - $s", + plan_stream.str ().c_str ())); + } +#endif /* GEN_OSTREAM_OPS */ + + // resourceCommitment will be used on next development stage + if (0 == this->managers_.find (plan.UUID.in())) + { + // What should we do here if we already have application for this plan? + // Probably it is mistake because we should previously call destroyApplication + // before performe relaunching of application + DANCE_ERROR ((LM_ERROR, DLINFO "NodeManager_impl::preparePlan - " + "ApplicationManager for UUID %s already exists\n", + plan.UUID.in ())); + throw ::Deployment::PlanError(); + } + ACE_DEBUG ((LM_DEBUG, "*** size of properties_:%u\n", properties_.current_size ())); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::preparePlan - creating NodeApplicationManager...\n")); + NodeApplicationManager_Impl* manager = 0; + ACE_NEW_THROW_EX (manager, + NodeApplicationManager_Impl (this->orb_.in(), + this->poa_.in(), + plan, + this->redirection_, + this->name_, + this->properties_), + CORBA::NO_MEMORY()); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::preparePlan - activating NodeApplicationManager...\n")); + PortableServer::ObjectId_var id = this->poa_->activate_object (manager); + CORBA::Object_var nam = this->poa_->id_to_reference (id.in()); + + //there is an idea to check if plan.UUID really exists + this->managers_.bind (plan.UUID.in(), manager); + // narrow should return a nil reference if it fails. + DANCE_DEBUG ((LM_INFO, DLINFO "NodeManager_impl::preparePlan - NodeApplicationManager for plan %s completed\n", + plan.UUID.in ())); + return Deployment::NodeApplicationManager::_narrow (nam.in ()); + } - this->orb_->shutdown (0); + void + NodeManager_Impl::destroyManager (::Deployment::NodeApplicationManager_ptr appManager) + { + DANCE_TRACE ( "NodeManager_Impl::destroyManager"); + + for (TManagers::iterator iter = this->managers_.begin(); + iter != this->managers_.end(); + ++iter) + { + if (appManager->_is_equivalent (this->poa_->servant_to_reference ( (*iter).int_id_))) + { + PortableServer::ObjectId_var id = this->poa_->reference_to_id (appManager); + this->poa_->deactivate_object (id.in()); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::destroyManager - deleting NodeApplicationManager\n")); + delete (*iter).int_id_; + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::destroyManager - NodeApplicationManager deleted\n")); + this->managers_.unbind ( (*iter).ext_id_); + DANCE_DEBUG ((LM_TRACE, DLINFO "NodeManager_impl::destroyManager - finished\n")); + return; + } + } + + DANCE_ERROR((LM_ERROR, DLINFO "NodeManager_impl::destroyManager - " + "correponding NodeApplicationManager cannot be found\n")); + throw ::Deployment::InvalidReference(); + } - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Static_NodeManager_Impl::destroyManager\t\n"); - throw; - } + ::Deployment::Resources * + NodeManager_Impl::getDynamicResources () + { + DANCE_TRACE ( "NodeManager_Impl::getDynamicResources ()"); + ACE_DEBUG ((LM_ERROR, DLINFO "NodeManager_Impl::getDynamicResources - " + "getDynamicResources not implemented\n")); + throw CORBA::NO_IMPLEMENT (); + return 0; + } +} //DAnCE -} diff --git a/CIAO/DAnCE/NodeManager/NodeManager_Impl.h b/CIAO/DAnCE/NodeManager/NodeManager_Impl.h index 45edfb63899..2df92d203f4 100644 --- a/CIAO/DAnCE/NodeManager/NodeManager_Impl.h +++ b/CIAO/DAnCE/NodeManager/NodeManager_Impl.h @@ -1,324 +1,69 @@ // -*- C++ -*- + //============================================================================= /** - * @file NodeManager_Impl.h + * @file NodeManager_Impl.h * * $Id$ * - * This file contains servant implementation for Deployment:NodeManager - * interface. In the current design of the NodeManager, each NodeManager - * could manage one or more NodeApplication Managers. - * Though, the name intuitively suggests - * that there be one NodeManager for every node, our design, allows - * the end-user to have multiple components run on the same node. + * @Brief Implementation of POA_Deployment::NodeManager * - * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> + * @author Erwin Gottlieb <eg@prismtech.com> + * @author William R. Otte <wotte@dre.vanderbilt.edu> */ //============================================================================= +#ifndef NODEMANAGER_IMPL_H_ +#define NODEMANAGER_IMPL_H_ -#ifndef CIAO_NODEMANAGER_IMPL_H -#define CIAO_NODEMANAGER_IMPL_H -#include /**/ "ace/pre.h" - -#include "Interfaces/NodeManagerDaemonS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (_MSC_VER) -# pragma warning(push) -# pragma warning (disable:4250) -#endif /* _MSC_VER */ - -#include "NodeManager_svnt_export.h" -#include "NAM_Map.h" -#include "MonitorController.h" -#include "ace/Vector_T.h" +#include "NodeManager_Export.h" +#include "tao/Object.h" +#include "tao/ORB.h" +#include "Deployment/Deployment_common.h" +#include "Deployment/Deployment_NodeManagerS.h" +#include "NodeApplicationManager/NodeApplicationManager_Impl.h" +#include "RedirectionService/RedirectionService.h" -namespace CIAO +namespace DAnCE { - class NodeApplicationManager_Impl_Base; - - /** - * @class NodeManager_Impl - * - * @brief Servant implementation CIAO's daemon process control - * interface - * - * This class implements the CIAO:NodeManagerDaemon interface. - * - */ - class NodeManager_svnt_Export NodeManager_Impl_Base - : public virtual POA_CIAO::NodeManagerDaemon + class NodeManager_Export NodeManager_Impl : public virtual POA_Deployment::NodeManager { public: - /// A struct that tracks the reference count of a particular - /// component as well as the "child_plan_uuid" where the component is - /// actually installed - typedef struct _ref_count_info - { - ACE_CString plan_uuid_; - size_t count_; - } Ref_Count_Info; - - /// Constructor - NodeManager_Impl_Base (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr p, - const char * nodeapp_loc, - const char* nodeapp_options, - int spawn_delay); - - /// Initializes the NodeManager. - virtual void init (); - - /// POA operation.. - virtual PortableServer::POA_ptr _default_POA (void); + // the fixed listener port is caused by the usage of CCM Object locator + NodeManager_Impl (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + const char* name, + RedirectionService& redirection, + const PROPERTY_MAP &options); - /// CIAO::Daemon defined attributes/operations. - virtual char * name (); + virtual ~NodeManager_Impl(); - virtual void shutdown (); - - virtual void joinDomain (const Deployment::Domain & domain, - Deployment::TargetManager_ptr manager, - Deployment::Logger_ptr log - ); + virtual void joinDomain (const ::Deployment::Domain & theDomain, + ::Deployment::TargetManager_ptr manager, + ::Deployment::Logger_ptr log, + ::CORBA::Long updateInterval); virtual void leaveDomain (); - virtual ::Deployment::NodeApplicationManager_ptr - preparePlan (const Deployment::DeploymentPlan &plan); - - virtual void - destroyManager (Deployment::NodeApplicationManager_ptr appManager); - - /// CIAO specific extension, which is particularly useful for dealing with - /// shared components issue - virtual void destroyPlan (const Deployment::DeploymentPlan & plan); - - /// CIAO specific extension, return a set of shared components - virtual ::Deployment::ComponentPlans * - get_shared_components (); - - /// 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); - - // ********* CIAO Specific Helper functions ************ - - virtual ::Components::FacetDescriptions * - get_all_facets (ACE_CString & name); + virtual ::Deployment::NodeApplicationManager_ptr preparePlan ( + const ::Deployment::DeploymentPlan & plan, + ::Deployment::ResourceCommitmentManager_ptr resourceCommitment); - virtual ::Components::ConsumerDescriptions * - get_all_consumers (ACE_CString & name); + virtual void destroyManager (::Deployment::NodeApplicationManager_ptr appManager); - virtual void - set_all_facets (ACE_CString &name, - const ::Components::FacetDescriptions_var & facets); + virtual ::Deployment::Resources * getDynamicResources (); - virtual void - set_all_consumers (ACE_CString &name, - const ::Components::ConsumerDescriptions_var & consumers); - - // ********* Function added for getting component ids... - - struct Component_Ids - { - ACE_Unbounded_Set <ACE_CString> cid_seq_; - pid_t process_id_; - }; - - virtual void push_component_id_info (Component_Ids comps); - - - Component_Ids get_component_detail (); + const char* getName(); private: - /// Validate the child deployment plan. In particular, we are - /// trying to verify that all the component instances within this - /// child deployment plan have the same "server_resource_id" - /// assigned. - bool validate_plan (const Deployment::DeploymentPlan &plan); - - protected: - /// Since this class is reference counted, making this - /// destructor protected to enforce proper memory managment - /// through the reference counting mechanism (i.e. to - /// disallow calling operator delete() on an instance of - /// this class. - virtual ~NodeManager_Impl_Base (void); - - virtual ::CIAO::NodeApplicationManager_Impl_Base * - create_node_app_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) - =0; - - /// Actual implementation of the @c get_shared_components IDL operation - virtual ::Deployment::ComponentPlans * - get_shared_components_i (void); - - /// A helper method that convert ACE_Unbounded_Set to CORBA StringSeq - CORBA::StringSeq * shared_components_seq (void); - - /// Keep a pointer to the managing ORB serving this servant. CORBA::ORB_var orb_; - - /// Keep a pointer to the managing POA. PortableServer::POA_var poa_; - - /// My Canonical name. - CORBA::String_var name_; - - /// NodeApplication location - CORBA::String_var nodeapp_location_; - - /// NodeApplication options - CORBA::String_var nodeapp_options_; - - /// Cached callback POA. - PortableServer::POA_var callback_poa_; - - /// Spawn delay for the NodeAppMgr - int spawn_delay_; - - /// Cache reference of last NodeAppManager - /// Deployment::NodeApplicationManager_var manager_; - NAM_Map map_; - - /// A reference count map for the components installed on this node - /// @@TODO We should also keep the information about *where* the - /// component is installed - typedef - ACE_Hash_Map_Manager_Ex <ACE_CString, - Ref_Count_Info, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Reference_Count_Map; - typedef Reference_Count_Map::iterator Ref_Count_Iterator; - - Reference_Count_Map ref_count_map_; - - /// A set to track the names of shared component instances - ACE_Unbounded_Set<ACE_CString> shared_components_; - - /// Cached object references of ports (facets/consumers) of - /// all components. This is useful for getting the port object - /// references of "shared components". The key in the map - /// is the component instance name. - typedef - ACE_Hash_Map_Manager_Ex <ACE_CString, - Components::FacetDescriptions_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Component_Facets_Map; - - Component_Facets_Map comp_facets_map_; - - typedef - ACE_Hash_Map_Manager_Ex <ACE_CString, - Components::ConsumerDescriptions_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> Component_Consumers_Map; - - Component_Consumers_Map comp_consumers_map_; - - /// The MonitorController pointer - auto_ptr <MonitorController> monitor_controller_; - - /// The set of Components - Component_Ids components_; - }; - - - /** - * @class NodeManager_Impl - * - */ - class NodeManager_svnt_Export NodeManager_Impl - : public virtual NodeManager_Impl_Base - { - public: - - /// Constructor - NodeManager_Impl (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr p, - const char * nodeapp_loc, - const char * nodeapp_options, - int spawn_delay, - bool is_multi_threaded); - - protected: - /// Since this class is reference counted, making this - /// destructor protected to enforce proper memory managment - /// through the reference counting mechanism (i.e. to - /// disallow calling operator delete() on an instance of - /// this class. - virtual ~NodeManager_Impl (void); - - virtual ::CIAO::NodeApplicationManager_Impl_Base * - create_node_app_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa); - - private: - bool is_multi_threaded_; - }; - - class NodeApplicationManager_Impl; - struct Static_Config_EntryPoints_Maps; - - /** - * @class Static_NodeManager_Impl - * - */ - class NodeManager_svnt_Export Static_NodeManager_Impl - : public virtual NodeManager_Impl_Base - { - public: - - /// Constructor - Static_NodeManager_Impl (const char *name, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr p, - const char * nodeapp_loc, - const char * nodeapp_options, - int spawn_delay, - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps - ); - - void destroyManager - (Deployment::NodeApplicationManager_ptr manager); - - protected: - /// Since this class is reference counted, making this - /// destructor protected to enforce proper memory managment - /// through the reference counting mechanism (i.e. to - /// disallow calling operator delete() on an instance of - /// this class. - virtual ~Static_NodeManager_Impl (void); - - virtual ::CIAO::NodeApplicationManager_Impl_Base * - create_node_app_manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa); - - Static_Config_EntryPoints_Maps* static_config_entrypoints_maps_; + ACE_CString name_; + typedef ACE_Map_Manager<ACE_CString, NodeApplicationManager_Impl*, ACE_Null_Mutex > TManagers; + TManagers managers_; + RedirectionService& redirection_; + PROPERTY_MAP properties_; }; +}; -} - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* CIAO_NODEMANAGER_IMPL_H */ +#endif /*NODEMANAGER_IMPL_H_*/ diff --git a/CIAO/DAnCE/NodeManager/Node_Manager.cpp b/CIAO/DAnCE/NodeManager/Node_Manager.cpp deleted file mode 100644 index db17269b707..00000000000 --- a/CIAO/DAnCE/NodeManager/Node_Manager.cpp +++ /dev/null @@ -1,293 +0,0 @@ -// $Id$ - -#include "NodeManager_Impl.h" -#include "orbsvcs/CosNamingC.h" -#include "tao/IORTable/IORTable.h" -#include "ace/SString.h" -#include "ace/Read_Buffer.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#include "ace/os_include/os_netdb.h" -#include "ciao/Server_init.h" -#include "ciao/CIAO_common.h" - -const char *ior_file_name_ = "nodedaemon.ior"; -char *nodeapp_location_ = 0; -const char *pid_file_name_ = 0; -bool write_to_ior_ = false; -bool register_with_ns_ = false; -int nodeapp_loc_ = 0; -int spawn_delay = 1; -bool is_multi_threaded = false; - -ACE_CString nodeapp_options_; - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:c:ms:d:na:p:z:")); - int c; - - while ((c = get_opts ()) != -1) - { - switch (c) - { - case 'z': - nodeapp_options_ += " -ORBDebugLevel "; - nodeapp_options_ += get_opts.opt_arg (); - break; - - case 'o': // Get the file name to write to. - ior_file_name_ = get_opts.opt_arg (); - write_to_ior_ = true; - break; - - case 'c': // Get the default svc.conf filename. - nodeapp_options_ += " -ORBSvcConf "; - nodeapp_options_ += get_opts.opt_arg (); - break; - - case 's': // Get the location to spawn the NodeApplication. - nodeapp_location_ = get_opts.opt_arg (); - nodeapp_loc_ = 1; - break; - - case 'a': // Nodeapplication arguments. - nodeapp_options_ = get_opts.opt_arg (); - break; - - case 'd': // Get the spawn delay argument. - spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case 'n': - register_with_ns_ = true; - break; - - case 'p': - pid_file_name_ = get_opts.opt_arg (); - break; - - case 'm': - is_multi_threaded = true; - break; - - case '?': // Display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s\n" - "-o <ior_output_file>\n" - "-c <svc.conf file>\n" - "-n <use naming service>\n" - "-s <NodeApplication executable path>\n" - "-a <arguments to NodeApplication>\n" - "-d <spawn delay for nodeapplication>\n" - "-p <pid file>\n" - "-m <running in multi-threaded mode>\n" - "\n", - argv [0]), - -1); - break; - } - } - - return 0; -} - -int -write_IOR (const char* ior) -{ - FILE* ior_output_file_ = - ACE_OS::fopen (ior_file_name_, "w"); - - if (ior_output_file_) - { - ACE_OS::fprintf (ior_output_file_, - "%s", - ior); - ACE_OS::fclose (ior_output_file_); - } - - 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, - CIAO::NodeManagerDaemon_ptr obj) -{ - // Naming Service related operations - CORBA::Object_var naming_context_object = - orb->resolve_initial_references ("NameService"); - - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_context_object.in ()); - - // Initialize the Naming Sequence - CosNaming::Name name (1); - name.length (1); - name[0].id = name_context; - - 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; -} - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - try - { - // Initialize orb - // @@TODO: Add error checking. There is absoluteley none. - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - - CIAO::Server_init (orb.in ()); - - if (parse_args (argc, argv) != 0) - return -1; - - // Check if NodeApplication executable location has been - // specified - if (! nodeapp_loc_) - { - ACE_DEBUG ((LM_DEBUG, "Use -s <NodeApplicationPath> to specify \ - executable path\n")); - ACE_OS::exit (1); - } - - // Get reference to Root POA. - CORBA::Object_var obj - = orb->resolve_initial_references ("RootPOA"); - - PortableServer::POA_var poa - = PortableServer::POA::_narrow (obj.in ()); - - CORBA::Object_var table_object = - orb->resolve_initial_references ("IORTable"); - - IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in ()); - - if (CORBA::is_nil (adapter.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, "Nil IORTable\n"), -1); - } - - // Create and install the CIAO NodeManager servant - CIAO::NodeManager_Impl *node_manager_servant = 0; - ACE_NEW_RETURN (node_manager_servant, - CIAO::NodeManager_Impl("NodeManager", - orb.in (), - poa.in (), - nodeapp_location_, - nodeapp_options_.c_str (), - spawn_delay, - is_multi_threaded), - -1); - - PortableServer::ServantBase_var safe_daemon (node_manager_servant); - - node_manager_servant->init (); - - // Implicit activation - CIAO::NodeManagerDaemon_var node_manager = - node_manager_servant->_this (); - - CORBA::String_var str = - orb->object_to_string (node_manager.in ()); - - adapter->bind ("NodeManager", - str.in ()); - - if (write_to_ior_) - { - write_IOR (str.in ()); - } - else if (register_with_ns_) - { - char name [MAXHOSTNAMELEN + 1]; - - if (ACE_OS::hostname (name, MAXHOSTNAMELEN + 1) == -1) - { - ACE_ERROR ((LM_ERROR, - "gethostname call failed! \n")); - ACE_OS::exit (1); - } - - // Register this name with the Naming Service - (void) register_with_ns (name, - orb.in (), - node_manager.in ()); - } - - ACE_DEBUG ((LM_INFO, "CIAO_NodeManager IOR: %s\n", str.in ())); - - // Activate POA manager - PortableServer::POAManager_var mgr - = poa->the_POAManager (); - - mgr->activate (); - - // Here start the Monitor - /* - MonitorController* monitor_controller - = new MonitorController (orb); - - 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 (); - - poa->destroy (1, 1); - - orb->destroy (); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("CIAO_NodeManager::main\t\n"); - return 1; - } - - ACE_DEBUG ((LM_DEBUG, - "CIAO_NodeManager has closed\n")); - return 0; -} diff --git a/CIAO/DAnCE/NodeManager/Node_Manager_Exec.cpp b/CIAO/DAnCE/NodeManager/Node_Manager_Exec.cpp new file mode 100644 index 00000000000..889604048c5 --- /dev/null +++ b/CIAO/DAnCE/NodeManager/Node_Manager_Exec.cpp @@ -0,0 +1,6 @@ +// $Id$ +#include "Node_Manager_Module.h" + +#define DANCE_MODULE_MAIN_CLASS_NAME DAnCE_NodeManager_Module +#include "Deployment/Module_Main.h" + diff --git a/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp b/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp new file mode 100644 index 00000000000..1df77501dd6 --- /dev/null +++ b/CIAO/DAnCE/NodeManager/Node_Manager_Module.cpp @@ -0,0 +1,653 @@ +// -*- C++ -*- +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/OS.h" + +#include "tao/TAO_Singleton_Manager.h" +#include "tao/StringSeqC.h" +#include "tao/IORTable/IORTable.h" +#include "tao/Utils/PolicyList_Destroyer.h" +#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/orbsvcs/Naming/Naming_Loader.h" +#include "ciao/CIAO_common.h" +#include "ciao/Valuetype_Factories/Cookies.h" +#include "ciao/ComponentServer/CIAO_PropertiesC.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "DAnCE/Deployment/DAnCE_PropertiesC.h" +#include "Node_Manager_Module.h" +#include "NodeManager_Impl.h" +#include "RedirectionService/RedirectionService.h" + +ACE_RCSID (DAnCE, + Node_Manager_Module, + "$Id$") + +namespace DAnCE +{ + namespace Node_Manager + { + bool + write_IOR (const ACE_TCHAR * ior_file_name, const char* ior) + { + FILE* ior_output_file_ = + ACE_OS::fopen (ior_file_name, ACE_TEXT("w")); + + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, + "%s", + ior); + ACE_OS::fclose (ior_output_file_); + return true; + } + return false; + } + } +} + +DAnCE_NodeManager_Module::DAnCE_NodeManager_Module (void) + : redirection_ (0) +{ + DANCE_TRACE("DAnCE_NodeManager_Module::DAnCE_NodeManager_Module"); +} + +DAnCE_NodeManager_Module::~DAnCE_NodeManager_Module (void) +{ + DANCE_TRACE ("DAnCE_NodeManager_Module::~DAnCE_NodeManager_Module"); + + for (Servant_Map::iterator it = this->nm_map_.begin (); + it != this->nm_map_.end (); + ++it) + { + delete (*it).int_id_; + } + + delete this->redirection_; +} + +const char * +DAnCE_NodeManager_Module::usage (void) +{ + DANCE_TRACE ("DAnCE_NodeManager_Module::usage"); + return "Node Manager Options:\n" + "\t-e,--exec-mgr\t\t [execution manager ior file name]\n" + "\t-n,--node-mgr\t\t <node name> [=node manager ior file name]\n" + // "\t-p,--process-ns\t\t\t [file name] create process name service and store its ior to file name\n" + "\t-c,--create-plan-ns [NC] create plan objects (components and ports) representation in name context with ior NC\n" + "\t-r,--rebind-plan-ns [NC] bind plan representation name context to NC\n" + "\t-i,--port-indirection\t enable plan objects indirection via servant locator\n" + //"\t-f,--ignore-failure\t\t ignore deployment failures\n" + "\t-s,--server-executable\t default component server executable\n" + "\t--server-args\t\t additional arguments to supply to the component server\n" + "\t--standalone-nm\t\t Indicates that this NodeManager is not managed by an ExecutionManager\n" + "\t-t,--timeout\t\t default timeout in seconds to wait for component server spawn\n" + "\t-d,--domain-nc [NC]\t Default naming context for domain objects.\n" + "\t--instance-nc [NC]\t Default naming context for instance registration directives. No argument indicates Domain NC.\n" + "\t-h,help\t\t\t print this help message\n"; +} + +bool +DAnCE_NodeManager_Module::parse_args (int argc, ACE_TCHAR * argv[]) +{ + ACE_Get_Opt get_opts (argc, + argv, + ACE_TEXT("e:n:p::c::r::ifs:t:h"), + 0, + 0, + ACE_Get_Opt::RETURN_IN_ORDER); + + get_opts.long_option (ACE_TEXT("exec-mgr"), 'e', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("node-mgr"), 'n', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("process-ns"), 'p', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option (ACE_TEXT("create-plan-ns"), 'c', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option (ACE_TEXT("rebind-plan-ns"), 'r', ACE_Get_Opt::ARG_OPTIONAL); + get_opts.long_option (ACE_TEXT("port-indirection"), 'i', ACE_Get_Opt::NO_ARG); + get_opts.long_option (ACE_TEXT("ignore-failure"), 'f', ACE_Get_Opt::NO_ARG); + get_opts.long_option (ACE_TEXT("server-executable"), 's', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("server-args"), ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("standalone-nm"), ACE_Get_Opt::NO_ARG); + get_opts.long_option (ACE_TEXT("timeout"), 't', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("domain-nc"), 'd', ACE_Get_Opt::ARG_REQUIRED); + get_opts.long_option (ACE_TEXT("help"), 'h', ACE_Get_Opt::NO_ARG); + get_opts.long_option (ACE_TEXT("instance-nc"), ACE_Get_Opt::ARG_REQUIRED); + + //get_opts.long_option ("help", '?'); + + char c; + while ( (c = get_opts ()) != -1) + { + switch (c) + { + case 'n': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Provided Node Manager name: %C\n", get_opts.opt_arg ())); + this->options_.node_managers_.push_back (get_opts.opt_arg ()); + break; + + case 'p': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instructed to create process ns with file %C\n", get_opts.opt_arg ())); + this->options_.process_ns_ = true; + this->options_.process_ns_file_ = get_opts.opt_arg (); + break; + + case 'c': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instructed to create plan NS in context: %C\n", get_opts.opt_arg ())); + this->options_.create_plan_ns_ = true; + this->options_.create_plan_ns_ior_ = get_opts.opt_arg (); + break; + + case 'r': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instructed to rebind plan NS in context: %C\n", get_opts.opt_arg ())); + this->options_.rebind_plan_ns_ = true; + this->options_.rebind_plan_ns_ior_ = get_opts.opt_arg (); + break; + + case 'i': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instructed to create port indirection service\n")); + this->options_.port_indirection_ = true; + break; + + case 'f': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instructed to ignore deployment errors\n")); + this->options_.ignore_failure_ = true; + break; + + case 's': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Using provided component server executable:%C\n", + get_opts.opt_arg ())); + this->options_.cs_path_ = get_opts.opt_arg (); + break; + + case 't': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Using provided component server spawn timeout:%C\n", + get_opts.opt_arg ())); + this->options_.timeout_ = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case 'd': + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Binding to provided Domain Naming Context: '%s'\n", + get_opts.opt_arg ())); + this->options_.domain_nc_ = get_opts.opt_arg (); + break; + + case 'h': + //case '?': // Display help for use of the server. + //default: + DANCE_ERROR_RETURN ( (LM_ERROR, + this->usage (), + argv [0], c), + false); + break; + + case 0: + if (ACE_OS::strcmp (get_opts.long_option (), ACE_TEXT("standalone-nm")) == 0) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Found option directing NodeManager to run as standalone entity.\n")); + this->options_.standalone_ = true; + } + else if (ACE_OS::strcmp (get_opts.long_option (), + ACE_TEXT("server-args")) == 0) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Using provided compoent server arguments: '%C'\n", + get_opts.opt_arg ())); + this->options_.server_args_ = get_opts.opt_arg (); + } + else if (ACE_OS::strcmp (get_opts.long_option (), + "instance-nc") == 0) + { + if (get_opts.opt_arg () == 0) + { + if (this->options_.domain_nc_ == 0) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Manager_Module::parse_args - " + "ERROR: instance-nc provided no argument, but domain-nc did not appear before.\n")); + DANCE_ERROR_RETURN ((LM_ERROR, this->usage (), argv[0], c), false); + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Instance NC defaulting to Domain NC\n")); + this->options_.instance_nc_ = this->options_.domain_nc_; + } + else + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Node_Manager_Module::parse_args - " + "Using provided instance NC: %C\n", + get_opts.opt_arg ())); + this->options_.instance_nc_ = get_opts.opt_arg (); + } + } + else + { + DANCE_ERROR ((LM_ERROR, DLINFO "Node_Manager_Module::parse_args - " + "ERROR: unknown long option %C\n", + get_opts.long_option ())); + } + + break; + + default: + DANCE_DEBUG ((LM_TRACE, DLINFO "Node_Manager_Module::parse_args - ignoring unknown option %i\n", + c)); + } + } + return true; +} + +CORBA::Object_ptr +DAnCE_NodeManager_Module::create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv[]) +{ + try + { + if (CORBA::is_nil(orb)) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Attempted to create Node Manager with a nil orb.\n")); + return CORBA::Object::_nil(); + } + + if (CORBA::is_nil(this->orb_.in())) + { + DANCE_DEBUG((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "NM's orb is nil.\n")); + this->orb_ = CORBA::ORB::_duplicate (orb); + } + else if (ACE_OS::strcmp(orb->id(), this->orb_->id()) != 0) + { + DANCE_DEBUG((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Resetting NM's orb.\n")); + this->orb_ = CORBA::ORB::_duplicate (orb); + this->domain_nc_ = CosNaming::NamingContext::_nil(); + } + + if (!this->parse_args (argc, argv)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Failed to parse command line arguments, exiting\n")); + return CORBA::Object::_nil (); + } + + + /* @@CDMW stuff, figure out what to do with this later.... + try + { + CORBA::Object_var obj = orb->resolve_initial_references ("ProcessDestinationNC"); + if (CORBA::is_nil(obj)) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "ProcessDestinationNC can not be resolved. RIR returned nil.\n")); + return CORBA::Object::_nil(); + } + + CosNaming::NamingContext_var pdnc = CosNaming::NamingContext::_narrow(obj.in()); + if (CORBA::is_nil(pdnc.in())) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "ProcessDestinationNC can not be narrowed to NC.\n")); + return CORBA::Object::_nil(); + } + } + catch (CORBA::ORB::InvalidName &) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "ProcessDestinationNC can not be resolved. InvalidName.\n")); + return CORBA::Object::_nil(); + } + catch(...) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "ProcessDestinationNC can not be retrieved. Unknown exception.\n")); + return CORBA::Object::_nil(); + } + */ + + + this->register_value_factories (); + this->create_poas (); + + if (this->options_.domain_nc_) + { + try + { + DANCE_DEBUG((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Resolving DomainNC.\n")); + CORBA::Object_var domain_obj = this->orb_->string_to_object (this->options_.domain_nc_); + if (!CORBA::is_nil (domain_obj.in ())) + { + this->domain_nc_ = CosNaming::NamingContext::_narrow (domain_obj.in()); + if (CORBA::is_nil (this->domain_nc_.in ())) + { + DANCE_ERROR ((LM_ERROR,DLINFO "DAnCE_NodeManager_Module::create_object - " + "Narrow to NamingContext return nil for DomainNC.\n")); + return CORBA::Object::_nil (); + } + } + } + catch (CORBA::Exception&) + { + DANCE_DEBUG ((LM_WARNING, DLINFO "DAnCE_NodeManager_Module::create_object - " + "DomainNC context not found!\n")); + } + } + + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Resolving plan NS naming context.\n")); + CosNaming::NamingContext_var rebind_nc; + if (this->options_.rebind_plan_ns_) + { + if (!this->options_.create_plan_ns_) + { + DANCE_ERROR((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Rebind_plan_ns option is enabled but Create_plan_ns is not.\n")); + return CORBA::Object::_nil(); + } + CORBA::Object_var tmp_obj; + if (0 != this->options_.rebind_plan_ns_ior_) + { + tmp_obj = orb->string_to_object (this->options_.rebind_plan_ns_ior_); + rebind_nc = CosNaming::NamingContext::_narrow (tmp_obj); + } + else + { + if (CORBA::is_nil (this->domain_nc_.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "The rebind plan is enabled but neither NC " + "nor DomainNC are not supplied. No rebinding will be done.\n" + "Use the \"-rebind-plan-ns NC ior\" " + "or \"-ORBInitRef DomainNC\" option.\n")); + return CORBA::Object::_nil (); + } + rebind_nc = CosNaming::NamingContext::_duplicate (this->domain_nc_.in ()); + } + } + + // Initialize IOR table + CORBA::Object_var table_object = orb->resolve_initial_references ("IORTable"); + + IORTable::Table_var adapter = IORTable::Table::_narrow (table_object.in ()); + + if (CORBA::is_nil (adapter.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Unable to RIR the IORTable.\n")); + return CORBA::Object::_nil (); + } + + // Creating in process nameservice + CosNaming::NamingContext_var plan_nc; + TAO_Naming_Loader loader; + if (this->options_.create_plan_ns_) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Resolving plan-specific naming context.\n")); + CORBA::Object_var naming_obj; + if (0 != this->options_.create_plan_ns_ior_) + { + naming_obj = orb->string_to_object (this->options_.create_plan_ns_ior_); + plan_nc = CosNaming::NamingContext::_narrow (naming_obj.in()); + if (CORBA::is_nil (plan_nc.in())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Failed trying to narrow naming context " + "for dance creating plan NC.\n" + "Use the \"--create-plan-ns NC ior\" " + "or \"--process-ns\" option.\n")); + return CORBA::Object::_nil (); + } + } + else if (this->options_.process_ns_) + { + const int argc_ns = 1; + char* argv_ns[argc_ns]; + argv_ns[0] = argv[0]; + naming_obj = orb->resolve_initial_references ("NameService"); + if (0 != this->options_.process_ns_file_) + { + CORBA::String_var ior = orb->object_to_string (naming_obj.in ()); + DAnCE::Node_Manager::write_IOR (this->options_.process_ns_file_, ior.in ()); + } + plan_nc = CosNaming::NamingContext::_narrow (naming_obj.in ()); + if (CORBA::is_nil (plan_nc.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Fails trying to narrow naming context " + "for dance creating plan NC.\n" + "Use the \"--create-plan-ns NC ior\" " + "or \"--process-ns\" option.\n")); + return CORBA::Object::_nil (); + } + } + else if (CORBA::is_nil (this->domain_nc_.in ())) + { + DANCE_ERROR ((LM_ERROR,DLINFO "DAnCE_NodeManager_Module::create_object - " + "The create plan is enabled but neither NC ior " + "nor --process-ns or DomainNC option are not supplied.\n" + "Use the \"--create-plan-ns NC ior\", \"--process-ns\" " + "or \"-ORBInitRef DomainNC\" option.\n")); + return CORBA::Object::_nil (); + } + else + { + plan_nc = CosNaming::NamingContext::_duplicate (this->domain_nc_.in ()); + } + } + + //Creating redirection object + if (this->redirection_ == 0) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Creating redirection service object\n")); + this->redirection_ = new DAnCE::RedirectionService (orb, + this->root_poa_.in (), + plan_nc.in (), + rebind_nc.in (), + this->options_.create_plan_ns_, + this->options_.port_indirection_); + } + + // Make sure that we have only one Node Manager + if (this->options_.node_managers_.size () != 1) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "For now only one node manager creation is supported.\n")); + return CORBA::Object::_nil (); + } + + DANCE_DEBUG ((LM_DEBUG, DLINFO "DAnCE_NodeManager_Module::create_object - " + "DAnCE_NodeManager::run_main - creating NodeManager for node %C\n", + this->options_.node_managers_[0].c_str())); + + // Parsing Node name and node manager ior file name + ACE_CString node_name = this->options_.node_managers_[0].c_str (); + ACE_CString node_file; + size_t npos = node_name.find ('='); + if (ACE_CString::npos != npos) + { + node_file = node_name.substring (npos + 1, node_name.length() - npos + 1); + node_name = node_name.substring (0, npos); + } + + DANCE_DEBUG ((LM_INFO, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Creating node named '%C' and outputting ior to file '%C'\n", + node_name.c_str (), + node_file.c_str ())); + + //Creating node manager servant + DAnCE::NodeManager_Impl * nm = 0; + if (this->nm_map_.find (node_name, nm) == -1) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Allocating new NodeManger servant instance for NodeManager\n")); + int size = 64; + DAnCE::PROPERTY_MAP properties (size); + this->create_nm_properties (properties); + + ACE_NEW_RETURN (nm, + DAnCE::NodeManager_Impl (orb, + this->root_poa_.in (), + node_name.c_str(), + *this->redirection_, + properties), + CORBA::Object::_nil ()); + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "New NodeManger servant instance for NodeManager allocated.\n")); + this->nm_map_.bind (node_name, nm); + } + + ACE_CString node_manager_oid = node_name + ".NodeManager"; + + // Registering servant in poa + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (node_manager_oid.c_str()); + this->nm_poa_->activate_object_with_id (oid, nm); + + // Getting node manager ior + CORBA::Object_var nm_obj = this->nm_poa_->id_to_reference (oid.in ()); + CORBA::String_var ior = orb->object_to_string (nm_obj.in ()); + + // Binding ior to IOR Table + adapter->bind (node_manager_oid.c_str (), ior.in ()); + + // Binding node menager to DomainNC + if (!CORBA::is_nil (this->domain_nc_.in ())) + { + DANCE_DEBUG((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Registering NM in NC as \"%C.NodeManager\".\n", node_name.c_str ())); + CosNaming::Name name (1); + name.length (1); + name[0].id = CORBA::string_dup (node_name.c_str ()); + name[0].kind = CORBA::string_dup ("NodeManager"); + this->domain_nc_->rebind (name, nm_obj.in ()); + } + + // Writing ior to file + if (0 != node_file.length ()) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Writing node IOR %C to file %C.\n", node_file.c_str (), ior.in ())); + if (!DAnCE::Node_Manager::write_IOR (node_file.c_str (), ior.in ())) + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Error: Unable to write IOR to file %C\n", + node_file.c_str ())); + } + + // Activate POA manager + PortableServer::POAManager_var mgr = this->root_poa_->the_POAManager (); + mgr->activate (); + + // Finishing Deployment part + DANCE_DEBUG ((LM_NOTICE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "DAnCE_NodeManager is running...\n")); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "DAnCE_NodeManager_Module::create_object - " + "NodeManager IOR: %s\n", ior.in ())); + + return nm_obj._retn (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("DAnCE_NodeManager::main\t\n"); + return CORBA::Object::_nil (); + } +} + +void +DAnCE_NodeManager_Module::register_value_factories (void) +{ + DANCE_TRACE("DAnCE_Node_Manager_Module::register_value_factories (void)"); + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_object - " + "Registering Cookie value factory.\n")); + CORBA::ValueFactory_var vf = new Components::Cookie_init(); + vf = this->orb_->register_value_factory ("IDL:omg.org/Components/Cookie:1.0", vf.in()); +} + +void +DAnCE_NodeManager_Module::create_poas (void) +{ + DANCE_TRACE("DAnCE_Node_Manager_Module::create_poas"); + // Get reference to Root POA. + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_poas - " + "Resolving root POA\n")); + CORBA::Object_var obj = this->orb_->resolve_initial_references ("RootPOA"); + + this->root_poa_ = PortableServer::POA::_narrow (obj.in ()); + + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_poas - " + "Obtaining the POAManager\n")); + PortableServer::POAManager_var mgr = this->root_poa_->the_POAManager (); + + TAO::Utils::PolicyList_Destroyer policies (2); + policies.length (2); + + try + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_NodeManager_Module::create_poas - " + "DAnCE_NodeManager_Module::create_poas - " + "Creating the \"Managers\" POA.\n")); + + policies[0] = this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID); + policies[1] = this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT); + this->nm_poa_ = this->root_poa_->create_POA ("Managers", + mgr.in(), + policies); + } + catch (const PortableServer::POA::AdapterAlreadyExists &) + { + DANCE_DEBUG ((LM_INFO, DLINFO "DAnCE_NodeManager_Module::create_poas - " + "Using exiswting \"Managers\" POA\n")); + this->nm_poa_ = this->root_poa_->find_POA ("Managers", 0); + } +} + +void +DAnCE_NodeManager_Module::create_nm_properties (DAnCE::PROPERTY_MAP &props) +{ + { + CORBA::Any val; + val <<= this->options_.timeout_; + props.bind (CIAO::Deployment::SERVER_TIMEOUT, val); + } + { + CORBA::Any val; + val <<= CORBA::Any::from_string (CORBA::string_dup (this->options_.cs_path_),0); + props.bind (CIAO::Deployment::SERVER_EXECUTABLE, val); + } + { + CORBA::Any val; + val <<= CORBA::Any::from_boolean (this->options_.standalone_); + props.bind (DAnCE::STANDALONE_NM, val); + } + { + CORBA::Any val; + val <<= CORBA::Any::from_string (CORBA::string_dup (this->options_.server_args_),0); + props.bind (CIAO::Deployment::SERVER_ARGUMENTS, val); + } + if (this->options_.instance_nc_) + { + CORBA::Any val; + val <<= CORBA::Any::from_string (CORBA::string_dup (this->options_.instance_nc_), 0); + props.bind (DAnCE::INSTANCE_NC, val); + } + if (this->options_.domain_nc_) + { + CORBA::Any val; + val <<= CORBA::Any::from_string (CORBA::string_dup (this->options_.domain_nc_), 0); + props.bind (DAnCE::DOMAIN_NC, val); + } +} + +#ifndef BUILD_NODE_MANAGER_EXE +ACE_FACTORY_DEFINE (DAnCE_NodeManager_Module, DAnCE_NodeManager_Module) +#endif /*BUILD_NODE_MANAGER_EXE */ diff --git a/CIAO/DAnCE/NodeManager/Node_Manager_Module.h b/CIAO/DAnCE/NodeManager/Node_Manager_Module.h new file mode 100644 index 00000000000..97487f15328 --- /dev/null +++ b/CIAO/DAnCE/NodeManager/Node_Manager_Module.h @@ -0,0 +1,133 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Node_Manager_Module.h + * + * $Id$ + * + * @Brief To start NodeManager by starter + * + * @author Vinzenz Tornow <vt@prismtech.com> + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef NODE_MANAGER_MODULE_H +#define NODE_MANAGER_MODULE_H + +#include /**/ "ace/pre.h" + +#include "DAnCE_NodeManager_Module_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Service_Config.h" +#include "ace/Vector_T.h" +#include "ace/Map_Manager.h" +#include "ace/Null_Mutex.h" +#include "tao/ORB.h" +#include "tao/PortableServer/POAC.h" +#include "orbsvcs/CosNamingC.h" +#include "tao/Object_Loader.h" +#include "Deployment/DAnCE_Loader.h" +#include "DAnCE/Deployment/Deployment_common.h" + +namespace DAnCE +{ + class NodeManager_Impl; + class RedirectionService; +} + +/** + * @class Node_Manager_Module + * + * @brief The shared object that is instantiated when the node manager + * module/library is dynamically loaded. + * + * This class runs the node manager instance + */ +class DAnCE_NodeManager_Module_Export DAnCE_NodeManager_Module + : public DAnCE::DAnCE_Object_Loader +{ + public: + struct SOptions + { + bool process_ns_; + const char* process_ns_file_; + bool create_plan_ns_; + const char* create_plan_ns_ior_; + bool rebind_plan_ns_; + const char* rebind_plan_ns_ior_; + bool port_indirection_; + ACE_Vector<ACE_CString> node_managers_; + bool ignore_failure_; + const char * cs_path_; + unsigned int timeout_; + CORBA::Boolean standalone_; + const char * server_args_; + const char * domain_nc_; + const char * instance_nc_; + + SOptions() + : process_ns_ (false), + process_ns_file_ (0), + create_plan_ns_ (false), + create_plan_ns_ior_ (0), + rebind_plan_ns_ (false), + rebind_plan_ns_ior_ (0), + ignore_failure_ (false), + cs_path_ (0), + timeout_ (5), + standalone_ (false), + server_args_ (0), + domain_nc_ (0), + instance_nc_ (0) + { + } + }; + + /// Constructor. + DAnCE_NodeManager_Module (void); + + /// Destructor. + ~DAnCE_NodeManager_Module (void); + + /// Overload the base class method to create a new instance + /// of a DAnCE_NodeManager_Module object. + virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv []); + + virtual const char * usage (void); + + virtual bool parse_args (int argc, ACE_TCHAR *argv []); + + private: + void register_value_factories (void); + void create_poas (void); + void create_nm_properties (DAnCE::PROPERTY_MAP &props); + + /// Here we store the servants. + typedef ACE_Map_Manager < ACE_CString, + DAnCE::NodeManager_Impl *, + ACE_Null_Mutex > Servant_Map; + Servant_Map nm_map_; + CORBA::ORB_var orb_; + CosNaming::NamingContext_var domain_nc_; + + /// Single redirection service for all NMs. + DAnCE::RedirectionService * redirection_; + SOptions options_; + + PortableServer::POA_var root_poa_; + PortableServer::POA_var nm_poa_; +}; + +ACE_FACTORY_DECLARE (DAnCE_NodeManager_Module, DAnCE_NodeManager_Module) + +#include /**/ "ace/post.h" + +#endif /* NODE_MANAGER_MODULE_H */ diff --git a/CIAO/DAnCE/Plan_Generator/Plan_Generator.mpc b/CIAO/DAnCE/Plan_Generator/Plan_Generator.mpc index 082fb9b47df..8a1091e5c58 100644 --- a/CIAO/DAnCE/Plan_Generator/Plan_Generator.mpc +++ b/CIAO/DAnCE/Plan_Generator/Plan_Generator.mpc @@ -1,7 +1,8 @@ // -*- MPC -*- //$Id$ -project (Plan_Generator): ciao_component_dnc, ace_output { +project (Plan_Generator) { //: ciao_component_dnc, ace_output { + requires += dummy_label sharedname = Plan_Generator after += RepositoryManager diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index 4365434bcc4..9ca8632e434 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -1,359 +1,42 @@ // $Id$ -#include "Plan_Launcher_Benchmark_Impl.h" +#include "Plan_Launcher_Impl.h" -#include "ace/OS.h" -#include "ace/Get_Opt.h" -#include <iostream> - -#include "DAnCE/Interfaces/ExecutionManagerDaemonC.h" - -namespace CIAO -{ - namespace Plan_Launcher +namespace DAnCE { - // deployment plan URL - const char* deployment_plan_url = 0; - bool use_package_name = true; - const char* package_names = 0; - const char* package_types = 0; - const char* new_deployment_plan_url = 0; - const char* plan_uuid = 0; - bool em_use_naming = false; - const char* em_ior_file = "file://em.ior"; - bool rm_use_naming = false; - bool use_repoman = false; - const char* rm_ior_file = "file://rm.ior"; - const char* repoman_name_ = "RepositoryManager"; - const char* dap_ior_filename = 0; - const char* dap_ior = 0; - bool do_benchmarking = false; - size_t niterations = 0; - CORBA::Short priority = 0; - - enum mode_type { - pl_mode_start, - pl_mode_interactive, - pl_mode_stop_by_dam, - pl_mode_stop_by_uuid, - pl_mode_redeployment - }; - - // default mode - mode_type mode = pl_mode_interactive; - - static void - usage (const ACE_TCHAR* program) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[(%P|%t) Executor] Usage: %s\n") - ACE_TEXT ("-a <PACKAGE_NAMES>\n") - ACE_TEXT ("-b <BENCHMARKING_ITERATIONS>\n") - ACE_TEXT ("-e <PACKAGE_TYPES>\n") - ACE_TEXT ("-i <DOMAIN_APPLICATION_MANAGER_IOR_FOR_INPUT>: Tear down the application launched by this Domain Application Manager\n") - ACE_TEXT ("-k <EXECUTION_MANAGER_IOR>") - ACE_TEXT (" : Default file://em.ior\n") - ACE_TEXT ("-l <REPOSITORY_MANAGER_IOR>") - ACE_TEXT (" : Default file://rm.ior\n") - ACE_TEXT ("-n : Use naming service to fetch EM\n") - ACE_TEXT ("-o <DOMAIN_APPLICATION_MANAGER_IOR_OUTPUT_FILE>: Use this option to dump out the IOR of the Domain Application Manager\n") - ACE_TEXT ("-p <DEPLOYMENT_PLAN_URL>\n") - ACE_TEXT ("-r <NEW_PLAN_DESCRIPTOR_FOR_REDEPLOYMENT>\n") - ACE_TEXT ("-t <PLAN_UUID>\n") - ACE_TEXT ("-v <REPOSITORY_MANAGER_NAME>: Use naming service to fetch RM with the given name") - ACE_TEXT (" : Default RepositoryManager\n") - ACE_TEXT ("-z <DESIRED_CORBA_PRIORITY_FOR_EXECUTION_MANAGER>\n") - ACE_TEXT ("-h : Show this usage information\n"), - program)); - } - - static bool - parse_args (int argc, - ACE_TCHAR *argv[]) - { - ACE_Get_Opt get_opt (argc, - argv, - ACE_TEXT ("a:b:e:p:nk:l:v:t:o:i:r:z:h")); - int c; - - while ((c = get_opt ()) != EOF) - { - switch (c) - { - case 'a': - package_names = get_opt.opt_arg (); - use_package_name = true; - break; - case 'b': - do_benchmarking = true; - niterations = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'e': - package_types = get_opt.opt_arg (); - use_package_name = false; - break; - case 'p': - deployment_plan_url = get_opt.opt_arg (); - break; - case 'n': - em_use_naming = true; - break; - case 'k': - em_ior_file = get_opt.opt_arg (); - break; - case 'l': - use_repoman = true; - rm_ior_file = get_opt.opt_arg (); - break; - case 'v': - use_repoman = true; - rm_use_naming = true; - repoman_name_ = get_opt.opt_arg (); - break; - case 'o': - dap_ior_filename = get_opt.opt_arg (); - mode = pl_mode_start; - break; - case 'i': - dap_ior = get_opt.opt_arg (); - mode = pl_mode_stop_by_dam; - break; - case 't': - plan_uuid = get_opt.opt_arg (); - mode = pl_mode_stop_by_uuid; - break; - case 'r': - new_deployment_plan_url = get_opt.opt_arg (); - mode = pl_mode_redeployment; - break; - case 'z': - priority = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'h': - default: - usage(argv[0]); - return false; - } - } - - if ((mode != pl_mode_stop_by_dam) && - (mode != pl_mode_stop_by_uuid) && - (package_names == 0) && - (package_types == 0) && - (deployment_plan_url == 0) && - (new_deployment_plan_url == 0)) - { - usage (argv[0]); - return false; - } - - return true; - } - - static ::Deployment::DomainApplicationManager_ptr - read_dap_ior (CORBA::ORB_ptr orb) - { - CORBA::Object_var obj = orb->string_to_object (dap_ior); - return - Deployment::DomainApplicationManager::_narrow (obj.in ()); - } - - static int - write_dap_ior (CORBA::ORB_ptr orb, - ::Deployment::DomainApplicationManager_ptr dap) + namespace Plan_Launcher { - CORBA::String_var ior = orb->object_to_string (dap); - FILE* ior_output_file = ACE_OS::fopen (dap_ior_filename, "w"); - - if (ior_output_file) - { - ACE_OS::fprintf (ior_output_file, "%s", ior.in ()); - ACE_OS::fclose (ior_output_file); - return 0; - } - else - { - ACE_DEBUG ((LM_DEBUG, - "Error in opening file %s to write DAM IOR: %m", - dap_ior_filename)); - return -1; - } - } - - static int + int run_main_implementation (int argc, char *argv[]) { - try { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) == false) - return -1; - - Plan_Launcher_i * launcher = 0; - - if (do_benchmarking) - { - ACE_NEW_RETURN (launcher, - Plan_Launcher_Benchmark_i, - -1); - } - else - { - ACE_NEW_RETURN (launcher, - Plan_Launcher_i, - -1); - } - - if (!launcher->init (em_use_naming ? 0 : em_ior_file, - orb.in (), - use_repoman, - rm_use_naming, - rm_use_naming ? repoman_name_ : rm_ior_file, - priority, - niterations)) - { - 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 - { - CORBA::String_var uuid; - - if (package_names != 0) - uuid = launcher->launch_plan (deployment_plan_url, - package_names, - use_package_name, - use_repoman); - else - uuid = launcher->launch_plan (deployment_plan_url, - package_types, - use_package_name, - use_repoman); - - if (uuid.in () == 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.in ())); - dapp_mgr = launcher->get_dam (uuid.in ()); - - // Write out DAM ior if requested - if (mode == pl_mode_start) - { - if (write_dap_ior (orb.in (), dapp_mgr.in ()) != 0) - return -1; - } - else // if (pl_mode_interactive) - { - ACE_DEBUG ((LM_DEBUG, - "Press <Enter> to tear down application\n")); - char dummy [256]; - std::cin.getline (dummy, 256); - - // Tear down the assembly - ACE_DEBUG ((LM_DEBUG, - "Plan_Launcher: destroy the application.....\n")); - if (! launcher->teardown_plan (uuid)) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) CIAO_PlanLauncher:tear down assembly failed: " - "unknown plan uuid.\n")); - } - } - else if (mode == pl_mode_redeployment && new_deployment_plan_url != 0) // do redeployment - { - ACE_DEBUG ((LM_DEBUG, - "Plan_Launcher: reconfigure application assembly.....\n")); - - CORBA::String_var uuid; - - if (package_names != 0) - uuid = launcher->re_launch_plan (new_deployment_plan_url, - package_names, - use_package_name, - use_repoman); - else - uuid = launcher->re_launch_plan (new_deployment_plan_url, - package_types, - use_package_name, - use_repoman); - - if (uuid.in () == 0) - { - ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error re-launching plan\n")); - return -1; - } - } - else if (mode == pl_mode_stop_by_dam) // tear down by DAM - { - dapp_mgr = read_dap_ior (orb.in ()); - - if (CORBA::is_nil (dapp_mgr.in ())) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) CIAO_PlanLauncher:tear down assembly failed: " - "nil DomainApplicationManager reference\n")); - return -1; - } - - // Tear down the assembly - ACE_DEBUG ((LM_DEBUG, - "Plan_Launcher: destroy the application.....\n")); - launcher->teardown_plan (dapp_mgr.in ()); - } - else if (mode == pl_mode_stop_by_uuid) // tear down by plan_uuid - { - // Tear down the assembly - ACE_DEBUG ((LM_DEBUG, - "Plan_Launcher: destroy the application.....\n")); - if (! launcher->teardown_plan (plan_uuid)) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher:tear down assembly failed: " - "unkown plan uuid.\n")); - } - } - - orb->destroy (); + Plan_Launcher_Impl pl (argc, argv); + pl.execute(); } - catch (const Plan_Launcher_i::Deployment_Failure&) + catch (const Plan_Launcher_Impl::Deployment_Failure& e) { - ACE_ERROR ((LM_ERROR, - "Deployment failed. Plan_Launcher exiting.\n")); + DANCE_ERROR ( (LM_ERROR, "[%M] PlanLauncher error : %s.\n", e.error_.c_str())); } catch (const CORBA::Exception& ex) { - ex._tao_print_exception ("(%P|%t) Plan_Launcher: "); - + ex._tao_print_exception ("Plan_Launcher.cpp::run_main_implementation "); return -1; } catch (...) { - ACE_ERROR ((LM_ERROR, - "(%P|%t) Plan_Launcher: Unknown exception.\n")); + DANCE_ERROR ( (LM_ERROR, "[%M] Plan_Launcher.cpp::run_main_implementation Unknown exception.\n")); return -1; } - return 0; } - } -} -using namespace CIAO::Plan_Launcher; -int -ACE_TMAIN (int argc, - ACE_TCHAR *argv[]) -{ - return run_main_implementation (argc, argv); -} + } // Plan_Launcher +} // DAnCE + + + + diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.h new file mode 100644 index 00000000000..b2e7bfee44c --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.h @@ -0,0 +1,26 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Plan_Launcher.h + * + * $Id$ + * + * @Brief Run PlanLauncher + * + * @author Vinzenz Tornow <vt@prismtech.com> + */ +//============================================================================= + +#ifndef PLAN_LAUNCHER_H +#define PLAN_LAUNCHER_H + +namespace DAnCE + { + namespace Plan_Launcher + { + int run_main_implementation (int, char*[]); + } +} + +#endif /* PLAN_LAUNCHER_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc index 371672bdeb0..1863d60c249 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc @@ -1,46 +1,47 @@ // -*- MPC -*- // $Id$ -project(Plan_Launcher_Impl) : ciao_servant_dnc \ - , ciao_config_handlers \ - , ciao_executionmanager_stub \ - , ciao_plan_generator \ - , rtcorba \ - , dance_utils \ - , ace_output \ -{ - sharedname = Plan_Launcher_Impl - dynamicflags = PLAN_LAUNCHER_IMPL_BUILD_DLL +project(Plan_Launcher_Base) : dance_lib, taolib, tao_output, naming, dance_executionmanager_stub { + sharedname = DAnCE_Plan_Launcher_Base + dynamicflags = PLAN_LAUNCHER_BASE_IMPL_BUILD_DLL DANCE_PLAN_LAUNCHER_BASE_MODULE_BUILD_DLL Source_Files { - ../ExecutionManager/DAM_Map.cpp - Plan_Launcher_Impl.cpp - Plan_Launcher_Benchmark_Impl.cpp + Plan_Launcher_Base_Impl.cpp + Plan_Launcher_Base_Module.cpp } Header_Files { - ../ExecutionManager/DAM_Map.h - Plan_Launcher_Impl.h - Plan_Launcher_Impl_Export.h + Plan_Launcher_Base_Impl.h + Plan_Launcher_Base_Module.h + Plan_Launcher_Base_Impl_Export.h + Plan_Launcher_Base_Module_Export.h } } -project(Plan_Launcher) : ciao_server_dnc \ - , ciao_config_handlers \ - , ciao_executionmanager_stub \ - , ciao_plan_generator \ - , ciaoexe \ - , rtcorba \ - , dance_utils \ -{ - exename = plan_launcher - after += Plan_Launcher_Impl - libs += Plan_Launcher_Impl - +project(Plan_Launcher) : dance_lib, taolib, tao_output, xerces, naming, dance_executionmanager_stub, ciao_config_handlers { + sharedname = DAnCE_Plan_Launcher + dynamicflags = PLAN_LAUNCHER_IMPL_BUILD_DLL DANCE_PLAN_LAUNCHER_MODULE_BUILD_DLL + after += Plan_Launcher_Base + libs += DAnCE_Plan_Launcher_Base Source_Files { - Plan_Launcher.cpp + Plan_Launcher_Impl.cpp + Plan_Launcher_Module.cpp } Header_Files { + Plan_Launcher_Impl.h + Plan_Launcher_Module.h + Plan_Launcher_Impl_Export.h + Plan_Launcher_Module_Export.h } } + +project(Plan_Launcher_Exec) : dance_exe, xerces, naming, dance_executionmanager_stub, ciao_config_handlers { + after += Plan_Launcher + libs += DAnCE_Plan_Launcher DAnCE_Plan_Launcher_Base + exename = dance_plan_launcher + + Source_Files { + Plan_Launcher_Exec.cpp + } +}
\ No newline at end of file diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp new file mode 100644 index 00000000000..d1f6d0ce32b --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp @@ -0,0 +1,816 @@ +// $Id$ +#include "Plan_Launcher_Base_Impl.h" +#include "orbsvcs/CosNamingC.h" +#include "tao/ORB_Core.h" +#include "ace/Sched_Params.h" +#include "ccm/CCM_ObjectC.h" +#include "ace/Env_Value_T.h" +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "DAnCE/Logger/Log_Macros.h" + +namespace DAnCE +{ +namespace Plan_Launcher +{ + +Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl(CORBA::ORB_ptr orb, int argc, + ACE_TCHAR *argv[]) : + orb_(CORBA::is_nil (orb) ? 0 : CORBA::ORB::_duplicate (orb)), + em_(DAnCE::ExecutionManagerDaemon::_nil()), em_ior_("file://em.ior") //default + , mode_(0x0) +{ + DANCE_TRACE ("Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl"); + if (CORBA::is_nil (this->orb_)) + { + DANCE_DEBUG ((LM_INFO, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "Creating internal ORB.\n")); + this->orb_ = CORBA::ORB_init (argc, argv); + } + this->parse_args(argc, argv); + + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_i::init - em_ior = \"%s\"\n" + , is_empty (this->em_ior_) ? "NULL" : this->em_ior_.c_str())); + + if (this->mode_ & (MODE_START_PLAN | MODE_STOP_PLAN)) + { + CORBA::Object_var obj; + if (this->em_ior_.length() > 0) + { + obj = this->orb_->string_to_object(this->em_ior_.c_str()); + if (CORBA::is_nil(obj)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "Failed to retrieve EM object from \"%s\"\n", this->em_ior_.c_str())); + throw Deployment_Failure ("Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "failed to retrieve EM object"); + } + } + try + { + this->em_ = ::DAnCE::ExecutionManagerDaemon::_narrow (obj.in()); + } + catch(CORBA::Exception&) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "Failed to retrieve EM object from \"%s\"\n", this->em_ior_.c_str())); + throw Deployment_Failure ("Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "failed to retrieve EM object"); + } + + if (CORBA::is_nil (this->em_.in())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "failed to get an execution manager.\n")); + throw Deployment_Failure ("Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "failed to get an execution manager"); + } + } + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - " + "Obtained Execution Manager ref \n")); +} + +Plan_Launcher_Base_Impl::~Plan_Launcher_Base_Impl() +{ +} + +void Plan_Launcher_Base_Impl::execute() +{ + DANCE_TRACE ("Plan_Launcher_Base_Impl::execute - "); + + if (this->mode_ & MODE_START_PLAN) + { + size_t sz = this->cdr_plan_urls_.size(); + for (size_t i= 0; i < sz; ++i) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::execute - " + "launching plan \"%s\"...\n", this->cdr_plan_urls_[i].c_str())); + ::Deployment::DeploymentPlan_var plan = this->read_cdr_plan_file(this->cdr_plan_urls_[i].c_str()); + try + { + CORBA::String_var uuid = this->launch_plan (plan.in()); + if (0 == uuid.in ()) + { + throw Deployment_Failure ("Plan_Launcher_Base_Impl::execute - " + "Error launching plan\n"); + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::execute - " + "returned plan UUID is \"%s\"\n", uuid.in ())); + } + catch (...) + { + this->teardown_plan (plan->UUID.in()); + throw; + } + } + } + else if (this->mode_ & MODE_STOP_PLAN) + { + this->stop_plan(); + } +} + +const char * +Plan_Launcher_Base_Impl::launch_plan(const ::Deployment::DeploymentPlan &plan) +{ + DANCE_TRACE ("Plan_Launcher_Base_Impl::launch_plan"); + + try + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - Starting...\n")); + if (CORBA::is_nil (this->em_.in ())) + { + DANCE_ERROR ( (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher_Base_Impl::launch_plan - ") + ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); + return 0; + } + + DANCE_DEBUG ( (LM_DEBUG, DLINFO + ACE_TEXT ("Plan_Launcher_Base_Impl::launch_plan - ") + ACE_TEXT ("about to call this->em_->preparePlan\n"))); + + ::Deployment::DomainApplicationManager_var dam; + try + { + dam = this->em_->preparePlan (plan, 0); + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "An exception was thrown during EM->preparePlan.\n")); + throw; + } + + DANCE_DEBUG ( (LM_DEBUG, DLINFO + ACE_TEXT ("Plan_Launcher_Base_Impl::launch_plan - ") + ACE_TEXT ("after to call this->em_->preparePlan\n"))); + + if (CORBA::is_nil (dam.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "CIAO_PlanLauncher:preparePlan call failed: " + "nil DomainApplicationManager reference\n")); + return 0; + } + else + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "DAM was received from preparePlan.\n")); + } + + this->write_dam_ior (dam.in()); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "Obtained DAM ref \n")); + + ::Deployment::Properties_var properties; + ACE_NEW_RETURN (properties, + Deployment::Properties, + 0); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "before startLaunch...\n")); + + ::Deployment::Connections_var conns; + Deployment::Application_var da; + try + { + da = dam->startLaunch (properties.in (), conns.out()); + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "An exception was thrown during DAM->startLaunch.\n")); + throw; + } + //Deployment::DomainApplication_var da = Deployment::DomainApplication::_narrow(obj) + if (CORBA::is_nil (da.in())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "CIAO_PlanLauncher:startLaunch call failed: " + "nil DomainApplication reference\n")); + return 0; + } + else + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "DomainApplication was received from startLaunch\n")); + } + //this is temporal workaround while cdmw checks object type in connect call + /* + DANCE_DEBUG ((LM_DEBUG, DLINFO "Press any key after deployment on other node finished\n")); + getchar(); + */ + this->create_external_connections (plan, conns.inout()); + + // Call finish Launch to complete the connections + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "before finishLaunch\n")); + try + { + da->finishLaunch (conns.in(), false); // is_ReDAC by default is <false> + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "An exception was thrown during DA->finishLaunch.\n")); + throw; + } + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "after finishLaunch\n")); + + // Call start to activate components + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "before start activating components...\n")); + + try + { + da->start (); + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::launch_plan - " + "An exception was thrown during DA->start.\n")); + throw; + } + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::launch_plan - [success]\n")); + DANCE_DEBUG ( (LM_DEBUG, DLINFO + ACE_TEXT ("[%M] Plan_Launcher_Base_Impl::launch_plan - ") + ACE_TEXT ("Application Deployed successfully\n"))); + + } + catch (const Deployment::ResourceNotAvailable& ex) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" + "Type: %s\n" + "Property: %s\n" + "Element: %s\n" + "Resource: %s\n", + ex.name.in (), + ex.resourceType.in (), + ex.propertyName.in (), + ex.elementName.in (), + ex.resourceName.in ()); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + catch (const Deployment::StartError& ex) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - EXCEPTION: StartError exception caught: %s, %s\n", + ex.name.in (), + ex.reason.in ()); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + catch (const Deployment::InvalidProperty& ex) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - EXCEPTION: InvalidProperty exception caught: %s, %s\n", + ex.name.in (), + ex.reason.in ()); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + catch (const Deployment::InvalidConnection& ex) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - EXCEPTION: InvalidConnection exception caught: %s, %s\n", + ex.name.in (), + ex.reason.in ()); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + catch (const CORBA::Exception& ex) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - CORBA EXCEPTION: %s\n", + ex._info().fast_rep()); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + catch (...) + { + char buf[1024]; + ACE_OS::sprintf (buf, "Plan_Launcher_Base_Impl::launch_plan - EXCEPTION: non-CORBA exception\n"); + DANCE_ERROR ((LM_ERROR, DLINFO "%s", buf)); + throw Deployment_Failure (buf); + } + + return CORBA::string_dup (plan.UUID.in()); +} + +bool Plan_Launcher_Base_Impl::teardown_plan(const char *uuid) +{ + DANCE_TRACE ("Plan_Launcher_Base_Impl::teardown_plan"); + + try + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::teardown_plan - looking for uuid=\"%s\"\n", uuid)); + ::Deployment::DomainApplicationManagers_var mgrs = this->em_->getManagers(); + ::Deployment::DomainApplicationManager_var dapp_mgr; + for (size_t i = 0; i < mgrs->length(); ++i) + { + ACE_CString s = (*mgrs) [i]->getPlan()->UUID.in(); + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::teardown_plan - " + "comparing with existing uuid=\"%s\"\n", s.c_str())); + if (s == uuid) + { + dapp_mgr = ::Deployment::DomainApplicationManager::_duplicate ( (*mgrs) [i].in()); + break; + } + } + + if (!::CORBA::is_nil (dapp_mgr.in())) + { + this->teardown_plan (dapp_mgr.in()); + } + else + { + throw Deployment_Failure ("Failed to find DAM by UUID"); + } + } + catch (const CORBA::Exception&) + { + // @todo the destroy_dam_by_plan could give a stoperror exception + // we should handle + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::teardown_plan - " + "Unable to find DomainApplicationManager " + "for plan with uuid: %s\n", uuid)); + return false; + } + + return true; +} + +void +Plan_Launcher_Base_Impl::teardown_plan(::Deployment::DomainApplicationManager_ptr dam) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO + "Plan_Launcher_Base_Impl::teardown_plan - destroy the application.....\n")); + ::Deployment::Applications_var apps = dam->getApplications(); + if (0 == apps->length()) + { + DANCE_DEBUG((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::teardown_plan - " + "DAM has no application.\n")); + } + for (size_t i = 0; i < apps->length(); ++i) + { + dam->destroyApplication(apps[i]); + } + this->destroy_dam(dam); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::teardown_plan - [success]\n")); +} + +void Plan_Launcher_Base_Impl::destroy_dam( + ::Deployment::DomainApplicationManager_ptr dam) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO + "Plan_Launcher_Base_Impl::destroy_dam - destroy the manager.....\n")); + this->em_->destroyManager(dam); + + DANCE_DEBUG ((LM_DEBUG, DLINFO "Plan_Launcher_Base_Impl::destroy_dam - [success]\n")); +} + +void Plan_Launcher_Base_Impl::usage(const ACE_TCHAR* program) +{ + if (0 == program) + { + DANCE_ERROR ( (LM_ERROR, ACE_TEXT ("[(%P|%t) Executor] Usage: %s <options>\n"), program)); + } + + DANCE_ERROR ( (LM_ERROR, ACE_TEXT ("Options : \n") + ACE_TEXT ("-k|--em-ior <EXECUTION_MANAGER_IOR>") + ACE_TEXT (" : Default file://em.ior\n") + ACE_TEXT ("-d|--read-cdr-plan <CDR_DEPLOYMENT_PLAN_URL>\n") + ACE_TEXT ("-w|--write-cdr-plan <CDR_DEPLOYMENT_PLAN_URL>\n") + ACE_TEXT ("-t|--plan-uuid <PLAN_UUID>\n") + // ACE_TEXT ("-a|dam-ior <DOMAIN_APPLICATION_MANAGER_IOR>\n") + // ACE_TEXT ("-n|--node-mgr : Use naming service to fetch EM\n") + ACE_TEXT ("-q|--stop-plan : Stop the plan\n") + ACE_TEXT ("-h|--help : Show this usage information\n") + ACE_TEXT ("-x|--read-plan <XML_DEPLOYMENT_PLAN_URL>"))); +} + +void Plan_Launcher_Base_Impl::parse_args(int argc, ACE_TCHAR *argv[]) +{ + DANCE_DEBUG ((LM_TRACE, DLINFO "PL options : \"")); + for (int i = 0; i < argc; ++i) + { + DANCE_DEBUG ( (LM_TRACE, " %s", argv[i])); + } + DANCE_DEBUG ( (LM_TRACE, "\"\n")); + + ACE_Get_Opt get_opt(argc, argv, + ACE_TEXT ("k:d:w:t:a:qx:h"), 0); + get_opt.long_option("em-ior", 'k', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("read-cdr-plan", 'd', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("write-cdr-plan", 'w', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("plan-uuid", 't', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("dam-ior", 'a', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("stop-plan", 'q', ACE_Get_Opt::NO_ARG); + get_opt.long_option("read-plan", 'x', ACE_Get_Opt::ARG_REQUIRED); + get_opt.long_option("help", 'h', ACE_Get_Opt::NO_ARG); + + int c; + ACE_CString s; + while ( (c = get_opt ()) != EOF) + { + switch (c) + { + case 'k': + this->em_ior_ = expand_env_vars (get_opt.opt_arg()); + break; + case 'd': + s = expand_env_vars (get_opt.opt_arg()); + // trim leading file:// + if (0 < s.length()) + { + ssize_t pos = s.find("file://"); + if (0 == pos) + { + s = s.substring(7); + } + this->cdr_plan_urls_.push_back(s); + } + break; + case 'w': + if (0 < this->cdr_dest_url_.length()) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Ambiguity: more then one --write-cdr-plan option.\n")); + throw Deployment_Failure("Ambiguity: more then one --write-cdr-plan option."); + } + this->cdr_dest_url_ = expand_env_vars (get_opt.opt_arg()); + this->mode_ |= MODE_WRITE_CDR; + // trim leading file:// + if (0 < this->cdr_dest_url_.length()) + { + ssize_t pos = this->cdr_dest_url_.find("file://"); + if (0 == pos) + { + this->cdr_dest_url_= this->cdr_dest_url_.substring(7); + } + } + break; + case 't': + this->plan_uuid_ = get_opt.opt_arg(); + break; + case 'a': + this->dam_ior_ = expand_env_vars (get_opt.opt_arg()); + DANCE_DEBUG((LM_TRACE, "[%M] Parsed DAM IOR : %s\n", this->dam_ior_.c_str())); + break; + case 'q': + this->mode_ |= MODE_STOP_PLAN; + break; + case 'x': + this->xml_plan_urls_.push_back(expand_env_vars (get_opt.opt_arg())); + break; + case 'h': + default: + usage (argv[0]); + throw Deployment_Failure ("parse_args : invalid arguments"); + } + } + if (0 == (this->mode_ & (MODE_STOP_PLAN | MODE_WRITE_CDR))) + { + this->mode_ |= MODE_START_PLAN; + } + // Post-check + this->check_mode_consistentness(); +} + +void Plan_Launcher_Base_Impl::write_dam_ior( + ::Deployment::DomainApplicationManager_ptr dam) +{ + if (is_empty (this->dam_ior_)) + return; + + CORBA::String_var ior = this->orb_->object_to_string(dam); + + FILE* ior_output_file = ACE_OS::fopen (this->dam_ior_.c_str(), "w"); + + if (ior_output_file) + { + ACE_OS::fprintf (ior_output_file, "%s", ior.in()); + ACE_OS::fclose (ior_output_file); + } + else + { + DANCE_ERROR ((LM_ERROR, DLINFO "PlanLauncher.cpp::write_dap_ior - Error in opening file %s to write DAM IOR: %m", + this->dam_ior_.c_str())); + throw Deployment_Failure (ACE_CString ("write_dap_ior - Error in opening file %s to write DAM IOR: %m") + + this->dam_ior_); + } +} + +void +Plan_Launcher_Base_Impl::stop_plan() +{ + bool stopped = false; + if (!is_empty (this->plan_uuid_)) + { + stopped = true; + DANCE_DEBUG((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "Stopping plan \"%s\"\n", this->plan_uuid_.c_str())); + + if (!this->teardown_plan(this->plan_uuid_.c_str())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "tear down assembly failed: unknown plan uuid.\n")); + } + } + + if (!is_empty (this->dam_ior_)) + { + stopped = true; + DANCE_DEBUG((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "Stopping plan by DAM IOR.\n")); + CORBA::Object_var + obj = this->orb_->string_to_object(this->dam_ior_.c_str()); + if (CORBA::is_nil (obj.in ())) + { + DANCE_ERROR ((LM_ERROR, DLINFO + "Plan_Launcher_Base_Impl::stop_plan - " + "tear down assembly failed: DAM IOR is invalid.\n")); + } + else + { + Deployment::DomainApplicationManager_var + dam = Deployment::DomainApplicationManager::_narrow (obj.in()); + this->teardown_plan(dam.in()); + } + } + + if (0 < this->cdr_plan_urls_.size()) + { + stopped = true; + size_t sz = this->cdr_plan_urls_.size(); + for (size_t i = 0; i < sz; ++i) + { + DANCE_DEBUG((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "Stopping plan by plan file : %s\n", this->cdr_plan_urls_[i].c_str())); + ::Deployment::DeploymentPlan_var plan = this->read_cdr_plan_file(this->cdr_plan_urls_[i].c_str()); + if (!this->teardown_plan(plan->UUID.in())) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "tear down assembly failed: unknown plan uuid.\n")); + } + } + } + + if (!stopped && 0 == this->xml_plan_urls_.size()) + { + DANCE_DEBUG((LM_TRACE, DLINFO "Plan_Launcher_Base_Impl::stop_plan - " + "Stopping plan all running plans.\n")); + ::Deployment::DomainApplicationManagers_var + mgrs = this->em_->getManagers(); + ::Deployment::DomainApplicationManager_var dapp_mgr; + for (size_t i = 0; i < mgrs->length(); ++i) + { + this->teardown_plan((*mgrs) [i]); + } + } +} + +void Plan_Launcher_Base_Impl::create_external_connections( + const ::Deployment::DeploymentPlan &plan, Deployment::Connections& conn) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO "create_external_connections - start\n")); + /* CORBA::Object_var obj = this->orb_->resolve_initial_references("NameService"); + CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow(obj.in()); + CosNaming::BindingList_var bl; + CosNaming::BindingIterator_var bi; + //naming->list(10L, bl.out(), bi.out()); + CosNaming::Name name(1); + name.length(3); + name[0].id = CORBA::string_dup("CDMW");//CORBA::string_dup("CcmDance1Test"); + name[1].id = CORBA::string_dup ("SERVICES"); + name[2].id = CORBA::string_dup("ASSEMBLYANDDEPLOYMENT"); + obj = naming->resolve(name); + DANCE_DEBUG((LM_DEBUG, "[%M] create_external_connections - After resolve\n")); + CosNaming::NamingContext_var CcmDance1Test = CosNaming::NamingContext::_narrow(obj.in()); + CcmDance1Test->list(10L, bl.out(), bi.out()); + bool exit = false; + while (!exit) + { + char buf[1024]; + ACE_OS::sprintf(buf, "create_external_connections - naming size is %u\n", bl->length()); + DANCE_DEBUG((LM_DEBUG, buf)); + for ( size_t i = 0; i< bl->length(); i++ ) + { + for ( size_t j = 0; j < (*bl)[i].binding_name.length(); j++ ) + { + ACE_OS::sprintf(buf, "create_external_connections - Binding name %s, binding kind %s, binding type %i\n" + , (*bl)[i].binding_name[j].id.in() + , (*bl)[i].binding_name[j].kind.in() + , (*bl)[i].binding_type); + DANCE_DEBUG((LM_DEBUG, buf)); + } + } + if(!bi->next_n(10L, bl.out())) + { + exit = true; + } + } + */ + for (unsigned int i = 0; i < plan.connection.length(); i++) + { + if (plan.connection[i].externalReference.length() > 0 + && plan.connection[i].externalReference[0].provider) + { + DANCE_DEBUG ( (LM_DEBUG, + "Plan_Launcher_i::create_external_connections - create connection %C from IOR %C\n", + plan.connection[i].name.in(), + plan.connection[i].externalReference[0].location.in())); + unsigned int indx = conn.length(); + conn.length(indx + 1); + conn[indx].name= CORBA::string_dup (plan.connection[i].name.in()); + conn[indx].endpoint.length(1L); + CORBA::Object_ptr + obj = this->orb_->string_to_object(plan.connection[i].externalReference[0].location.in()); + if (!CORBA::is_nil (obj)) + { + //Components::CCMObject_ptr ccmobj = Components::CCMObject::_narrow (obj); + conn[indx].endpoint[0] = obj; + } + else + { + DANCE_DEBUG ( (LM_DEBUG, + "Plan_Launcher_i::create_external_connections - can't create object for IOR %C\n", + plan.connection[i].externalReference[0].location.in())); + throw 0; + } + } + } +} + +Deployment::DeploymentPlan*Plan_Launcher_Base_Impl::read_cdr_plan_file( + const char *cdr_plan_uri) +{ + Deployment::DeploymentPlan* res = 0; + try + { + FILE* file = ACE_OS::fopen (cdr_plan_uri, "r"); + if (0 == file) + { + ACE_CString s = "read_cdr_plan_file : failed to open file \""; + s += cdr_plan_uri; + s += "\""; + throw Deployment_Failure (s.c_str()); + } + + size_t buf_size; + ACE_OS::fread (&buf_size, sizeof (buf_size), 1, file); + + char * buf = new char[buf_size]; + ACE_OS::fread (buf, 1, buf_size, file); + + { + TAO_InputCDR cdr (buf, buf_size); + ACE_NEW_THROW_EX (res, + Deployment::DeploymentPlan (), + CORBA::NO_MEMORY ()); + cdr >> *res; + } + delete [] buf; + ACE_OS::fclose (file); + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Failed to read CDR plan file.\n")); + throw Deployment_Failure("Failed to read CDR plan file."); + } + return res; +} + +void +Plan_Launcher_Base_Impl::write_cdr_plan_file(const char * filename, + const Deployment::DeploymentPlan & plan) +{ + try + { + TAO_OutputCDR cdr; + cdr << plan; + size_t buf_size = cdr.total_length(); + FILE * file = ACE_OS::fopen (filename, "w"); + if (0 == file) + { + throw Deployment_Failure ("write_cdr_plan_file : failed to open file."); + } + ACE_OS::fwrite (&buf_size, sizeof (buf_size), 1, file); + for (const ACE_Message_Block *i = cdr.begin (); + i != 0; + i = i->cont ()) + { + ACE_OS::fwrite (i->rd_ptr (), 1, i->length (), file); + } + ACE_OS::fclose (file); + } + catch(...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::write_cdr_plan_file - " + "Failed to write CDR plan file.\n")); + throw Deployment_Failure("Failed to write CDR plan file."); + } +} + +void +Plan_Launcher_Base_Impl::check_mode_consistentness() +{ + if (this->mode_ & MODE_START_PLAN) + { + if (0 == this->cdr_plan_urls_.size() && 0 == this->xml_plan_urls_.size()) + { + throw Deployment_Failure ("check_mode_consistentness : no plan to start"); + } + } + else if (this->mode_ & MODE_STOP_PLAN) + { + // if (is_empty (this->cdr_plan_url_) + // && is_empty (this->xml_plan_url_) + // && is_empty (this->plan_uuid_) + // && is_empty (this->dam_ior_)) + // { + // throw Deployment_Failure ("check_mode_consistentness : no plan to stop"); + // } + } + else if (this->mode_ & MODE_WRITE_CDR) + { + if (is_empty (this->cdr_dest_url_)) + { + throw Deployment_Failure ("check_mode_consistentness : no cdr url for writing plan."); + } + if (1 != this->xml_plan_urls_.size()) + { + throw Deployment_Failure ("check_mode_consistentness : not one source url for writing plan."); + } + } + else + { + throw Deployment_Failure ("check_mode_consistentness : no action specified"); + } + } + +ACE_CString +Plan_Launcher_Base_Impl::expand_env_vars (const char * s) + { + ACE_CString src = s; + ACE_CString res; + size_t pos_done = 0; + while (pos_done < (size_t) src.length()) + { + size_t pos_start = src.find ('$', pos_done); + if (ACE_CString::npos == pos_start) + { + res += src.substring (pos_done); + pos_done = src.length(); + } + else // take the substring before '$' and append value + + { + if (pos_start > pos_done) + { + res += src.substring (pos_done, pos_start - pos_done); + pos_done = pos_start; + } + + size_t pos_end = src.length(); + + size_t p; + + p = src.find (' ', pos_start + 1); + if (ACE_CString::npos != p && pos_end > p) pos_end = p; + + p = src.find ('/', pos_start + 1); + if (ACE_CString::npos != p && pos_end > p) pos_end = p; + + p = src.find ('\\', pos_start + 1); + if (ACE_CString::npos != p && pos_end > p) pos_end = p; + + p = src.find ('$', pos_start + 1); + if (ACE_CString::npos != p && pos_end > p) pos_end = p; + + if (pos_end - pos_start > 1) + { + ACE_Env_Value<const char*> val (src.substring (pos_start + 1, pos_end - pos_start - 1).c_str(), 0); + res += val; + pos_done = pos_end; + } + else + { + DANCE_DEBUG ((LM_WARNING, DLINFO "Plan_Launcher_Base_Impl::expand_env_vars - " + "Envvar can not be parsed out at %i in \"%s\"", + pos_start, + src.c_str())); + } + } + } + return res; + } + +} // Plan_Launcher +} // DAnCE diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h new file mode 100644 index 00000000000..5e6f5e60cc6 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h @@ -0,0 +1,114 @@ +/** + * $Id$ + * @file Plan_Launcher_Base_Impl.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + * + * Contains the Plan_Launcher_i class, which can be used by + * applications to launch component assemblies. + */ +#ifndef PLAN_LAUNCHER_BASE_IMPL_H +#define PLAN_LAUNCHER_BASE_IMPL_H + +#include "Plan_Launcher_Base_Impl_Export.h" +#include "ciao/CIAO_common.h" +#include "DAnCE/Interfaces/ExecutionManagerDaemonC.h" +#include "DAnCE/Deployment/Deployment_ConnectionC.h" +#include "ace/Map_Manager.h" +#include "DAnCE/Deployment/Deployment_DeploymentPlanC.h" +#include "ace/Vector_T.h" + +namespace DAnCE +{ +namespace Plan_Launcher +{ + +/** + * @class Plan_Launcher_Impl + * @brief This class launches and manages deployment plans. + */ +class Plan_Launcher_Base_Impl_Export Plan_Launcher_Base_Impl +{ +public: + class Deployment_Failure + { +public: + Deployment_Failure(const ACE_CString &error) : + error_(error) + { + } + ; + ACE_CString error_; + }; + + Plan_Launcher_Base_Impl(CORBA::ORB_ptr orb, int argc, ACE_TCHAR *argv[]); + + virtual ~Plan_Launcher_Base_Impl(); + + void execute(); + + static Deployment::DeploymentPlan* read_cdr_plan_file( + const char *deployment_plan_uri); + static void write_cdr_plan_file(const char * filename, + const Deployment::DeploymentPlan & plan); + +protected: + + /** + * @brief Launch a plan, given an IDL deployment plan + * @param plan A valid IDL deployment plan + * @returns a string containing the UUID of the plan. Null indicates failure. + */ + virtual const char * launch_plan(const ::Deployment::DeploymentPlan &plan); + + /// Returns the DAM associated with a given plan URI + ::Deployment::DomainApplicationManager_ptr get_dam(const char *uuid); + + /// Tears down a plan given the UUID + bool teardown_plan(const char *uuid); + + void teardown_plan(::Deployment::DomainApplicationManager_ptr dam); + + void destroy_dam(::Deployment::DomainApplicationManager_ptr dam); + + virtual void stop_plan(); + void usage(const ACE_TCHAR* program = 0); + void parse_args(int argc, ACE_TCHAR *argv[]); + + static bool is_empty(const ACE_CString & s) + { + return 0 == s.length(); + } + ; + void write_dam_ior(::Deployment::DomainApplicationManager_ptr dam); + + void create_external_connections(const ::Deployment::DeploymentPlan &plan, + Deployment::Connections& conn); + + virtual void check_mode_consistentness(); + static ACE_CString expand_env_vars(const char * src); + + /// Cached ORB pointer + CORBA::ORB_var orb_; + /// Object reference of the ExecutionManager + ::DAnCE::ExecutionManagerDaemon_var em_; + + ACE_Vector<ACE_CString> cdr_plan_urls_; + ACE_CString plan_uuid_; + ACE_CString em_ior_; + ACE_CString dam_ior_; + ACE_Vector<ACE_CString> xml_plan_urls_; + ACE_CString cdr_dest_url_; + + unsigned long mode_; + static const unsigned long MODE_START_PLAN = 0x0001; + static const unsigned long MODE_STOP_PLAN = 0x0002; + static const unsigned long MODE_USE_NAMING = 0x0004; + static const unsigned long MODE_WRITE_CDR = 0x0008; + +}; // class Plan_Launcher_Impl + +} // Plan_Launcher +} // DAnCE + + +#endif /* PLAN_LAUNCHER_BASE_IMPL_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_Export.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_Export.h new file mode 100644 index 00000000000..5dcb51be117 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Plan_Launcher_Base_Impl +// ------------------------------ +#ifndef PLAN_LAUNCHER_BASE_IMPL_EXPORT_H +#define PLAN_LAUNCHER_BASE_IMPL_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (PLAN_LAUNCHER_BASE_IMPL_HAS_DLL) +# define PLAN_LAUNCHER_BASE_IMPL_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && PLAN_LAUNCHER_BASE_IMPL_HAS_DLL */ + +#if !defined (PLAN_LAUNCHER_BASE_IMPL_HAS_DLL) +# define PLAN_LAUNCHER_BASE_IMPL_HAS_DLL 1 +#endif /* ! PLAN_LAUNCHER_BASE_IMPL_HAS_DLL */ + +#if defined (PLAN_LAUNCHER_BASE_IMPL_HAS_DLL) && (PLAN_LAUNCHER_BASE_IMPL_HAS_DLL == 1) +# if defined (PLAN_LAUNCHER_BASE_IMPL_BUILD_DLL) +# define Plan_Launcher_Base_Impl_Export ACE_Proper_Export_Flag +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* PLAN_LAUNCHER_BASE_IMPL_BUILD_DLL */ +# define Plan_Launcher_Base_Impl_Export ACE_Proper_Import_Flag +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* PLAN_LAUNCHER_BASE_IMPL_BUILD_DLL */ +#else /* PLAN_LAUNCHER_BASE_IMPL_HAS_DLL == 1 */ +# define Plan_Launcher_Base_Impl_Export +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARATION(T) +# define PLAN_LAUNCHER_BASE_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* PLAN_LAUNCHER_BASE_IMPL_HAS_DLL == 1 */ + +// Set PLAN_LAUNCHER_BASE_IMPL_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (PLAN_LAUNCHER_BASE_IMPL_NTRACE) +# if (ACE_NTRACE == 1) +# define PLAN_LAUNCHER_BASE_IMPL_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define PLAN_LAUNCHER_BASE_IMPL_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !PLAN_LAUNCHER_BASE_IMPL_NTRACE */ + +#if (PLAN_LAUNCHER_BASE_IMPL_NTRACE == 1) +# define PLAN_LAUNCHER_BASE_IMPL_TRACE(X) +#else /* (PLAN_LAUNCHER_BASE_IMPL_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define PLAN_LAUNCHER_BASE_IMPL_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (PLAN_LAUNCHER_BASE_IMPL_NTRACE == 1) */ + +#endif /* PLAN_LAUNCHER_BASE_IMPL_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp new file mode 100644 index 00000000000..65feab0df60 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.cpp @@ -0,0 +1,47 @@ +// -*- C++ -*- +// $Id$ + +#include "Plan_Launcher_Base_Module.h" +#include "tao/TAO_Singleton_Manager.h" +#include "tao/StringSeqC.h" +#include "ace/Get_Opt.h" +#include "Plan_Launcher_Base_Impl.h" +#include "DAnCE/Logger/Log_Macros.h" + +ACE_RCSID (DAnCE, + DAnCE_Plan_Launcher_Base_Module, + "$Id$") + +using namespace DAnCE::Plan_Launcher; + +DAnCE_Plan_Launcher_Base_Module::DAnCE_Plan_Launcher_Base_Module (void) +{ +} + +CORBA::Object_ptr +DAnCE_Plan_Launcher_Base_Module::create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv[]) +{ + try + { + Plan_Launcher_Base_Impl pl (orb, argc, argv); + pl.execute(); + } + catch (const Plan_Launcher_Base_Impl::Deployment_Failure& e) + { + DANCE_ERROR ( (LM_ERROR, "[%M] PlanLauncher error : %s.\n", e.error_.c_str())); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Plan_Launcher_Base_Module.cpp::run_main_implementation "); + } + catch (...) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Plan_Launcher_Base_Module.cpp::run_main_implementation Unknown exception.\n")); + } + return CORBA::Object::_nil (); +} + + +ACE_FACTORY_DEFINE (DAnCE_Plan_Launcher_Base_Module, DAnCE_Plan_Launcher_Base_Module) diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h new file mode 100644 index 00000000000..308ae3c3c00 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module.h @@ -0,0 +1,58 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Plan_Launcher_Base_Module.h + * + * $Id$ + * + * @Brief Uses to run PlanLauncher from starter + * + * @author Vinzenz Tornow <vt@prismtech.com> + */ +//============================================================================= + +#ifndef PLAN_LAUNCHER_MODULE_H +#define PLAN_LAUNCHER_MODULE_H + +#include /**/ "ace/pre.h" + +#include "Plan_Launcher_Base_Module_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Service_Config.h" +#include "tao/Object_Loader.h" + + +/** + * @class Plan_Launcher_Module + * + * @brief The shared object that is instantiated when the plan launcher + * module/library is dynamically loaded. + * + * This class runs the plan launcher instance + */ +class DAnCE_Plan_Launcher_Base_Module_Export DAnCE_Plan_Launcher_Base_Module + : public TAO_Object_Loader + { + public: + /// Constructor. + DAnCE_Plan_Launcher_Base_Module (void); + + /// Overload the base class method to create a new instance + /// of a DAnCE_NodeManager_Module object. + virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv []); + + private: + }; + +ACE_FACTORY_DECLARE (DAnCE_Plan_Launcher_Base_Module, DAnCE_Plan_Launcher_Base_Module) + +#include /**/ "ace/post.h" + +#endif /* PLAN_LAUNCHER_MODULE_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module_Export.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module_Export.h new file mode 100644 index 00000000000..f9e3f7a7961 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Module_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_Plan_Launcher_Base_Module +// ------------------------------ +#ifndef DANCE_PLAN_LAUNCHER_BASE_MODULE_EXPORT_H +#define DANCE_PLAN_LAUNCHER_BASE_MODULE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL */ + +#if !defined (DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL 1 +#endif /* ! DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL */ + +#if defined (DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL) && (DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL == 1) +# if defined (DANCE_PLAN_LAUNCHER_BASE_MODULE_BUILD_DLL) +# define DAnCE_Plan_Launcher_Base_Module_Export ACE_Proper_Export_Flag +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_PLAN_LAUNCHER_BASE_MODULE_BUILD_DLL */ +# define DAnCE_Plan_Launcher_Base_Module_Export ACE_Proper_Import_Flag +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_PLAN_LAUNCHER_BASE_MODULE_BUILD_DLL */ +#else /* DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL == 1 */ +# define DAnCE_Plan_Launcher_Base_Module_Export +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARATION(T) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_PLAN_LAUNCHER_BASE_MODULE_HAS_DLL == 1 */ + +// Set DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE */ + +#if (DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE == 1) +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_TRACE(X) +#else /* (DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_PLAN_LAUNCHER_BASE_MODULE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_PLAN_LAUNCHER_BASE_MODULE_NTRACE == 1) */ + +#endif /* DANCE_PLAN_LAUNCHER_BASE_MODULE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp deleted file mode 100644 index e0b4ab85023..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.cpp +++ /dev/null @@ -1,245 +0,0 @@ -// $Id$ -#include "Plan_Launcher_Benchmark_Impl.h" - -#include "ace/High_Res_Timer.h" -#include "ace/Sched_Params.h" -#include "ace/Stats.h" -#include "ace/Throughput_Stats.h" -#include "ace/Sample_History.h" -#include "DAnCE/Utils/Plan_Handler.h" - -namespace CIAO -{ - namespace Plan_Launcher - { - Plan_Launcher_Benchmark_i::~Plan_Launcher_Benchmark_i () - { - } - - const char * - Plan_Launcher_Benchmark_i::launch_plan ( - const ::Deployment::DeploymentPlan &plan) - { - try - { - ///// Start Test //////////////////////////////////////////// - ACE_Sample_History history_prepare_plan (this->niterations_); - ACE_Sample_History history_start_launch (this->niterations_); - ACE_Sample_History history_finish_launch (this->niterations_); - ACE_Sample_History history_start_system (this->niterations_); - ACE_hrtime_t test_start = ACE_OS::gethrtime (); - ACE_hrtime_t call_start, call_end; - - while (this->niterations_ > 0) - { - --this->niterations_; - - if (CORBA::is_nil (this->em_.in ())) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: ") - ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); - return 0; - } - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: " ) - ACE_TEXT ("about to call this->em_->preparePlan\n"))); - } - - //////// Measure the latency for preparePlan() //////////////// - call_start = ACE_OS::gethrtime (); - ::Deployment::DomainApplicationManager_var dam (this->em_->preparePlan (plan, 1)); - call_end = ACE_OS::gethrtime (); - history_prepare_plan.sample (call_end - call_start); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_Benchmark_i: " ) - ACE_TEXT ("after to call this->em_->preparePlan\n"))); - } - - if (CORBA::is_nil (dam.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher:preparePlan call failed: " - "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")); - } - - - - // Do not start the Application immediately since it violates - // the semantics of component activation sequence - int start = 0; - - //////// Measure the latency for startLaunch() //////////////// - call_start = ACE_OS::gethrtime (); - dam->startLaunch (properties.in (), 0); - call_end = ACE_OS::gethrtime (); - history_start_launch.sample (call_end - call_start); - - - 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")); - - - //////// Measure the latency for finishLaunch() //////////////// - call_start = ACE_OS::gethrtime (); - dam->finishLaunch (start, false); // is_ReDAC by default is <false> - call_end = ACE_OS::gethrtime (); - history_finish_launch.sample (call_end - call_start); - - 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")); - - //////// Measure the latency for start() //////////////// - call_start = ACE_OS::gethrtime (); - dam->start (); - call_end = ACE_OS::gethrtime (); - history_start_system.sample (call_end - call_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 ())); - - // In order to run the launch_plan() multiple times to collect benchmarking - // results, we have to tear down the plan and then redeploy. - if (this->niterations_ > 0) - { - dam->destroyApplication (); - this->destroy_dam_by_plan (plan.UUID.in ()); - } - } - - - ///// End Test //////////////////////////////////////////// - ACE_hrtime_t test_end = ACE_OS::gethrtime (); - - ACE_DEBUG ((LM_DEBUG, "test finished\n")); - - ACE_DEBUG ((LM_DEBUG, "High resolution timer calibration....")); - ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); - ACE_DEBUG ((LM_DEBUG, "done\n")); - - ACE_Basic_Stats stats_1; - history_prepare_plan.dump_samples ("HISTORY -- pareparePlan", gsf); - history_prepare_plan.collect_basic_stats (stats_1); - stats_1.dump_results ("TOTAL -- pareparePlan", gsf); - - ACE_Basic_Stats stats_2; - history_start_launch.dump_samples ("HISTORY -- startLaunch", gsf); - history_start_launch.collect_basic_stats (stats_2); - stats_2.dump_results ("TOTAL -- startLaunch", gsf); - - ACE_Basic_Stats stats_3; - history_finish_launch.dump_samples ("HISTORY -- finishLaunch", gsf); - history_finish_launch.collect_basic_stats (stats_3); - stats_3.dump_results ("TOTAL -- finishLaunch", gsf); - - ACE_Basic_Stats stats_4; - history_start_system.dump_samples ("HISTORY -- activateSystem", gsf); - history_start_system.collect_basic_stats (stats_4); - stats_4.dump_results ("TOTAL -- activateSystem", gsf); - - - ACE_Throughput_Stats::dump_throughput ("Total", gsf, - test_end - test_start, - stats_1.samples_count ()); - - } - catch (Deployment::ResourceNotAvailable& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" - "Type: %s\n" - "Property: %s\n" - "Element: %s\n" - "Resource: %s\n", - ex.name.in (), - ex.resourceType.in (), - ex.propertyName.in (), - ex.elementName.in (), - ex.resourceName.in ())); - throw Deployment_Failure (""); - } - catch (Deployment::StartError& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (Deployment::InvalidProperty& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (Deployment::InvalidConnection& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const CORBA::Exception& ex) - { - ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", - ex._info().fast_rep())); - throw Deployment_Failure (""); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); - throw Deployment_Failure (""); - } - - return CORBA::string_dup (plan.UUID.in ()); - } - } -} diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h deleted file mode 100644 index de36701449d..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Benchmark_Impl.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * $Id$ - * @file Plan_Launcher_Benchmark_Impl.h - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * - * A subclass of the Plan_Launcher_i class, which overrides the method - * called lauch_plan() to collect benchmarking results.. - */ -#ifndef PLAN_LAUNCHER_BENCHMARK_IMPL_H -#define PLAN_LAUNCHER_BENCHMARK_IMPL_H - -#include "Plan_Launcher_Impl.h" - -namespace CIAO -{ - namespace Plan_Launcher - { - /** - * @class Plan_Launcher_Benchmark_i - * @brief This class is a subclass of Plan_Launcher_i which is solely for - * benchmarking purpose. - */ - class Plan_Launcher_Impl_Export Plan_Launcher_Benchmark_i - : public Plan_Launcher_i - { - public: - - virtual ~Plan_Launcher_Benchmark_i (); - - /** - * @brief Launch a plan, given an IDL deployment plan - * @param plan A valid IDL deployment plan - * @returns a string containing the UUID of the plan. Null indicates failure. - */ - virtual const char * launch_plan (const ::Deployment::DeploymentPlan &plan); - - protected: - - }; - - } -} - -#endif /* PLAN_LAUNCHER_BENCHMARK_IMPL_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Exec.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Exec.cpp new file mode 100644 index 00000000000..bd832e3dd31 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Exec.cpp @@ -0,0 +1,8 @@ +// $Id$ +#include "Plan_Launcher_Module.h" + +#define DANCE_MODULE_MAIN_SKIP_ORB_RUN +#define DANCE_MODULE_MAIN_CLASS_NAME DAnCE_Plan_Launcher_Module +#include "Deployment/Module_Main.h" + + diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index 88829fdd1e0..bd1c5f49425 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -1,569 +1,120 @@ // $Id$ #include "Plan_Launcher_Impl.h" #include "orbsvcs/CosNamingC.h" -#include "Config_Handlers/XML_File_Intf.h" -#include "Config_Handlers/DnC_Dump.h" -#include "tao/RTCORBA/RTCORBA.h" -#include "tao/RTCORBA/Priority_Mapping_Manager.h" +#include "tools/Config_Handlers/XML_File_Intf.h" +#include "tools/Config_Handlers/DnC_Dump.h" +//#include "tao/RTCORBA/RTCORBA.h" +//#include "tao/RTCORBA/Priority_Mapping_Manager.h" #include "tao/ORB_Core.h" #include "ace/Sched_Params.h" +#include "ccm/CCM_ObjectC.h" -namespace CIAO -{ - namespace Plan_Launcher - { - // @todo make this a private method - static CORBA::Object_ptr - fetch_reference_naming (CORBA::ORB_ptr orb) - { - CORBA::Object_var tmp = orb->resolve_initial_references ("NameService"); - - CosNaming::NamingContext_var pns = - CosNaming::NamingContext::_narrow (tmp.in ()); - - if (CORBA::is_nil (pns.in ())) - { - return CORBA::Object::_nil (); - } - - CosNaming::Name name (1); - name.length (1); - - name[0].id = CORBA::string_dup ("ExecutionManager"); - - return pns->resolve (name); - } - - Plan_Launcher_i::Plan_Launcher_i () - : orb_ (0), em_ (), pg_ () - { - } - - Plan_Launcher_i::~Plan_Launcher_i () - { - } - - bool - Plan_Launcher_i::init (const char *em_ior, - CORBA::ORB_ptr orb, - bool use_repoman, - bool rm_use_naming, - const char *rm_name, - CORBA::Short priority, - size_t niterations) - { - this->orb_ = CORBA::ORB::_duplicate (orb); - this->niterations_ = niterations; - this->desired_priority_ = priority; - - CORBA::Object_var obj; - - // EM - if (em_ior == 0) - { - obj = fetch_reference_naming (orb); - } - else - { - obj = orb->string_to_object (em_ior); - } - - this->em_ = ::CIAO::ExecutionManagerDaemon::_narrow (obj.in ()); - - if (CORBA::is_nil (this->em_.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%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")); - } - - // Check whether the client_propagate priority model has been set - // on the ExecutionManager - if (this->is_client_propagated_model ()) - { - // Set the priority of the current thread, so it can be propagated - // to the ExecutionManager - this->set_current_priority (this->desired_priority_); - } +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "DAnCE/Logger/Log_Macros.h" - if (use_repoman) - { - return pg_.init (orb, rm_use_naming, rm_name); - } - else - { - return true; - } - } +namespace DAnCE +{ +namespace Plan_Launcher +{ +::Deployment::DeploymentPlan * +Plan_Launcher_Impl::load_xml_plan(const char *deployment_plan_uri) +{ + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Impl::load_xml_plan - " + "Parsing plan \"%s\"...\n", deployment_plan_uri)); - const char * - Plan_Launcher_i::launch_plan (const char *deployment_plan_uri, - const char *package_uri, - bool use_package_name, - bool use_repoman) + ::Deployment::DeploymentPlan * plan = 0; + try { - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, "Parsing plan...\n")); - } - CIAO::Config_Handlers::XML_File_Intf intf (deployment_plan_uri); - - ::Deployment::DeploymentPlan_var plan = intf.get_plan (); - - // Use the package name(s) or type(s) to modify the location of all the - // artifacts in DeploymentPlan. - if (use_repoman) - { - // @todo check return value - pg_.generate_plan (plan, package_uri, use_package_name); - } - - if (CIAO::debug_level () > 9) + intf.add_search_path ("CIAO_ROOT", "/docs/schema/"); + intf.add_search_path ("TAO_ROOT", "/docs/schema/"); + plan = intf.release_plan (); + if (0 == plan) { - ACE_DEBUG ((LM_DEBUG, "Parsing complete....\n")); + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Impl::load_xml_plan - " + "Failed to parse plan \"%C\".\n", deployment_plan_uri)); + throw Deployment_Failure("Failed to parse plan."); } - - return this->launch_plan (plan.in ()); } - - const char * - Plan_Launcher_i::launch_plan (const ::Deployment::DeploymentPlan &plan) + catch (...) { - try - { - if (CORBA::is_nil (this->em_.in ())) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_i: ") - ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); - return 0; - } - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("about to call this->em_->preparePlan\n"))); - } - - ::Deployment::DomainApplicationManager_var dam (this->em_->preparePlan (plan, 1)); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("after to call this->em_->preparePlan\n"))); - } - - if (CORBA::is_nil (dam.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher:preparePlan call failed: " - "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 violates - // the semantics of component activation sequence - int start = 0; - - 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 <false> - - 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 ())); - } - catch (const Deployment::ResourceNotAvailable& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" - "Type: %s\n" - "Property: %s\n" - "Element: %s\n" - "Resource: %s\n", - ex.name.in (), - ex.resourceType.in (), - ex.propertyName.in (), - ex.elementName.in (), - ex.resourceName.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::StartError& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::InvalidProperty& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::InvalidConnection& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const CORBA::Exception& ex) - { - ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", - ex._info().fast_rep())); - throw Deployment_Failure (""); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); - throw Deployment_Failure (""); - } - - return CORBA::string_dup (plan.UUID.in ()); - } - - ::Deployment::DomainApplicationManager_ptr - Plan_Launcher_i::get_dam (const char *uuid) - { - if (!this->map_.is_plan_available (uuid)) - { - // Note: we could do an exhaustive (and expensive!) search of the DAMS - // on our EM at this point, if we wanted. In most cases, though, this - // would not produce a different result. - return Deployment::DomainApplicationManager::_nil (); - } - return this->map_.fetch_dam_reference (uuid); + ACE_CString s = "failed to parse deployment plan \""; + s += deployment_plan_uri; + s += "\""; + DANCE_DEBUG ((LM_ERROR, DLINFO "Plan_Launcher_Impl::load_xml_plan - %C\n", s.c_str())); + throw Deployment_Failure (s.c_str()); } - bool - Plan_Launcher_i::teardown_plan (const char *uuid) - { - // Since people could always run another instance of the Plan_Launcher - // 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. - try - { - ::Deployment::DomainApplicationManager_var dapp_mgr = - this->em_->getManager (uuid); - - if (!::CORBA::is_nil (dapp_mgr.in ())) - { - 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); - } - } - catch (const CORBA::Exception&) - { - // @todo the destroy_dam_by_plan could give a stoperror exception - // we should handle - ACE_ERROR ((LM_ERROR, "Unable to find DomainApplicationManager " - "for plan with uuid: %s\n", uuid)); - return false; - } + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Impl::load_xml_plan - Parsing complete....\n")); + return plan; +} - return true; - } +void Plan_Launcher_Impl::execute() +{ + DANCE_TRACE ("Plan_Launcher_Impl::execute()"); - bool - Plan_Launcher_i::teardown_plan (::Deployment::DomainApplicationManager_ptr dam) + if (this->mode_ & MODE_START_PLAN) { - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the application.....\n")); - } - - dam->destroyApplication (); - - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } - - this->destroy_dam (dam); - - return true; + size_t sz = this->xml_plan_urls_.size(); + for (size_t i= 0; i < sz; ++i) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Impl::execute - " + "launching plan \"%C\"...\n", this->xml_plan_urls_[i].c_str())); + ::Deployment::DeploymentPlan_var plan = + this->load_xml_plan(this->xml_plan_urls_[i].c_str()); + try + { + CORBA::String_var uuid = this->launch_plan (plan.in()); + if (0 == uuid.in ()) + { + throw Deployment_Failure ("execute - Error launching plan\n"); + } + DANCE_DEBUG ((LM_TRACE, DLINFO "Plan_Launcher_Impl::execute - " + "returned plan UUID is \"%s\"\n", uuid.in ())); + } + catch (...) + { + this->teardown_plan (plan->UUID.in()); + throw; + } + } + this->Plan_Launcher_Base_Impl::execute(); } - void - Plan_Launcher_i::destroy_dam (::Deployment::DomainApplicationManager_ptr dam) + if (this->mode_ & MODE_STOP_PLAN) { - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the manager.....\n")); - } - - this->em_->destroyManager (dam); - - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } + this->stop_plan(); } - void - Plan_Launcher_i::destroy_dam_by_plan (const char* plan_uuid) + if (this->mode_ & MODE_WRITE_CDR) { - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the manager.....\n")); - } - - this->em_->destroyManagerByPlan (plan_uuid); - - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } + ::Deployment::DeploymentPlan_var plan = this->load_xml_plan(this->xml_plan_urls_[0].c_str()); + this->write_cdr_plan_file(this->cdr_dest_url_.c_str(), plan); } - - const char * - Plan_Launcher_i::re_launch_plan (const char *deployment_plan_uri, - const char *package_uri, - bool use_package_name, - bool use_repoman) - { - CIAO::Config_Handlers::XML_File_Intf intf (deployment_plan_uri); - - ::Deployment::DeploymentPlan_var plan = intf.get_plan (); - - // Use the package name(s) or type(s) to modify the location of all the - // artifacts in DeploymentPlan. - if (use_repoman) - { - // @todo use return value - pg_.generate_plan (plan, package_uri, use_package_name); - } - - return this->re_launch_plan (plan.in ()); - } - - const char * - Plan_Launcher_i::re_launch_plan (const ::Deployment::DeploymentPlan &plan) +} +void Plan_Launcher_Impl::stop_plan() +{ + DANCE_TRACE ("Plan_Launcher_Impl::stop_plan"); + + if (0 < this->xml_plan_urls_.size()) { - try + size_t sz = this->xml_plan_urls_.size(); + for (size_t i= 0; i < sz; ++i) { - if (CORBA::is_nil (this->em_.in ())) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_i: ") - ACE_TEXT ("re_launch_plan called witn an uninitialized EM.\n"))); - return 0; - } - - this->em_->perform_redeployment (plan); - - if (CIAO::debug_level ()) + DANCE_DEBUG((LM_TRACE, DLINFO "Plan_Launcher_Impl::stop_plan - " + "Stopping plan by plan file: %C\n", this->xml_plan_urls_[i].c_str())); + ::Deployment::DeploymentPlan_var plan = this->load_xml_plan(this->xml_plan_urls_[i].c_str()); + if (!this->teardown_plan(plan->UUID.in())) { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: new plan redeployed ...\n")); + DANCE_ERROR ((LM_ERROR, DLINFO "Plan_Launcher_Impl::stop_plan - " + "tear down assembly failed: unknown plan uuid.\n")); } - - return CORBA::string_dup (plan.UUID.in ()); } - catch (const Deployment::ResourceNotAvailable& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: ResourceNotAvaiable exception caught: %s,\n" - "Type: %s\n" - "Property: %s\n" - "Element: %s\n" - "Resource: %s\n", - ex.name.in (), - ex.resourceType.in (), - ex.propertyName.in (), - ex.elementName.in (), - ex.resourceName.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::StartError& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: StartError exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::InvalidProperty& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidProperty exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const Deployment::InvalidConnection& ex) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: InvalidConnection exception caught: %s, %s\n", - ex.name.in (), - ex.reason.in ())); - throw Deployment_Failure (""); - } - catch (const CORBA::Exception& ex) - { - ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION: %s\n", - ex._info().fast_rep())); - throw Deployment_Failure (""); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - "EXCEPTION: non-CORBA exception\n")); - throw Deployment_Failure (""); - } - - return CORBA::string_dup (plan.UUID.in ()); - } - - bool - Plan_Launcher_i::set_current_priority (CORBA::Short desired_priority) - { - CORBA::Object_var object = - this->orb_->resolve_initial_references ("RTCurrent"); - RTCORBA::Current_var current = - RTCORBA::Current::_narrow (object.in ()); - - object = this->orb_->resolve_initial_references ("PriorityMappingManager"); - RTCORBA::PriorityMappingManager_var mapping_manager = - RTCORBA::PriorityMappingManager::_narrow (object.in ()); - - RTCORBA::PriorityMapping *pm = - mapping_manager->mapping (); - - int sched_policy = - this->orb_->orb_core ()->orb_params ()->ace_sched_policy (); - - int max_priority = - ACE_Sched_Params::priority_max (sched_policy); - int min_priority = - ACE_Sched_Params::priority_min (sched_policy); - - CORBA::Short native_priority = - (max_priority + min_priority) / 2; - - if (pm->to_CORBA (native_priority, desired_priority) == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot convert native priority %d to corba priority\n", - native_priority), - false); - - current->the_priority (desired_priority); - - CORBA::Short priority = - current->the_priority (); - - if (desired_priority != priority) - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: Unable to set thread " - "priority to %d\n", desired_priority), - false); - - return true; } - - bool - Plan_Launcher_i::is_client_propagated_model () - { - CORBA::Policy_var policy = - this->em_->_get_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE); - - RTCORBA::PriorityModelPolicy_var priority_policy = - RTCORBA::PriorityModelPolicy::_narrow (policy.in ()); - - if (CORBA::is_nil (priority_policy.in ())) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("In ExecutionManager, the Priority Model Policy is not exposed. ") - ACE_TEXT ("Use non-RT mode.\n"))); - return false; - } - - RTCORBA::PriorityModel priority_model = - priority_policy->priority_model (); - - if (priority_model != RTCORBA::CLIENT_PROPAGATED) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("The Priority Model of ExecutionManager is not CLIENT_PROPAGATED! ") - ACE_TEXT ("Use non-RT mode instead.\n"))); - return false; - } - - return true; - } - } + this->Plan_Launcher_Base_Impl::stop_plan(); } + +} // Plan_Launcher +} // DAnCE diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h index 057fdfaeac2..a21a0fe65d5 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h @@ -10,108 +10,34 @@ #define PLAN_LAUNCHER_IMPL_H #include "Plan_Launcher_Impl_Export.h" -#include "ciao/CIAO_common.h" -#include "DAnCE/ExecutionManager/DAM_Map.h" -#include "DAnCE/Interfaces/ExecutionManagerDaemonC.h" -#include "DAnCE/Plan_Generator/Plan_Generator_Impl.h" +#include "Plan_Launcher_Base_Impl.h" - -namespace CIAO -{ - namespace Plan_Launcher +namespace DAnCE { - /** - * @class Plan_Launcher_i - * @brief This class launches and manages deployment plans. - */ - class Plan_Launcher_Impl_Export Plan_Launcher_i + namespace Plan_Launcher { - public: - class Deployment_Failure { - public: - Deployment_Failure (const ACE_CString &error) - : error_ (error) - { - } - - ACE_CString error_; - }; - - Plan_Launcher_i (); - virtual ~Plan_Launcher_i (); - - bool init (const char *em_ior, - CORBA::ORB_ptr orb, - bool use_repoman = false, - bool rm_use_naming = false, - const char *rm_name = 0, - CORBA::Short priority = 0, - size_t niterations = 0); - - /** - * @brief Launch a plan, given a deployment plan URI - * @param deployment_plan_uri A uri that points ot a valid deployment plan - * @returns a string containing the UUID of the plan. Null indicates failure. - */ - const char * launch_plan (const char *deployment_plan_uri, - const char *package_uri = 0, - bool use_package_name = true, - bool use_repoman = false); - - const char * re_launch_plan (const char *deployment_plan_uri, - const char *package_uri = 0, - bool use_package_name = true, - bool use_repoman = false); - - /** - * @brief Launch a plan, given an IDL deployment plan - * @param plan A valid IDL deployment plan - * @returns a string containing the UUID of the plan. Null indicates failure. - */ - virtual const char * launch_plan (const ::Deployment::DeploymentPlan &plan); - - virtual const char * re_launch_plan (const ::Deployment::DeploymentPlan &plan); - /// Returns the DAM associated with a given plan URI - ::Deployment::DomainApplicationManager_ptr get_dam (const char *uuid); - - /// Tears down a plan given the UUID - bool teardown_plan (const char *uuid); - - bool teardown_plan (::Deployment::DomainApplicationManager_ptr dam); - - void destroy_dam (::Deployment::DomainApplicationManager_ptr dam); - - void destroy_dam_by_plan (const char * plan_uuid); - - // Change the priority of this thread - bool set_current_priority (CORBA::Short priority); - - protected: - // Check that the object is configured with CLIENT_PROPAGATED - // PriorityModelPolicy. - bool is_client_propagated_model (void); - - /// Cached ORB pointer - CORBA::ORB_var orb_; - - /// Object reference of the ExecutionManager - ::CIAO::ExecutionManagerDaemon_var em_; - - /// Local map for DAMs, to save expensive UUID lookups. - Execution_Manager::DAM_Map map_; + /** + * @class Plan_Launcher_Impl + * @brief This class launches and manages deployment plans. + */ + class Plan_Launcher_Impl_Export Plan_Launcher_Impl : public Plan_Launcher_Base_Impl + { + public: + Plan_Launcher_Impl (CORBA::ORB_ptr orb, int argc, ACE_TCHAR *argv[]) + : Plan_Launcher_Base_Impl (orb, argc, argv) {}; - CIAO::Plan_Generator::Plan_Generator_i pg_; + virtual ~Plan_Launcher_Impl () {}; - /// Desired CORBA prioirty to be propagated to EM - CORBA::Short desired_priority_; + void execute(); + static ::Deployment::DeploymentPlan* load_xml_plan (const char *deployment_plan_uri); - /// Number of iterations to run benchmarking, if specified - size_t niterations_; - }; + protected: + virtual void stop_plan(); + }; // class Plan_Launcher_Impl - } -} + } // Plan_Launcher +} // DAnCE #endif /* PLAN_LAUNCHER_IMPL_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp new file mode 100644 index 00000000000..0312707a66c --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.cpp @@ -0,0 +1,55 @@ +// -*- C++ -*- +// $Id$ + +#include "Plan_Launcher_Module.h" +#include "tao/TAO_Singleton_Manager.h" +#include "tao/StringSeqC.h" +#include "Plan_Launcher_Impl.h" +#include "ace/Get_Opt.h" +#include "DAnCE/Logger/Log_Macros.h" + +ACE_RCSID (DAnCE, + DAnCE_Plan_Launcher_Module, + "$Id$") + +using namespace DAnCE::Plan_Launcher; + +DAnCE_Plan_Launcher_Module::DAnCE_Plan_Launcher_Module (void) +{ +} + +CORBA::Object_ptr +DAnCE_Plan_Launcher_Module::create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv[]) +{ + try + { + DANCE_DEBUG ((LM_TRACE, DLINFO "DAnCE_Plan_Launcher_Module::create_object - " + "Creating Plan Launcher object.")); + + Plan_Launcher_Impl pl (orb, argc, argv); + pl.execute(); + } + catch (const Plan_Launcher_Base_Impl::Deployment_Failure& e) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_Plan_Launcher_Module::create_object - " + "Eerror : %s.\n", e.error_.c_str())); + } + catch (const CORBA::Exception& ex) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_Plan_Launcher_Module::create_object - " + "Caught CORBA Exception %C", + ex._info ().c_str ())); + } + catch (...) + { + DANCE_ERROR ((LM_ERROR, DLINFO "DAnCE_Plan_Launcher_Module::create_object - " + "Unknown exception.\n")); + } + return CORBA::Object::_nil (); +} + +ACE_FACTORY_DEFINE (DAnCE_Plan_Launcher_Module, DAnCE_Plan_Launcher_Module) + + diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.h new file mode 100644 index 00000000000..cb0895694d9 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module.h @@ -0,0 +1,58 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Plan_Launcher_Module.h + * + * $Id$ + * + * @Brief Uses to run PlanLauncher from starter + * + * @author Vinzenz Tornow <vt@prismtech.com> + */ +//============================================================================= + +#ifndef PLAN_LAUNCHER_MODULE_H +#define PLAN_LAUNCHER_MODULE_H + +#include /**/ "ace/pre.h" + +#include "Plan_Launcher_Module_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Service_Config.h" +#include "tao/Object_Loader.h" + + +/** + * @class Plan_Launcher_Module + * + * @brief The shared object that is instantiated when the plan launcher + * module/library is dynamically loaded. + * + * This class runs the plan launcher instance + */ +class DAnCE_Plan_Launcher_Module_Export DAnCE_Plan_Launcher_Module + : public TAO_Object_Loader + { + public: + /// Constructor. + DAnCE_Plan_Launcher_Module (void); + + /// Overload the base class method to create a new instance + /// of a DAnCE_NodeManager_Module object. + virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, + int argc, + ACE_TCHAR *argv []); + + private: + }; + +ACE_FACTORY_DECLARE (DAnCE_Plan_Launcher_Module, DAnCE_Plan_Launcher_Module) + +#include /**/ "ace/post.h" + +#endif /* PLAN_LAUNCHER_MODULE_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module_Export.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module_Export.h new file mode 100644 index 00000000000..cdeb11e8abf --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Module_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_Plan_Launcher_Module +// ------------------------------ +#ifndef DANCE_PLAN_LAUNCHER_MODULE_EXPORT_H +#define DANCE_PLAN_LAUNCHER_MODULE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL) +# define DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL */ + +#if !defined (DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL) +# define DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL 1 +#endif /* ! DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL */ + +#if defined (DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL) && (DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL == 1) +# if defined (DANCE_PLAN_LAUNCHER_MODULE_BUILD_DLL) +# define DAnCE_Plan_Launcher_Module_Export ACE_Proper_Export_Flag +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_PLAN_LAUNCHER_MODULE_BUILD_DLL */ +# define DAnCE_Plan_Launcher_Module_Export ACE_Proper_Import_Flag +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_PLAN_LAUNCHER_MODULE_BUILD_DLL */ +#else /* DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL == 1 */ +# define DAnCE_Plan_Launcher_Module_Export +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARATION(T) +# define DANCE_PLAN_LAUNCHER_MODULE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_PLAN_LAUNCHER_MODULE_HAS_DLL == 1 */ + +// Set DANCE_PLAN_LAUNCHER_MODULE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_PLAN_LAUNCHER_MODULE_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_PLAN_LAUNCHER_MODULE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_PLAN_LAUNCHER_MODULE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_PLAN_LAUNCHER_MODULE_NTRACE */ + +#if (DANCE_PLAN_LAUNCHER_MODULE_NTRACE == 1) +# define DANCE_PLAN_LAUNCHER_MODULE_TRACE(X) +#else /* (DANCE_PLAN_LAUNCHER_MODULE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_PLAN_LAUNCHER_MODULE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_PLAN_LAUNCHER_MODULE_NTRACE == 1) */ + +#endif /* DANCE_PLAN_LAUNCHER_MODULE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/Plan_Launcher/launcher.cpp b/CIAO/DAnCE/Plan_Launcher/launcher.cpp new file mode 100644 index 00000000000..4a93cdfdd77 --- /dev/null +++ b/CIAO/DAnCE/Plan_Launcher/launcher.cpp @@ -0,0 +1,11 @@ +// $Id$ + +#include "ace/OS.h" +#include "Plan_Launcher.h" + +int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + return DAnCE::Plan_Launcher::run_main_implementation (argc, argv); +} + + diff --git a/CIAO/DAnCE/RedirectionService/CCMObjectLocator.cpp b/CIAO/DAnCE/RedirectionService/CCMObjectLocator.cpp new file mode 100644 index 00000000000..63487b08874 --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/CCMObjectLocator.cpp @@ -0,0 +1,390 @@ +// $Id$ + +#include "CCMObjectLocator.h" +#include "ace/String_Base.h" +#include "tao/IORTable/IORTable.h" +#include "DAnCE/Logger/Log_Macros.h" + +namespace DAnCE + { + + CCMObjectLocator::CCMObjectLocator (CORBA::ORB_ptr orb, PortableServer::POA_ptr parent_poa, const char * poa_name) + : orb_ (CORBA::ORB::_duplicate (orb)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::CCMObjectLocator - started\n")); + CORBA::PolicyList policies (4); + policies.length (4); + policies[0] = parent_poa->create_id_assignment_policy (PortableServer::USER_ID); + policies[1] = parent_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER); + policies[2] = parent_poa->create_servant_retention_policy (PortableServer::NON_RETAIN); + policies[3] = parent_poa->create_lifespan_policy (PortableServer::PERSISTENT); + PortableServer::POAManager_var mgr = parent_poa->the_POAManager (); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::CCMObjectLocator - before create_POA\n")); + this->myPOA_ = parent_poa->create_POA (poa_name + , mgr.in() + , policies); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::CCMObjectLocator - after create_POA\n")); + for (CORBA::ULong i = 0; i < policies.length(); ++i) + { + policies[i]->destroy(); + } + + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::CCMObjectLocator - before set_servant_manager\n")); + this->myPOA_->set_servant_manager (this); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::CCMObjectLocator - CCMObjectLocator started on POA \"%s\"\n" + , poa_name)); + } + + CCMObjectLocator::~CCMObjectLocator() + {} + + void + CCMObjectLocator::postinvoke ( + const ::PortableServer::ObjectId & /*oid*/, + ::PortableServer::POA_ptr /*adapter*/, + const char * /*operation*/, + ::PortableServer::ServantLocator::Cookie /*the_cookie*/, + ::PortableServer::Servant /*the_servant*/ + ) + { + } + + ::PortableServer::Servant + CCMObjectLocator::preinvoke ( + const ::PortableServer::ObjectId & oid, + ::PortableServer::POA_ptr , + const char * , + ::PortableServer::ServantLocator::Cookie & + ) + { + CORBA::String_var s = PortableServer::ObjectId_to_string (oid); + ACE_CString path = s.in(); + CORBA::Object_var res = this->db_.getValue (path.c_str()); + if (!CORBA::is_nil (res)) + { + throw ::PortableServer::ForwardRequest (res._retn()); + } + else + { + int level = this->db_.missingNodeLevel (path.c_str()); + if (0 > level // all levels (app(1), inst(2), port(3) exist but object is nil yet + || 1 == level) // application is not registered + { + throw CORBA::TRANSIENT(); + } + else + { + throw CORBA::OBJECT_NOT_EXIST(); + } + } + } + + void + CCMObjectLocator::start_register (const ACE_CString& plan) + { + TreeNode* tree = 0; + if (0 != this->transactions_.find (plan, tree)) + { + tree = new TreeNode(); + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] CCMObjectLocator::start_register - transaction for plan \"%s\" alreday started!\n" + , plan.c_str())); + ///TODO Deside correcet processing of this error - probably finish_register should be called + delete tree; + tree = new TreeNode(); + } + this->transactions_.rebind (plan, tree); + } + + + CORBA::Object_ptr + CCMObjectLocator::register_object (const ACE_CString & plan + , const ACE_CString & inst + , const ACE_CString & port + , CORBA::Object_ptr obj) + { + TreeNode* transaction = 0; + ACE_CString s; + s = plan + TreeNode::delimiter_ + inst; + if (0 < port.length()) + { + s += TreeNode::delimiter_ + port; + } + + if (0 == this->transactions_.find (plan, transaction)) + { + ACE_CString path = inst; + if (0 < port.length()) + { + path += TreeNode::delimiter_ + port; + } + transaction->addChild (path.c_str(), obj); + } + else + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::register_object - transaction record for \"%s\" doesn't exist.\n" + , plan.c_str())); + + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::register_object - registering \"%s\"\n" + , s.c_str())); + this->db_.addChild (s.c_str(), obj); + } + + PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId (s.c_str()); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::register_object obj id : \"%s\"\n", PortableServer::ObjectId_to_string (oid.in()))); + CORBA::Object_var o = this->myPOA_->create_reference_with_id (oid.in(), "IDL:omg.org/CORBA/Object:1.0"); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::register_object url : \"%s\"\n", this->orb_->object_to_string (o))); + + //--------------- Temporal workaround +// CORBA::Object_var table_object = +// this->orb_->resolve_initial_references ("IORTable" ); +// +// IORTable::Table_var adapter = +// IORTable::Table::_narrow (table_object.in () ); +// +// adapter->bind(s.c_str(), this->orb_->object_to_string(o)); + //--------------- + return o._retn(); + } + + CORBA::Object_ptr + CCMObjectLocator::register_object (const ACE_CString & app + , const ACE_CString & inst + , CORBA::Object_ptr obj) + { + return this->register_object (app, inst, "", obj); + } + + void + CCMObjectLocator::register_objects (const char * name, TreeNode & node) + { + this->db_.addChild (name, node); + } + + void + CCMObjectLocator::finish_register (const ACE_CString& plan) + { + TreeNode* tree = 0; + if (0 != this->transactions_.find (plan, tree)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::finish_register - can't find \"%s\" record for register\n", plan.c_str())); + return; + } + this->register_objects (plan.c_str(), *tree); + this->transactions_.unbind (plan); + delete tree; + + } + + void + CCMObjectLocator::unregister_object (const ACE_CString & app + , const ACE_CString & inst + , const ACE_CString & port) + { + ACE_CString s = app + TreeNode::delimiter_ + inst; + if (0 < inst.length()) + { + s += TreeNode::delimiter_ + inst; + if (0 < port.length()) + { + s += TreeNode::delimiter_ + port; + } + } + this->db_.removeChild (s.c_str()); + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::unregister_object - unregistering \"%s\"\n" + , s.c_str())); + } + + ACE_CString + CCMObjectLocator::TreeNode::mergePath (const char * parent, const char * child) + { + return ACE_CString (parent) + delimiter_ + child; + } + + ACE_CString + CCMObjectLocator::TreeNode::splitPath (ACE_CString & path, bool first) + { + size_t pos = first + ? path.find (CCMObjectLocator::TreeNode::delimiter_) + : path.rfind (CCMObjectLocator::TreeNode::delimiter_); + /* if ( 0 == pos ) + { + path = path.substring(1); Cuts off a leading delimiter + }*/ + ACE_CString res; + if (ACE_CString::npos == pos) + { + res = path; + path = ""; + } + else + { + res = path.substring (0, pos); + path = path.substring (pos + 1); + } + return res; + } + + CCMObjectLocator::TreeNode::TreeNode (const TreeNode & src) + : obj_ (src.obj_) + { + TNodes::const_iterator it (src.children_); + for (;!it.done(); ++it) + { + this->children_.bind ( (*it).ext_id_, new TreeNode (* (*it).int_id_)); + } + } + + CCMObjectLocator::TreeNode::~TreeNode() + { + for (TNodes::iterator it = this->children_.begin(); !it.done(); ++it) + { + TreeNode * p = (*it).int_id_; + (*it).int_id_ = 0; + delete p; + } + this->children_.unbind_all(); + } + + CORBA::Object_ptr + CCMObjectLocator::TreeNode::getValue (const char * path) const + { + const TreeNode * p = this->getChild (path); + if (0 != p) + { + return p->getValue(); + } + else + { + return CORBA::Object::_nil(); + } + } + + CCMObjectLocator::TreeNode * + CCMObjectLocator::TreeNode::getChild (const char * path) const + { + ACE_CString path_loc = path; + ACE_CString s = splitPath (path_loc); + + TreeNode * res = 0; + if (0 == this->children_.find (s, res)) + { + return 0 == path_loc.length() ? res : res->getChild (path_loc.c_str()); + } + else + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::TreeNode::getChild - Node \"%s\" not found.\n" + , s.c_str())); + return 0; + } + } + + void + CCMObjectLocator::TreeNode::addChild (const char * path, CORBA::Object_ptr obj) + { + ACE_CString path_loc = path; + ACE_CString child = splitPath (path_loc); + + TreeNode * p = 0; +// DANCE_DEBUG((LM_DEBUG, "[%M] CCMObjectLocator::TreeNode::addChild looking for %C in map with %i.\n" +// , child.c_str() +// , this->children_.current_size())); + + if (0 != this->children_.find (child, p)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::TreeNode::addChild - create new Node.\n")); + p = new TreeNode; + this->children_.bind (child, p); + } +// DANCE_DEBUG((LM_DEBUG, "[%M] CCMObjectLocator::TreeNode::addChild - Check for path.")); + if (0 == path_loc.length()) // i.e. empty + { + p->setValue (obj); + } + else + { + p->addChild (path_loc.c_str(), obj); + } + } + + void + CCMObjectLocator::TreeNode::removeChild (const char * path) + { + ACE_CString path_loc = path; + ACE_CString child = splitPath (path_loc); + + TreeNode * p = 0; + if (0 != this->children_.find (child, p)) + { + DANCE_ERROR ( (LM_ERROR, "[%M] CCMObjectLocator::TreeNode::removeChild failed. Node \"%s\" is missing.\n" + , child.c_str())); + } + if (0 == path_loc.length()) // i.e. empty + { + delete p; + } + else + { + p->removeChild (path_loc.c_str()); + } + } + + int + CCMObjectLocator::TreeNode::missingNodeLevel (const char * path) + { + ACE_CString path_loc = path; + ACE_CString child = splitPath (path_loc); + + TreeNode * p = 0; + if (0 != this->children_.find (child, p)) + { + return 1; + } + else + { + if (0 == path_loc.length()) + { + return -1; + } + else + { + int i = p->missingNodeLevel (path_loc.c_str()); + return 0 > i ? -1 : i + 1; + } + } + } + + void + CCMObjectLocator::TreeNode::addChild (const char * path, TreeNode & node) + { + ACE_CString path_loc = path; + ACE_CString child = splitPath (path_loc); + if (0 == path_loc.length()) + { + TreeNode * p = 0; + if (0 == this->children_.find (child, p)) + { + DANCE_DEBUG ( (LM_DEBUG, "[%M] CCMObjectLocator::TreeNode::register_objects - " + "node \"%s\" already exists. Replacing.\n" + , child.c_str())); + this->children_.unbind (child); + delete p; + p = 0; + } + this->children_.bind (child, new TreeNode (node)); + } + else + { + TreeNode * p = 0; + if (0 != this->children_.find (child, p)) + { + p = new TreeNode(); + } + p->addChild (path_loc.c_str(), node); + } + } + +} // DAnCE + diff --git a/CIAO/DAnCE/RedirectionService/CCMObjectLocator.h b/CIAO/DAnCE/RedirectionService/CCMObjectLocator.h new file mode 100644 index 00000000000..127d940bfa2 --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/CCMObjectLocator.h @@ -0,0 +1,107 @@ +// $Id$ + +#ifndef CCMOBJECTLOCATOR_H_ +#define CCMOBJECTLOCATOR_H_ + +#include "ace/Map_Manager.h" +#include "ace/Null_Mutex.h" +#include "ace/SStringfwd.h" +#include "ace/String_Base.h" +#include "tao/corba.h" +#include "tao/ORB.h" +#include "tao/Object.h" +#include "tao/PortableServer/PortableServer.h" +#include "tao/PortableServer/ServantLocatorC.h" + +#include "RedirectionService_Export.h" + +namespace DAnCE +{ + + class RedirectionService_Export CCMObjectLocator + : public PortableServer::ServantLocator + , public ::CORBA::LocalObject + { + public: + class TreeNode; + typedef ACE_Map_Manager<ACE_CString, TreeNode*, ACE_Null_Mutex> TNodes; + class TreeNode + { + public: + static const char delimiter_ = '/'; + TreeNode() {}; + TreeNode (const TreeNode & src); + ~TreeNode(); + CORBA::Object_ptr getValue() const + { + return CORBA::Object::_duplicate (this->obj_.in()); + }; + CORBA::Object_ptr getValue (const char * path) const; + void setValue (CORBA::Object_ptr obj) + { + this->obj_ = CORBA::Object::_duplicate (obj); + }; + void addChild (const char * path, CORBA::Object_ptr obj = CORBA::Object::_nil()); + void addChild (const char * path, TreeNode & node); + void removeChild (const char * path); + int missingNodeLevel (const char * path); + static ACE_CString mergePath (const char * parent, const char * child); + private: + CORBA::Object_var obj_; + TNodes children_; + TreeNode * getChild (const char * path) const; + static ACE_CString splitPath (ACE_CString & path, bool first = true); + }; + + CCMObjectLocator (CORBA::ORB_ptr orb, PortableServer::POA_ptr parent_poa, const char * poa_name); + + + ~CCMObjectLocator(); + + virtual ::PortableServer::Servant preinvoke ( + const ::PortableServer::ObjectId & oid, + ::PortableServer::POA_ptr adapter, + const char * operation, + ::PortableServer::ServantLocator::Cookie & the_cookie + ); + + virtual void postinvoke ( + const ::PortableServer::ObjectId & /*oid*/, + ::PortableServer::POA_ptr /*adapter*/, + const char * /*operation*/, + ::PortableServer::ServantLocator::Cookie /*the_cookie*/, + ::PortableServer::Servant /*the_servant*/ + ); + + void start_register (const ACE_CString& plan); + + CORBA::Object_ptr register_object (const ACE_CString & plan + , const ACE_CString & inst + , const ACE_CString & port + , CORBA::Object_ptr obj); + + CORBA::Object_ptr register_object (const ACE_CString & plan + , const ACE_CString & inst + , CORBA::Object_ptr obj); + + void unregister_object (const ACE_CString & plan + , const ACE_CString & inst + , const ACE_CString & port); + + void finish_register (const ACE_CString& plan); + + void register_objects (const char * name, TreeNode & node); + + private: + TreeNode db_; + CORBA::ORB_var orb_; + PortableServer::POA_var myPOA_; + + TNodes transactions_; + CCMObjectLocator() {}; + // to ban the usage + }; // CCMObjectLocator + +} //DAnCE + +#endif /*CCMOBJECTLOCATOR_H_*/ diff --git a/CIAO/DAnCE/RedirectionService/NameServiceRedirection.cpp b/CIAO/DAnCE/RedirectionService/NameServiceRedirection.cpp new file mode 100644 index 00000000000..c5c5c0c86b2 --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/NameServiceRedirection.cpp @@ -0,0 +1,271 @@ +// $Id$ + +#include "NameServiceRedirection.h" +#include "DAnCE/Logger/Log_Macros.h" + +using namespace DAnCE; + +NameServiceRedirection::NameServiceRedirection (CosNaming::NamingContext_ptr naming, + CosNaming::NamingContext_ptr domain) + : naming_ (CosNaming::NamingContext::_duplicate (naming)), + domain_ (CosNaming::NamingContext::_duplicate (domain)) +{ +} + +NameServiceRedirection::~NameServiceRedirection() +{ +} + +void +NameServiceRedirection::start_binding (const ACE_CString& node, const ACE_CString& plan) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::start_binding for node %s plan %s.\n", + node.c_str(), + plan.c_str())); + ACE_CString key = node + plan; + TRecords* records = 0; + if (0 != this->transactions_.find (key, records)) + { + records = new TRecords(); + this->transactions_.rebind (key, records); + } + else + { + records->clear(); + } +} + +void +NameServiceRedirection::bind (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, const ACE_CString& port, CORBA::Object_ptr obj) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::bind for node %s plan %s component %s and port %s is started.\n", + node.c_str(), + plan.c_str(), + component.c_str(), + port.c_str())); + SRecord record; + record.name.length (4); + + ACE_CString kind = ""; + CosNaming::NamingContext_var node_context = this->resolve_context (node, kind, this->naming_.in()); + record.name[0].id = CORBA::string_dup (node.c_str()); + record.name[0].kind = CORBA::string_dup (kind.c_str()); + + kind = "DeploymentPlan"; + CosNaming::NamingContext_var plan_context = this->resolve_context (plan, kind, node_context.in()); + record.name[1].id = CORBA::string_dup (plan.c_str()); + record.name[1].kind = CORBA::string_dup (kind.c_str()); + + kind = ""; + CosNaming::NamingContext_var component_context = this->resolve_context (component, kind, plan_context.in()); + record.name[2].id = CORBA::string_dup (component.c_str()); + record.name[2].kind = CORBA::string_dup (kind.c_str()); + + record.name[3].id = CORBA::string_dup (port.c_str()); + record.name[3].kind = CORBA::string_dup ("Port"); + + ACE_CString key = node + plan; + TRecords* records = 0; + if (0 != this->transactions_.find (key, records)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NameServiceRedirection::bind - Cann't find record %C for closing transaction.\n", key.c_str())); + return; + } + + record.obj = CORBA::Object::_duplicate (obj); + records->push_back (record); + + // try{ + // component_context->bind(name, obj); + // } + // catch(CosNaming::NamingContext::AlreadyBound&) + // { + // component_context->rebind(name, obj); + // } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::bind has finished.\n")); +} + +void +NameServiceRedirection::bind (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, CORBA::Object_ptr obj) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::bind for node %s plan %s and component %s is started.\n", + node.c_str(), + plan.c_str(), + component.c_str())); + SRecord record; + record.name.length (3); + + ACE_CString kind = ""; + CosNaming::NamingContext_var node_context = this->resolve_context (node, kind, this->naming_.in()); + + record.name[0].id = CORBA::string_dup (node.c_str()); + record.name[0].kind = CORBA::string_dup (kind.c_str()); + + kind = "DeploymentPlan"; + CosNaming::NamingContext_var plan_context = this->resolve_context (plan, kind, node_context.in()); + + record.name[1].id = CORBA::string_dup (plan.c_str()); + record.name[1].kind = CORBA::string_dup (kind.c_str()); + + ACE_CString key = node + plan; + TRecords* records = 0; + if (0 != this->transactions_.find (key, records)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NameServiceRedirection::bind - Cann't find record %s for closing transaction.\n", key.c_str())); + return; + } + + record.name[2].id = CORBA::string_dup (component.c_str()); + record.name[2].kind = CORBA::string_dup ("Component"); + + record.obj = CORBA::Object::_duplicate (obj); + + records->push_back (record); + // try{ + // plan_context->bind(name, obj); + // } + // catch(CosNaming::NamingContext::AlreadyBound&) + // { + // DANCE_DEBUG((LM_DEBUG, "[%M] NameServiceRedirection::bind - Already bound exception was thrown. Rebinding\n")); + // plan_context->rebind(name, obj); + // } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::bind has finished.\n")); +} + +void +NameServiceRedirection::finish_binding (const ACE_CString& node, const ACE_CString& plan) +{ + ACE_CString key = node + plan; + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::finish_binding started for %s.\n", key.c_str())); + TRecords* records = 0; + if (0 != this->transactions_.find (key, records)) + { + DANCE_ERROR ((LM_ERROR, DLINFO "NameServiceRedirection::finish_binding - Cann't find record %s for closing transaction.\n", key.c_str())); + return; + } + for (unsigned int i = 0; i < records->size(); i++) + { + //this->naming_->bind((*records)[i].name, (*records)[i].obj.in()); + try + { + this->naming_->bind ( (*records) [i].name, (*records) [i].obj.in()); + } + catch (CosNaming::NamingContext::AlreadyBound&) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::finish_bind - Already bound exception was thrown. Rebinding\n")); + this->naming_->rebind ( (*records) [i].name, (*records) [i].obj.in()); + } + + } + if (!CORBA::is_nil (this->domain_.in())) + { + ACE_CString kind = ""; + CosNaming::NamingContext_var context = this->resolve_context (node, kind, this->naming_.in()); + CosNaming::Name name; + name.length (1); + name[0].id = CORBA::string_dup (node.c_str()); + name[0].kind = CORBA::string_dup (kind.c_str()); + try + { + this->domain_->bind_context (name, context.in()); + } + catch (CosNaming::NamingContext::AlreadyBound&) + { + this->domain_->rebind_context (name, context.in()); + } + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::finish_bind has finished.\n")); +} + +void +NameServiceRedirection::unbind_context (const ACE_CString& node, const ACE_CString& plan) +{ + DANCE_DEBUG ( (LM_TRACE, "[%M] NameServiceRedirection::unbind_context started...\n")); + ACE_CString kind = ""; + CosNaming::NamingContext_var node_context = this->resolve_context (node, kind, this->naming_.in()); + kind = "DeploymentPlan"; + CosNaming::NamingContext_var plan_context = this->resolve_context (plan, kind, node_context.in()); + DANCE_DEBUG ( (LM_TRACE, "[%M] NameServiceRedirection::unbind_context before clear_context for %s.%s\n", plan.c_str(), kind.c_str())); + this->clear_context (plan_context.inout()); + CosNaming::Name name (1); + name.length (1); + name[0].id = CORBA::string_dup (plan.c_str()); + name[0].kind = CORBA::string_dup (kind.c_str()); + DANCE_DEBUG ( (LM_TRACE, "[%M] NameServiceRedirection::unbind_context before unbinding %s.%s\n" + , name[0].id.in(), name[0].kind.in())); + node_context->unbind (name); + DANCE_DEBUG ( (LM_TRACE, "[%M] NameServiceRedirection::unbind_context before destroying plan context.\n")); + plan_context->destroy(); + DANCE_DEBUG ( (LM_TRACE, "[%M] NameServiceRedirection::unbind_context fininshed.\n")); +} + +CosNaming::NamingContext_ptr +NameServiceRedirection::resolve_context (const ACE_CString& context_name, const ACE_CString& context_kind, CosNaming::NamingContext_ptr naming) +{ + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::resolve_context is started for context %s.%s\n", context_name.c_str(), context_kind.c_str())); + if (CORBA::is_nil (naming)) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::resolve_context source context is nil!.\n")); + return CosNaming::NamingContext::_nil (); + } + CORBA::Object_var obj; + CosNaming::Name name (1); + name.length (1); + name[0].id = CORBA::string_dup (context_name.c_str()); + name[0].kind = CORBA::string_dup (context_kind.c_str()); + try + { + obj = naming->resolve (name); + } + catch (const CosNaming::NamingContext::NotFound&) + { + obj = naming->bind_new_context (name); + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "NameServiceRedirection::resolve_context has finished.\n")); + return CosNaming::NamingContext::_narrow (obj._retn()); +} + +void +NameServiceRedirection::clear_context (CosNaming::NamingContext_ptr& naming) +{ + CosNaming::BindingList_var bl; + CosNaming::BindingIterator_var bi; + naming->list (0, bl.out(), bi.out()); + + if (CORBA::is_nil (bi.in())) + { + return; + } + while (bi->next_n (100, bl.out())) + { + for (unsigned int i = 0; i < bl->length(); i++) + { + if (bl[i].binding_type == CosNaming::ncontext) + { + CORBA::Object_var obj = naming->resolve ( (*bl) [i].binding_name); + CosNaming::NamingContext_var sub_context = CosNaming::NamingContext::_narrow (obj); + this->clear_context (sub_context.inout()); + naming->unbind ( (*bl) [i].binding_name); + sub_context->destroy(); + } + else + { + naming->unbind ( (*bl) [i].binding_name); + } + } + } +} + +void +NameServiceRedirection::add_node (const ACE_CString& node) +{ + CosNaming::NamingContext_var new_nc = this->resolve_context (node, "", this->naming_); + if (!CORBA::is_nil (this->domain_.in())) + { + CosNaming::Name name; + name.length (1); + name[0].id = CORBA::string_dup (node.c_str()); + name[0].kind = CORBA::string_dup (""); + this->domain_->bind_context (name, new_nc.in()); + } +} diff --git a/CIAO/DAnCE/RedirectionService/NameServiceRedirection.h b/CIAO/DAnCE/RedirectionService/NameServiceRedirection.h new file mode 100644 index 00000000000..f58fa65f1cd --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/NameServiceRedirection.h @@ -0,0 +1,57 @@ +// $Id$ + +#ifndef NAMESERVICEREDIRECTION_H_ +#define NAMESERVICEREDIRECTION_H_ + +#include "ace/SString.h" +#include "ace/Vector_T.h" +#include "ace/Map_Manager.h" +#include "ace/Null_Mutex.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" + +#include "RedirectionService_Export.h" + +namespace DAnCE + { + + class RedirectionService_Export NameServiceRedirection + { + public: + NameServiceRedirection (CosNaming::NamingContext_ptr hosting_naming, + CosNaming::NamingContext_ptr domain_naming); + + ~NameServiceRedirection(); + + void start_binding (const ACE_CString& node, const ACE_CString& plan); + /// Registration for port object + void bind (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, const ACE_CString& port, CORBA::Object_ptr obj); + /// Registration for component object + void bind (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, CORBA::Object_ptr obj); + + void finish_binding (const ACE_CString& node, const ACE_CString& plan); + // Removes all records for specified plan + void unbind_context (const ACE_CString& node, const ACE_CString& plan); + + void add_node (const ACE_CString& node); + + protected: + CosNaming::NamingContext_ptr resolve_context (const ACE_CString& name, const ACE_CString& kind, CosNaming::NamingContext_ptr naming); + + void clear_context (CosNaming::NamingContext_ptr& naming); + + private: + CosNaming::NamingContext_var naming_; + CosNaming::NamingContext_var domain_; + + struct SRecord + { + CosNaming::Name name; + CORBA::Object_var obj; + }; + + typedef ACE_Vector<SRecord> TRecords; + typedef ACE_Map_Manager<ACE_CString, TRecords*, ACE_Null_Mutex> TTransactions; + TTransactions transactions_; + }; +}; +#endif /*NAMESERVICEREDIRECTION_H_*/ diff --git a/CIAO/DAnCE/RedirectionService/RedirectionService.cpp b/CIAO/DAnCE/RedirectionService/RedirectionService.cpp new file mode 100644 index 00000000000..e79673bfa4c --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/RedirectionService.cpp @@ -0,0 +1,162 @@ +// $Id$ + +#include "RedirectionService.h" +#include "DAnCE/Logger/Log_Macros.h" + +using namespace DAnCE; + +RedirectionService::RedirectionService (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + CosNaming::NamingContext_ptr hosting_naming, + CosNaming::NamingContext_ptr domain_naming, + bool ns, + bool sl) + : orb_ (CORBA::ORB::_duplicate (orb)) + , poa_ (PortableServer::POA::_duplicate (poa)) + , naming_ (hosting_naming, domain_naming) + , ns_ (ns) + , sl_ (sl) +{ + DANCE_TRACE ("RedirectionService::RedirectionService"); + if (this->ns_) + { + if (CORBA::is_nil (hosting_naming)) + { + DANCE_DEBUG ((LM_DEBUG, DLINFO "RedirectionService::RedirectionService - " + "Name Service redirection is enabled but name context is nil.\n")); + } + } +} + +RedirectionService::~RedirectionService() +{ + DANCE_TRACE ("RedirectionService::~RedirectionService"); + for (TLocators::iterator it = this->locators_.begin (); + it != this->locators_.end (); + ++it) + { + delete (*it).int_id_; + } +} + +void +RedirectionService::add_node (const ACE_CString& node) +{ + DANCE_TRACE ("RedirectionService::add_node"); + if (this->sl_) + { + CCMObjectLocator* locator = 0; + if (0 != this->locators_.find (node, locator)) + { + locator = new CCMObjectLocator (this->orb_.in(), this->poa_.in(), node.c_str()); + this->locators_.rebind (node, locator); + } + } + + if (this->ns_) + { + this->naming_.add_node (node); + } +} + +void +RedirectionService::registration_start (const ACE_CString& node, const ACE_CString& plan) +{ + DANCE_TRACE ("RedirectionService::registration_start"); + if (this->sl_) + { + CCMObjectLocator* locator = 0; + if (0 != this->locators_.find (node, locator)) + { + locator = new CCMObjectLocator (this->orb_.in(), this->poa_.in(), node.c_str()); + this->locators_.rebind (node, locator); + } + locator->start_register (plan); + } + if (this->ns_) + { + this->naming_.start_binding (node, plan); + } +} + +void +RedirectionService::registration (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, const ACE_CString& port, CORBA::Object_ptr obj) +{ + DANCE_TRACE ("RedirectionService::registration"); + DANCE_DEBUG ((LM_DEBUG, DLINFO "RedirectionService::registration - " + "for node %s plan %s component %s and port %s is started.\n", + node.c_str(), + plan.c_str(), + component.c_str(), + port.c_str())); + CORBA::Object_var ns_obj = CORBA::Object::_duplicate (obj); + if (this->sl_) + { + CCMObjectLocator* locator = 0; + if (0 != this->locators_.find (node, locator)) + { + locator = new CCMObjectLocator (this->orb_.in(), this->poa_.in(), node.c_str()); + this->locators_.rebind (node, locator); + } + ns_obj = locator->register_object (plan, component, port, obj); + } + if (this->ns_) + { + if (0 == port.length()) + { + this->naming_.bind (node, plan, component, ns_obj.in()); + } + else + { + this->naming_.bind (node, plan, component, port, ns_obj.in()); + } + } + DANCE_DEBUG ((LM_DEBUG, DLINFO "RedirectionService::registration - " + "Registration has been finished.\n")); +} + +void +RedirectionService::registration (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, CORBA::Object_ptr obj) +{ + DANCE_TRACE ("RedirectionService::registration"); + this->registration (node, plan, component, "", obj); +} + +void +RedirectionService::registration_finish (const ACE_CString& node, const ACE_CString& plan) +{ + DANCE_TRACE ("RedirectionService::registration_finish"); + if (this->sl_) + { + CCMObjectLocator* locator; + if (0 != this->locators_.find (node, locator)) + { + locator = new CCMObjectLocator (this->orb_.in(), this->poa_.in(), node.c_str()); + this->locators_.rebind (node, locator); + } + locator->finish_register (plan); + } + if (this->ns_) + { + this->naming_.finish_binding (node, plan); + } +} + +void +RedirectionService::unregister (const ACE_CString& node, const ACE_CString& plan) +{ + DANCE_TRACE ("RedirectionService::unregister"); + DANCE_DEBUG((LM_TRACE, DLINFO "RedirectionService::unregister - " + "unregistering %s/%s...\n", node.c_str(), plan.c_str())); + if (this->ns_) + { + this->naming_.unbind_context (node, plan); + DANCE_DEBUG((LM_TRACE, DLINFO "RedirectionService::unregister - " + "finished.\n")); + } + else + { + DANCE_DEBUG((LM_TRACE, DLINFO "RedirectionService::unregister - " + "nothing to do.\n")); + } +} diff --git a/CIAO/DAnCE/RedirectionService/RedirectionService.h b/CIAO/DAnCE/RedirectionService/RedirectionService.h new file mode 100644 index 00000000000..9b039f19206 --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/RedirectionService.h @@ -0,0 +1,74 @@ +#ifndef REDIRECTIONSERVICE_H_ +#define REDIRECTIONSERVICE_H_ + +#include "ace/Map_Manager.h" +#include "tao/PortableServer/PortableServer.h" +#include "orbsvcs/orbsvcs/CosNamingC.h" + +#include "RedirectionService_Export.h" + +#include "CCMObjectLocator.h" +#include "NameServiceRedirection.h" + +/* + This class encapsulates redirection mechanisms for dance offline deployment. + It contains NameService and ServantLocator classes with correspondent poas + and hides from NodeApplication all specific steps required for supporting redirection + If no NameService nor ServantLocator is not required when registration methods do nothing. +*/ +namespace DAnCE + { + class RedirectionService_Export RedirectionService + { + public: + /// Constructor for redirection service object + /// In general, redirection service should be singleton in scope of dance agent process + /// but probably it is not compulsory + /// parameter hosting_context is compulsory if ns is true + /// parameter domain_context should be specified if we need to bind local contextes to external context + /// parameter ns should be passed as true if NameService redirection mechanism should be used + /// parameter sl should be passed as true if ServantLocator redirection should be used + /// parameter poa should be root poa (? probably this parameter is unnecessary and this class can obtains from orb) + RedirectionService (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + CosNaming::NamingContext_ptr hosting_context, + CosNaming::NamingContext_ptr domain_context, + bool ns = false, + bool sl = false); + + ~RedirectionService (); + /// Creates record in redirection service for correspondent node + void add_node (const ACE_CString& node); + /// Opens transaction for registering node ccm objects. + /// Parameters node and plan are the keys + void registration_start (const ACE_CString& node, const ACE_CString& plan); + /// Registration for port object + void registration (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, const ACE_CString& port, CORBA::Object_ptr obj); + /// Registration for component object + void registration (const ACE_CString& node, const ACE_CString& plan, const ACE_CString& component, CORBA::Object_ptr obj); + /// Closes transaction for registering node ccm objects + /// and insert node to correspondent ServantLocator and/or NameService + /// Parameters node and plan are the keys + void registration_finish (const ACE_CString& node, const ACE_CString& plan); + // Removes all records for specified plan + void unregister (const ACE_CString& node, const ACE_CString& plan); + private: + /// Orb variable + CORBA::ORB_var orb_; + + /// Root POA variable + PortableServer::POA_var poa_; + + NameServiceRedirection naming_; + + bool ns_; + + bool sl_; + + /// Map of servant locators (node name is a key) + typedef ACE_Map_Manager<ACE_CString, DAnCE::CCMObjectLocator*, ACE_Null_Mutex> TLocators; + TLocators locators_; + }; +}; + +#endif /*REDIRECTIONSERVICE_H_*/ diff --git a/CIAO/DAnCE/RedirectionService/RedirectionService.mpc b/CIAO/DAnCE/RedirectionService/RedirectionService.mpc new file mode 100644 index 00000000000..08f0cd6f462 --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/RedirectionService.mpc @@ -0,0 +1,14 @@ +// -*- MPC -*- +// $Id$ + +project : taolib, tao_output, iortable, naming, dance_logger { + sharedname = DAnCE_RedirectionService + dynamicflags += REDIRECTIONSERVICE_BUILD_DLL + + Source_Files { + RedirectionService.cpp + NameServiceRedirection.cpp + CCMObjectLocator.cpp + } +} + diff --git a/CIAO/DAnCE/RedirectionService/RedirectionService_Export.h b/CIAO/DAnCE/RedirectionService/RedirectionService_Export.h new file mode 100644 index 00000000000..af8e613acfc --- /dev/null +++ b/CIAO/DAnCE/RedirectionService/RedirectionService_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RedirectionService +// ------------------------------ +#ifndef REDIRECTIONSERVICE_EXPORT_H +#define REDIRECTIONSERVICE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (REDIRECTIONSERVICE_HAS_DLL) +# define REDIRECTIONSERVICE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && REDIRECTIONSERVICE_HAS_DLL */ + +#if !defined (REDIRECTIONSERVICE_HAS_DLL) +# define REDIRECTIONSERVICE_HAS_DLL 1 +#endif /* ! REDIRECTIONSERVICE_HAS_DLL */ + +#if defined (REDIRECTIONSERVICE_HAS_DLL) && (REDIRECTIONSERVICE_HAS_DLL == 1) +# if defined (REDIRECTIONSERVICE_BUILD_DLL) +# define RedirectionService_Export ACE_Proper_Export_Flag +# define REDIRECTIONSERVICE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define REDIRECTIONSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* REDIRECTIONSERVICE_BUILD_DLL */ +# define RedirectionService_Export ACE_Proper_Import_Flag +# define REDIRECTIONSERVICE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define REDIRECTIONSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* REDIRECTIONSERVICE_BUILD_DLL */ +#else /* REDIRECTIONSERVICE_HAS_DLL == 1 */ +# define RedirectionService_Export +# define REDIRECTIONSERVICE_SINGLETON_DECLARATION(T) +# define REDIRECTIONSERVICE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* REDIRECTIONSERVICE_HAS_DLL == 1 */ + +// Set REDIRECTIONSERVICE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (REDIRECTIONSERVICE_NTRACE) +# if (ACE_NTRACE == 1) +# define REDIRECTIONSERVICE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define REDIRECTIONSERVICE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !REDIRECTIONSERVICE_NTRACE */ + +#if (REDIRECTIONSERVICE_NTRACE == 1) +# define REDIRECTIONSERVICE_TRACE(X) +#else /* (REDIRECTIONSERVICE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define REDIRECTIONSERVICE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (REDIRECTIONSERVICE_NTRACE == 1) */ + +#endif /* REDIRECTIONSERVICE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc b/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc index d14d97843cd..ed13535d7ad 100644 --- a/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc +++ b/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc @@ -4,8 +4,8 @@ //RepositoryManager project: implementation of a repository manager //compleint with the D&C spec -project (RepositoryManager) : ciao_server_dnc, ciao_config_handlers, zlib, ciaoexe { - +project (RepositoryManager) : ccm_stub { //ciao_server_dnc, ciao_config_handlers, zlib, ciaoexe { + requires += dummy_label includes += $(CIAO_ROOT)/tools/Config_Handlers $(ACE_ROOT)/contrib/minizip //to circumvent an improper include resolution //in the Package_Handlers/PC_Intf.h @@ -36,7 +36,8 @@ project (RepositoryManager) : ciao_server_dnc, ciao_config_handlers, zlib, ciaoe // RMadmin project: a sample client for the RM. -project (RMAdmin) : ciao_servant_dnc, ciao_config_handlers, ciaoexe { +project (RMAdmin) : ccm_stub { //ciao_servant_dnc, ciao_config_handlers, ciaoexe { + requires += dummy_label exename = RMadmin after += RepositoryManager diff --git a/CIAO/DAnCE/Starter/DAnCELoggerFactory.h b/CIAO/DAnCE/Starter/DAnCELoggerFactory.h new file mode 100644 index 00000000000..1efd071621d --- /dev/null +++ b/CIAO/DAnCE/Starter/DAnCELoggerFactory.h @@ -0,0 +1,18 @@ +#ifndef LOGGERFACTORY_H_ +#define LOGGERFACTORY_H_ + +#include "ace/Service_Object.h" +#include "tao/ORB.h" +#include "ace/Log_Msg_Backend.h" + +namespace DAnCE + { + + class DAnCELoggerFactory : public ACE_Service_Object + { + public: + virtual ACE_Log_Msg_Backend * get_logger_backend (CORBA::ORB_ptr orb) = 0; + }; +} // DAnCE + +#endif /*LOGGERFACTORY_H_*/ diff --git a/CIAO/DAnCE/Starter/Starter.cpp b/CIAO/DAnCE/Starter/Starter.cpp new file mode 100644 index 00000000000..4a21110f722 --- /dev/null +++ b/CIAO/DAnCE/Starter/Starter.cpp @@ -0,0 +1,925 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Starter.cpp + * + * $Id$ + * + * @Brief Dynamically runs libraries + * + * @author Vinzenz Tornow <vt@prismtech.com> + */ +//============================================================================= + +#include "Starter.h" +#include "ace/Service_Config.h" +#include "ace/Thread_Manager.h" +#include "ace/DLL.h" +#include "ace/Get_Opt.h" +#include "tao/ORB.h" +#include "tao/Object.h" +#include "tao/PortableServer/PortableServer.h" +#include "DAnCELoggerFactory.h" +#include "tao/Object_Loader.h" +#include "tao/IORTable/IORTable.h" +#include "DAnCE/Logger/Log_Macros.h" + +using namespace DAnCE; + +#ifdef DANCE_BUILD_STARTER_EXE + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + Starter starter (argc, argv); + starter.execute(); + return 0; + } + catch (ACE_CString & e) + { + DANCE_ERROR ( (LM_ERROR, "[%M] dance starter failed with an exception : \"%s\"\n", e.c_str())); + } + catch (CORBA::Exception & e) + { + DANCE_ERROR ( (LM_ERROR, "[%M] dance starter failed with an CORBA exception : \"%s\"\n", e._info().c_str())); + } + catch (...) + { + DANCE_ERROR ( (LM_ERROR, "[%M] dance starter failed with an unknown exception.\n")); + } + return -1; +} + +#endif /* DANCE_BUILD_STARTER_EXE */ + +namespace DAnCE +{ + +Starter::Starter(int argc, ACE_TCHAR * argv[]) : + orb_(CORBA::ORB_init (argc, argv, "")), + optLogLevel_(5), //default + argc_(argc), + argv_(argv), + optNS_(false), + optEM_(false), + optPLB_(false), + optPL_(false) +{ + DANCE_TRACE ("DAnCE::Starter::Starter ()"); + + Logger_Service + * dlf = ACE_Dynamic_Service<Logger_Service>::instance ("DAnCE_Logger_Backend_Factory"); + + if (!dlf) + dlf = new Logger_Service; + + this->logger_.reset (dlf); + this->logger_->init (argc, argv); + + DANCE_DEBUG ((LM_TRACE, DLINFO + "Starter::Starter - Creating starter...\n")); + + this->parseArgs(argc, argv); + + this->configure_logging_backend (); + + DANCE_DEBUG ((LM_TRACE, DLINFO + "Starter::Starter - Starter was created successfully.\n")); +} + +Starter::~Starter() +{ + DANCE_TRACE ("Starter::~Starter"); +/* TAO_Object_Loader + * loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("ExecutionManager_Loader"); + if (0 != loader) + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starter::~Starter - removing EM ...\n")); + loader = 0; + ACE_Service_Config::remove ("ExecutionManager_Loader"); + } + loader + = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("NodeManager_Loader"); + if (0 != loader) + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starter::~Starter - removing NM ...\n")); + loader = 0; + ACE_Service_Config::remove ("NodeManager_Loader"); + } + + this->orb_._retn()->destroy(); */ +} + +void Starter::parseArgs(int argc, ACE_TCHAR * argv[]) +{ + DANCE_DEBUG ( (LM_TRACE, "[%M] Parsing starter's arguments...\n")); + + ACE_Get_Opt opts(argc, argv, "p::n:e::c::r::il:hg:x:d:qk:w:t:a:", 1, 0, + ACE_Get_Opt::RETURN_IN_ORDER); + opts.long_option("process-ns", 'p', ACE_Get_Opt::ARG_OPTIONAL); + opts.long_option("process-ns-options", ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("node-mgr", 'n', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("exec-mgr", 'e', ACE_Get_Opt::ARG_OPTIONAL); + opts.long_option("create-plan-ns", 'c', ACE_Get_Opt::ARG_OPTIONAL); + opts.long_option("rebind-plan-ns", 'r', ACE_Get_Opt::ARG_OPTIONAL); + opts.long_option("port-indirection", 'i', ACE_Get_Opt::NO_ARG); + opts.long_option("log-level", 'l', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("help", 'h', ACE_Get_Opt::NO_ARG); + opts.long_option("gen-object-key", 'g', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("read-plan", 'x', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("read-cdr-plan", 'd', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("stop-plan", 'q', ACE_Get_Opt::NO_ARG); + opts.long_option("em-ior", 'k', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("write-cdr-plan", 'w', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("plan-uuid", 't', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option("dam-ior", 'a', ACE_Get_Opt::ARG_REQUIRED); + + int j; + char c; + ACE_CString s; + while ( (c = opts ()) != -1) + { + DANCE_DEBUG((LM_TRACE, "[%M] Option : \"%s\" with argument \"%s\"\n", opts.last_option(), opts.opt_arg())); + switch (c) + { + case '?': + DANCE_ERROR ( (LM_ERROR, "[%M] Wrong option \"%s\" or this option is requred attribute!\n", opts.last_option())); + this->usage(); + throw ACE_CString("Error parsing starter arguments"); + break; + case 'p': + this->optNS_ = true; + DANCE_DEBUG ( (LM_TRACE, "[%M] Naming will be started.\n")); + this->optNSFile_ = opts.opt_arg(); + break; + case 'n': + s = opts.opt_arg(); + if (0 < s.length()) + { + ACE_CString nodename; + Node node; + size_t pos = s.find("="); + if (ACE_CString::npos != pos) + { + nodename = s.substring(0, pos); + node.ior_ = s.substring(pos + 1); + /* + node.obj = this->orb_->string_to_object(objstr.c_str()); + if (CORBA::is_nil (node.obj)) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed create object for node \"%s\"\n", nodename.c_str())); + throw ACE_CString ("Invalid IOR in --node-mgr option"); + } + */ + } + else + { + nodename = s; + DANCE_DEBUG ( (LM_TRACE, "[%M] Node \"%s\" will be started.\n", nodename.c_str())); + if (opts.optind < opts.argc_&& '-' != (s = opts.argv_[opts.optind])[0]) + { + ++opts.optind; + node.iorfile_ = s; + DANCE_DEBUG ( (LM_TRACE, "[%M] and its IOR will be written to file \"%s\".\n", node.iorfile_.c_str())); + } + + } + if (0 == this->nodes_.find(nodename)) + { + DANCE_ERROR((LM_ERROR, "[%M] Duplication of NM name \"%s\"\n", nodename.c_str())); + this->usage(); + throw ACE_CString("Duplication of NM name"); + } + this->nodes_.bind(nodename, node); + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] --node-mgr option without arguments.\n")); + this->usage(); + throw ACE_CString ("--node-mgr option without arguments."); + } + break; + case 'e': + if (this->optEM_) + { + DANCE_DEBUG((LM_WARNING, "[%M] ExecutionManager option is encountered more than once. Second and following ignored.\n")); + break; + } + this->optEM_ = true; + DANCE_DEBUG ( (LM_TRACE, "[%M] ExecutionManager will be started.\n")); + this->optEMFile_ = opts.opt_arg(); + break; + case 'l': + j = ACE_OS::atoi (opts.opt_arg()); + if (j != 0) + { + this->optLogLevel_ = j; + } + else + { + DANCE_ERROR ( (LM_WARNING, "--log-level without argument. Using default.\n")); + } + break; + case 'h': + this->usage(); + break; + case 'x': + this->optPL_ = true; + DANCE_DEBUG ( (LM_TRACE, "[%M] PlanLauncher will be started.\n")); + break; + case 'd': + case 'q': + this->optPLB_ = true; + DANCE_DEBUG ( (LM_TRACE, "[%M] PlanLauncherBase will be started.\n")); + break; + case 'g': + DANCE_DEBUG ( (LM_TRACE, "[%M] Object key will be generated.\n")); + this->optGenObjKey_ = opts.opt_arg(); + if (0 == this->optGenObjKey_.length()) + { + DANCE_ERROR ( (LM_ERROR, "[%M] --gen-object-key without argument. Doing nothing.\n")); + } + break; + case 0: // long options that do not have short + s = opts.last_option(); + if (s == "process-ns-options") + { + this->optNSOptions_ = opts.opt_arg(); + if (0 == this->optNSOptions_.length()) + { + DANCE_ERROR ( (LM_ERROR, "[%M] --process-ns-options without argument\n")); + } + } + else + { + if (!isPossibleOption(s.c_str())) + { + DANCE_ERROR((LM_ERROR, "[%M] Invalid option : %s\n", s.c_str())); + } + } + break; + default: + if (!isPossibleOption(opts.last_option())) + { + DANCE_ERROR((LM_ERROR, "[%M] Invalid option : %s\n", opts.last_option())); + this->usage(); + } + break; + }//switch + }//while + + DANCE_DEBUG ( (LM_TRACE, "[%M] Parsing starter's arguments completed.\n")); +} + +void Starter::execute() +{ + DANCE_DEBUG ( (LM_TRACE, "[%M] Executing starter...\n")); + bool orb_run = false; + + // Generate object key + if (0 < this->optGenObjKey_.length()) + { + this->generateObjectKey(this->optGenObjKey_.c_str()); + } + + // Naming + if (this->optNS_) + { + this->initNaming(); + orb_run = true; + } + + // NodeManagers + for (ACE_Map_Manager<ACE_CString, Node, ACE_Null_Mutex>::iterator + it = this->nodes_.begin(); it != this->nodes_.end(); ++it) + { + if (!CORBA::is_nil ((*it).int_id_.obj) || 0 < (*it).int_id_.ior_.length()) + continue; + orb_run = true; + (*it).int_id_.obj = this->initNodeManager((*it).ext_id_.c_str()); + if (0 != (*it).int_id_.iorfile_.length()) + { + this->write_IOR((*it).int_id_.iorfile_.c_str(), this->orb_->object_to_string((*it).int_id_.obj)); + } + } + + // ExecutionManager + CORBA::Object_var em; + if (this->optEM_) + { + em = this->initExecutionManager(); + if ( !CORBA::is_nil(em) && 0 < this->optEMFile_.length()) + { + this->write_IOR(this->optEMFile_.c_str(), + this->orb_->object_to_string(em.in())); + } + orb_run = true; + } + + if (this->optPLB_ || this->optPL_) + { + this->runPlanLauncher(); + } + + if (orb_run) + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Running starter's ORB...\n")); + this->orb_->run(); + } + else + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Skipping starter's ORB->run.\n")); + } + DANCE_DEBUG ( (LM_TRACE, "[%M] Executing starter has completed.\n")); +} + +void Starter::usage() +{ + DANCE_ERROR ( (LM_EMERGENCY, "Usage : dance <options>\n" + "Options :\n" + "\t-l|--log-level <log level> - sets log level (default 5). 1 - most detailed.\n" + "\t-g|--gen-object-key \"<NODE_NAME> <PLAN_ID> <COMPONENT_ID> [<PORT_NAME>]\" - generates a corbaloc URL\n" + "\t-h|--help - shows this help\n" + "\t-p|--process-ns [IOR_FILE_NAME] - Instantiate a local name service within the DAnCE process. Export the root context to IOR_FILE if any.\n" + "\t--process-ns-options <options> - Specifies quoted string of options to be passed to name service. Depends on --process-ns option.\n" + "\t-e|--exec-mgr [IOR_FILE_NAME] - This process will have an execution manager and it's IOR will optionally be exported to IOR_FILE_NAME.\n" + "\t-n|--node-mgr name [IOR_FILE_NAME] - Create a named NodeManager in process and optionally export its IOR to IOR_FILE_NAME\n" + "\t-n|--node-mgr name=<IOR> - Place the NodeManager instance whose reference is IOR under the control of the ExecutionManager in this process (requires --exec-mgr).\n" + "In addition to the options above, the Service Configurator options are processed too.\n")); +} + +void Starter::generateObjectKey(const char * keyargs) +{ + ACE_CString args = keyargs; + ssize_t pos_start = 0; + ACE_CString node; + ACE_CString plan; + ACE_CString component; + ACE_CString port; + + // node + if (pos_start < (ssize_t) args.length()) + { + size_t pos_end = args.find(' ', pos_start); + if (ACE_CString::npos == pos_end) + { + node = args.substring(pos_start); + pos_start = args.length(); + } + else + { + node = args.substring(pos_start, pos_end - pos_start); + pos_start = pos_end + 1; + } + } + + // plan + if (pos_start < (ssize_t) args.length()) + { + size_t pos_end = args.find(' ', pos_start); + if (ACE_CString::npos == pos_end) + { + plan = args.substring(pos_start); + pos_start = args.length(); + } + else + { + plan = args.substring(pos_start, pos_end - pos_start); + pos_start = pos_end + 1; + } + } + + // component + if (pos_start < (ssize_t) args.length()) + { + size_t pos_end = args.find(' ', pos_start); + if (ACE_CString::npos == pos_end) + { + component = args.substring(pos_start); + pos_start = args.length(); + } + else + { + component = args.substring(pos_start, pos_end - pos_start); + pos_start = pos_end + 1; + } + } + + // port + if (pos_start < (ssize_t) args.length()) + { + size_t pos_end = args.find(' ', pos_start); + if (ACE_CString::npos == pos_end) + { + port = args.substring(pos_start); + pos_start = args.length(); + } + else + { + port = args.substring(pos_start, pos_end - pos_start); + pos_start = pos_end + 1; + } + } + + // check + if (0 == node.length() || 0 == plan.length() || 0 == component.length()) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Invalid object attributes received : \"s\"\n", args.c_str())); + this->usage(); + return; + } + + this->generateObjectKey(node.c_str(), plan.c_str(), component.c_str(), 0 + == port.length() ? 0 : port.c_str()); +} + +void Starter::generateObjectKey(const char * node, const char * plan, + const char * component, const char * port) +{ + DANCE_DEBUG ( (LM_TRACE, "[%M] Starter::generateObjectKey starting...\n")); + CORBA::Boolean prev_format = this->orb_->_use_omg_ior_format(); + this->orb_->_use_omg_ior_format(false); + // warning : parent POA supposed to be RootPOA + CORBA::Object_var obj = this->orb_->resolve_initial_references("RootPOA"); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in()); + + CORBA::PolicyList policies(4); + policies.length(4); + policies[0]= root_poa->create_id_assignment_policy(PortableServer::USER_ID); + policies[1] + = root_poa->create_request_processing_policy(PortableServer::USE_SERVANT_MANAGER); + policies[2] + = root_poa->create_servant_retention_policy(PortableServer::NON_RETAIN); + policies[3] = root_poa->create_lifespan_policy(PortableServer::PERSISTENT); + PortableServer::POAManager_var mgr = root_poa->the_POAManager(); + PortableServer::POA_var + myPOA = root_poa->create_POA(node, mgr.in(), policies); + for (size_t i = 0; i < policies.length(); ++i) + { + policies[i]->destroy(); + } + + const char delim = '/'; + + ACE_CString s = plan; + s += delim; + s += component; + if (0 != port) + { + s += delim; + s += port; + } + + PortableServer::ObjectId_var + oid = PortableServer::string_to_ObjectId (s.c_str()); + CORBA::Object_var o = myPOA->create_reference_with_id(oid.in(), + "IDL:omg.org/CORBA/Object:1.0"); + s = this->orb_->object_to_string(o); + size_t pos = s.find(delim); + if (ACE_CString::npos != pos) + { + s = s.substr(pos + 1); + } + else + { + DANCE_ERROR ( (LM_WARNING, "Failed to cut off the host specific part of URL.\n")); + } + DANCE_DEBUG ( (LM_TRACE, "[%M] Starter::generateObjectKey printing result : %s\n", s.c_str())); + ACE_OS::printf ("%s\n", s.c_str()); + + this->orb_->_use_omg_ior_format(prev_format); + DANCE_DEBUG ( (LM_TRACE, "[%M] Starter::generateObjectKey completed.\n")); +} + +void Starter::write_IOR(const char * ior_file_name, const char* ior) +{ + FILE* ior_output_file_ = ACE_OS::fopen (ior_file_name, "w"); + + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, "%s", ior); + ACE_OS::fclose (ior_output_file_); + DANCE_DEBUG ( (LM_DEBUG, "[%M] ior was written into file \"%s\"\n", ior_file_name)); + } + else + { + DANCE_ERROR ( (LM_ERROR, "[%M] Unable to open IOR output file %s : %m\n", + ior_file_name)); + } +} + +void Starter::initNaming() +{ + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting naming...\n")); + TAO_Object_Loader + * loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("Naming_Loader"); + if (0 == loader) + { + ACE_CString directive = + "dynamic Naming_Loader Service_Object * TAO_CosNaming_Serv:_make_TAO_Naming_Loader() \""; + directive += this->optNSOptions_ + "\""; + ACE_Service_Config::process_directive(directive.c_str()); + } + + DANCE_DEBUG ( (LM_TRACE, "[%M] Putting ior to file if necessary...\n")); + if (0 < this->optNSFile_.length()) + { + CORBA::Object_var obj = this->orb_->resolve_initial_references("NameService"); + if (CORBA::is_nil(obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to rir \"NameService\" after creation to write it to file.\n")); + } + else + { + this->write_IOR(this->optNSFile_.c_str(), this->orb_->object_to_string(obj)); + } + } + +/* CORBA::Object_var table_object = this->orb_->resolve_initial_references ("IORTable"); + IORTable::Table_var table = IORTable::Table::_narrow (table_object.in ()); + if (CORBA::is_nil (table.in())) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to register Naming in IORTable.Nil IORTable\n")); + return; + } + try + { + table->bind ("NameService", this->orb_->object_to_string (this->process_naming_)); + } + catch (...) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to register Naming in IORTable with \"NameService\". Exception is caught.\n")); + }*/ + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting naming completed.\n")); + } + +CORBA::Object_ptr +Starter::initNodeManager (const char * node) + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting NodeManager \"%s\"...\n", node)); + TAO_Object_Loader * loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("NodeManager_Loader"); + if (0 == loader) + { + ACE_Service_Config::process_directive (ACE_DYNAMIC_SERVICE_DIRECTIVE ("NodeManager_Loader", + "DAnCE_NodeManager", + "_make_DAnCE_NodeManager_Module", + "")); + loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("NodeManager_Loader"); + } + if (0 == loader) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to load node manager \"%s\".\n", node)); + throw ACE_CString ("Failed to load NodeManager."); + } + int c = 0; + char ** v = 0; + this->argCopyForNode (node, c, v); + CORBA::Object_var res = loader->create_object (this->orb_, c, v); + this->releaseArgs (c, v); + if (CORBA::is_nil(res.in())) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to create node manager \"%s\".\n", node)); + throw ACE_CString ("Failed to create NodeManager."); + } + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting NodeManager \"%s\" completed.\n", node)); + return res._retn(); + } + +CORBA::Object_ptr +Starter::initExecutionManager() + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting ExecutionManager...\n")); + ACE_Service_Config::process_directive ( + ACE_DYNAMIC_SERVICE_DIRECTIVE ("ExecutionManager_Loader" + , "DAnCE_ExecutionManager" + , "_make_DAnCE_ExecutionManager_Module" + , "")); + TAO_Object_Loader * loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("ExecutionManager_Loader"); + if (0 == loader) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to load execution manager .\n")); + throw ACE_CString ("Failed to load ExecutionManager."); + } + int c = 0; + char ** v = 0; + this->argCopyForEM (c, v); + CORBA::Object_var em = loader->create_object (this->orb_, c, v); + this->releaseArgs (c, v); + if (CORBA::is_nil(em.in())) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to create execution manager.\n")); + throw ACE_CString ("Failed to create ExecutionManager."); + } + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting ExecutionManager completed.\n")); + return em._retn(); + } + +void +Starter::runPlanLauncher() + { + if (this->optPL_) + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting PlanLauncher...\n")); + ACE_Service_Config::process_directive ( + ACE_DYNAMIC_SERVICE_DIRECTIVE ("PlanLauncher_Loader" + , "DAnCE_Plan_Launcher" + , "_make_DAnCE_Plan_Launcher_Module" + , "")); + } + else + { + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting PlanLauncherBase...\n")); + ACE_Service_Config::process_directive ( + ACE_DYNAMIC_SERVICE_DIRECTIVE ("PlanLauncher_Loader" + , "DAnCE_Plan_Launcher_Base" + , "_make_DAnCE_Plan_Launcher_Base_Module" + , "")); + } + TAO_Object_Loader * loader = ACE_Dynamic_Service<TAO_Object_Loader>::instance ("PlanLauncher_Loader"); + if (0 == loader) + { + DANCE_ERROR ( (LM_ERROR, "[%M] Failed to load plan launcher.\n")); + throw ACE_CString ("Failed to load PlanLauncher."); + } + int c = 0; + char ** v = 0; + this->argCopyForPL (c, v); + loader->create_object (this->orb_, c, v); + this->releaseArgs (c, v); + DANCE_DEBUG ( (LM_TRACE, "[%M] Starting PlanLauncher(Base) completed.\n")); + } + +void +Starter::argCopyForNaming (int & c, char **& v) + { + int total_sz = 2; + for (size_t pos = this->optNSOptions_.find (' '); + ACE_CString::npos != pos; + pos = this->optNSOptions_.find (' ', pos + 1)) + { + ++total_sz; + } + v = new char*[total_sz]; + c = 0; + //take the 0-th argument anyway + v[c++] = CORBA::string_dup (this->argv_[0]); + + for (int i = 1; i < total_sz; ++i) v[i] = 0; + + ssize_t p0 = 0; + + for (ssize_t p1 = this->optNSOptions_.find (' '); + (size_t) p0 < this->optNSOptions_.length(); + p1 = this->optNSOptions_.find (' ', p0)) + { + if (p1 == p0) + { + p0 = p1 + 1; + continue; + } + v[c++] = CORBA::string_dup (this->optNSOptions_.substring (p0, p1 - p0).c_str()); + p0 = p1 + 1; + } + } + +void +Starter::argCopyForNode (const char * node, int & c, char **& v) + { + const char * validOptions[] = + { //"--node-mgr", "-n" + "--process-ns", "-p" + , "--create-plan-ns", "-c" + , "--rebind-plan-ns", "-r" + , "--port-indirection", "-i" + , 0 + }; + + int total_sz = this->argc_ + 1; + v = new char*[total_sz]; + for (int i = 0; i < total_sz; ++i) v[i] = 0; + + c = 0; + v[c++] = CORBA::string_dup ("-n"); + v[c++] = CORBA::string_dup (node); + Node n; + if (0 == this->nodes_.find(node, n) && 0 < n.iorfile_.length()) + { + v[c++] = CORBA::string_dup (n.iorfile_.c_str()); + } + + bool take = false; + for (int i = 0; i < this->argc_; ++i) + { + if ('-' == this->argv_[i][0]) + { + take = false; + for (int j = 0; 0 != validOptions[j]; ++j) + { + if (this->argv_[i] == ACE_OS::strstr (this->argv_[i], validOptions[j])) + { + if (i + 1 < this->argc_ + && (0 == ACE_OS::strcmp (this->argv_[i], "--node-mgr") || 0 == ACE_OS::strcmp (this->argv_[i], "-n"))) + { + ACE_CString s = this->argv_[i+1]; + if (ACE_CString::npos != s.find ('=')) + { + break; + } + else if (s == node) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + take = true; + break; + } + } + else + { + v[c++] = CORBA::string_dup (this->argv_[i]); + take = true; + break; + } + } + } + } + else if (take) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + } + } + v[c] = 0; + } + +void +Starter::argCopyForEM (int & c, char **& v) + { + const char * validOptions[] = + { + //"--node-mgr", "-n" + "--exec-mgr", "-e" + , "--process-ns", "-p" + , "--create-plan-ns", "-c" + , "--rebind-plan-ns", "-r" + , "--port-indirection", "-i" + , 0 + }; + + int total_sz = this->argc_ + 2 * this->nodes_.total_size() + 1; + v = new char*[total_sz]; + for (int i = 0; i < total_sz; ++i) v[i] = 0; + + bool take = false; + c = 0; + for (int i = 0; i < this->argc_; ++i) + { + if ('-' == this->argv_[i][0]) + { + take = false; + for (int j = 0; 0 != validOptions[j]; ++j) + { + if (this->argv_[i] == ACE_OS::strstr (this->argv_[i], validOptions[j])) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + take = true; + break; + } + } + } + else if (take) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + } + } + + for (ACE_Map_Manager<ACE_CString, Node, ACE_Null_Mutex>::iterator it = this->nodes_.begin(); + it != this->nodes_.end(); + ++it) + { + //v[c++] = CORBA::string_dup("--node-mgr"); + v[c++] = CORBA::string_dup ("-n"); + ACE_CString s = (*it).ext_id_; + s += "="; + if ( 0 < (*it).int_id_.ior_.length() ) + { + s += (*it).int_id_.ior_; + } + else if (!CORBA::is_nil((*it).int_id_.obj.in())) + { + s += this->orb_->object_to_string ( (*it).int_id_.obj.in()); + } + else + { + DANCE_ERROR((LM_ERROR, "[%M] No IOR for node \"%s\"\n", (*it).ext_id_.c_str())); + continue; + } + v[c++] = CORBA::string_dup (s.c_str()); + } + + v[c] = 0; + } + +void +Starter::argCopyForPL (int & c, char **& v) + { + const char * validOptions[] = + { "--em-ior", "-k" + , "--read-plan", "-x" + , "--read-cdr-plan", "-d" + , "--write-cdr-plan", "-w" + , "--plan-uuid", "-t" + , "--dam-ior", "-a" + , "--stop-plan", "-q" + , 0 + }; + + int total_sz = this->argc_ + 1; + v = new char*[total_sz]; + for (int i = 0; i < total_sz; ++i) v[i] = 0; + + bool take = false; + c = 0; + for (int i = 0; i < this->argc_; ++i) + { + if ('-' == this->argv_[i][0]) + { + take = false; + for (int j = 0; 0 != validOptions[j]; ++j) + { + if (this->argv_[i] == ACE_OS::strstr (this->argv_[i], validOptions[j])) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + take = true; + break; + } + } + } + else if (take) + { + v[c++] = CORBA::string_dup (this->argv_[i]); + } + } + v[c] = 0; + } + +void +Starter::releaseArgs (int c, char ** v) + { + for (int i = 0; i < c && 0 != v[i]; ++i) + { + CORBA::string_free (v[i]); + v[i] = 0; + } + delete [] v; + } + +bool +Starter::isPossibleOption(const char* opt) +{ + const char * validOptions[] = + { "node-mgr", "n" + , "exec-mgr", "e" + , "process-ns", "p" + , "create-plan-ns", "c" + , "rebind-plan-ns", "r" + , "port-indirection", "i" + , "gen-object-key", "g" + , "log-level", "l" + , "em-ior", "k" + , "read-plan", "x" + , "read-cdr-plan", "d" + , "write-cdr-plan", "w" + , "plan-uuid", "t" + , "dam-ior", "a" + , "stop-plan", "q" + , 0 + }; + + ACE_CString option = opt; + for (int i = 0; 0 != validOptions[i]; ++i) + { + if ( option == validOptions[i]) return true; + } + return false; +} + +void +Starter::configure_logging_backend (void) +{ + Logger_Service + *clf = ACE_Dynamic_Service<Logger_Service>::instance ("DAnCE_Logger_Backend_Factory"); + if (clf) + { + DANCE_DEBUG ((LM_TRACE, DLINFO "Starter::configure_logging_backend - " + "Replacing logger backend\n")); + ACE_Log_Msg_Backend * backend = clf->get_logger_backend(this->orb_); + backend->open(0); + ACE_Log_Msg::msg_backend (backend); + ACE_Log_Msg * ace = ACE_Log_Msg::instance(); + ace->clr_flags(ace->flags()); + ace->set_flags(ACE_Log_Msg::CUSTOM); + } +} + +} // DAnCE + diff --git a/CIAO/DAnCE/Starter/Starter.h b/CIAO/DAnCE/Starter/Starter.h new file mode 100644 index 00000000000..2bf08442651 --- /dev/null +++ b/CIAO/DAnCE/Starter/Starter.h @@ -0,0 +1,72 @@ +#ifndef STARTER_H_ +#define STARTER_H_ + +#include "ace/String_Base.h" +#include "tao/ORB.h" +#include "tao/Object.h" +#include "ace/Map_Manager.h" +#include "ace/Null_Mutex.h" + +#include "DAnCE/Logger/Logger_Service.h" + +namespace DAnCE + { + + class Starter + { + public: + Starter (int argc, ACE_TCHAR* argv[]); + ~Starter(); + void execute(); + private: + struct Node + { + ACE_CString iorfile_; + ACE_CString ior_; + CORBA::Object_var obj; + + Node() : obj (CORBA::Object::_nil()) {}; + }; + + auto_ptr<DAnCE::Logger_Service> logger_; + + CORBA::ORB_var orb_; + int optLogLevel_; + int argc_; + ACE_TCHAR** argv_; + bool optNS_; + ACE_CString optNSFile_; + ACE_CString optNSOptions_; + ACE_Map_Manager<ACE_CString, Node, ACE_Null_Mutex> nodes_; + bool optEM_; + ACE_CString optEMFile_; + ACE_CString optGenObjKey_; + bool optPLB_; + bool optPL_; + + void parseArgs (int argc, ACE_TCHAR* argv[]); + void usage (); + void generateObjectKey (const char * keyargs); + void generateObjectKey (const char * node + , const char * plan + , const char * component + , const char * port); + void write_IOR (const char * ior_file_name, const char* ior); + + void initNaming(); + CORBA::Object_ptr initNodeManager (const char * node); + CORBA::Object_ptr initExecutionManager(); + void runPlanLauncher(); + void argCopyForNaming (int & c, char **& v); + void argCopyForNode (const char * node, int & c, char **& v); + void argCopyForEM (int & c, char **& v); + void argCopyForPL (int & c, char **& v); + void releaseArgs (int c, char ** v); + static bool isPossibleOption(const char* opt); + + void configure_logging_backend (void); + }; + +} // DAnCE + +#endif /*STARTER_H_*/ diff --git a/CIAO/DAnCE/Starter/Starter.mpc b/CIAO/DAnCE/Starter/Starter.mpc new file mode 100644 index 00000000000..d2b04efd734 --- /dev/null +++ b/CIAO/DAnCE/Starter/Starter.mpc @@ -0,0 +1,9 @@ + +project(Starter) : taoexe, dance_exe, dance_logger, messaging, naming, iortable { + exename = dance + macros += DANCE_BUILD_STARTER_EXE + Source_Files { + Starter.cpp + } +} + diff --git a/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc b/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc index 98e868eef7e..3ebe3271730 100644 --- a/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc +++ b/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser.mpc @@ -1,17 +1,17 @@ // -*- MPC -*- // $Id$ -project(StaticDAnCEParser): ciao_component_dnc \ - , taoexe \ - , ciao_config_handlers \ - , ciao_domainapplicationmanager_dnc \ - , iortable \ - , ciao_server_dnc \ - , ciao_nodeapplicationmanager \ -{ - exename = StaticDAnCEParser - - Source_Files { - StaticDAnCEParser.cpp - } -} +//project(StaticDAnCEParser): ciao_component_dnc \ +// , taoexe \ +// , ciao_config_handlers \ +// , ciao_domainapplicationmanager_dnc \ +// , iortable \ +// , ciao_server_dnc \ +// , ciao_nodeapplicationmanager \ +//{ +// exename = StaticDAnCEParser +// +// Source_Files { +// StaticDAnCEParser.cpp +// } +//} diff --git a/CIAO/DAnCE/TargetManager/TM_Client.mpc b/CIAO/DAnCE/TargetManager/TM_Client.mpc index 0a203ab1476..3bbf415126a 100644 --- a/CIAO/DAnCE/TargetManager/TM_Client.mpc +++ b/CIAO/DAnCE/TargetManager/TM_Client.mpc @@ -2,7 +2,8 @@ // Client.mpc,v 1.6 2005/02/18 09:07:06 jwillemsen Exp -project(TMClient): ciao_client_dnc,ciao_deployment_stub, ciao_config_handlers, ciao_events_dnc, ciao_targetmanager_stub { +project(TMClient): ccm_stub { //ciao_deployment_stub, ciao_config_handlers, ciao_events_dnc, ciao_targetmanager_stub { + requires += dummy_label IDL_Files { } diff --git a/CIAO/DAnCE/TargetManager/TargetManager.mpc b/CIAO/DAnCE/TargetManager/TargetManager.mpc index 1df4ff3808d..d2bcf25eae4 100644 --- a/CIAO/DAnCE/TargetManager/TargetManager.mpc +++ b/CIAO/DAnCE/TargetManager/TargetManager.mpc @@ -1,6 +1,7 @@ // $Id$ -project(CIAO_TargetManager_stub): ciao_client_dnc, ciao_deployment_stub, ciao_nodemanager_stub, ace_output { +project(CIAO_TargetManager_stub) : ccm_stub { //: ciao_client_dnc, ciao_deployment_stub, ciao_nodemanager_stub, ace_output { + requires += dummy_label sharedname = TargetManager_stub idlflags += -Wb,stub_export_macro=TARGETMANAGER_STUB_Export \ -Wb,stub_export_include=TargetManager_stub_export.h \ @@ -21,7 +22,8 @@ project(CIAO_TargetManager_stub): ciao_client_dnc, ciao_deployment_stub, ciao_no } } -project(CIAO_TargetManager_svnt) : ciao_servant_dnc, ciao_targetmanager_stub, ace_output { +project(CIAO_TargetManager_svnt) : ciao_servant { // : ciao_servant_dnc, ciao_targetmanager_stub, ace_output { + requires += dummy_label sharedname = TargetManager_svnt idlflags += -Wb,export_macro=TARGETMANAGER_SVNT_Export \ @@ -47,7 +49,8 @@ project(CIAO_TargetManager_svnt) : ciao_servant_dnc, ciao_targetmanager_stub, ac } -project(CIAO_TargetManager_exec) : ciao_component_dnc, ciao_config_handlers, ciao_domainapplicationmanager_dnc, ciao_targetmanager_svnt, ace_output { +project(CIAO_TargetManager_exec) : ciao_executor { //: ciao_component_dnc, ciao_config_handlers, ciao_domainapplicationmanager_dnc, ciao_targetmanager_svnt, ace_output { + requires += dummy_label sharedname = TargetManager_exec dynamicflags = TARGETMANAGER_EXEC_BUILD_DLL diff --git a/CIAO/DAnCE/Utils/DAnCE_Utils.mpc b/CIAO/DAnCE/Utils/DAnCE_Utils.mpc index dfe9f1e5be5..cf8d3db5c49 100644 --- a/CIAO/DAnCE/Utils/DAnCE_Utils.mpc +++ b/CIAO/DAnCE/Utils/DAnCE_Utils.mpc @@ -1,9 +1,8 @@ // -*- MPC -*- // $Id$ -project (DAnCE_Utils): ciao_deployment_svnt, naming, ace_output { +project (DAnCE_Utils): dance_lib, dance_deployment_svnt, naming { sharedname = DAnCE_Utils - dynamicflags = DANCE_UTILS_BUILD_DLL Source_Files { diff --git a/CIAO/DAnCE/Utils/Plan_Handler.cpp b/CIAO/DAnCE/Utils/Plan_Handler.cpp index 3dd0eab8845..f464bf5058f 100644 --- a/CIAO/DAnCE/Utils/Plan_Handler.cpp +++ b/CIAO/DAnCE/Utils/Plan_Handler.cpp @@ -1,20 +1,20 @@ // $Id$ #include "Plan_Handler.h" -#include "ace/OS_NS_stdlib.h" +#include "DAnCE/Logger/Log_Macros.h" -namespace CIAO +namespace DAnCE { - void + void DAnCE_Utils::add_instance ( - ::Deployment::DeploymentPlan &deployment_plan, - const char *instance_name, - const char *node_name, - const char *impl_name, + ::Deployment::DeploymentPlan &deployment_plan, + const char *instance_name, + const char *node_name, + const char *impl_name, const char *ns_name) { // Modifying the deployment plan in order to include the new instance ... - ::Deployment::InstanceDeploymentDescriptions instance = + ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan.instance; instance.length (instance.length()+1); @@ -24,10 +24,10 @@ namespace CIAO instance[instance.length()-1].source.length(0); // Looking for implementation block with name equals to type ... - ::Deployment::MonolithicDeploymentDescriptions implementation = + ::Deployment::MonolithicDeploymentDescriptions implementation = deployment_plan.implementation; - CORBA::ULong i; + CORBA::ULong i = 0; for (i = 0; i < implementation.length(); ++i) if (ACE_OS::strcmp (implementation[i].name.in(), impl_name) == 0) break; @@ -36,7 +36,7 @@ namespace CIAO instance[instance.length()-1].implementationRef = i; else throw ImplementationNotFound(); - + if (ns_name != 0) { instance[instance.length()-1].configProperty.length(1); @@ -48,37 +48,6 @@ namespace CIAO deployment_plan.instance = instance; } - - void - DAnCE_Utils::add_instances ( - int num, - ::Deployment::DeploymentPlan &deployment_plan, - const char *instance_name, - const char *node_name, - const char *impl_name, - const char *ns_name) - { - for (int i = 1; i <= num; ++i) - { - ACE_CString inst_name (instance_name); - //ACE_CString naming (ns_name); - - const int BUF_SIZE = 256; - char buf[BUF_SIZE]; - ACE_OS::itoa (i, buf, 10); - inst_name += buf; - //naming += buf; - - DAnCE_Utils::add_instance (deployment_plan, - inst_name.c_str (), - node_name, - impl_name, - ns_name); - } - } - - - /* void DAnCE_Utils::add_connection (::Deployment::DeploymentPlan_var &deployment_plan, const char *connection_name, const char *port_name, const char *facet_instance, const char *receptacle_instance) @@ -104,7 +73,7 @@ namespace CIAO ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan->instance; for (i = 0; i < instance.length(); i++) - if (!ACE_OS::strcmp(instance[i].name.in(), facet_instance)) + if (!strcmp(instance[i].name.in(), facet_instance)) break; if (i < instance.length()) @@ -119,7 +88,7 @@ namespace CIAO // Looking for instance block with name equals to receptacle_instance ... for (i = 0; i < instance.length(); i++) - if (!ACE_OS::strcmp(instance[i].name.in(), receptacle_instance)) + if (!strcmp(instance[i].name.in(), receptacle_instance)) break; if (i < instance.length()) @@ -145,7 +114,7 @@ namespace CIAO unsigned int instance_ref = 0, i; for (i = 0; i < instance.length(); i++) - if (!ACE_OS::strcmp(instance[i].name.in(), instance_name)) + if (!strcmp(instance[i].name.in(), instance_name)) { instance_ref = i; break; @@ -159,14 +128,14 @@ namespace CIAO for (i = 0; i < connection.length(); i++) for (unsigned int j = 0; j < connection[i].internalEndpoint.length(); j++) if (connection[i].internalEndpoint[j].instanceRef == instance_ref) - { - remove_connection(deployment_plan, connection[i].name.in()); - // Updating i in order to verify the shifted connection ... - i--; - // Re-acquiring instances from the deployment plan ... - connection = deployment_plan->connection; - break; - } + { + remove_connection(deployment_plan, connection[i].name.in()); + // Updating i in order to verify the shifted connection ... + i--; + // Re-acquiring instances from the deployment plan ... + connection = deployment_plan->connection; + break; + } // And then, removing the instance itself ... @@ -204,13 +173,13 @@ namespace CIAO void DAnCE_Utils::remove_connection ( - ::Deployment::DeploymentPlan_var &deployment_plan, + ::Deployment::DeploymentPlan_var &deployment_plan, const char *connection_name) { ::Deployment::PlanConnectionDescriptions connection = deployment_plan->connection; for (unsigned int i = 0; i < connection.length(); i++) - if (!ACE_OS::strcmp(connection[i].name.in(), connection_name)) + if (!strcmp(connection[i].name.in(), connection_name)) { for (unsigned int k = i; k < connection.length() - 1; k++) { @@ -252,8 +221,8 @@ namespace CIAO } } connection.length(connection.length()-1); - // Re-assigning connection to the deployment plan ... - deployment_plan->connection = connection; + // Re-assigning connection to the deployment plan ... + deployment_plan->connection = connection; return; } // Throw exception if connection name not found ... @@ -263,119 +232,115 @@ namespace CIAO void DAnCE_Utils::print_instances (const ::Deployment::DeploymentPlan &deployment_plan) { - const ::Deployment::InstanceDeploymentDescriptions instance = + const ::Deployment::InstanceDeploymentDescriptions instance = deployment_plan.instance; for (CORBA::ULong i = 0; i < instance.length(); ++i) { - ACE_DEBUG ((LM_DEBUG, "\nInstance no. %d\n", i)); - ACE_DEBUG ((LM_DEBUG, "\tName: %s\n", instance[i].name.in())); - ACE_DEBUG ((LM_DEBUG, "\tNode: %s\n", instance[i].node.in())); + DANCE_DEBUG((LM_DEBUG, "[%M] \nInstance no. %d\n", i)); + DANCE_DEBUG((LM_DEBUG, "[%M] \tName: %C\n", instance[i].name.in())); + DANCE_DEBUG((LM_DEBUG, "[%M] \tNode: %C\n", instance[i].node.in())); - ACE_DEBUG ((LM_DEBUG, "\tImplementationRef: %d\n", instance[i].implementationRef)); - ACE_DEBUG ((LM_DEBUG, "\tNumber of properties: %d\n", instance[i].configProperty.length())); + DANCE_DEBUG((LM_DEBUG, "[%M] \tImplementationRef: %d\n", instance[i].implementationRef)); + DANCE_DEBUG((LM_DEBUG, "[%M] \tNumber of properties: %d\n", instance[i].configProperty.length())); for (CORBA::ULong k = 0; k < instance[i].configProperty.length(); k++) - ACE_DEBUG ((LM_DEBUG, "\t\tName: %s\n", instance[i].configProperty[k].name.in())); + DANCE_DEBUG((LM_DEBUG, "[%M] \t\tName: %C\n", instance[i].configProperty[k].name.in())); } } void DAnCE_Utils::print_connections (const ::Deployment::DeploymentPlan &deployment_plan) { - const ::Deployment::PlanConnectionDescriptions connection = + const ::Deployment::PlanConnectionDescriptions connection = deployment_plan.connection; for (CORBA::ULong i = 0; i < connection.length(); ++i) { - ACE_DEBUG ((LM_DEBUG, "\nConnection no. %d\n", i)); - ACE_DEBUG ((LM_DEBUG, "\tName: %s\n", connection[i].name.in())); + DANCE_DEBUG((LM_DEBUG, "[%M] \nConnection no. %d\n", i)); + DANCE_DEBUG((LM_DEBUG, "[%M] \tName: %C\n", connection[i].name.in())); - ACE_DEBUG ((LM_DEBUG, - "\tNo of deployRequirements: %d\n", + DANCE_DEBUG((LM_DEBUG, "[%M] \tNo of deployRequirements: %d\n", connection[i].deployRequirement.length())); for (CORBA::ULong j = 0; j < connection[i].deployRequirement.length(); ++j) { - ACE_DEBUG ((LM_DEBUG, - "\t\tDeploy Requirement %d:\n", + DANCE_DEBUG((LM_DEBUG, + "\t\tDeploy Requirement %d:\n", j+1)); - ACE_DEBUG ((LM_DEBUG, - "\t\t\tResource Type: %s\n", + DANCE_DEBUG((LM_DEBUG, + "\t\t\tResource Type: %C\n", connection[i].deployRequirement[j].resourceType.in())); - ACE_DEBUG ((LM_DEBUG, - "\t\t\tName: %s\n", + DANCE_DEBUG((LM_DEBUG, + "\t\t\tName: %C\n", connection[i].deployRequirement[j].name.in())); - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\t\t\tNo of Properties: %d\n", connection[i].deployRequirement[j].property.length())); for (CORBA::ULong k = 0; k < connection[i].deployRequirement[j].property.length(); ++k) { - ACE_DEBUG ((LM_DEBUG, "\t\t\tProperty %d:\n", k+1)); - ACE_DEBUG ((LM_DEBUG, - "\t\t\t\tName: %s\n", + DANCE_DEBUG((LM_DEBUG, "[%M] \t\t\tProperty %d:\n", k+1)); + DANCE_DEBUG((LM_DEBUG, + "\t\t\t\tName: %C\n", connection[i].deployRequirement[j].property[k].name.in())); } } - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\tNo of externalEndpoints: %d\n", connection[i].externalEndpoint.length())); for (CORBA::ULong j = 0; j < connection[i].externalEndpoint.length(); j++) - ACE_DEBUG ((LM_DEBUG, - "\t\tPortname %d: %s\n", j+1, + DANCE_DEBUG((LM_DEBUG, + "\t\tPortname %d: %C\n", j+1, connection[i].externalEndpoint[j].portName.in())); - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\tNo of internalEndpoints: %d\n", connection[i].internalEndpoint.length())); for (CORBA::ULong j = 0; j < connection[i].internalEndpoint.length(); j++) { - ACE_DEBUG ((LM_DEBUG, "\t\tInternalEndpoint %d:\n", j+1)); - ACE_DEBUG ((LM_DEBUG, "\t\t\tPortname: %s\n", connection[i].internalEndpoint[j].portName.in())); - ACE_DEBUG ((LM_DEBUG, "\t\t\tProvider: %d\n", connection[i].internalEndpoint[j].provider)); + DANCE_DEBUG((LM_DEBUG, "[%M] \t\tInternalEndpoint %d:\n", j+1)); + DANCE_DEBUG((LM_DEBUG, "[%M] \t\t\tPortname: %C\n", connection[i].internalEndpoint[j].portName.in())); + DANCE_DEBUG((LM_DEBUG, "\t\t\tProvider: %d\n", connection[i].internalEndpoint[j].provider)); - if (connection[i].internalEndpoint[j].kind == ::Deployment::Facet || + if (connection[i].internalEndpoint[j].kind == ::Deployment::Facet || connection[i].internalEndpoint[j].kind == ::Deployment::SimplexReceptacle) - ACE_DEBUG ((LM_DEBUG, - "\t\t\tKind: %s\n", - (connection[i].internalEndpoint[j].kind == ::Deployment::Facet) ? + DANCE_DEBUG((LM_DEBUG, + "\t\t\tKind: %C\n", + (connection[i].internalEndpoint[j].kind == ::Deployment::Facet) ? "Facet" : "SimplexReceptacle")); else - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\t\t\tKind: %d\n", connection[i].internalEndpoint[j].kind)); - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\t\t\tInstanceRef: %ld", (long) connection[i].internalEndpoint[j].instanceRef)); - ACE_DEBUG ((LM_DEBUG, - "\tInstanceName: %s\n", + DANCE_DEBUG((LM_DEBUG, "[%M] \tInstanceName: %C\n", deployment_plan.instance[connection[i].internalEndpoint[j].instanceRef].name.in())); } - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\tNo of externalReferenceEndpoints: %d\n", connection[i].externalReference.length())); for (CORBA::ULong j = 0; j < connection[i].externalReference.length(); ++j) - ACE_DEBUG ((LM_DEBUG, - "\t\tLocation %d: %s\n", + DANCE_DEBUG((LM_DEBUG, + "\t\tLocation %d: %C\n", j+1, connection[i].externalReference[j].location.in())); - ACE_DEBUG ((LM_DEBUG, + DANCE_DEBUG((LM_DEBUG, "\tNo of deployedResources: %d\n", connection[i].deployedResource.length())); for (CORBA::ULong j = 0; j < connection[i].deployedResource.length(); j++) { - ACE_DEBUG ((LM_DEBUG, - "\t\tTargetName: %s\n", + DANCE_DEBUG((LM_DEBUG, + "\t\tTargetName: %C\n", connection[i].deployedResource[j].targetName.in())); - ACE_DEBUG ((LM_DEBUG, - "\t\tRequirementName: %s\n", + DANCE_DEBUG((LM_DEBUG, "[%M] \t\tRequirementName: %C\n", connection[i].deployedResource[j].requirementName.in())); - ACE_DEBUG ((LM_DEBUG, - "\t\tResourceName: %s\n", + DANCE_DEBUG((LM_DEBUG, "[%M] \t\tResourceName: %C\n", connection[i].deployedResource[j].resourceName.in())); } } diff --git a/CIAO/DAnCE/Utils/Plan_Handler.h b/CIAO/DAnCE/Utils/Plan_Handler.h index 39bcde869d9..f65e976ed19 100644 --- a/CIAO/DAnCE/Utils/Plan_Handler.h +++ b/CIAO/DAnCE/Utils/Plan_Handler.h @@ -15,7 +15,7 @@ #include "DAnCE_Utils_Export.h" #include "Deployment/DeploymentC.h" -namespace CIAO +namespace DAnCE { class ImplementationNotFound {}; class InstanceNotFound {}; @@ -48,17 +48,6 @@ namespace CIAO const char *impl_name, const char *ns_name = 0); - /// Add a certain number of instances - /// The name of the instances will be "instance_name_X" where - /// <X> is a positive integer number starting from 1 to <num>. - static void add_instances ( - int num, - ::Deployment::DeploymentPlan &deployment_plan, - const char *instance_name, - const char *node_name, - const char *impl_name, - const char *ns_name = 0); - static void add_connection ( ::Deployment::DeploymentPlan &deployment_plan, const char *connection_name, diff --git a/CIAO/DAnCE/bin/.empty b/CIAO/DAnCE/bin/.empty new file mode 100644 index 00000000000..eb0e403e06a --- /dev/null +++ b/CIAO/DAnCE/bin/.empty @@ -0,0 +1 @@ +This file keeps the directory around even when using cvs update -dP diff --git a/CIAO/DAnCE/bin/PythonDAnCE/__init__.py b/CIAO/DAnCE/bin/PythonDAnCE/__init__.py new file mode 100755 index 00000000000..0ebbdbeba93 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/__init__.py @@ -0,0 +1 @@ +import generator diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/__init__.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/__init__.py new file mode 100755 index 00000000000..641e463cdaa --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/__init__.py @@ -0,0 +1,46 @@ +temp_path = "" + + +# # The following is the initialization logic that is executed +# # when the fuzz module is loaded +# from os import listdir, chdir, getcwd +# from sys import stderr, path +# oldwd = getcwd () + +# try: +# # The following is a trick to get the directory THIS SCRIPT - note, not necessarily the CWD - +# # is located. We use this path later to load all of the available templates +# import _path +# script_path = str (_path).split ()[3][1:-11] +# if script_path == "": +# script_path = "." + +# chdir (script_path + "/templates") + +# path.append (getcwd ()) + +# files = listdir (".") + +# modules = list () + + +# for item in files: +# if (item[0] != '_') and (item[-3:] == ".py"): +# print "Registering " + item [:-3] +# try: +# __import__ (item[:-3]) +# except: +# stderr.write ("ERROR: Unable to load the " + item[:-3] + " template\n") + +# finally: +# chdir (oldwd) + +import header +import comp_impl +import comp_inst +import footer +import homed_comp_impl +import homed_comp_inst +import home_impl +import home_inst +import artifact diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/_path.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/_path.py new file mode 100755 index 00000000000..e69de29bb2d --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/_path.py diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/artifact.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/artifact.py new file mode 100755 index 00000000000..dbebad5291d --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/artifact.py @@ -0,0 +1,24 @@ +from templet import stringfunction + +@stringfunction +def template (component_name): + """ + <artifact xmi:id="${component_name}_ExecArtifact"> + <name>${component_name}_exec</name> + <source/> + <node/> + <location>${component_name}_exec</location> + </artifact> + <artifact xmi:id="${component_name}_SvntArtifact"> + <name>${component_name}_svnt</name> + <source/> + <node/> + <location>${component_name}_svnt</location> + </artifact> + <artifact xmi:id="${component_name}_StubArtifact"> + <name>${component_name}_stub</name> + <source/> + <node/> + <location>${component_name}_stub</location> + </artifact> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_impl.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_impl.py new file mode 100755 index 00000000000..e807fc6f58a --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_impl.py @@ -0,0 +1,58 @@ +from templet import stringfunction + +@stringfunction +def template (component_name, namespace) : + """ + + <implementation xmi:id="${component_name}ComponentImplementation"> + <name>${component_name}ComponentImplementation</name> + <source/> + <artifact xmi:idref="${component_name}_ExecArtifact" /> + <artifact xmi:idref="${component_name}_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_${namespace}${component_name}_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_${namespace}${component_name}_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>${component_name}_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>${component_name}_exec</string> + </value> + </value> + </execParameter> + </implementation> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_inst.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_inst.py new file mode 100755 index 00000000000..7bacf681616 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/comp_inst.py @@ -0,0 +1,13 @@ +from templet import stringfunction + +@stringfunction +def template (component_name) : + """ + <instance xmi:id="${component_name}ComponentInstance"> + <name>${component_name}Component</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="${component_name}ComponentImplementation" /> + </instance> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/footer.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/footer.py new file mode 100755 index 00000000000..687cfb78a02 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/footer.py @@ -0,0 +1,8 @@ +from templet import stringfunction + +@stringfunction +def template (): + """ +</Deployment:DeploymentPlan> +""" + diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/header.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/header.py new file mode 100755 index 00000000000..c16146ae028 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/header.py @@ -0,0 +1,14 @@ +from templet import stringfunction + +@stringfunction +def template (uuid): + """ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>${uuid}</label> + <UUID>${uuid}</UUID> + +""" diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/home_impl.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/home_impl.py new file mode 100755 index 00000000000..87c14a68070 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/home_impl.py @@ -0,0 +1,57 @@ +from templet import stringfunction + +@stringfunction +def template (component_name, namespace) : + """ + <implementation xmi:id="${component_name}HomeImplementation"> + <name>${component_name}HomeImplementation</name> + <source/> + <artifact xmi:idref="${component_name}_ExecArtifact" /> + <artifact xmi:idref="${component_name}_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_${namespace}${component_name}Home_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_${namespace}${component_name}Home_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>${component_name}_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>${component_name}_exec</string> + </value> + </value> + </execParameter> + </implementation> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/home_inst.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/home_inst.py new file mode 100755 index 00000000000..6d24a5c5986 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/home_inst.py @@ -0,0 +1,13 @@ +from templet import stringfunction + +@stringfunction +def template (component_name) : + """ + <instance xmi:id="${component_name}HomeInstance"> + <name>${component_name}Home</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="${component_name}HomeImplementation" /> + </instance> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_impl.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_impl.py new file mode 100755 index 00000000000..ab8a7ee9517 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_impl.py @@ -0,0 +1,13 @@ +from templet import stringfunction + +@stringfunction +def template (component_name) : + """ + <implementation xmi:id="${component_name}ComponentImplementation"> + <name>${component_name}ComponentImplementation</name> + <source/> + <artifact xmi:idref="${component_name}_ExecArtifact" /> + <artifact xmi:idref="${component_name}_SvntArtifact" /> + <artifact xmi:idref="${component_name}_StubArtifact" /> + </implementation> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_inst.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_inst.py new file mode 100755 index 00000000000..ee1218d4539 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/homed_comp_inst.py @@ -0,0 +1,24 @@ +from templet import stringfunction + +@stringfunction +def template (component_name) : + """ + <instance xmi:id="${component_name}ComponentInstance"> + <name>${component_name}Component</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="${component_name}ComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>${component_name}Home</string> + </value> + </value> + </configProperty> + </instance> + """ diff --git a/CIAO/DAnCE/bin/PythonDAnCE/generator/templet.py b/CIAO/DAnCE/bin/PythonDAnCE/generator/templet.py new file mode 100755 index 00000000000..85cfb9f0389 --- /dev/null +++ b/CIAO/DAnCE/bin/PythonDAnCE/generator/templet.py @@ -0,0 +1,325 @@ +"""A lightweight python templating engine. Templet version 2 beta. + +Supports two templating idioms: + 1. template functions using @stringfunction and @unicodefunction + 2. template classes inheriting from StringTemplate and UnicodeTemplate + +Each template function is marked with the attribute @stringfunction +or @unicodefunction. Template functions will be rewritten to expand +their document string as a template and return the string result. +For example: + + @stringtemplate + def myTemplate(animal, thing): + "the $animal jumped over the $thing." + + print myTemplate('cow', 'moon') + +The template language understands the following forms: + + $myvar - inserts the value of the variable 'myvar' + ${...} - evaluates the expression and inserts the result + ${{...}} - executes enclosed code; use 'out.append(text)' to insert text + $$ - an escape for a single $ + $ (at the end of the line) - a line continuation + +Template functions are compiled into code that accumulates a list of +strings in a local variable 'out', and then returns the concatenation +of them. If you want do do complicated computation, you can append +to 'out' directly inside a ${{...}} block. + +Another alternative is to use template classes. + +Each template class is a subclass of StringTemplate or UnicodeTemplate. +Template classes should define a class attribute 'template' that +contains the template code. Also, any class attribute ending with +'_template' will be compiled into a template method. + +Use a template class by instantiating it with a dictionary or +keyword arguments. Get the expansion by converting the instance +to a string. For example: + + class MyTemplate(templet.Template): + template = "the $animal jumped over the $thing." + + print MyTemplate(animal='cow', thing='moon') + +Within a template class, the template language is similar to a template +function, but 'self.write' should be used to build the string inside +${{..}} blocks. Also, there is a shorthand for calling template methods: + + $<sub_template> - shorthand for '${{self.sub_template(vars())}}' + +This idiom is helpful for decomposing a template and when subclassing. + +A longer example: + + import cgi + class RecipeTemplate(templet.Template): + template = r''' + <html><head><title>$dish</title></head> + <body> + $<header_template> + $<body_template> + </body></html> + ''' + header_template = r''' + <h1>${cgi.escape(dish)}</h1> + ''' + body_template = r''' + <ol> + ${{ + for item in ingredients: + self.write('<li>', item, '\n') + }} + </ol> + ''' + +This template can be expanded as follows: + + print RecipeTemplate(dish='burger', ingredients=['bun', 'beef', 'lettuce']) + +And it can be subclassed like this: + + class RecipeWithPriceTemplate(RecipeTemplate): + header_template = "<h1>${cgi.escape(dish)} - $$$price</h1>\n" + +Templet is by David Bau and was inspired by Tomer Filiba's Templite class. +For details, see http://davidbau.com/templet + +Templet is posted by David Bau under BSD-license terms. + +Copyright (c) 2007, David Bau +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Templet nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +import sys, re, inspect + +class _TemplateBuilder(object): + __pattern = re.compile(r"""\$( # Directives begin with a $ + \$ | # $$ is an escape for $ + [^\S\n]*\n | # $\n is a line continuation + [_a-z][_a-z0-9]* | # $simple Python identifier + \{(?!\{)[^\}]*\} | # ${...} expression to eval + \{\{.*?\}\} | # ${{...}} multiline code to exec + <[_a-z][_a-z0-9]*> | # $<sub_template> method call + )(?:(?:(?<=\}\})|(?<=>))[^\S\n]*\n)? # eat some trailing newlines + """, re.IGNORECASE | re.VERBOSE | re.DOTALL) + + def __init__(self, constpat, emitpat, callpat=None): + self.constpat, self.emitpat, self.callpat = constpat, emitpat, callpat + + def __realign(self, str, spaces=''): + """Removes any leading empty columns of spaces and an initial empty line""" + lines = str.splitlines(); + if lines and not lines[0].strip(): del lines[0] + lspace = [len(l) - len(l.lstrip()) for l in lines if l.lstrip()] + margin = len(lspace) and min(lspace) + return '\n'.join((spaces + l[margin:]) for l in lines) + + def build(self, template, filename, s=''): + code = [] + for i, part in enumerate(self.__pattern.split(self.__realign(template))): + if i % 2 == 0: + if part: code.append(s + self.constpat % repr(part)) + else: + if not part or (part.startswith('<') and self.callpat is None): + raise SyntaxError('Unescaped $ in ' + filename) + elif part.endswith('\n'): continue + elif part == '$': code.append(s + self.emitpat % '"$"') + elif part.startswith('{{'): code.append(self.__realign(part[2:-2], s)) + elif part.startswith('{'): code.append(s + self.emitpat % part[1:-1]) + elif part.startswith('<'): code.append(s + self.callpat % part[1:-1]) + else: code.append(s + self.emitpat % part) + return '\n'.join(code) + +class _TemplateMetaClass(type): + __builder = _TemplateBuilder( + 'self.out.append(%s)', 'self.write(%s)', 'self.%s(vars())') + + def __compile(cls, template, n): + globals = sys.modules[cls.__module__].__dict__ + if '__file__' not in globals: filename = '<%s %s>' % (cls.__name__, n) + else: filename = '%s: <%s %s>' % (globals['__file__'], cls.__name__, n) + code = compile(cls.__builder.build(template, filename), filename, 'exec') + def expand(self, __dict = None, **kw): + if __dict: kw.update([i for i in __dict.iteritems() if i[0] not in kw]) + kw['self'] = self + exec code in globals, kw + return expand + + def __init__(cls, *args): + for attr, val in cls.__dict__.items(): + if attr == 'template' or attr.endswith('_template'): + if isinstance(val, basestring): + setattr(cls, attr, cls.__compile(val, attr)) + type.__init__(cls, *args) + +class StringTemplate(object): + """A base class for string template classes.""" + __metaclass__ = _TemplateMetaClass + + def __init__(self, *args, **kw): + self.out = [] + self.template(*args, **kw) + + def write(self, *args): + self.out.extend([str(a) for a in args]) + + def __str__(self): + return ''.join(self.out) + +# The original version of templet called StringTemplate "Template" +Template = StringTemplate + +class UnicodeTemplate(object): + """A base class for unicode template classes.""" + __metaclass__ = _TemplateMetaClass + + def __init__(self, *args, **kw): + self.out = [] + self.template(*args, **kw) + + def write(self, *args): + self.out.extend([unicode(a) for a in args]) + + def __unicode__(self): + return u''.join(self.out) + + def __str__(self): + return unicode(self).encode('utf-8') + +def _templatefunction(func, listname, stringtype): + globals, locals = sys.modules[func.__module__].__dict__, {} + if '__file__' not in globals: filename = '<%s>' % func.__name__ + else: filename = '%s: <%s>' % (globals['__file__'], func.__name__) + builder = _TemplateBuilder('%s.append(%%s)' % listname, + '%s.append(%s(%%s))' % (listname, stringtype)) + args = inspect.getargspec(func) + code = [ + 'def %s%s:' % (func.__name__, inspect.formatargspec(*args)), + ' %s = []' % listname, + builder.build(func.__doc__, filename, ' '), + ' return "".join(%s)' % listname] + code = compile('\n'.join(code), filename, 'exec') + exec code in globals, locals + return locals[func.__name__] + +def stringfunction(func): + """Function attribute for string template functions""" + return _templatefunction(func, listname='out', stringtype='str') + +def unicodefunction(func): + """Function attribute for unicode template functions""" + return _templatefunction(func, listname='out', stringtype='unicode') + +# When executed as a script, run some testing code. +if __name__ == '__main__': + ok = True + def expect(actual, expected): + global ok + if expected != actual: + print "error - got:\n%s" % repr(actual) + ok = False + class TestAll(Template): + """A test of all the $ forms""" + template = r""" + Bought: $count ${name}s$ + at $$$price. + ${{ + for i in xrange(count): + self.write(TestCalls(vars()), "\n") # inherit all the local $vars + }} + Total: $$${"%.2f" % (count * price)} + """ + class TestCalls(Template): + """A recursive test""" + template = "$name$i ${*[TestCalls(name=name[0], i=n) for n in xrange(i)]}" + expect( + str(TestAll(count=5, name="template call", price=1.23)), + "Bought: 5 template calls at $1.23.\n" + "template call0 \n" + "template call1 t0 \n" + "template call2 t0 t1 t0 \n" + "template call3 t0 t1 t0 t2 t0 t1 t0 \n" + "template call4 t0 t1 t0 t2 t0 t1 t0 t3 t0 t1 t0 t2 t0 t1 t0 \n" + "Total: $6.15\n") + class TestBase(Template): + template = r""" + <head>$<head_template></head> + <body>$<body_template></body> + """ + class TestDerived(TestBase): + head_template = "<title>$name</title>" + body_template = "${TestAll(vars())}" + expect( + str(TestDerived(count=4, name="template call", price=2.88)), + "<head><title>template call</title></head>\n" + "<body>" + "Bought: 4 template calls at $2.88.\n" + "template call0 \n" + "template call1 t0 \n" + "template call2 t0 t1 t0 \n" + "template call3 t0 t1 t0 t2 t0 t1 t0 \n" + "Total: $11.52\n" + "</body>\n") + class TestUnicode(UnicodeTemplate): + template = u""" + \N{Greek Small Letter Pi} = $pi + """ + expect( + unicode(TestUnicode(pi = 3.14)), + u"\N{Greek Small Letter Pi} = 3.14\n") + goterror = False + try: + class TestError(Template): + template = 'Cost of an error: $0' + except SyntaxError: + goterror = True + if not goterror: + print 'TestError failed' + ok = False + @stringfunction + def testBasic(name): + "Hello $name." + expect(testBasic('Henry'), "Hello Henry.") + @stringfunction + def testReps(a, count=5): r""" + ${{ if count == 0: return '' }} + $a${testReps(a, count - 1)}""" + expect( + testReps('foo'), + "foofoofoofoofoo") + @unicodefunction + def testUnicode(count=4): u""" + ${{ if not count: return '' }} + \N{BLACK STAR}${testUnicode(count - 1)}""" + expect( + testUnicode(count=10), + u"\N{BLACK STAR}" * 10) + if ok: print "OK" diff --git a/CIAO/DAnCE/bin/generate_plan.py b/CIAO/DAnCE/bin/generate_plan.py new file mode 100755 index 00000000000..15310877bec --- /dev/null +++ b/CIAO/DAnCE/bin/generate_plan.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +import sys, os + +sys.path.append (os.getenv ("DANCE_ROOT")) + + +def parse_args (): + from optparse import OptionParser + + parser = OptionParser ("""usage %prog [options] + Note that this script is very simple. It assumes that the idl and mpc follow + canonical and predictable patterns.""") + + parser.add_option ("-o", "--output", dest="output", action="store", type="string", + help="Output filename", default="Plan.cdp") + parser.add_option ("--home", dest="homes", action="append", type="string", + help="Home types to be included") + parser.add_option ("-c", "--component", dest="components", action="append", + type="string", help="Component types to be included") + parser.add_option ("--homed-component", dest="homed_components", action="append", + type="string", help="Homed component types to be included") + parser.add_option ("-u", "--uuid", dest="uuid", action="store", + type="string", help="UUID for the generated plan") + parser.add_option ("-n", "--namespace", dest="namespace", action="store", default="", + type="string", help="IDL namespace any components may be in") + + (options, arguments) = parser.parse_args () + + return (options, arguments) + +def main (): + (opts, args) = parse_args () + + # compset = set (opts.homes) | set (opts.components) | set (homed_components) + + from PythonDAnCE import generator + retval = "" + retval += generator.header.template (opts.uuid) + + artifacts = {} + + if opts.namespace != "": + opts.namespace += "_" + + #implementations + if opts.homes is not None: + for item in opts.homes: + retval += generator.home_impl.template (item, opts.namespace) + artifacts[item] = 1 + + if opts.homed_components is not None: + for item in opts.homed_components: + retval += generator.homed_comp_impl.template (item) + artifacts[item] = 1 + + if opts.components is not None: + for item in opts.components: + retval += generator.comp_impl.template (item, opts.namespace) + artifacts[item] = 1 + + #instances + if opts.homes is not None: + for item in opts.homes: + retval += generator.home_inst.template (item) + + if opts.homed_components is not None: + for item in opts.homed_components: + retval += generator.homed_comp_inst.template (item) + + if opts.components is not None: + for item in opts.components: + retval += generator.comp_inst.template (item) + + #artifacts + if artifacts is not None: + for item in artifacts.keys(): + retval += generator.artifact.template(item) + + retval += generator.footer.template () + + outfile = open (opts.output, 'w') + outfile.write (retval) + outfile.close () + + +if __name__ == "__main__": + main () + + + diff --git a/CIAO/DAnCE/lib/.empty b/CIAO/DAnCE/lib/.empty new file mode 100644 index 00000000000..eb0e403e06a --- /dev/null +++ b/CIAO/DAnCE/lib/.empty @@ -0,0 +1 @@ +This file keeps the directory around even when using cvs update -dP diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.cidl new file mode 100644 index 00000000000..fe2ff8f2859 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleAttribute.idl" + +composition session SimpleAttribute_Impl +{ + home executor SimpleAttributeHome_Exec + { + implements Simple::SimpleAttributeHome; + manages SimpleAttribute_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.idl new file mode 100644 index 00000000000..7d41978b4de --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.idl @@ -0,0 +1,25 @@ +// $Id$ + +#ifndef SIMPLE_ATTRIBUTE_IDL +#define SIMPLE_ATTRIBUTE_IDL + +#include "Components.idl" + +module Simple +{ + component SimpleAttribute + { + attribute string str_attr; + attribute long long_attr; + attribute short short_attr; + }; + + home SimpleAttributeHome manages SimpleAttribute + { + attribute string str_attr; + attribute long long_attr; + attribute short short_attr; + }; +}; + +#endif /*SIMPLE_ATTRIBUTE_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.mpc new file mode 100644 index 00000000000..6f552eaee25 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute.mpc @@ -0,0 +1,119 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl SimpleAttribute" + +project(SimpleAttribute_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEATTRIBUTE_STUB_Export \ + -Wb,stub_export_include=SimpleAttribute_stub_export.h \ + -Wb,skel_export_macro=SIMPLEATTRIBUTE_SVNT_Export \ + -Wb,skel_export_include=SimpleAttribute_svnt_export.h + + IDL_Files { + SimpleAttribute.idl + } +} + +project(SimpleAttribute_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEATTRIBUTE_SVNT_Export \ + --svnt-export-include SimpleAttribute_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEATTRIBUTE_EXEC_Export \ + -Wb,export_include=SimpleAttribute_exec_export.h \ + -SS + + CIDL_Files { + SimpleAttribute.cidl + } + + IDL_Files { + SimpleAttributeE.idl + } +} + +project(SimpleAttribute_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleAttribute_idl_gen + libs += + + sharedname = SimpleAttribute_stub + dynamicflags = SIMPLEATTRIBUTE_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleAttributeC.cpp + } + + Header_Files { + SimpleAttributeC.h + SimpleAttribute_stub_export.h + } + + Inline_Files { + SimpleAttributeC.inl + } +} + +project(SimpleAttribute_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleAttribute_cidl_gen SimpleAttribute_stub + sharedname = SimpleAttribute_exec + libs += SimpleAttribute_stub + + dynamicflags = SIMPLEATTRIBUTE_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleAttributeEC.cpp + SimpleAttribute_exec.cpp + } + + Header_Files { + SimpleAttributeEC.h + SimpleAttribute_exec.h + SimpleAttribute_exec_export.h + } + + Inline_Files { + SimpleAttributeEC.inl + } +} + + +project(SimpleAttribute_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleAttribute_exec + sharedname = SimpleAttribute_svnt + libs += SimpleAttribute_exec \ + SimpleAttribute_stub + + dynamicflags = SIMPLEATTRIBUTE_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleAttributeS.cpp + SimpleAttribute_svnt.cpp + } + + Header_Files { + SimpleAttributeS.h + SimpleAttribute_svnt.h + SimpleAttribute_svnt_export.h + } + + Inline_Files { + SimpleAttributeS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.cpp new file mode 100644 index 00000000000..675e7dcc386 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.cpp @@ -0,0 +1,259 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleAttribute_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleAttribute_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleAttribute_exec_i + //================================================================== + + SimpleAttribute_exec_i::SimpleAttribute_exec_i (void) + : str_ (""), + long_(-1), + short_(-1) + { + } + + SimpleAttribute_exec_i::~SimpleAttribute_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + char * + SimpleAttribute_exec_i::str_attr () + { + // Your code here. + return CORBA::string_dup (str_.c_str ()); + } + + void + SimpleAttribute_exec_i::str_attr (const char * str) + { + CIAO_TRACE ("SimpleAttribute_exec_i::str_attr"); + // Your code here. + this->str_ = str; + } + + ::CORBA::Long + SimpleAttribute_exec_i::long_attr () + { + CIAO_TRACE ("SimpleAttribute_exec_i::long_attr"); + // Your code here. + return long_; + } + + void + SimpleAttribute_exec_i::long_attr (::CORBA::Long long_attr ) + { + CIAO_TRACE ("SimpleAttribute_exec_i::long_attr"); + // Your code here. + this->long_ = long_attr; + } + + ::CORBA::Short + SimpleAttribute_exec_i::short_attr () + { + // Your code here. + return short_; + } + + void + SimpleAttribute_exec_i::short_attr (::CORBA::Short short_attr ) + { + CIAO_TRACE ("SimpleAttribute_exec_i::short_attr"); + // Your code here. + this->short_ = short_attr; + } + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleAttribute_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Simple::CCM_SimpleAttribute_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleAttribute_exec_i::configuration_complete () + { + // Your code here. + } + + void + SimpleAttribute_exec_i::ccm_activate () + { + // Your code here. + if (this->str_ == "" || + this->long_ == -1 || + this->short_ == -1) + { + CIAO_ERROR ((LM_ERROR, "SimpleAttribute_exec_i::ccm_activate - " + "Error: Attribute values didin't initialize correctly!\n")); + } + else + { + CIAO_DEBUG ((LM_EMERGENCY, "SimpleAttribute_exec_i::ccm_activate - " + "Test passed! String attribute is %s\n", + this->str_.c_str ())); + } + + } + + void + SimpleAttribute_exec_i::ccm_passivate () + { + // Your code here. + } + + void + SimpleAttribute_exec_i::ccm_remove () + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleAttributeHome_exec_i + //================================================================== + + SimpleAttributeHome_exec_i::SimpleAttributeHome_exec_i (void) + : str_ (""), + long_(-1), + short_(-1) + { + } + + SimpleAttributeHome_exec_i::~SimpleAttributeHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + + char * + SimpleAttributeHome_exec_i::str_attr () + { + // Your code here. + return CORBA::string_dup (str_.c_str ()); + } + + void + SimpleAttributeHome_exec_i::str_attr (const char * str) + { + CIAO_TRACE ("SimpleAttributeHome_exec_i::str_attr"); + // Your code here. + this->str_ = str; + } + + ::CORBA::Long + SimpleAttributeHome_exec_i::long_attr () + { + CIAO_TRACE ("SimpleAttributeHome_exec_i::long_attr"); + // Your code here. + return long_; + } + + void + SimpleAttributeHome_exec_i::long_attr (::CORBA::Long long_attr ) + { + CIAO_TRACE ("SimpleAttributeHome_exec_i::long_attr"); + // Your code here. + this->long_ = long_attr; + } + + ::CORBA::Short + SimpleAttributeHome_exec_i::short_attr () + { + // Your code here. + return short_; + } + + void + SimpleAttributeHome_exec_i::short_attr (::CORBA::Short short_attr ) + { + CIAO_TRACE ("SimpleAttributeHome_exec_i::short_attr"); + // Your code here. + this->short_ = short_attr; + } + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleAttributeHome_exec_i::create () + { + if (this->str_ == "" || + this->long_ == -1 || + this->short_ == -1) + { + CIAO_ERROR ((LM_ERROR, "SimpleAttribute_exec_i::ccm_activate - " + "Error: Attribute values didin't initialize correctly!\n")); + } + else + { + CIAO_DEBUG ((LM_EMERGENCY, "SimpleAttributeHome_exec_i::create - " + "Test passed! String attribute is %s\n", + this->str_.c_str ())); + } + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleAttribute_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEATTRIBUTE_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleAttributeHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleAttributeHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.h new file mode 100644 index 00000000000..2913eeb8d07 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec.h @@ -0,0 +1,141 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEATTRIBUTE_EXEC_H +#define CIAO_SIMPLEATTRIBUTE_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleAttributeEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleAttribute_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleAttribute_Impl +{ + class SIMPLEATTRIBUTE_EXEC_Export SimpleAttribute_exec_i + : public virtual SimpleAttribute_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleAttribute_exec_i (void); + virtual ~SimpleAttribute_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + virtual char * + str_attr (); + + virtual void + str_attr (const char * str_attr); + + virtual ::CORBA::Long + long_attr (); + + virtual void + long_attr (::CORBA::Long long_attr); + + virtual ::CORBA::Short + short_attr (); + + virtual void + short_attr (::CORBA::Short short_attr); + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleAttribute_Context_var context_; + ACE_CString str_; + ::CORBA::Long long_; + ::CORBA::Short short_; + }; + + class SIMPLEATTRIBUTE_EXEC_Export SimpleAttributeHome_exec_i + : public virtual SimpleAttributeHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleAttributeHome_exec_i (void); + virtual ~SimpleAttributeHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + virtual char * + str_attr (); + + virtual void + str_attr (const char * str_attr); + + virtual ::CORBA::Long + long_attr (); + + virtual void + long_attr (::CORBA::Long long_attr); + + virtual ::CORBA::Short + short_attr (); + + virtual void + short_attr (::CORBA::Short short_attr); + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + private: + ACE_CString str_; + ::CORBA::Long long_; + ::CORBA::Short short_; + }; + + extern "C" SIMPLEATTRIBUTE_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleAttributeHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEATTRIBUTE_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec_export.h new file mode 100644 index 00000000000..1b9481804a3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEATTRIBUTE_EXEC +// ------------------------------ +#ifndef SIMPLEATTRIBUTE_EXEC_EXPORT_H +#define SIMPLEATTRIBUTE_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEATTRIBUTE_EXEC_HAS_DLL) +# define SIMPLEATTRIBUTE_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEATTRIBUTE_EXEC_HAS_DLL */ + +#if !defined (SIMPLEATTRIBUTE_EXEC_HAS_DLL) +# define SIMPLEATTRIBUTE_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEATTRIBUTE_EXEC_HAS_DLL */ + +#if defined (SIMPLEATTRIBUTE_EXEC_HAS_DLL) && (SIMPLEATTRIBUTE_EXEC_HAS_DLL == 1) +# if defined (SIMPLEATTRIBUTE_EXEC_BUILD_DLL) +# define SIMPLEATTRIBUTE_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEATTRIBUTE_EXEC_BUILD_DLL */ +# define SIMPLEATTRIBUTE_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEATTRIBUTE_EXEC_BUILD_DLL */ +#else /* SIMPLEATTRIBUTE_EXEC_HAS_DLL == 1 */ +# define SIMPLEATTRIBUTE_EXEC_Export +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEATTRIBUTE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEATTRIBUTE_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEATTRIBUTE_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEATTRIBUTE_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEATTRIBUTE_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEATTRIBUTE_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEATTRIBUTE_EXEC_NTRACE */ + +#if (SIMPLEATTRIBUTE_EXEC_NTRACE == 1) +# define SIMPLEATTRIBUTE_EXEC_TRACE(X) +#else /* (SIMPLEATTRIBUTE_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEATTRIBUTE_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEATTRIBUTE_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEATTRIBUTE_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_stub_export.h new file mode 100644 index 00000000000..00e32efd226 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEATTRIBUTE_STUB +// ------------------------------ +#ifndef SIMPLEATTRIBUTE_STUB_EXPORT_H +#define SIMPLEATTRIBUTE_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEATTRIBUTE_STUB_HAS_DLL) +# define SIMPLEATTRIBUTE_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEATTRIBUTE_STUB_HAS_DLL */ + +#if !defined (SIMPLEATTRIBUTE_STUB_HAS_DLL) +# define SIMPLEATTRIBUTE_STUB_HAS_DLL 1 +#endif /* ! SIMPLEATTRIBUTE_STUB_HAS_DLL */ + +#if defined (SIMPLEATTRIBUTE_STUB_HAS_DLL) && (SIMPLEATTRIBUTE_STUB_HAS_DLL == 1) +# if defined (SIMPLEATTRIBUTE_STUB_BUILD_DLL) +# define SIMPLEATTRIBUTE_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEATTRIBUTE_STUB_BUILD_DLL */ +# define SIMPLEATTRIBUTE_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEATTRIBUTE_STUB_BUILD_DLL */ +#else /* SIMPLEATTRIBUTE_STUB_HAS_DLL == 1 */ +# define SIMPLEATTRIBUTE_STUB_Export +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEATTRIBUTE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEATTRIBUTE_STUB_HAS_DLL == 1 */ + +// Set SIMPLEATTRIBUTE_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEATTRIBUTE_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEATTRIBUTE_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEATTRIBUTE_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEATTRIBUTE_STUB_NTRACE */ + +#if (SIMPLEATTRIBUTE_STUB_NTRACE == 1) +# define SIMPLEATTRIBUTE_STUB_TRACE(X) +#else /* (SIMPLEATTRIBUTE_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEATTRIBUTE_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEATTRIBUTE_STUB_NTRACE == 1) */ + +#endif /* SIMPLEATTRIBUTE_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_svnt_export.h new file mode 100644 index 00000000000..6c1f3cf5a6f --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleAttribute_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEATTRIBUTE_SVNT +// ------------------------------ +#ifndef SIMPLEATTRIBUTE_SVNT_EXPORT_H +#define SIMPLEATTRIBUTE_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEATTRIBUTE_SVNT_HAS_DLL) +# define SIMPLEATTRIBUTE_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEATTRIBUTE_SVNT_HAS_DLL */ + +#if !defined (SIMPLEATTRIBUTE_SVNT_HAS_DLL) +# define SIMPLEATTRIBUTE_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEATTRIBUTE_SVNT_HAS_DLL */ + +#if defined (SIMPLEATTRIBUTE_SVNT_HAS_DLL) && (SIMPLEATTRIBUTE_SVNT_HAS_DLL == 1) +# if defined (SIMPLEATTRIBUTE_SVNT_BUILD_DLL) +# define SIMPLEATTRIBUTE_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEATTRIBUTE_SVNT_BUILD_DLL */ +# define SIMPLEATTRIBUTE_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEATTRIBUTE_SVNT_BUILD_DLL */ +#else /* SIMPLEATTRIBUTE_SVNT_HAS_DLL == 1 */ +# define SIMPLEATTRIBUTE_SVNT_Export +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEATTRIBUTE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEATTRIBUTE_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEATTRIBUTE_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEATTRIBUTE_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEATTRIBUTE_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEATTRIBUTE_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEATTRIBUTE_SVNT_NTRACE */ + +#if (SIMPLEATTRIBUTE_SVNT_NTRACE == 1) +# define SIMPLEATTRIBUTE_SVNT_TRACE(X) +#else /* (SIMPLEATTRIBUTE_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEATTRIBUTE_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEATTRIBUTE_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEATTRIBUTE_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.idl new file mode 100644 index 00000000000..6f943e9d1d5 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_COMMON_IDL +#define SIMPLE_COMMON_IDL + +#include "Components.idl" + +module Simple +{ + interface Trigger + { + void hello (in string hello); + }; + + eventtype Hello + { + public string hello_; + }; +}; + +#endif /*SIMPLE_COMMON_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.mpc new file mode 100644 index 00000000000..b1f86554639 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon.mpc @@ -0,0 +1,67 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl SimpleCommon" + +project(SimpleCommon_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLECOMMON_STUB_Export \ + -Wb,stub_export_include=SimpleCommon_stub_export.h \ + -Wb,skel_export_macro=SIMPLECOMMON_SVNT_Export \ + -Wb,skel_export_include=SimpleCommon_svnt_export.h + + IDL_Files { + SimpleCommon.idl + } +} + +project(SimpleCommon_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_idl_gen + libs += + + sharedname = SimpleCommon_stub + dynamicflags = SIMPLECOMMON_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleCommonC.cpp + } + + Header_Files { + SimpleCommonC.h + SimpleCommon_stub_export.h + } + + Inline_Files { + SimpleCommonC.inl + } +} + +project(SimpleCommon_skel) : ccm_svnt { + avoids += ace_for_tao + after += SimpleCommon_stub + sharedname = SimpleCommon_skel + libs += SimpleCommon_stub + + dynamicflags = SIMPLECOMMON_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleCommonS.cpp + } + + Header_Files { + SimpleCommonS.h + SimpleCommon_svnt_export.h + } + + Inline_Files { + SimpleCommonS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_stub_export.h new file mode 100644 index 00000000000..79aac6677b7 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECOMMON_STUB +// ------------------------------ +#ifndef SIMPLECOMMON_STUB_EXPORT_H +#define SIMPLECOMMON_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECOMMON_STUB_HAS_DLL) +# define SIMPLECOMMON_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECOMMON_STUB_HAS_DLL */ + +#if !defined (SIMPLECOMMON_STUB_HAS_DLL) +# define SIMPLECOMMON_STUB_HAS_DLL 1 +#endif /* ! SIMPLECOMMON_STUB_HAS_DLL */ + +#if defined (SIMPLECOMMON_STUB_HAS_DLL) && (SIMPLECOMMON_STUB_HAS_DLL == 1) +# if defined (SIMPLECOMMON_STUB_BUILD_DLL) +# define SIMPLECOMMON_STUB_Export ACE_Proper_Export_Flag +# define SIMPLECOMMON_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMMON_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECOMMON_STUB_BUILD_DLL */ +# define SIMPLECOMMON_STUB_Export ACE_Proper_Import_Flag +# define SIMPLECOMMON_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMMON_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECOMMON_STUB_BUILD_DLL */ +#else /* SIMPLECOMMON_STUB_HAS_DLL == 1 */ +# define SIMPLECOMMON_STUB_Export +# define SIMPLECOMMON_STUB_SINGLETON_DECLARATION(T) +# define SIMPLECOMMON_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECOMMON_STUB_HAS_DLL == 1 */ + +// Set SIMPLECOMMON_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECOMMON_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECOMMON_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECOMMON_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECOMMON_STUB_NTRACE */ + +#if (SIMPLECOMMON_STUB_NTRACE == 1) +# define SIMPLECOMMON_STUB_TRACE(X) +#else /* (SIMPLECOMMON_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECOMMON_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECOMMON_STUB_NTRACE == 1) */ + +#endif /* SIMPLECOMMON_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_svnt_export.h new file mode 100644 index 00000000000..0190bfeebab --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleCommon_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECOMMON_SVNT +// ------------------------------ +#ifndef SIMPLECOMMON_SVNT_EXPORT_H +#define SIMPLECOMMON_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECOMMON_SVNT_HAS_DLL) +# define SIMPLECOMMON_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECOMMON_SVNT_HAS_DLL */ + +#if !defined (SIMPLECOMMON_SVNT_HAS_DLL) +# define SIMPLECOMMON_SVNT_HAS_DLL 1 +#endif /* ! SIMPLECOMMON_SVNT_HAS_DLL */ + +#if defined (SIMPLECOMMON_SVNT_HAS_DLL) && (SIMPLECOMMON_SVNT_HAS_DLL == 1) +# if defined (SIMPLECOMMON_SVNT_BUILD_DLL) +# define SIMPLECOMMON_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECOMMON_SVNT_BUILD_DLL */ +# define SIMPLECOMMON_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECOMMON_SVNT_BUILD_DLL */ +#else /* SIMPLECOMMON_SVNT_HAS_DLL == 1 */ +# define SIMPLECOMMON_SVNT_Export +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLECOMMON_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECOMMON_SVNT_HAS_DLL == 1 */ + +// Set SIMPLECOMMON_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECOMMON_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECOMMON_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECOMMON_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECOMMON_SVNT_NTRACE */ + +#if (SIMPLECOMMON_SVNT_NTRACE == 1) +# define SIMPLECOMMON_SVNT_TRACE(X) +#else /* (SIMPLECOMMON_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECOMMON_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECOMMON_SVNT_NTRACE == 1) */ + +#endif /* SIMPLECOMMON_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.cidl new file mode 100644 index 00000000000..ff5081f82dd --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleConsumer.idl" + +composition session SimpleConsumer_Impl +{ + home executor SimpleConsumerHome_Exec + { + implements Simple::SimpleConsumerHome; + manages SimpleConsumer_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.idl new file mode 100644 index 00000000000..3895eacda3c --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_CONSUMER_IDL +#define SIMPLE_CONSUMER_IDL + +#include "SimpleCommon.idl" +#include <Components.idl> + +module Simple +{ + component SimpleConsumer + { + consumes Hello hello_; + }; + + home SimpleConsumerHome manages SimpleConsumer + { + }; +}; + +#endif /*SIMPLE_CONSUMER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.mpc new file mode 100644 index 00000000000..bece676d798 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimpleConsumer" + +project(SimpleCommon_SimpleConsumer_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLECONSUMER_STUB_Export \ + -Wb,stub_export_include=SimpleConsumer_stub_export.h \ + -Wb,skel_export_macro=SIMPLECONSUMER_SVNT_Export \ + -Wb,skel_export_include=SimpleConsumer_svnt_export.h + + IDL_Files { + SimpleConsumer.idl + } +} + +project(SimpleCommon_SimpleConsumer_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLECONSUMER_SVNT_Export \ + --svnt-export-include SimpleConsumer_svnt_export.h + idlflags += -Wb,export_macro=SIMPLECONSUMER_EXEC_Export \ + -Wb,export_include=SimpleConsumer_exec_export.h \ + -SS + + CIDL_Files { + SimpleConsumer.cidl + } + + IDL_Files { + SimpleConsumerE.idl + } +} + +project(SimpleCommon_SimpleConsumer_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimpleConsumer_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimpleConsumer_stub + dynamicflags = SIMPLECONSUMER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleConsumerC.cpp + } + + Header_Files { + SimpleConsumerC.h + SimpleConsumer_stub_export.h + } + + Inline_Files { + SimpleConsumerC.inl + } +} + +project(SimpleCommon_SimpleConsumer_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimpleConsumer_cidl_gen SimpleCommon_SimpleConsumer_stub + sharedname = SimpleConsumer_exec + libs += SimpleConsumer_stub SimpleCommon_stub + + dynamicflags = SIMPLECONSUMER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleConsumerEC.cpp + SimpleConsumer_exec.cpp + } + + Header_Files { + SimpleConsumerEC.h + SimpleConsumer_exec.h + SimpleConsumer_exec_export.h + } + + Inline_Files { + SimpleConsumerEC.inl + } +} + + +project(SimpleCommon_SimpleConsumer_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimpleConsumer_exec + sharedname = SimpleConsumer_svnt + libs += SimpleConsumer_exec \ + SimpleConsumer_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLECONSUMER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleConsumerS.cpp + SimpleConsumer_svnt.cpp + } + + Header_Files { + SimpleConsumerS.h + SimpleConsumer_svnt.h + SimpleConsumer_svnt_export.h + } + + Inline_Files { + SimpleConsumerS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp new file mode 100644 index 00000000000..f8201a17fb9 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.cpp @@ -0,0 +1,156 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleConsumer_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleConsumer_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleConsumer_exec_i + //================================================================== + + SimpleConsumer_exec_i::SimpleConsumer_exec_i (void) + { + CIAO_TRACE ("SimpleConsumer_exec_i::SimpleConsumer_exec_i (void)"); + } + + SimpleConsumer_exec_i::~SimpleConsumer_exec_i (void) + { + CIAO_TRACE ("SimpleConsumer_exec_i::~SimpleConsumer_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + void + SimpleConsumer_exec_i::push_hello_ ( + ::Simple::Hello * ev ) + { + CIAO_TRACE ("SimpleConsumer_exec_i::push_hello_ ()"); + // Your code here. + + CIAO_DEBUG ((LM_EMERGENCY, "SimpleConsumer_exec_i::push_hello_ - " + "Received hello event, value is %s\n", ev->hello_ ())); + } + + // Operations from Components::SessionComponent + + void + SimpleConsumer_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleConsumer_exec_i::set_session_context ()"); + + this->context_ = + ::Simple::CCM_SimpleConsumer_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleConsumer_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleConsumer_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimpleConsumer_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleConsumer_exec_i::ccm_activate ()"); + // Your code here. + } + + void + SimpleConsumer_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleConsumer_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimpleConsumer_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleConsumer_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleConsumerHome_exec_i + //================================================================== + + SimpleConsumerHome_exec_i::SimpleConsumerHome_exec_i (void) + { + CIAO_TRACE ("SimpleConsumerHome_exec_i::SimpleConsumerHome_exec_i (void)"); + } + + SimpleConsumerHome_exec_i::~SimpleConsumerHome_exec_i (void) + { + CIAO_TRACE ("SimpleConsumerHome_exec_i::~SimpleConsumerHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleConsumerHome_exec_i::create () + { + CIAO_TRACE ("SimpleConsumerHome_exec_i::create ()"); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleConsumer_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLECONSUMER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleConsumerHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleConsumerHome_Impl (void)"); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleConsumerHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.h new file mode 100644 index 00000000000..e4b9607bb45 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec.h @@ -0,0 +1,102 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLECONSUMER_EXEC_H +#define CIAO_SIMPLECONSUMER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleConsumerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleConsumer_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleConsumer_Impl +{ + class SIMPLECONSUMER_EXEC_Export SimpleConsumer_exec_i + : public virtual SimpleConsumer_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleConsumer_exec_i (void); + virtual ~SimpleConsumer_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual void + push_hello_ ( + ::Simple::Hello *ev); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleConsumer_Context_var context_; + }; + + class SIMPLECONSUMER_EXEC_Export SimpleConsumerHome_exec_i + : public virtual SimpleConsumerHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleConsumerHome_exec_i (void); + virtual ~SimpleConsumerHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLECONSUMER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleConsumerHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLECONSUMER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec_export.h new file mode 100644 index 00000000000..a8074c4c81f --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECONSUMER_EXEC +// ------------------------------ +#ifndef SIMPLECONSUMER_EXEC_EXPORT_H +#define SIMPLECONSUMER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECONSUMER_EXEC_HAS_DLL) +# define SIMPLECONSUMER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECONSUMER_EXEC_HAS_DLL */ + +#if !defined (SIMPLECONSUMER_EXEC_HAS_DLL) +# define SIMPLECONSUMER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLECONSUMER_EXEC_HAS_DLL */ + +#if defined (SIMPLECONSUMER_EXEC_HAS_DLL) && (SIMPLECONSUMER_EXEC_HAS_DLL == 1) +# if defined (SIMPLECONSUMER_EXEC_BUILD_DLL) +# define SIMPLECONSUMER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECONSUMER_EXEC_BUILD_DLL */ +# define SIMPLECONSUMER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECONSUMER_EXEC_BUILD_DLL */ +#else /* SIMPLECONSUMER_EXEC_HAS_DLL == 1 */ +# define SIMPLECONSUMER_EXEC_Export +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLECONSUMER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECONSUMER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLECONSUMER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECONSUMER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECONSUMER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECONSUMER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECONSUMER_EXEC_NTRACE */ + +#if (SIMPLECONSUMER_EXEC_NTRACE == 1) +# define SIMPLECONSUMER_EXEC_TRACE(X) +#else /* (SIMPLECONSUMER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECONSUMER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECONSUMER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLECONSUMER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_stub_export.h new file mode 100644 index 00000000000..89e5e37b32e --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECONSUMER_STUB +// ------------------------------ +#ifndef SIMPLECONSUMER_STUB_EXPORT_H +#define SIMPLECONSUMER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECONSUMER_STUB_HAS_DLL) +# define SIMPLECONSUMER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECONSUMER_STUB_HAS_DLL */ + +#if !defined (SIMPLECONSUMER_STUB_HAS_DLL) +# define SIMPLECONSUMER_STUB_HAS_DLL 1 +#endif /* ! SIMPLECONSUMER_STUB_HAS_DLL */ + +#if defined (SIMPLECONSUMER_STUB_HAS_DLL) && (SIMPLECONSUMER_STUB_HAS_DLL == 1) +# if defined (SIMPLECONSUMER_STUB_BUILD_DLL) +# define SIMPLECONSUMER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECONSUMER_STUB_BUILD_DLL */ +# define SIMPLECONSUMER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECONSUMER_STUB_BUILD_DLL */ +#else /* SIMPLECONSUMER_STUB_HAS_DLL == 1 */ +# define SIMPLECONSUMER_STUB_Export +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLECONSUMER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECONSUMER_STUB_HAS_DLL == 1 */ + +// Set SIMPLECONSUMER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECONSUMER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECONSUMER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECONSUMER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECONSUMER_STUB_NTRACE */ + +#if (SIMPLECONSUMER_STUB_NTRACE == 1) +# define SIMPLECONSUMER_STUB_TRACE(X) +#else /* (SIMPLECONSUMER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECONSUMER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECONSUMER_STUB_NTRACE == 1) */ + +#endif /* SIMPLECONSUMER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_svnt_export.h new file mode 100644 index 00000000000..eab50bcfd0a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleConsumer_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECONSUMER_SVNT +// ------------------------------ +#ifndef SIMPLECONSUMER_SVNT_EXPORT_H +#define SIMPLECONSUMER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECONSUMER_SVNT_HAS_DLL) +# define SIMPLECONSUMER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECONSUMER_SVNT_HAS_DLL */ + +#if !defined (SIMPLECONSUMER_SVNT_HAS_DLL) +# define SIMPLECONSUMER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLECONSUMER_SVNT_HAS_DLL */ + +#if defined (SIMPLECONSUMER_SVNT_HAS_DLL) && (SIMPLECONSUMER_SVNT_HAS_DLL == 1) +# if defined (SIMPLECONSUMER_SVNT_BUILD_DLL) +# define SIMPLECONSUMER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECONSUMER_SVNT_BUILD_DLL */ +# define SIMPLECONSUMER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECONSUMER_SVNT_BUILD_DLL */ +#else /* SIMPLECONSUMER_SVNT_HAS_DLL == 1 */ +# define SIMPLECONSUMER_SVNT_Export +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLECONSUMER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECONSUMER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLECONSUMER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECONSUMER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECONSUMER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECONSUMER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECONSUMER_SVNT_NTRACE */ + +#if (SIMPLECONSUMER_SVNT_NTRACE == 1) +# define SIMPLECONSUMER_SVNT_TRACE(X) +#else /* (SIMPLECONSUMER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECONSUMER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECONSUMER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLECONSUMER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.cidl new file mode 100644 index 00000000000..9de9153b267 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleEmitter.idl" + +composition session SimpleEmitter_Impl +{ + home executor SimpleEmitterHome_Exec + { + implements Simple::SimpleEmitterHome; + manages SimpleEmitter_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.idl new file mode 100644 index 00000000000..37431ca8134 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_EMITTER_IDL +#define SIMPLE_EMITTER_IDL + +#include "SimpleCommon.idl" +#include "Components.idl" + +module Simple +{ + component SimpleEmitter + { + emits Hello hello; + }; + + home SimpleEmitterHome manages SimpleEmitter + { + }; +}; + +#endif /*SIMPLE_EMITTER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.mpc new file mode 100644 index 00000000000..6a68a0a5376 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimpleEmitter" + +project(SimpleCommon_SimpleEmitter_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEEMITTER_STUB_Export \ + -Wb,stub_export_include=SimpleEmitter_stub_export.h \ + -Wb,skel_export_macro=SIMPLEEMITTER_SVNT_Export \ + -Wb,skel_export_include=SimpleEmitter_svnt_export.h + + IDL_Files { + SimpleEmitter.idl + } +} + +project(SimpleCommon_SimpleEmitter_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEEMITTER_SVNT_Export \ + --svnt-export-include SimpleEmitter_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEEMITTER_EXEC_Export \ + -Wb,export_include=SimpleEmitter_exec_export.h \ + -SS + + CIDL_Files { + SimpleEmitter.cidl + } + + IDL_Files { + SimpleEmitterE.idl + } +} + +project(SimpleCommon_SimpleEmitter_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimpleEmitter_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimpleEmitter_stub + dynamicflags = SIMPLEEMITTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleEmitterC.cpp + } + + Header_Files { + SimpleEmitterC.h + SimpleEmitter_stub_export.h + } + + Inline_Files { + SimpleEmitterC.inl + } +} + +project(SimpleCommon_SimpleEmitter_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimpleEmitter_cidl_gen SimpleCommon_SimpleEmitter_stub + sharedname = SimpleEmitter_exec + libs += SimpleEmitter_stub SimpleCommon_stub + + dynamicflags = SIMPLEEMITTER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleEmitterEC.cpp + SimpleEmitter_exec.cpp + } + + Header_Files { + SimpleEmitterEC.h + SimpleEmitter_exec.h + SimpleEmitter_exec_export.h + } + + Inline_Files { + SimpleEmitterEC.inl + } +} + + +project(SimpleCommon_SimpleEmitter_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimpleEmitter_exec + sharedname = SimpleEmitter_svnt + libs += SimpleEmitter_exec \ + SimpleEmitter_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLEEMITTER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleEmitterS.cpp + SimpleEmitter_svnt.cpp + } + + Header_Files { + SimpleEmitterS.h + SimpleEmitter_svnt.h + SimpleEmitter_svnt_export.h + } + + Inline_Files { + SimpleEmitterS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.cpp new file mode 100644 index 00000000000..99a3d01f161 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.cpp @@ -0,0 +1,149 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleEmitter_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleEmitter_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleEmitter_exec_i + //================================================================== + + SimpleEmitter_exec_i::SimpleEmitter_exec_i (void) + { + CIAO_TRACE ("SimpleEmitter_exec_i::SimpleEmitter_exec_i (void)"); + } + + SimpleEmitter_exec_i::~SimpleEmitter_exec_i (void) + { + CIAO_TRACE ("SimpleEmitter_exec_i::~SimpleEmitter_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleEmitter_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleEmitter_exec_i::set_session_context ()"); + this->context_ = + ::Simple::CCM_SimpleEmitter_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleEmitter_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleEmitter_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimpleEmitter_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleEmitter_exec_i::ccm_activate ()"); + // Your code here. + + ::Simple::Hello_var hello = new OBV_Simple::Hello ("Test successful, hello from SimpleEmitter_exec_i"); + + this->context_->push_hello (hello._retn ()); + } + + void + SimpleEmitter_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleEmitter_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimpleEmitter_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleEmitter_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleEmitterHome_exec_i + //================================================================== + + SimpleEmitterHome_exec_i::SimpleEmitterHome_exec_i (void) + { + CIAO_TRACE ("SimpleEmitterHome_exec_i::SimpleEmitterHome_exec_i (void)"); + } + + SimpleEmitterHome_exec_i::~SimpleEmitterHome_exec_i (void) + { + CIAO_TRACE ("SimpleEmitterHome_exec_i::~SimpleEmitterHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleEmitterHome_exec_i::create () + { + CIAO_TRACE ("SimpleEmitterHome_exec_i::create ()"); + + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleEmitter_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEEMITTER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleEmitterHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleEmitterHome_Impl (void)"); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleEmitterHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.h new file mode 100644 index 00000000000..a5008a85ea5 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec.h @@ -0,0 +1,98 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEEMITTER_EXEC_H +#define CIAO_SIMPLEEMITTER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleEmitterEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleEmitter_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleEmitter_Impl +{ + class SIMPLEEMITTER_EXEC_Export SimpleEmitter_exec_i + : public virtual SimpleEmitter_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleEmitter_exec_i (void); + virtual ~SimpleEmitter_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleEmitter_Context_var context_; + }; + + class SIMPLEEMITTER_EXEC_Export SimpleEmitterHome_exec_i + : public virtual SimpleEmitterHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleEmitterHome_exec_i (void); + virtual ~SimpleEmitterHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLEEMITTER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleEmitterHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEEMITTER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec_export.h new file mode 100644 index 00000000000..53fef48b799 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEEMITTER_EXEC +// ------------------------------ +#ifndef SIMPLEEMITTER_EXEC_EXPORT_H +#define SIMPLEEMITTER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEEMITTER_EXEC_HAS_DLL) +# define SIMPLEEMITTER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEEMITTER_EXEC_HAS_DLL */ + +#if !defined (SIMPLEEMITTER_EXEC_HAS_DLL) +# define SIMPLEEMITTER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEEMITTER_EXEC_HAS_DLL */ + +#if defined (SIMPLEEMITTER_EXEC_HAS_DLL) && (SIMPLEEMITTER_EXEC_HAS_DLL == 1) +# if defined (SIMPLEEMITTER_EXEC_BUILD_DLL) +# define SIMPLEEMITTER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEEMITTER_EXEC_BUILD_DLL */ +# define SIMPLEEMITTER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEEMITTER_EXEC_BUILD_DLL */ +#else /* SIMPLEEMITTER_EXEC_HAS_DLL == 1 */ +# define SIMPLEEMITTER_EXEC_Export +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEEMITTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEEMITTER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEEMITTER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEEMITTER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEEMITTER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEEMITTER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEEMITTER_EXEC_NTRACE */ + +#if (SIMPLEEMITTER_EXEC_NTRACE == 1) +# define SIMPLEEMITTER_EXEC_TRACE(X) +#else /* (SIMPLEEMITTER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEEMITTER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEEMITTER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEEMITTER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_stub_export.h new file mode 100644 index 00000000000..797140271a4 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEEMITTER_STUB +// ------------------------------ +#ifndef SIMPLEEMITTER_STUB_EXPORT_H +#define SIMPLEEMITTER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEEMITTER_STUB_HAS_DLL) +# define SIMPLEEMITTER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEEMITTER_STUB_HAS_DLL */ + +#if !defined (SIMPLEEMITTER_STUB_HAS_DLL) +# define SIMPLEEMITTER_STUB_HAS_DLL 1 +#endif /* ! SIMPLEEMITTER_STUB_HAS_DLL */ + +#if defined (SIMPLEEMITTER_STUB_HAS_DLL) && (SIMPLEEMITTER_STUB_HAS_DLL == 1) +# if defined (SIMPLEEMITTER_STUB_BUILD_DLL) +# define SIMPLEEMITTER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEEMITTER_STUB_BUILD_DLL */ +# define SIMPLEEMITTER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEEMITTER_STUB_BUILD_DLL */ +#else /* SIMPLEEMITTER_STUB_HAS_DLL == 1 */ +# define SIMPLEEMITTER_STUB_Export +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEEMITTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEEMITTER_STUB_HAS_DLL == 1 */ + +// Set SIMPLEEMITTER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEEMITTER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEEMITTER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEEMITTER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEEMITTER_STUB_NTRACE */ + +#if (SIMPLEEMITTER_STUB_NTRACE == 1) +# define SIMPLEEMITTER_STUB_TRACE(X) +#else /* (SIMPLEEMITTER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEEMITTER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEEMITTER_STUB_NTRACE == 1) */ + +#endif /* SIMPLEEMITTER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_svnt_export.h new file mode 100644 index 00000000000..0fdc781a895 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleEmitter_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEEMITTER_SVNT +// ------------------------------ +#ifndef SIMPLEEMITTER_SVNT_EXPORT_H +#define SIMPLEEMITTER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEEMITTER_SVNT_HAS_DLL) +# define SIMPLEEMITTER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEEMITTER_SVNT_HAS_DLL */ + +#if !defined (SIMPLEEMITTER_SVNT_HAS_DLL) +# define SIMPLEEMITTER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEEMITTER_SVNT_HAS_DLL */ + +#if defined (SIMPLEEMITTER_SVNT_HAS_DLL) && (SIMPLEEMITTER_SVNT_HAS_DLL == 1) +# if defined (SIMPLEEMITTER_SVNT_BUILD_DLL) +# define SIMPLEEMITTER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEEMITTER_SVNT_BUILD_DLL */ +# define SIMPLEEMITTER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEEMITTER_SVNT_BUILD_DLL */ +#else /* SIMPLEEMITTER_SVNT_HAS_DLL == 1 */ +# define SIMPLEEMITTER_SVNT_Export +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEEMITTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEEMITTER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEEMITTER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEEMITTER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEEMITTER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEEMITTER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEEMITTER_SVNT_NTRACE */ + +#if (SIMPLEEMITTER_SVNT_NTRACE == 1) +# define SIMPLEEMITTER_SVNT_TRACE(X) +#else /* (SIMPLEEMITTER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEEMITTER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEEMITTER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEEMITTER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.cidl new file mode 100644 index 00000000000..638efe0cb30 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleMultipleUser.idl" + +composition session SimpleMultipleUser_Impl +{ + home executor SimpleMultipleUserHome_Exec + { + implements Simple::SimpleMultipleUserHome; + manages SimpleMultipleUser_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.idl new file mode 100644 index 00000000000..60aec58f9af --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_MULTIPLEUSER_IDL +#define SIMPLE_MULTIPLEUSER_IDL + +#include "SimpleCommon.idl" +#include "Components.idl" + +module Simple +{ + component SimpleMultipleUser + { + uses multiple Trigger trig; + }; + + home SimpleMultipleUserHome manages SimpleMultipleUser + { + }; +}; + +#endif /*SIMPLE_MULTIPLEUSER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.mpc new file mode 100644 index 00000000000..841ba3c2c99 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimpleMultipleUser" + +project(SimpleCommon_SimpleMultipleUser_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEMULTIPLEUSER_STUB_Export \ + -Wb,stub_export_include=SimpleMultipleUser_stub_export.h \ + -Wb,skel_export_macro=SIMPLEMULTIPLEUSER_SVNT_Export \ + -Wb,skel_export_include=SimpleMultipleUser_svnt_export.h + + IDL_Files { + SimpleMultipleUser.idl + } +} + +project(SimpleCommon_SimpleMultipleUser_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEMULTIPLEUSER_SVNT_Export \ + --svnt-export-include SimpleMultipleUser_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEMULTIPLEUSER_EXEC_Export \ + -Wb,export_include=SimpleMultipleUser_exec_export.h \ + -SS + + CIDL_Files { + SimpleMultipleUser.cidl + } + + IDL_Files { + SimpleMultipleUserE.idl + } +} + +project(SimpleCommon_SimpleMultipleUser_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimpleMultipleUser_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimpleMultipleUser_stub + dynamicflags = SIMPLEMULTIPLEUSER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleMultipleUserC.cpp + } + + Header_Files { + SimpleMultipleUserC.h + SimpleMultipleUser_stub_export.h + } + + Inline_Files { + SimpleMultipleUserC.inl + } +} + +project(SimpleCommon_SimpleMultipleUser_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimpleMultipleUser_cidl_gen SimpleCommon_SimpleMultipleUser_stub + sharedname = SimpleMultipleUser_exec + libs += SimpleMultipleUser_stub SimpleCommon_stub + + dynamicflags = SIMPLEMULTIPLEUSER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleMultipleUserEC.cpp + SimpleMultipleUser_exec.cpp + } + + Header_Files { + SimpleMultipleUserEC.h + SimpleMultipleUser_exec.h + SimpleMultipleUser_exec_export.h + } + + Inline_Files { + SimpleMultipleUserEC.inl + } +} + + +project(SimpleCommon_SimpleMultipleUser_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimpleMultipleUser_exec + sharedname = SimpleMultipleUser_svnt + libs += SimpleMultipleUser_exec \ + SimpleMultipleUser_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLEMULTIPLEUSER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleMultipleUserS.cpp + SimpleMultipleUser_svnt.cpp + } + + Header_Files { + SimpleMultipleUserS.h + SimpleMultipleUser_svnt.h + SimpleMultipleUser_svnt_export.h + } + + Inline_Files { + SimpleMultipleUserS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp new file mode 100644 index 00000000000..e69a11e6e0e --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.cpp @@ -0,0 +1,176 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleMultipleUser_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleMultipleUser_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleMultipleUser_exec_i + //================================================================== + + SimpleMultipleUser_exec_i::SimpleMultipleUser_exec_i (void) + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::SimpleMultipleUser_exec_i (void)"); + } + + SimpleMultipleUser_exec_i::~SimpleMultipleUser_exec_i (void) + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::~SimpleMultipleUser_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleMultipleUser_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::set_session_context ()"); + this->context_ = + ::Simple::CCM_SimpleMultipleUser_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleMultipleUser_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimpleMultipleUser_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::ccm_activate ()"); + + ::Simple::SimpleMultipleUser::trigConnections_var conns = + this->context_->get_connections_trig (); + + CIAO_DEBUG ((LM_NOTICE, "SimpleMultipleUser_exec_i::ccm_activate - " + "Got %u connections to my receptacle\n", + conns->length ())); + + for (CORBA::ULong i = 0; i < conns->length (); ++i) + { + try + { + CIAO_DEBUG ((LM_NOTICE, "SimpleMultipleUser_exec_i::ccm_activate - " + "Invoking %u'th connection\n", i)); + ::Simple::Trigger_var trig (conns[i].objref); + + trig->hello ("Test succeeded, hello from SimpleMultipleUser_exec"); + } + catch (CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, "SimpleMultipleUser_exec_i::ccm_activate () - " + "Caught CORBA exception on %u'th reference, details follow:\n", + i)); + ex._tao_print_exception ("SimpleUser_exec_i::ccm_activate () - "); + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, "SimpleMultipleUser_exec_i::ccm_activate () - " + "Error: Caught unknown exception whilst invoking reference for port trig.\n")); + } + } + + // Your code here. + } + + void + SimpleMultipleUser_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimpleMultipleUser_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleMultipleUser_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleMultipleUserHome_exec_i + //================================================================== + + SimpleMultipleUserHome_exec_i::SimpleMultipleUserHome_exec_i (void) + { + CIAO_TRACE ("SimpleMultipleUserHome_exec_i::SimpleMultipleUserHome_exec_i (void)"); + } + + SimpleMultipleUserHome_exec_i::~SimpleMultipleUserHome_exec_i (void) + { + CIAO_TRACE ("SimpleMultipleUserHome_exec_i::~SimpleMultipleUserHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleMultipleUserHome_exec_i::create () + { + CIAO_TRACE ("SimpleMultipleUserHome_exec_i::create ()"); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleMultipleUser_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEMULTIPLEUSER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleMultipleUserHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleMultipleUserHome_Impl (void)"); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleMultipleUserHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.h new file mode 100644 index 00000000000..180cce92554 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec.h @@ -0,0 +1,98 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEMULTIPLEUSER_EXEC_H +#define CIAO_SIMPLEMULTIPLEUSER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleMultipleUserEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleMultipleUser_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleMultipleUser_Impl +{ + class SIMPLEMULTIPLEUSER_EXEC_Export SimpleMultipleUser_exec_i + : public virtual SimpleMultipleUser_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleMultipleUser_exec_i (void); + virtual ~SimpleMultipleUser_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleMultipleUser_Context_var context_; + }; + + class SIMPLEMULTIPLEUSER_EXEC_Export SimpleMultipleUserHome_exec_i + : public virtual SimpleMultipleUserHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleMultipleUserHome_exec_i (void); + virtual ~SimpleMultipleUserHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLEMULTIPLEUSER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleMultipleUserHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEMULTIPLEUSER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec_export.h new file mode 100644 index 00000000000..79cec9f8fe7 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEMULTIPLEUSER_EXEC +// ------------------------------ +#ifndef SIMPLEMULTIPLEUSER_EXEC_EXPORT_H +#define SIMPLEMULTIPLEUSER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEMULTIPLEUSER_EXEC_HAS_DLL) +# define SIMPLEMULTIPLEUSER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEMULTIPLEUSER_EXEC_HAS_DLL */ + +#if !defined (SIMPLEMULTIPLEUSER_EXEC_HAS_DLL) +# define SIMPLEMULTIPLEUSER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEMULTIPLEUSER_EXEC_HAS_DLL */ + +#if defined (SIMPLEMULTIPLEUSER_EXEC_HAS_DLL) && (SIMPLEMULTIPLEUSER_EXEC_HAS_DLL == 1) +# if defined (SIMPLEMULTIPLEUSER_EXEC_BUILD_DLL) +# define SIMPLEMULTIPLEUSER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEMULTIPLEUSER_EXEC_BUILD_DLL */ +# define SIMPLEMULTIPLEUSER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEMULTIPLEUSER_EXEC_BUILD_DLL */ +#else /* SIMPLEMULTIPLEUSER_EXEC_HAS_DLL == 1 */ +# define SIMPLEMULTIPLEUSER_EXEC_Export +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEMULTIPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEMULTIPLEUSER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEMULTIPLEUSER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEMULTIPLEUSER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEMULTIPLEUSER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEMULTIPLEUSER_EXEC_NTRACE */ + +#if (SIMPLEMULTIPLEUSER_EXEC_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_EXEC_TRACE(X) +#else /* (SIMPLEMULTIPLEUSER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEMULTIPLEUSER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEMULTIPLEUSER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEMULTIPLEUSER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_stub_export.h new file mode 100644 index 00000000000..bf0be40ece3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEMULTIPLEUSER_STUB +// ------------------------------ +#ifndef SIMPLEMULTIPLEUSER_STUB_EXPORT_H +#define SIMPLEMULTIPLEUSER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEMULTIPLEUSER_STUB_HAS_DLL) +# define SIMPLEMULTIPLEUSER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEMULTIPLEUSER_STUB_HAS_DLL */ + +#if !defined (SIMPLEMULTIPLEUSER_STUB_HAS_DLL) +# define SIMPLEMULTIPLEUSER_STUB_HAS_DLL 1 +#endif /* ! SIMPLEMULTIPLEUSER_STUB_HAS_DLL */ + +#if defined (SIMPLEMULTIPLEUSER_STUB_HAS_DLL) && (SIMPLEMULTIPLEUSER_STUB_HAS_DLL == 1) +# if defined (SIMPLEMULTIPLEUSER_STUB_BUILD_DLL) +# define SIMPLEMULTIPLEUSER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEMULTIPLEUSER_STUB_BUILD_DLL */ +# define SIMPLEMULTIPLEUSER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEMULTIPLEUSER_STUB_BUILD_DLL */ +#else /* SIMPLEMULTIPLEUSER_STUB_HAS_DLL == 1 */ +# define SIMPLEMULTIPLEUSER_STUB_Export +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEMULTIPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEMULTIPLEUSER_STUB_HAS_DLL == 1 */ + +// Set SIMPLEMULTIPLEUSER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEMULTIPLEUSER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEMULTIPLEUSER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEMULTIPLEUSER_STUB_NTRACE */ + +#if (SIMPLEMULTIPLEUSER_STUB_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_STUB_TRACE(X) +#else /* (SIMPLEMULTIPLEUSER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEMULTIPLEUSER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEMULTIPLEUSER_STUB_NTRACE == 1) */ + +#endif /* SIMPLEMULTIPLEUSER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_svnt_export.h new file mode 100644 index 00000000000..97f0fdf0f00 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleMultipleUser_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEMULTIPLEUSER_SVNT +// ------------------------------ +#ifndef SIMPLEMULTIPLEUSER_SVNT_EXPORT_H +#define SIMPLEMULTIPLEUSER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEMULTIPLEUSER_SVNT_HAS_DLL) +# define SIMPLEMULTIPLEUSER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEMULTIPLEUSER_SVNT_HAS_DLL */ + +#if !defined (SIMPLEMULTIPLEUSER_SVNT_HAS_DLL) +# define SIMPLEMULTIPLEUSER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEMULTIPLEUSER_SVNT_HAS_DLL */ + +#if defined (SIMPLEMULTIPLEUSER_SVNT_HAS_DLL) && (SIMPLEMULTIPLEUSER_SVNT_HAS_DLL == 1) +# if defined (SIMPLEMULTIPLEUSER_SVNT_BUILD_DLL) +# define SIMPLEMULTIPLEUSER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEMULTIPLEUSER_SVNT_BUILD_DLL */ +# define SIMPLEMULTIPLEUSER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEMULTIPLEUSER_SVNT_BUILD_DLL */ +#else /* SIMPLEMULTIPLEUSER_SVNT_HAS_DLL == 1 */ +# define SIMPLEMULTIPLEUSER_SVNT_Export +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEMULTIPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEMULTIPLEUSER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEMULTIPLEUSER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEMULTIPLEUSER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEMULTIPLEUSER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEMULTIPLEUSER_SVNT_NTRACE */ + +#if (SIMPLEMULTIPLEUSER_SVNT_NTRACE == 1) +# define SIMPLEMULTIPLEUSER_SVNT_TRACE(X) +#else /* (SIMPLEMULTIPLEUSER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEMULTIPLEUSER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEMULTIPLEUSER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEMULTIPLEUSER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.cidl new file mode 100644 index 00000000000..8c10398272a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.cidl @@ -0,0 +1,12 @@ +// $Id$ + +#include "SimpleNull.idl" + +composition session SimpleNull_Impl +{ + home executor SimpleNullHome_Exec + { + implements Simple::SimpleNullHome; + manages SimpleProvider_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.idl new file mode 100644 index 00000000000..d8f02901be4 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.idl @@ -0,0 +1,14 @@ +// $Id$ + +#include <Components.idl> + +module Simple +{ + component SimpleNull + { + }; + + home SimpleNullHome manages SimpleNull + { + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.mpc new file mode 100644 index 00000000000..3e64dd78d9b --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull.mpc @@ -0,0 +1,119 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl SimpleNull" + +project(SimpleNull_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLENULL_STUB_Export \ + -Wb,stub_export_include=SimpleNull_stub_export.h \ + -Wb,skel_export_macro=SIMPLENULL_SVNT_Export \ + -Wb,skel_export_include=SimpleNull_svnt_export.h + + IDL_Files { + SimpleNull.idl + } +} + +project(SimpleNull_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLENULL_SVNT_Export \ + --svnt-export-include SimpleNull_svnt_export.h + idlflags += -Wb,export_macro=SIMPLENULL_EXEC_Export \ + -Wb,export_include=SimpleNull_exec_export.h \ + -SS + + CIDL_Files { + SimpleNull.cidl + } + + IDL_Files { + SimpleNullE.idl + } +} + +project(SimpleNull_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleNull_idl_gen + libs += + + sharedname = SimpleNull_stub + dynamicflags = SIMPLENULL_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleNullC.cpp + } + + Header_Files { + SimpleNullC.h + SimpleNull_stub_export.h + } + + Inline_Files { + SimpleNullC.inl + } +} + +project(SimpleNull_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleNull_cidl_gen SimpleNull_stub + sharedname = SimpleNull_exec + libs += SimpleNull_stub + + dynamicflags = SIMPLENULL_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleNullEC.cpp + SimpleNull_exec.cpp + } + + Header_Files { + SimpleNullEC.h + SimpleNull_exec.h + SimpleNull_exec_export.h + } + + Inline_Files { + SimpleNullEC.inl + } +} + + +project(SimpleNull_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleNull_exec + sharedname = SimpleNull_svnt + libs += SimpleNull_exec \ + SimpleNull_stub + + dynamicflags = SIMPLENULL_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleNullS.cpp + SimpleNull_svnt.cpp + } + + Header_Files { + SimpleNullS.h + SimpleNull_svnt.h + SimpleNull_svnt_export.h + } + + Inline_Files { + SimpleNullS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.cpp new file mode 100644 index 00000000000..15ee5ee2dbb --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.cpp @@ -0,0 +1,168 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleNull_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleNull_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleNull_exec_i + //================================================================== + + SimpleNull_exec_i::SimpleNull_exec_i (void) + { + CIAO_TRACE ("SimpleNull_exec_i::SimpleNull_exec_i (void)"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::SimpleNull_exec_i (void)\n")); + } + + SimpleNull_exec_i::~SimpleNull_exec_i (void) + { + CIAO_TRACE ("SimpleNull_exec_i::~SimpleNull_exec_i"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::~SimpleNull_exec_i\n")); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleNull_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleNull_exec_i::set_session_context"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::set_session_context\n")); + this->context_ = + ::Simple::CCM_SimpleNull_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleNull_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleNull_exec_i::configuration_complete\n"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::configuration_complete\n")); + // Your code here. + } + + void + SimpleNull_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleNull_exec_i::ccm_activate"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::ccm_activate\n")); + // Your code here. + } + + void + SimpleNull_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleNull_exec_i::ccm_passivate"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::ccm_passivate\n")); + // Your code here. + } + + void + SimpleNull_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleNull_exec_i::ccm_remove"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNull_exec_i::ccm_remove\n")); + // Your code here. + } + + extern "C" SIMPLENULL_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Simple_SimpleNull_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + SimpleNull_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: SimpleNullHome_exec_i + //================================================================== + + SimpleNullHome_exec_i::SimpleNullHome_exec_i (void) + { + CIAO_TRACE ("SimpleNullHome_exec_i::SimpleNullHome_exec_i"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNullHome_exec_i::SimpleNullHome_exec_i\n")); + } + + SimpleNullHome_exec_i::~SimpleNullHome_exec_i (void) + { + CIAO_TRACE ("SimpleNullHome_exec_i::~SimpleNullHome_exec_i"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNullHome_exec_i::~SimpleNullHome_exec_i\n")); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleNullHome_exec_i::create () + { + CIAO_TRACE ("SimpleNullHome_exec_i::create"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - SimpleNullHome_exec_i::create\n")); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleNull_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLENULL_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleNullHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleNullHome_Impl"); + CIAO_DEBUG ((LM_EMERGENCY, "SimpleNull - Test - Lifecycle event - create_Simple_SimpleNullHome_Impl\n")); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleNullHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.h new file mode 100644 index 00000000000..e5887e7afdc --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec.h @@ -0,0 +1,101 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLENULL_EXEC_H +#define CIAO_SIMPLENULL_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleNullEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleNull_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleNull_Impl +{ + class SIMPLENULL_EXEC_Export SimpleNull_exec_i + : public virtual SimpleProvider_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleNull_exec_i (void); + virtual ~SimpleNull_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleNull_Context_var context_; + }; + + extern "C" SIMPLENULL_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Simple_SimpleNull_Impl (void); + + class SIMPLENULL_EXEC_Export SimpleNullHome_exec_i + : public virtual SimpleNullHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleNullHome_exec_i (void); + virtual ~SimpleNullHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLENULL_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleNullHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLENULL_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec_export.h new file mode 100644 index 00000000000..5d0ff473419 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLENULL_EXEC +// ------------------------------ +#ifndef SIMPLENULL_EXEC_EXPORT_H +#define SIMPLENULL_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLENULL_EXEC_HAS_DLL) +# define SIMPLENULL_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLENULL_EXEC_HAS_DLL */ + +#if !defined (SIMPLENULL_EXEC_HAS_DLL) +# define SIMPLENULL_EXEC_HAS_DLL 1 +#endif /* ! SIMPLENULL_EXEC_HAS_DLL */ + +#if defined (SIMPLENULL_EXEC_HAS_DLL) && (SIMPLENULL_EXEC_HAS_DLL == 1) +# if defined (SIMPLENULL_EXEC_BUILD_DLL) +# define SIMPLENULL_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLENULL_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLENULL_EXEC_BUILD_DLL */ +# define SIMPLENULL_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLENULL_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLENULL_EXEC_BUILD_DLL */ +#else /* SIMPLENULL_EXEC_HAS_DLL == 1 */ +# define SIMPLENULL_EXEC_Export +# define SIMPLENULL_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLENULL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLENULL_EXEC_HAS_DLL == 1 */ + +// Set SIMPLENULL_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLENULL_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLENULL_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLENULL_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLENULL_EXEC_NTRACE */ + +#if (SIMPLENULL_EXEC_NTRACE == 1) +# define SIMPLENULL_EXEC_TRACE(X) +#else /* (SIMPLENULL_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLENULL_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLENULL_EXEC_NTRACE == 1) */ + +#endif /* SIMPLENULL_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_stub_export.h new file mode 100644 index 00000000000..17eef930019 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLENULL_STUB +// ------------------------------ +#ifndef SIMPLENULL_STUB_EXPORT_H +#define SIMPLENULL_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLENULL_STUB_HAS_DLL) +# define SIMPLENULL_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLENULL_STUB_HAS_DLL */ + +#if !defined (SIMPLENULL_STUB_HAS_DLL) +# define SIMPLENULL_STUB_HAS_DLL 1 +#endif /* ! SIMPLENULL_STUB_HAS_DLL */ + +#if defined (SIMPLENULL_STUB_HAS_DLL) && (SIMPLENULL_STUB_HAS_DLL == 1) +# if defined (SIMPLENULL_STUB_BUILD_DLL) +# define SIMPLENULL_STUB_Export ACE_Proper_Export_Flag +# define SIMPLENULL_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLENULL_STUB_BUILD_DLL */ +# define SIMPLENULL_STUB_Export ACE_Proper_Import_Flag +# define SIMPLENULL_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLENULL_STUB_BUILD_DLL */ +#else /* SIMPLENULL_STUB_HAS_DLL == 1 */ +# define SIMPLENULL_STUB_Export +# define SIMPLENULL_STUB_SINGLETON_DECLARATION(T) +# define SIMPLENULL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLENULL_STUB_HAS_DLL == 1 */ + +// Set SIMPLENULL_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLENULL_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLENULL_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLENULL_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLENULL_STUB_NTRACE */ + +#if (SIMPLENULL_STUB_NTRACE == 1) +# define SIMPLENULL_STUB_TRACE(X) +#else /* (SIMPLENULL_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLENULL_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLENULL_STUB_NTRACE == 1) */ + +#endif /* SIMPLENULL_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_svnt_export.h new file mode 100644 index 00000000000..9afa614f9a4 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleNull_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLENULL_SVNT +// ------------------------------ +#ifndef SIMPLENULL_SVNT_EXPORT_H +#define SIMPLENULL_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLENULL_SVNT_HAS_DLL) +# define SIMPLENULL_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLENULL_SVNT_HAS_DLL */ + +#if !defined (SIMPLENULL_SVNT_HAS_DLL) +# define SIMPLENULL_SVNT_HAS_DLL 1 +#endif /* ! SIMPLENULL_SVNT_HAS_DLL */ + +#if defined (SIMPLENULL_SVNT_HAS_DLL) && (SIMPLENULL_SVNT_HAS_DLL == 1) +# if defined (SIMPLENULL_SVNT_BUILD_DLL) +# define SIMPLENULL_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLENULL_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLENULL_SVNT_BUILD_DLL */ +# define SIMPLENULL_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLENULL_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLENULL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLENULL_SVNT_BUILD_DLL */ +#else /* SIMPLENULL_SVNT_HAS_DLL == 1 */ +# define SIMPLENULL_SVNT_Export +# define SIMPLENULL_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLENULL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLENULL_SVNT_HAS_DLL == 1 */ + +// Set SIMPLENULL_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLENULL_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLENULL_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLENULL_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLENULL_SVNT_NTRACE */ + +#if (SIMPLENULL_SVNT_NTRACE == 1) +# define SIMPLENULL_SVNT_TRACE(X) +#else /* (SIMPLENULL_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLENULL_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLENULL_SVNT_NTRACE == 1) */ + +#endif /* SIMPLENULL_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.cidl new file mode 100644 index 00000000000..cff76c14b89 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleProvider.idl" + +composition session SimpleProvider_Impl +{ + home executor SimpleProviderHome_Exec + { + implements Simple::SimpleProviderHome; + manages SimpleProvider_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.idl new file mode 100644 index 00000000000..97e2c80984b --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_PROVIDER_IDL +#define SIMPLE_PROVIDER_IDL + +#include "SimpleCommon.idl" +#include "Components.idl" + +module Simple +{ + component SimpleProvider + { + provides Trigger trig; + }; + + home SimpleProviderHome manages SimpleProvider + { + }; +}; + +#endif /*SIMPLE_PROVIDER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.mpc new file mode 100644 index 00000000000..c917d235490 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimpleProvider" + +project(SimpleCommon_SimpleProvider_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEPROVIDER_STUB_Export \ + -Wb,stub_export_include=SimpleProvider_stub_export.h \ + -Wb,skel_export_macro=SIMPLEPROVIDER_SVNT_Export \ + -Wb,skel_export_include=SimpleProvider_svnt_export.h + + IDL_Files { + SimpleProvider.idl + } +} + +project(SimpleCommon_SimpleProvider_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEPROVIDER_SVNT_Export \ + --svnt-export-include SimpleProvider_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEPROVIDER_EXEC_Export \ + -Wb,export_include=SimpleProvider_exec_export.h \ + -SS + + CIDL_Files { + SimpleProvider.cidl + } + + IDL_Files { + SimpleProviderE.idl + } +} + +project(SimpleCommon_SimpleProvider_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimpleProvider_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimpleProvider_stub + dynamicflags = SIMPLEPROVIDER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleProviderC.cpp + } + + Header_Files { + SimpleProviderC.h + SimpleProvider_stub_export.h + } + + Inline_Files { + SimpleProviderC.inl + } +} + +project(SimpleCommon_SimpleProvider_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimpleProvider_cidl_gen SimpleCommon_SimpleProvider_stub + sharedname = SimpleProvider_exec + libs += SimpleProvider_stub SimpleCommon_stub + + dynamicflags = SIMPLEPROVIDER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleProviderEC.cpp + SimpleProvider_exec.cpp + } + + Header_Files { + SimpleProviderEC.h + SimpleProvider_exec.h + SimpleProvider_exec_export.h + } + + Inline_Files { + SimpleProviderEC.inl + } +} + + +project(SimpleCommon_SimpleProvider_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimpleProvider_exec + sharedname = SimpleProvider_svnt + libs += SimpleProvider_exec \ + SimpleProvider_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLEPROVIDER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleProviderS.cpp + SimpleProvider_svnt.cpp + } + + Header_Files { + SimpleProviderS.h + SimpleProvider_svnt.h + SimpleProvider_svnt_export.h + } + + Inline_Files { + SimpleProviderS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp new file mode 100644 index 00000000000..63453474a67 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.cpp @@ -0,0 +1,178 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleProvider_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleProvider_Impl +{ + //================================================================== + // Facet Executor Implementation Class: Trigger_exec_i + //================================================================== + + Trigger_exec_i::Trigger_exec_i (void) + { + CIAO_TRACE ("Trigger_exec_i::Trigger_exec_i (void)"); + } + + Trigger_exec_i::~Trigger_exec_i (void) + { + CIAO_TRACE ("Trigger_exec_i::~Trigger_exec_i (void)"); + } + + // Operations from ::Simple::Trigger + + void + Trigger_exec_i::hello ( + const char * hello ) + { + CIAO_TRACE ("Trigger_exec_i::hello ()"); + // Your code here. + CIAO_DEBUG ((LM_EMERGENCY, "Trigger_exec_i::hello - " + "Got the following intofrmation from trig port: %s\n", + hello)); + } + + //================================================================== + // Component Executor Implementation Class: SimpleProvider_exec_i + //================================================================== + + SimpleProvider_exec_i::SimpleProvider_exec_i (void) + { + CIAO_TRACE ("SimpleProvider_exec_i::SimpleProvider_exec_i (void)"); + } + + SimpleProvider_exec_i::~SimpleProvider_exec_i (void) + { + CIAO_TRACE ("SimpleProvider_exec_i::~SimpleProvider_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + ::Simple::CCM_Trigger_ptr + SimpleProvider_exec_i::get_trig () + { + CIAO_TRACE ("SimpleProvider_exec_i::get_trig ()"); + return new Trigger_exec_i (); + } + + // Operations from Components::SessionComponent + + void + SimpleProvider_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleProvider_exec_i::set_session_context ()"); + this->context_ = + ::Simple::CCM_SimpleProvider_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleProvider_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleProvider_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimpleProvider_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleProvider_exec_i::ccm_activate ()"); + // Your code here. + } + + void + SimpleProvider_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleProvider_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimpleProvider_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleProvider_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleProviderHome_exec_i + //================================================================== + + SimpleProviderHome_exec_i::SimpleProviderHome_exec_i (void) + { + CIAO_TRACE ("SimpleProviderHome_exec_i::SimpleProviderHome_exec_i (void)"); + } + + SimpleProviderHome_exec_i::~SimpleProviderHome_exec_i (void) + { + CIAO_TRACE ("SimpleProviderHome_exec_i::~SimpleProviderHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleProviderHome_exec_i::create () + { + CIAO_TRACE ("SimpleProviderHome_exec_i::create ()"); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleProvider_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEPROVIDER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleProviderHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleProviderHome_Impl (void)"); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleProviderHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.h new file mode 100644 index 00000000000..044c9aa56e3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec.h @@ -0,0 +1,116 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEPROVIDER_EXEC_H +#define CIAO_SIMPLEPROVIDER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleProviderEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleProvider_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleProvider_Impl +{ + class SIMPLEPROVIDER_EXEC_Export Trigger_exec_i + : public virtual ::Simple::CCM_Trigger, + public virtual ::CORBA::LocalObject + { + public: + Trigger_exec_i (void); + virtual ~Trigger_exec_i (void); + + // Operations from ::Simple::Trigger + + virtual void + hello ( + const char * hello); + }; + + class SIMPLEPROVIDER_EXEC_Export SimpleProvider_exec_i + : public virtual SimpleProvider_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleProvider_exec_i (void); + virtual ~SimpleProvider_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual ::Simple::CCM_Trigger_ptr + get_trig (); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleProvider_Context_var context_; + }; + + class SIMPLEPROVIDER_EXEC_Export SimpleProviderHome_exec_i + : public virtual SimpleProviderHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleProviderHome_exec_i (void); + virtual ~SimpleProviderHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLEPROVIDER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleProviderHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEPROVIDER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec_export.h new file mode 100644 index 00000000000..c5e9182f61f --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPROVIDER_EXEC +// ------------------------------ +#ifndef SIMPLEPROVIDER_EXEC_EXPORT_H +#define SIMPLEPROVIDER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPROVIDER_EXEC_HAS_DLL) +# define SIMPLEPROVIDER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPROVIDER_EXEC_HAS_DLL */ + +#if !defined (SIMPLEPROVIDER_EXEC_HAS_DLL) +# define SIMPLEPROVIDER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEPROVIDER_EXEC_HAS_DLL */ + +#if defined (SIMPLEPROVIDER_EXEC_HAS_DLL) && (SIMPLEPROVIDER_EXEC_HAS_DLL == 1) +# if defined (SIMPLEPROVIDER_EXEC_BUILD_DLL) +# define SIMPLEPROVIDER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPROVIDER_EXEC_BUILD_DLL */ +# define SIMPLEPROVIDER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPROVIDER_EXEC_BUILD_DLL */ +#else /* SIMPLEPROVIDER_EXEC_HAS_DLL == 1 */ +# define SIMPLEPROVIDER_EXEC_Export +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEPROVIDER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPROVIDER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEPROVIDER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPROVIDER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPROVIDER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPROVIDER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPROVIDER_EXEC_NTRACE */ + +#if (SIMPLEPROVIDER_EXEC_NTRACE == 1) +# define SIMPLEPROVIDER_EXEC_TRACE(X) +#else /* (SIMPLEPROVIDER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPROVIDER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPROVIDER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEPROVIDER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_stub_export.h new file mode 100644 index 00000000000..795f3fec902 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPROVIDER_STUB +// ------------------------------ +#ifndef SIMPLEPROVIDER_STUB_EXPORT_H +#define SIMPLEPROVIDER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPROVIDER_STUB_HAS_DLL) +# define SIMPLEPROVIDER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPROVIDER_STUB_HAS_DLL */ + +#if !defined (SIMPLEPROVIDER_STUB_HAS_DLL) +# define SIMPLEPROVIDER_STUB_HAS_DLL 1 +#endif /* ! SIMPLEPROVIDER_STUB_HAS_DLL */ + +#if defined (SIMPLEPROVIDER_STUB_HAS_DLL) && (SIMPLEPROVIDER_STUB_HAS_DLL == 1) +# if defined (SIMPLEPROVIDER_STUB_BUILD_DLL) +# define SIMPLEPROVIDER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPROVIDER_STUB_BUILD_DLL */ +# define SIMPLEPROVIDER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPROVIDER_STUB_BUILD_DLL */ +#else /* SIMPLEPROVIDER_STUB_HAS_DLL == 1 */ +# define SIMPLEPROVIDER_STUB_Export +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEPROVIDER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPROVIDER_STUB_HAS_DLL == 1 */ + +// Set SIMPLEPROVIDER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPROVIDER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPROVIDER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPROVIDER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPROVIDER_STUB_NTRACE */ + +#if (SIMPLEPROVIDER_STUB_NTRACE == 1) +# define SIMPLEPROVIDER_STUB_TRACE(X) +#else /* (SIMPLEPROVIDER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPROVIDER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPROVIDER_STUB_NTRACE == 1) */ + +#endif /* SIMPLEPROVIDER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_svnt_export.h new file mode 100644 index 00000000000..5f6be2501b6 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleProvider_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPROVIDER_SVNT +// ------------------------------ +#ifndef SIMPLEPROVIDER_SVNT_EXPORT_H +#define SIMPLEPROVIDER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPROVIDER_SVNT_HAS_DLL) +# define SIMPLEPROVIDER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPROVIDER_SVNT_HAS_DLL */ + +#if !defined (SIMPLEPROVIDER_SVNT_HAS_DLL) +# define SIMPLEPROVIDER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEPROVIDER_SVNT_HAS_DLL */ + +#if defined (SIMPLEPROVIDER_SVNT_HAS_DLL) && (SIMPLEPROVIDER_SVNT_HAS_DLL == 1) +# if defined (SIMPLEPROVIDER_SVNT_BUILD_DLL) +# define SIMPLEPROVIDER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPROVIDER_SVNT_BUILD_DLL */ +# define SIMPLEPROVIDER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPROVIDER_SVNT_BUILD_DLL */ +#else /* SIMPLEPROVIDER_SVNT_HAS_DLL == 1 */ +# define SIMPLEPROVIDER_SVNT_Export +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEPROVIDER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPROVIDER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEPROVIDER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPROVIDER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPROVIDER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPROVIDER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPROVIDER_SVNT_NTRACE */ + +#if (SIMPLEPROVIDER_SVNT_NTRACE == 1) +# define SIMPLEPROVIDER_SVNT_TRACE(X) +#else /* (SIMPLEPROVIDER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPROVIDER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPROVIDER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEPROVIDER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.cidl new file mode 100644 index 00000000000..d5bae5c32ee --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimplePublisher.idl" + +composition session SimplePublisher_Impl +{ + home executor SimplePublisherHome_Exec + { + implements Simple::SimplePublisherHome; + manages SimplePublisher_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.idl b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.idl new file mode 100644 index 00000000000..cee261fd15a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_PUBLISHER_IDL +#define SIMPLE_PUBLISHER_IDL + +#include "SimpleCommon.idl" +#include "Components.idl" + +module Simple +{ + component SimplePublisher + { + publishes Hello hello; + }; + + home SimplePublisherHome manages SimplePublisher + { + }; +}; + +#endif /*SIMPLE_PUBLISHER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.mpc new file mode 100644 index 00000000000..232a4d462be --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimplePublisher" + +project(SimpleCommon_SimplePublisher_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEPUBLISHER_STUB_Export \ + -Wb,stub_export_include=SimplePublisher_stub_export.h \ + -Wb,skel_export_macro=SIMPLEPUBLISHER_SVNT_Export \ + -Wb,skel_export_include=SimplePublisher_svnt_export.h + + IDL_Files { + SimplePublisher.idl + } +} + +project(SimpleCommon_SimplePublisher_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEPUBLISHER_SVNT_Export \ + --svnt-export-include SimplePublisher_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEPUBLISHER_EXEC_Export \ + -Wb,export_include=SimplePublisher_exec_export.h \ + -SS + + CIDL_Files { + SimplePublisher.cidl + } + + IDL_Files { + SimplePublisherE.idl + } +} + +project(SimpleCommon_SimplePublisher_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimplePublisher_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimplePublisher_stub + dynamicflags = SIMPLEPUBLISHER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimplePublisherC.cpp + } + + Header_Files { + SimplePublisherC.h + SimplePublisher_stub_export.h + } + + Inline_Files { + SimplePublisherC.inl + } +} + +project(SimpleCommon_SimplePublisher_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimplePublisher_cidl_gen SimpleCommon_SimplePublisher_stub + sharedname = SimplePublisher_exec + libs += SimplePublisher_stub SimpleCommon_stub + + dynamicflags = SIMPLEPUBLISHER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimplePublisherEC.cpp + SimplePublisher_exec.cpp + } + + Header_Files { + SimplePublisherEC.h + SimplePublisher_exec.h + SimplePublisher_exec_export.h + } + + Inline_Files { + SimplePublisherEC.inl + } +} + + +project(SimpleCommon_SimplePublisher_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimplePublisher_exec + sharedname = SimplePublisher_svnt + libs += SimplePublisher_exec \ + SimplePublisher_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLEPUBLISHER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimplePublisherS.cpp + SimplePublisher_svnt.cpp + } + + Header_Files { + SimplePublisherS.h + SimplePublisher_svnt.h + SimplePublisher_svnt_export.h + } + + Inline_Files { + SimplePublisherS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.cpp new file mode 100644 index 00000000000..d15ab0ce667 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.cpp @@ -0,0 +1,148 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimplePublisher_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimplePublisher_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimplePublisher_exec_i + //================================================================== + + SimplePublisher_exec_i::SimplePublisher_exec_i (void) + { + CIAO_TRACE ("SimplePublisher_exec_i::SimplePublisher_exec_i (void)"); + } + + SimplePublisher_exec_i::~SimplePublisher_exec_i (void) + { + CIAO_TRACE ("SimplePublisher_exec_i::~SimplePublisher_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimplePublisher_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimplePublisher_exec_i::set_session_context ()"); + this->context_ = + ::Simple::CCM_SimplePublisher_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimplePublisher_exec_i::configuration_complete () + { + CIAO_TRACE ("SimplePublisher_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimplePublisher_exec_i::ccm_activate () + { + CIAO_TRACE ("SimplePublisher_exec_i::ccm_activate ()"); + ::Simple::Hello_var hello = new OBV_Simple::Hello ("Test successful, hello from SimplePublisher_exec_i"); + + this->context_->push_hello (hello._retn ()); + // Your code here. + } + + void + SimplePublisher_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimplePublisher_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimplePublisher_exec_i::ccm_remove () + { + CIAO_TRACE ("SimplePublisher_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimplePublisherHome_exec_i + //================================================================== + + SimplePublisherHome_exec_i::SimplePublisherHome_exec_i (void) + { + CIAO_TRACE ("SimplePublisherHome_exec_i::SimplePublisherHome_exec_i (void)"); + } + + SimplePublisherHome_exec_i::~SimplePublisherHome_exec_i (void) + { + CIAO_TRACE ("SimplePublisherHome_exec_i::~SimplePublisherHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimplePublisherHome_exec_i::create () + { + CIAO_TRACE ("SimplePublisherHome_exec_i::create ()"); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimplePublisher_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEPUBLISHER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimplePublisherHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimplePublisherHome_Impl (void)"); + + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimplePublisherHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.h new file mode 100644 index 00000000000..b25191f0a4a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec.h @@ -0,0 +1,98 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEPUBLISHER_EXEC_H +#define CIAO_SIMPLEPUBLISHER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimplePublisherEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimplePublisher_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimplePublisher_Impl +{ + class SIMPLEPUBLISHER_EXEC_Export SimplePublisher_exec_i + : public virtual SimplePublisher_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimplePublisher_exec_i (void); + virtual ~SimplePublisher_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimplePublisher_Context_var context_; + }; + + class SIMPLEPUBLISHER_EXEC_Export SimplePublisherHome_exec_i + : public virtual SimplePublisherHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimplePublisherHome_exec_i (void); + virtual ~SimplePublisherHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLEPUBLISHER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimplePublisherHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEPUBLISHER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec_export.h new file mode 100644 index 00000000000..2f18677399f --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPUBLISHER_EXEC +// ------------------------------ +#ifndef SIMPLEPUBLISHER_EXEC_EXPORT_H +#define SIMPLEPUBLISHER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPUBLISHER_EXEC_HAS_DLL) +# define SIMPLEPUBLISHER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPUBLISHER_EXEC_HAS_DLL */ + +#if !defined (SIMPLEPUBLISHER_EXEC_HAS_DLL) +# define SIMPLEPUBLISHER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEPUBLISHER_EXEC_HAS_DLL */ + +#if defined (SIMPLEPUBLISHER_EXEC_HAS_DLL) && (SIMPLEPUBLISHER_EXEC_HAS_DLL == 1) +# if defined (SIMPLEPUBLISHER_EXEC_BUILD_DLL) +# define SIMPLEPUBLISHER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPUBLISHER_EXEC_BUILD_DLL */ +# define SIMPLEPUBLISHER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPUBLISHER_EXEC_BUILD_DLL */ +#else /* SIMPLEPUBLISHER_EXEC_HAS_DLL == 1 */ +# define SIMPLEPUBLISHER_EXEC_Export +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEPUBLISHER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPUBLISHER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEPUBLISHER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPUBLISHER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPUBLISHER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPUBLISHER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPUBLISHER_EXEC_NTRACE */ + +#if (SIMPLEPUBLISHER_EXEC_NTRACE == 1) +# define SIMPLEPUBLISHER_EXEC_TRACE(X) +#else /* (SIMPLEPUBLISHER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPUBLISHER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPUBLISHER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEPUBLISHER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_stub_export.h new file mode 100644 index 00000000000..8ab3300c5ca --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPUBLISHER_STUB +// ------------------------------ +#ifndef SIMPLEPUBLISHER_STUB_EXPORT_H +#define SIMPLEPUBLISHER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPUBLISHER_STUB_HAS_DLL) +# define SIMPLEPUBLISHER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPUBLISHER_STUB_HAS_DLL */ + +#if !defined (SIMPLEPUBLISHER_STUB_HAS_DLL) +# define SIMPLEPUBLISHER_STUB_HAS_DLL 1 +#endif /* ! SIMPLEPUBLISHER_STUB_HAS_DLL */ + +#if defined (SIMPLEPUBLISHER_STUB_HAS_DLL) && (SIMPLEPUBLISHER_STUB_HAS_DLL == 1) +# if defined (SIMPLEPUBLISHER_STUB_BUILD_DLL) +# define SIMPLEPUBLISHER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPUBLISHER_STUB_BUILD_DLL */ +# define SIMPLEPUBLISHER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPUBLISHER_STUB_BUILD_DLL */ +#else /* SIMPLEPUBLISHER_STUB_HAS_DLL == 1 */ +# define SIMPLEPUBLISHER_STUB_Export +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEPUBLISHER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPUBLISHER_STUB_HAS_DLL == 1 */ + +// Set SIMPLEPUBLISHER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPUBLISHER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPUBLISHER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPUBLISHER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPUBLISHER_STUB_NTRACE */ + +#if (SIMPLEPUBLISHER_STUB_NTRACE == 1) +# define SIMPLEPUBLISHER_STUB_TRACE(X) +#else /* (SIMPLEPUBLISHER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPUBLISHER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPUBLISHER_STUB_NTRACE == 1) */ + +#endif /* SIMPLEPUBLISHER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_svnt_export.h new file mode 100644 index 00000000000..cbc5f4e56be --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimplePublisher_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEPUBLISHER_SVNT +// ------------------------------ +#ifndef SIMPLEPUBLISHER_SVNT_EXPORT_H +#define SIMPLEPUBLISHER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEPUBLISHER_SVNT_HAS_DLL) +# define SIMPLEPUBLISHER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEPUBLISHER_SVNT_HAS_DLL */ + +#if !defined (SIMPLEPUBLISHER_SVNT_HAS_DLL) +# define SIMPLEPUBLISHER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEPUBLISHER_SVNT_HAS_DLL */ + +#if defined (SIMPLEPUBLISHER_SVNT_HAS_DLL) && (SIMPLEPUBLISHER_SVNT_HAS_DLL == 1) +# if defined (SIMPLEPUBLISHER_SVNT_BUILD_DLL) +# define SIMPLEPUBLISHER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEPUBLISHER_SVNT_BUILD_DLL */ +# define SIMPLEPUBLISHER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEPUBLISHER_SVNT_BUILD_DLL */ +#else /* SIMPLEPUBLISHER_SVNT_HAS_DLL == 1 */ +# define SIMPLEPUBLISHER_SVNT_Export +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEPUBLISHER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEPUBLISHER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEPUBLISHER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEPUBLISHER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEPUBLISHER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEPUBLISHER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEPUBLISHER_SVNT_NTRACE */ + +#if (SIMPLEPUBLISHER_SVNT_NTRACE == 1) +# define SIMPLEPUBLISHER_SVNT_TRACE(X) +#else /* (SIMPLEPUBLISHER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEPUBLISHER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEPUBLISHER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEPUBLISHER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.cidl b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.cidl new file mode 100644 index 00000000000..e3afe5e12f6 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleUser.idl" + +composition session SimpleUser_Impl +{ + home executor SimpleUserHome_Exec + { + implements Simple::SimpleUserHome; + manages SimpleUser_Exec; + }; +}; diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.idl b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.idl new file mode 100644 index 00000000000..90d4e67e542 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.idl @@ -0,0 +1,21 @@ +// $Id$ + +#ifndef SIMPLE_USER_IDL +#define SIMPLE_USER_IDL + +#include "SimpleCommon.idl" +#include "Components.idl" + +module Simple +{ + component SimpleUser + { + uses Trigger trig; + }; + + home SimpleUserHome manages SimpleUser + { + }; +}; + +#endif /*SIMPLE_USER_IDL*/ diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.mpc b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.mpc new file mode 100644 index 00000000000..c33c4120a77 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p SimpleCommon SimpleUser" + +project(SimpleCommon_SimpleUser_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLEUSER_STUB_Export \ + -Wb,stub_export_include=SimpleUser_stub_export.h \ + -Wb,skel_export_macro=SIMPLEUSER_SVNT_Export \ + -Wb,skel_export_include=SimpleUser_svnt_export.h + + IDL_Files { + SimpleUser.idl + } +} + +project(SimpleCommon_SimpleUser_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLEUSER_SVNT_Export \ + --svnt-export-include SimpleUser_svnt_export.h + idlflags += -Wb,export_macro=SIMPLEUSER_EXEC_Export \ + -Wb,export_include=SimpleUser_exec_export.h \ + -SS + + CIDL_Files { + SimpleUser.cidl + } + + IDL_Files { + SimpleUserE.idl + } +} + +project(SimpleCommon_SimpleUser_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleCommon_SimpleUser_idl_gen SimpleCommon_stub + libs += SimpleCommon_stub + + sharedname = SimpleUser_stub + dynamicflags = SIMPLEUSER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleUserC.cpp + } + + Header_Files { + SimpleUserC.h + SimpleUser_stub_export.h + } + + Inline_Files { + SimpleUserC.inl + } +} + +project(SimpleCommon_SimpleUser_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleCommon_SimpleUser_cidl_gen SimpleCommon_SimpleUser_stub + sharedname = SimpleUser_exec + libs += SimpleUser_stub SimpleCommon_stub + + dynamicflags = SIMPLEUSER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleUserEC.cpp + SimpleUser_exec.cpp + } + + Header_Files { + SimpleUserEC.h + SimpleUser_exec.h + SimpleUser_exec_export.h + } + + Inline_Files { + SimpleUserEC.inl + } +} + + +project(SimpleCommon_SimpleUser_svnt) : ciao_servant { + avoids += ace_for_tao + after += SimpleCommon_skel SimpleCommon_SimpleUser_exec + sharedname = SimpleUser_svnt + libs += SimpleUser_exec \ + SimpleUser_stub \ + SimpleCommon_skel \ + SimpleCommon_stub + + dynamicflags = SIMPLEUSER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + SimpleUserS.cpp + SimpleUser_svnt.cpp + } + + Header_Files { + SimpleUserS.h + SimpleUser_svnt.h + SimpleUser_svnt_export.h + } + + Inline_Files { + SimpleUserS.inl + } +} + + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp new file mode 100644 index 00000000000..accb8f8f949 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.cpp @@ -0,0 +1,169 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleUser_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleUser_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleUser_exec_i + //================================================================== + + SimpleUser_exec_i::SimpleUser_exec_i (void) + { + CIAO_TRACE ("SimpleUser_exec_i::SimpleUser_exec_i (void)"); + } + + SimpleUser_exec_i::~SimpleUser_exec_i (void) + { + CIAO_TRACE ("SimpleUser_exec_i::~SimpleUser_exec_i (void)"); + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleUser_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + CIAO_TRACE ("SimpleUser_exec_i::set_session_context ()"); + this->context_ = + ::Simple::CCM_SimpleUser_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleUser_exec_i::configuration_complete () + { + CIAO_TRACE ("SimpleUser_exec_i::configuration_complete ()"); + // Your code here. + } + + void + SimpleUser_exec_i::ccm_activate () + { + CIAO_TRACE ("SimpleUser_exec_i::ccm_activate ()"); + + ::Simple::Trigger_var trig (this->context_->get_connection_trig ()); + + if (CORBA::is_nil (trig.in ())) + { + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " + "Error: Reference nil for port trig\n")); + return; + } + + // Your code here. + try + { + trig->hello ("Test successful; hello from SimpleUser."); + } + catch (CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " + "Caught CORBA exception, details follow:\n")); + ex._tao_print_exception ("SimpleUser_exec_i::ccm_activate () - "); + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, "SimpleUser_exec_i::ccm_activate () - " + "Error: Caught unknown exception whilst invoking reference for port trig.\n")); + } + } + + void + SimpleUser_exec_i::ccm_passivate () + { + CIAO_TRACE ("SimpleUser_exec_i::ccm_passivate ()"); + // Your code here. + } + + void + SimpleUser_exec_i::ccm_remove () + { + CIAO_TRACE ("SimpleUser_exec_i::ccm_remove ()"); + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleUserHome_exec_i + //================================================================== + + SimpleUserHome_exec_i::SimpleUserHome_exec_i (void) + { + CIAO_TRACE ("SimpleUserHome_exec_i::SimpleUserHome_exec_i (void)"); + } + + SimpleUserHome_exec_i::~SimpleUserHome_exec_i (void) + { + CIAO_TRACE ("SimpleUserHome_exec_i::~SimpleUserHome_exec_i (void)"); + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleUserHome_exec_i::create () + { + CIAO_TRACE ("SimpleUserHome_exec_i::create ()"); + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleUser_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLEUSER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleUserHome_Impl (void) + { + CIAO_TRACE ("create_Simple_SimpleUserHome_Impl (void)"); + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleUserHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.h new file mode 100644 index 00000000000..9b28f1e36f2 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec.h @@ -0,0 +1,98 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLEUSER_EXEC_H +#define CIAO_SIMPLEUSER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleUserEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleUser_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleUser_Impl +{ + class SIMPLEUSER_EXEC_Export SimpleUser_exec_i + : public virtual SimpleUser_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleUser_exec_i (void); + virtual ~SimpleUser_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Simple::CCM_SimpleUser_Context_var context_; + }; + + class SIMPLEUSER_EXEC_Export SimpleUserHome_exec_i + : public virtual SimpleUserHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleUserHome_exec_i (void); + virtual ~SimpleUserHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLEUSER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Simple_SimpleUserHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLEUSER_EXEC_H */ + diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec_export.h new file mode 100644 index 00000000000..fcc935919a3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEUSER_EXEC +// ------------------------------ +#ifndef SIMPLEUSER_EXEC_EXPORT_H +#define SIMPLEUSER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEUSER_EXEC_HAS_DLL) +# define SIMPLEUSER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEUSER_EXEC_HAS_DLL */ + +#if !defined (SIMPLEUSER_EXEC_HAS_DLL) +# define SIMPLEUSER_EXEC_HAS_DLL 1 +#endif /* ! SIMPLEUSER_EXEC_HAS_DLL */ + +#if defined (SIMPLEUSER_EXEC_HAS_DLL) && (SIMPLEUSER_EXEC_HAS_DLL == 1) +# if defined (SIMPLEUSER_EXEC_BUILD_DLL) +# define SIMPLEUSER_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLEUSER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEUSER_EXEC_BUILD_DLL */ +# define SIMPLEUSER_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLEUSER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEUSER_EXEC_BUILD_DLL */ +#else /* SIMPLEUSER_EXEC_HAS_DLL == 1 */ +# define SIMPLEUSER_EXEC_Export +# define SIMPLEUSER_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLEUSER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEUSER_EXEC_HAS_DLL == 1 */ + +// Set SIMPLEUSER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEUSER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEUSER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEUSER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEUSER_EXEC_NTRACE */ + +#if (SIMPLEUSER_EXEC_NTRACE == 1) +# define SIMPLEUSER_EXEC_TRACE(X) +#else /* (SIMPLEUSER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEUSER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEUSER_EXEC_NTRACE == 1) */ + +#endif /* SIMPLEUSER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_stub_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_stub_export.h new file mode 100644 index 00000000000..a31d19d5614 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEUSER_STUB +// ------------------------------ +#ifndef SIMPLEUSER_STUB_EXPORT_H +#define SIMPLEUSER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEUSER_STUB_HAS_DLL) +# define SIMPLEUSER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEUSER_STUB_HAS_DLL */ + +#if !defined (SIMPLEUSER_STUB_HAS_DLL) +# define SIMPLEUSER_STUB_HAS_DLL 1 +#endif /* ! SIMPLEUSER_STUB_HAS_DLL */ + +#if defined (SIMPLEUSER_STUB_HAS_DLL) && (SIMPLEUSER_STUB_HAS_DLL == 1) +# if defined (SIMPLEUSER_STUB_BUILD_DLL) +# define SIMPLEUSER_STUB_Export ACE_Proper_Export_Flag +# define SIMPLEUSER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEUSER_STUB_BUILD_DLL */ +# define SIMPLEUSER_STUB_Export ACE_Proper_Import_Flag +# define SIMPLEUSER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEUSER_STUB_BUILD_DLL */ +#else /* SIMPLEUSER_STUB_HAS_DLL == 1 */ +# define SIMPLEUSER_STUB_Export +# define SIMPLEUSER_STUB_SINGLETON_DECLARATION(T) +# define SIMPLEUSER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEUSER_STUB_HAS_DLL == 1 */ + +// Set SIMPLEUSER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEUSER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEUSER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEUSER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEUSER_STUB_NTRACE */ + +#if (SIMPLEUSER_STUB_NTRACE == 1) +# define SIMPLEUSER_STUB_TRACE(X) +#else /* (SIMPLEUSER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEUSER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEUSER_STUB_NTRACE == 1) */ + +#endif /* SIMPLEUSER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_svnt_export.h b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_svnt_export.h new file mode 100644 index 00000000000..897f82c3081 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/Components/SimpleUser_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLEUSER_SVNT +// ------------------------------ +#ifndef SIMPLEUSER_SVNT_EXPORT_H +#define SIMPLEUSER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLEUSER_SVNT_HAS_DLL) +# define SIMPLEUSER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLEUSER_SVNT_HAS_DLL */ + +#if !defined (SIMPLEUSER_SVNT_HAS_DLL) +# define SIMPLEUSER_SVNT_HAS_DLL 1 +#endif /* ! SIMPLEUSER_SVNT_HAS_DLL */ + +#if defined (SIMPLEUSER_SVNT_HAS_DLL) && (SIMPLEUSER_SVNT_HAS_DLL == 1) +# if defined (SIMPLEUSER_SVNT_BUILD_DLL) +# define SIMPLEUSER_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLEUSER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLEUSER_SVNT_BUILD_DLL */ +# define SIMPLEUSER_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLEUSER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLEUSER_SVNT_BUILD_DLL */ +#else /* SIMPLEUSER_SVNT_HAS_DLL == 1 */ +# define SIMPLEUSER_SVNT_Export +# define SIMPLEUSER_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLEUSER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLEUSER_SVNT_HAS_DLL == 1 */ + +// Set SIMPLEUSER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLEUSER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLEUSER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLEUSER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLEUSER_SVNT_NTRACE */ + +#if (SIMPLEUSER_SVNT_NTRACE == 1) +# define SIMPLEUSER_SVNT_TRACE(X) +#else /* (SIMPLEUSER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLEUSER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLEUSER_SVNT_NTRACE == 1) */ + +#endif /* SIMPLEUSER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp new file mode 100644 index 00000000000..01c13b3f3d1 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp @@ -0,0 +1,227 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleEmitterHomeImplementation"> + <name>SimpleEmitterHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleEmitterComponentImplementation"> + <name>SimpleEmitterComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleEmitterHomeInstance"> + <name>SimpleEmitterHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleEmitterComponentInstance"> + <name>SimpleEmitterComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitterHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>hello</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance xmi:idref="SimpleEmitterComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleEmitter_ExecArtifact"> + <name>SimpleEmitter_exec</name> + <source/> + <node/> + <location>SimpleEmitter_exec</location> + </artifact> + <artifact xmi:id="SimpleEmitter_SvntArtifact"> + <name>SimpleEmitter_svnt</name> + <source/> + <node/> + <location>SimpleEmitter_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp new file mode 100644 index 00000000000..6c01f6d36d6 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp @@ -0,0 +1,238 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleEmitterHomeImplementation"> + <name>SimpleEmitterHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleEmitterComponentImplementation"> + <name>SimpleEmitterComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleEmitterHomeInstance"> + <name>SimpleEmitterHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleEmitterComponentInstance"> + <name>SimpleEmitterComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitterHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitterComponent</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + <externalReference> + <location>corbaname:rir:/NameService#SimpleEmitterComponent</location> + <provider>false</provider> + <portName>hello</portName> + <supportedType>Meaningless</supportedType> + </externalReference> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleEmitter_ExecArtifact"> + <name>SimpleEmitter_exec</name> + <source/> + <node/> + <location>SimpleEmitter_exec</location> + </artifact> + <artifact xmi:id="SimpleEmitter_SvntArtifact"> + <name>SimpleEmitter_svnt</name> + <source/> + <node/> + <location>SimpleEmitter_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome.cdp new file mode 100644 index 00000000000..c5bc81c852a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome.cdp @@ -0,0 +1,262 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleMultipleUserHomeImplementation"> + <name>SimpleMultipleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleMultipleUserComponentImplementation"> + <name>SimpleMultipleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserHomeInstance"> + <name>SimpleMultipleUserHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstance"> + <name>SimpleMultipleUserComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstanceReverse"> + <name>SimpleMultipleUserComponentReverse</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstanceReverse" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleMultipleUser_ExecArtifact"> + <name>SimpleMultipleUser_exec</name> + <source/> + <node/> + <location>SimpleMultipleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleMultipleUser_SvntArtifact"> + <name>SimpleMultipleUser_svnt</name> + <source/> + <node/> + <location>SimpleMultipleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome_NS.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome_NS.cdp new file mode 100644 index 00000000000..dc865e8d0a3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/MultiplexConnectionExplicitHome_NS.cdp @@ -0,0 +1,286 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleMultipleUserHomeImplementation"> + <name>SimpleMultipleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleMultipleUserComponentImplementation"> + <name>SimpleMultipleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserHomeInstance"> + <name>SimpleMultipleUserHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstance"> + <name>SimpleMultipleUserComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserComponent</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstanceReverse"> + <name>SimpleMultipleUserComponentReverse</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <externalReference> + <location>corbaname:rir:/NameService#SimpleMultipleUserComponent</location> + <provider>false</provider> + <portName>trig</portName> + <supportedType>Meaningless</supportedType> + </externalReference> +<!-- <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstance" /> + </internalEndpoint> --> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <externalReference> + <location>corbaname:rir:/NameService#SimpleMultipleUserComponent</location> + <provider>false</provider> + <portName>trig</portName> + <supportedType>Meaningless</supportedType> + </externalReference> +<!-- + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstanceReverse" /> + </internalEndpoint> --> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleMultipleUser_ExecArtifact"> + <name>SimpleMultipleUser_exec</name> + <source/> + <node/> + <location>SimpleMultipleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleMultipleUser_SvntArtifact"> + <name>SimpleMultipleUser_svnt</name> + <source/> + <node/> + <location>SimpleMultipleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp new file mode 100644 index 00000000000..32747bfc1bf --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp @@ -0,0 +1,227 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimplePublisherHomeImplementation"> + <name>SimplePublisherHomeImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimplePublisherComponentImplementation"> + <name>SimplePublisherComponentImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimplePublisherHomeInstance"> + <name>SimplePublisherHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherHomeImplementation" /> + </instance> + + <instance xmi:id="SimplePublisherComponentInstance"> + <name>SimplePublisherComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisherHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>hello</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="SimplePublisherComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimplePublisher_ExecArtifact"> + <name>SimplePublisher_exec</name> + <source/> + <node/> + <location>SimplePublisher_exec</location> + </artifact> + <artifact xmi:id="SimplePublisher_SvntArtifact"> + <name>SimplePublisher_svnt</name> + <source/> + <node/> + <location>SimplePublisher_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp new file mode 100644 index 00000000000..054e7964bea --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp @@ -0,0 +1,244 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimplePublisherHomeImplementation"> + <name>SimplePublisherHomeImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimplePublisherComponentImplementation"> + <name>SimplePublisherComponentImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimplePublisherHomeInstance"> + <name>SimplePublisherHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherHomeImplementation" /> + </instance> + + <instance xmi:id="SimplePublisherComponentInstance"> + <name>SimplePublisherComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisherHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisherComponentInstance</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <!--<internalEndpoint> + <portName>hello</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="SimplePublisherComponentInstance" /> + </internalEndpoint>--> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + <externalReference> + <location>corbaname:rir:/NameService#SimplePublisherComponentInstance</location> + <provider>false</provider> + <portName>hello</portName> + <supportedType>Meaningless</supportedType> + </externalReference> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimplePublisher_ExecArtifact"> + <name>SimplePublisher_exec</name> + <source/> + <node/> + <location>SimplePublisher_exec</location> + </artifact> + <artifact xmi:id="SimplePublisher_SvntArtifact"> + <name>SimplePublisher_svnt</name> + <source/> + <node/> + <location>SimplePublisher_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp new file mode 100644 index 00000000000..e9af75b1ac4 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimpleComponentExplicitHome.cdp @@ -0,0 +1,113 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation xmi:id="SimpleNullHomeImplementation"> + <name>SimpleNullHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleNullComponentImplementation"> + <name>SimpleNullComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleNullHomeInstance"> + <name>SimpleNullHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleNullComponentInstance"> + <name>SimpleNullComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNullHome</string> + </value> + </value> + </configProperty> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleNull_ExecArtifact"> + <name>SimpleNull_exec</name> + <source/> + <node/> + <location>SimpleNull_exec</location> + </artifact> + <artifact xmi:id="SimpleNull_SvntArtifact"> + <name>SimpleNull_svnt</name> + <source/> + <node/> + <location>SimpleNull_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome.cdp new file mode 100644 index 00000000000..8283e9e869a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome.cdp @@ -0,0 +1,262 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleUserHomeImplementation"> + <name>SimpleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleUserComponentImplementation"> + <name>SimpleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserHomeInstance"> + <name>SimpleUserHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleUserComponentInstance"> + <name>SimpleUserComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserComponentInstanceReverse"> + <name>SimpleUserComponentReverse</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstanceReverse" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleUser_ExecArtifact"> + <name>SimpleUser_exec</name> + <source/> + <node/> + <location>SimpleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleUser_SvntArtifact"> + <name>SimpleUser_svnt</name> + <source/> + <node/> + <location>SimpleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome_NS.cdp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome_NS.cdp new file mode 100644 index 00000000000..c60ad818d6f --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/SimplexConnectionExplicitHome_NS.cdp @@ -0,0 +1,279 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleUserHomeImplementation"> + <name>SimpleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleUserComponentImplementation"> + <name>SimpleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserHomeInstance"> + <name>SimpleUserHome</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleUserComponentInstance"> + <name>SimpleUserComponent</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserComponent</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserComponentInstanceReverse"> + <name>SimpleUserComponentReverse</name> + <node>NodeTwo</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> +<!-- <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstance" /> + </internalEndpoint>--> + <externalReference> + <location>corbaname:rir:/NameService#SimpleUserComponent</location> + <provider>false</provider> + <portName>trig</portName> + <supportedType>Meaningless</supportedType> + </externalReference> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstanceReverse" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleUser_ExecArtifact"> + <name>SimpleUser_exec</name> + <source/> + <node/> + <location>SimpleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleUser_SvntArtifact"> + <name>SimpleUser_svnt</name> + <source/> + <node/> + <location>SimpleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc new file mode 100644 index 00000000000..bfe2a2d6dba --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/em_launcher.mpc @@ -0,0 +1,5 @@ +project(simple_em_launcher) : ciao_config_handlers, dance_nodemanager_stub, ciao_logger { + Source_Files { + simple_em_launcher.cpp + } +}
\ No newline at end of file diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl new file mode 100755 index 00000000000..b738049952b --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl @@ -0,0 +1,173 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; +$daemons = 2; +@ports = ( 60001, 60002 ); +@iorfiles = ( "NodeApp1.ior", "NodeApp2.ior" ); +@nodenames = ( "NodeOne", "NodeTwo" ); +$status = 0; +$dat_file = "NodeManagerMap.dat"; +$controller_exec = "$CIAO_ROOT/examples/Hello/Sender/starter"; + +$nsior = PerlACE::LocalFile ("ns.ior"); + +$E = 0; +$EM = 0; +$retval = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } + unlink PerlACE::LocalFile ("EM.ior"); + unlink PerlACE::LocalFile ("Receiver.ior"); + unlink PerlACE::LocalFile ("Sender.ior"); + unlink PerlACE::LocalFile ("DAM.ior"); + unlink PerlACE::LocalFile ("ns.ior"); +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } + + if ($em_running == 1) { + $EM->Kill (); + $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); + $NS->TimedWait (1); + } + +} + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; + + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService --instance-nc corbaloc:rir:/NameService"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + 30) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +if ($#ARGV == -1) +{ + opendir(DIR, "."); + @files = grep(/\.cdp$/,readdir(DIR)); + closedir(DIR); +} else { + @files = @ARGV; +} + +foreach $file (@files) { + print "Starting test for deployment $file\n"; + delete_ior_files (); + + print STDERR "Starting Naming Service\n"; + + $NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); + $NS->Spawn (); + + if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1) + { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; + } + $ns_running = 1; + +# Set up NamingService environment + $ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + + +# Invoke node daemons. + print "Invoking node daemons\n"; + $status = run_node_daemons (); + + if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemons\n"; + kill_open_processes (); + exit 1; + } + + $daemons_running = 1; + + # Invoke execution manager. + print "Invoking execution manager\n"; + $EM = new PerlACE::Process ("$DAnCE/bin/dance_execution_manager", + "-eEM.ior --domain-nc corbaloc:rir:/NameService"); + $EM->Spawn (); + + if (PerlACE::waitforfile_timed ("EM.ior", + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; + } + + $em_running = 1; + + # Invoke executor - start the application -. + print "Invoking executor - start the application -\n"; + $E = new PerlACE::Process ("simple_em_launcher", + "file://EM.ior $file"); + + $status = $E->SpawnWaitKill (5000); + + if ($status != 0) + { + print "ERROR: simple_em_launcher returned an error code while deploying $file\n"; + $retval = -1; + } + + delete_ior_files (); + kill_open_processes (); +} + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp new file mode 100644 index 00000000000..be325f6d09a --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/simple_em_launcher.cpp @@ -0,0 +1,128 @@ +/** + * @file simple_em_launcher.cpp + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Launches then immediately tears down a plan. + */ + +#include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" +#include "tao/ORB.h" +#include "ciao/Logger/Logger_Service.h" +#include "ciao/Logger/Log_Macros.h" +#include "Deployment/Deployment_DomainApplicationC.h" +#include "Deployment/Deployment_ExecutionManagerC.h" +#include "Deployment/Deployment_DeploymentPlanC.h" +#include "tools/Config_Handlers/XML_File_Intf.h" + +int usage () +{ + ACE_ERROR ((LM_ERROR, "simple_nm_launcher <nm_url> <plan>\n")); + return -1; +} + +#include <iostream> + +int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + CIAO_DISABLE_TRACE (); + + auto_ptr<CIAO::Logger_Service> logger; + + CIAO::Logger_Service + * dlf = ACE_Dynamic_Service<CIAO::Logger_Service>::instance ("CIAO_Logger_Backend_Factory"); + + if (!dlf) + dlf = new CIAO::Logger_Service; + + logger.reset (dlf); + logger->init (argc, argv); + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (argc != 3) + return usage (); + + try + { + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: parsing XML\n")); + // Parse plan + CIAO::Config_Handlers::XML_File_Intf xml (argv[2]); + xml.add_search_path ("CIAO_ROOT", "/docs/schema/"); + + auto_ptr< ::Deployment::DeploymentPlan> plan (xml.release_plan ()); + + if (plan.get () == 0) + { + ACE_ERROR ((LM_ERROR, "*** error parsing XML document\n")); + throw 1; + } + + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: resoling execution manager reference.\n")); + CORBA::Object_var obj = orb->string_to_object (argv[1]); + Deployment::ExecutionManager_var em = Deployment::ExecutionManager::_narrow (obj.in ()); + + if (CORBA::is_nil (em.in ())) + { + ACE_ERROR ((LM_ERROR, "*** simple_em_launcher: ExecutionManager reference is nil.")); + throw 1; + } + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: calling prepareplan.\n")); + Deployment::DomainApplicationManager_var dam = em->preparePlan (*plan, + Deployment::ResourceCommitmentManager::_nil ()); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: calling startLaunch\n")); + Deployment::Connections_var conns; + Deployment::Properties props; + Deployment::Application_var app = dam->startLaunch (props, conns.out ()); + Deployment::DomainApplication_var da = Deployment::DomainApplication::_narrow (app.in ()); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: calling finishLaunch\n")); + da->finishLaunch (conns.in (), false); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: calling start\n")); + da->start (); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: start finished, sleeping 5 seconds.\n")); + ACE_OS::sleep (5); + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: waking up from sleep, calling destroyApplication\n")); + + dam->destroyApplication (da.in ()); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: calling destroyManager\n")); + + em->destroyManager (dam.in ()); + + ACE_DEBUG ((LM_INFO, "*** simple_em_launcher: destroyManager completed.\n")); + + orb->destroy (); + } + catch (const Deployment::StopError &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught StopError exception with name %s and reason %s\n", + ex.name.in (), ex.reason.in ())); + return -1; + } + catch (const Deployment::StartError &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught StartError exception with name %s and reason %s\n", + ex.name.in (), ex.reason.in ())); + return -1; + } + catch (const CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught CORBA exception: %s\n", + ex._info ().c_str ())); + return -1; + + } + catch (...) + { + orb->destroy (); + ACE_ERROR ((LM_ERROR, "*** Caugn unknown exception\n")); + return -1; + } + return 0; +} diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/EmitsConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/EmitsConnectionExplicitHome.cdp new file mode 100644 index 00000000000..6ac17b1e9e9 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/EmitsConnectionExplicitHome.cdp @@ -0,0 +1,227 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleEmitterHomeImplementation"> + <name>SimpleEmitterHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleEmitterHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitter_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleEmitterComponentImplementation"> + <name>SimpleEmitterComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleEmitter_ExecArtifact" /> + <artifact xmi:idref="SimpleEmitter_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleEmitterHomeInstance"> + <name>SimpleEmitterHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleEmitterComponentInstance"> + <name>SimpleEmitterComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleEmitterComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleEmitterHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>hello</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance xmi:idref="SimpleEmitterComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleEmitter_ExecArtifact"> + <name>SimpleEmitter_exec</name> + <source/> + <node/> + <location>SimpleEmitter_exec</location> + </artifact> + <artifact xmi:id="SimpleEmitter_SvntArtifact"> + <name>SimpleEmitter_svnt</name> + <source/> + <node/> + <location>SimpleEmitter_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/MultiplexConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/MultiplexConnectionExplicitHome.cdp new file mode 100644 index 00000000000..45ff31929c3 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/MultiplexConnectionExplicitHome.cdp @@ -0,0 +1,262 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleMultipleUserHomeImplementation"> + <name>SimpleMultipleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleMultipleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleMultipleUserComponentImplementation"> + <name>SimpleMultipleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleMultipleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleMultipleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserHomeInstance"> + <name>SimpleMultipleUserHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstance"> + <name>SimpleMultipleUserComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleMultipleUserComponentInstanceReverse"> + <name>SimpleMultipleUserComponentReverse</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleMultipleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleMultipleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>MultiplexReceptacle</kind> + <instance xmi:idref="SimpleMultipleUserComponentInstanceReverse" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleMultipleUser_ExecArtifact"> + <name>SimpleMultipleUser_exec</name> + <source/> + <node/> + <location>SimpleMultipleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleMultipleUser_SvntArtifact"> + <name>SimpleMultipleUser_svnt</name> + <source/> + <node/> + <location>SimpleMultipleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/PublishConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/PublishConnectionExplicitHome.cdp new file mode 100644 index 00000000000..53a0a54482d --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/PublishConnectionExplicitHome.cdp @@ -0,0 +1,227 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimplePublisherHomeImplementation"> + <name>SimplePublisherHomeImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimplePublisherHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisher_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimplePublisherComponentImplementation"> + <name>SimplePublisherComponentImplementation</name> + <source/> + <artifact xmi:idref="SimplePublisher_ExecArtifact" /> + <artifact xmi:idref="SimplePublisher_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleConsumerHomeImplementation"> + <name>SimpleConsumerHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleConsumerHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumer_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleConsumerComponentImplementation"> + <name>SimpleConsumerComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleConsumer_ExecArtifact" /> + <artifact xmi:idref="SimpleConsumer_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimplePublisherHomeInstance"> + <name>SimplePublisherHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherHomeImplementation" /> + </instance> + + <instance xmi:id="SimplePublisherComponentInstance"> + <name>SimplePublisherComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimplePublisherComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimplePublisherHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleConsumerHomeInstance"> + <name>SimpleConsumerHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleConsumerComponentInstance"> + <name>SimpleConsumerComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleConsumerComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleConsumerHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>hello</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="SimplePublisherComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>hello_</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="SimpleConsumerComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimplePublisher_ExecArtifact"> + <name>SimplePublisher_exec</name> + <source/> + <node/> + <location>SimplePublisher_exec</location> + </artifact> + <artifact xmi:id="SimplePublisher_SvntArtifact"> + <name>SimplePublisher_svnt</name> + <source/> + <node/> + <location>SimplePublisher_svnt</location> + </artifact> + + <artifact xmi:id="SimpleConsumer_ExecArtifact"> + <name>SimpleConsumer_exec</name> + <source/> + <node/> + <location>SimpleConsumer_exec</location> + </artifact> + <artifact xmi:id="SimpleConsumer_SvntArtifact"> + <name>SimpleConsumer_svnt</name> + <source/> + <node/> + <location>SimpleConsumer_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleAttributeExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleAttributeExplicitHome.cdp new file mode 100644 index 00000000000..d66eef2c70b --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleAttributeExplicitHome.cdp @@ -0,0 +1,179 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation xmi:id="SimpleAttributeHomeImplementation"> + <name>SimpleAttributeHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleAttribute_ExecArtifact" /> + <artifact xmi:idref="SimpleAttribute_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleAttributeHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleAttributeHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleAttribute_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleAttribute_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleAttributeComponentImplementation"> + <name>SimpleAttributeComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleAttribute_ExecArtifact" /> + <artifact xmi:idref="SimpleAttribute_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleAttributeHomeInstance"> + <name>SimpleAttributeHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleAttributeHomeImplementation" /> + <configProperty> + <name>str_attr</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Initialized Attribute!</string> + </value> + </value> + </configProperty> + <configProperty> + <name>long_attr</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1</long> + </value> + </value> + </configProperty> + <configProperty> + <name>short_attr</name> + <value> + <type> + <kind>tk_short</kind> + </type> + <value> + <short>1</short> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleAttributeComponentInstance"> + <name>SimpleAttributeComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleAttributeComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleAttributeHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>str_attr</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Initialized Attribute!</string> + </value> + </value> + </configProperty> + <configProperty> + <name>long_attr</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>1</long> + </value> + </value> + </configProperty> + <configProperty> + <name>short_attr</name> + <value> + <type> + <kind>tk_short</kind> + </type> + <value> + <short>1</short> + </value> + </value> + </configProperty> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleAttribute_ExecArtifact"> + <name>SimpleAttribute_exec</name> + <source/> + <node/> + <location>SimpleAttribute_exec</location> + </artifact> + <artifact xmi:id="SimpleAttribute_SvntArtifact"> + <name>SimpleAttribute_svnt</name> + <source/> + <node/> + <location>SimpleAttribute_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp new file mode 100644 index 00000000000..5632d219c48 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentExplicitHome.cdp @@ -0,0 +1,113 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation xmi:id="SimpleNullHomeImplementation"> + <name>SimpleNullHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleNullComponentImplementation"> + <name>SimpleNullComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleNullHomeInstance"> + <name>SimpleNullHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleNullComponentInstance"> + <name>SimpleNullComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNullHome</string> + </value> + </value> + </configProperty> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleNull_ExecArtifact"> + <name>SimpleNull_exec</name> + <source/> + <node/> + <location>SimpleNull_exec</location> + </artifact> + <artifact xmi:id="SimpleNull_SvntArtifact"> + <name>SimpleNull_svnt</name> + <source/> + <node/> + <location>SimpleNull_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentUnhomed.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentUnhomed.cdp new file mode 100644 index 00000000000..e31930188d2 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleComponentUnhomed.cdp @@ -0,0 +1,86 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <implementation xmi:id="SimpleNullComponentImplementation"> + <name>SimpleNullComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNull_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNull_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="SimpleNullComponentInstance"> + <name>SimpleNullComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullComponentImplementation" /> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleNull_ExecArtifact"> + <name>SimpleNull_exec</name> + <source/> + <node/> + <location>SimpleNull_exec</location> + </artifact> + <artifact xmi:id="SimpleNull_SvntArtifact"> + <name>SimpleNull_svnt</name> + <source/> + <node/> + <location>SimpleNull_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleHome.cdp new file mode 100644 index 00000000000..a63da21f0f6 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleHome.cdp @@ -0,0 +1,90 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation xmi:id="SimpleNullHomeImplementation"> + <name>SimpleNullHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleNull_ExecArtifact" /> + <artifact xmi:idref="SimpleNull_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleNullHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleNull_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance xmi:id="SimpleNullHomeInstance"> + <name>SimpleNullHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleNullHomeImplementation" /> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleNull_ExecArtifact"> + <name>SimpleNull_exec</name> + <source/> + <node/> + <location>SimpleNull_exec</location> + </artifact> + <artifact xmi:id="SimpleNull_SvntArtifact"> + <name>SimpleNull_svnt</name> + <source/> + <node/> + <location>SimpleNull_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp new file mode 100644 index 00000000000..f3f1e1ca6e9 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimplexConnectionExplicitHome.cdp @@ -0,0 +1,262 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>SimpleComponent_Home</label> + <UUID>SimpleComponent_Home</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + <implementation xmi:id="SimpleProviderHomeImplementation"> + <name>SimpleProviderHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleProviderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProvider_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleProviderComponentImplementation"> + <name>SimpleProviderComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleProvider_ExecArtifact" /> + <artifact xmi:idref="SimpleProvider_SvntArtifact" /> + </implementation> + + <implementation xmi:id="SimpleUserHomeImplementation"> + <name>SimpleUserHomeImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Simple_SimpleUserHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUser_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="SimpleUserComponentImplementation"> + <name>SimpleUserComponentImplementation</name> + <source/> + <artifact xmi:idref="SimpleUser_ExecArtifact" /> + <artifact xmi:idref="SimpleUser_SvntArtifact" /> + </implementation> + + <instance xmi:id="SimpleProviderHomeInstance"> + <name>SimpleProviderHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleProviderComponentInstance"> + <name>SimpleProviderComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleProviderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleProviderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserHomeInstance"> + <name>SimpleUserHome</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserHomeImplementation" /> + </instance> + + <instance xmi:id="SimpleUserComponentInstance"> + <name>SimpleUserComponent</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="SimpleUserComponentInstanceReverse"> + <name>SimpleUserComponentReverse</name> + <node>Node</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="SimpleUserComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>SimpleUserHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>TestConnection</name> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>TestConnectionReverse</name> + <internalEndpoint> + <portName>trig</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="SimpleUserComponentInstanceReverse" /> + </internalEndpoint> + <internalEndpoint> + <portName>trig</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="SimpleProviderComponentInstance" /> + </internalEndpoint> + </connection> + + <!-- Artifacts declarations --> + <artifact xmi:id="SimpleProvider_ExecArtifact"> + <name>SimpleProvider_exec</name> + <source/> + <node/> + <location>SimpleProvider_exec</location> + </artifact> + <artifact xmi:id="SimpleProvider_SvntArtifact"> + <name>SimpleProvider_svnt</name> + <source/> + <node/> + <location>SimpleProvider_svnt</location> + </artifact> + + <artifact xmi:id="SimpleUser_ExecArtifact"> + <name>SimpleUser_exec</name> + <source/> + <node/> + <location>SimpleUser_exec</location> + </artifact> + <artifact xmi:id="SimpleUser_SvntArtifact"> + <name>SimpleUser_svnt</name> + <source/> + <node/> + <location>SimpleUser_svnt</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/nm_launcher.mpc b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/nm_launcher.mpc new file mode 100644 index 00000000000..479e04f2acc --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/nm_launcher.mpc @@ -0,0 +1,5 @@ +project(simple_nm_launcher) : ciao_config_handlers, dance_nodemanager_stub, ciao_logger { + Source_Files { + simple_nm_launcher.cpp + } +}
\ No newline at end of file diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl new file mode 100755 index 00000000000..27b9f7987e8 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl @@ -0,0 +1,115 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$daemons = 1; +@ports = ( 60001 ); +@iorfiles = ( "NodeApp1.ior" ); +@nodenames = ( "Node" ); +$status = 0; + +$E = 0; +$EM = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } +} + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; + + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + 30) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +if ($#ARGV == -1) +{ + opendir(DIR, "."); + @files = grep(/\.cdp$/,readdir(DIR)); + closedir(DIR); +} else { + @files = @ARGV; +} + +foreach $file (@files) { + delete_ior_files (); + + print "Running test for plan $file\n"; + + # Invoke node daemons. + print "Invoking node daemon\n"; + $status = run_node_daemons (); + + if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; + } + + $daemons_running = 1; + + # Invoke executor - start the application -. + print "Launching the plan. file://NodeApp1.ior \n"; + $E = new PerlACE::Process ("simple_nm_launcher", + "file://NodeApp1.ior $file"); + + $status = $E->SpawnWaitKill (5000); + + if ($status != 0) + { + print "ERROR: simple_nm_launcher returned error status $status\n"; + } + + print "Test for plan $file succeeded\n"; + kill_open_processes (); +} + + +exit $status; diff --git a/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp new file mode 100644 index 00000000000..8b4d5531816 --- /dev/null +++ b/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/simple_nm_launcher.cpp @@ -0,0 +1,128 @@ +/** + * @file simple_nm_launcher.cpp + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Launches then immediately tears down a plan. + */ + +#include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" +#include "tao/ORB.h" +#include "ciao/Logger/Logger_Service.h" +#include "ciao/Logger/Log_Macros.h" +#include "Deployment/Deployment_NodeApplicationC.h" +#include "Deployment/Deployment_NodeManagerC.h" +#include "Deployment/Deployment_DeploymentPlanC.h" +#include "tools/Config_Handlers/XML_File_Intf.h" + +int usage () +{ + ACE_ERROR ((LM_ERROR, "simple_nm_launcher <nm_url> <plan>\n")); + return -1; +} + +#include <iostream> + +int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + CIAO_DISABLE_TRACE (); + + auto_ptr<CIAO::Logger_Service> logger; + + CIAO::Logger_Service + * dlf = ACE_Dynamic_Service<CIAO::Logger_Service>::instance ("CIAO_Logger_Backend_Factory"); + + if (!dlf) + dlf = new CIAO::Logger_Service; + + logger.reset (dlf); + logger->init (argc, argv); + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (argc != 3) + return usage (); + + try + { + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: parsing XML\n")); + // Parse plan + CIAO::Config_Handlers::XML_File_Intf xml (argv[2]); + xml.add_search_path ("CIAO_ROOT", "/docs/schema/"); + + auto_ptr< ::Deployment::DeploymentPlan> plan (xml.release_plan ()); + + if (plan.get () == 0) + { + ACE_ERROR ((LM_ERROR, "*** error parsing XML document\n")); + throw 1; + } + + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: resoling node manager reference.\n")); + CORBA::Object_var obj = orb->string_to_object (argv[1]); + Deployment::NodeManager_var nm = Deployment::NodeManager::_narrow (obj.in ()); + + if (CORBA::is_nil (nm.in ())) + { + ACE_ERROR ((LM_ERROR, "*** simple_nm_launcher: NodeManager reference is nil.")); + throw 1; + } + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling prepareplan.\n")); + Deployment::NodeApplicationManager_var nam = nm->preparePlan (*plan, + Deployment::ResourceCommitmentManager::_nil ()); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling startLaunch\n")); + Deployment::Connections_var conns; + Deployment::Properties props; + Deployment::Application_var app = nam->startLaunch (props, conns.out ()); + Deployment::NodeApplication_var na = Deployment::NodeApplication::_narrow (app.in ()); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling finishLaunch\n")); + na->finishLaunch (conns.in (), false); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling start\n")); + na->start (); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: start finished, sleeping 5 seconds.\n")); + ACE_OS::sleep (5); + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: waking up from sleep, calling destroyApplication\n")); + + nam->destroyApplication (na.in ()); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: calling destroyManager\n")); + + nm->destroyManager (nam.in ()); + + ACE_DEBUG ((LM_DEBUG, "*** simple_nm_launcher: destroyManager completed.\n")); + + orb->destroy (); + } + catch (Deployment::StopError &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught StopError exception with name %s and reason %s\n", + ex.name.in (), ex.reason.in ())); + return -1; + } + catch (Deployment::StartError &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught StartError exception with name %s and reason %s\n", + ex.name.in (), ex.reason.in ())); + return -1; + } + catch (CORBA::Exception &ex) + { + ACE_ERROR ((LM_ERROR, "*** Caught CORBA exception: %s\n", + ex._info ().c_str ())); + return -1; + + } + catch (...) + { + orb->destroy (); + ACE_ERROR ((LM_ERROR, "*** Caugn unknown exception\n")); + return -1; + } + return 0; +} diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host1.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host1.cdp new file mode 100644 index 00000000000..7aa477fae74 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host1.cdp @@ -0,0 +1,639 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance2_1</label> + <UUID>CcmDance2_1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createHostnameResultFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + <!-- Test Driver implementation--> + <!-- Home implementation --> + <implementation id="TestDriverHomeImplementation"> + <name>TestDriverHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_TestDriverHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/DriverModule/TestDriverHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.DriverModule.SessionTestDriverHome_impl</string> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="TestDriverImplementation"> + <name>TestDriverImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + + + + + <!-- Instances declarations --> + + <!-- Client Dance instances--> + <instance id="ClientDanceHome1"> + <name>ClientDanceHome1</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess2@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance1"> + <name>ClientDance1</name> + <node>Host1</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + <!-- Test Driver instances--> + <instance id="TestDriverHome"> + <name>TestDriverHome</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>TestDriverHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess2@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="TestDriver1"> + <name>TestDriver1</name> + <node>Host1</node> + <source/> + <implementation>TestDriverImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriverHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriver1</string> + </value> + </value> + </configProperty> + </instance> + + + + + + <!-- Connections declarations --> + + <connection> + <name>client1_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance/serverHostInfo1.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance.Component</location> + <provider>false</provider> + <portName>clientHostInfo1</portName> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance.Component</location> + <provider>false</provider> + <portName>hostnamePublishes</portName> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_consumer_to_emits1</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance/commands.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client1_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance/supports.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client1_naming</name> + <internalEndpoint> + <portName>naming</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4x.prismtech.com:21869</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_server</name> + <internalEndpoint> + <portName>server</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance/supports.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_client1</name> + <internalEndpoint> + <portName>client1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>client2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ClientDance2/supports.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_sayHello</name> + <internalEndpoint> + <portName>handshake</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:12345#Host2/CcmDance2_1.DeploymentPlan/ServerDance/supports.Port</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <!-- Artifacts declarations --> + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libClientCcmDance2Demo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createHostnameResultFactory</string> + </value> + </value> + </execParameter> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host2.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host2.cdp new file mode 100644 index 00000000000..57a44321b09 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2-host2.cdp @@ -0,0 +1,969 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance2_1</label> + <UUID>CcmDance2_1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation id="ServerDanceHomeImplementation"> + <name>ServerDanceHomeImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ServerDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.ServerModule.SessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/Command:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createCommandFactory</string> + </value> + </member> + </element> + </value> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/FooValueType:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createFooValueTypeFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ServerDanceImplementation"> + <name>ServerDanceImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + </implementation> + + + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createHostnameResultFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance id="ServerDanceHome"> + <name>ServerDanceHome</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ServerDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceProcess@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ServerDance"> + <name>ServerDance</name> + <node>Host2</node> + <source/> + <implementation>ServerDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDance</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStruct--> + <name>fooStruct</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2Test/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>fooString</name> + <value> + <string>hello</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>250</long> + </value> + </member> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnum--> + <name>fooEnum</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2Test/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </type> + <value> + <enum>B</enum> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStructSeq--> + <name>fooStructSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2Test/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>fooString</name> + <value> + <string>hello1</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>123</long> + </value> + </member> + </element> + <element> + <member> + <name>fooString</name> + <value> + <string>hello2</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>456</long> + </value> + </member> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnumSeq--> + <name>fooEnumSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2Test/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </elementType> + </sequence> + </type> + <value> + <element> + <enum>A</enum> + </element> + <element> + <enum>C</enum> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname1--> + <name>expectedClientHostname1</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x.prismtech.com</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname2--> + <name>expectedClientHostname2</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + + <instance id="ClientDanceHome2"> + <name>ClientDanceHome2</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess1@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance2"> + <name>ClientDance2</name> + <node>Host2</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + <!-- Connections declarations --> + + <connection> + <name>client1_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo1</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>serverHostInfo2</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4x.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host1%00CcmDance2_1/ClientDance1/clientHostInfo</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_receptacle2</name> + <internalEndpoint> + <portName>clientHostInfo2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4x.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host1%00CcmDance2_1/ClientDance1/hostnameResults</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client2_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits1</name> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits2</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_sayHello</name> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_naming</name> + <internalEndpoint> + <portName>naming</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4x.prismtech.com:21869</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_server</name> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_sayHello</name> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + + + + + <!-- Artifacts declarations --> + <artifact id="ServerDanceArtifact1"> + <name>ServerDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libServerCcmDance2Demo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/Command:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createCommandFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ServerDanceArtifact2"> + <name>ServerDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libServerCcmDance2Demo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/FooValueType:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createFooValueTypeFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libClientCcmDance2Demo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createHostnameResultFactory</string> + </value> + </value> + </execParameter> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2.cdp new file mode 100644 index 00000000000..bc761b07268 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance2.cdp @@ -0,0 +1,1300 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance2_1</label> + <UUID>CcmDance2_1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation id="ServerDanceHomeImplementation"> + <name>ServerDanceHomeImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ServerDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.ServerModule.SessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/Command:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createCommandFactory</string> + </value> + </member> + </element> + </value> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/FooValueType:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createFooValueTypeFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ServerDanceImplementation"> + <name>ServerDanceImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + </implementation> + + + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createHostnameResultFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + <!-- Test Driver implementation--> + <!-- Home implementation --> + <implementation id="TestDriverHomeImplementation"> + <name>TestDriverHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_TestDriverHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/DriverModule/TestDriverHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2Test.DriverModule.SessionTestDriverHome_impl</string> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="TestDriverImplementation"> + <name>TestDriverImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + + + + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance id="ServerDanceHome"> + <name>ServerDanceHome</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ServerDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceProcess@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ServerDance"> + <name>ServerDance</name> + <node>Host2</node> + <source/> + <implementation>ServerDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDance</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStruct--> + <name>fooStruct</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2Test/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>fooString</name> + <value> + <string>hello</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>250</long> + </value> + </member> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnum--> + <name>fooEnum</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2Test/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </type> + <value> + <enum>B</enum> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStructSeq--> + <name>fooStructSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2Test/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>fooString</name> + <value> + <string>hello1</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>123</long> + </value> + </member> + </element> + <element> + <member> + <name>fooString</name> + <value> + <string>hello2</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>456</long> + </value> + </member> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnumSeq--> + <name>fooEnumSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2Test/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </elementType> + </sequence> + </type> + <value> + <element> + <enum>A</enum> + </element> + <element> + <enum>C</enum> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname1--> + <name>expectedClientHostname1</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x.prismtech.com</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname2--> + <name>expectedClientHostname2</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + + <!-- Client Dance instances--> + <instance id="ClientDanceHome1"> + <name>ClientDanceHome1</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess2@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance1"> + <name>ClientDance1</name> + <node>Host1</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + <instance id="ClientDanceHome2"> + <name>ClientDanceHome2</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess1@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance2"> + <name>ClientDance2</name> + <node>Host2</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + <!-- Test Driver instances--> + <instance id="TestDriverHome"> + <name>TestDriverHome</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>TestDriverHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess2@CcmDance2Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="TestDriver1"> + <name>TestDriver1</name> + <node>Host1</node> + <source/> + <implementation>TestDriverImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriverHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriver1</string> + </value> + </value> + </configProperty> + </instance> + + + + + + <!-- Connections declarations --> + + <connection> + <name>client1_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>serverHostInfo1</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>serverHostInfo2</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle2</name> + <internalEndpoint> + <portName>clientHostInfo2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits1</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits2</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_naming</name> + <internalEndpoint> + <portName>naming</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:21869</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client2_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_naming</name> + <internalEndpoint> + <portName>naming</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::rhel4y.prismtech.com:21869</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_server</name> + <internalEndpoint> + <portName>server</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client1</name> + <internalEndpoint> + <portName>client1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>client2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_sayHello</name> + <internalEndpoint> + <portName>handshake</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + + + + + <!-- Artifacts declarations --> + <artifact id="ServerDanceArtifact1"> + <name>ServerDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libServerCcmDance2Demo.so</location> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createCommandFactory</string> + </value> + </value> + </execParameter> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/Command:1.0</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ServerDanceArtifact2"> + <name>ServerDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libServerCcmDance2Demo.so</location> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createFooValueTypeFactory</string> + </value> + </value> + </execParameter> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/FooValueType:1.0</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2/c++/i686-pc-linux-gnu/libClientCcmDance2Demo.so</location> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createHostnameResultFactory</string> + </value> + </value> + </execParameter> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2Test/EventTypeModule/HostnameResult:1.0</string> + </value> + </value> + </execParameter> + + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host1.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host1.cdp new file mode 100644 index 00000000000..8626b5275a9 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host1.cdp @@ -0,0 +1,1055 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance2_1</label> + <UUID>CcmDance2_1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation id="ServerDanceHomeImplementation"> + <name>ServerDanceHomeImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ServerDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.ServerModule.FTSessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- FAULT_TOLERANCE_REPLICATION_STYLE --> + <name>cdmw.config.FaultToleranceReplicationStyle</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FTReplicationStyleValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/FTReplicationStyleValue:1.0</typeId> + <member>STATELSESS</member> + <member>COLD_PASSIVE</member> + <member>WARM_PASSIVE</member> + <member>ACTIVE</member> + <member>ACTIVE_WITH_VOTING</member> + </enum> + </type> + <value> + <enum>WARM_PASSIVE</enum> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="ServerDanceImplementation"> + <name>ServerDanceImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + </implementation> + + + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + <artifact>ServerDanceArtifact1</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + <artifact>ServerDanceArtifact1</artifact> + </implementation> + + + <!-- Test Driver implementation--> + <!-- Home implementation --> + <implementation id="TestDriverHomeImplementation"> + <name>TestDriverHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_TestDriverHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/DriverModule/TestDriverHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.DriverModule.SessionTestDriverHome_impl</string> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="TestDriverImplementation"> + <name>TestDriverImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance id="ServerDanceHome1"> + <name>ServerDanceHome1</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>ServerDanceHomeImplementation</implementation> + + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceProcess1@CcmDance2WithFTApplication</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ServerDance1"> + <name>ServerDance1</name> + <node>Host1</node> + <source/> + <implementation>ServerDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceHome1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDance1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- FAULT_TOLERANT GROUP NAME--> + <name>cdmw.config.FaultToleranceGroupName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceFT</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStruct--> + <name>fooStruct</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>fooString</name> + <value> + <string>hello</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>250</long> + </value> + </member> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnum--> + <name>fooEnum</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </type> + <value> + <enum>B</enum> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStructSeq--> + <name>fooStructSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>fooString</name> + <value> + <string>hello1</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>123</long> + </value> + </member> + </element> + <element> + <member> + <name>fooString</name> + <value> + <string>hello2</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>456</long> + </value> + </member> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnumSeq--> + <name>fooEnumSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </elementType> + </sequence> + </type> + <value> + <element> + <enum>A</enum> + </element> + <element> + <enum>C</enum> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname1--> + <name>expectedClientHostname1</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x.prismtech.com</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname2--> + <name>expectedClientHostname2</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + + <!-- Client Dance instances--> + <instance id="ClientDanceHome1"> + <name>ClientDanceHome1</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess1@CcmDance2WithFTApplication</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance1"> + <name>ClientDance1</name> + <node>Host1</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + <!-- Test Driver instances--> + <instance id="TestDriverHome"> + <name>TestDriverHome</name> + <node>Host1</node> + <!-- hostname --> + <source/> + <implementation>TestDriverHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess1@CcmDance2WithFTApplication</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="TestDriver1"> + <name>TestDriver1</name> + <node>Host1</node> + <source/> + <implementation>TestDriverImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriverHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriver1</string> + </value> + </value> + </configProperty> + </instance> + + + + + + <!-- Connections declarations --> + + <connection> + <name>client1_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle2</name> + <internalEndpoint> + <portName>clientHostInfo2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4y.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host2%00CcmDance2_1/ClientDance2/clientHostInfo</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> +<!-- <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance1</instance> + </internalEndpoint> --> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>false</provider> + <portName>hostnamePublishes</portName> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client2_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4y.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host2%00CcmDance2_1/ClientDance2/hostnameResults</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_consumer_to_emits1</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client1_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_server</name> + <internalEndpoint> + <portName>server</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_client1</name> + <internalEndpoint> + <portName>client1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>client2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4y.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host2%00CcmDance2_1/ClientDance2/supports</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_sayHello</name> + <internalEndpoint> + <portName>handshake</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + + + + + <!-- Artifacts declarations --> + <artifact id="ServerDanceArtifact1"> + <name>ServerDanceArtifact1</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libServerCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/EventTypeModule/Command:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createCommandFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ServerDanceArtifact2"> + <name>ServerDanceArtifact2</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libServerCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DL:acme.com/CcmDance2WithFTTest/FooValueType:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createFooValueTypeFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libClientCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/EventTypeModule/HostnameResult:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createHostnameResultFactory</string> + </value> + </value> + </execParameter> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host2.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host2.cdp new file mode 100644 index 00000000000..801ebf4b60f --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/CcmDance4-host2.cdp @@ -0,0 +1,941 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance2_1</label> + <UUID>CcmDance2_1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation id="ServerDanceHomeImplementation"> + <name>ServerDanceHomeImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ServerDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.ServerModule.FTSessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- FAULT_TOLERANCE_REPLICATION_STYLE --> + <name>cdmw.config.FaultToleranceReplicationStyle</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FTReplicationStyleValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/FTReplicationStyleValue:1.0</typeId> + <member>STATELSESS</member> + <member>COLD_PASSIVE</member> + <member>WARM_PASSIVE</member> + <member>ACTIVE</member> + <member>ACTIVE_WITH_VOTING</member> + </enum> + </type> + <value> + <enum>WARM_PASSIVE</enum> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="ServerDanceImplementation"> + <name>ServerDanceImplementation</name> + <source/> + <artifact>ServerDanceArtifact1</artifact> + <artifact>ServerDanceArtifact2</artifact> + </implementation> + + + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + <artifact>ServerDanceArtifact1</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + <artifact>ServerDanceArtifact1</artifact> + </implementation> + + + <!-- Test Driver implementation--> + <!-- Home implementation --> + <implementation id="TestDriverHomeImplementation"> + <name>TestDriverHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_TestDriverHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/DriverModule/TestDriverHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance2WithFTTest.DriverModule.SessionTestDriverHome_impl</string> + </value> + </value> + </execParameter> + + </implementation> + + <!-- Component implementation --> + <implementation id="TestDriverImplementation"> + <name>TestDriverImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + + + + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance id="ServerDanceHome2"> + <name>ServerDanceHome2</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ServerDanceHomeImplementation</implementation> + + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceProcess2@CcmDance2WithFTApplication</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ServerDance2"> + <name>ServerDance2</name> + <node>Host2</node> + <source/> + <implementation>ServerDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceHome2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDance2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- FAULT_TOLERANT GROUP NAME--> + <name>cdmw.config.FaultToleranceGroupName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceFT</string> + </value> + </value> + </configProperty> + + + <configProperty> + <!-- Attribute: fooStruct--> + <name>fooStruct</name> + <value> + <type> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </type> + <value> + <member> + <name>fooString</name> + <value> + <string>hello</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>250</long> + </value> + </member> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnum--> + <name>fooEnum</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </type> + <value> + <enum>B</enum> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooStructSeq--> + <name>fooStructSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>FooStruct</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooStruct:1.0</typeId> + <member> + <name>fooString</name> + <type> + <kind>tk_string</kind> + </type> + </member> + <member> + <name>fooLong</name> + <type> + <kind>tk_long</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>fooString</name> + <value> + <string>hello1</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>123</long> + </value> + </member> + </element> + <element> + <member> + <name>fooString</name> + <value> + <string>hello2</string> + </value> + </member> + <member> + <name>fooLong</name> + <value> + <long>456</long> + </value> + </member> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: fooEnumSeq--> + <name>fooEnumSeq</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_enum</kind> + <enum> + <name>FooEnum</name> + <typeId>IDL:acme.com/CcmDance2WithFTTest/FooEnum:1.0</typeId> + <member>A</member> + <member>B</member> + <member>C</member> + </enum> + </elementType> + </sequence> + </type> + <value> + <element> + <enum>A</enum> + </element> + <element> + <enum>C</enum> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname1--> + <name>expectedClientHostname1</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x.prismtech.com</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname2--> + <name>expectedClientHostname2</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + + + <!-- Client Dance instances--> + <instance id="ClientDanceHome2"> + <name>ClientDanceHome2</name> + <node>Host2</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess2@CcmDance2WithFTApplication</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance2"> + <name>ClientDance2</name> + <node>Host2</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4y.prismtech.com</string> + </value> + </value> + </configProperty> + </instance> + + <!-- Connections declarations --> + <connection> + <name>client2_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4x.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host1%00CcmDance2_1/ClientDance1/clientHostInfo</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + + <connection> + <name>server_receptacle2</name> + <internalEndpoint> + <portName>clientHostInfo2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaloc:iiop:1.2@rhel4x.prismtech.com:12345/%14%01%0f%00NUP%00%00%00%16%02%00%00%00%01%00%00%00RootPOA%00Host1%00CcmDance2_1/ClientDance1/hostnameResults</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client2_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits2</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>client2_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <externalReference> + <location>corbaname::localhost:21869#CDMW__FaultToleranceDomain/ServerDanceFT</location> + <provider>true</provider> + <portName/> + <supportedType/> + </externalReference> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + + <!-- Artifacts declarations --> + <!-- Artifacts declarations --> + <artifact id="ServerDanceArtifact1"> + <name>ServerDanceArtifact1</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libServerCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/EventTypeModule/Command:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createCommandFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ServerDanceArtifact2"> + <name>ServerDanceArtifact2</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libServerCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>DL:acme.com/CcmDance2WithFTTest/FooValueType:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createFooValueTypeFactory</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance2_with_ft/c++/i686-pc-linux-gnu/libClientCcmDance2WithFTDemo.so</location> + <execParameter> + <name>repid</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance2WithFTTest/EventTypeModule/HostnameResult:1.0</string> + </value> + </value> + </execParameter> + <execParameter> + <name>factory_entrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createHostnameResultFactory</string> + </value> + </value> + </execParameter> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/DeploymentPlanDump.mpc b/CIAO/DAnCE/tests/DeploymentPlanDump/DeploymentPlanDump.mpc new file mode 100644 index 00000000000..090283f81ee --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/DeploymentPlanDump.mpc @@ -0,0 +1,9 @@ + +project : dance, taoexe, xerces, aceexe, ciao_config_handlers, dance_logger { + exename = DeploymentPlanDump + + Source_Files { + test.cpp + } +} + diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/NewCcmDance1.cdp b/CIAO/DAnCE/tests/DeploymentPlanDump/NewCcmDance1.cdp new file mode 100644 index 00000000000..be02b05aade --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/NewCcmDance1.cdp @@ -0,0 +1,1063 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>CCmDance1</label> + <UUID>CcmDance1</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Server Dance implementation--> + <!-- Home implementation --> + <implementation id="ServerDanceHomeImplementation"> + <name>ServerDanceHomeImplementation</name> + <source/> + <artifact>ServerDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ServerDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance1Test/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance1Test.ServerModule.SessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + +<!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> +<!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/Example/SaySomethingElse:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createSaySomethingElseFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ServerDanceImplementation"> + <name>ServerDanceImplementation</name> + <source/> + <artifact>ServerDanceArtifact</artifact> + </implementation> + + + + <!-- Client Dance implementation--> + <!-- Home implementation --> + <implementation id="ClientDanceHomeImplementation"> + <name>ClientDanceHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_ClientDanceHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance1Test/ClientModule/ClientDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance1Test.ClientModule.SessionClientDanceHome_impl</string> + </value> + </value> + </execParameter> + + <!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> + <!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/Example/SaySomethingElse:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createSaySomethingElseFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="ClientDanceImplementation"> + <name>ClientDanceImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + <!-- Test Driver implementation--> + <!-- Home implementation --> + <implementation id="TestDriverHomeImplementation"> + <name>TestDriverHomeImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CCM_TestDriverHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance1Test/DriverModule/TestDriverHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance1Test.DriverModule.SessionTestDriverHome_impl</string> + </value> + </value> + </execParameter> + + <!-- <execParameter> --> + <!-- VALUETYPE_FACTORY_DEPENDENCIES --> + <!-- <name>cdmw.config.ValuetypeFactoryDependencies</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_struct</kind> + <struct> + <name>ValuetypeFactoryDescription</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ValuetypeFactoryDescription:1.0</typeId> + <member> + <name>repid</name> + <type> + <kind>tk_alias</kind> + <alias> + <name>RepositoryId</name> + <typeId>IDL:omg.org/CORBA/RepositoryId</typeId> + <elementType> + <kind>tk_string</kind> + </elementType> + </alias> + </type> + </member> + <member> + <name>factory_entrypoint</name> + <type> + <kind>tk_string</kind> + </type> + </member> + </struct> + </elementType> + </sequence> + </type> + <value> + <element> + <member> + <name>repid</name> + <value> + <string>IDL:acme.com/Example/SaySomethingElse:1.0</string> + </value> + </member> + <member> + <name>factory_entrypoint</name> + <value> + <string>createSaySomethingElseFactory</string> + </value> + </member> + </element> + </value> + </value> + </execParameter> --> + </implementation> + + <!-- Component implementation --> + <implementation id="TestDriverImplementation"> + <name>TestDriverImplementation</name> + <source/> + <artifact>ClientDanceArtifact</artifact> + </implementation> + + + + + + + + + + + <!-- Instances declarations --> + + <!-- Server Dance instances--> + <instance id="ServerDanceHome"> + <name>ServerDanceHome</name> + <node>MyHost</node> + <!-- hostname --> + <source/> + <implementation>ServerDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceProcess@CcmDance1Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ServerDance"> + <name>ServerDance</name> + <node>MyHost</node> + <source/> + <implementation>ServerDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDanceHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ServerDance</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname1--> + <name>expectedClientHostname1</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedClientHostname2--> + <name>expectedClientHostname2</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x</string> + </value> + </value> + </configProperty> + </instance> + + + + <!-- Client Dance instances--> + <instance id="ClientDanceHome"> + <name>ClientDanceHome</name> + <node>MyHost</node> + <!-- hostname --> + <source/> + <implementation>ClientDanceHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess@CcmDance1Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="ClientDance1"> + <name>ClientDance1</name> + <node>MyHost</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client1</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x</string> + </value> + </value> + </configProperty> + </instance> + + + <instance id="ClientDance2"> + <name>ClientDance2</name> + <node>MyHost</node> + <source/> + <implementation>ClientDanceImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDance2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: configuration--> + <name>configuration</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Client2</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- Attribute: expectedServerHostname--> + <name>expectedServerHostname</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rhel4x</string> + </value> + </value> + </configProperty> + </instance> + + + <!-- Test Driver instances--> + <instance id="TestDriverHome"> + <name>TestDriverHome</name> + <node>MyHost</node> + <!-- hostname --> + <source/> + <implementation>TestDriverHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ClientDanceProcess@CcmDance1Application</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="TestDriver1"> + <name>TestDriver1</name> + <node>MyHost</node> + <source/> + <implementation>TestDriverImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriverHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>TestDriver1</string> + </value> + </value> + </configProperty> + </instance> + + + + + + <!-- Connections declarations --> + + <connection> + <name>client1_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>serverHostInfo1</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_receptacle</name> + <internalEndpoint> + <portName>serverHostInfo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>serverHostInfo2</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle1</name> + <internalEndpoint> + <portName>clientHostInfo1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_receptacle2</name> + <internalEndpoint> + <portName>clientHostInfo2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>clientHostInfo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_consumer_to_publishes</name> + <internalEndpoint> + <portName>hostnamePublishes</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance>ServerDance</instance> + </internalEndpoint> + <internalEndpoint> + <portName>hostnameResults</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits1</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>server_consumer_to_emits2</name> + <internalEndpoint> + <portName>commandEmits</portName> + <provider>false</provider> + <kind>EventEmitter</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>commands</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client1_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>client2_sayHello</name> + <internalEndpoint> + <portName>sayHello</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_server</name> + <internalEndpoint> + <portName>server</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client1</name> + <internalEndpoint> + <portName>client1</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance1</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_client2</name> + <internalEndpoint> + <portName>client2</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ClientDance2</instance> + </internalEndpoint> + </connection> + + <connection> + <name>testDriver_sayHello</name> + <internalEndpoint> + <portName>handshake</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance>TestDriver1</instance> + </internalEndpoint> + <internalEndpoint> + <portName>supports</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance>ServerDance</instance> + </internalEndpoint> + </connection> + + + + + + <!-- Artifacts declarations --> + <artifact id="ServerDanceArtifact"> + <name>ServerDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance1/c++/i686-pc-linux-gnu/libServerCcmDance1Demo.so</location> + </artifact> + + <artifact id="ClientDanceArtifact"> + <name>ClientDanceArtifact</name> + <source/> + <node/> + <location>/home/sl/install/ofccm_v0/demos/demo_dance1/c++/i686-pc-linux-gnu/libClientCcmDance1Demo.so</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp b/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp new file mode 100644 index 00000000000..3fd058f2131 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanDump/test.cpp @@ -0,0 +1,33 @@ +#include "tools/Config_Handlers/DnC_Dump.h" +#include "tools/Config_Handlers/XML_File_Intf.h" +#include "DAnCE/Logger/Log_Macros.h" + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + if (argc < 1) + { + DANCE_ERROR((LM_ERROR, "[%M] Incorrect count of arguments. Path to deployment plan has not been specified.\n")); + return 1; + } + CIAO::Config_Handlers::XML_File_Intf file (argv[1]); + file.add_search_path ("CIAO_ROOT", "/docs/schema/"); + file.add_search_path ("TAO_ROOT", "/docs/schema/"); + Deployment::DeploymentPlan * plan = file.release_plan(); + Deployment::DnC_Dump::dump (*plan); + delete plan; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("DAnCE_DeploymentPlanDump::main\n"); + return -1; + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] Unexpected exception\n")); + return 1; + } + + return 0; +} diff --git a/CIAO/DAnCE/tests/DeploymentPlanTestReferences/DeploymentPlanTestReferences.mpc b/CIAO/DAnCE/tests/DeploymentPlanTestReferences/DeploymentPlanTestReferences.mpc new file mode 100644 index 00000000000..86a4bb93ff0 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanTestReferences/DeploymentPlanTestReferences.mpc @@ -0,0 +1,9 @@ + +project : dance, taolib, tao_output, xerces, ciao_config_handlers, dance_logger { + exename = DeploymentPlanTestReferences + + Source_Files { + test.cpp + } +} + diff --git a/CIAO/DAnCE/tests/DeploymentPlanTestReferences/test.cpp b/CIAO/DAnCE/tests/DeploymentPlanTestReferences/test.cpp new file mode 100644 index 00000000000..0f89c40ea72 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentPlanTestReferences/test.cpp @@ -0,0 +1,51 @@ +#include "ace/Auto_Ptr.h" +#include "tools/Config_Handlers/DnC_Dump.h" +#include "tools/Config_Handlers/XML_File_Intf.h" +#include "DAnCE/Logger/Log_Macros.h" + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + if (argc < 1) + { + DANCE_ERROR((LM_ERROR, "[%M] Incorrect count of arguments. Path to deployment plan has not been specified.\n")); + return 1; + } + //parsing plan + CIAO::Config_Handlers::XML_File_Intf file (argv[1]); + file.add_search_path ("CIAO_ROOT", "/docs/schema/"); + file.add_search_path ("TAO_ROOT", "/docs/schema/"); + auto_ptr<Deployment::DeploymentPlan> plan (file.release_plan()); + + //check instance references to corresponding implementations + for (unsigned int i = 0; i < plan->instance.length(); i++) + { + if (plan->instance[i].implementationRef > plan->implementation.length() - 1) + { + DANCE_ERROR((LM_ERROR, "[%M] incorrect implementationRef in instance %s.\n", plan->instance[i].name.in())); + return 1; + } + } + + //check artifact reference for implementations of Home objects + for (unsigned int i = 0; i < plan->implementation.length(); i++) + { + if (plan->implementation[i].artifactRef.length() > 0) + { + if (plan->implementation[i].artifactRef[0] > plan->artifact.length() - 1) + { + DANCE_ERROR((LM_ERROR, "[%M] incorrect artifactRef in the implementation %s.\n", plan->implementation[i].name.in())); + return 1; + } + } + } + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] Unexpected exception")); + return 1; + } + + return 0; +} diff --git a/CIAO/DAnCE/tests/DeploymentTest1/DeploymentTest1.mpc b/CIAO/DAnCE/tests/DeploymentTest1/DeploymentTest1.mpc new file mode 100644 index 00000000000..efcdaec3203 --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentTest1/DeploymentTest1.mpc @@ -0,0 +1,8 @@ +project : dance, taolib, tao_output, xerces, ciao_config_handlers, dance_logger { + exename = DeploymentTest1 + + Source_Files { + test.cpp + } +} + diff --git a/CIAO/DAnCE/tests/DeploymentTest1/test.cpp b/CIAO/DAnCE/tests/DeploymentTest1/test.cpp new file mode 100644 index 00000000000..aaccef082fc --- /dev/null +++ b/CIAO/DAnCE/tests/DeploymentTest1/test.cpp @@ -0,0 +1,66 @@ +#include "ace/Auto_Ptr.h" +#include "DAnCE/Deployment/Deployment_DeploymentPlanC.h" +#include "DAnCE/Deployment/Deployment_ExecutionManagerC.h" +#include "DAnCE/Deployment/Deployment_DomainApplicationManagerC.h" +#include "DAnCE/Deployment/Deployment_DomainApplicationC.h" +#include "DAnCE/Deployment/Deployment_NodeManagerC.h" +#include "DAnCE/Deployment/Deployment_NodeApplicationManagerC.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "tools/Config_Handlers/DnC_Dump.h" +#include "tools/Config_Handlers/XML_File_Intf.h" + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + CIAO::Config_Handlers::XML_File_Intf file (argv[1]); + file.add_search_path ("CIAO_ROOT", "/docs/schema/"); + file.add_search_path ("TAO_ROOT", "/docs/schema/"); + auto_ptr<Deployment::DeploymentPlan> pplan (file.release_plan()); + + DANCE_DEBUG((LM_DEBUG, "[%M] Test starts.\n")); + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + const char * ior = "file://execution_manager.ior"; + + CORBA::Object_var obj = orb->string_to_object (ior); + if (CORBA::is_nil (obj. in())) + { + throw 0; + } + + Deployment::ExecutionManager_var em = Deployment::ExecutionManager::_narrow (obj); + if (CORBA::is_nil (em.in ())) + { + throw 0; + } + DANCE_DEBUG((LM_DEBUG, "[%M] preparePlan\n")); + Deployment::DomainApplicationManager_var dam = em->preparePlan (*pplan, Deployment::ResourceCommitmentManager::_nil()); + DANCE_DEBUG((LM_DEBUG, "[%M] startLaunch\n")); + //call startLaunch + Deployment::Properties dp; + Deployment::Connections_var dc; + Deployment::Application_var na = dam->startLaunch (dp, dc.out()); + Deployment::DomainApplication_var da = Deployment::DomainApplication::_narrow (na); + if (CORBA::is_nil (da.in ())) + { + DANCE_DEBUG((LM_DEBUG, "[%M] narrow fails\n")); + } + DANCE_DEBUG((LM_DEBUG, "[%M] finishLaunch\n")); + da->finishLaunch (dc.in(), true); + DANCE_DEBUG((LM_DEBUG, "[%M] Test succeded!\n")); + + } + catch (const CORBA::Exception &e) + { + e._tao_print_exception ("DeploymentTest1::main\t\n"); + DANCE_ERROR((LM_ERROR, "[%M] Uncaught CORBA exception\n")); + return 1; + } + catch (...) + { + return 1; + } + + return 0; +} diff --git a/CIAO/DAnCE/tests/MocksTest/MockObjectHome.cpp b/CIAO/DAnCE/tests/MocksTest/MockObjectHome.cpp new file mode 100644 index 00000000000..35a522bb9f6 --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MockObjectHome.cpp @@ -0,0 +1,18 @@ +#include "MockObjectHome.h" + +::Components::CCMObject_ptr +MockObjectHome::create_component_with_config_values ( + const ::Components::ConfigValues & config +) + { + return MockHome_Impl::create_component_with_config_values (config); + } + +extern "C" MocksTest_Export MockHome_Impl *create_MockHome (void); + +MockHome_Impl*create_MockHome (void) + { + MockHome_Impl* home = 0; + ACE_NEW_RETURN (home, MockObjectHome (), 0); + return home; + } diff --git a/CIAO/DAnCE/tests/MocksTest/MockObjectHome.h b/CIAO/DAnCE/tests/MocksTest/MockObjectHome.h new file mode 100644 index 00000000000..056e90a1244 --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MockObjectHome.h @@ -0,0 +1,23 @@ +#ifndef MOCKOBJECTHOME_H_ +#define MOCKOBJECTHOME_H_ + +#include "MocksTest_Export.h" +#include "Mocks/MockHome_Impl.h" + +class MocksTest_Export MockObjectHome : public MockHome_Impl + { + public: + MockObjectHome() + {}; + virtual ~MockObjectHome() + {}; + + virtual ::Components::CCMObject_ptr create_component_with_config_values ( + const ::Components::ConfigValues & config + ); + + protected: + private: + }; + +#endif /*MOCKOBJECTHOME_H_*/ diff --git a/CIAO/DAnCE/tests/MocksTest/MockTest.cdp b/CIAO/DAnCE/tests/MocksTest/MockTest.cdp new file mode 100644 index 00000000000..f3478812063 --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MockTest.cdp @@ -0,0 +1,196 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>MockTest</label> + <UUID>MockTest</UUID> + + <realizes></realizes> + + <!-- Implementations declarations --> + + <!-- Mock object implementation--> + <!-- Home implementation --> + <implementation id="MockObjectHomeImplementation"> + <name>MockObjectHomeImplementation</name> + <source/> + <artifact>MockObjectArtifact</artifact> + + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_MockHome</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- COMPONENT_KIND --> + <name>cdmw.config.ComponentKind</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ComponentKindValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ComponentKindValue:1.0</typeId> + <member>SERVICE</member> + <member>SESSION</member> + <member>PROCESS</member> + <member>ENTITY</member> + <member>UNCLASSIFIED</member> + </enum> + </type> + <value> + <enum>SESSION</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- SERVANT_LIFETIME --> + <name>cdmw.config.ServantLifeTime</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ServantLifeTimeValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ServantLifetimeValue:1.0</typeId> + <member>COMPONENT_LIFETIME</member> + <member>METHOD_LIFETIME</member> + <member>TRANSACTION_LIFETIME</member> + <member>CONTAINER_LIFETIME</member> + </enum> + </type> + <value> + <enum>CONTAINER_LIFETIME</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- THREADING_POLICY --> + <name>cdmw.config.ThreadingPolicy</name> + <value> + <type> + <kind>tk_enum</kind> + <enum> + <name>ThreadingPolicyValue</name> + <typeId>IDL:thalesgroup.com/CdmwDeployment/ThreadingPolicyValue:1.0</typeId> + <member>SERIALIZE</member> + <member>MULTITHREAD</member> + </enum> + </type> + <value> + <enum>MULTITHREAD</enum> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_REPOSITORY_ID --> + <name>cdmw.config.HomeRepositoryId</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>IDL:acme.com/CcmDance1Test/ServerModule/ServerDanceHome:1.0</string> + </value> + </value> + </execParameter> + + <execParameter> + <!-- HOME_SERVANT_CLASSNAME --> + <name>cdmw.config.HomeServantClassName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Cdmw.CCM.CIF.CdmwCcmDance1Test.ServerModule.SessionServerDanceHome_impl</string> + </value> + </value> + </execParameter> + </implementation> + + <!-- Component implementation --> + <implementation id="MockObjectImplementation"> + <name>MockObjectImplementation</name> + <source/> + <artifact>MockObjectArtifact</artifact> + </implementation> + + + + + <!-- Instances declarations --> + + <!-- MockObjectHome instances--> + <instance id="MockObjectHome"> + <name>MockObjectHome</name> + <node>MyHost</node> + <!-- hostname --> + <source/> + <implementation>MockObjectHomeImplementation</implementation> + <configProperty> + <!-- PROCESS_DESTINATION --> + <name>cdmw.config.ProcessDestination</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>MockTest</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="MockObject"> + <name>MockObject</name> + <node>MyHost</node> + <source/> + <implementation>MockObjectImplementation</implementation> + + <configProperty> + <!-- HOME --> + <name>cdmw.component_home</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>MockObjectHome</string> + </value> + </value> + </configProperty> + + <configProperty> + <!-- COMPONENT_NAME --> + <name>cdmw.config.ComponentName</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>MockObject</string> + </value> + </value> + </configProperty> + </instance> + + <!-- Artifacts declarations --> + <artifact id="MockObjectArtifact"> + <name>MockObjectArtifact</name> + <source/> + <node/> + <location>./libMockObject.so</location> + </artifact> + + </Deployment:DeploymentPlan> diff --git a/CIAO/DAnCE/tests/MocksTest/MockTest.mpc b/CIAO/DAnCE/tests/MocksTest/MockTest.mpc new file mode 100644 index 00000000000..2de6e7bf904 --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MockTest.mpc @@ -0,0 +1,28 @@ +// -*- MPC -*- +// $Id$ + +project(*MockTest): dance, taoserver, naming, dance_mocks { + requires += ofccm + exename = MockTest + after += MockObject + + Source_Files { + MocksTest.cpp + } + +} + +project(*MockObject): dance_mocks{ + requires += ofccm + sharedname = MockObject + dynamicflags = MOCKTEST_BUILD_DLL + + Source_Files { + MockObjectHome.cpp + } + + Header_Files { + MockObjectHome.h + } +} + diff --git a/CIAO/DAnCE/tests/MocksTest/MocksTest.cpp b/CIAO/DAnCE/tests/MocksTest/MocksTest.cpp new file mode 100644 index 00000000000..dbe6117c2be --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MocksTest.cpp @@ -0,0 +1,36 @@ +#include "orbsvcs/orbsvcs/CosNamingC.h" +#include "Mocks/ComponentServer_Impl.h" +#include "tao/ORB.h" + +int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) + { + + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow (obj.in ()); + PortableServer::POAManager_var poa_manager = poa->the_POAManager (); + poa_manager->activate (); + + obj = orb->resolve_initial_references ("NameService"); + CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow (obj.in ()); + + ComponentServer_Impl* comp_server = 0; + + ACE_NEW_THROW_EX (comp_server, + ComponentServer_Impl (orb.in (), poa.in ()), + CORBA::NO_MEMORY()); + + PortableServer::ObjectId_var oid = poa->activate_object (comp_server); + obj = poa->id_to_reference (oid.in ()); + CdmwCcmComponentServer::ComponentServer_var server = CdmwCcmComponentServer::ComponentServer::_narrow (obj.in ()); + + CosNaming::Name name(1); + name.length(1); + name[0].id = CORBA::string_dup("MockTest"); + name[0].kind = CORBA::string_dup("ComponentServer"); + naming->bind (name, server.in ()); + + orb->run (); + return 0; + } diff --git a/CIAO/DAnCE/tests/MocksTest/MocksTest_Export.h b/CIAO/DAnCE/tests/MocksTest/MocksTest_Export.h new file mode 100644 index 00000000000..984e865bf1f --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/MocksTest_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl MocksTest +// ------------------------------ +#ifndef MOCKSTEST_EXPORT_H +#define MOCKSTEST_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (MOCKSTEST_HAS_DLL) +# define MOCKSTEST_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && MOCKSTEST_HAS_DLL */ + +#if !defined (MOCKSTEST_HAS_DLL) +# define MOCKSTEST_HAS_DLL 1 +#endif /* ! MOCKSTEST_HAS_DLL */ + +#if defined (MOCKSTEST_HAS_DLL) && (MOCKSTEST_HAS_DLL == 1) +# if defined (MOCKSTEST_BUILD_DLL) +# define MocksTest_Export ACE_Proper_Export_Flag +# define MOCKSTEST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define MOCKSTEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* MOCKSTEST_BUILD_DLL */ +# define MocksTest_Export ACE_Proper_Import_Flag +# define MOCKSTEST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define MOCKSTEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* MOCKSTEST_BUILD_DLL */ +#else /* MOCKSTEST_HAS_DLL == 1 */ +# define MocksTest_Export +# define MOCKSTEST_SINGLETON_DECLARATION(T) +# define MOCKSTEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* MOCKSTEST_HAS_DLL == 1 */ + +// Set MOCKSTEST_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (MOCKSTEST_NTRACE) +# if (ACE_NTRACE == 1) +# define MOCKSTEST_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define MOCKSTEST_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !MOCKSTEST_NTRACE */ + +#if (MOCKSTEST_NTRACE == 1) +# define MOCKSTEST_TRACE(X) +#else /* (MOCKSTEST_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define MOCKSTEST_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (MOCKSTEST_NTRACE == 1) */ + +#endif /* MOCKSTEST_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/DAnCE/tests/MocksTest/plCommand.In b/CIAO/DAnCE/tests/MocksTest/plCommand.In new file mode 100644 index 00000000000..ca7b0873bab --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/plCommand.In @@ -0,0 +1,5 @@ +I +am +the +chatter +quit diff --git a/CIAO/DAnCE/tests/MocksTest/run_test.pl b/CIAO/DAnCE/tests/MocksTest/run_test.pl new file mode 100755 index 00000000000..5ecaae833c6 --- /dev/null +++ b/CIAO/DAnCE/tests/MocksTest/run_test.pl @@ -0,0 +1,97 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' +& eval 'exec perl -S $0 $argv:q' +if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +#delete IOR files +if (-e em.ior) { + unlink "em.ior" +} +if (-e ns.ior) { + unlink "ns.ior" +} + +$ns_status = 0; +$mt_status = 0; +$pl_status = 0; +$em_status = 0; + +if (PerlACE::is_vxworks_test()) { + $ns = new PerlACE::ProcessVX ("$ENV{'ACE_ROOT'}/TAO/orbsvcs/Naming_Service/Naming_Service", "-o ns.ior"); +} +else { + $ns = new PerlACE::Process ("$ENV{'ACE_ROOT'}/TAO/orbsvcs/Naming_Service/Naming_Service", "-o ns.ior"); +} + +$ns_status = $ns->Spawn(); +sleep 10; + +#read NameService IOR +$data_file = "ns.ior"; +open(DAT, $data_file) || die("ERROR: Could not open file!"); +$ior = <DAT>; +close(DAT); + +if (PerlACE::is_vxworks_test()) { + $mt = new PerlACE::ProcessVX ("./MockTest", "-ORBInitRef NameService=file://ns.ior"); +} +else { + $mt = new PerlACE::Process ("./MockTest", "-ORBInitRef NameService=file://ns.ior"); +} + +$mt_status = $mt->Spawn(); +sleep 10; + +if (PerlACE::is_vxworks_test()) { + $em = new PerlACE::ProcessVX ("$ENV{'ACE_ROOT'}/bin/dance", "--log-level 1 -eem.ior --node-mgr MyHost -ORBListenEndpoints iiop://localhost:12345 -ORBInitRef ProcessDestinationNC=file://ns.ior"); + $pl = new PerlACE::ProcessVX ("$ENV{'ACE_ROOT'}/bin/dance", "--log-level 1 -x MockTest.cdp -k file://em.ior"); +} +else { + $em = new PerlACE::Process ("$ENV{'ACE_ROOT'}/bin/dance", "--log-level 1 -eem.ior --node-mgr MyHost -ORBListenEndpoints iiop://localhost:12345 -ORBInitRef ProcessDestinationNC=file://ns.ior"); +#open (OLD_STDIN, "<STDIN"); +#open (STDIN, "") + $pl = new PerlACE::Process ("$ENV{'ACE_ROOT'}/bin/dance", "--log-level 1 -x MockTest.cdp -k file://em.ior"); +} + +$em_status = $em->Spawn(); +sleep 30; +#print STDIN "c\n"; +#open (OLD_STDIN, "<STDIN"); +#open (kid, "|-"); +open (STDIN, "<./plCommand.In"); +$pl_status = $pl->Spawn(); +sleep 10; +#print kid "c\n"; + +#print STDIN "c\n"; +sleep 10; + + +$pl_status = $pl->Kill(); +close (STDIN); +$em_status = $em->Kill(); + +$ns_status = $ns->Kill(); + +$mt_status = $mt->Kill(); + +#delete IOR files +if (-e em.ior) { + unlink "em.ior" +} +if (-e ns.ior) { + unlink "ns.ior" +} + +if ($pl_status != 0) +{ + print "\n ERROR: test returned $pl_status \n"; +} + +exit $pl_status; + diff --git a/CIAO/DAnCE/tests/NameServiceTest/Dummy.idl b/CIAO/DAnCE/tests/NameServiceTest/Dummy.idl new file mode 100644 index 00000000000..1f0edee59cd --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/Dummy.idl @@ -0,0 +1,14 @@ +// $Id$ + +#ifndef DUMMY_IDL +#define DUMMY_IDL + +module NameServiceTest +{ + interface Dummy { + string sayHello(); + }; +}; + +#endif /* DUMMY_IDL */ + diff --git a/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.cpp b/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.cpp new file mode 100644 index 00000000000..7066f38cbc4 --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.cpp @@ -0,0 +1,13 @@ +#include "DummyImpl.h" + +namespace NameServiceTest + { + + char * DummyImpl::sayHello ( + ) + { + return CORBA::string_dup (this->helloSentence); + } + + } // namespace ObjectLocatorTest + diff --git a/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.h b/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.h new file mode 100644 index 00000000000..cca7e1de8f9 --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/DummyImpl.h @@ -0,0 +1,24 @@ +#ifndef DUMMYIMPL_H_ +#define DUMMYIMPL_H_ + +#include "DummyS.h" + +namespace NameServiceTest + { + + class DummyImpl + : public virtual POA_NameServiceTest::Dummy + { + public: + DummyImpl() : helloSentence ("A dummy hello sentence.") {}; + + virtual char * sayHello ( + ); + + private: + const char * helloSentence; + }; + + } // namespace POA_ObjectLocatorTest + +#endif /*DUMMYIMPL_H_*/ diff --git a/CIAO/DAnCE/tests/NameServiceTest/NameServiceTest.mpc b/CIAO/DAnCE/tests/NameServiceTest/NameServiceTest.mpc new file mode 100644 index 00000000000..091c461d669 --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/NameServiceTest.mpc @@ -0,0 +1,30 @@ +// $Id$ + +project(*idl): taoidldefaults { + IDL_Files { + Dummy.idl + } + custom_only = 1 +} + +project (*NameServiceTestServer): dance, taoserver, iortable, naming_serv, dance_logger { + after += *idl + IDL_Files { + } + Source_Files { + srv_main.cpp + DummyC.cpp + DummyS.cpp + DummyImpl.cpp + } +} + +project (NameServiceTestClient): dance, taoclient, naming, dance_logger { + after += *idl + IDL_Files { + } + Source_Files { + clt_main.cpp + DummyC.cpp + } +} diff --git a/CIAO/DAnCE/tests/NameServiceTest/RegistrationPath.h b/CIAO/DAnCE/tests/NameServiceTest/RegistrationPath.h new file mode 100644 index 00000000000..6ecf9197ad3 --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/RegistrationPath.h @@ -0,0 +1,8 @@ +#ifndef REGISTRATIONPATH_H_ +#define REGISTRATIONPATH_H_ + +const char * app_name = "app1"; +const char * inst_name = "inst1"; +const char * port_name = "port1"; + +#endif /*REGISTRATIONPATH_H_*/ diff --git a/CIAO/DAnCE/tests/NameServiceTest/clt_main.cpp b/CIAO/DAnCE/tests/NameServiceTest/clt_main.cpp new file mode 100644 index 00000000000..f25da11c9bd --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/clt_main.cpp @@ -0,0 +1,85 @@ + +#include "ace/String_Base.h" +#include <orbsvcs/orbsvcs/CosNamingC.h> +#include "DAnCE/Logger/Log_Macros.h" +#include "RegistrationPath.h" +#include "DummyC.h" + +using namespace NameServiceTest; + + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService"); +// CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow(naming_obj.in()); +// CosNaming::Name name(1); +// +// name.length(1); +// +// name[0].id = CORBA::string_dup("Dummy"); +// name[0].kind = CORBA::string_dup(""); +// +// CORBA::Object_ptr res_obj = naming->resolve(name); +// if ( CORBA::is_nil(res_obj) ) +// { +// DANCE_ERROR((LM_ERROR, "[%M] Failed to resolve object. The test failed.\n")); +// return 1; +// } +// DANCE_DEBUG((LM_DEBUG, "[%M] resolve object : ok.\n")); +// +// Dummy_var res_dummy_obj = Dummy::_narrow(res_obj); +// if ( CORBA::is_nil(res_dummy_obj) ) +// { +// DANCE_ERROR((LM_ERROR, "[%M] Failed to narrow the resolved object to custom type. The test failed.\n")); +// return 1; +// } +// DANCE_DEBUG((LM_DEBUG, "[%M] resolved object -> dummy : ok.\n")); +// +// DANCE_DEBUG((LM_DEBUG, "[%M] Dummy object returned : %s.", res_dummy_obj->sayHello())); +// DANCE_DEBUG((LM_DEBUG, "[%M] The test succeeded.")); + //glasgow.headquarters.eclipsesp.com:12345 + ACE_CString url = "corbaname:rir:#app1.DeploymentPlan/Dummy"; +// url += app_name; +// url += "/"; +// url += inst_name; +// url += "/"; +// url += port_name; + DANCE_DEBUG((LM_DEBUG, "[%M] URL : %s\n", url.c_str())); + + CORBA::Object_var obj = orb->string_to_object (url.c_str()); + if (CORBA::is_nil (obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to convert url to object. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] URL -> object : ok.\n")); + + Dummy_var dummy_obj = Dummy::_narrow (obj); + if (CORBA::is_nil (dummy_obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to narrow the object to custom type. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] object -> dummy : ok.\n")); + + DANCE_DEBUG((LM_DEBUG, "[%M] Dummy object returned : %C.", dummy_obj->sayHello())); + DANCE_DEBUG((LM_DEBUG, "[%M] The test succeeded.")); + return 0; + } + catch (const CORBA::Exception & e) + { + DANCE_ERROR((LM_ERROR, "[%M] A CORBA exception \"%s\" (%s) was thrown. The test failed." + , e._name(), e._info().c_str())); + return 1; + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] An exception was thrown. The test failed.")); + return 1; + } +} + diff --git a/CIAO/DAnCE/tests/NameServiceTest/run_test.pl b/CIAO/DAnCE/tests/NameServiceTest/run_test.pl new file mode 100755 index 00000000000..719974e5c50 --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/run_test.pl @@ -0,0 +1,73 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; +my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; + +my $iorbase = "server.ior"; +my $server_iorfile = $server->LocalFile ($iorbase); +my $client_iorfile = $client->LocalFile ($iorbase); +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); + +$SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile"); +$CL = $client->CreateProcess ("client", "-k file://$client_iorfile"); +$server_status = $SV->Spawn (); + +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + exit 1; +} + +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +if ($server->GetFile ($iorbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} +if ($client->PutFile ($iorbase) == -1) { + print STDERR "ERROR: cannot set file <$client_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval()); + +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; + $status = 1; +} + +$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval()); + +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + $status = 1; +} + +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); + +exit $status; diff --git a/CIAO/DAnCE/tests/NameServiceTest/srv_main.cpp b/CIAO/DAnCE/tests/NameServiceTest/srv_main.cpp new file mode 100644 index 00000000000..74794ce420b --- /dev/null +++ b/CIAO/DAnCE/tests/NameServiceTest/srv_main.cpp @@ -0,0 +1,71 @@ +#include "ace/OS_NS_stdio.h" +#include <orbsvcs/orbsvcs/CosNamingC.h> +#include <orbsvcs/orbsvcs/Naming/Naming_Loader.h> +#include "DAnCE/Logger/Log_Macros.h" + +#include "DummyC.h" +#include "DummyImpl.h" +#include "RegistrationPath.h" + +using namespace NameServiceTest; + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + int argcm = argc + 2; + char ** argvm = new char* [argcm+1]; + for (int i = 0; i < argc; ++i) + { + argvm[i] = argv[i]; + } + char buf1[32]; + ACE_OS::sprintf (buf1, "-ORBListenEndpoints"); + argvm[argcm-2] = buf1; + char buf2[32]; + ACE_OS::sprintf (buf2, "iiop://:12345"); + argvm[argcm-1] = buf2; + argvm[argcm] = 0; + + CORBA::ORB_var orb = CORBA::ORB_init (argcm, argvm); + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in ()); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager(); + poa_manager->activate(); + + DummyImpl servant; + + PortableServer::ObjectId_var id = root_poa->activate_object (&servant); + + Dummy_var dummy_obj = Dummy::_narrow (root_poa->id_to_reference (id));//servant._this(); + + TAO_Naming_Loader loader; + + CORBA::Object_var obj_tmp = loader.create_object (orb.in(), argcm, argvm); + CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService"); + CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow (naming_obj.in()); + + CosNaming::Name name (1); + + name.length (1); + + name[0].id = CORBA::string_dup (app_name); + name[0].kind = CORBA::string_dup ("DeploymentPlan"); + + CosNaming::NamingContext_var naming_app = naming->bind_new_context (name); + + name[0].id = CORBA::string_dup ("Dummy"); + name[0].kind = CORBA::string_dup (""); + naming_app->bind (name, dummy_obj.in()); + + orb->run(); + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] An error has occured.")); + } + return 0; +} + diff --git a/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/NodeApplicationManager-NodeApplication.mpc b/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/NodeApplicationManager-NodeApplication.mpc new file mode 100644 index 00000000000..5f82007e24e --- /dev/null +++ b/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/NodeApplicationManager-NodeApplication.mpc @@ -0,0 +1,8 @@ + +project : dance, dance_deployment_svnt, dance_deployment_stub, dance_node_application_manager, dance_node_application, dance_logger { + exename = NodeApplicationManagerNodeApplicationTest + + Source_Files { + test.cpp + } +} diff --git a/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp b/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp new file mode 100644 index 00000000000..727f691b970 --- /dev/null +++ b/CIAO/DAnCE/tests/NodeApplicationManager-NodeApplication/test.cpp @@ -0,0 +1,47 @@ +#include "DAnCE/Deployment/Deployment_NodeManagerC.h" +#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" +#include "DAnCE/Logger/Log_Macros.h" + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + const char * ior = "file://node_manager.ior"; + CORBA::Object_var obj = orb->string_to_object (ior); + if (CORBA::is_nil (obj)) + { + throw 0; + } + + Deployment::NodeManager_var nm = Deployment::NodeManager::_narrow (obj); + if (CORBA::is_nil (nm)) + { + throw 0; + } + + //get NodeApplicationManager + Deployment::DeploymentPlan plan; + Deployment::NodeApplicationManager_var nam; + nam = nm->preparePlan (plan, Deployment::ResourceCommitmentManager::_nil()); + + //call startLaunch + Deployment::Properties dp; + Deployment::Connections_var dc; + Deployment::Application_ptr app = nam->startLaunch (dp, dc.out()); + Deployment::NodeApplication_var na = Deployment::NodeApplication::_narrow (app); + } + catch (const CORBA::Exception &e) + { + e._tao_print_exception ("DAnCE_NodeManager::main\t\n"); + DANCE_ERROR((LM_ERROR, "[%M] Uncaught CORBA exception\n")); + return 1; + } + catch (...) + { + return 1; + } + + return 0; +} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc b/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc deleted file mode 100644 index 2cc04a9a18a..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest.mpc +++ /dev/null @@ -1,163 +0,0 @@ -// $Id$ - -project(NodeAppTest_RoundTrip_stub): ciao_client_dnc { - sharedname = NodeAppTest_RoundTrip_stub - after += CIAO_DnC_Server - - idlflags += -Wb,stub_export_macro=NODEAPPTEST_ROUNDTRIP_STUB_Export \ - -Wb,stub_export_include=RoundTrip_stub_export.h \ - -Wb,skel_export_macro=NODEAPPTEST_ROUNDTRIP_SVNT_Export \ - -Wb,skel_export_include=RoundTrip_svnt_export.h - dynamicflags = NODEAPPTEST_ROUNDTRIP_STUB_BUILD_DLL - - IDL_Files { - NodeAppTest_RoundTrip.idl - } - - Source_Files { - NodeAppTest_RoundTripC.cpp - } - - Header_Files { - NodeAppTest_RoundTripC.h - } - - Inline_Files { - NodeAppTest_RoundTripC.inl - } -} - -project(NodeAppTest_RoundTrip_svnt) : ciao_servant_dnc { - after += NodeAppTest_RoundTrip_stub - sharedname = NodeAppTest_RoundTrip_svnt - - libs += NodeAppTest_RoundTrip_stub - idlflags += -Wb,export_macro=NODEAPPTEST_ROUNDTRIP_SVNT_Export \ - -Wb,export_include=RoundTrip_svnt_export.h - dynamicflags = NODEAPPTEST_ROUNDTRIP_SVNT_BUILD_DLL - - CIDL_Files { - NodeAppTest_RoundTrip.cidl - } - - IDL_Files { - NodeAppTest_RoundTripE.idl - } - - Source_Files { - NodeAppTest_RoundTripEC.cpp - NodeAppTest_RoundTripS.cpp - NodeAppTest_RoundTrip_svnt.cpp - } - - Header_Files { - NodeAppTest_RoundTripEC.h - NodeAppTest_RoundTripS.h - NodeAppTest_RoundTrip_svnt.h - } - - Inline_Files { - NodeAppTest_RoundTripEC.inl - NodeAppTest_RoundTripS.inl - } -} - -project(NodeAppTest_RoundTrip_exec) : ciao_component_dnc, ciao_events_dnc, ciao_server_dnc { - after += NodeAppTest_RoundTrip_stub NodeAppTest_RoundTrip_svnt - - sharedname = NodeAppTest_RoundTrip_exec - libs += NodeAppTest_RoundTrip_stub NodeAppTest_RoundTrip_svnt - idlflags += -Wb,export_macro=NODEAPPTEST_ROUNDTRIP_EXEC_Export \ - -Wb,export_include=RoundTrip_exec_export.h - dynamicflags = NODEAPPTEST_ROUNDTRIP_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - RoundTrip_exec.cpp - } - - Header_Files { - RoundTrip_exec.h - } - - Inline_Files { - } -} - -project (NodeAppTest_client_simple) : ciao_deployment_stub { - after += NodeAppTest_RoundTrip_stub - libs += NodeAppTest_RoundTrip_stub - exename += client_simple - - IDL_Files { - } - - Source_Files { - NodeApp_test_client_simple.cpp - } - - Header_Files { - } - - Inline_Files { - } -} - -project (NodeAppTest_client) : ciao_deployment_stub { - after += NodeAppTest_RoundTrip_stub - libs += NodeAppTest_RoundTrip_stub - exename += client - - IDL_Files { - } - - Source_Files { - NodeApp_test_client.cpp - } - - Header_Files { - } - - Inline_Files { - } -} - -project (NodeAppTest_client_ex) : ciao_deployment_stub { - after += NodeAppTest_RoundTrip_stub - libs += NodeAppTest_RoundTrip_stub - exename += client_ex - - IDL_Files { - } - - Source_Files { - NodeApp_test_client_ex.cpp - } - - Header_Files { - } - - Inline_Files { - } -} - -project (NodeAppTest_client_dynamic) : ciao_deployment_stub { - after += NodeAppTest_RoundTrip_stub - libs += NodeAppTest_RoundTrip_stub - exename += client_dynamic - - IDL_Files { - } - - Source_Files { - NodeApp_test_client_dynamic.cpp - } - - Header_Files { - } - - Inline_Files { - } -} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl b/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl deleted file mode 100644 index 3063a673d5a..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.cidl +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ - -#ifndef NODEAPPTEST_ROUNDTRIP_CIDL -#define NODEAPPTEST_ROUNDTRIP_CIDL - -#include "NodeAppTest_RoundTrip.idl" - -composition session RoundTrip_Impl -{ - - home executor RoundTripHome_Exec - { - implements NodeAppTest::NodeAppTest_RoundTripHome; - manages RoundTrip_Exec; - }; - -}; - -#endif /* NODEAPPTEST_ROUNDTRIP_CIDL */ diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.idl b/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.idl deleted file mode 100644 index ca7397916b8..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip.idl +++ /dev/null @@ -1,34 +0,0 @@ -// $Id$ - -//============================================================================= -/** - * @file NodeAppTest_RoundTrip.idl - * - * Definition of the Component that provides the LatencyTest interface - * - */ -//============================================================================= -#ifndef NODEAPP_ROUNDTRIP_IDL -#define NODEAPP_ROUNDTRIP_IDL - -#include <Components.idl> - -module NodeAppTest -{ - interface LatencyTest - { - long cube_long (in long param); - }; - - component NodeAppTest_RoundTrip supports LatencyTest - { - provides LatencyTest facet_1; - provides LatencyTest facet_2; - }; - - home NodeAppTest_RoundTripHome manages NodeAppTest_RoundTrip - { - }; - -}; -#endif /* NODEAPP_ROUNDTRIP_IDL */ diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp b/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp deleted file mode 100644 index 08950a08b9b..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// $Id$ - -// This test tries to install a set of components in 2 different containers, which -// is hosted in the same NodeApplication. - -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "Client_init.h" -#include "NodeAppTest_RoundTripC.h" -#include "ace/Get_Opt.h" -#include <sstream> -#include <vector> -#include <stdlib.h> -#include "assert.h" - -const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior"); -int comp_number = 4; -int counter = 0; - -int parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:n:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case 'n': - comp_number = ACE_OS::atoi (get_opts.opt_arg ()); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s \n" - "-k <NodeApplication ior> \n" - "-n <The number of component instances> \n" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - std::vector<NodeAppTest::NodeAppTest_RoundTrip_var> comp_list; - //std::vector<NodeAppTest::NodeAppTest_RoundTrip_var>::const_iterator iter; - - try - { - if (parse_args (argc, argv) != 0) - return 1; - - CORBA::ULong comp_num (comp_number); - ACE_DEBUG ((LM_DEBUG, "CompNum: %d\n",comp_num)); - - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - CIAO::Client_init (orb.in ()); - - CORBA::Object_var tmp = - orb->string_to_object(ior); - - Deployment::NodeApplication_var node_app = - Deployment::NodeApplication::_narrow (tmp.in ()); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil nodeapplication reference <%s>\n", ior), - 1); - } - - // This is what we will send out of the ContainerImplmentationInfo for the - // first container - - Deployment::ContainerImplementationInfo container_info_1; - CORBA::ULong length_1 = comp_num/2; - container_info_1.impl_infos.length (CORBA::ULong (length_1)); - - CORBA::ULong i; - for (i = 0; i < length_1; ++i) - { - Deployment::ComponentImplementationInfo info; - - std::stringstream tmp; - tmp << "NodeAppTest_RoundTrip:" << counter; - counter = counter + 1; - - // Add the names and entry points of each of the DLLs - info.component_instance_name = - CORBA::string_dup (tmp.str ().c_str ()); - info.executor_dll = CORBA::string_dup ("NodeAppTest_RoundTrip_exec"); - info.executor_entrypt = - CORBA::string_dup ("createRoundTripHome_Impl"); - info.servant_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); - info.servant_entrypt = - CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); - - //Now add the info into the infos - container_info_1.impl_infos[i] = info; - } - - // For debug purpose. - for (i = 0; i < comp_num/2; ++i) - { - std::stringstream tmp; - tmp << "NodeAppTest_RoundTrip:" << i; - - // Add the names and entry points of each of the DLLs - ACE_DEBUG ((LM_DEBUG, - "The info I will send out: \n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", - container_info_1.impl_infos[i].component_instance_name.in (), - container_info_1.impl_infos[i].executor_dll.in (), - container_info_1.impl_infos[i].executor_entrypt.in (), - container_info_1.impl_infos[i].servant_dll.in (), - container_info_1.impl_infos[i].servant_entrypt.in () )); - } - - // This is what we will send out of the ContainerImplmentationInfo for the - // first container - - Deployment::ContainerImplementationInfo container_info_2; - CORBA::ULong length_2 = comp_num - comp_num/2; - container_info_2.impl_infos.length (CORBA::ULong (length_2)); - - for (i = 0; i < length_2; ++i) - { - Deployment::ComponentImplementationInfo info; - - std::stringstream tmp; - tmp << "NodeAppTest_RoundTrip:" << counter; - counter = counter + 1; - - // Add the names and entry points of each of the DLLs - info.component_instance_name = - CORBA::string_dup (tmp.str ().c_str ()); - info.executor_dll = CORBA::string_dup ("NodeAppTest_RoundTrip_exec"); - info.executor_entrypt = - CORBA::string_dup ("createRoundTripHome_Impl"); - info.servant_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); - info.servant_entrypt = - CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); - - //Now add the info into the infos - container_info_2.impl_infos[i] = info; - } - - // For debug purpose. - for (i = 0; i < length_2; ++i) - { - std::stringstream tmp; - tmp << "NodeAppTest_RoundTrip:" << i; - - // Add the names and entry points of each of the DLLs - ACE_DEBUG ((LM_DEBUG, - "The info I will send out: \n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", - container_info_2.impl_infos[i].component_instance_name.in (), - container_info_2.impl_infos[i].executor_dll.in (), - container_info_2.impl_infos[i].executor_entrypt.in (), - container_info_2.impl_infos[i].servant_dll.in (), - container_info_2.impl_infos[i].servant_entrypt.in () )); - } - - // container_info.container_config is not set for now - - ACE_DEBUG ((LM_DEBUG, "Try installing Homes and Components\n")); - - // Create a NodeImplementationInfo sequence - Deployment::NodeImplementationInfo node_info; - node_info.impl_infos.length (2); - node_info.impl_infos[0] = container_info_1; - node_info.impl_infos[1] = container_info_2; - - // Install test component and its home on NodeApplication - Deployment::ComponentInfos_var comp_info = - node_app->install (node_info); - - // store the component refs - for (i = 0; i < comp_num; ++i) - { - comp_list.push_back (NodeAppTest::NodeAppTest_RoundTrip::_narrow - (comp_info[i].component_ref.in ())); - - if (CORBA::is_nil (comp_list[i].in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil RoundTripHome reference: %s \n", - comp_info[i].component_instance_name.in ()), - 1); - } - } - - ACE_DEBUG ((LM_DEBUG, "Installation finished successfully.\n")); - - // Before we can start we have to start. - node_app->start (); - - // Invoke Operation on the components - ACE_DEBUG ((LM_DEBUG, "Try cube_long operation on the Interface \n")); - - for (i = 0; i < comp_num; ++i) - { - - CORBA::Long input = i; - - CORBA::Long output = - (comp_list[i])->cube_long (input); - - if (input*input*input == output) - { - ACE_DEBUG ((LM_DEBUG, - "Return values matched!! on Component: %d \n", - i)); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "Return values did not match: on Component: %d \n", - i)); - ACE_OS::exit (1); - } - } - - ACE_DEBUG ((LM_DEBUG, "Try removing everything\n")); - node_app->remove (); - - ACE_DEBUG ((LM_DEBUG, "Homes and components removed successfully\n")); - - orb->destroy (); - - ACE_DEBUG ((LM_DEBUG, "Test success!!\n")); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught:"); - return 1; - } - - return 0; -} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp b/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp deleted file mode 100644 index 4cf7065221c..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// $Id$ - -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "Client_init.h" -#include "NodeAppTest_RoundTripC.h" -#include "ace/Get_Opt.h" -#include "assert.h" - -const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior"); - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s \n" - "-k <ComponentServer ior> \n" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - try - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) != 0) - return 1; - - CIAO::Client_init (orb.in ()); - - CORBA::Object_var tmp = - orb->string_to_object(ior); - - Deployment::NodeApplication_var node_app = - Deployment::NodeApplication::_narrow(tmp.in ()); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil nodeapplication reference <%s>\n", - ior), - 1); - } - - - ACE_DEBUG ((LM_DEBUG, "Try installing Home and Component\n")); - - Deployment::ComponentImplementationInfo info; - - // Add the names and entry points of each of the DLLs - info.component_instance_name = - CORBA::string_dup ("NodeAppTest_RoundTrip"); - info.executor_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_exec"); - info.executor_entrypt = - CORBA::string_dup ("createRoundTripHome_Impl"); - info.servant_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); - info.servant_entrypt = - CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); - - // Create a ContainerImplementationInfo sequence - Deployment::ContainerImplementationInfo container_info; - container_info.impl_infos.length (1); - container_info.impl_infos[0] = info; - - // Create a NodeImplementationInfo sequence - Deployment::NodeImplementationInfo node_info; - node_info.impl_infos.length (1); - node_info.impl_infos[0] = container_info; - - // Install test component and its home on NodeApplication - Deployment::ComponentInfos_var comp_info = - node_app->install (node_info); - - assert (comp_info->length () == 1); //return 1 component objeref - - const CORBA::ULong i = 0; - Components::CCMObject_var objref = (comp_info[i]).component_ref; - - NodeAppTest::NodeAppTest_RoundTrip_var roundtrip_var = - NodeAppTest::NodeAppTest_RoundTrip::_narrow (objref.in ()); - - if (CORBA::is_nil (roundtrip_var.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil RoundTrip reference\n"), - 1); - } - - // Invoke Operation on the Interface - ACE_DEBUG ((LM_DEBUG, "Try cube_long operation on the Interface \n")); - CORBA::Long input = 1L; - CORBA::Long output = - roundtrip_var->cube_long (input); - - if (input == output) - ACE_DEBUG ((LM_DEBUG, "Retrun values matched!!\n")); - else - { - ACE_DEBUG ((LM_DEBUG, "Return values did not match: failure\n")); - ACE_OS::exit (1); - } - - // Install another set of components - ACE_DEBUG ((LM_DEBUG, "Try installing another component dynamically\n")); - - // Modifying the component instance name since it must be unique - (node_info.impl_infos[0]).impl_infos[0].component_instance_name = - CORBA::string_dup ("NodeAppTest_RoundTrip_2"); - Deployment::ComponentInfos_var comp_info_new = - node_app->install (node_info); - - assert (comp_info_new->length () == 1); //return 1 component objeref - - ACE_DEBUG ((LM_DEBUG, "Try removing the second component and its home\n")); - node_app->remove_component ("NodeAppTest_RoundTrip"); - ACE_DEBUG ((LM_DEBUG, "Component and Home removed successfully\n")); - - ACE_DEBUG ((LM_DEBUG, "=====Try removing all remaining components and homes\n")); - node_app->remove (); - ACE_DEBUG ((LM_DEBUG, "=====Components and Homes removed successfully\n")); - - orb->destroy (); - ACE_DEBUG ((LM_DEBUG, "=====Test success!!\n")); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught:"); - return 1; - } - - return 0; -} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp b/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp deleted file mode 100644 index 9207b2886af..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_ex.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// $Id$ - -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "ciao/Client_init.h" -#include "NodeAppTest_RoundTripC.h" -#include "ace/Get_Opt.h" -#include "assert.h" - -const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior"); - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s \n" - "-k <NodeApplication ior> \n" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - try - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) != 0) - return 1; - - CIAO::Client_init (orb.in ()); - - CORBA::Object_var tmp = - orb->string_to_object(ior); - - Deployment::NodeApplication_var node_app = - Deployment::NodeApplication::_narrow(tmp.in ()); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil NodeApplication reference <%s>\n", - ior), - 1); - } - - - ACE_DEBUG ((LM_DEBUG, "Try installing Home and Component\n")); - - Deployment::ComponentImplementationInfo info; - - // Add the names and entry points of each of the DLLs - info.component_instance_name = - CORBA::string_dup ("NodeAppTest_RoundTrip"); - info.executor_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_exec"); - info.executor_entrypt = - CORBA::string_dup ("createRoundTripHome_Impl"); - info.servant_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); - info.servant_entrypt = - CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); - - // Create a ContainerImplementationInfo sequence - Deployment::ContainerImplementationInfo container_info; - container_info.impl_infos.length (1); - container_info.impl_infos[0] = info; - - // Create a NodeImplementationInfo sequence - Deployment::NodeImplementationInfo node_info; - node_info.impl_infos.length (1); - node_info.impl_infos[0] = container_info; - - // Install test component and its home on NodeApplication - Deployment::ComponentInfos_var comp_info = - node_app->install (node_info); - - assert (comp_info->length () == 1); //return 1 component objeref - - CORBA::ULong i = 0; - Components::CCMObject_var objref = (comp_info[i]).component_ref; - - NodeAppTest::NodeAppTest_RoundTrip_var roundtrip_var = - NodeAppTest::NodeAppTest_RoundTrip::_narrow (objref.in ()); - - if (CORBA::is_nil (roundtrip_var.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil RoundTrip reference\n"), - 1); - } - - // initialize the component - roundtrip_var->ciao_postactivate (); - - //get the provided facets info. - Components::FacetDescriptions_var facets_info = - roundtrip_var->get_all_facets () ; - - if ( facets_info->length () != 2 ) - { - 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 ()))); - - - 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); - - if (input == output) - ACE_DEBUG ((LM_DEBUG, "Retrun values matched!!\n")); - else - { - ACE_DEBUG ((LM_DEBUG, "Return values did not match: failure\n")); - ACE_OS::exit (1); - } - } - - ACE_DEBUG ((LM_DEBUG, "Try removing test component and its home\n")); - node_app->remove (); - ACE_DEBUG ((LM_DEBUG, "Component and Home removed successfully\n")); - - orb->destroy (); - ACE_DEBUG ((LM_DEBUG, "Test success!!\n")); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught:"); - return 1; - } - - return 0; -} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp b/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp deleted file mode 100644 index e29470f3d95..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_simple.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// $Id$ - -#include "DAnCE/Deployment/Deployment_NodeApplicationC.h" -#include "Client_init.h" -#include "NodeAppTest_RoundTripC.h" -#include "ace/Get_Opt.h" -#include "assert.h" - -const ACE_TCHAR *ior = ACE_TEXT ("file://test.ior"); - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s \n" - "-k <ComponentServer ior> \n" - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN(int argc, ACE_TCHAR *argv[]) -{ - try - { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - if (parse_args (argc, argv) != 0) - return 1; - - CIAO::Client_init (orb.in ()); - - CORBA::Object_var tmp = - orb->string_to_object(ior); - - Deployment::NodeApplication_var node_app = - Deployment::NodeApplication::_narrow(tmp.in ()); - - if (CORBA::is_nil (node_app.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil nodeapplication reference <%s>\n", - ior), - 1); - } - - - ACE_DEBUG ((LM_DEBUG, "Try installing Home and Component\n")); - - Deployment::ComponentImplementationInfo info; - - // Add the names and entry points of each of the DLLs - info.component_instance_name = - CORBA::string_dup ("NodeAppTest_RoundTrip"); - info.executor_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_exec"); - info.executor_entrypt = - CORBA::string_dup ("createRoundTripHome_Impl"); - info.servant_dll = - CORBA::string_dup ("NodeAppTest_RoundTrip_svnt"); - info.servant_entrypt = - CORBA::string_dup ( - "create_NodeAppTest_NodeAppTest_RoundTripHome_Servant" - ); - - // Create a ContainerImplementationInfo sequence - Deployment::ContainerImplementationInfo container_info; - container_info.impl_infos.length (1); - container_info.impl_infos[0] = info; - - // Create a NodeImplementationInfo sequence - Deployment::NodeImplementationInfo node_info; - node_info.impl_infos.length (1); - node_info.impl_infos[0] = container_info; - - // Install test component and its home on NodeApplication - Deployment::ComponentInfos_var comp_info = - node_app->install (node_info); - - assert (comp_info->length () == 1); //return 1 component objeref - - const CORBA::ULong i = 0; - Components::CCMObject_var objref = (comp_info[i]).component_ref; - - NodeAppTest::NodeAppTest_RoundTrip_var roundtrip_var = - NodeAppTest::NodeAppTest_RoundTrip::_narrow (objref.in ()); - - if (CORBA::is_nil (roundtrip_var.in ())) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "Nil RoundTrip reference\n"), - 1); - } - - // Invoke Operation on the Interface - ACE_DEBUG ((LM_DEBUG, "Try cube_long operation on the Interface \n")); - CORBA::Long input = 1L; - CORBA::Long output = - roundtrip_var->cube_long (input); - - if (input == output) - ACE_DEBUG ((LM_DEBUG, "Retrun values matched!!\n")); - else - { - ACE_DEBUG ((LM_DEBUG, "Return values did not match: failure\n")); - ACE_OS::exit (1); - } - - ACE_DEBUG ((LM_DEBUG, "Try removing test component and its home\n")); - node_app->remove (); - ACE_DEBUG ((LM_DEBUG, "Component and Home removed successfully\n")); - - orb->destroy (); - ACE_DEBUG ((LM_DEBUG, "Test success!!\n")); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Exception caught:"); - return 1; - } - - return 0; -} diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/README b/CIAO/DAnCE/tests/NodeApplicationTest/README deleted file mode 100644 index ea8fc438089..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/README +++ /dev/null @@ -1,12 +0,0 @@ -$Id$ -This directory contains the basic testing program for NodeApplication. - -client_simple: Test the basic home installation and component creation. - -client: Test the installation of several homes and components. - In this test I use the more convenient method provided - by the NodeApplication to insall multiple components. Aslo - a remove method is called to easily remove all homes and components. - -client_ex: Test the get_all_facet methods provided in the servant of the - component. diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp b/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp deleted file mode 100644 index 044e6acc8af..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// $Id$ - -#include "RoundTrip_exec.h" -#include "CIAO_common.h" - -//-- ACE Scheduling Params -#include "ace/OS_NS_errno.h" - -//================================================================= - -namespace CIDL_RoundTrip_Impl -{ - RoundTrip_exec_i::RoundTrip_exec_i () - { - - } - - RoundTrip_exec_i::~RoundTrip_exec_i () - { - } - - NodeAppTest::CCM_LatencyTest_ptr - RoundTrip_exec_i::get_facet_1 () - { - return new LatencyTest_Impl; - } - - NodeAppTest::CCM_LatencyTest_ptr - RoundTrip_exec_i::get_facet_2 () - { - return new LatencyTest_Impl; - } - - CORBA::Long - RoundTrip_exec_i::cube_long (CORBA::Long data) - { - return data * data * data; - } - - // Operations from Components::SessionComponent - void - RoundTrip_exec_i::set_session_context (Components::SessionContext_ptr) - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "RoundTrip_exec_i::set_session_context\n")); - } - } - - void - RoundTrip_exec_i::ccm_activate () - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "RoundTrip_exec_i::ccm_activate\n")); - } - - } - - void - RoundTrip_exec_i::ccm_passivate () - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "RoundTrip_exec_i::ccm_passivate\n")); - } - } - - void - RoundTrip_exec_i::ccm_remove () - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "RoundTrip_exec_i::ccm_remove\n")); - } - } - - void - RoundTrip_exec_i::ciao_preactivate () - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "RoundTrip_exec_i::ciao_preactivate\n")); - } - - } - - void - RoundTrip_exec_i::ciao_postactivate () - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "RoundTrip_exec_i::ciao_postactivate\n")); - } - } - - RoundTripHome_exec_i::RoundTripHome_exec_i () - { - } - - RoundTripHome_exec_i::~RoundTripHome_exec_i () - { - } - - ::Components::EnterpriseComponent_ptr - RoundTripHome_exec_i::create () - { - return new RoundTrip_exec_i; - } - - // Implementation for the probided inferface. - CORBA::Long - LatencyTest_Impl::cube_long (CORBA::Long data) - { - return data*data*data; - } - - extern "C" NODEAPPTEST_ROUNDTRIP_EXEC_Export - ::Components::HomeExecutorBase_ptr - createRoundTripHome_Impl (void) - { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "Creating Round_trip impl\n")); - } - - return new RoundTripHome_exec_i (); - } -} - diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h b/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h deleted file mode 100644 index d3ac7acd995..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec.h +++ /dev/null @@ -1,129 +0,0 @@ -// -*- C++ -*- - -//============================================================ -/** - * @file RoundTrip_exec.h - * - * $Id$ - * - * Header file for the Executor implementation. - * - * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> - */ -//============================================================ - -#ifndef NODEAPP_ROUNDTRIP_EXEC_H -#define NODEAPP_ROUNDTRIP_EXEC_H - -#include "NodeAppTest_RoundTripEC.h" -#include "RoundTrip_exec_export.h" -#include "tao/LocalObject.h" - -namespace CIDL_RoundTrip_Impl -{ - - /** - * @class RoundTrip_exec_i - * - * RoundTrip executor implementation class. - */ - class NODEAPPTEST_ROUNDTRIP_EXEC_Export RoundTrip_exec_i - : public virtual NodeAppTest::LatencyTest, - public virtual RoundTrip_Exec, - public virtual ::CORBA::LocalObject - { - - public: - /// Default constructor. - RoundTrip_exec_i (); - - /// Operation to test the data - virtual CORBA::Long cube_long (CORBA::Long data); - - /* - virtual ::NodeAppTest::CCM_LatencyTest* - get_latency (); - */ - - NodeAppTest::CCM_LatencyTest_ptr get_facet_1(); - - - NodeAppTest::CCM_LatencyTest_ptr - get_facet_2(); - - // Operations from Components::SessionComponent - virtual void set_session_context (Components::SessionContext_ptr ctx); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - /// Helper function to be called back by timeout_Handler - void pulse (void); - - // CIAO defined methods - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); - - protected: - - /// Destructor. - /** - * Protected destructor to enforce proper memory management - * through the reference counting mechanism. - */ - ~RoundTrip_exec_i (); - - }; - - // - // - // - class LatencyTest_Impl : public virtual NodeAppTest::CCM_LatencyTest, - public virtual ::CORBA::LocalObject - { - public: - LatencyTest_Impl () - { - } - - virtual CORBA::Long cube_long (CORBA::Long data); - }; - - /** - * @class RoundTripHome_exec_i - * - * RoundTrip home executor implementation class. - */ - class NODEAPPTEST_ROUNDTRIP_EXEC_Export RoundTripHome_exec_i : - public virtual RoundTripHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - /// Default ctor. - RoundTripHome_exec_i (); - - // Implicit home operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - - protected: - - /// Destructor. - /** - * Protected destructor to enforce proper memory management - * through the reference counting mechanism. - */ - ~RoundTripHome_exec_i (); - - }; - - extern "C" NODEAPPTEST_ROUNDTRIP_EXEC_Export - ::Components::HomeExecutorBase_ptr createRoundTripHome_Impl (void); -} - -#endif /* NODEAPP_ROUNDTRIPGEN_EXEC_H */ diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h b/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h deleted file mode 100644 index 30f8c3b38d9..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_exec_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl NODEAPPTEST_ROUNDTRIP_EXEC -// ------------------------------ -#ifndef NODEAPPTEST_ROUNDTRIP_EXEC_EXPORT_H -#define NODEAPPTEST_ROUNDTRIP_EXEC_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL */ - -#if !defined (NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL 1 -#endif /* ! NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL */ - -#if defined (NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL) && (NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL == 1) -# if defined (NODEAPPTEST_ROUNDTRIP_EXEC_BUILD_DLL) -# define NODEAPPTEST_ROUNDTRIP_EXEC_Export ACE_Proper_Export_Flag -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* NODEAPPTEST_ROUNDTRIP_EXEC_BUILD_DLL */ -# define NODEAPPTEST_ROUNDTRIP_EXEC_Export ACE_Proper_Import_Flag -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* NODEAPPTEST_ROUNDTRIP_EXEC_BUILD_DLL */ -#else /* NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL == 1 */ -# define NODEAPPTEST_ROUNDTRIP_EXEC_Export -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARATION(T) -# define NODEAPPTEST_ROUNDTRIP_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* NODEAPPTEST_ROUNDTRIP_EXEC_HAS_DLL == 1 */ - -// Set NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE) -# if (ACE_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE */ - -#if (NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_EXEC_TRACE(X) -#else /* (NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define NODEAPPTEST_ROUNDTRIP_EXEC_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (NODEAPPTEST_ROUNDTRIP_EXEC_NTRACE == 1) */ - -#endif /* NODEAPPTEST_ROUNDTRIP_EXEC_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h b/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h deleted file mode 100644 index 1ad37f8e51e..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_stub_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl NODEAPPTEST_ROUNDTRIP_STUB -// ------------------------------ -#ifndef NODEAPPTEST_ROUNDTRIP_STUB_EXPORT_H -#define NODEAPPTEST_ROUNDTRIP_STUB_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL */ - -#if !defined (NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL 1 -#endif /* ! NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL */ - -#if defined (NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL) && (NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL == 1) -# if defined (NODEAPPTEST_ROUNDTRIP_STUB_BUILD_DLL) -# define NODEAPPTEST_ROUNDTRIP_STUB_Export ACE_Proper_Export_Flag -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* NODEAPPTEST_ROUNDTRIP_STUB_BUILD_DLL */ -# define NODEAPPTEST_ROUNDTRIP_STUB_Export ACE_Proper_Import_Flag -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* NODEAPPTEST_ROUNDTRIP_STUB_BUILD_DLL */ -#else /* NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL == 1 */ -# define NODEAPPTEST_ROUNDTRIP_STUB_Export -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARATION(T) -# define NODEAPPTEST_ROUNDTRIP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* NODEAPPTEST_ROUNDTRIP_STUB_HAS_DLL == 1 */ - -// Set NODEAPPTEST_ROUNDTRIP_STUB_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (NODEAPPTEST_ROUNDTRIP_STUB_NTRACE) -# if (ACE_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_STUB_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define NODEAPPTEST_ROUNDTRIP_STUB_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !NODEAPPTEST_ROUNDTRIP_STUB_NTRACE */ - -#if (NODEAPPTEST_ROUNDTRIP_STUB_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_STUB_TRACE(X) -#else /* (NODEAPPTEST_ROUNDTRIP_STUB_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define NODEAPPTEST_ROUNDTRIP_STUB_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (NODEAPPTEST_ROUNDTRIP_STUB_NTRACE == 1) */ - -#endif /* NODEAPPTEST_ROUNDTRIP_STUB_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h b/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h deleted file mode 100644 index 96b74f356bb..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/RoundTrip_svnt_export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl NODEAPPTEST_ROUNDTRIP_SVNT -// ------------------------------ -#ifndef NODEAPPTEST_ROUNDTRIP_SVNT_EXPORT_H -#define NODEAPPTEST_ROUNDTRIP_SVNT_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL */ - -#if !defined (NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL) -# define NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL 1 -#endif /* ! NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL */ - -#if defined (NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL) && (NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL == 1) -# if defined (NODEAPPTEST_ROUNDTRIP_SVNT_BUILD_DLL) -# define NODEAPPTEST_ROUNDTRIP_SVNT_Export ACE_Proper_Export_Flag -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* NODEAPPTEST_ROUNDTRIP_SVNT_BUILD_DLL */ -# define NODEAPPTEST_ROUNDTRIP_SVNT_Export ACE_Proper_Import_Flag -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* NODEAPPTEST_ROUNDTRIP_SVNT_BUILD_DLL */ -#else /* NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL == 1 */ -# define NODEAPPTEST_ROUNDTRIP_SVNT_Export -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARATION(T) -# define NODEAPPTEST_ROUNDTRIP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* NODEAPPTEST_ROUNDTRIP_SVNT_HAS_DLL == 1 */ - -// Set NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE) -# if (ACE_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE */ - -#if (NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE == 1) -# define NODEAPPTEST_ROUNDTRIP_SVNT_TRACE(X) -#else /* (NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define NODEAPPTEST_ROUNDTRIP_SVNT_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (NODEAPPTEST_ROUNDTRIP_SVNT_NTRACE == 1) */ - -#endif /* NODEAPPTEST_ROUNDTRIP_SVNT_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl b/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl deleted file mode 100755 index 65e97232ac6..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl +++ /dev/null @@ -1,47 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("test.ior"); - -for ($iter = 0; $iter <= $#ARGV; $iter++) { - if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { - print "Run_Test Perl script for NodeApplicationTest \n\n"; - print "run_test \n"; - print "\n"; - print "-h -- prints this information\n"; - exit 0; - } -} - - -unlink $iorfile; -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV = new PerlACE::Process ("$CIAO_ROOT/bin/NodeApplication", - "-n -o $iorfile"); - -$CL = new PerlACE::Process ("client", - "-k file://$iorfile -n 4"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$CL->SpawnWaitKill (30); -$status = $SV->Kill (); $SV->TimedWait (1); - -unlink $iorfile; - -exit $status; diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl b/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl deleted file mode 100755 index 6a39f451377..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl +++ /dev/null @@ -1,47 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("test.ior"); - -for ($iter = 0; $iter <= $#ARGV; $iter++) { - if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { - print "Run_Test Perl script for NodeApplicationTest \n\n"; - print "run_test \n"; - print "\n"; - print "-h -- prints this information\n"; - exit 0; - } -} - - -unlink $iorfile; -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV = new PerlACE::Process ("$CIAO_ROOT/bin/NodeApplication", - "-n -o $iorfile"); - -$CL = new PerlACE::Process ("client_ex", - "-k file://$iorfile"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$CL->SpawnWaitKill (30); -$status = $SV->Kill (); $SV->TimedWait (1); - -unlink $iorfile; - -exit $status; diff --git a/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl b/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl deleted file mode 100755 index 4d2a1c9df9d..00000000000 --- a/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl +++ /dev/null @@ -1,47 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("test.ior"); - -for ($iter = 0; $iter <= $#ARGV; $iter++) { - if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { - print "Run_Test Perl script for NodeApplicationTest \n\n"; - print "run_test \n"; - print "\n"; - print "-h -- prints this information\n"; - exit 0; - } -} - - -unlink $iorfile; -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV = new PerlACE::Process ("$CIAO_ROOT/bin/NodeApplication", - "-n -o $iorfile"); - -$CL = new PerlACE::Process ("client_simple", - "-k file://$iorfile "); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$CL->SpawnWaitKill (10); -$status = $SV->Kill (); $SV->TimedWait (1); - -unlink $iorfile; - -exit $status; diff --git a/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/NodeManager-NodeApplicationManager.mpc b/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/NodeManager-NodeApplicationManager.mpc new file mode 100644 index 00000000000..5864a4df895 --- /dev/null +++ b/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/NodeManager-NodeApplicationManager.mpc @@ -0,0 +1,8 @@ + +project : dance_exe, dance_deployment_svnt, dance_deployment_stub, dance_node_application_manager, dance_node_application, dance_logger { + exename = NodeManagerNodeApplicationManagerTest + + Source_Files { + test.cpp + } +} diff --git a/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp b/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp new file mode 100644 index 00000000000..2b60ad8bb9a --- /dev/null +++ b/CIAO/DAnCE/tests/NodeManager-NodeApplicationManager/test.cpp @@ -0,0 +1,41 @@ +#include "DAnCE/Deployment/Deployment_NodeManagerC.h" +#include "DAnCE/Logger/Log_Macros.h" + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + const char * ior = "file://node_manager.ior"; + CORBA::Object_var obj = orb->string_to_object (ior); + if (CORBA::is_nil (obj)) + { + throw 0; + } + + Deployment::NodeManager_var nm = Deployment::NodeManager::_narrow (obj); + if (CORBA::is_nil (nm)) + { + throw 0; + } + + Deployment::DeploymentPlan plan; + Deployment::NodeApplicationManager_ptr nam_ptr = nm->preparePlan (plan, Deployment::ResourceCommitmentManager::_nil()); + DANCE_DEBUG((LM_DEBUG, "[%M] Plan prepared\n")); + + nm->destroyManager (nam_ptr); + DANCE_DEBUG((LM_DEBUG, "[%M] NodeApplicationManager object destroyed\n")); + } + catch (const CORBA::Exception &) + { + DANCE_ERROR((LM_ERROR, "[%M] Uncaught CORBA exception\n")); + return 1; + } + catch (...) + { + return 1; + } + + return 0; +} diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/Dummy.idl b/CIAO/DAnCE/tests/ObjectLocatorTest/Dummy.idl new file mode 100644 index 00000000000..b91938cb4df --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/Dummy.idl @@ -0,0 +1,13 @@ +// $Id$ +#ifndef DUMMY_IDL +#define DUMMY_IDL + +module ObjectLocatorTest +{ + interface Dummy { + string sayHello(); + }; +}; + +#endif /* DUMMY_IDL */ + diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.cpp b/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.cpp new file mode 100644 index 00000000000..a84441fe146 --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.cpp @@ -0,0 +1,13 @@ +#include "DummyImpl.h" + +namespace ObjectLocatorTest + { + + char * DummyImpl::sayHello ( + ) + { + return CORBA::string_dup (this->helloSentence); + } + + } // namespace ObjectLocatorTest + diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.h b/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.h new file mode 100644 index 00000000000..83671cbf84e --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/DummyImpl.h @@ -0,0 +1,24 @@ +#ifndef DUMMYIMPL_H_ +#define DUMMYIMPL_H_ + +#include "DummyS.h" + +namespace ObjectLocatorTest + { + + class DummyImpl + : public virtual POA_ObjectLocatorTest::Dummy + { + public: + DummyImpl() : helloSentence ("A dummy hello sentence.") {}; + + virtual char * sayHello ( + ); + + private: + const char * helloSentence; + }; + + } // namespace POA_ObjectLocatorTest + +#endif /*DUMMYIMPL_H_*/ diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/ObjectLocatorTest.mpc b/CIAO/DAnCE/tests/ObjectLocatorTest/ObjectLocatorTest.mpc new file mode 100644 index 00000000000..caf05417148 --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/ObjectLocatorTest.mpc @@ -0,0 +1,27 @@ + +project (ObjectLocatorTestServer): dance, taoserver, iortable, dance_redirection_service, dance_logger { + exename = ObjectLocatorTestServer + + IDL_Files { + Dummy.idl + } + + Source_Files { + srv_main.cpp + DummyC.cpp + DummyS.cpp + DummyImpl.cpp + } +} + +project (ObjectLocatorTestClient): dance, taoclient, anytypecode, dance_logger { + + after += ObjectLocatorTestServer + exename = ObjectLocatorTestClient + + Source_Files { + clt_main.cpp + DummyC.cpp + DummyS.cpp + } +} diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/RegistrationPath.h b/CIAO/DAnCE/tests/ObjectLocatorTest/RegistrationPath.h new file mode 100644 index 00000000000..6ecf9197ad3 --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/RegistrationPath.h @@ -0,0 +1,8 @@ +#ifndef REGISTRATIONPATH_H_ +#define REGISTRATIONPATH_H_ + +const char * app_name = "app1"; +const char * inst_name = "inst1"; +const char * port_name = "port1"; + +#endif /*REGISTRATIONPATH_H_*/ diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/clt_main.cpp b/CIAO/DAnCE/tests/ObjectLocatorTest/clt_main.cpp new file mode 100644 index 00000000000..361d70dbc00 --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/clt_main.cpp @@ -0,0 +1,56 @@ + +#include "ace/String_Base.h" +#include "DAnCE/Logger/Log_Macros.h" +#include "RegistrationPath.h" +#include "DummyC.h" + +using namespace ObjectLocatorTest; + + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + ACE_CString url = "corbaloc:iiop:glasgow.headquarters.eclipsesp.com:12345/"; + url += app_name; + url += "/"; + url += inst_name; + url += "/"; + url += port_name; + DANCE_DEBUG((LM_DEBUG, "[%M] URL : %s\n", url.c_str())); + + CORBA::Object_var obj = orb->string_to_object (url.c_str()); + if (CORBA::is_nil (obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to convert url to object. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] URL -> object : ok.\n")); + + Dummy_var dummy_obj = Dummy::_narrow (obj); + if (CORBA::is_nil (dummy_obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to narrow the object to custom type. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] object -> dummy : ok.\n")); + + DANCE_DEBUG((LM_DEBUG, "[%M] Dummy object returned : %s.", dummy_obj->sayHello())); + DANCE_DEBUG((LM_DEBUG, "[%M] The test succeeded.")); + return 0; + } + catch (CORBA::Exception & e) + { + DANCE_ERROR((LM_ERROR, "[%M] A CORBA exception \"%s\" (%s) was thrown. The test failed." + , e._name(), e._info().c_str())); + return 1; + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] An exception was thrown. The test failed.")); + return 1; + } +} + diff --git a/CIAO/DAnCE/tests/ObjectLocatorTest/srv_main.cpp b/CIAO/DAnCE/tests/ObjectLocatorTest/srv_main.cpp new file mode 100644 index 00000000000..45086a67704 --- /dev/null +++ b/CIAO/DAnCE/tests/ObjectLocatorTest/srv_main.cpp @@ -0,0 +1,55 @@ + +#include "ace/OS_NS_stdio.h" + +#include "DummyC.h" +#include "DummyImpl.h" +#include "RedirectionService/CCMObjectLocator.h" +#include "RegistrationPath.h" +#include "DAnCE/Logger/Log_Macros.h" + +using namespace ObjectLocatorTest; + + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + try + { + int argcm = argc + 2; + char ** argvm = new ACE_TCHAR* [argcm+1]; + for (int i = 0; i < argc; ++i) + { + argvm[i] = argv[i]; + } + ACE_TCHAR buf1[32]; + ACE_OS::sprintf (buf1, ACE_TEXT("-ORBListenEndpoints")); + argvm[argcm-2] = buf1; + char buf2[32]; + ACE_OS::sprintf (buf2, ACE_TEXT("iiop://:12345")); + argvm[argcm-1] = buf2; + argvm[argcm] = 0; + CORBA::ORB_var orb = CORBA::ORB_init (argcm, argvm); + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in ()); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager(); + poa_manager->activate(); + + DAnCE::CCMObjectLocator locator (orb.in(), root_poa.in(), "Dummy"); + + DummyImpl servant; + + PortableServer::ObjectId_var id = root_poa->activate_object (&servant); + Dummy_var dummy_obj = Dummy::_narrow (root_poa->id_to_reference (id));//servant._this(); + + locator.register_object (app_name, inst_name, port_name, dummy_obj); + + orb->run(); + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] An error has occured.")); + } + return 0; +} + diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl b/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl new file mode 100644 index 00000000000..5925a4ceeba --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/Dummy.idl @@ -0,0 +1,13 @@ +// $Id$ +#ifndef DUMMY_IDL +#define DUMMY_IDL + +module Test +{ + interface Dummy { + string sayHello(); + }; +}; + +#endif /* DUMMY_IDL */ + diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp b/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp new file mode 100644 index 00000000000..92a0f9bf474 --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.cpp @@ -0,0 +1,13 @@ +#include "DummyImpl.h" + +namespace Test + { + + char * DummyImpl::sayHello ( + ) + { + return CORBA::string_dup (this->helloSentence); + } + + } // namespace ObjectLocatorTest + diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h b/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h new file mode 100644 index 00000000000..c75204b0495 --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/DummyImpl.h @@ -0,0 +1,24 @@ +#ifndef DUMMYIMPL_H_ +#define DUMMYIMPL_H_ + +#include "DummyS.h" + +namespace Test + { + + class DummyImpl + : public virtual POA_Test::Dummy + { + public: + DummyImpl() : helloSentence ("A dummy hello sentence.") {}; + + virtual char * sayHello ( + ); + + private: + const char * helloSentence; + }; + + } // namespace POA_ObjectLocatorTest + +#endif /*DUMMYIMPL_H_*/ diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc b/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc new file mode 100644 index 00000000000..b587494e045 --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/RedirectionServiceTest.mpc @@ -0,0 +1,25 @@ + +project (*RedirectionServiceTestServer): dance, taoserver, iortable, naming, dance_redirection_service, dance_logger, naming_serv { + exename = RedirectionServiceTestServer + + IDL_Files { + Dummy.idl + } + + Source_Files { + srv_main.cpp + DummyC.cpp + DummyS.cpp + DummyImpl.cpp + } +} + +project (*RedirectionServiceTestClient): dance, taoclient, naming, dance_logger { + after = *RedirectionServiceTestServer + exename = RedirectionServiceTestClient + + Source_Files { + clt_main.cpp + DummyC.cpp + } +} diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h b/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h new file mode 100644 index 00000000000..21a4b5dd91e --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/RegistrationPath.h @@ -0,0 +1,10 @@ +#ifndef REGISTRATIONPATH_H_ +#define REGISTRATIONPATH_H_ +#include "ace/SString.h" + +const ACE_CString node_name = "MyNode"; +const ACE_CString app_name = "app1"; +const ACE_CString inst_name = "inst1"; +const ACE_CString port_name = "port1"; + +#endif /*REGISTRATIONPATH_H_*/ diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp b/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp new file mode 100644 index 00000000000..af42d33e8f1 --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/clt_main.cpp @@ -0,0 +1,110 @@ + +#include "ace/String_Base.h" +#include <orbsvcs/orbsvcs/CosNamingC.h> +#include "DAnCE/Logger/Log_Macros.h" +#include "RegistrationPath.h" +#include "DummyC.h" +#include "ace/OS.h" + +using namespace Test; + +CORBA::ORB_var orb; +CORBA::Object_var naming_obj; + +void inspect () + { + CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow(obj.in()); + CosNaming::BindingList_var bl; + CosNaming::BindingIterator_var bi; + //naming->list(10L, bl.out(), bi.out()); + CosNaming::Name name(1); + name.length(2); + name[0].id = CORBA::string_dup("Host1");//CORBA::string_dup("CcmDance1Test"); + name[1].id = CORBA::string_dup ("CcmDance2_1@Host1"); + name[1].kind = CORBA::string_dup ("DeploymentPlan"); + //name[2].id = CORBA::string_dup("ASSEMBLYANDDEPLOYMENT"); + obj = naming->resolve(name); + DANCE_DEBUG((LM_DEBUG, "[%M] create_external_connections - After resolve\n")); + CosNaming::NamingContext_var CcmDance1Test = CosNaming::NamingContext::_narrow(obj.in()); + CcmDance1Test->list(10L, bl.out(), bi.out()); + bool exit = false; + while (!exit) + { + DANCE_DEBUG((LM_DEBUG, "[%M] create_external_connections - naming size is %u\n", bl->length())); + for ( size_t i = 0; i< bl->length(); i++ ) + { + for ( size_t j = 0; j < (*bl)[i].binding_name.length(); j++ ) + { + DANCE_DEBUG((LM_DEBUG, "create_external_connections - Binding name %s, binding kind %s, binding type %i\n" + , (*bl)[i].binding_name[j].id.in() + , (*bl)[i].binding_name[j].kind.in() + , (*bl)[i].binding_type)); + } + } + if(!bi->next_n(10L, bl.out())) + { + exit = true; + } + } + + } +bool test (const ACE_CString& url) +{ + bool res = false; + try + { + DANCE_DEBUG((LM_DEBUG, "[%M] URL : %s\n", url.c_str())); + + CORBA::Object_var obj = orb->string_to_object (url.c_str()); + if (CORBA::is_nil (obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to convert url to object. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] URL -> object : ok.\n")); + + Dummy_var dummy_obj = Dummy::_narrow (obj); + if (CORBA::is_nil (dummy_obj)) + { + DANCE_ERROR((LM_ERROR, "[%M] Failed to narrow the object to custom type. The test failed.\n")); + return 1; + } + DANCE_DEBUG((LM_DEBUG, "[%M] object -> dummy : ok.\n")); + + DANCE_DEBUG((LM_DEBUG, "[%M] Dummy object returned : %s.\n", dummy_obj->sayHello())); + DANCE_DEBUG((LM_DEBUG, "[%M] The test succeeded.\n")); + res = true; + } + catch (CORBA::Exception & e) + { + DANCE_ERROR((LM_ERROR, "[%M] A CORBA exception \"%s\" (%s) was thrown. The test failed." + , e._name(), e._info().c_str())); + } + catch (...) + { + DANCE_ERROR((LM_ERROR, "[%M] An exception was thrown. The test failed.\n")); + } + + return res; +}; + + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ + orb = CORBA::ORB_init (argc, argv); + + //naming_obj = orb->resolve_initial_references("NameService"); + //glasgow.headquarters.eclipsesp.com:12345 + ACE_CString url = "corbaname::glasgow:12345#" + node_name + "/" + app_name + ".DeploymentPlan" + "/" + inst_name + "/" + port_name + ".Port"; + test (url); + url = "corbaname::glasgow:12345#" + node_name + "/" + app_name + ".DeploymentPlan" + "/" + inst_name + ".Component"; + test (url); + //node_name + "/" + %14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00 + url = "corbaloc:iiop:1.2@glasgow.headquarters.eclipsesp.com:12345/%14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00" + app_name + "/" + inst_name + "/" + port_name; + test (url); + url = "corbaloc:iiop:1.2@glasgow.headquarters.eclipsesp.com:12345/%14%01%0f%00NUP%00%00%00%17%01%00%00%00%01%00%00%00RootPOA%00MyNode%00" + app_name + "/" + inst_name; + test (url); + + return 0; +} diff --git a/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp b/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp new file mode 100644 index 00000000000..1158a27e6b1 --- /dev/null +++ b/CIAO/DAnCE/tests/RedirectionServiceTest/srv_main.cpp @@ -0,0 +1,67 @@ +#include "ace/OS_NS_stdio.h" +#include "ace/Get_Opt.h" +#include <orbsvcs/orbsvcs/Naming/Naming_Loader.h> +#include "DAnCE/Logger/Log_Macros.h" +#include "RedirectionService/RedirectionService.h" + +#include "DummyC.h" +#include "DummyImpl.h" +#include "RegistrationPath.h" + +using namespace Test; + +int ACE_TMAIN (int argc, ACE_TCHAR * argv[]) +{ +// try + { + int argcm = argc + 2; + char ** argvm = new char* [argcm+1]; + for (int i = 0; i < argc; ++i) + { + argvm[i] = argv[i]; + } + char buf1[32]; + ACE_OS::sprintf (buf1, "-ORBListenEndpoints"); + argvm[argcm-2] = buf1; + char buf2[32]; + ACE_OS::sprintf (buf2, "iiop://:12345"); + argvm[argcm-1] = buf2; + argvm[argcm] = 0; + + CORBA::ORB_var orb = CORBA::ORB_init (argcm, argvm); + + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in ()); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager(); + poa_manager->activate(); + + DummyImpl servant; + + PortableServer::ObjectId_var id = root_poa->activate_object (&servant); + + Dummy_var dummy_obj = Dummy::_narrow (root_poa->id_to_reference (id));//servant._this(); + + TAO_Naming_Loader loader; + + CORBA::Object_var obj_tmp = loader.create_object (orb.in(), argcm, argvm); + CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService"); + CosNaming::NamingContext_var naming = CosNaming::NamingContext::_narrow (naming_obj.in()); + + DAnCE::RedirectionService redirection (orb.in(), root_poa.in(), naming.in(), CosNaming::NamingContext::_nil(), true, true); + + redirection.registration_start (node_name, app_name); + redirection.registration (node_name, app_name, inst_name, port_name, dummy_obj.in()); + DANCE_DEBUG((LM_DEBUG, "[%M] Registration for port have finished.\n\n")); + redirection.registration (node_name, app_name, inst_name, /*CORBA::Object::_nil()*/dummy_obj.in()); + DANCE_DEBUG((LM_DEBUG, "[%M] Registration for component have finished.\n\n")); + redirection.registration_finish (node_name, app_name); + orb->run(); + } +// catch (...) +// { +// DANCE_ERROR((LM_ERROR, "[%M] An error has occured.")); +// } + return 0; +} + diff --git a/CIAO/DAnCE/tests/scripts/BasicSP/basicsp.dat b/CIAO/DAnCE/tests/scripts/BasicSP/basicsp.dat index ab4b1faf954..8bd5e6a72f6 100644 --- a/CIAO/DAnCE/tests/scripts/BasicSP/basicsp.dat +++ b/CIAO/DAnCE/tests/scripts/BasicSP/basicsp.dat @@ -1,2 +1,3 @@ BMClosedED corbaloc:iiop:localhost:10000/NodeManager -EC corbaloc:iiop:localhost:20000/NodeManager
\ No newline at end of file +EC corbaloc:iiop:localhost:20000/NodeManager + diff --git a/CIAO/DevGuideExamples/Messenger/Administrator.mpc b/CIAO/DevGuideExamples/Messenger/Administrator.mpc deleted file mode 100644 index 54bb3a3878b..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Administrator.mpc +++ /dev/null @@ -1,121 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl -p Messenger Administrator" - -project(Messenger_Administrator_idl_gen) : taoidldefaults, anytypecode { - avoids += ace_for_tao - custom_only = 1 - idlflags += -Wb,stub_export_macro=ADMINISTRATOR_STUB_Export \ - -Wb,stub_export_include=Administrator_stub_export.h \ - -Wb,skel_export_macro=ADMINISTRATOR_SVNT_Export \ - -Wb,skel_export_include=Administrator_svnt_export.h - - IDL_Files { - Administrator.idl - } -} - -project(Messenger_Administrator_cidl_gen) : ciaocidldefaults, taoidldefaults { - avoids += ace_for_tao - custom_only = 1 - cidlflags += --svnt-export-macro ADMINISTRATOR_SVNT_Export \ - --svnt-export-include Administrator_svnt_export.h - idlflags += -Wb,export_macro=ADMINISTRATOR_EXEC_Export \ - -Wb,export_include=Administrator_exec_export.h \ - -SS - - CIDL_Files { - Administrator.cidl - } - - IDL_Files { - AdministratorE.idl - } -} - -project(Messenger_Administrator_stub) : ciao_client_dnc { - avoids += ace_for_tao - after += Messenger_Administrator_idl_gen Messenger_stub - libs += Messenger_stub - - sharedname = Administrator_stub - dynamicflags = ADMINISTRATOR_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - AdministratorC.cpp - } - - Header_Files { - AdministratorC.h - Administrator_stub_export.h - } - - Inline_Files { - AdministratorC.inl - } -} - -project(Messenger_Administrator_exec) : ciao_component_dnc { - avoids += ace_for_tao - after += Messenger_Administrator_cidl_gen Messenger_Administrator_stub - sharedname = Administrator_exec - libs += Administrator_stub Messenger_stub - - dynamicflags = ADMINISTRATOR_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - AdministratorEC.cpp - Administrator_exec_i.cpp - } - - Header_Files { - AdministratorEC.h - Administrator_exec_i.h - Administrator_exec_export.h - } - - Inline_Files { - AdministratorEC.inl - } -} - - -project(Messenger_Administrator_svnt) : ciao_servant_dnc { - avoids += ace_for_tao - after += Messenger_svnt Messenger_Administrator_exec - sharedname = Administrator_svnt - libs += Administrator_exec \ - Administrator_stub \ - Messenger_svnt \ - Messenger_stub - - dynamicflags = ADMINISTRATOR_SVNT_BUILD_DLL - - CIDL_Files { - } - - IDL_Files { - } - - Source_Files { - AdministratorS.cpp - Administrator_svnt.cpp - } - - Header_Files { - AdministratorS.h - Administrator_svnt.h - Administrator_svnt_export.h - } - - Inline_Files { - AdministratorS.inl - } -} - - diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc b/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc deleted file mode 100644 index 03c707ce33a..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -project(Administrator_Client_IDL2_Compile): taoidl3toidl2defaults { - // ensures that only idl3-to-idl2 processing is performed - custom_only = 1 - - idl3toidl2flags += -I. -o idl2 - - IDL3TOIDL2_Files { - gendir = idl2 - Runnable.idl - Publication.idl - Message.idl - History.idl - Administrator.idl - Messenger.idl - } -} - -project(Administrator_Client_IDL2): ciao_client_dnc, valuetype { - after += Administrator_Client_IDL2_Compile - - exename = Administrator_Client_IDL2 - idlflags += -Sm -Iidl2 -o idl2 -SS - - IDL_Files { - gendir = idl2 - idl2/Runnable_IDL2.idl - idl2/Publication_IDL2.idl - idl2/Message_IDL2.idl - idl2/History_IDL2.idl - idl2/Administrator_IDL2.idl - idl2/Messenger_IDL2.idl - } - - Source_Files { - Administrator_Client_IDL2.cpp - idl2/Administrator_IDL2C.cpp - idl2/Messenger_IDL2C.cpp - idl2/Publication_IDL2C.cpp - idl2/Runnable_IDL2C.cpp - idl2/History_IDL2C.cpp - idl2/Message_IDL2C.cpp - } -} diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc b/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc deleted file mode 100644 index 60afb1f457c..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc +++ /dev/null @@ -1,29 +0,0 @@ -// $Id$ - -// @file Administrator_Client_IDL3.mpc -// -// @author Don Busch <busch_d@ociweb.com> - -project(Administrator_Client_IDL3): ciao_client_dnc, valuetype { - after += Messenger_stub - libs += Messenger_stub - after += Administrator_Client_IDL2_Compile - - exename = Administrator_Client_IDL3 - - IDL_Files { - // IDL stubs are linked from the Messenger_stub library; - // this empty section prevents all of the IDL stub code from - // being linked into this executable as well - } - - Header_Files { - // this empty section prevents all of the header files - // being includes in this project - } - - Source_Files { - Administrator_Client_IDL3.cpp - } -} - diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.cpp b/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.cpp deleted file mode 100644 index e10ba645b40..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#include "Administrator_exec_i.h" -#include "ciao/CIAO_common.h" - -// MY CODE -#include <iostream> -#include <string> - -namespace CIDL_Administrator_Impl -{ - //================================================================== - // Component Executor Implementation Class: Administrator_exec_i - //================================================================== - - Administrator_exec_i::Administrator_exec_i (void) - { - } - - Administrator_exec_i::~Administrator_exec_i (void) - { - } - - // Supported or inherited operations. - - // Attribute operations. - - // Port operations. - - // Operations from Components::SessionComponent - - void - Administrator_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::CCM_Administrator_Context::_narrow (ctx); - - if (CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - Administrator_exec_i::ccm_activate () - { - // Your code here. - - // MY CODE - ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_activate\n" ))); - - // Activate the Task - this->activate(); - } - - void - Administrator_exec_i::ccm_passivate () - { - // Your code here. - - // MY CODE - ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_passivate\n" ))); - } - - void - Administrator_exec_i::ccm_remove () - { - // Your code here. - ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_remove\n"))); - } - - void - Administrator_exec_i::ciao_preactivate () - { - // Your code here. - ACE_DEBUG((LM_INFO, ACE_TEXT("ciao_preactivate\n"))); - } - - void - Administrator_exec_i::ciao_postactivate () - { - // Your code here. - ACE_DEBUG((LM_INFO, ACE_TEXT("ciao_postactivate\n"))); - } - - // Overridden from ACE_Task_Base - int - Administrator_exec_i::svc() - { - enum SelectionType { START=1, STOP, CHANGE_PERIOD, CHANGE_TEXT,EXIT }; - - bool done = false; - do { - std::cout << "\nWhat do you want to do to the Messenger(s)?" << std::endl; - std::cout << START << ". Start" << std::endl; - std::cout << STOP << ". Stop" << std::endl; - std::cout << CHANGE_PERIOD << ". Change Publication Period" << std::endl; - std::cout << CHANGE_TEXT << ". Change Publication Text" << std::endl; - std::cout << EXIT << ". Exit" << std::endl; - - char selection_text[10]; - std::cout << "Please enter a selection: "; - std::cin.getline( selection_text, sizeof(selection_text) ); - int selection = ACE_OS::atoi(selection_text); - - switch (selection) { - case START: - startPublishing(); - break; - case STOP: - stopPublishing(); - break; - case CHANGE_PERIOD: - changePublicationPeriod(); - break; - case CHANGE_TEXT: - changePublicationText(); - break; - case EXIT: { - done = true; - break; - } - default: - std::cout << "Please enter a valid option" << std::endl; - } - } while ( !done ); - - return 0; - } - - void Administrator_exec_i::startPublishing() - { - // Get the attached Runnable facet(s) - ::Administrator::runnablesConnections_var connections = - this->context_->get_connections_runnables(); - - std::cout << "Starting Publication" << std::endl; - for ( unsigned int i = 0; i < connections->length(); ++i ) { - Runnable_var runnable = (*connections)[i].objref; - runnable->start(); - } - } - - void Administrator_exec_i::stopPublishing() - { - // Get the attached Runnable facet(s) - ::Administrator::runnablesConnections_var connections = - this->context_->get_connections_runnables(); - - std::cout << "Stopping Publication" << std::endl; - for ( unsigned int i = 0; i < connections->length(); ++i ) { - Runnable_var runnable = (*connections)[i].objref; - runnable->stop(); - } - } - - void Administrator_exec_i::changePublicationPeriod() - { - // Get the attached Publication facet(s) - ::Administrator::contentConnections_var contents = - this->context_->get_connections_content(); - - char period[10]; - std::cout << "Please enter a new period in seconds: "; - std::cin.getline( period, sizeof( period ) ); - for ( unsigned int i = 0; i < contents->length(); ++i ) { - Publication_var publication = (*contents)[i].objref; - publication->period( ACE_OS::atoi(period) ); - } - } - - void Administrator_exec_i::changePublicationText() - { - // Get the attached Publication facet(s) - ::Administrator::contentConnections_var contents = - this->context_->get_connections_content(); - - char buffer[1024]; - std::cout << "Please enter new text: "; - std::cin.getline( buffer, sizeof(buffer) ); - for ( unsigned int i = 0; i < contents->length(); ++i ) { - Publication_var publication = (*contents)[i].objref; - publication->text( buffer ); - } - } - - //================================================================== - // Home Executor Implementation Class: AdministratorHome_exec_i - //================================================================== - - AdministratorHome_exec_i::AdministratorHome_exec_i (void) - { - } - - AdministratorHome_exec_i::~AdministratorHome_exec_i (void) - { - } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - AdministratorHome_exec_i::create () - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - Administrator_exec_i, - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr - create_AdministratorHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_RETURN ( - retval, - AdministratorHome_exec_i, - ::Components::HomeExecutorBase::_nil ()); - - return retval; - } -} diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.h b/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.h deleted file mode 100644 index 55d8bc85b5a..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Administrator_exec_i.h +++ /dev/null @@ -1,111 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#ifndef CIAO_ADMINISTRATOR_EXEC_H -#define CIAO_ADMINISTRATOR_EXEC_H - -#include /**/ "ace/pre.h" - -#include "AdministratorEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Administrator_exec_export.h" -#include "tao/LocalObject.h" - -#include "ace/Task.h" - -namespace CIDL_Administrator_Impl -{ - class ADMINISTRATOR_EXEC_Export Administrator_exec_i - : public virtual Administrator_Exec, - public virtual ::CORBA::LocalObject, - public virtual ACE_Task_Base - { - public: - Administrator_exec_i (void); - virtual ~Administrator_exec_i (void); - - // Supported or inherited operations. - - // Attribute operations. - - // Port operations. - - // Operations from Components::SessionComponent - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - // Overridden from ACE_Task_Base - int svc(); - - private: - - void startPublishing(); - void stopPublishing(); - void changePublicationPeriod(); - void changePublicationText(); - - ::CCM_Administrator_Context_var context_; - }; - - class ADMINISTRATOR_EXEC_Export AdministratorHome_exec_i - : public virtual AdministratorHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - AdministratorHome_exec_i (void); - virtual ~AdministratorHome_exec_i (void); - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - }; - - extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr - create_AdministratorHome_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_ADMINISTRATOR_EXEC_H */ diff --git a/CIAO/DevGuideExamples/Messenger/Messenger.mpc b/CIAO/DevGuideExamples/Messenger/Messenger.mpc deleted file mode 100644 index fcbc9f9d768..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Messenger.mpc +++ /dev/null @@ -1,153 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl Messenger" - -project(Messenger_idl_gen) : taoidldefaults, anytypecode { - avoids += ace_for_tao - custom_only = 1 - idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export \ - -Wb,stub_export_include=Messenger_stub_export.h \ - -Wb,skel_export_macro=MESSENGER_SVNT_Export \ - -Wb,skel_export_include=Messenger_svnt_export.h - - IDL_Files { - Runnable.idl - Publication.idl - Message.idl - History.idl - Messenger.idl - } -} - -project(Messenger_cidl_gen) : ciaocidldefaults, taoidldefaults { - avoids += ace_for_tao - custom_only = 1 - cidlflags += --svnt-export-macro MESSENGER_SVNT_Export \ - --svnt-export-include Messenger_svnt_export.h - idlflags += -Wb,export_macro=MESSENGER_EXEC_Export \ - -Wb,export_include=Messenger_exec_export.h \ - -SS - - CIDL_Files { - Messenger.cidl - } - - IDL_Files { - MessengerE.idl - } -} - -project(Messenger_stub) : ciao_client_dnc { - avoids += ace_for_tao - after += Messenger_idl_gen - libs += - - sharedname = Messenger_stub - dynamicflags = MESSENGER_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - RunnableC.cpp - PublicationC.cpp - MessageC.cpp - HistoryC.cpp - MessengerC.cpp - } - - Header_Files { - RunnableC.h - PublicationC.h - MessageC.h - HistoryC.h - MessengerC.h - Messenger_stub_export.h - } - - Inline_Files { - RunnableC.inl - PublicationC.inl - MessageC.inl - HistoryC.inl - MessengerC.inl - } -} - -project(Messenger_exec) : ciao_component_dnc { - avoids += ace_for_tao - after += Messenger_cidl_gen Messenger_stub - sharedname = Messenger_exec - libs += Messenger_stub - - dynamicflags = MESSENGER_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - MessengerEC.cpp - Messenger_exec_i.cpp - Publication_exec_i.cpp - History_exec_i.cpp - Runnable_exec_i.cpp - } - - Header_Files { - MessengerEC.h - Messenger_exec_i.h - Publication_exec_i.h - History_exec_i.h - Runnable_exec_i.h - Messenger_exec_export.h - } - - Inline_Files { - MessengerEC.inl - } -} - - -project(Messenger_svnt) : ciao_servant_dnc { - avoids += ace_for_tao - after += Messenger_exec - sharedname = Messenger_svnt - libs += Messenger_exec \ - Messenger_stub - - dynamicflags = MESSENGER_SVNT_BUILD_DLL - - CIDL_Files { - } - - IDL_Files { - } - - Source_Files { - RunnableS.cpp - PublicationS.cpp - MessageS.cpp - HistoryS.cpp - MessengerS.cpp - Messenger_svnt.cpp - } - - Header_Files { - RunnableS.h - PublicationS.h - MessageS.h - HistoryS.h - MessengerS.h - Messenger_svnt.h - Messenger_svnt_export.h - } - - Inline_Files { - RunnableS.inl - PublicationS.inl - MessageS.inl - HistoryS.inl - MessengerS.inl - } -} - - diff --git a/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.cpp b/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.cpp deleted file mode 100644 index c1d188b08d2..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#include "Messenger_exec_i.h" -#include "ciao/CIAO_common.h" - -// MY CODE -#include "ace/OS.h" -#include "History_exec_i.h" -#include "Runnable_exec_i.h" -#include "Publication_exec_i.h" - -namespace CIDL_Messenger_Impl -{ - //================================================================== - // Component Executor Implementation Class: Messenger_exec_i - //================================================================== - - Messenger_exec_i::Messenger_exec_i () - : subject_( "Test Subject" ), - user_( "ciao_user" ) - { - this->control_ = new Runnable_exec_i(); - this->history_ = new History_exec_i(); - this->content_ = new Publication_exec_i( - "The quick brown fox jumped over the lazy dog", - 2 ); - } - - Messenger_exec_i::~Messenger_exec_i (void) - { - this->control_->_remove_ref(); - this->history_->_remove_ref(); - this->content_->_remove_ref(); - } - - // MY CODE - int Messenger_exec_i::svc() { - - ACE_DEBUG((LM_INFO, ACE_TEXT("svc()\n"))); - - while (1) - { - ACE_OS::sleep( this->content_->period() ); - - // get the run_lock from the Runnable executor; we have an - // agreement with the Runnable executor that we must posess the - // run_lock to publish - ACE_Guard<ACE_Mutex> guard( this->control_->get_run_lock() ); - - // create a message to publish - ::Message_var msg = new ::OBV_Message(); - msg->subject( this->subject() ); - msg->text( this->content_->text() ); - msg->user( CORBA::string_dup( this->user_.c_str() ) ); - - // add the message to the message history - this->history_->add( msg.in() ); - - ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::svc: publishing message\n") )); - - // publish to all interested consumers - this->context_->push_message_publisher( msg.in() ); - - ACE_DEBUG((LM_INFO, - ACE_TEXT("Published Message on subject %s\n User %s\n Text %s\n"), - msg->subject(), - msg->user(), - msg->text() )); - } - - ACE_DEBUG((LM_INFO, ACE_TEXT("svc(): Gracefully stopping publication\n"))); - return 0; - } - - // Supported or inherited operations. - - // Attribute operations. - - char* - Messenger_exec_i::subject () - { - return CORBA::string_dup( this->subject_.c_str() ); - } - - void - Messenger_exec_i::subject ( const char* subject) - { - this->subject_ = CORBA::string_dup( subject ); - } - - // Port operations. - - ::CCM_Runnable_ptr - Messenger_exec_i::get_control () - { - // Your code here. - - // MY CODE - - // bump up ref count because we give up ownership when we return this - this->control_->_add_ref(); - return this->control_; - } - - ::CCM_Publication_ptr - Messenger_exec_i::get_content () - { - // Your code here. - - // MY CODE - - // bump up ref count because we give up ownership when we return this - this->content_->_add_ref(); - return this->content_; - } - - ::CCM_History_ptr - Messenger_exec_i::get_message_history () - { - // Your code here. - - // MY CODE - - // bump up ref count because we give up ownership when we return this - this->history_->_add_ref(); - return this->history_; - } - - // Operations from Components::SessionComponent - - void - Messenger_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::CCM_Messenger_Context::_narrow (ctx); - - if (CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - Messenger_exec_i::ciao_preactivate () - { - /* Your code here. */ - } - - void - Messenger_exec_i::ciao_postactivate () - { - /* Your code here. */ - } - - void - Messenger_exec_i::ccm_activate () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_activate\n"))); - this->activate(); - } - - void - Messenger_exec_i::ccm_passivate () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_passivate\n"))); - } - - void - Messenger_exec_i::ccm_remove () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_remove\n"))); - } - - //================================================================== - // Home Executor Implementation Class: MessengerHome_exec_i - //================================================================== - - MessengerHome_exec_i::MessengerHome_exec_i (void) - { - } - - MessengerHome_exec_i::~MessengerHome_exec_i (void) - { - } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - MessengerHome_exec_i::create () - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - Messenger_exec_i, - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_MessengerHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_RETURN ( - retval, - MessengerHome_exec_i, - ::Components::HomeExecutorBase::_nil ()); - - return retval; - } -} - diff --git a/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.h b/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.h deleted file mode 100644 index 5de411b5d55..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Messenger_exec_i.h +++ /dev/null @@ -1,135 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#ifndef CIAO_MESSENGER_EXEC_H -#define CIAO_MESSENGER_EXEC_H - -#include /**/ "ace/pre.h" - -#include "MessengerEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Messenger_exec_export.h" -#include "tao/LocalObject.h" - -// MY CODE -#include <string> -#include "ace/Task.h" - -namespace CIDL_Messenger_Impl -{ - class Runnable_exec_i; - class Publication_exec_i; - class History_exec_i; - - class MESSENGER_EXEC_Export Messenger_exec_i - : public virtual Messenger_Exec, - public virtual ::CORBA::LocalObject, - public virtual ACE_Task_Base - { - public: - Messenger_exec_i (void); - virtual ~Messenger_exec_i (void); - - // Supported or inherited operations. - - // Attribute operations. - - virtual char * - subject (); - - virtual void - subject (const char * subject); - - // Port operations. - - virtual ::CCM_Runnable_ptr - get_control (); - - virtual ::CCM_Publication_ptr - get_content (); - - virtual ::CCM_History_ptr - get_message_history (); - - // Operations from Components::SessionComponent - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - // MY CODE - virtual int svc(); - - private: - ::CCM_Messenger_Context_var context_; - - // MY CODE - Runnable_exec_i* control_; - Publication_exec_i* content_; - History_exec_i* history_; - - std::string subject_; - const std::string user_; - }; - - class MESSENGER_EXEC_Export MessengerHome_exec_i - : public virtual MessengerHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - MessengerHome_exec_i (void); - virtual ~MessengerHome_exec_i (void); - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - }; - - extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_MessengerHome_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_MESSENGER_EXEC_H */ - diff --git a/CIAO/DevGuideExamples/Messenger/Receiver.mpc b/CIAO/DevGuideExamples/Messenger/Receiver.mpc deleted file mode 100644 index 475b22f9b3f..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Receiver.mpc +++ /dev/null @@ -1,121 +0,0 @@ -// $Id$ -// This file is generated with "generate_component_mpc.pl -p Messenger Receiver" - -project(Messenger_Receiver_idl_gen) : taoidldefaults, anytypecode { - avoids += ace_for_tao - custom_only = 1 - idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ - -Wb,stub_export_include=Receiver_stub_export.h \ - -Wb,skel_export_macro=RECEIVER_SVNT_Export \ - -Wb,skel_export_include=Receiver_svnt_export.h - - IDL_Files { - Receiver.idl - } -} - -project(Messenger_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { - avoids += ace_for_tao - custom_only = 1 - cidlflags += --svnt-export-macro RECEIVER_SVNT_Export \ - --svnt-export-include Receiver_svnt_export.h - idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ - -Wb,export_include=Receiver_exec_export.h \ - -SS - - CIDL_Files { - Receiver.cidl - } - - IDL_Files { - ReceiverE.idl - } -} - -project(Messenger_Receiver_stub) : ciao_client_dnc { - avoids += ace_for_tao - after += Messenger_Receiver_idl_gen Messenger_stub - libs += Messenger_stub - - sharedname = Receiver_stub - dynamicflags = RECEIVER_STUB_BUILD_DLL - - IDL_Files { - } - - Source_Files { - ReceiverC.cpp - } - - Header_Files { - ReceiverC.h - Receiver_stub_export.h - } - - Inline_Files { - ReceiverC.inl - } -} - -project(Messenger_Receiver_exec) : ciao_component_dnc { - avoids += ace_for_tao - after += Messenger_Receiver_cidl_gen Messenger_Receiver_stub - sharedname = Receiver_exec - libs += Receiver_stub Messenger_stub - - dynamicflags = RECEIVER_EXEC_BUILD_DLL - - IDL_Files { - } - - Source_Files { - ReceiverEC.cpp - Receiver_exec_i.cpp - } - - Header_Files { - ReceiverEC.h - Receiver_exec_i.h - Receiver_exec_export.h - } - - Inline_Files { - ReceiverEC.inl - } -} - - -project(Messenger_Receiver_svnt) : ciao_servant_dnc { - avoids += ace_for_tao - after += Messenger_svnt Messenger_Receiver_exec - sharedname = Receiver_svnt - libs += Receiver_exec \ - Receiver_stub \ - Messenger_svnt \ - Messenger_stub - - dynamicflags = RECEIVER_SVNT_BUILD_DLL - - CIDL_Files { - } - - IDL_Files { - } - - Source_Files { - ReceiverS.cpp - Receiver_svnt.cpp - } - - Header_Files { - ReceiverS.h - Receiver_svnt.h - Receiver_svnt_export.h - } - - Inline_Files { - ReceiverS.inl - } -} - - diff --git a/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.cpp b/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.cpp deleted file mode 100644 index a87fa8ae3ab..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.cpp +++ /dev/null @@ -1,172 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#include "Receiver_exec_i.h" -#include "ciao/CIAO_common.h" - -namespace CIDL_Receiver_Impl -{ - //================================================================== - // Component Executor Implementation Class: Receiver_exec_i - //================================================================== - - Receiver_exec_i::Receiver_exec_i (void) - { - } - - Receiver_exec_i::~Receiver_exec_i (void) - { - } - - // Supported or inherited operations. - - // Attribute operations. - - // Port operations. - - void - Receiver_exec_i::push_message_consumer ( - ::Message * ev) - { - /* Your code here. */ - - // MY CODE - - CORBA::String_var subject = ev->subject(); - CORBA::String_var user = ev->user(); - CORBA::String_var text = ev->text(); - - ACE_DEBUG((LM_INFO, - ACE_TEXT("Received Message:\n Subject: %s\n User: %s\n Text: %s\n"), - subject.in(), - user.in(), - text.in() )); - - // Use the history to (inefficiently) get the total number of messages - // published on this item so far - ::History_var history = - this->context_->get_connection_message_history(); - ::Messages_var messages = history->get_all(); - ACE_DEBUG((LM_INFO, - ACE_TEXT(" Subject \"%s\" has published %d messages so far\n"), - subject.in(), - messages->length() )); - } - - // Operations from Components::SessionComponent - - void - Receiver_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) - { - this->context_ = - ::CCM_Receiver_Context::_narrow (ctx); - - if (CORBA::is_nil (this->context_.in ())) - { - throw ::CORBA::INTERNAL (); - } - } - - void - Receiver_exec_i::ciao_preactivate () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ciao_preactivate\n"))); - } - - void - Receiver_exec_i::ciao_postactivate () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ciao_postactivate\n"))); - } - - void - Receiver_exec_i::ccm_activate () - { - // Your code here. - ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_activate\n"))); - } - - void - Receiver_exec_i::ccm_passivate () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_passivate\n"))); - } - - void - Receiver_exec_i::ccm_remove () - { - /* Your code here. */ - ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_remove\n"))); - } - - //================================================================== - // Home Executor Implementation Class: ReceiverHome_exec_i - //================================================================== - - ReceiverHome_exec_i::ReceiverHome_exec_i (void) - { - } - - ReceiverHome_exec_i::~ReceiverHome_exec_i (void) - { - } - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - ::Components::EnterpriseComponent_ptr - ReceiverHome_exec_i::create () - { - ::Components::EnterpriseComponent_ptr retval = - ::Components::EnterpriseComponent::_nil (); - - ACE_NEW_THROW_EX ( - retval, - Receiver_exec_i, - ::CORBA::NO_MEMORY ()); - - return retval; - } - - extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_ReceiverHome_Impl (void) - { - ::Components::HomeExecutorBase_ptr retval = - ::Components::HomeExecutorBase::_nil (); - - ACE_NEW_RETURN ( - retval, - ReceiverHome_exec_i, - ::Components::HomeExecutorBase::_nil ()); - - return retval; - } -} diff --git a/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.h b/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.h deleted file mode 100644 index 28e1e19f569..00000000000 --- a/CIAO/DevGuideExamples/Messenger/Receiver_exec_i.h +++ /dev/null @@ -1,104 +0,0 @@ -// $Id$ -// -// **** Code generated by the **** -// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** -// CIAO has been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// CIDL Compiler has been developed by: -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about CIAO is available at: -// http://www.dre.vanderbilt.edu/CIAO - -#ifndef CIAO_RECEIVER_EXEC_H -#define CIAO_RECEIVER_EXEC_H - -#include /**/ "ace/pre.h" - -#include "ReceiverEC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Receiver_exec_export.h" -#include "tao/LocalObject.h" - -namespace CIDL_Receiver_Impl -{ - class RECEIVER_EXEC_Export Receiver_exec_i - : public virtual Receiver_Exec, - public virtual ::CORBA::LocalObject - { - public: - Receiver_exec_i (void); - virtual ~Receiver_exec_i (void); - - // Supported or inherited operations. - - // Attribute operations. - - // Port operations. - - virtual void - push_message_consumer ( - ::Message *ev); - - // Operations from Components::SessionComponent - - virtual void - set_session_context ( - ::Components::SessionContext_ptr ctx); - - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); - - virtual void ccm_activate (); - - virtual void ccm_passivate (); - - virtual void ccm_remove (); - - private: - ::CCM_Receiver_Context_var context_; - }; - - class RECEIVER_EXEC_Export ReceiverHome_exec_i - : public virtual ReceiverHome_Exec, - public virtual ::CORBA::LocalObject - { - public: - ReceiverHome_exec_i (void); - virtual ~ReceiverHome_exec_i (void); - - // Supported or inherited operations. - - // Home operations. - - // Factory and finder operations. - - // Attribute operations. - - // Implicit operations. - - virtual ::Components::EnterpriseComponent_ptr - create (); - }; - - extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr - create_ReceiverHome_Impl (void); -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_RECEIVER_EXEC_H */ - diff --git a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc b/CIAO/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc deleted file mode 100644 index 1d6d7510510..00000000000 --- a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc +++ /dev/null @@ -1,18 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(Messenger_StaticDAnCE): ciao_static_dnc_app { - exename = Messenger_StaticDAnCE - requires += dummy_label - - libs += Receiver_stub Administrator_stub Messenger_stub - libs += Receiver_svnt Administrator_svnt Messenger_svnt - libs += Receiver_exec Administrator_exec Messenger_exec - libpaths += .. - - after += Receiver_exec Administrator_exec Messenger_exec - - Source_Files { - StaticDAnCEApp.cpp - } -} diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat b/CIAO/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat deleted file mode 100644 index 75f28747798..00000000000 --- a/CIAO/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat +++ /dev/null @@ -1,4 +0,0 @@ -Administrator_Node corbaloc:iiop:localhost:11000/NodeManager -First_Receiver_Node corbaloc:iiop:localhost:22000/NodeManager -Second_Receiver_Node corbaloc:iiop:localhost:33000/NodeManager -Messenger_Node corbaloc:iiop:localhost:44000/NodeManager diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/run_test.pl b/CIAO/DevGuideExamples/Messenger/descriptors/run_test.pl deleted file mode 100644 index e99fe13b396..00000000000 --- a/CIAO/DevGuideExamples/Messenger/descriptors/run_test.pl +++ /dev/null @@ -1,111 +0,0 @@ -# $Id$ - -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -use Env (ACE_ROOT); -use lib "$ACE_ROOT/bin"; -use PerlACE::Run_Test; - -$emior= PerlACE::LocalFile ("em.ior"); -unlink $emior; -$plior= PerlACE::LocalFile ("pl.ior"); -unlink $plior; - -if (defined $ENV{'CIAO_ROOT'}) { - $CIAO_ROOT = $ENV{'CIAO_ROOT'}; -} -else { - $CIAO_ROOT = $ACE_ROOT/TAO/CIAO; -} - - -$NA = new PerlACE::Process ("$CIAO_ROOT/bin/NodeApplication"); -$NA_cmd = $NA->Executable (); - -$NA1 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:11000 -s $NA_cmd"); - -$NA2 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:22000 -s $NA_cmd"); - -$NA3 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:33000 -s $NA_cmd"); - -$NA4 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:44000 -s $NA_cmd"); - -# Each Node Manager lauches a Node Application process. -open(STDIN, "<admin.dat"); -$Ret1 = $NA1->Spawn (); -if($Ret1 == -1) { - print STDERR "ERROR: Administrator returned <$Ret1>\n" -} - -$Ret2 = $NA2->Spawn (); -if($Ret2 == -1) { - print STDERR "ERROR: Receiver 1 returned <$Ret2>\n" -} - -$Ret3 = $NA3->Spawn (); -if($Ret3 == -1) { - print STDERR "ERROR: Receiver 2 returned <$Ret3>\n" -} - -$Ret4 = $NA4->Spawn (); -if($Ret4 == -1) { - print STDERR "ERROR: Messenger returned <$Ret4>\n" -} - -#Start an Execution Manager -$EM = new PerlACE::Process ("$CIAO_ROOT/bin/Execution_Manager", "-o $emior -i ApplicationNodeMap.dat"); - -$Ret5 = $EM->Spawn (); -if($Ret5 == -1) { - print STDERR "ERROR: Execution Manager returned <$Ret5>\n" -} - -if (PerlACE::waitforfile_timed ($emior, 5) == -1) { - print STDERR "ERROR: cannot find file <$emior>\n"; - $EM->Kill(); - unlink $emior; - exit 1; -} - -sleep(5); -#Start the plan laucnher -$EX = new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-p Application-flattened.cdp -k file://$emior ". - "-o $plior"); - -#Stop the plan launcher -$EX2 = new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-k file://$emior -i file://$plior"); - -$Ret6 = $EX->Spawn (); -if($Ret6 == -1) { - print STDERR "ERROR: plan launcher returned <$Ret6>\n" -} - -sleep(10); - -$Ret7 = $EX2->Spawn (); -if($Ret7 == -1) { - print STDERR "ERROR: plan launcher (shutdown) returned <$Ret7>\n" -} - -sleep(5); - -$NA1->Kill(); -$NA2->Kill(); -$NA3->Kill(); -$NA4->Kill(); -$EX->Kill(); -$EX2->Kill(); -$EM->Kill(); - -unlink $emior; -unlink $plior; - -exit 0; diff --git a/CIAO/MPC/config/ccm.mpb b/CIAO/MPC/config/ccm.mpb new file mode 100644 index 00000000000..a6c49e6b649 --- /dev/null +++ b/CIAO/MPC/config/ccm.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project { + includes += $(CIAO_ROOT)/ccm +} diff --git a/CIAO/MPC/config/ccm_componentserver_stub.mpb b/CIAO/MPC/config/ccm_componentserver_stub.mpb new file mode 100644 index 00000000000..ce5bd47cea2 --- /dev/null +++ b/CIAO/MPC/config/ccm_componentserver_stub.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub { + after += CCM_ComponentServer_stub + libs += CCM_ComponentServer_stub + includes += $(CIAO_ROOT)/DAnCE +} diff --git a/CIAO/MPC/config/ccm_componentserver_svnt.mpb b/CIAO/MPC/config/ccm_componentserver_svnt.mpb new file mode 100644 index 00000000000..e9b80b61dec --- /dev/null +++ b/CIAO/MPC/config/ccm_componentserver_svnt.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_componentserver_stub { + after += CCM_ComponentServer_svnt + libs += CCM_ComponentServer_svnt +} diff --git a/CIAO/MPC/config/ccm_configvalue.mpb b/CIAO/MPC/config/ccm_configvalue.mpb new file mode 100644 index 00000000000..48cca222e92 --- /dev/null +++ b/CIAO/MPC/config/ccm_configvalue.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub { + after += CCM_ConfigValue_Factory + libs += CCM_ConfigValue_Factory +} diff --git a/CIAO/MPC/config/ccm_cookie.mpb b/CIAO/MPC/config/ccm_cookie.mpb new file mode 100644 index 00000000000..060cd137d36 --- /dev/null +++ b/CIAO/MPC/config/ccm_cookie.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub { + after += CCM_Cookie_Factory + libs += CCM_Cookie_Factory +} diff --git a/CIAO/MPC/config/ccm_executor.mpb b/CIAO/MPC/config/ccm_executor.mpb new file mode 100644 index 00000000000..5d588a31939 --- /dev/null +++ b/CIAO/MPC/config/ccm_executor.mpb @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub { +} diff --git a/CIAO/MPC/config/ccm_stub.mpb b/CIAO/MPC/config/ccm_stub.mpb new file mode 100644 index 00000000000..871cbb57062 --- /dev/null +++ b/CIAO/MPC/config/ccm_stub.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project : ifr_client, valuetype, pi, codecfactory, ciao_vcwarnings, tao_output, ccm { + includes += $(CIAO_ROOT) + idlflags += -I$(CIAO_ROOT) + after += CCM_stub + libs += CCM_stub +} diff --git a/CIAO/MPC/config/ccm_svnt.mpb b/CIAO/MPC/config/ccm_svnt.mpb new file mode 100644 index 00000000000..059ac04f717 --- /dev/null +++ b/CIAO/MPC/config/ccm_svnt.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub, portableserver, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { + after += CCM_svnt + libs += CCM_svnt +} diff --git a/CIAO/MPC/config/ciao.mpb b/CIAO/MPC/config/ciao.mpb new file mode 100644 index 00000000000..6a72bc480e6 --- /dev/null +++ b/CIAO/MPC/config/ciao.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project { + includes += $(CIAO_ROOT) $(CIAO_ROOT)/DAnCE + libpaths += $(ACE_ROOT)/lib +} diff --git a/CIAO/MPC/config/ciao_client.mpb b/CIAO/MPC/config/ciao_client.mpb new file mode 100644 index 00000000000..869729f7464 --- /dev/null +++ b/CIAO/MPC/config/ciao_client.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ciao_vcwarnings, tao_output { + after += CIAO_Client + libs += CIAO_Client +} diff --git a/CIAO/MPC/config/ciao_component_dnc.mpb b/CIAO/MPC/config/ciao_component_dnc.mpb deleted file mode 100644 index 7df3f4749d9..00000000000 --- a/CIAO/MPC/config/ciao_component_dnc.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : portableserver, ciao_server_dnc, ciao_events_dnc, tao_output { - after += CIAO_Container - libs += CIAO_Container -} diff --git a/CIAO/MPC/config/ciao_componentserver_configurator.mpb b/CIAO/MPC/config/ciao_componentserver_configurator.mpb new file mode 100644 index 00000000000..4249a379c00 --- /dev/null +++ b/CIAO/MPC/config/ciao_componentserver_configurator.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub, ciao_componentserver_stub, ciao_lib { + after += CIAO_Basic_Configurator + libs += CIAO_Basic_Configurator +} diff --git a/CIAO/MPC/config/ciao_componentserver_stub.mpb b/CIAO/MPC/config/ciao_componentserver_stub.mpb new file mode 100644 index 00000000000..cc318f0b8c5 --- /dev/null +++ b/CIAO/MPC/config/ciao_componentserver_stub.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_componentserver_stub { + after += CIAO_ComponentServer_stub + libs += CIAO_ComponentServer_stub +} diff --git a/CIAO/MPC/config/ciao_componentserver_svnt.mpb b/CIAO/MPC/config/ciao_componentserver_svnt.mpb new file mode 100644 index 00000000000..df1134671df --- /dev/null +++ b/CIAO/MPC/config/ciao_componentserver_svnt.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ciao_componentserver_stub, ccm_componentserver_svnt, ciao_session_container { + after += CIAO_ComponentServer_svnt + libs += CIAO_ComponentServer_svnt +} diff --git a/CIAO/MPC/config/ciao_config_handlers.mpb b/CIAO/MPC/config/ciao_config_handlers.mpb index 69412b873f1..8c78f0bbaca 100644 --- a/CIAO/MPC/config/ciao_config_handlers.mpb +++ b/CIAO/MPC/config/ciao_config_handlers.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_config_handlers_base, dynamicany, typecodefactory { +project : ciao_config_handlers_base, dynamicany, typecodefactory, dance_deployment_stub { verbatim(gnuace, macros) { override no_hidden_visibility = 1 } @@ -9,15 +9,11 @@ project : ciao_config_handlers_base, dynamicany, typecodefactory { XSC_DynAny_Handler \ XSC_Config_Handlers \ XSC_XML_Handlers \ - RT_CCM_Config_Handlers \ - CIAO_Events_Handlers \ Package_Config_Handlers \ XSC_Config_Handlers_Common libs += CIAO_XML_Utils \ XSC_Config_Handlers \ - RT_CCM_Config_Handlers \ - CIAO_Events_Handlers \ Package_Config_Handlers \ XSC_XML_Handlers \ XSC_Config_Handlers_Common \ diff --git a/CIAO/MPC/config/ciao_config_handlers_base.mpb b/CIAO/MPC/config/ciao_config_handlers_base.mpb index 4b5e001febb..9d36eda836b 100644 --- a/CIAO/MPC/config/ciao_config_handlers_base.mpb +++ b/CIAO/MPC/config/ciao_config_handlers_base.mpb @@ -1,6 +1,6 @@ // $Id$ -project : ciao_xml_utils, dynamicany, typecodefactory, exceptions, ciao_events_dnc { +project : ciao_xml_utils, dynamicany, typecodefactory, exceptions { after += XSC_XML_Handlers libs += XSC_XML_Handlers macros += XML_USE_PTHREADS diff --git a/CIAO/MPC/config/ciao_config_manager.mpb b/CIAO/MPC/config/ciao_config_manager.mpb index d37943f3c81..b24e128b799 100755 --- a/CIAO/MPC/config/ciao_config_manager.mpb +++ b/CIAO/MPC/config/ciao_config_manager.mpb @@ -1,7 +1,5 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { - libs += CIAO_Config_Manager - after += Config_Manager +project {//: ciao_container_base { } diff --git a/CIAO/MPC/config/ciao_container_base.mpb b/CIAO/MPC/config/ciao_container_base.mpb new file mode 100644 index 00000000000..2b069aa7906 --- /dev/null +++ b/CIAO/MPC/config/ciao_container_base.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_svnt, avoids_corba_e_compact, avoids_corba_e_micro { + after += CIAO_Container_Base + libs += CIAO_Container_Base +} diff --git a/CIAO/MPC/config/ciao_container_dnc.mpb b/CIAO/MPC/config/ciao_container_dnc.mpb deleted file mode 100644 index 1d4c2770456..00000000000 --- a/CIAO/MPC/config/ciao_container_dnc.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : portableserver, ciao_client_dnc, avoids_corba_e_compact, avoids_corba_e_micro { - after += CIAO_Container - libs += CIAO_Container -} diff --git a/CIAO/MPC/config/ciao_context_impl.mpb b/CIAO/MPC/config/ciao_context_impl.mpb new file mode 100644 index 00000000000..1514876a1d0 --- /dev/null +++ b/CIAO/MPC/config/ciao_context_impl.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_svnt, ciao_container_base, portableserver { + after += CIAO_Context_Impl + libs += CIAO_Context_Impl +} diff --git a/CIAO/MPC/config/ciao_cs_client.mpb b/CIAO/MPC/config/ciao_cs_client.mpb new file mode 100644 index 00000000000..3df571604e1 --- /dev/null +++ b/CIAO/MPC/config/ciao_cs_client.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub, ciao_componentserver_svnt, portableserver { + after += CIAO_CS_Client_svnt + libs += CIAO_CS_Client_svnt +} diff --git a/CIAO/MPC/config/ciao_deployment_stub.mpb b/CIAO/MPC/config/ciao_deployment_stub.mpb deleted file mode 100644 index 651038b0fb0..00000000000 --- a/CIAO/MPC/config/ciao_deployment_stub.mpb +++ /dev/null @@ -1,10 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ciao_client_dnc, ciao_events_base_dnc, messaging { - after += Deployment_stub - libs += CIAO_Deployment_stub - includes += $(CIAO_ROOT)/DAnCE - idlflags += -I$(CIAO_ROOT)/DAnCE - requires += threads -} diff --git a/CIAO/MPC/config/ciao_deployment_svnt.mpb b/CIAO/MPC/config/ciao_deployment_svnt.mpb deleted file mode 100644 index 644feb7f2b6..00000000000 --- a/CIAO/MPC/config/ciao_deployment_svnt.mpb +++ /dev/null @@ -1,8 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ciao_deployment_stub, portableserver, ciao_events_dnc { - after += Deployment_svnt - libs += CIAO_Deployment_svnt - idlflags += -I$(CIAO_ROOT)/DAnCE -} diff --git a/CIAO/MPC/config/ciao_domainapplicationmanager_dnc.mpb b/CIAO/MPC/config/ciao_domainapplicationmanager_dnc.mpb index 31731a84d5d..a37df9b5326 100644 --- a/CIAO/MPC/config/ciao_domainapplicationmanager_dnc.mpb +++ b/CIAO/MPC/config/ciao_domainapplicationmanager_dnc.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_svnt { +project : dance_deployment_svnt { includes += $(CIAO_ROOT)/DomainApplicationManager libs += DomainApplicationManager after += DomainApplicationManager diff --git a/CIAO/MPC/config/ciao_events_base_dnc.mpb b/CIAO/MPC/config/ciao_events_base_dnc.mpb index 9553e9fd826..9a0d938c576 100644 --- a/CIAO/MPC/config/ciao_events_base_dnc.mpb +++ b/CIAO/MPC/config/ciao_events_base_dnc.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : orbsvcslib, ciao_container_dnc, ciao_client_dnc { +project : orbsvcslib, ccm_stub { libs += CIAO_Events_Base after += CIAO_Events_Base } diff --git a/CIAO/MPC/config/ciao_events_dnc.mpb b/CIAO/MPC/config/ciao_events_dnc.mpb index 4589a8ad55e..bcee405f969 100644 --- a/CIAO/MPC/config/ciao_events_dnc.mpb +++ b/CIAO/MPC/config/ciao_events_dnc.mpb @@ -5,8 +5,7 @@ project : ifr_client \ , valuetype \ , pi \ , codecfactory \ - , ciao_container_dnc \ - , ciao_client_dnc \ + , ccm_stub \ , ciao_rtevent_dnc \ , naming \ { diff --git a/CIAO/MPC/config/ciao_exe.mpb b/CIAO/MPC/config/ciao_exe.mpb new file mode 100644 index 00000000000..d182a9c06d5 --- /dev/null +++ b/CIAO/MPC/config/ciao_exe.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project : ciao { + install = $(CIAO_ROOT)/bin +} diff --git a/CIAO/MPC/config/ciao_executionmanager_stub.mpb b/CIAO/MPC/config/ciao_executionmanager_stub.mpb index bea046abd2d..e6b5bdacc63 100644 --- a/CIAO/MPC/config/ciao_executionmanager_stub.mpb +++ b/CIAO/MPC/config/ciao_executionmanager_stub.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { +project : dance_deployment_stub { includes += $(CIAO_ROOT)/DAnCE/ExecutionManager libs += ExecutionManager_stub after += ExecutionManager_stub diff --git a/CIAO/MPC/config/ciao_executor.mpb b/CIAO/MPC/config/ciao_executor.mpb new file mode 100644 index 00000000000..7075659bc02 --- /dev/null +++ b/CIAO/MPC/config/ciao_executor.mpb @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_svnt { +} diff --git a/CIAO/MPC/config/ciao_lib.mpb b/CIAO/MPC/config/ciao_lib.mpb new file mode 100644 index 00000000000..1125dbf77df --- /dev/null +++ b/CIAO/MPC/config/ciao_lib.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project : ciao { + libout = $(ACE_ROOT)/lib +} diff --git a/CIAO/MPC/config/ciao_logger.mpb b/CIAO/MPC/config/ciao_logger.mpb new file mode 100644 index 00000000000..8f54f1b59a3 --- /dev/null +++ b/CIAO/MPC/config/ciao_logger.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- + +project : ciao, messaging { + after += CIAO_Logger + libs += CIAO_Logger +}
\ No newline at end of file diff --git a/CIAO/MPC/config/ciao_nodeapplication.mpb b/CIAO/MPC/config/ciao_nodeapplication.mpb index a21c68e7896..c1854438c7d 100644 --- a/CIAO/MPC/config/ciao_nodeapplication.mpb +++ b/CIAO/MPC/config/ciao_nodeapplication.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub, ciao_nodeapp_configurator { +project : dance_deployment_stub, ciao_nodeapp_configurator { libs += CIAO_NodeApplication after += NodeApplicationLib } diff --git a/CIAO/MPC/config/ciao_nodemanager_stub.mpb b/CIAO/MPC/config/ciao_nodemanager_stub.mpb index f69e5881091..b0252f28d76 100644 --- a/CIAO/MPC/config/ciao_nodemanager_stub.mpb +++ b/CIAO/MPC/config/ciao_nodemanager_stub.mpb @@ -1,9 +1,9 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { +project : dance_deployment_stub { includes += $(CIAO_ROOT)/DAnCE/Interfaces includes += $(CIAO_ROOT)/DAnCE/NodeManager - libs += NodeManager_stub - after += NodeManager_stub + libs += DAnCE_NodeManager_Stub + after += DAnCE_NodeManager_stub } diff --git a/CIAO/MPC/config/ciao_noop_configurator.mpb b/CIAO/MPC/config/ciao_noop_configurator.mpb index 67b3508ee38..dcdc1c82c6f 100644 --- a/CIAO/MPC/config/ciao_noop_configurator.mpb +++ b/CIAO/MPC/config/ciao_noop_configurator.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { +project : dance_deployment_stub { libs += CIAO_NoOp_Configurator after += NoOp_Configurator } diff --git a/CIAO/MPC/config/ciao_port_activator_stub.mpb b/CIAO/MPC/config/ciao_port_activator_stub.mpb new file mode 100644 index 00000000000..1a38e34dc93 --- /dev/null +++ b/CIAO/MPC/config/ciao_port_activator_stub.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : portableserver { + after += CIAO_Port_Activator_stub + libs += CIAO_Port_Activator_stub +} diff --git a/CIAO/MPC/config/ciao_servant.mpb b/CIAO/MPC/config/ciao_servant.mpb new file mode 100644 index 00000000000..4dc7f0263d6 --- /dev/null +++ b/CIAO/MPC/config/ciao_servant.mpb @@ -0,0 +1,5 @@ +//$Id$ +project : ciao_port_activator_stub, ciao_servant_activator, ccm_svnt, ciaocidldefaults, taoidldefaults, ciao_container_base, portableserver, ccm_cookie, ciao_context_impl { + after += CIAO_Servant_Impl + libs += CIAO_Servant_Impl +} diff --git a/CIAO/MPC/config/ciao_servant_activator.mpb b/CIAO/MPC/config/ciao_servant_activator.mpb new file mode 100644 index 00000000000..1c18221f90e --- /dev/null +++ b/CIAO/MPC/config/ciao_servant_activator.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : portableserver, ciao_port_activator_stub { + libs += CIAO_Servant_Activator_stub + after += CIAO_Servant_Activator_stub +} diff --git a/CIAO/MPC/config/ciao_servant_dnc.mpb b/CIAO/MPC/config/ciao_servant_dnc.mpb index c6edf00271b..156a0cb883d 100644 --- a/CIAO/MPC/config/ciao_servant_dnc.mpb +++ b/CIAO/MPC/config/ciao_servant_dnc.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_component_dnc, ciao_deployment_svnt, ciao_events_dnc, ciaocidldefaults, utils, naming { +project : ciao_component_dnc, dance_deployment_svnt, ciaocidldefaults, utils, naming { after += CIAO_Server libs += CIAO_Server } diff --git a/CIAO/MPC/config/ciao_server.mpb b/CIAO/MPC/config/ciao_server.mpb new file mode 100644 index 00000000000..2f26c6bb3b0 --- /dev/null +++ b/CIAO/MPC/config/ciao_server.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : ciao_client, naming, ccm_cookie, ccm_configvalue, \ + avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro, ciao_client { + after += CIAO_Server + libs += CIAO_Server +} diff --git a/CIAO/MPC/config/ciao_server_dnc.mpb b/CIAO/MPC/config/ciao_server_dnc.mpb deleted file mode 100644 index 7b19cab3743..00000000000 --- a/CIAO/MPC/config/ciao_server_dnc.mpb +++ /dev/null @@ -1,7 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project : ciao_client_dnc, ciao_deployment_svnt, utils, naming, ciao_events_dnc, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { - after += CIAO_Server - libs += CIAO_Server -} diff --git a/CIAO/MPC/config/ciao_session_container.mpb b/CIAO/MPC/config/ciao_session_container.mpb new file mode 100644 index 00000000000..d5dd4e0639c --- /dev/null +++ b/CIAO/MPC/config/ciao_session_container.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : utils, \ + ccm_componentserver_stub, ciao_port_activator_stub, ciao_servant_activator, ciao_container_base { + libs += CIAO_Session_Container + after += CIAO_Session_Container +} diff --git a/CIAO/MPC/config/ciao_targetmanager_stub.mpb b/CIAO/MPC/config/ciao_targetmanager_stub.mpb index 59d2a646212..f9cf898c3a0 100644 --- a/CIAO/MPC/config/ciao_targetmanager_stub.mpb +++ b/CIAO/MPC/config/ciao_targetmanager_stub.mpb @@ -3,6 +3,6 @@ project : ciao_nodemanager_stub { includes += $(CIAO_ROOT)/DAnCE/TargetManager - libs += TargetManager_stub + libs += CIAO_TargetManager_stub after += CIAO_TargetManager_stub } diff --git a/CIAO/MPC/config/ciao_targetmanager_svnt.mpb b/CIAO/MPC/config/ciao_targetmanager_svnt.mpb index 6b6ea42cd7e..edfccb7f45d 100644 --- a/CIAO/MPC/config/ciao_targetmanager_svnt.mpb +++ b/CIAO/MPC/config/ciao_targetmanager_svnt.mpb @@ -2,6 +2,6 @@ // $Id$ project : ciao_targetmanager_stub { - libs += TargetManager_svnt + libs += CIAO_TargetManager_svnt after += CIAO_TargetManager_svnt } diff --git a/CIAO/MPC/config/ciao_vcwarnings.mpb b/CIAO/MPC/config/ciao_vcwarnings.mpb index 2f224300656..03a5e886ecb 100644 --- a/CIAO/MPC/config/ciao_vcwarnings.mpb +++ b/CIAO/MPC/config/ciao_vcwarnings.mpb @@ -8,13 +8,13 @@ // with the feature set to 0. feature(vc_avoid_deprecated_warnings) { - specific(vc8, vc9, vc10) { + specific(vc8, vc9) { DisableSpecificWarnings += 4996 } } feature(vc_avoid_dominance_warnings) { - specific(vc8, vc9, vc10) { + specific(vc8, vc9) { DisableSpecificWarnings += 4250 } } diff --git a/CIAO/MPC/config/ciaocidldefaults.mpb b/CIAO/MPC/config/ciaocidldefaults.mpb index 3238837b042..38589f70022 100644 --- a/CIAO/MPC/config/ciaocidldefaults.mpb +++ b/CIAO/MPC/config/ciaocidldefaults.mpb @@ -2,7 +2,6 @@ // $Id$ project { - after += CIDLC // Set the cidl compiler and flags as template values specific { cidlc = $(CIAO_ROOT)/bin/cidlc @@ -10,6 +9,7 @@ project { cidlc_flags = -I $(CIAO_ROOT) \ -I$(CIAO_ROOT)/DAnCE \ -I$(CIAO_ROOT)/ciao \ + -I$(CIAO_ROOT)/ccm \ -I$(TAO_ROOT) \ -I$(TAO_ROOT)/tao \ -I$(TAO_ROOT)/orbsvcs @@ -24,10 +24,7 @@ project { source_outputext = _svnt.cpp header_outputext = _svnt.h generic_outputext = E.idl + documentation_outputext = _Impl.ccd keyword cidlflags = commandflags - - optional (documentation_outputext) { - commandflags (--gen-desc-file) = _Impl.ccd - } } } diff --git a/CIAO/MPC/config/cidlc.mpb b/CIAO/MPC/config/cidlc.mpb index 25ca2f45e86..d2ee254d115 100644 --- a/CIAO/MPC/config/cidlc.mpb +++ b/CIAO/MPC/config/cidlc.mpb @@ -1,11 +1,11 @@ // $Id$ -project: boost_filesystem, boost_regex, exceptions, crosscompile { +project: boost_filesystem, boost_regex, exceptions, crosscompile, boost_system { requires += cidl includes += $(CIAO_ROOT) $(CIAO_ROOT)/CCF $(ACE_ROOT)/contrib/utility libpaths += $(CIAO_ROOT)/CCF/CCF $(ACE_ROOT)/lib - specific(nmake, vc71, vc8) { + specific(nmake, vc71, vc8, vc9) { compile_flags += /wd4290 /wd4800 /wd4250 /wd4355 /wd4996 } diff --git a/CIAO/MPC/config/dance.mpb b/CIAO/MPC/config/dance.mpb new file mode 100644 index 00000000000..6a72bc480e6 --- /dev/null +++ b/CIAO/MPC/config/dance.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project { + includes += $(CIAO_ROOT) $(CIAO_ROOT)/DAnCE + libpaths += $(ACE_ROOT)/lib +} diff --git a/CIAO/MPC/config/dance_cdmw_idl.mpb b/CIAO/MPC/config/dance_cdmw_idl.mpb new file mode 100644 index 00000000000..c1b3a524ca0 --- /dev/null +++ b/CIAO/MPC/config/dance_cdmw_idl.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance { + libs += DAnCE_Cdmw_IDL + after += Cdmw_IDL +} diff --git a/CIAO/MPC/config/dance_component_server.mpb b/CIAO/MPC/config/dance_component_server.mpb new file mode 100644 index 00000000000..5a744e8fa86 --- /dev/null +++ b/CIAO/MPC/config/dance_component_server.mpb @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +project : ciao_client_dnc { + after += DAnCE_ComponentServer_IDL diff --git a/CIAO/MPC/config/dance_component_server_svnt.mpb b/CIAO/MPC/config/dance_component_server_svnt.mpb new file mode 100644 index 00000000000..4ba1eef01b0 --- /dev/null +++ b/CIAO/MPC/config/dance_component_server_svnt.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_svnt { +// after += Cdmw_IDL +// libs += DAnCE_Cdmw_IDL +} diff --git a/CIAO/MPC/config/dance_deployment_stub.mpb b/CIAO/MPC/config/dance_deployment_stub.mpb new file mode 100644 index 00000000000..2b0c8379399 --- /dev/null +++ b/CIAO/MPC/config/dance_deployment_stub.mpb @@ -0,0 +1,10 @@ +// -*- MPC -*- +// $Id$ + +project : ccm_stub, messaging { + after += Deployment_stub + libs += DAnCE_Deployment_stub + includes += $(CIAO_ROOT)/DAnCE + idlflags += -I$(CIAO_ROOT)/DAnCE + requires += threads +} diff --git a/CIAO/MPC/config/dance_deployment_svnt.mpb b/CIAO/MPC/config/dance_deployment_svnt.mpb new file mode 100644 index 00000000000..2a4bf4e5e74 --- /dev/null +++ b/CIAO/MPC/config/dance_deployment_svnt.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : dance_deployment_stub, portableserver, { + after += Deployment_svnt + libs += DAnCE_Deployment_svnt + idlflags += -I$(CIAO_ROOT)/DAnCE +} diff --git a/CIAO/MPC/config/dance_domain_application.mpb b/CIAO/MPC/config/dance_domain_application.mpb new file mode 100644 index 00000000000..8c066cdf365 --- /dev/null +++ b/CIAO/MPC/config/dance_domain_application.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_deployment_svnt, dance_logger { + after += DomainApplication + libs += DAnCE_DomainApplication +} diff --git a/CIAO/MPC/config/dance_domain_application_manager.mpb b/CIAO/MPC/config/dance_domain_application_manager.mpb new file mode 100644 index 00000000000..2fe161b2007 --- /dev/null +++ b/CIAO/MPC/config/dance_domain_application_manager.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_domain_application { + after += DomainApplicationManager + libs += DAnCE_DomainApplicationManager +} diff --git a/CIAO/MPC/config/dance_exe.mpb b/CIAO/MPC/config/dance_exe.mpb new file mode 100644 index 00000000000..0613cfbb41b --- /dev/null +++ b/CIAO/MPC/config/dance_exe.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project : dance { + install = $(DANCE_ROOT)/bin +} diff --git a/CIAO/MPC/config/dance_executionmanager_stub.mpb b/CIAO/MPC/config/dance_executionmanager_stub.mpb new file mode 100644 index 00000000000..f5996522724 --- /dev/null +++ b/CIAO/MPC/config/dance_executionmanager_stub.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_deployment_stub, dance_logger, portableserver, messaging, ifr_client { + libs += DAnCE_ExecutionManager_stub + after += ExecutionManager_stub +} diff --git a/CIAO/MPC/config/dance_extension_stub.mpb b/CIAO/MPC/config/dance_extension_stub.mpb index 4f5353b87bb..d0b678b74bf 100644 --- a/CIAO/MPC/config/dance_extension_stub.mpb +++ b/CIAO/MPC/config/dance_extension_stub.mpb @@ -1,6 +1,6 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { +project : dance_deployment_stub { includes += $(CIAO_ROOT)/DAnCE/Interfaces } diff --git a/CIAO/MPC/config/dance_lib.mpb b/CIAO/MPC/config/dance_lib.mpb new file mode 100644 index 00000000000..9c1c1bd4640 --- /dev/null +++ b/CIAO/MPC/config/dance_lib.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project : dance { + libout = $(ACE_ROOT)/lib +} diff --git a/CIAO/MPC/config/dance_logger.mpb b/CIAO/MPC/config/dance_logger.mpb new file mode 100644 index 00000000000..2c69b3414e2 --- /dev/null +++ b/CIAO/MPC/config/dance_logger.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- + +project : dance, messaging { + after += DAnCE_Logger + libs += DAnCE_Logger +} diff --git a/CIAO/MPC/config/dance_mocks.mpb b/CIAO/MPC/config/dance_mocks.mpb new file mode 100644 index 00000000000..c7395989cbe --- /dev/null +++ b/CIAO/MPC/config/dance_mocks.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project : dance, ccm_stub { + after += dance_mocks, dummy_ccm_container + libs += DAnCE_Mocks Dummy_CCM_Container + libpaths += $(ACE_ROOT)/prism/tests/DAnCE/ciao $(ACE_ROOT)/prism/tests/DAnCE/Mocks + includes += $(ACE_ROOT)/prism/tests/DAnCE $(ACE_ROOT)/prism/tests/DAnCE/Mocks +} diff --git a/CIAO/MPC/config/dance_node_application.mpb b/CIAO/MPC/config/dance_node_application.mpb new file mode 100644 index 00000000000..70bdf6ee265 --- /dev/null +++ b/CIAO/MPC/config/dance_node_application.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_redirection_service, ccm_stub, dance_logger, iortable, naming { + after += NodeApplication + libs += DAnCE_NodeApplication CIAO_Client +} diff --git a/CIAO/MPC/config/dance_node_application_manager.mpb b/CIAO/MPC/config/dance_node_application_manager.mpb new file mode 100644 index 00000000000..52ccfaa255b --- /dev/null +++ b/CIAO/MPC/config/dance_node_application_manager.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_node_application, dynamicinterface { + after += NodeApplicationManager + libs += DAnCE_NodeApplicationManager +} diff --git a/CIAO/MPC/config/dance_node_manager.mpb b/CIAO/MPC/config/dance_node_manager.mpb new file mode 100644 index 00000000000..93a4d3cff8b --- /dev/null +++ b/CIAO/MPC/config/dance_node_manager.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, dance_node_application_manager, naming_serv { + after += Node_Manager_Module + libs += DAnCE_NodeManager +} diff --git a/CIAO/MPC/config/dance_nodemanager_stub.mpb b/CIAO/MPC/config/dance_nodemanager_stub.mpb new file mode 100644 index 00000000000..cbad1f594fb --- /dev/null +++ b/CIAO/MPC/config/dance_nodemanager_stub.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project : dance_deployment_stub { + includes += $(CIAO_ROOT)/DAnCE/Interfaces + includes += $(CIAO_ROOT)/DAnCE/NodeManager + libs += DAnCE_NodeManager_stub + after += DAnCE_NodeManager_stub +} diff --git a/CIAO/MPC/config/dance_nodemanager_svnt.mpb b/CIAO/MPC/config/dance_nodemanager_svnt.mpb new file mode 100644 index 00000000000..8acb50fbfe5 --- /dev/null +++ b/CIAO/MPC/config/dance_nodemanager_svnt.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project : dance_deployment_svnt { + includes += $(CIAO_ROOT)/DAnCE/Interfaces + includes += $(CIAO_ROOT)/DAnCE/NodeManager + libs += DAnCE_NodeManager_svnt + after += DAnCE_NodeManager_svnt +} diff --git a/CIAO/MPC/config/dance_redirection_service.mpb b/CIAO/MPC/config/dance_redirection_service.mpb new file mode 100644 index 00000000000..092c0d55928 --- /dev/null +++ b/CIAO/MPC/config/dance_redirection_service.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project : dance, naming, messaging { + after += RedirectionService + libs += DAnCE_RedirectionService +} diff --git a/CIAO/MPC/config/dance_utils.mpb b/CIAO/MPC/config/dance_utils.mpb index 1b98dae5b05..2505f9dee32 100644 --- a/CIAO/MPC/config/dance_utils.mpb +++ b/CIAO/MPC/config/dance_utils.mpb @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project : ciao_deployment_stub { +project : dance_deployment_stub { after += DAnCE_Utils libs += DAnCE_Utils } diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst index 3d22a26fb80..c0af627219d 100644 --- a/CIAO/bin/ciao_tests.lst +++ b/CIAO/bin/ciao_tests.lst @@ -8,13 +8,17 @@ # Example: TAO\examples\foo\run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST # TAO/CIAO/examples/Hello/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/examples/Hello/descriptors/run_test_without_ns.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/examples/Hello/descriptors_RTCCM/rt_run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO RT_CAPABLE !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/examples/BasicSP/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/examples/Null_Component/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +#TAO/CIAO/examples/Hello/descriptors/run_test_without_ns.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +#TAO/CIAO/examples/Hello/descriptors_RTCCM/rt_run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO RT_CAPABLE !ST !LabVIEW_RT !WinCE !FUZZ TAO/CIAO/tests/IDL3/Events/Any/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ -TAO/CIAO/DevGuideExamples/Messenger/descriptors/run_test.pl: !LabVIEW_RT !WinCE !FUZZ !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !NOXERCES +#TAO/CIAO/DevGuideExamples/Messenger/descriptors/run_test.pl: !LabVIEW_RT !WinCE !FUZZ !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST !NOXERCES TAO/CIAO/tests/IDL3_to_XMI/XMI_For_Array/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ TAO/CIAO/tests/IDL3_to_XMI/XMI_For_Included_File/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ TAO/CIAO/tests/IDL3_to_XMI/XMI_For_Sequence/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/examples/DAnCE/tests/CIAO/NodeManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/DAnCE/tests/CIAO/ExecutionManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ +TAO/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !FUZZ diff --git a/CIAO/bin/generate_component_mpc.pl b/CIAO/bin/generate_component_mpc.pl index 451ec9299a5..6b61e2edefa 100755 --- a/CIAO/bin/generate_component_mpc.pl +++ b/CIAO/bin/generate_component_mpc.pl @@ -78,7 +78,7 @@ if (defined $opt_l) { if (defined $opt_c) { $client_def = -'project ('."$unique_prefix"."$opt_c".') : ciao_client_dnc, valuetype { +'project ('."$unique_prefix"."$opt_c".') : ccm_stub, valuetype { exename = '."$opt_c".' after += '."$unique_prefix"."$com_name".'_stub libs += '."$com_name".'_stub '."$stub_depend"." @@ -123,7 +123,7 @@ project('."$unique_prefix"."$com_name".'_cidl_gen) : ciaocidldefaults, taoidldef $component_def = ' -project('."$unique_prefix"."$com_name".'_exec) : ciao_component_dnc { +project('."$unique_prefix"."$com_name".'_exec) : ciao_executor { avoids += ace_for_tao after += '."$unique_prefix"."$com_name".'_cidl_gen '."$unique_prefix"."$com_name".'_stub sharedname = '."$com_name".'_exec @@ -159,8 +159,8 @@ $cli_idlflags = -Wb,skel_export_include='."$com_name"."$svr_suffix".'_export.h' ; -$cli_base = "ciao_client_dnc"; -$svr_base = "ciao_servant_dnc"; +$cli_base = "ccm_stub"; +$svr_base = "ciao_servant"; $svr_after = "$unique_prefix"."$com_name".'_exec'; $svr_libs = "$com_name".'_exec \ @@ -183,7 +183,7 @@ if (defined $opt_n) { '."$com_name".'_skel_export.h '; - $svr_base = "ciao_component_dnc"; + $svr_base = "ciao_executor"; $cidl_block = ""; } else { diff --git a/CIAO/ccm/CCM.mpc b/CIAO/ccm/CCM.mpc new file mode 100644 index 00000000000..0f7673c94b7 --- /dev/null +++ b/CIAO/ccm/CCM.mpc @@ -0,0 +1,180 @@ +// $Id$ + +project(CCM_stub_idl) : taolib_with_idl, valuetype { + idlflags += -Wb,stub_export_include=CCM_Stub_Export.h + idlflags += -Wb,stub_export_macro=CCM_Stub_Export + idlflags += -Wb,skel_export_include=CCM_Svnt_Export.h + idlflags += -Wb,skel_export_macro=CCM_Svnt_Export + idlflags += -I$(CIAO_ROOT)/ciao + custom_only = 1 + IDL_Files { + idlflags += -SS -Sci + CCM_Base.idl + CCM_Component.idl + CCM_Exceptions.idl + } + + IDL_Files { + idlflags += -SS + CCM_Cookie.idl + CCM_Enumeration.idl + } + + IDL_Files { + idlflags += -Ssi -Sci + Components.idl + } + + IDL_Files { + CCM_HomeConfiguration.idl + CCM_StandardConfigurator.idl + CCM_Home.idl + CCM_Object.idl + CCM_PrimaryKeyBase.idl + } + + IDL_Files { + idlflags += -Ssi + CCM_HomeFinder.idl + CCM_Configurator.idl + CCM_KeylessCCMHome.idl + CCM_Navigation.idl + CCM_Receptacle.idl + } + + IDL_Files { + CCM_Events.idl + CCM_EventBase.idl + CCM_EventConsumerBase.idl + } + +} + +project(CCM_stub) : taolib_with_idl, tao_output, valuetype, ifr_client { + // This is necessary for MPC to pull in rules.ciao.GNU + includes += $(CIAO_ROOT) + dynamicflags = CCM_STUB_BUILD_DLL + after += CCM_stub_idl + IDL_Files { + } + + Source_Files { + CCM_BaseC.cpp + CCM_EventsC.cpp + CCM_EventBaseC.cpp + CCM_EventConsumerBaseC.cpp + CCM_ComponentC.cpp + CCM_EnumerationC.cpp + CCM_HomeC.cpp + CCM_ConfiguratorC.cpp + CCM_HomeConfigurationC.cpp + CCM_KeylessCCMHomeC.cpp + CCM_StandardConfiguratorC.cpp + CCM_HomeFinderC.cpp + CCM_NavigationC.cpp + CCM_ReceptacleC.cpp + CCM_CookieC.cpp + CCM_ObjectC.cpp + CCM_PrimaryKeyBaseC.cpp + CCM_ExceptionsC.cpp + ComponentsC.cpp + } +} + +project(CCM_svnt_idl) : taolib_with_idl, valuetype { + idlflags += -Wb,export_include=CCM_Svnt_Export.h + idlflags += -Wb,export_macro=CCM_Svnt_Export + custom_only = 1 + IDL_Files { + idlflags += -SS -Sci \ + -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL \ + -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL + Security.idl + } + + IDL_Files { + idlflags += -SS -Sci + CCM_Context.idl + CCM_CCMException.idl + CCM_EntityComponent.idl + CCM_EntityContext.idl + } + + IDL_Files { + idlflags += -SS + CCM_CCM2Context.idl + CCM_ProxyHomeRegistration.idl + CCM_Session2Context.idl + CCM_Transaction.idl + CosPersistentState.idl + CCM_Container.idl + CCM_SessionContext.idl + CCM_SessionComponent.idl + CCM_Container_Ex.idl + CCM_StateIdFactory.idl + CCM_Entity2Context.idl + CCM_ComponentId.idl + CCM_ExecutorLocator.idl + CCM_EnterpriseComponent.idl + CCM_SessionSynchronization.idl + CCM_HomeRegistration.idl + CCM_HomeExecutorBase.idl + } + +} + +project(CCM_svnt) : orbsvcslib, orbsvcs_output \ + , portableserver \ + , valuetype \ + , ifr_client \ + , codecfactory \ + , pi \ + , ccm_stub \ + , avoids_corba_e_compact \ + , avoids_corba_e_micro \ +{ + dynamicflags = CCM_SVNT_BUILD_DLL + after += CCM_svnt_idl + IDL_Files { + } + + Source_Files { + CCM_TransactionC.cpp + CosPersistentStateC.cpp + CCM_ContainerC.cpp + CCM_SessionContextC.cpp + CCM_SessionComponentC.cpp + CCM_EnterpriseComponentC.cpp + CCM_SessionSynchronizationC.cpp + CCM_CCMExceptionC.cpp + CCM_ContextC.cpp + SecurityC.cpp + CCM_Container_ExC.cpp + CCM_StateIdFactoryC.cpp + CCM_ComponentIdC.cpp + CCM_Entity2ContextC.cpp + CCM_ExecutorLocatorC.cpp + CCM_ProxyHomeRegistrationC.cpp + CCM_Session2ContextC.cpp + CCM_CCM2ContextC.cpp + CCM_HomeRegistrationC.cpp + CCM_HomeExecutorBaseC.cpp + CCM_EntityContextC.cpp + CCM_EntityComponentC.cpp + CCM_EventsS.cpp + CCM_EventConsumerBaseS.cpp + CCM_EventBaseS.cpp + CCM_ConfiguratorS.cpp + CCM_HomeConfigurationS.cpp + CCM_KeylessCCMHomeS.cpp + CCM_StandardConfiguratorS.cpp + CCM_HomeS.cpp + CCM_ObjectS.cpp + CCM_PrimaryKeyBaseS.cpp + CCM_HomeFinderS.cpp + CCM_NavigationS.cpp + CCM_ReceptacleS.cpp + ComponentsS.cpp + } +} + diff --git a/CIAO/ccm/CCM_Base.idl b/CIAO/ccm/CCM_Base.idl new file mode 100644 index 00000000000..d5fdac61919 --- /dev/null +++ b/CIAO/ccm/CCM_Base.idl @@ -0,0 +1,14 @@ +// $Id$ + +#if !defined (CCM_BASE_IDL) +#define CCM_BASE_IDL + +module Components +{ + typeprefix Components "omg.org"; + + exception InvalidConnection {}; + exception AlreadyConnected {}; + exception NoConnection {}; +}; +#endif /* CCM_BASE_IDL */ diff --git a/CIAO/ccm/CCM_CCM2Context.idl b/CIAO/ccm/CCM_CCM2Context.idl new file mode 100644 index 00000000000..eedb43ff5ca --- /dev/null +++ b/CIAO/ccm/CCM_CCM2Context.idl @@ -0,0 +1,34 @@ +// $Id$ + +#if !defined (CCM_2CONTEXT_IDL) +#define CCM_2CONTEXT_IDL + +#include "ccm/CCM_Container.idl" +#include "ccm/CCM_HomeRegistration.idl" +#include <CosPersistentState.idl> + +// *************** Extended Container Interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + typedef CosPersistentState::CatalogBase CatalogBase; + typedef CosPersistentState::_TypeId _TypeId; + + exception PolicyMismatch {}; + exception PersistenceNotAvailable {}; + + local interface CCM2Context : CCMContext + { + HomeRegistration get_home_registration (); + + void req_passivate () + raises (PolicyMismatch); + + CatalogBase get_persistence (in _TypeId catalog_type_id) + raises (PersistenceNotAvailable); + }; + +}; +#endif /* CCM_2CONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_CCMException.idl b/CIAO/ccm/CCM_CCMException.idl new file mode 100644 index 00000000000..af076144304 --- /dev/null +++ b/CIAO/ccm/CCM_CCMException.idl @@ -0,0 +1,29 @@ +// $Id$ + +#if !defined (CCM_CCMEXCEPTION_IDL) +#define CCM_CCMEXCEPTION_IDL + +module Components +{ + typeprefix Components "omg.org"; + + enum CCMExceptionReason + { + SYSTEM_ERROR, + CREATE_ERROR, + REMOVE_ERROR, + DUPLICATE_KEY, + FIND_ERROR, + OBJECT_NOT_FOUND, + NO_SUCH_ENTITY, + QOS_ERROR, + REGISTRATION_ERROR, + SERVICE_INSTALLATION_ERROR + }; + + exception CCMException + { + CCMExceptionReason reason; + }; +}; +#endif /* CCM_CCMEXCEPTION_IDL */ diff --git a/CIAO/ccm/CCM_Component.idl b/CIAO/ccm/CCM_Component.idl new file mode 100644 index 00000000000..a579496685f --- /dev/null +++ b/CIAO/ccm/CCM_Component.idl @@ -0,0 +1,11 @@ +// $Id$ + +#if !defined (CCM_COMPONENT_IDL) +#define CCM_COMPONENT_IDL + +#include "ccm/CCM_Events.idl" +#include "ccm/CCM_Home.idl" +#include "ccm/CCM_Object.idl" +#include "ccm/CCM_Enumeration.idl" + +#endif /* CCM_COMPONENT_IDL */ diff --git a/CIAO/ccm/CCM_ComponentId.idl b/CIAO/ccm/CCM_ComponentId.idl new file mode 100644 index 00000000000..c8d8deabdcb --- /dev/null +++ b/CIAO/ccm/CCM_ComponentId.idl @@ -0,0 +1,34 @@ +// $Id$ + +#if !defined (CCM_COMPONENTID_IDL) +#define CCM_COMPONENTID_IDL + +#include "ccm/CCM_StateIdFactory.idl" + +// *************** Extended Container Interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + local interface ComponentId + { + FacetId get_target_facet(); + + SegmentId get_target_segment(); + + StateIdValue get_target_state_id (in StateIdFactory sid_factory) + raises (InvalidStateIdData); + + StateIdValue get_segment_state_id (in SegmentId seg, + in StateIdFactory sid_factory) + raises (InvalidStateIdData); + + ComponentId create_with_new_target (in FacetId new_target_facet, + in SegmentId new_target_segment); + + SegmentDescrSeq get_segment_descrs (in StateIdFactory sid_factory) + raises (InvalidStateIdData); + }; +}; +#endif /* CCM_COMPONENTID_IDL */ diff --git a/CIAO/ccm/CCM_Configurator.idl b/CIAO/ccm/CCM_Configurator.idl new file mode 100644 index 00000000000..6af21d68533 --- /dev/null +++ b/CIAO/ccm/CCM_Configurator.idl @@ -0,0 +1,20 @@ +// $Id$ + +#if !defined (CCM_CONFIGURATOR_IDL) +#define CCM_CONFIGURATOR_IDL + +module Components +{ + typeprefix Components "omg.org"; + + exception WrongComponentType {}; + + interface CCMObject; + + interface Configurator + { + void configure (in CCMObject comp) + raises (WrongComponentType); + }; +}; +#endif /* CCM_CONFIGURATOR_IDL */ diff --git a/CIAO/ccm/CCM_Container.idl b/CIAO/ccm/CCM_Container.idl new file mode 100644 index 00000000000..fdefcc1e0f9 --- /dev/null +++ b/CIAO/ccm/CCM_Container.idl @@ -0,0 +1,12 @@ +// $Id$ + +#if !defined (CCM_CONTAINER_IDL) +#define CCM_CONTAINER_IDL + +#include "ccm/CCM_Component.idl" +#include "ccm/CCM_CCMException.idl" +#include "ccm/CCM_HomeExecutorBase.idl" +#include "ccm/CCM_SessionContext.idl" +#include "ccm/CCM_SessionComponent.idl" + +#endif /* CCM_CONTAINER_IDL */ diff --git a/CIAO/ccm/CCM_Container_Ex.idl b/CIAO/ccm/CCM_Container_Ex.idl new file mode 100644 index 00000000000..8a64c1c5679 --- /dev/null +++ b/CIAO/ccm/CCM_Container_Ex.idl @@ -0,0 +1,10 @@ +// $Id$ + +#if !defined (CCM_CONTAINER_EX_IDL) +#define CCM_CONTAINER_EX_IDL + +#include "ccm/CCM_Container.idl" +#include "ccm/CCM_Session2Context.idl" +#include "ccm/CCM_EntityContext.idl" + +#endif /* CCM_CONTAINER_EX_IDL */ diff --git a/CIAO/ccm/CCM_Context.idl b/CIAO/ccm/CCM_Context.idl new file mode 100644 index 00000000000..499c934255e --- /dev/null +++ b/CIAO/ccm/CCM_Context.idl @@ -0,0 +1,45 @@ +// $Id$ + +#if !defined (CCM_CONTEXT_IDL) +#define CCM_CONTEXT_IDL + +#include "ccm/Security.idl" +#include "ccm/CCM_Transaction.idl" +#include "ccm/CCM_Home.idl" +#include "ccm/CCM_CCMException.idl" + +// *************** Basic Container interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + typedef SecurityLevel2::Credentials Principal; + + exception IllegalState {}; + + local interface CCMContext + { + Principal get_caller_principal(); + + CCMHome get_CCM_home(); + + boolean get_rollback_only() + raises (IllegalState); + + Transaction::UserTransaction get_user_transaction() + raises (IllegalState); + + boolean is_caller_in_role (in string role); + + void set_rollback_only() + raises (IllegalState); + + /** + * Added for QoS4CCM + */ + Object resolve_service_reference(in string service_id) + raises (CCMException); + }; +}; +#endif /* CCM_CONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_Cookie.idl b/CIAO/ccm/CCM_Cookie.idl new file mode 100644 index 00000000000..6f2eb87b196 --- /dev/null +++ b/CIAO/ccm/CCM_Cookie.idl @@ -0,0 +1,17 @@ +// $Id$ + +#if !defined (CCM_COOKIE_IDL) +#define CCM_COOKIE_IDL + +#include "tao/OctetSeq.pidl" + +module Components +{ + typeprefix Components "omg.org"; + + valuetype Cookie + { + private CORBA::OctetSeq cookieValue; + }; +}; +#endif /* CCM_COOKIE_IDL */ diff --git a/CIAO/ccm/CCM_EnterpriseComponent.idl b/CIAO/ccm/CCM_EnterpriseComponent.idl new file mode 100644 index 00000000000..b2470468da0 --- /dev/null +++ b/CIAO/ccm/CCM_EnterpriseComponent.idl @@ -0,0 +1,12 @@ +// $Id$ + +#if !defined (CCM_ENTERPRISECOMPONENT_IDL) +#define CCM_ENTERPRISECOMPONENT_IDL + +module Components +{ + typeprefix Components "omg.org"; + + local interface EnterpriseComponent {}; +}; +#endif /* CCM_CONTAINER_IDL */ diff --git a/CIAO/ccm/CCM_Entity2Context.idl b/CIAO/ccm/CCM_Entity2Context.idl new file mode 100644 index 00000000000..d21772bfb6b --- /dev/null +++ b/CIAO/ccm/CCM_Entity2Context.idl @@ -0,0 +1,35 @@ +// $Id$ + +#if !defined (CCM_ENTITY2CONTEXT_IDL) +#define CCM_ENTITY2CONTEXT_IDL + +#include "ccm/CCM_Session2Context.idl" +#include "ccm/CCM_EntityContext.idl" +#include "ccm/CCM_ComponentId.idl" + +// *************** Extended Container Interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + local interface Entity2Context : EntityContext, CCM2Context + { + ComponentId get_component_id () + raises (IllegalState); + + ComponentId create_component_id (in FacetId target_facet, + in SegmentId target_segment, + in SegmentDescrSeq seq_descrs); + + ComponentId create_monolithic_component_id (in FacetId target_facet, + in StateIdValue sid); + + Object create_ref_from_cid (in CORBA::RepositoryId repid, + in ComponentId cid); + + ComponentId get_cid_from_ref (in Object objref) + raises (BadComponentReference); + }; +}; +#endif /* CCM_ENTITY2CONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_EntityComponent.idl b/CIAO/ccm/CCM_EntityComponent.idl new file mode 100644 index 00000000000..4fb219a7904 --- /dev/null +++ b/CIAO/ccm/CCM_EntityComponent.idl @@ -0,0 +1,38 @@ +// $Id$ + +#if !defined (CCM_ENTITYCOMPONENT_IDL) +#define CCM_ENTITYCOMPONENT_IDL + +#include "ccm/CCM_CCMException.idl" +#include "ccm/CCM_EnterpriseComponent.idl" +#include "ccm/CCM_EntityContext.idl" + +module Components +{ + typeprefix Components "omg.org"; + + local interface EntityComponent : EnterpriseComponent + { + void set_entity_context (in EntityContext ctx) + raises (CCMException); + + void unset_entity_context () + raises (CCMException); + + void ccm_activate () + raises (CCMException); + + void ccm_load () + raises (CCMException); + + void ccm_store () + raises (CCMException); + + void ccm_passivate () + raises (CCMException); + + void ccm_remove () + raises (CCMException); + }; +}; +#endif /* CCM_ENTITYCOMPONENT_IDL */ diff --git a/CIAO/ccm/CCM_EntityContext.idl b/CIAO/ccm/CCM_EntityContext.idl new file mode 100644 index 00000000000..3375c44717d --- /dev/null +++ b/CIAO/ccm/CCM_EntityContext.idl @@ -0,0 +1,22 @@ +// $Id$ + +#if !defined (CCM_ENTITYCONTEXT_IDL) +#define CCM_ENTITYCONTEXT_IDL + +#include "ccm/CCM_Context.idl" +#include "ccm/CCM_Object.idl" + +module Components +{ + typeprefix Components "omg.org"; + + local interface EntityContext : CCMContext + { + Object get_CCM_object () + raises (IllegalState); + + PrimaryKeyBase get_primary_key () + raises (IllegalState); + }; +}; +#endif /* CCM_ENTITYCONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_Enumeration.idl b/CIAO/ccm/CCM_Enumeration.idl new file mode 100644 index 00000000000..c47c23b6347 --- /dev/null +++ b/CIAO/ccm/CCM_Enumeration.idl @@ -0,0 +1,25 @@ +// $Id$ + +#if !defined (CCM_ENUMERATION_IDL) +#define CCM_ENUMERATION_IDL + +#include "ccm/CCM_Object.idl" + +module Components +{ + typeprefix Components "omg.org"; + + /// @@ Enumeration and DefaultEnumeration are only for EJB to CCM + /// mapping? At any rate, we should be able to skip them for now. + abstract valuetype Enumeration + { + boolean has_more_elements(); + CCMObject next_element(); + }; + + valuetype DefaultEnumeration : Enumeration + { + private CCMObjectSeq objects; + }; +}; +#endif /* CCM_ENUMERATION_IDL */ diff --git a/CIAO/ccm/CCM_EventBase.idl b/CIAO/ccm/CCM_EventBase.idl new file mode 100644 index 00000000000..3e9a6cb816f --- /dev/null +++ b/CIAO/ccm/CCM_EventBase.idl @@ -0,0 +1,12 @@ +// $Id$ + +#if !defined (CCM_EVENTBASE_IDL) +#define CCM_EVENTBASE_IDL + +module Components +{ + typeprefix Components "omg.org"; + + abstract valuetype EventBase {}; +}; +#endif /* CCM_EVENTBASE_IDL */ diff --git a/CIAO/ccm/CCM_EventConsumerBase.idl b/CIAO/ccm/CCM_EventConsumerBase.idl new file mode 100644 index 00000000000..eb84836917e --- /dev/null +++ b/CIAO/ccm/CCM_EventConsumerBase.idl @@ -0,0 +1,37 @@ +// $Id$ + +#if !defined (CCM_EVENTCONSUMERBASE_IDL) +#define CCM_EVENTCONSUMERBASE_IDL + +#include "ccm/CCM_EventBase.idl" +#include "tao/Typecode_types.pidl" +#include "tao/orb_types.pidl" + +module Components +{ + typeprefix Components "omg.org"; + + exception BadEventType + { + CORBA::RepositoryId expected_event_type; + }; + + interface EventConsumerBase + { + void push_event (in EventBase evt) raises (BadEventType); + + /// CIAO-specific operation to treat event service as regular event + /// sink port. The source_id needs to be passed in to identify the + /// source of the publisher port to support event filtering mechanism. + void ciao_push_event (in EventBase evt, + in string source_id, + in CORBA::TypeCode tc) + raises (BadEventType); + + /// CIAO-specific operation to help support the capability + /// to subscribe to eventtypes more derived than the type + /// consumed. + boolean ciao_is_substitutable (in string event_repo_id); + }; +}; +#endif /* CCM_EVENTCONSUMERBASE_IDL */ diff --git a/CIAO/ccm/CCM_Events.idl b/CIAO/ccm/CCM_Events.idl new file mode 100644 index 00000000000..31af47ee913 --- /dev/null +++ b/CIAO/ccm/CCM_Events.idl @@ -0,0 +1,84 @@ +// $Id$ + +#if !defined (CCM_EVENTS_IDL) +#define CCM_EVENTS_IDL + +#include "ccm/CCM_Base.idl" +#include "ccm/CCM_Navigation.idl" +#include "ccm/CCM_Receptacle.idl" +#include "ccm/CCM_Cookie.idl" +#include "ccm/CCM_EventBase.idl" +#include "ccm/CCM_EventConsumerBase.idl" + +module Components +{ + typeprefix Components "omg.org"; + + valuetype ConsumerDescription : PortDescription + { + public EventConsumerBase consumer; + }; + typedef sequence<ConsumerDescription> ConsumerDescriptions; + + valuetype EmitterDescription : PortDescription + { + public EventConsumerBase consumer; + }; + typedef sequence<EmitterDescription> EmitterDescriptions; + + valuetype SubscriberDescription + { + public Cookie ck; + public EventConsumerBase consumer; + }; + typedef sequence<SubscriberDescription> SubscriberDescriptions; + + valuetype PublisherDescription : PortDescription + { + public SubscriberDescriptions consumer; + }; + typedef sequence<PublisherDescription> PublisherDescriptions; + + interface Events + { + EventConsumerBase get_consumer (in FeatureName sink_name) + raises (InvalidName); + + Cookie subscribe (in FeatureName publisher_name, + in EventConsumerBase subscriber) + raises (InvalidName, + InvalidConnection, + ExceededConnectionLimit); + + EventConsumerBase unsubscribe (in FeatureName publisher_name, + in Cookie ck) + raises (InvalidName, + InvalidConnection); + + void connect_consumer (in FeatureName emitter_name, + in EventConsumerBase consumer) + raises (InvalidName, + AlreadyConnected, + InvalidConnection); + + EventConsumerBase disconnect_consumer (in FeatureName source_name) + raises (InvalidName, + NoConnection); + + ConsumerDescriptions get_all_consumers (); + + ConsumerDescriptions get_named_consumers (in NameList names) + raises (InvalidName); + + EmitterDescriptions get_all_emitters (); + + EmitterDescriptions get_named_emitters (in NameList names) + raises (InvalidName); + + PublisherDescriptions get_all_publishers (); + + PublisherDescriptions get_named_publishers (in NameList names) + raises (InvalidName); + }; +}; +#endif /* CCM_EVENT_IDL */ diff --git a/CIAO/ccm/CCM_Exceptions.idl b/CIAO/ccm/CCM_Exceptions.idl new file mode 100644 index 00000000000..b347df76a97 --- /dev/null +++ b/CIAO/ccm/CCM_Exceptions.idl @@ -0,0 +1,25 @@ +// $Id$ + +#if !defined (CCM_EXCEPTIONS_IDL) +#define CCM_EXCEPTIONS_IDL + +module Components +{ + typeprefix Components "omg.org"; + + typedef unsigned long FailureReason; + + exception CreateFailure { + FailureReason reason; + }; + exception FinderFailure + { + FailureReason reason; + }; + exception RemoveFailure + { + FailureReason reason; + }; +}; + +#endif diff --git a/CIAO/ccm/CCM_ExecutorLocator.idl b/CIAO/ccm/CCM_ExecutorLocator.idl new file mode 100644 index 00000000000..ef0ac8386d8 --- /dev/null +++ b/CIAO/ccm/CCM_ExecutorLocator.idl @@ -0,0 +1,28 @@ +// $Id$ + +#if !defined (CCM_EXECUTORLOCATOR_IDL) +#define CCM_EXECUTORLOCATOR_IDL + +#include "ccm/CCM_EnterpriseComponent.idl" +#include "ccm/CCM_CCMException.idl" +#include "ccm/CCM_Object.idl" + +// *************** Extended Container Interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + local interface ExecutorLocator : EnterpriseComponent + { + Object obtain_executor (in string name) + raises (CCMException); + + void release_executor (in Object exc) + raises (CCMException); + + void configuration_complete() + raises (InvalidConfiguration); + }; +}; +#endif /* CCM_EXECUTORLOCATOR_IDL */ diff --git a/CIAO/ccm/CCM_Home.idl b/CIAO/ccm/CCM_Home.idl new file mode 100644 index 00000000000..42213ded39c --- /dev/null +++ b/CIAO/ccm/CCM_Home.idl @@ -0,0 +1,32 @@ +// $Id$ + +#if !defined (CCM_HOME_IDL) +#define CCM_HOME_IDL + +#include "tao/IFR_Client/IFR_Base.pidl" +#include "ccm/CCM_Exceptions.idl" + +module Components +{ + typeprefix Components "omg.org"; + + exception DuplicateKeyValue {}; + exception InvalidKey {}; + exception UnknownKeyValue {}; + + interface CCMObject; + + interface CCMHome + { + CORBA::IRObject get_component_def (); + CORBA::IRObject get_home_def (); + void remove_component (in CCMObject comp) + raises (RemoveFailure); + }; + + // @@ Added by wotte for continued compatibility with + // OFCCM + typedef sequence<CCMHome> CCMHomes; +}; + +#endif /* CCM_HOME_IDL */ diff --git a/CIAO/ccm/CCM_HomeConfiguration.idl b/CIAO/ccm/CCM_HomeConfiguration.idl new file mode 100644 index 00000000000..e5647901bca --- /dev/null +++ b/CIAO/ccm/CCM_HomeConfiguration.idl @@ -0,0 +1,22 @@ +// $Id$ + +#if !defined (CCM_HOMECONFIGURATION_IDL) +#define CCM_HOMECONFIGURATION_IDL + +#include "ccm/CCM_Configurator.idl" +#include "ccm/CCM_StandardConfigurator.idl" +#include "ccm/CCM_Home.idl" + +module Components +{ + typeprefix Components "omg.org"; + + interface HomeConfiguration : CCMHome + { + void set_configurator (in Configurator cfg); + void set_configuration_values (in ConfigValues config); + void complete_component_configuration (in boolean b); + void disable_home_configuration(); + }; +}; +#endif /* CCM_HOMECONFIGURATOR_IDL */ diff --git a/CIAO/ccm/CCM_HomeExecutorBase.idl b/CIAO/ccm/CCM_HomeExecutorBase.idl new file mode 100644 index 00000000000..34a92fbe539 --- /dev/null +++ b/CIAO/ccm/CCM_HomeExecutorBase.idl @@ -0,0 +1,14 @@ +// $Id$ + +#if !defined (CCM_HOMEEXECUTORBASE_IDL) +#define CCM_HOMEEXECUTORBASE_IDL + +module Components +{ + typeprefix Components "omg.org"; + + local interface HomeExecutorBase + { + }; +}; +#endif /* CCM_HOMEEXECUTORBASE_IDL */ diff --git a/CIAO/ccm/CCM_HomeFinder.idl b/CIAO/ccm/CCM_HomeFinder.idl new file mode 100644 index 00000000000..d530cc5117e --- /dev/null +++ b/CIAO/ccm/CCM_HomeFinder.idl @@ -0,0 +1,28 @@ +// $Id$ + +#if !defined (CCM_HOMEFINDER_IDL) +#define CCM_HOMEFINDER_IDL + +#include "tao/orb_types.pidl" + +module Components +{ + typeprefix Components "omg.org"; + + exception HomeNotFound {}; + + interface CCMHome; + + interface HomeFinder + { + CCMHome find_home_by_component_type (in CORBA::RepositoryId comp_repid) + raises (HomeNotFound); + + CCMHome find_home_by_home_type (in CORBA::RepositoryId home_repid) + raises (HomeNotFound); + + CCMHome find_home_by_name (in string home_name) + raises (HomeNotFound); + }; +}; +#endif /* CCM_HOMEFINDER_IDL */ diff --git a/CIAO/ccm/CCM_HomeRegistration.idl b/CIAO/ccm/CCM_HomeRegistration.idl new file mode 100644 index 00000000000..c6f69ed6c43 --- /dev/null +++ b/CIAO/ccm/CCM_HomeRegistration.idl @@ -0,0 +1,21 @@ +// $Id$ + +#if !defined (CCM_HOMEREGISTRATION_IDL) +#define CCM_HOMEREGISTRATION_IDL + +#include "ccm/CCM_Home.idl" + +module Components +{ + typeprefix Components "omg.org"; + + local interface HomeRegistration + { + void register_home (in CCMHome home_ref, + in string home_name); + + void unregister_home (in CCMHome home_ref); + }; + +}; +#endif /* CCM_HOMEREGISTRATION_IDL */ diff --git a/CIAO/ccm/CCM_KeylessCCMHome.idl b/CIAO/ccm/CCM_KeylessCCMHome.idl new file mode 100644 index 00000000000..20ac16249f1 --- /dev/null +++ b/CIAO/ccm/CCM_KeylessCCMHome.idl @@ -0,0 +1,19 @@ +// $Id$ + +#if !defined (CCM_KEYLESSCCMHOME_IDL) +#define CCM_KEYLESSCCMHOME_IDL + +#include "ccm/CCM_Object.idl" + +module Components +{ + typeprefix Components "omg.org"; + + interface KeylessCCMHome + { + CCMObject create_component() + raises (CreateFailure); + }; + +}; +#endif /* CCM_KEYLESSCCMHOME_IDL */ diff --git a/CIAO/ccm/CCM_Navigation.idl b/CIAO/ccm/CCM_Navigation.idl new file mode 100644 index 00000000000..af531032808 --- /dev/null +++ b/CIAO/ccm/CCM_Navigation.idl @@ -0,0 +1,40 @@ +// $Id$ + +#if !defined (CCM_NAVIGATION_IDL) +#define CCM_NAVIGATION_IDL + +#include "tao/orb_types.pidl" +#include "tao/StringSeq.pidl" + +module Components +{ + typeprefix Components "omg.org"; + + typedef string FeatureName; + typedef sequence<FeatureName> NameList; + + valuetype PortDescription + { + public FeatureName name; + public CORBA::RepositoryId type_id; + }; + + valuetype FacetDescription : PortDescription + { + public Object facet_ref; + }; + + typedef sequence<FacetDescription> FacetDescriptions; + + exception InvalidName {}; + interface Navigation + { + Object provide_facet (in FeatureName name) + raises (InvalidName); + FacetDescriptions get_all_facets(); + FacetDescriptions get_named_facets (in NameList names) + raises (InvalidName); + boolean same_component (in Object object_ref); + }; +}; +#endif /* CCM_NAVIGATION_IDL */ diff --git a/CIAO/ccm/CCM_Object.idl b/CIAO/ccm/CCM_Object.idl new file mode 100644 index 00000000000..fd9e66ced21 --- /dev/null +++ b/CIAO/ccm/CCM_Object.idl @@ -0,0 +1,55 @@ +// $Id$ + +#if !defined (CCM_OBJECT_IDL) +#define CCM_OBJECT_IDL + +#include "ccm/CCM_Events.idl" +#include "ccm/CCM_Navigation.idl" +#include "ccm/CCM_Home.idl" +#include "ccm/CCM_PrimaryKeyBase.idl" + +module Components +{ + typeprefix Components "omg.org"; + + /// This typedef and consts shouldn't be here but are here because of CIAO + /// specific additions + typedef FailureReason InvalidConfigurationReason; + const InvalidConfigurationReason UnknownConfigValueName = 0; + const InvalidConfigurationReason InvalidConfigValueType = 1; + const InvalidConfigurationReason ConfigValueRequired = 2; + const InvalidConfigurationReason ConfigValueNotExpected = 3; + + /// Shouldn't be here but is now here because of CIAO additions + exception InvalidConfiguration + { + InvalidConfigurationReason reason; + FeatureName name; + }; + + valuetype ComponentPortDescription + { + public FacetDescriptions facets; + public ReceptacleDescriptions receptacles; + public ConsumerDescriptions consumers; + public EmitterDescriptions emitters; + public PublisherDescriptions publishers; + }; + + exception NoKeyAvailable {}; + + interface CCMObject : Navigation, Receptacles, Events + { + CORBA::IRObject get_component_def ( ); + CCMHome get_ccm_home( ); + PrimaryKeyBase get_primary_key( ) + raises (NoKeyAvailable); + void configuration_complete () + raises (InvalidConfiguration); + void remove() + raises (RemoveFailure); + ComponentPortDescription get_all_ports (); + }; + typedef sequence<CCMObject> CCMObjectSeq; +}; +#endif /* CCM_OBJECT_IDL */ diff --git a/CIAO/ccm/CCM_PrimaryKeyBase.idl b/CIAO/ccm/CCM_PrimaryKeyBase.idl new file mode 100644 index 00000000000..27c261d20b2 --- /dev/null +++ b/CIAO/ccm/CCM_PrimaryKeyBase.idl @@ -0,0 +1,13 @@ +// $Id$ + +#if !defined (CCM_PRIMARYKEYBASE_IDL) +#define CCM_PRIMARYKEYBASE_IDL + +module Components +{ + typeprefix Components "omg.org"; + + abstract valuetype PrimaryKeyBase {}; + +}; +#endif /* CCM_PRIMARYKEYBASE_IDL */ diff --git a/CIAO/ccm/CCM_ProxyHomeRegistration.idl b/CIAO/ccm/CCM_ProxyHomeRegistration.idl new file mode 100644 index 00000000000..3f613d7c13f --- /dev/null +++ b/CIAO/ccm/CCM_ProxyHomeRegistration.idl @@ -0,0 +1,23 @@ +// $Id$ + +#if !defined (CCM_PROXYHOMEREGISTRATION_IDL) +#define CCM_PROXYHOMEREGISTRATION_IDL + +#include "ccm/CCM_HomeRegistration.idl" + +module Components +{ + typeprefix Components "omg.org"; + + exception UnknownActualHome {}; + exception ProxyHomeNotSupported {}; + + local interface ProxyHomeRegistration : HomeRegistration + { + void register_proxy_home (in CCMHome rhome, + in CCMHome ahome) + raises (UnknownActualHome, + ProxyHomeNotSupported); + }; +}; +#endif /* CCM_PROXYHOMEREGISTRATION_IDL */ diff --git a/CIAO/ccm/CCM_Receptacle.idl b/CIAO/ccm/CCM_Receptacle.idl new file mode 100644 index 00000000000..6eaaa789320 --- /dev/null +++ b/CIAO/ccm/CCM_Receptacle.idl @@ -0,0 +1,54 @@ +// $Id$ + +#if !defined (CCM_RECEPTACLE_IDL) +#define CCM_RECEPTACLE_IDL + +#include "ccm/CCM_Base.idl" +#include "ccm/CCM_Navigation.idl" +#include "ccm/CCM_Cookie.idl" + +module Components +{ + typeprefix Components "omg.org"; + + valuetype ConnectionDescription + { + public Cookie ck; + public Object objref; + }; + typedef sequence<ConnectionDescription> ConnectionDescriptions; + + valuetype ReceptacleDescription : PortDescription + { + public boolean is_multiple; + public ConnectionDescriptions connections; + }; + typedef sequence<ReceptacleDescription> ReceptacleDescriptions; + + exception ExceededConnectionLimit {}; + exception CookieRequired {}; + + interface Receptacles + { + Cookie connect (in FeatureName name, in Object connection ) + raises (InvalidName, + InvalidConnection, + AlreadyConnected, + ExceededConnectionLimit); + + Object disconnect (in FeatureName name, in Cookie ck) + raises (InvalidName, + InvalidConnection, + CookieRequired, + NoConnection); + + ConnectionDescriptions get_connections (in FeatureName name) + raises (InvalidName); + + ReceptacleDescriptions get_all_receptacles (); + + ReceptacleDescriptions get_named_receptacles (in NameList names) + raises (InvalidName); + }; +}; +#endif /* CCM_RECEPTACLE_IDL */ diff --git a/CIAO/ccm/CCM_Session2Context.idl b/CIAO/ccm/CCM_Session2Context.idl new file mode 100644 index 00000000000..e1f2d8f1614 --- /dev/null +++ b/CIAO/ccm/CCM_Session2Context.idl @@ -0,0 +1,37 @@ +// $Id$ + +#if !defined (CCM_SESSION2CONTEXT_IDL) +#define CCM_SESSION2CONTEXT_IDL + +#include "ccm/CCM_CCM2Context.idl" + +// *************** Extended Container Interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + enum BadComponentReferenceReason + { + NON_LOCAL_REFERENCE, + NON_COMPONENT_REFERENCE, + WRONG_CONTAINER + }; + exception BadComponentReference + { + BadComponentReferenceReason reason; + }; + + local interface Session2Context : SessionContext, CCM2Context + { + Object create_ref (in CORBA::RepositoryId repid); + + Object create_ref_from_oid (in CORBA::OctetSeq oid, + in CORBA::RepositoryId repid); + + CORBA::OctetSeq get_oid_from_ref (in Object objref) + raises (IllegalState, + BadComponentReference); + }; +}; +#endif /* CCM_SESSION2CONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_SessionComponent.idl b/CIAO/ccm/CCM_SessionComponent.idl new file mode 100644 index 00000000000..f7de21e3f04 --- /dev/null +++ b/CIAO/ccm/CCM_SessionComponent.idl @@ -0,0 +1,34 @@ +// $Id$ + +#if !defined (CCM_SESSIONCOMPONENT_IDL) +#define CCM_SESSIONCOMPONENT_IDL + +#include "ccm/CCM_SessionContext.idl" +#include "ccm/CCM_CCMException.idl" +#include "ccm/CCM_EnterpriseComponent.idl" + +// *************** Basic Container interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + local interface SessionComponent : EnterpriseComponent + { + void set_session_context ( in SessionContext ctx) + raises (CCMException); + + void configuration_complete () + raises (CCMException); + + void ccm_activate() + raises (CCMException); + + void ccm_passivate() + raises (CCMException); + + void ccm_remove () + raises (CCMException); + }; +}; +#endif /* CCM_SESSIONCOMPONENT_IDL */ diff --git a/CIAO/ccm/CCM_SessionContext.idl b/CIAO/ccm/CCM_SessionContext.idl new file mode 100644 index 00000000000..88685acd965 --- /dev/null +++ b/CIAO/ccm/CCM_SessionContext.idl @@ -0,0 +1,18 @@ +// $Id$ + +#if !defined (CCM_SESSIONCONTEXT_IDL) +#define CCM_SESSIONCONTEXT_IDL + +#include "ccm/CCM_Context.idl" + +module Components +{ + typeprefix Components "omg.org"; + + local interface SessionContext : CCMContext + { + Object get_CCM_object() + raises (IllegalState); + }; +}; +#endif /* CCM_SESSIONCONTEXT_IDL */ diff --git a/CIAO/ccm/CCM_SessionSynchronization.idl b/CIAO/ccm/CCM_SessionSynchronization.idl new file mode 100644 index 00000000000..988cd4fdfb1 --- /dev/null +++ b/CIAO/ccm/CCM_SessionSynchronization.idl @@ -0,0 +1,26 @@ +// $Id$ + +#if !defined (CCM_SESSIONSYNCHRONIZATION_IDL) +#define CCM_SESSIONSYNCHRONIZATION_IDL + +#include "ccm/CCM_CCMException.idl" + +// *************** Basic Container interfaces *************** + +module Components +{ + typeprefix Components "omg.org"; + + local interface SessionSynchronization + { + void after_begin () + raises (CCMException); + + void before_completion () + raises (CCMException); + + void after_completion (in boolean committed) + raises (CCMException); + }; +}; +#endif /* CCM_SESSIONSYNCHRONIZATION_IDL */ diff --git a/CIAO/ccm/CCM_StandardConfigurator.idl b/CIAO/ccm/CCM_StandardConfigurator.idl new file mode 100644 index 00000000000..3b45955d5e7 --- /dev/null +++ b/CIAO/ccm/CCM_StandardConfigurator.idl @@ -0,0 +1,27 @@ +// $Id$ + +#if !defined (CCM_STANDARDCONFIGURATOR_IDL) +#define CCM_STANDARDCONFIGURATOR_IDL + +#include "ccm/CCM_Configurator.idl" +#include "ccm/CCM_Navigation.idl" + +module Components +{ + typeprefix Components "omg.org"; + + valuetype ConfigValue + { + public FeatureName name; + public any value; + }; + + typedef sequence<ConfigValue> ConfigValues; + + interface StandardConfigurator : Configurator + { + void set_configuration (in ConfigValues descr); + }; + +}; +#endif /* CCM_STANDARDCONFIGURATOR_IDL */ diff --git a/CIAO/ccm/CCM_StateIdFactory.idl b/CIAO/ccm/CCM_StateIdFactory.idl new file mode 100644 index 00000000000..f26371ecd54 --- /dev/null +++ b/CIAO/ccm/CCM_StateIdFactory.idl @@ -0,0 +1,59 @@ +// $Id$ + +#if !defined (CCM_STATEIDFACTORY) +#define CCM_STATEIDFACTORY + +#include <CosPersistentState.idl> + +module Components +{ + typeprefix Components "omg.org"; + + typedef short SegmentId; + const SegmentId COMPONENT_SEGMENT = 0; + + typedef short FacetId; + const FacetId COMPONENT_FACET = 0; + + typedef sequence<octet> IdData; + typedef CosPersistentState::Pid PersistentId; + + exception InvalidStateIdData {}; + + typedef short StateIdType; + const StateIdType PERSISTENT_ID = 0; + + abstract valuetype StateIdValue + { + StateIdType get_sid_type(); + IdData get_sid_data(); + }; + + local interface StateIdFactory + { + StateIdValue create (in IdData data) + raises (InvalidStateIdData); + }; + + valuetype PersistentIdValue : StateIdValue + { + private PersistentId pid; + PersistentId get_pid(); + factory init (in PersistentId pid); + }; + + valuetype SegmentDescr + { + private StateIdValue sid; + private SegmentId seg; + + StateIdValue get_sid(); + SegmentId get_seg_id(); + factory init (in StateIdValue sid, + in SegmentId seg); + }; + + typedef sequence<SegmentDescr> SegmentDescrSeq; + +}; +#endif /* CCM_STATEIDFACTORY */ diff --git a/CIAO/ccm/CCM_Stub_Export.h b/CIAO/ccm/CCM_Stub_Export.h new file mode 100644 index 00000000000..dad69c9cc0e --- /dev/null +++ b/CIAO/ccm/CCM_Stub_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CCM_Stub +// ------------------------------ +#ifndef CCM_STUB_EXPORT_H +#define CCM_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CCM_STUB_HAS_DLL) +# define CCM_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CCM_STUB_HAS_DLL */ + +#if !defined (CCM_STUB_HAS_DLL) +# define CCM_STUB_HAS_DLL 1 +#endif /* ! CCM_STUB_HAS_DLL */ + +#if defined (CCM_STUB_HAS_DLL) && (CCM_STUB_HAS_DLL == 1) +# if defined (CCM_STUB_BUILD_DLL) +# define CCM_Stub_Export ACE_Proper_Export_Flag +# define CCM_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CCM_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CCM_STUB_BUILD_DLL */ +# define CCM_Stub_Export ACE_Proper_Import_Flag +# define CCM_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CCM_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CCM_STUB_BUILD_DLL */ +#else /* CCM_STUB_HAS_DLL == 1 */ +# define CCM_Stub_Export +# define CCM_STUB_SINGLETON_DECLARATION(T) +# define CCM_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CCM_STUB_HAS_DLL == 1 */ + +// Set CCM_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CCM_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define CCM_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CCM_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CCM_STUB_NTRACE */ + +#if (CCM_STUB_NTRACE == 1) +# define CCM_STUB_TRACE(X) +#else /* (CCM_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CCM_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CCM_STUB_NTRACE == 1) */ + +#endif /* CCM_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ccm/CCM_Svnt_Export.h b/CIAO/ccm/CCM_Svnt_Export.h new file mode 100644 index 00000000000..edb1b38f5ba --- /dev/null +++ b/CIAO/ccm/CCM_Svnt_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CCM_Svnt +// ------------------------------ +#ifndef CCM_SVNT_EXPORT_H +#define CCM_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CCM_SVNT_HAS_DLL) +# define CCM_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CCM_SVNT_HAS_DLL */ + +#if !defined (CCM_SVNT_HAS_DLL) +# define CCM_SVNT_HAS_DLL 1 +#endif /* ! CCM_SVNT_HAS_DLL */ + +#if defined (CCM_SVNT_HAS_DLL) && (CCM_SVNT_HAS_DLL == 1) +# if defined (CCM_SVNT_BUILD_DLL) +# define CCM_Svnt_Export ACE_Proper_Export_Flag +# define CCM_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CCM_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CCM_SVNT_BUILD_DLL */ +# define CCM_Svnt_Export ACE_Proper_Import_Flag +# define CCM_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CCM_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CCM_SVNT_BUILD_DLL */ +#else /* CCM_SVNT_HAS_DLL == 1 */ +# define CCM_Svnt_Export +# define CCM_SVNT_SINGLETON_DECLARATION(T) +# define CCM_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CCM_SVNT_HAS_DLL == 1 */ + +// Set CCM_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CCM_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define CCM_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CCM_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CCM_SVNT_NTRACE */ + +#if (CCM_SVNT_NTRACE == 1) +# define CCM_SVNT_TRACE(X) +#else /* (CCM_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CCM_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CCM_SVNT_NTRACE == 1) */ + +#endif /* CCM_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ccm/CCM_Transaction.idl b/CIAO/ccm/CCM_Transaction.idl new file mode 100644 index 00000000000..5760d39846d --- /dev/null +++ b/CIAO/ccm/CCM_Transaction.idl @@ -0,0 +1,76 @@ +// $Id$ + +#if !defined (CCM_TRANSACTION_IDL) +#define CCM_TRANSACTION_IDL + +module Components +{ + typeprefix Components "omg.org"; + + // @@ Components::Transaction is still there. + module Transaction + { + + typedef sequence<octet> TranToken; + + exception NoTransaction {}; + exception NotSupported {}; + exception SystemError {}; + exception RollbackError {}; + exception HeuristicMixed {}; + exception HeuristicRollback {}; + exception Security {}; + exception InvalidToken {}; + + enum Status + { + ACTIVE, + MARKED_ROLLBACK, + PREPARED, + COMMITTED, + ROLLED_BACK, + NO_TRANSACTION, + PREPARING, + COMMITTING, + ROLLING_BACK + }; + + local interface UserTransaction { + void begin () + raises (NotSupported, + SystemError); + + void commit () + raises (RollbackError, + NoTransaction, + HeuristicMixed, + HeuristicRollback, + Security, + SystemError); + + void rollback () + raises (NoTransaction, + Security, + SystemError); + + void set_rollback_only () + raises (NoTransaction, + SystemError); + + Status get_status() + raises (SystemError); + + void set_timeout (in long to) + raises (SystemError); + + TranToken suspend () + raises (NoTransaction, + SystemError); + + void resume (in TranToken txtoken) + raises (InvalidToken, + SystemError); + }; + }; +}; +#endif /* CCM_TRANSACTION_IDL */ diff --git a/CIAO/ccm/ComponentServer/CCM_ComponentServer.idl b/CIAO/ccm/ComponentServer/CCM_ComponentServer.idl new file mode 100644 index 00000000000..84a51c4e697 --- /dev/null +++ b/CIAO/ccm/ComponentServer/CCM_ComponentServer.idl @@ -0,0 +1,61 @@ +// $Id$ + +#if !defined (COMPONENTSERVER_IDL) +#define COMPONENTSERVER_IDL + +#include "ccm/ComponentServer/CCM_ComponentServer_Base.idl" + +module Components +{ + typeprefix Components "omg.org"; + + module Deployment + { + interface Container; + typedef sequence<Container> Containers; + interface ServerActivator; + + interface ComponentServer + { + readonly attribute ConfigValues configuration; + + ServerActivator get_server_activator(); + + Container create_container(in ConfigValues config) + raises (::Components::CreateFailure, + ::Components::Deployment::InvalidConfiguration); + + void remove_container(in Container cref) raises (::Components::RemoveFailure); + + Containers get_containers(); + + void remove() raises (::Components::RemoveFailure); + }; + + typedef sequence<ComponentServer> ComponentServers; + + interface Container + { + readonly attribute ConfigValues configuration; + + ComponentServer get_component_server(); + + CCMHome install_home(in UUID id, + in string entrypt, + in ConfigValues config) + raises (::Components::Deployment::UnknownImplId, + ::Components::Deployment::ImplEntryPointNotFound, + ::Components::Deployment::InstallationFailure, + ::Components::Deployment::InvalidConfiguration); + + void remove_home(in CCMHome href) raises (::Components::RemoveFailure); + + CCMHomes get_homes(); + + void remove() raises (::Components::RemoveFailure); + }; + }; + +}; + +#endif /* COMPONENTSERVER_IDL */ diff --git a/CIAO/ccm/ComponentServer/CCM_ComponentServer.mpc b/CIAO/ccm/ComponentServer/CCM_ComponentServer.mpc new file mode 100644 index 00000000000..63bb1af3f8b --- /dev/null +++ b/CIAO/ccm/ComponentServer/CCM_ComponentServer.mpc @@ -0,0 +1,57 @@ +// -*- MPC -*- +// $Id$ + +project(CCM_ComponentServer_IDL) : taoidldefaults, anytypecode { + idlflags += -Wb,stub_export_macro=DAnCE_ComponentServer_stub_Export + idlflags += -Wb,stub_export_include=DAnCE_ComponentServer_stub_export.h + idlflags += -Wb,skel_export_macro=DAnCE_ComponentServer_svnt_Export + idlflags += -Wb,skel_export_include=DAnCE_ComponentServer_svnt_export.h + + custom_only = 1 + + IDL_Files { + CCM_ComponentServer.idl + CCM_ComponentServer_Base.idl + CCM_ComponentServer_Client.idl + } +} + +project(CCM_ComponentServer_stub) : taolib_with_idl, tao_output, messaging, ccm_stub, anytypecode, ciao_lib { + dynamicflags = DANCE_COMPONENTSERVER_STUB_BUILD_DLL + after += CCM_ComponentServer_IDL + + Header_Files { + DAnCE_ComponentServer_stub_export.h + CCM_ComponentServerC.h + CCM_ComponentServer_ClientC.h + CCM_ComponentServer_BaseC.h + } + + Source_Files { + CCM_ComponentServerC.cpp + CCM_ComponentServer_ClientC.cpp + CCM_ComponentServer_BaseC.cpp + } + IDL_Files { + } +} + +project(CCM_ComponentServer_svnt) : taolib_with_idl, tao_output, messaging, ccm_componentserver_stub, anytypecode, ciao_lib { + dynamicflags = DANCE_COMPONENTSERVER_SVNT_BUILD_DLL + + Header_Files { + DAnCE_ComponentServer_svnt_export.h + CCM_ComponentServerS.h + CCM_ComponentServer_ClientS.h + CCM_ComponentServer_BaseS.h + } + + Source_Files { + CCM_ComponentServerS.cpp + CCM_ComponentServer_ClientS.cpp + CCM_ComponentServer_BaseS.cpp + } + IDL_Files { + } +} + diff --git a/CIAO/ccm/ComponentServer/CCM_ComponentServer_Base.idl b/CIAO/ccm/ComponentServer/CCM_ComponentServer_Base.idl new file mode 100644 index 00000000000..c44ce1b8796 --- /dev/null +++ b/CIAO/ccm/ComponentServer/CCM_ComponentServer_Base.idl @@ -0,0 +1,56 @@ +/** + * @file CCM_ComponentServer_Base.idl + * $Id$ + * Contains base types for all componenent server interfaces. + * These interfaces are not part of the CCM standard. + */ + +#ifndef COMPONENTSERVER_BASE_IDL_ +#define COMPONENTSERVER_BASE_IDL_ + +#include "ccm/CCM_Home.idl" +#include "ccm/CCM_KeylessCCMHome.idl" +#include "ccm/CCM_Navigation.idl" +#include "ccm/CCM_StandardConfigurator.idl" + +module Components +{ + typeprefix Components "omg.org"; + + module Deployment + { + typedef string UUID; + typedef string Location; + + typedef FailureReason InvalidConfigurationReason; + const InvalidConfigurationReason UnknownConfigValueName = 0; + const InvalidConfigurationReason InvalidConfigValueType = 1; + const InvalidConfigurationReason ConfigValueRequired = 2; + const InvalidConfigurationReason ConfigValueNotExpected = 3; + + exception InvalidConfiguration + { + InvalidConfigurationReason reason; + FeatureName name; + }; + + exception UnknownImplId + { + }; + + exception InvalidLocation + { + }; + + exception ImplEntryPointNotFound + { + }; + + exception InstallationFailure + { + FailureReason reason; + }; + }; +}; + +#endif diff --git a/CIAO/ccm/ComponentServer/CCM_ComponentServer_Client.idl b/CIAO/ccm/ComponentServer/CCM_ComponentServer_Client.idl new file mode 100644 index 00000000000..8d5b0b02abd --- /dev/null +++ b/CIAO/ccm/ComponentServer/CCM_ComponentServer_Client.idl @@ -0,0 +1,47 @@ +/** + * @file CCM_ComponentServer_Client.idl + * Client side objects hosted by the NodeApplication. + * $Id$ + */ + +#ifndef COMPONENTSERVER_CLIENT_IDL_ +#define COMPONENTSERVER_CLIENT_IDL_ + +#include "ccm/ComponentServer/CCM_ComponentServer.idl" + +module Components +{ + typeprefix Components "omg.org"; + + module Deployment + { + interface ComponentInstallation + { + void install(in UUID implUUID, in Location component_loc) + raises (InvalidLocation, InstallationFailure); + + void replace(in UUID implUUID, in Location component_loc) + raises (InvalidLocation, InstallationFailure); + + void remove(in UUID implUUID) + raises (UnknownImplId, RemoveFailure); + + Location get_implementation(in UUID implUUID) + raises(UnknownImplId, InstallationFailure); + }; + + interface ServerActivator + { + ComponentServer create_component_server(in ConfigValues config) + raises(::Components::CreateFailure, + ::Components::Deployment::InvalidConfiguration); + + void remove_component_server(in ComponentServer server) + raises(::Components::RemoveFailure); + + ComponentServers get_component_servers(); + }; + }; +}; + +#endif diff --git a/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_stub_export.h b/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_stub_export.h new file mode 100644 index 00000000000..f4e188e2df0 --- /dev/null +++ b/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_ComponentServer_stub +// ------------------------------ +#ifndef DANCE_COMPONENTSERVER_STUB_EXPORT_H +#define DANCE_COMPONENTSERVER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_COMPONENTSERVER_STUB_HAS_DLL) +# define DANCE_COMPONENTSERVER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_COMPONENTSERVER_STUB_HAS_DLL */ + +#if !defined (DANCE_COMPONENTSERVER_STUB_HAS_DLL) +# define DANCE_COMPONENTSERVER_STUB_HAS_DLL 1 +#endif /* ! DANCE_COMPONENTSERVER_STUB_HAS_DLL */ + +#if defined (DANCE_COMPONENTSERVER_STUB_HAS_DLL) && (DANCE_COMPONENTSERVER_STUB_HAS_DLL == 1) +# if defined (DANCE_COMPONENTSERVER_STUB_BUILD_DLL) +# define DAnCE_ComponentServer_stub_Export ACE_Proper_Export_Flag +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_COMPONENTSERVER_STUB_BUILD_DLL */ +# define DAnCE_ComponentServer_stub_Export ACE_Proper_Import_Flag +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_COMPONENTSERVER_STUB_BUILD_DLL */ +#else /* DANCE_COMPONENTSERVER_STUB_HAS_DLL == 1 */ +# define DAnCE_ComponentServer_stub_Export +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) +# define DANCE_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_COMPONENTSERVER_STUB_HAS_DLL == 1 */ + +// Set DANCE_COMPONENTSERVER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_COMPONENTSERVER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_COMPONENTSERVER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_COMPONENTSERVER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_COMPONENTSERVER_STUB_NTRACE */ + +#if (DANCE_COMPONENTSERVER_STUB_NTRACE == 1) +# define DANCE_COMPONENTSERVER_STUB_TRACE(X) +#else /* (DANCE_COMPONENTSERVER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_COMPONENTSERVER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_COMPONENTSERVER_STUB_NTRACE == 1) */ + +#endif /* DANCE_COMPONENTSERVER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_svnt_export.h b/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_svnt_export.h new file mode 100644 index 00000000000..475047b4e16 --- /dev/null +++ b/CIAO/ccm/ComponentServer/DAnCE_ComponentServer_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl DAnCE_ComponentServer_svnt +// ------------------------------ +#ifndef DANCE_COMPONENTSERVER_SVNT_EXPORT_H +#define DANCE_COMPONENTSERVER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DANCE_COMPONENTSERVER_SVNT_HAS_DLL) +# define DANCE_COMPONENTSERVER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DANCE_COMPONENTSERVER_SVNT_HAS_DLL */ + +#if !defined (DANCE_COMPONENTSERVER_SVNT_HAS_DLL) +# define DANCE_COMPONENTSERVER_SVNT_HAS_DLL 1 +#endif /* ! DANCE_COMPONENTSERVER_SVNT_HAS_DLL */ + +#if defined (DANCE_COMPONENTSERVER_SVNT_HAS_DLL) && (DANCE_COMPONENTSERVER_SVNT_HAS_DLL == 1) +# if defined (DANCE_COMPONENTSERVER_SVNT_BUILD_DLL) +# define DAnCE_ComponentServer_svnt_Export ACE_Proper_Export_Flag +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DANCE_COMPONENTSERVER_SVNT_BUILD_DLL */ +# define DAnCE_ComponentServer_svnt_Export ACE_Proper_Import_Flag +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DANCE_COMPONENTSERVER_SVNT_BUILD_DLL */ +#else /* DANCE_COMPONENTSERVER_SVNT_HAS_DLL == 1 */ +# define DAnCE_ComponentServer_svnt_Export +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) +# define DANCE_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DANCE_COMPONENTSERVER_SVNT_HAS_DLL == 1 */ + +// Set DANCE_COMPONENTSERVER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (DANCE_COMPONENTSERVER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define DANCE_COMPONENTSERVER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define DANCE_COMPONENTSERVER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !DANCE_COMPONENTSERVER_SVNT_NTRACE */ + +#if (DANCE_COMPONENTSERVER_SVNT_NTRACE == 1) +# define DANCE_COMPONENTSERVER_SVNT_TRACE(X) +#else /* (DANCE_COMPONENTSERVER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define DANCE_COMPONENTSERVER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (DANCE_COMPONENTSERVER_SVNT_NTRACE == 1) */ + +#endif /* DANCE_COMPONENTSERVER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ccm/Components.idl b/CIAO/ccm/Components.idl new file mode 100644 index 00000000000..cda791f25fa --- /dev/null +++ b/CIAO/ccm/Components.idl @@ -0,0 +1,17 @@ +// $Id$ + +/** + * This file is included in the generated executor + * mapping IDL file, + */ + +#if !defined (CCM_COMPONENTS_IDL) +#define CCM_COMPONENTS_IDL + +#include "ccm/CCM_Component.idl" +#include "ccm/CCM_KeylessCCMHome.idl" +#include "ccm/CCM_Home.idl" +#include "ccm/CCM_Object.idl" + +#endif /* CCM_COMPONENTS_IDL */ + diff --git a/CIAO/ccm/CosPersistentState.idl b/CIAO/ccm/CosPersistentState.idl new file mode 100644 index 00000000000..b6ce4324fa8 --- /dev/null +++ b/CIAO/ccm/CosPersistentState.idl @@ -0,0 +1,21 @@ +// $Id$ + +/** + * @@ This is just a temporary file. Since TAO does not have + * CosPersistentState at all, we use this file to define + * types necessary to get ComponentBase.idl to compile. + */ + +#if !defined (CIAO_COSPERSISTENTSTATE_PIDL) +#define CIAO_COSPERSISTENTSTATE_PIDL + +module CosPersistentState { + + local interface CatalogBase + { + }; + + typedef sequence<octet> _TypeId; + typedef string Pid; +}; +#endif /* CIAO_COSPERSISTENTSTATE_PIDL */ diff --git a/CIAO/ccm/Security.idl b/CIAO/ccm/Security.idl new file mode 100644 index 00000000000..ce38f2ce1aa --- /dev/null +++ b/CIAO/ccm/Security.idl @@ -0,0 +1,23 @@ +/** + * @@ This is just a temporary file. CIAO doesn't use the security + * service in its implementation but just using this local + * interface below from the real security service pulls in + * 250Kb of footprint + * + * $Id$ + */ + +#if !defined (CIAO_SECURITY_IDL) +#define CIAO_SECURITY_IDL + +#pragma prefix "omg.org" + +module SecurityLevel2 { + +# pragma version SecurityLevel2 1.8 + + local interface Credentials + { + }; +}; +#endif /* CIAO_SECURITY_IDL */ diff --git a/CIAO/ciao/extension/CCM_ClientContainerInterceptor.idl b/CIAO/ccm/extension/CCM_ClientContainerInterceptor.idl index 27a5fdc8929..27a5fdc8929 100644 --- a/CIAO/ciao/extension/CCM_ClientContainerInterceptor.idl +++ b/CIAO/ccm/extension/CCM_ClientContainerInterceptor.idl diff --git a/CIAO/ciao/extension/CCM_ClientContainerInterceptorRegistration.idl b/CIAO/ccm/extension/CCM_ClientContainerInterceptorRegistration.idl index 031f06f1a0f..031f06f1a0f 100644 --- a/CIAO/ciao/extension/CCM_ClientContainerInterceptorRegistration.idl +++ b/CIAO/ccm/extension/CCM_ClientContainerInterceptorRegistration.idl diff --git a/CIAO/ciao/extension/CCM_ContainerClientRequestInfo.idl b/CIAO/ccm/extension/CCM_ContainerClientRequestInfo.idl index b44dac880b8..b44dac880b8 100644 --- a/CIAO/ciao/extension/CCM_ContainerClientRequestInfo.idl +++ b/CIAO/ccm/extension/CCM_ContainerClientRequestInfo.idl diff --git a/CIAO/ciao/extension/CCM_ContainerInterceptor.idl b/CIAO/ccm/extension/CCM_ContainerInterceptor.idl index b5ccdf52fae..b5ccdf52fae 100644 --- a/CIAO/ciao/extension/CCM_ContainerInterceptor.idl +++ b/CIAO/ccm/extension/CCM_ContainerInterceptor.idl diff --git a/CIAO/ciao/extension/CCM_ContainerRequestInfo.idl b/CIAO/ccm/extension/CCM_ContainerRequestInfo.idl index 3fb590acc16..3fb590acc16 100644 --- a/CIAO/ciao/extension/CCM_ContainerRequestInfo.idl +++ b/CIAO/ccm/extension/CCM_ContainerRequestInfo.idl diff --git a/CIAO/ciao/extension/CCM_ContainerServantRequestInfo.idl b/CIAO/ccm/extension/CCM_ContainerServantRequestInfo.idl index 0a3348b8f7e..0a3348b8f7e 100644 --- a/CIAO/ciao/extension/CCM_ContainerServantRequestInfo.idl +++ b/CIAO/ccm/extension/CCM_ContainerServantRequestInfo.idl diff --git a/CIAO/ciao/extension/CCM_ContainerServerRequestInfo.idl b/CIAO/ccm/extension/CCM_ContainerServerRequestInfo.idl index 4868e6a2e8d..4868e6a2e8d 100644 --- a/CIAO/ciao/extension/CCM_ContainerServerRequestInfo.idl +++ b/CIAO/ccm/extension/CCM_ContainerServerRequestInfo.idl diff --git a/CIAO/ciao/extension/CCM_ContainerStubRequestInfo.idl b/CIAO/ccm/extension/CCM_ContainerStubRequestInfo.idl index da14afa9e08..da14afa9e08 100644 --- a/CIAO/ciao/extension/CCM_ContainerStubRequestInfo.idl +++ b/CIAO/ccm/extension/CCM_ContainerStubRequestInfo.idl diff --git a/CIAO/ciao/extension/CCM_ExtensionComponent.idl b/CIAO/ccm/extension/CCM_ExtensionComponent.idl index 585e5e85f64..585e5e85f64 100644 --- a/CIAO/ciao/extension/CCM_ExtensionComponent.idl +++ b/CIAO/ccm/extension/CCM_ExtensionComponent.idl diff --git a/CIAO/ciao/extension/CCM_ExtensionContext.idl b/CIAO/ccm/extension/CCM_ExtensionContext.idl index 33fa969b436..33fa969b436 100644 --- a/CIAO/ciao/extension/CCM_ExtensionContext.idl +++ b/CIAO/ccm/extension/CCM_ExtensionContext.idl diff --git a/CIAO/ciao/extension/CCM_InvalidRegistration.idl b/CIAO/ccm/extension/CCM_InvalidRegistration.idl index a5dc36c640e..a5dc36c640e 100644 --- a/CIAO/ciao/extension/CCM_InvalidRegistration.idl +++ b/CIAO/ccm/extension/CCM_InvalidRegistration.idl diff --git a/CIAO/ciao/extension/CCM_QoS.idl b/CIAO/ccm/extension/CCM_QoS.idl index f78f98d3665..f78f98d3665 100644 --- a/CIAO/ciao/extension/CCM_QoS.idl +++ b/CIAO/ccm/extension/CCM_QoS.idl diff --git a/CIAO/ciao/extension/CCM_ServantContainerInterceptor.idl b/CIAO/ccm/extension/CCM_ServantContainerInterceptor.idl index 884a1af2599..884a1af2599 100644 --- a/CIAO/ciao/extension/CCM_ServantContainerInterceptor.idl +++ b/CIAO/ccm/extension/CCM_ServantContainerInterceptor.idl diff --git a/CIAO/ciao/extension/CCM_ServantContainerInterceptorRegistration.idl b/CIAO/ccm/extension/CCM_ServantContainerInterceptorRegistration.idl index 39448de9a58..39448de9a58 100644 --- a/CIAO/ciao/extension/CCM_ServantContainerInterceptorRegistration.idl +++ b/CIAO/ccm/extension/CCM_ServantContainerInterceptorRegistration.idl diff --git a/CIAO/ciao/extension/CCM_ServerContainerInterceptor.idl b/CIAO/ccm/extension/CCM_ServerContainerInterceptor.idl index 58ce5cc69a7..58ce5cc69a7 100644 --- a/CIAO/ciao/extension/CCM_ServerContainerInterceptor.idl +++ b/CIAO/ccm/extension/CCM_ServerContainerInterceptor.idl diff --git a/CIAO/ciao/extension/CCM_ServerContainerInterceptorRegistration.idl b/CIAO/ccm/extension/CCM_ServerContainerInterceptorRegistration.idl index b4a3dafac26..b4a3dafac26 100644 --- a/CIAO/ciao/extension/CCM_ServerContainerInterceptorRegistration.idl +++ b/CIAO/ccm/extension/CCM_ServerContainerInterceptorRegistration.idl diff --git a/CIAO/ciao/extension/CCM_StubContainerInterceptor.idl b/CIAO/ccm/extension/CCM_StubContainerInterceptor.idl index c183801af86..c183801af86 100644 --- a/CIAO/ciao/extension/CCM_StubContainerInterceptor.idl +++ b/CIAO/ccm/extension/CCM_StubContainerInterceptor.idl diff --git a/CIAO/ciao/extension/CCM_StubContainerInterceptorRegistration.idl b/CIAO/ccm/extension/CCM_StubContainerInterceptorRegistration.idl index 61ae62f51fa..61ae62f51fa 100644 --- a/CIAO/ciao/extension/CCM_StubContainerInterceptorRegistration.idl +++ b/CIAO/ccm/extension/CCM_StubContainerInterceptorRegistration.idl diff --git a/CIAO/ciao/extension/ExtensionContext.cpp b/CIAO/ccm/extension/ExtensionContext.cpp index 7592e2b97d2..7592e2b97d2 100644 --- a/CIAO/ciao/extension/ExtensionContext.cpp +++ b/CIAO/ccm/extension/ExtensionContext.cpp diff --git a/CIAO/ciao/extension/ExtensionContext.h b/CIAO/ccm/extension/ExtensionContext.h index d2ea1ee9948..d2ea1ee9948 100644 --- a/CIAO/ciao/extension/ExtensionContext.h +++ b/CIAO/ccm/extension/ExtensionContext.h diff --git a/CIAO/ciao/CCM_Base.idl b/CIAO/ciao/CCM_Base.idl deleted file mode 100644 index 40d6b308668..00000000000 --- a/CIAO/ciao/CCM_Base.idl +++ /dev/null @@ -1,26 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I W:/ACE_wrappers/TAO Component_Base.idl - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Base.idl - */ - -#if !defined (CCM_BASE_IDL) -#define CCM_BASE_IDL - -module Components -{ - typeprefix Components "omg.org"; - - exception InvalidConnection {}; - exception AlreadyConnected {}; - exception NoConnection {}; -}; -#endif /* CCM_BASE_IDL */ diff --git a/CIAO/ciao/CCM_CCM2Context.idl b/CIAO/ciao/CCM_CCM2Context.idl deleted file mode 100644 index 9b29d8b7d3b..00000000000 --- a/CIAO/ciao/CCM_CCM2Context.idl +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -#if !defined (CCM_2CONTEXT_IDL) -#define CCM_2CONTEXT_IDL - -#include "ciao/CCM_Container.idl" -#include "ciao/CCM_HomeRegistration.idl" -#include <CosPersistentState.idl> - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - typedef CosPersistentState::CatalogBase CatalogBase; - typedef CosPersistentState::_TypeId _TypeId; - - exception PolicyMismatch {}; - exception PersistenceNotAvailable {}; - - local interface CCM2Context : CCMContext - { - HomeRegistration get_home_registration (); - - void req_passivate () - raises (PolicyMismatch); - - CatalogBase get_persistence (in _TypeId catalog_type_id) - raises (PersistenceNotAvailable); - }; - -}; -#endif /* CCM_2CONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_CCMException.idl b/CIAO/ciao/CCM_CCMException.idl deleted file mode 100644 index 012f3dd24ff..00000000000 --- a/CIAO/ciao/CCM_CCMException.idl +++ /dev/null @@ -1,40 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -#if !defined (CCM_CCMEXCEPTION_IDL) -#define CCM_CCMEXCEPTION_IDL - -module Components -{ - typeprefix Components "omg.org"; - - enum CCMExceptionReason - { - SYSTEM_ERROR, - CREATE_ERROR, - REMOVE_ERROR, - DUPLICATE_KEY, - FIND_ERROR, - OBJECT_NOT_FOUND, - NO_SUCH_ENTITY, - QOS_ERROR, - REGISTRATION_ERROR, - SERVICE_INSTALLATION_ERROR - }; - - exception CCMException - { - CCMExceptionReason reason; - }; -}; -#endif /* CCM_CCMEXCEPTION_IDL */ diff --git a/CIAO/ciao/CCM_Component.idl b/CIAO/ciao/CCM_Component.idl deleted file mode 100644 index 8a604edf085..00000000000 --- a/CIAO/ciao/CCM_Component.idl +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_COMPONENT_IDL) -#define CCM_COMPONENT_IDL - -#include "ciao/CCM_Events.idl" -#include "ciao/CCM_Home.idl" -#include "ciao/CCM_Object.idl" -#include "ciao/CCM_Enumeration.idl" - -#endif /* CCM_COMPONENT_IDL */ diff --git a/CIAO/ciao/CCM_ComponentId.idl b/CIAO/ciao/CCM_ComponentId.idl deleted file mode 100644 index 299515d0978..00000000000 --- a/CIAO/ciao/CCM_ComponentId.idl +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_COMPONENTID_IDL) -#define CCM_COMPONENTID_IDL - -#include "ciao/CCM_StateIdFactory.idl" - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - local interface ComponentId - { - FacetId get_target_facet(); - - SegmentId get_target_segment(); - - StateIdValue get_target_state_id (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - StateIdValue get_segment_state_id (in SegmentId seg, - in StateIdFactory sid_factory) - raises (InvalidStateIdData); - - ComponentId create_with_new_target (in FacetId new_target_facet, - in SegmentId new_target_segment); - - SegmentDescrSeq get_segment_descrs (in StateIdFactory sid_factory) - raises (InvalidStateIdData); - }; -}; -#endif /* CCM_COMPONENTID_IDL */ diff --git a/CIAO/ciao/CCM_Configurator.idl b/CIAO/ciao/CCM_Configurator.idl deleted file mode 100644 index 0d48f8e65cb..00000000000 --- a/CIAO/ciao/CCM_Configurator.idl +++ /dev/null @@ -1,31 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_CONFIGURATOR_IDL) -#define CCM_CONFIGURATOR_IDL - -module Components -{ - typeprefix Components "omg.org"; - - exception WrongComponentType {}; - - interface CCMObject; - - interface Configurator - { - void configure (in CCMObject comp) - raises (WrongComponentType); - }; -}; -#endif /* CCM_CONFIGURATOR_IDL */ diff --git a/CIAO/ciao/CCM_Container.idl b/CIAO/ciao/CCM_Container.idl deleted file mode 100644 index d6555e16170..00000000000 --- a/CIAO/ciao/CCM_Container.idl +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_CONTAINER_IDL) -#define CCM_CONTAINER_IDL - -#include "ciao/CCM_Component.idl" -#include "ciao/CCM_CCMException.idl" -#include "ciao/CCM_HomeExecutorBase.idl" -#include "ciao/CCM_SessionContext.idl" -#include "ciao/CCM_SessionComponent.idl" - -#endif /* CCM_CONTAINER_IDL */ diff --git a/CIAO/ciao/CCM_Container_Ex.idl b/CIAO/ciao/CCM_Container_Ex.idl deleted file mode 100644 index c2161d56c94..00000000000 --- a/CIAO/ciao/CCM_Container_Ex.idl +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_CONTAINER_EX_IDL) -#define CCM_CONTAINER_EX_IDL - -#include "ciao/CCM_Container.idl" -#include "ciao/CCM_Session2Context.idl" -#include "ciao/CCM_EntityContext.idl" - -#endif /* CCM_CONTAINER_EX_IDL */ diff --git a/CIAO/ciao/CCM_Context.idl b/CIAO/ciao/CCM_Context.idl deleted file mode 100644 index e5eb75c218f..00000000000 --- a/CIAO/ciao/CCM_Context.idl +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ - -#if !defined (CCM_CONTEXT_IDL) -#define CCM_CONTEXT_IDL - -#include "ciao/Security.idl" -#include "ciao/CCM_Transaction.idl" -#include "ciao/CCM_Home.idl" -#include "ciao/CCM_CCMException.idl" - -// *************** Basic Container interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - typedef SecurityLevel2::Credentials Principal; - - exception IllegalState {}; - - local interface CCMContext - { - Principal get_caller_principal(); - - CCMHome get_CCM_home(); - - boolean get_rollback_only() - raises (IllegalState); - - Transaction::UserTransaction get_user_transaction() - raises (IllegalState); - - boolean is_caller_in_role (in string role); - - void set_rollback_only() - raises (IllegalState); - - /** - * Added for QoS4CCM - */ - Object resolve_service_reference(in string service_id) - raises (CCMException); - }; -}; -#endif /* CCM_CONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_Cookie.idl b/CIAO/ciao/CCM_Cookie.idl deleted file mode 100644 index f815d9f1ef9..00000000000 --- a/CIAO/ciao/CCM_Cookie.idl +++ /dev/null @@ -1,29 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I W:/ACE_wrappers/TAO Component_Base.idl - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Base.idl - */ - -#if !defined (CCM_COOKIE_IDL) -#define CCM_COOKIE_IDL - -#include "tao/OctetSeq.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - valuetype Cookie - { - private CORBA::OctetSeq cookieValue; - }; -}; -#endif /* CCM_COOKIE_IDL */ diff --git a/CIAO/ciao/CCM_Core.mpc b/CIAO/ciao/CCM_Core.mpc deleted file mode 100644 index a6b8cda19b2..00000000000 --- a/CIAO/ciao/CCM_Core.mpc +++ /dev/null @@ -1,239 +0,0 @@ -// $Id$ - -project (CIAO_Client) : taolib_with_idl, tao_output, valuetype, ifr_client { - sharedname = CIAO_Client - idlflags += -Wb,stub_export_include=CIAO_Client_Export.h - idlflags += -Wb,stub_export_macro=CIAO_CLIENT_Export - idlflags += -Wb,skel_export_include=CIAO_Container_Export.h - idlflags += -Wb,skel_export_macro=CIAO_CONTAINER_Export - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - dynamicflags = CIAO_CLIENT_BUILD_DLL - - IDL_Files { - idlflags += -SS -Sci - CCM_Base.idl - CCM_Component.idl - } - - IDL_Files { - idlflags += -SS - CCM_Cookie.idl - CCM_Enumeration.idl - } - - IDL_Files { - idlflags += -Ssi -Sci - Components.idl - } - - IDL_Files { - CCM_HomeConfiguration.idl - CCM_StandardConfigurator.idl - CCM_Home.idl - CCM_Object.idl - CCM_PrimaryKeyBase.idl - } - - IDL_Files { - idlflags += -Ssi - CCM_HomeFinder.idl - CCM_Configurator.idl - CCM_KeylessCCMHome.idl - CCM_Navigation.idl - CCM_Receptacle.idl - } - - IDL_Files { - CCM_Events.idl - CCM_EventBase.idl - CCM_EventConsumerBase.idl - } - - Source_Files { - CCM_BaseC.cpp - CCM_EventsC.cpp - CCM_EventBaseC.cpp - CCM_EventConsumerBaseC.cpp - CCM_ComponentC.cpp - CCM_EnumerationC.cpp - CCM_HomeC.cpp - CCM_ConfiguratorC.cpp - CCM_HomeConfigurationC.cpp - CCM_KeylessCCMHomeC.cpp - CCM_StandardConfiguratorC.cpp - CCM_HomeFinderC.cpp - CCM_NavigationC.cpp - CCM_ReceptacleC.cpp - CCM_CookieC.cpp - CCM_ObjectC.cpp - CCM_PrimaryKeyBaseC.cpp - Client_init.cpp - ComponentsC.cpp - } - - Header_Files { - CIAO_Client_Export.h - CIAO_common.h - } -} - -project (CIAO_Container) : orbsvcslib, orbsvcs_output \ - , portableserver \ - , valuetype \ - , ifr_client \ - , codecfactory \ - , pi \ - , ciao_client_dnc \ - , avoids_corba_e_compact \ - , avoids_corba_e_micro \ -{ - sharedname = CIAO_Container - idlflags += -Wb,export_include=CIAO_Container_Export.h - idlflags += -Wb,export_macro=CIAO_CONTAINER_Export - dynamicflags = CIAO_CONTAINER_BUILD_DLL - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - IDL_Files { - idlflags += -SS -Sci \ - -Wb,versioning_begin=TAO_BEGIN_VERSIONED_NAMESPACE_DECL \ - -Wb,versioning_end=TAO_END_VERSIONED_NAMESPACE_DECL - Security.idl - } - - IDL_Files { - idlflags += -SS -Sci - CCM_Context.idl - CCM_CCMException.idl - CCM_EntityComponent.idl - CCM_EntityContext.idl - CIAO_SwapExec.idl - CIAO_UpgradeableContext.idl - } - - IDL_Files { - idlflags += -SS - CCM_CCM2Context.idl - CCM_ProxyHomeRegistration.idl - CCM_Session2Context.idl - CCM_Transaction.idl - CosPersistentState.idl - CCM_Container.idl - CCM_SessionContext.idl - CCM_SessionComponent.idl - CCM_Container_Ex.idl - CCM_StateIdFactory.idl - CCM_Entity2Context.idl - CCM_ComponentId.idl - CCM_ExecutorLocator.idl - CCM_EnterpriseComponent.idl - CCM_SessionSynchronization.idl - CCM_HomeRegistration.idl - CCM_HomeExecutorBase.idl - } - - Source_Files { - CCM_TransactionC.cpp - CosPersistentStateC.cpp - CCM_ContainerC.cpp - CCM_SessionContextC.cpp - CCM_SessionComponentC.cpp - CCM_EnterpriseComponentC.cpp - CCM_SessionSynchronizationC.cpp - CCM_CCMExceptionC.cpp - CCM_ContextC.cpp - SecurityC.cpp - CCM_Container_ExC.cpp - CCM_StateIdFactoryC.cpp - CCM_ComponentIdC.cpp - CCM_Entity2ContextC.cpp - CCM_ExecutorLocatorC.cpp - CCM_ProxyHomeRegistrationC.cpp - CCM_Session2ContextC.cpp - CCM_CCM2ContextC.cpp - CCM_HomeRegistrationC.cpp - CCM_HomeExecutorBaseC.cpp - CCM_EntityContextC.cpp - CCM_EntityComponentC.cpp - CCM_EventsS.cpp - CCM_EventConsumerBaseS.cpp - CCM_EventBaseS.cpp - CCM_ConfiguratorS.cpp - CCM_HomeConfigurationS.cpp - CCM_KeylessCCMHomeS.cpp - CCM_StandardConfiguratorS.cpp - CCM_HomeS.cpp - CCM_ObjectS.cpp - CCM_PrimaryKeyBaseS.cpp - CCM_HomeFinderS.cpp - CCM_NavigationS.cpp - CCM_ReceptacleS.cpp - CIAO_SwapExecC.cpp - CIAO_UpgradeableContextC.cpp - Cookies.cpp - ComponentsS.cpp - } - - Header_Files { - CIAO_Container_Export.h - } -} - -project (CIAO_Server) : orbsvcslib, orbsvcs_output \ - , portableserver \ - , valuetype \ - , naming \ - , ifr_client \ - , utils \ - , ciao_container_dnc \ - , ciao_client_dnc \ - , ciao_deployment_svnt \ - , avoids_minimum_corba \ - , avoids_corba_e_compact \ - , avoids_corba_e_micro \ -{ - includes += $(CIAO_ROOT) - sharedname = CIAO_Server - idlflags += -Wb,export_include=CIAO_Server_Export.h \ - -Wb,export_macro=CIAO_SERVER_Export - dynamicflags = CIAO_SERVER_BUILD_DLL - - IDL_Files { - } - - Source_Files { - Container_Base.cpp - Session_Container.cpp - Swapping_Container.cpp - Context_Impl_Base.cpp - Home_Servant_Impl_Base.cpp - Servant_Impl_Base.cpp - Swapping_Servant_Home_Impl_Base.cpp - Server_init.cpp - Servant_Activator.cpp - Dynamic_Component_Activator.cpp - Dynamic_Component_Servant_Base.cpp - Port_Activator.cpp - StandardConfigurator_Impl.cpp - } - - Header_Files { - CIAO_Server_Export.h - CIAO_common.h - } - - Template_Files { - Context_Impl_T.cpp - Upgradeable_Context_Impl_T.cpp - Home_Servant_Impl_T.cpp - Swapping_Servant_Home_Impl_T.cpp - Dynamic_Component_Servant_T.cpp - Servant_Impl_T.cpp - Servant_Impl_Utils_T.cpp - Servant_Activator_T.cpp - } -} diff --git a/CIAO/ciao/CCM_EnterpriseComponent.idl b/CIAO/ciao/CCM_EnterpriseComponent.idl deleted file mode 100644 index b3f3d1b9432..00000000000 --- a/CIAO/ciao/CCM_EnterpriseComponent.idl +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_ENTERPRISECOMPONENT_IDL) -#define CCM_ENTERPRISECOMPONENT_IDL - -module Components -{ - typeprefix Components "omg.org"; - - local interface EnterpriseComponent {}; -}; -#endif /* CCM_CONTAINER_IDL */ diff --git a/CIAO/ciao/CCM_Entity2Context.idl b/CIAO/ciao/CCM_Entity2Context.idl deleted file mode 100644 index 4ed01244408..00000000000 --- a/CIAO/ciao/CCM_Entity2Context.idl +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_ENTITY2CONTEXT_IDL) -#define CCM_ENTITY2CONTEXT_IDL - -#include "ciao/CCM_Session2Context.idl" -#include "ciao/CCM_EntityContext.idl" -#include "ciao/CCM_ComponentId.idl" - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - local interface Entity2Context : EntityContext, CCM2Context - { - ComponentId get_component_id () - raises (IllegalState); - - ComponentId create_component_id (in FacetId target_facet, - in SegmentId target_segment, - in SegmentDescrSeq seq_descrs); - - ComponentId create_monolithic_component_id (in FacetId target_facet, - in StateIdValue sid); - - Object create_ref_from_cid (in CORBA::RepositoryId repid, - in ComponentId cid); - - ComponentId get_cid_from_ref (in Object objref) - raises (BadComponentReference); - }; -}; -#endif /* CCM_ENTITY2CONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_EntityComponent.idl b/CIAO/ciao/CCM_EntityComponent.idl deleted file mode 100644 index 0b04ad7131a..00000000000 --- a/CIAO/ciao/CCM_EntityComponent.idl +++ /dev/null @@ -1,51 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_ENTITYCOMPONENT_IDL) -#define CCM_ENTITYCOMPONENT_IDL - -#include "ciao/CCM_CCMException.idl" -#include "ciao/CCM_EnterpriseComponent.idl" -#include "ciao/CCM_EntityContext.idl" - -module Components -{ - typeprefix Components "omg.org"; - - local interface EntityComponent : EnterpriseComponent - { - void set_entity_context (in EntityContext ctx) - raises (CCMException); - - void unset_entity_context () - raises (CCMException); - - void ccm_activate () - raises (CCMException); - - void ccm_load () - raises (CCMException); - - void ccm_store () - raises (CCMException); - - void ccm_passivate () - raises (CCMException); - - void ccm_remove () - raises (CCMException); - }; -}; -#endif /* CCM_ENTITYCOMPONENT_IDL */ diff --git a/CIAO/ciao/CCM_EntityContext.idl b/CIAO/ciao/CCM_EntityContext.idl deleted file mode 100644 index ee02b728afb..00000000000 --- a/CIAO/ciao/CCM_EntityContext.idl +++ /dev/null @@ -1,35 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_ENTITYCONTEXT_IDL) -#define CCM_ENTITYCONTEXT_IDL - -#include "ciao/CCM_Context.idl" -#include "ciao/CCM_Object.idl" - -module Components -{ - typeprefix Components "omg.org"; - - local interface EntityContext : CCMContext - { - Object get_CCM_object () - raises (IllegalState); - - PrimaryKeyBase get_primary_key () - raises (IllegalState); - }; -}; -#endif /* CCM_ENTITYCONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_Enumeration.idl b/CIAO/ciao/CCM_Enumeration.idl deleted file mode 100644 index 55d64b68e07..00000000000 --- a/CIAO/ciao/CCM_Enumeration.idl +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_ENUMERATION_IDL) -#define CCM_ENUMERATION_IDL - -#include "ciao/CCM_Object.idl" - -module Components -{ - typeprefix Components "omg.org"; - - /// @@ Enumeration and DefaultEnumeration are only for EJB to CCM - /// mapping? At any rate, we should be able to skip them for now. - abstract valuetype Enumeration - { - boolean has_more_elements(); - CCMObject next_element(); - }; - - typedef sequence<CCMObject> CCMObjectSeq; - - valuetype DefaultEnumeration : Enumeration - { - private CCMObjectSeq objects; - }; -}; -#endif /* CCM_ENUMERATION_IDL */ diff --git a/CIAO/ciao/CCM_EventBase.idl b/CIAO/ciao/CCM_EventBase.idl deleted file mode 100644 index e97a474802a..00000000000 --- a/CIAO/ciao/CCM_EventBase.idl +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Event.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_EVENTBASE_IDL) -#define CCM_EVENTBASE_IDL - -module Components -{ - typeprefix Components "omg.org"; - - abstract valuetype EventBase {}; -}; -#endif /* CCM_EVENTBASE_IDL */ diff --git a/CIAO/ciao/CCM_EventConsumerBase.idl b/CIAO/ciao/CCM_EventConsumerBase.idl deleted file mode 100644 index 0e1facf5940..00000000000 --- a/CIAO/ciao/CCM_EventConsumerBase.idl +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Event.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_EVENTCONSUMERBASE_IDL) -#define CCM_EVENTCONSUMERBASE_IDL - -#include "ciao/CCM_EventBase.idl" -#include "tao/Typecode_types.pidl" -#include "tao/orb_types.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - exception BadEventType - { - CORBA::RepositoryId expected_event_type; - }; - - interface EventConsumerBase - { - void push_event (in EventBase evt) raises (BadEventType); - - // CIAO-specific operation to treat event service as regular event - // sink port. The source_id needs to be passed in to identify the - // source of the publisher port to support event filtering mechanism. - void ciao_push_event (in EventBase evt, - in string source_id, - in CORBA::TypeCode tc) - raises (BadEventType); - - // CIAO-specific operation to help support the capability - // to subscribe to eventtypes more derived than the type - // consumed. - boolean ciao_is_substitutable (in string event_repo_id); - }; -}; -#endif /* CCM_EVENTCONSUMERBASE_IDL */ diff --git a/CIAO/ciao/CCM_Events.idl b/CIAO/ciao/CCM_Events.idl deleted file mode 100644 index de0f894daf2..00000000000 --- a/CIAO/ciao/CCM_Events.idl +++ /dev/null @@ -1,97 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Event.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_EVENTS_IDL) -#define CCM_EVENTS_IDL - -#include "ciao/CCM_Base.idl" -#include "ciao/CCM_Navigation.idl" -#include "ciao/CCM_Receptacle.idl" -#include "ciao/CCM_Cookie.idl" -#include "ciao/CCM_EventBase.idl" -#include "ciao/CCM_EventConsumerBase.idl" - -module Components -{ - typeprefix Components "omg.org"; - - valuetype ConsumerDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<ConsumerDescription> ConsumerDescriptions; - - valuetype EmitterDescription : PortDescription - { - public EventConsumerBase consumer; - }; - typedef sequence<EmitterDescription> EmitterDescriptions; - - valuetype SubscriberDescription - { - public Cookie ck; - public EventConsumerBase consumer; - }; - typedef sequence<SubscriberDescription> SubscriberDescriptions; - - valuetype PublisherDescription : PortDescription - { - public SubscriberDescriptions consumer; - }; - typedef sequence<PublisherDescription> PublisherDescriptions; - - interface Events - { - EventConsumerBase get_consumer (in FeatureName sink_name) - raises (InvalidName); - - Cookie subscribe (in FeatureName publisher_name, - in EventConsumerBase subscriber) - raises (InvalidName, - InvalidConnection, - ExceededConnectionLimit); - - EventConsumerBase unsubscribe (in FeatureName publisher_name, - in Cookie ck) - raises (InvalidName, - InvalidConnection); - - void connect_consumer (in FeatureName emitter_name, - in EventConsumerBase consumer) - raises (InvalidName, - AlreadyConnected, - InvalidConnection); - - EventConsumerBase disconnect_consumer (in FeatureName source_name) - raises (InvalidName, - NoConnection); - - ConsumerDescriptions get_all_consumers (); - - ConsumerDescriptions get_named_consumers (in NameList names) - raises (InvalidName); - - EmitterDescriptions get_all_emitters (); - - EmitterDescriptions get_named_emitters (in NameList names) - raises (InvalidName); - - PublisherDescriptions get_all_publishers (); - - PublisherDescriptions get_named_publishers (in NameList names) - raises (InvalidName); - }; -}; -#endif /* CCM_EVENT_IDL */ diff --git a/CIAO/ciao/CCM_ExecutorLocator.idl b/CIAO/ciao/CCM_ExecutorLocator.idl deleted file mode 100644 index a764225af7c..00000000000 --- a/CIAO/ciao/CCM_ExecutorLocator.idl +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -#if !defined (CCM_EXECUTORLOCATOR_IDL) -#define CCM_EXECUTORLOCATOR_IDL - -#include "ciao/CCM_EnterpriseComponent.idl" -#include "ciao/CCM_CCMException.idl" -#include "ciao/CCM_Object.idl" - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - local interface ExecutorLocator : EnterpriseComponent - { - Object obtain_executor (in string name) - raises (CCMException); - - void release_executor (in Object exc) - raises (CCMException); - - void configuration_complete() - raises (InvalidConfiguration); - }; -}; -#endif /* CCM_EXECUTORLOCATOR_IDL */ diff --git a/CIAO/ciao/CCM_Home.idl b/CIAO/ciao/CCM_Home.idl deleted file mode 100644 index 6dfd2cc44a9..00000000000 --- a/CIAO/ciao/CCM_Home.idl +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_HOME_IDL) -#define CCM_HOME_IDL - -#include "tao/IFR_Client/IFR_Base.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - typedef unsigned long FailureReason; - - exception CreateFailure { - FailureReason reason; - }; - exception FinderFailure - { - FailureReason reason; - }; - exception RemoveFailure - { - FailureReason reason; - }; - - exception DuplicateKeyValue {}; - exception InvalidKey {}; - exception UnknownKeyValue {}; - - interface CCMObject; - - interface CCMHome - { - CORBA::IRObject get_component_def (); - CORBA::IRObject get_home_def (); - void remove_component (in CCMObject comp) - raises (RemoveFailure); - }; -}; - -#endif /* CCM_HOME_IDL */ diff --git a/CIAO/ciao/CCM_HomeConfiguration.idl b/CIAO/ciao/CCM_HomeConfiguration.idl deleted file mode 100644 index d3d488ae11b..00000000000 --- a/CIAO/ciao/CCM_HomeConfiguration.idl +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_HOMECONFIGURATION_IDL) -#define CCM_HOMECONFIGURATION_IDL - -#include "ciao/CCM_Configurator.idl" -#include "ciao/CCM_StandardConfigurator.idl" -#include "ciao/CCM_Home.idl" - -module Components -{ - typeprefix Components "omg.org"; - - interface HomeConfiguration : CCMHome - { - void set_configurator (in Configurator cfg); - void set_configuration_values (in ConfigValues config); - void complete_component_configuration (in boolean b); - void disable_home_configuration(); - }; -}; -#endif /* CCM_HOMECONFIGURATOR_IDL */ diff --git a/CIAO/ciao/CCM_HomeExecutorBase.idl b/CIAO/ciao/CCM_HomeExecutorBase.idl deleted file mode 100644 index e1db55b9afc..00000000000 --- a/CIAO/ciao/CCM_HomeExecutorBase.idl +++ /dev/null @@ -1,27 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_HOMEEXECUTORBASE_IDL) -#define CCM_HOMEEXECUTORBASE_IDL - -module Components -{ - typeprefix Components "omg.org"; - - local interface HomeExecutorBase - { - }; -}; -#endif /* CCM_HOMEEXECUTORBASE_IDL */ diff --git a/CIAO/ciao/CCM_HomeFinder.idl b/CIAO/ciao/CCM_HomeFinder.idl deleted file mode 100644 index f5ffca44442..00000000000 --- a/CIAO/ciao/CCM_HomeFinder.idl +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_HomeFinder.idl - */ - -#if !defined (CCM_HOMEFINDER_IDL) -#define CCM_HOMEFINDER_IDL - -#include "tao/orb_types.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - exception HomeNotFound {}; - - interface CCMHome; - - interface HomeFinder - { - CCMHome find_home_by_component_type (in CORBA::RepositoryId comp_repid) - raises (HomeNotFound); - - CCMHome find_home_by_home_type (in CORBA::RepositoryId home_repid) - raises (HomeNotFound); - - CCMHome find_home_by_name (in string home_name) - raises (HomeNotFound); - }; -}; -#endif /* CCM_HOMEFINDER_IDL */ diff --git a/CIAO/ciao/CCM_HomeRegistration.idl b/CIAO/ciao/CCM_HomeRegistration.idl deleted file mode 100644 index e7ee299e11c..00000000000 --- a/CIAO/ciao/CCM_HomeRegistration.idl +++ /dev/null @@ -1,34 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_HOMEREGISTRATION_IDL) -#define CCM_HOMEREGISTRATION_IDL - -#include "ciao/CCM_Home.idl" - -module Components -{ - typeprefix Components "omg.org"; - - local interface HomeRegistration - { - void register_home (in CCMHome home_ref, - in string home_name); - - void unregister_home (in CCMHome home_ref); - }; - -}; -#endif /* CCM_HOMEREGISTRATION_IDL */ diff --git a/CIAO/ciao/CCM_KeylessCCMHome.idl b/CIAO/ciao/CCM_KeylessCCMHome.idl deleted file mode 100644 index 747c45a5117..00000000000 --- a/CIAO/ciao/CCM_KeylessCCMHome.idl +++ /dev/null @@ -1,30 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_KEYLESSCCMHOME_IDL) -#define CCM_KEYLESSCCMHOME_IDL - -#include "ciao/CCM_Home.idl" - -module Components -{ - typeprefix Components "omg.org"; - - interface KeylessCCMHome - { - CCMObject create_component() - raises (CreateFailure); - }; - -}; -#endif /* CCM_KEYLESSCCMHOME_IDL */ diff --git a/CIAO/ciao/CCM_Navigation.idl b/CIAO/ciao/CCM_Navigation.idl deleted file mode 100644 index 53b74e2a10c..00000000000 --- a/CIAO/ciao/CCM_Navigation.idl +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I W:/ACE_wrappers/TAO Component_Base.idl - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Navigation.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_NAVIGATION_IDL) -#define CCM_NAVIGATION_IDL - -#include "tao/orb_types.pidl" -#include "tao/StringSeq.pidl" - -module Components -{ - typeprefix Components "omg.org"; - - typedef string FeatureName; - typedef sequence<FeatureName> NameList; - - valuetype PortDescription - { - public FeatureName name; - public CORBA::RepositoryId type_id; - }; - - valuetype FacetDescription : PortDescription - { - public Object facet_ref; - }; - - typedef sequence<FacetDescription> FacetDescriptions; - - exception InvalidName {}; - interface Navigation - { - Object provide_facet (in FeatureName name) - raises (InvalidName); - FacetDescriptions get_all_facets(); - FacetDescriptions get_named_facets (in NameList names) - raises (InvalidName); - boolean same_component (in Object object_ref); - }; -}; -#endif /* CCM_NAVIGATION_IDL */ diff --git a/CIAO/ciao/CCM_Object.idl b/CIAO/ciao/CCM_Object.idl deleted file mode 100644 index fc869afa97c..00000000000 --- a/CIAO/ciao/CCM_Object.idl +++ /dev/null @@ -1,106 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_OBJECT_IDL) -#define CCM_OBJECT_IDL - -#include "ciao/CCM_Events.idl" -#include "ciao/CCM_Navigation.idl" -#include "ciao/CCM_Home.idl" -#include "ciao/CCM_PrimaryKeyBase.idl" - -module Components -{ - typeprefix Components "omg.org"; - - /// This typedef and consts shouldn't be here but are here because of CIAO - /// specific additions - typedef FailureReason InvalidConfigurationReason; - const InvalidConfigurationReason UnknownConfigValueName = 0; - const InvalidConfigurationReason InvalidConfigValueType = 1; - const InvalidConfigurationReason ConfigValueRequired = 2; - const InvalidConfigurationReason ConfigValueNotExpected = 3; - - /// Shouldn't be here but is now here because of CIAO additions - exception InvalidConfiguration - { - InvalidConfigurationReason reason; - FeatureName name; - }; - - valuetype ComponentPortDescription - { - public FacetDescriptions facets; - public ReceptacleDescriptions receptacles; - public ConsumerDescriptions consumers; - public EmitterDescriptions emitters; - public PublisherDescriptions publishers; - }; - - /// CIAO specific forward declaration, shouldn't be here - interface StandardConfigurator; - - exception NoKeyAvailable {}; - - interface CCMObject : Navigation, Receptacles, Events - { - CORBA::IRObject get_component_def ( ); - CCMHome get_ccm_home( ); - PrimaryKeyBase get_primary_key( ) - raises (NoKeyAvailable); - void configuration_complete () - raises (InvalidConfiguration); - void remove() - raises (RemoveFailure); - ComponentPortDescription get_all_ports (); - - /// Factory method to return a StandardConfigurator interface. - /// CIAO specific - StandardConfigurator get_standard_configurator ( ); - - /// CIAO specific operations to have some control on when and how - /// to activate components. - /** - * This is all from our work on ARMS where we needed to know whether - * every component has been configured, say for example to use - * logging in the assembly which could in turn be provided by a - * component. To get around all this we are adding some methods on - * this till we think of some standard way to do this. The problem - * is that the deployer should be able to call this as opposed to - * the home calling it as soon as the component is created. - * - * All these operations are called in the order mentioned, ie. the - * deployer calls ciao_preactivate () on all components, then - * ciao_activate and then ciao_postactivate (). The speciality is - * that these operations would be invoked on every target object - * before the next call is made. It is similar to the way - * portable interceptors work, trying to get everything onto the - * flow stack, but differ in the intention. - */ - void ciao_preactivate () - raises (InvalidConfiguration); - - /// CIAO specific - void ciao_activate () - raises (InvalidConfiguration); - - /// CIAO specific - void ciao_postactivate () - raises (InvalidConfiguration); - - /// CIAO specific - void ciao_passivate () - raises (InvalidConfiguration); - }; -}; -#endif /* CCM_OBJECT_IDL */ diff --git a/CIAO/ciao/CCM_PrimaryKeyBase.idl b/CIAO/ciao/CCM_PrimaryKeyBase.idl deleted file mode 100644 index 4730208b2f9..00000000000 --- a/CIAO/ciao/CCM_PrimaryKeyBase.idl +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_PRIMARYKEYBASE_IDL) -#define CCM_PRIMARYKEYBASE_IDL - -module Components -{ - typeprefix Components "omg.org"; - - abstract valuetype PrimaryKeyBase {}; - -}; -#endif /* CCM_PRIMARYKEYBASE_IDL */ diff --git a/CIAO/ciao/CCM_ProxyHomeRegistration.idl b/CIAO/ciao/CCM_ProxyHomeRegistration.idl deleted file mode 100644 index 084b113a50d..00000000000 --- a/CIAO/ciao/CCM_ProxyHomeRegistration.idl +++ /dev/null @@ -1,36 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_PROXYHOMEREGISTRATION_IDL) -#define CCM_PROXYHOMEREGISTRATION_IDL - -#include "ciao/CCM_HomeRegistration.idl" - -module Components -{ - typeprefix Components "omg.org"; - - exception UnknownActualHome {}; - exception ProxyHomeNotSupported {}; - - local interface ProxyHomeRegistration : HomeRegistration - { - void register_proxy_home (in CCMHome rhome, - in CCMHome ahome) - raises (UnknownActualHome, - ProxyHomeNotSupported); - }; -}; -#endif /* CCM_PROXYHOMEREGISTRATION_IDL */ diff --git a/CIAO/ciao/CCM_Receptacle.idl b/CIAO/ciao/CCM_Receptacle.idl deleted file mode 100644 index 2ed7863b349..00000000000 --- a/CIAO/ciao/CCM_Receptacle.idl +++ /dev/null @@ -1,68 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -I W:/ACE_wrappers/TAO Component_Base.idl - * tao_idl -I ../.. \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Base.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_RECEPTACLE_IDL) -#define CCM_RECEPTACLE_IDL - -#include "ciao/CCM_Base.idl" -#include "ciao/CCM_Navigation.idl" -#include "ciao/CCM_Cookie.idl" - -module Components -{ - typeprefix Components "omg.org"; - - valuetype ConnectionDescription - { - public Cookie ck; - public Object objref; - }; - typedef sequence<ConnectionDescription> ConnectionDescriptions; - - valuetype ReceptacleDescription : PortDescription - { - public boolean is_multiple; - public ConnectionDescriptions connections; - }; - typedef sequence<ReceptacleDescription> ReceptacleDescriptions; - - exception ExceededConnectionLimit {}; - exception CookieRequired {}; - - interface Receptacles - { - Cookie connect (in FeatureName name, in Object connection ) - raises (InvalidName, - InvalidConnection, - AlreadyConnected, - ExceededConnectionLimit); - - Object disconnect (in FeatureName name, in Cookie ck) - raises (InvalidName, - InvalidConnection, - CookieRequired, - NoConnection); - - ConnectionDescriptions get_connections (in FeatureName name) - raises (InvalidName); - - ReceptacleDescriptions get_all_receptacles (); - - ReceptacleDescriptions get_named_receptacles (in NameList names) - raises (InvalidName); - }; -}; -#endif /* CCM_RECEPTACLE_IDL */ diff --git a/CIAO/ciao/CCM_Session2Context.idl b/CIAO/ciao/CCM_Session2Context.idl deleted file mode 100644 index 8fec0e9441c..00000000000 --- a/CIAO/ciao/CCM_Session2Context.idl +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_SESSION2CONTEXT_IDL) -#define CCM_SESSION2CONTEXT_IDL - -#include "ciao/CCM_CCM2Context.idl" - -// *************** Extended Container Interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - enum BadComponentReferenceReason - { - NON_LOCAL_REFERENCE, - NON_COMPONENT_REFERENCE, - WRONG_CONTAINER - }; - exception BadComponentReference - { - BadComponentReferenceReason reason; - }; - - local interface Session2Context : SessionContext, CCM2Context - { - Object create_ref (in CORBA::RepositoryId repid); - - Object create_ref_from_oid (in CORBA::OctetSeq oid, - in CORBA::RepositoryId repid); - - CORBA::OctetSeq get_oid_from_ref (in Object objref) - raises (IllegalState, - BadComponentReference); - }; -}; -#endif /* CCM_SESSION2CONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_SessionComponent.idl b/CIAO/ciao/CCM_SessionComponent.idl deleted file mode 100644 index c4d72fffa05..00000000000 --- a/CIAO/ciao/CCM_SessionComponent.idl +++ /dev/null @@ -1,62 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_SESSIONCOMPONENT_IDL) -#define CCM_SESSIONCOMPONENT_IDL - -#include "ciao/CCM_SessionContext.idl" -#include "ciao/CCM_CCMException.idl" -#include "ciao/CCM_EnterpriseComponent.idl" - -// *************** Basic Container interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - local interface SessionComponent : EnterpriseComponent - { - void set_session_context ( in SessionContext ctx) - raises (CCMException); - - void ccm_activate() - raises (CCMException); - - void ccm_passivate() - raises (CCMException); - - void ccm_remove () - raises (CCMException); - - /** - * This method is invoked before ccm_activate () is called. All - * components in the assembly get this callback before the - * ccm_activate () is called. - * @note CIAO specific - */ - void ciao_preactivate () - raises (CCMException); - - /** - * This method is invoked after ccm_activate () is called. All - * components in the assembly get this callback after the - * ccm_activate () is called. - * @note CIAO specific - */ - void ciao_postactivate () - raises (CCMException); - }; -}; -#endif /* CCM_SESSIONCOMPONENT_IDL */ diff --git a/CIAO/ciao/CCM_SessionContext.idl b/CIAO/ciao/CCM_SessionContext.idl deleted file mode 100644 index 24820fb5cce..00000000000 --- a/CIAO/ciao/CCM_SessionContext.idl +++ /dev/null @@ -1,31 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_SESSIONCONTEXT_IDL) -#define CCM_SESSIONCONTEXT_IDL - -#include "ciao/CCM_Context.idl" - -module Components -{ - typeprefix Components "omg.org"; - - local interface SessionContext : CCMContext - { - Object get_CCM_object() - raises (IllegalState); - }; -}; -#endif /* CCM_SESSIONCONTEXT_IDL */ diff --git a/CIAO/ciao/CCM_SessionSynchronization.idl b/CIAO/ciao/CCM_SessionSynchronization.idl deleted file mode 100644 index 27614d3e14e..00000000000 --- a/CIAO/ciao/CCM_SessionSynchronization.idl +++ /dev/null @@ -1,39 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_SESSIONSYNCHRONIZATION_IDL) -#define CCM_SESSIONSYNCHRONIZATION_IDL - -#include "ciao/CCM_CCMException.idl" - -// *************** Basic Container interfaces *************** - -module Components -{ - typeprefix Components "omg.org"; - - local interface SessionSynchronization - { - void after_begin () - raises (CCMException); - - void before_completion () - raises (CCMException); - - void after_completion (in boolean committed) - raises (CCMException); - }; -}; -#endif /* CCM_SESSIONSYNCHRONIZATION_IDL */ diff --git a/CIAO/ciao/CCM_StandardConfigurator.idl b/CIAO/ciao/CCM_StandardConfigurator.idl deleted file mode 100644 index e883c72ad64..00000000000 --- a/CIAO/ciao/CCM_StandardConfigurator.idl +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Component.idl - */ - -#if !defined (CCM_STANDARDCONFIGURATOR_IDL) -#define CCM_STANDARDCONFIGURATOR_IDL - -#include "ciao/CCM_Configurator.idl" -#include "ciao/CCM_Navigation.idl" - -module Components -{ - typeprefix Components "omg.org"; - - valuetype ConfigValue - { - public FeatureName name; - public any value; - }; - - typedef sequence<ConfigValue> ConfigValues; - - interface StandardConfigurator : Configurator - { - void set_configuration (in ConfigValues descr); - }; - -}; -#endif /* CCM_STANDARDCONFIGURATOR_IDL */ diff --git a/CIAO/ciao/CCM_StateIdFactory.idl b/CIAO/ciao/CCM_StateIdFactory.idl deleted file mode 100644 index de6b3b51b13..00000000000 --- a/CIAO/ciao/CCM_StateIdFactory.idl +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Container_Ex.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_STATEIDFACTORY) -#define CCM_STATEIDFACTORY - -#include <CosPersistentState.idl> - -module Components -{ - typeprefix Components "omg.org"; - - typedef short SegmentId; - const SegmentId COMPONENT_SEGMENT = 0; - - typedef short FacetId; - const FacetId COMPONENT_FACET = 0; - - typedef sequence<octet> IdData; - typedef CosPersistentState::Pid PersistentId; - - exception InvalidStateIdData {}; - - typedef short StateIdType; - const StateIdType PERSISTENT_ID = 0; - - abstract valuetype StateIdValue - { - StateIdType get_sid_type(); - IdData get_sid_data(); - }; - - local interface StateIdFactory - { - StateIdValue create (in IdData data) - raises (InvalidStateIdData); - }; - - valuetype PersistentIdValue : StateIdValue - { - private PersistentId pid; - PersistentId get_pid(); - factory init (in PersistentId pid); - }; - - valuetype SegmentDescr - { - private StateIdValue sid; - private SegmentId seg; - - StateIdValue get_sid(); - SegmentId get_seg_id(); - factory init (in StateIdValue sid, - in SegmentId seg); - }; - - typedef sequence<SegmentDescr> SegmentDescrSeq; - -}; -#endif /* CCM_STATEIDFACTORY */ diff --git a/CIAO/ciao/CCM_Transaction.idl b/CIAO/ciao/CCM_Transaction.idl deleted file mode 100644 index c0c8cdc2c1d..00000000000 --- a/CIAO/ciao/CCM_Transaction.idl +++ /dev/null @@ -1,89 +0,0 @@ -// $Id$ - -/** - * @@ Compile this file with: - * - * tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \ - * -Wb,export_macro=CIAO_Export \ - * -Wb,export_include=CIAO_export.h \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * CCM_Transaction.idl - */ - -//#define CIAO_HAS_IMPORT_KEYWORD - -#if !defined (CCM_TRANSACTION_IDL) -#define CCM_TRANSACTION_IDL - -module Components -{ - typeprefix Components "omg.org"; - - // @@ Components::Transaction is still there. - module Transaction - { - - typedef sequence<octet> TranToken; - - exception NoTransaction {}; - exception NotSupported {}; - exception SystemError {}; - exception RollbackError {}; - exception HeuristicMixed {}; - exception HeuristicRollback {}; - exception Security {}; - exception InvalidToken {}; - - enum Status - { - ACTIVE, - MARKED_ROLLBACK, - PREPARED, - COMMITTED, - ROLLED_BACK, - NO_TRANSACTION, - PREPARING, - COMMITTING, - ROLLING_BACK - }; - - local interface UserTransaction { - void begin () - raises (NotSupported, - SystemError); - - void commit () - raises (RollbackError, - NoTransaction, - HeuristicMixed, - HeuristicRollback, - Security, - SystemError); - - void rollback () - raises (NoTransaction, - Security, - SystemError); - - void set_rollback_only () - raises (NoTransaction, - SystemError); - - Status get_status() - raises (SystemError); - - void set_timeout (in long to) - raises (SystemError); - - TranToken suspend () - raises (NoTransaction, - SystemError); - - void resume (in TranToken txtoken) - raises (InvalidToken, - SystemError); - }; - }; -}; -#endif /* CCM_TRANSACTION_IDL */ diff --git a/CIAO/ciao/CIAO.mpc b/CIAO/ciao/CIAO.mpc new file mode 100644 index 00000000000..a9e25a92fb0 --- /dev/null +++ b/CIAO/ciao/CIAO.mpc @@ -0,0 +1,36 @@ +project(CIAO_Exception_IDL) : taoidldefaults { + custom_only = 1 + IDL_Files { + idlflags += -Sci -SS + CIAO_FailureReasons.idl + } +} + +project(CIAO_Client) : ccm_stub, ciao_lib, ccm_cookie, ccm_configvalue { + dynamicflags = CIAO_CLIENT_BUILD_DLL + after += CIAO_Exception_IDL + Source_Files { + Client_init.cpp + } + Header_Files { + Client_init.h + CIAO_Client_Export.h + } + IDL_Files { + } +} + +project(CIAO_Server) : ccm_stub, naming, ciao_client, ciao_lib, ccm_cookie { + dynamicflags = CIAO_SERVER_BUILD_DLL + + Source_Files { + Server_init.cpp + } + Header_Files { + CIAO_Server_Export.h + Server_init.h + } + IDL_Files { + } +} + diff --git a/CIAO/ciao/CIAO_FailureReasons.idl b/CIAO/ciao/CIAO_FailureReasons.idl new file mode 100644 index 00000000000..9a1edc5834f --- /dev/null +++ b/CIAO/ciao/CIAO_FailureReasons.idl @@ -0,0 +1,27 @@ +/** + * @file CIAO_FailureReasons.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * Failure code definitions for CIAO. The VID is based on that of TAO, but + * our failure reasons start at that base since this is a different namespace. + */ + +#ifndef CIAO_FAILUREREASONS_IDL +#define CIAO_FAILUREREASONS_IDL + +#include <ccm/CCM_Exceptions.idl> + +module CIAO +{ + const Components::FailureReason VID = 0x54410000; + const Components::FailureReason MAX_FAILURE = VID | 0xfff; + + // Container failures + + const Components::FailureReason SERVER_SPAWN_FAILURE = VID | 0x001; + const Components::FailureReason CALLBACK_TIMEOUT_EXCEEDED = VID | 0x002; + +}; + +#endif + diff --git a/CIAO/ciao/CIAO_SwapExec.idl b/CIAO/ciao/CIAO_SwapExec.idl deleted file mode 100644 index 2349988f46d..00000000000 --- a/CIAO/ciao/CIAO_SwapExec.idl +++ /dev/null @@ -1,12 +0,0 @@ -// $Id$ - -#include "ciao/CCM_EnterpriseComponent.idl" - -module CIAO -{ - local interface Swap_Exec : ::Components::EnterpriseComponent - { - Components::EnterpriseComponent incarnate (); - Components::EnterpriseComponent etherealize (); - }; -}; diff --git a/CIAO/ciao/CIAO_UpgradeableContext.idl b/CIAO/ciao/CIAO_UpgradeableContext.idl deleted file mode 100644 index 6d4b315ae85..00000000000 --- a/CIAO/ciao/CIAO_UpgradeableContext.idl +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ - -#include "ciao/CCM_Container.idl" -#include "tao/PortableServer/PortableServer_include.pidl" - -module CIAO -{ - local interface UpgradeableContext : ::Components::SessionContext - { - ::Components::ConsumerDescriptions get_registered_consumers - (in ::Components::FeatureName publisher_name) - raises (::Components::InvalidName, ::Components::InvalidConnection); - void deactivate_facet (in PortableServer::ObjectId oid); - void update_port_activator (in PortableServer::ObjectId oid); - void remove_facet (in Object reference); - }; -}; diff --git a/CIAO/ciao/CIAO_common.h b/CIAO/ciao/CIAO_common.h index fce3091aa88..ea678e6720e 100644 --- a/CIAO/ciao/CIAO_common.h +++ b/CIAO/ciao/CIAO_common.h @@ -30,52 +30,7 @@ if (prev_factory) prev_factory->_remove_ref (); \ factory->_remove_ref (); } -// By default tracing is turned off. -#if !defined (CIAO_NTRACE) -# if !defined (ACE_NTRACE) -# define CIAO_NTRACE 1 -# else -# define CIAO_NTRACE ACE_NTRACE -# endif -#endif /* CIAO_NTRACE */ - -#if (CIAO_NTRACE == 1) -# if !defined (ACE_NTRACE) -# define CIAO_TRACE(X) -# else -# if (ACE_NTRACE == 0) -# error CIAO_TRACE cannot be disabled if ACE_TRACE is enabled -# else -# define CIAO_TRACE(X) -# endif -# endif -#else -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* CIAO_NTRACE */ - -namespace CIAO -{ - /** - * Return the debug level. The debug level of CIAO is control by - * an environment variable "CIAO_DEBUG_LEVEL". It should be an int - * value. If it is not defined, the default debug level is 0. The - * value of debug value is evaluated on its first use and the value - * is then cached. The actual implementation of this function is in - * Client_init.cpp. - * - * Some recommendation for using the debug_level - * - * > 0 : For component users. Component developers are encouraged - * to develop their own - * > 10 : For CIAO tools - * > 20 : For CIAO core. - */ - CIAO_CLIENT_Export int debug_level (void); -} +#include "ciao/Logger/Log_Macros.h" #include /**/ "ace/post.h" diff --git a/CIAO/ciao/Client_init.cpp b/CIAO/ciao/Client_init.cpp index 38903c5538e..4ac6e9d53da 100644 --- a/CIAO/ciao/Client_init.cpp +++ b/CIAO/ciao/Client_init.cpp @@ -1,11 +1,10 @@ // $Id$ #include "Client_init.h" -#include "CCM_ComponentC.h" -#include "CCM_StandardConfiguratorC.h" +#include <ccm/CCM_ComponentC.h> +#include <ccm/CCM_StandardConfiguratorC.h> #include "CIAO_common.h" - -#include "ace/Env_Value_T.h" +#include "Valuetype_Factories/ConfigValue.h" int CIAO::Client_init (CORBA::ORB_ptr o) @@ -35,23 +34,72 @@ CIAO::Client_init (CORBA::ORB_ptr o) return 0; } -/// This should really be an anonymous namespace, but some compilers -/// still don't support this features. Therefore, just use a long -/// namespace name here. -namespace ciao_anonymous_namespace +namespace CIAO { - int debug_level = -1; -} + namespace Utility + { + void build_config_values_map (CONFIGVALUE_MAP &map, + const ::Components::ConfigValues &config) + { + CIAO_TRACE("CIAO::build_config_values_map"); + map.unbind_all (); -int -CIAO::debug_level (void) -{ - if (ciao_anonymous_namespace::debug_level == -1) + for (CORBA::ULong i = 0; i < config.length (); ++i) + { + int retval = map.rebind (config[i]->name (), config[i]->value ()); + + if (retval == 1) + { + CIAO_ERROR ((LM_WARNING, CLINFO "build_config_values_map: Duplicate value for %C encountered, " + "old value overwritten.\n", + config[i]->name ())); + } + else if (retval == -1) + { + CIAO_ERROR ((LM_WARNING, CLINFO "build_config_values_map: Error binding value for %C, ignoring.\n", + config[i]->name ())); + } + CIAO_DEBUG ((LM_TRACE, CLINFO + "build_config_values_map: Bound value for config value %C\n", + config[i]->name ())); + } + } + + void build_config_values_sequence (::Components::ConfigValues &config, + const CONFIGVALUE_MAP &map) { - // Initialize the thing. - ACE_Env_Value<int> envar (ACE_TEXT ("CIAO_DEBUG_LEVEL"), 1); - ciao_anonymous_namespace::debug_level = envar; + CIAO_TRACE ("CIAO::build_config_values_sequence"); + + config.length (map.current_size ()); + + CORBA::ULong pos = 0; + + for (CONFIGVALUE_MAP::const_iterator i = map.begin (); + (i.advance ()) != 0; ++pos) + { + Components::ConfigValue_var newval; + ACE_NEW_THROW_EX (newval, + ConfigValue_impl (i->ext_id_.c_str (), i->int_id_), + CORBA::NO_MEMORY ()); + config[pos] = newval._retn (); + } } - return ciao_anonymous_namespace::debug_level; + /* + void print_config_values (const ::Components::ConfigValues &config, + ACE_Log_Priority prio, + const char * prefix) + { + if (config.length () > 0) + for (CORBA::ULong i = 0; i < config.length (); ++i) + { + ACE_CString + CIAO_DEBUG ((prio, pfx + + + + } + */ + + } } + diff --git a/CIAO/ciao/Client_init.h b/CIAO/ciao/Client_init.h index 953372fa86d..d62ad6a0757 100644 --- a/CIAO/ciao/Client_init.h +++ b/CIAO/ciao/Client_init.h @@ -21,7 +21,10 @@ #pragma once #endif /* ! ACE_LACKS_PRAGMA_ONCE */ +#include "ace/Hash_Map_Manager_T.h" #include "tao/orbconf.h" +#include "tao/AnyTypeCode/Any.h" +#include "ccm/CCM_StandardConfiguratorC.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace CORBA @@ -41,6 +44,25 @@ namespace CIAO * to register these stuff automatically. */ CIAO_CLIENT_Export int Client_init (CORBA::ORB_ptr o); + + namespace Utility + { + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + CORBA::Any, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> CONFIGVALUE_MAP; + + void CIAO_CLIENT_Export build_config_values_map (CONFIGVALUE_MAP &map, + const ::Components::ConfigValues &config); + + void CIAO_CLIENT_Export build_config_values_sequence (::Components::ConfigValues &config, + const CONFIGVALUE_MAP &map); + + /*void CIAO_SERVER_Export print_config_values (const ::Components::ConfigValues &config, + ACE_Log_Priority prio, + const char * prefix);*/ + } } #include /**/ "ace/post.h" diff --git a/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl b/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl new file mode 100644 index 00000000000..e6ad7577de4 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_CS_Client.idl @@ -0,0 +1,35 @@ +/** + * @file CIAO_CS_Client.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * A couple CIAO-specific extensions to the component server client + * interfaces. + */ + +#ifndef CIAO_COMPONENTSERVER_IDL_ +#define CIAO_COMPONENTSERVER_IDL_ + +#include <ccm/ComponentServer/CCM_ComponentServer_Client.idl> + +module CIAO +{ + module Deployment + { + interface ServerActivator : ::Components::Deployment::ServerActivator + { + /// Used by spawned component servers to notify the server + /// activator of their object reference and retrieve + /// configuration information. + void component_server_callback (in ::Components::Deployment::ComponentServer serverref, + in string server_UUID, + out ::Components::ConfigValues config); + + void configuration_complete (in string server_UUID); + }; + }; +}; + + +#endif + + diff --git a/CIAO/ciao/ComponentServer/CIAO_CS_Client_svnt_export.h b/CIAO/ciao/ComponentServer/CIAO_CS_Client_svnt_export.h new file mode 100644 index 00000000000..32a2ea33fd5 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_CS_Client_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_CS_Client_svnt +// ------------------------------ +#ifndef CIAO_CS_CLIENT_SVNT_EXPORT_H +#define CIAO_CS_CLIENT_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_CS_CLIENT_SVNT_HAS_DLL) +# define CIAO_CS_CLIENT_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_CS_CLIENT_SVNT_HAS_DLL */ + +#if !defined (CIAO_CS_CLIENT_SVNT_HAS_DLL) +# define CIAO_CS_CLIENT_SVNT_HAS_DLL 1 +#endif /* ! CIAO_CS_CLIENT_SVNT_HAS_DLL */ + +#if defined (CIAO_CS_CLIENT_SVNT_HAS_DLL) && (CIAO_CS_CLIENT_SVNT_HAS_DLL == 1) +# if defined (CIAO_CS_CLIENT_SVNT_BUILD_DLL) +# define CIAO_CS_Client_svnt_Export ACE_Proper_Export_Flag +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_CS_CLIENT_SVNT_BUILD_DLL */ +# define CIAO_CS_Client_svnt_Export ACE_Proper_Import_Flag +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_CS_CLIENT_SVNT_BUILD_DLL */ +#else /* CIAO_CS_CLIENT_SVNT_HAS_DLL == 1 */ +# define CIAO_CS_Client_svnt_Export +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARATION(T) +# define CIAO_CS_CLIENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_CS_CLIENT_SVNT_HAS_DLL == 1 */ + +// Set CIAO_CS_CLIENT_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_CS_CLIENT_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_CS_CLIENT_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_CS_CLIENT_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_CS_CLIENT_SVNT_NTRACE */ + +#if (CIAO_CS_CLIENT_SVNT_NTRACE == 1) +# define CIAO_CS_CLIENT_SVNT_TRACE(X) +#else /* (CIAO_CS_CLIENT_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_CS_CLIENT_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_CS_CLIENT_SVNT_NTRACE == 1) */ + +#endif /* CIAO_CS_CLIENT_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp new file mode 100644 index 00000000000..2ae39ff1827 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.cpp @@ -0,0 +1,473 @@ +/** + * @file CIAO_ComponentServer.cpp + * @author William R. Otte + * + * Implementation and main for CIAO_ComponentServer. + */ + +#include "CIAO_ComponentServer.h" + +#include "ace/OS_NS_string.h" +#include "ace/Log_Msg.h" +#include "ace/Get_Opt.h" +#include "ace/Sched_Params.h" +#include "ace/Trace.h" +#include "ace/Env_Value_T.h" +#include "tao/ORB.h" +#include "tao/Object.h" +#include "tao/CORBA_methods.h" +#include "tao/PortableServer/PortableServer.h" +#include "tao/ORB_Core.h" +#include "ciao/CIAO_common.h" +#include "ciao/Logger/Logger_Service.h" +#include "ciao/Logger/Log_Macros.h" +#include "ciao/Server_init.h" + + +#include "CIAO_ComponentServer_Impl.h" +#include "CIAO_CS_ClientC.h" +#include "Configurator_Factory.h" +#include "Configurators/Server_Configurator.h" + +#ifdef CIAO_BUILD_COMPONENTSERVER_EXE + +int ACE_TMAIN (int argc, ACE_TCHAR **argv) +{ + // Tracing disabled by default + CIAO_DISABLE_TRACE (); + + CIAO_TRACE ("CIAO_ComponentServer::ACE_TMAIN"); + + try + { + CIAO::Deployment::ComponentServer_Task cs (argc, argv); + cs.run (); + return 0; + } + catch (CIAO::Deployment::ComponentServer_Task::Error &e) + { + CIAO_DEBUG ((LM_ALERT, CLINFO "CIAO_ComponentServer main: Caught ComponentServer exception: %C\n", + e.err_.c_str ())); + } + catch (...) + { + CIAO_DEBUG ((LM_ALERT, CLINFO "CIAO_ComponentServer main: Caught unknown exception.\n")); + } + + return -1; +} + +#endif /* CIAO_BUILD_COMPONENTSERVER_EXE */ + +bool +write_IOR (const ACE_TCHAR * ior_file_name, const char* ior) +{ + FILE* ior_output_file_ = + ACE_OS::fopen (ior_file_name, "w"); + + if (ior_output_file_) + { + ACE_OS::fprintf (ior_output_file_, + "%s", + ior); + ACE_OS::fclose (ior_output_file_); + return true; + } + return false; +} + +namespace CIAO +{ + namespace Deployment + { + ComponentServer_Task::ComponentServer_Task (int argc, ACE_TCHAR **argv) + : orb_ (0), + uuid_ (""), + callback_ior_str_ ("") + { + CIAO_TRACE ("CIAO_ComponentServer_Task::CIAO_ComponentServer_Task ()"); + + Logger_Service + *clf = ACE_Dynamic_Service<Logger_Service>::instance ("CIAO_Logger_Backend_Factory"); + + if (!clf) + clf = new Logger_Service; + + this->logger_.reset (clf); + + this->logger_->init (argc, argv); + + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_Task::CIAO_ComponentServer_Task - " + "Creating server object\n")); + Configurator_Factory cf; + this->configurator_.reset (cf (argc, argv)); + + if (!this->configurator_->create_config_managers ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "ComponentServer_Task::ComponentServer_Task - " + "Error configuring ComponentServer configurator, exiting.\n")); + throw Error ("Unable to load ComponentServer configurator."); + } + + + this->configurator_->pre_orb_initialize (); + + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_Task::CIAO_ComponentServer_Task - " + "Creating ORB\n")); + this->orb_ = CORBA::ORB_init (argc, argv); + + this->configurator_->post_orb_initialize (this->orb_.in ()); + + this->parse_args (argc, argv); + this->configure_logging_backend (); + + CIAO::Server_init (this->orb_.in ()); + + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_Task::CIAO_ComponentServer_Task - " + "CIAO_ComponentServer object created.\n")); + } + + int + ComponentServer_Task::svc (void) + { + CIAO_TRACE ("ComponentServer_Task::svc"); + + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Activating the root POA\n")); + CORBA::Object_var object = + this->orb_->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (object.in ()); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + poa_manager->activate (); + + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Creating server implementation object\n")); + CIAO::Deployment::CIAO_ComponentServer_i *ci_srv = 0; + ACE_NEW_NORETURN (ci_srv, CIAO_ComponentServer_i (this->uuid_, this->orb_.in (), root_poa.in ())); + + if (ci_srv == 0) + { + CIAO_ERROR ((LM_CRITICAL, "ComponentServer_Task::run - " + "Out of memory error while allocating servant.")); + throw Error ("Out of memory whilst allocating servant."); + } + + PortableServer::ServantBase_var safe (ci_srv); + + ComponentServer_var cs (ci_srv->_this ()); + + if (this->output_file_ != ACE_TEXT("")) + { + CORBA::String_var ior = this->orb_->object_to_string (cs.in ()); + write_IOR (this->output_file_.c_str (), ior.in ()); + } + + + if (this->callback_ior_str_ != "") + { + CIAO_DEBUG ((LM_TRACE, CLINFO " resolving callback IOR\n")); + CORBA::Object_ptr obj = this->orb_->string_to_object (this->callback_ior_str_.c_str ()); + ServerActivator_var sa (ServerActivator::_narrow (obj)); + + if (CORBA::is_nil (sa.in ())) + { + CIAO_DEBUG ((LM_ERROR, CLINFO "ComponentServer_Task::svc - " + "Failed to narrow callback IOR\n")); + throw Error ("Faled to narrow callback IOR"); + } + + Components::ConfigValues_var config; + { + Components::ConfigValues *cf = 0; + ACE_NEW_NORETURN (cf, Components::ConfigValues (0)); + + if (cf == 0) + { + CIAO_ERROR ((LM_CRITICAL, "ComponentServer_Task::run - " + "Out of memory error while allocating config values.")); + } + else + { + config = cf; + } + } + + // Make callback. + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Making callback on my ServerActivator\n")); + + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Calling back to ServerActivator\n")); + + try + { + // Callback to NodeApplication to get configuration + sa->component_server_callback (cs.in (), + this->uuid_.c_str (), + config.out ()); + + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Configuration received\n")); + // @@WO: Probably need to do something with these config values. + + ci_srv->init (sa.in (), config._retn ()); + + CIAO_DEBUG ((LM_NOTICE, CLINFO "ComponentServer_Task::svc - " + "Configuration complete for component server %C\n", + this->uuid_.c_str ())); + + sa->configuration_complete (this->uuid_.c_str ()); + } + catch (const CORBA::BAD_PARAM &) + { + CIAO_ERROR ((LM_ERROR, CLINFO "ComponentServer_Task::svc - " + "The Callback IOR provided pointed to the wrong ServerActivator\n")); + throw Error ("Bad callback IOR"); + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO "ComponentServer_Task::svc - " + "Caught exception while calling back\n")); + throw Error ("Caught exception while calling back"); + } + + } + else + { + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "Initializing ComponentServer without ServantActivator callback\n")); + ci_srv->init (0, 0); + } + + this->orb_->run (); + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::svc - " + "ORB Event loop completed.\n")); + + root_poa->destroy (1, 1); + + this->orb_->destroy (); + + return 0; + } + + void + ComponentServer_Task::run (void) + { + CIAO_TRACE ("ComponentServer_Task::run"); + + if (this->configurator_->rt_support ()) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::run - Starting ORB with RT support\n")); + + this->check_supported_priorities (); + + // spawn a thread + // Task activation flags. + long flags = + THR_NEW_LWP | + THR_JOINABLE | + this->orb_->orb_core ()->orb_params ()->thread_creation_flags (); + + // Activate task. + int result = this->activate (flags); + if (result == -1) + { + if (errno == EPERM) + { + CIAO_ERROR ((LM_EMERGENCY, CLINFO + "ComponentServer_Task::run - Cannot create thread with scheduling policy %C\n" + "because the user does not have the appropriate privileges, terminating program. " + "Check svc.conf options and/or run as root\n", + sched_policy_name (this->orb_->orb_core ()->orb_params ()->ace_sched_policy ()))); + throw Error ("Unable to start RT support due to permissions problem."); + } + else + throw Error ("Unknown error while spawning ORB thread."); + } + + // Wait for task to exit. + result = this->wait (); + + if (result != -1) + throw Error ("Unknown error waiting for ORB thread to complete"); + + CIAO_DEBUG ((LM_INFO, CLINFO "ComponentServer_Task::run - ORB thread completed, terminating ComponentServer %C\n", + this->uuid_.c_str ())); + } + else + { + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::run - Starting ORB without RT support\n")); + this->svc (); + CIAO_DEBUG ((LM_INFO, CLINFO "ComponentServer_Task::run - ORB has shutdown, terminating ComponentServer \n")); + } + } + + void + ComponentServer_Task::parse_args (int argc, ACE_TCHAR **argv) + { + CIAO_TRACE ("ComponentServer_Task::parse_args"); + + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::parse_args - parsing arguments...\n")); + + ACE_Get_Opt opts (argc, argv, ACE_TEXT("hu:c:"), 1, 0, + ACE_Get_Opt::RETURN_IN_ORDER); + opts.long_option (ACE_TEXT("uuid"), 'u', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option (ACE_TEXT("callback-ior"), 'c', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option (ACE_TEXT("help"), 'h'); + opts.long_option (ACE_TEXT("log-level"),'l', ACE_Get_Opt::ARG_REQUIRED); + opts.long_option (ACE_TEXT("trace"),'t', ACE_Get_Opt::NO_ARG); + opts.long_option (ACE_TEXT("output-ior"),'o', ACE_Get_Opt::ARG_REQUIRED); + + //int j; + char c; + ACE_CString s; + + while ((c = opts ()) != -1) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::parse_args - " + "Found option: \"%s\" with argument \"%s\"\n", + opts.last_option (), opts.opt_arg ())); + + switch (c) + { + case 'u': + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " + "uuid is %s\n", + opts.opt_arg ())); + this->uuid_ = opts.opt_arg (); + break; + + case 'c': + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " + "callback ior is %s\n", + opts.opt_arg ())); + this->callback_ior_str_ = opts.opt_arg (); + break; + + case 'l': + { + continue; // no-op, already taken care of + } + + case 't': + continue; // already taken care of + + case 'o': + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::parse_args - " + "IOR Output file: %s\n", + opts.opt_arg ())); + this->output_file_ = opts.opt_arg (); + break; + + case 'h': + this->usage (); + throw Error ("Command line help requested, bailing out...."); + + default: + CIAO_ERROR ((LM_ERROR, CLINFO " Unknown option: %s\n", + opts.last_option ())); + this->usage (); + ACE_TString err (ACE_TEXT("Unknown option ")); + err += opts.last_option (); + throw Error (err); + } + } + + // check required options. + if (this->uuid_ == "") + throw Error ("Option required: -u|--uuid"); + if (this->callback_ior_str_ == "") + CIAO_ERROR ((LM_WARNING, CLINFO + "ComponentServer_Task::parse_args - Starting ComponentServer without a callback IOR\n")); + } + + void + ComponentServer_Task::usage (void) + { + CIAO_TRACE ("ComponentServer_Task::usage"); + // Shouldn't be subject to CIAO's logging policy + ACE_ERROR ((LM_EMERGENCY, "Usage: CIAO_ComponentServer <options>\n" + "Options: \n" + "\t-h|--help\t\t\t\tShow help\n" + "\t-l|--log-level <level>\t\t\tSets log level (default 5). 1 - most detailed.\n" + "\t-u|--uuid <uuid> \t\t\tSets UUID of spawned component server (required)\n" + "\t-c|--callback-ior <string ior>\t\tSets callback url for the spawning ServerActivator.\n" + "\t-o|--output-ior <filename>\t\tOutputs the IOR of the component server object to file\n" + )); + + } + + const char * + ComponentServer_Task::sched_policy_name (int sched_policy) + { + const char *name = 0; + + switch (sched_policy) + { + case ACE_SCHED_OTHER: + name = "SCHED_OTHER"; + break; + case ACE_SCHED_RR: + name = "SCHED_RR"; + break; + case ACE_SCHED_FIFO: + name = "SCHED_FIFO"; + break; + } + + return name; + } + + /// The following check is taken from $(TAO_ROOT)/tests/RTCORBA/ + void + ComponentServer_Task::check_supported_priorities (void) + { + CIAO_TRACE ("ComponentServer_Task::check_supported_priorities"); + + int const sched_policy = + this->orb_->orb_core ()->orb_params ()->ace_sched_policy (); + + // Check that we have sufficient priority range to run, + // i.e., more than 1 priority level. + int const max_priority = ACE_Sched_Params::priority_max (sched_policy); + int const min_priority = ACE_Sched_Params::priority_min (sched_policy); + + if (max_priority == min_priority) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO "ComponentServer_Task::check_supported_priorities - " + " Not enough priority levels with the %C scheduling policy\n" + "on this platform to run, terminating ....\n" + "Check svc.conf options\n", + sched_policy_name (sched_policy))); + + throw Error ("Bad scheduling policy."); + } + } + + void + ComponentServer_Task::configure_logging_backend (void) + { + Logger_Service + *clf = ACE_Dynamic_Service<Logger_Service>::instance ("CIAO_Logger_Backend_Factory"); + if (clf) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Task::configure_logging_backend - " + "Replacing logger backend\n")); + ACE_Log_Msg_Backend * backend = clf->get_logger_backend(this->orb_); + backend->open(0); + ACE_Log_Msg::msg_backend (backend); + ACE_Log_Msg * ace = ACE_Log_Msg::instance(); + ace->clr_flags(ace->flags()); + ace->set_flags(ACE_Log_Msg::CUSTOM); + } + } + } +} + + diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.h new file mode 100644 index 00000000000..20828f7f078 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.h @@ -0,0 +1,68 @@ +/** + * @file CIAO_ComponentServer.h + * @author William R. Otte + * + * Defines interface for the bootstrap element of the CIAO Component + * Server. + */ + +#ifndef CIAO_COMPONENTSERVER_H_ +#define CIAO_COMPONENTSERVER_H_ + +#include "ace/String_Base.h" +#include "ace/Task.h" +#include "tao/ORB.h" +#include "ciao/Logger/Logger_Service.h" + +namespace CIAO +{ + namespace Deployment + { + class ComponentServer_Configurator; + + + class ComponentServer_Task : ACE_Task_Base + { + public: + ComponentServer_Task (int argc, ACE_TCHAR **argv); + + int svc (void); + + struct Error + { + Error (const ACE_CString &err) : err_(err) {} + + ACE_CString err_; + }; + + void run (void); + + private: + void parse_args (int argc, ACE_TCHAR **argv); + + void get_log_level (int argc, ACE_TCHAR **argv); + + void set_log_level (void); + + void configure_logging_backend (void); + + void usage (void); + + const char * sched_policy_name (int sched_policy); + + void check_supported_priorities (void); + + CORBA::ORB_var orb_; + + auto_ptr<CIAO::Logger_Service> logger_; + + ACE_CString uuid_; + ACE_CString callback_ior_str_; + ACE_TString output_file_; + auto_ptr<ComponentServer_Configurator> configurator_; + + }; + } +} + +#endif diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl new file mode 100644 index 00000000000..22f2fc09ae9 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.idl @@ -0,0 +1,66 @@ +/** + * @file CIAO_ComponentServer.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * A couple CIAO-specific extensions to the component server + * interfaces. + */ + +#ifndef CIAO_COMPONENTSERVER_IDL_ +#define CIAO_COMPONENTSERVER_IDL_ + +#include <ccm/CCM_Object.idl> +#include <ccm/ComponentServer/CCM_ComponentServer.idl> + +module CIAO +{ + module Deployment + { + interface ComponentServer : ::Components::Deployment::ComponentServer + { + oneway void shutdown (); + }; + + exception InvalidComponent + { + }; + + /** + * @interface CIAO_Container + * @brief CIAO specific extensions to the component server interface. + */ + interface Container : Components::Deployment::Container + { + /// Instruct the container to install a component without + /// an explicit home. + ::Components::CCMObject install_component (in ::Components::Deployment::UUID id, + in string entrypt, + in ::Components::ConfigValues config) + raises (::Components::Deployment::UnknownImplId, + ::Components::Deployment::ImplEntryPointNotFound, + ::Components::Deployment::InstallationFailure, + ::Components::Deployment::InvalidConfiguration); + + /// Activate component with specified ID, if no ID provided, + /// activates all components. + void activate_component (in ::Components::CCMObject comp) + raises (InvalidComponent); + + /// Passivate component with specified ID, if no ID provided, + /// passivates all components. + void passivate_component (in ::Components::CCMObject comp) + raises (InvalidComponent); + + /// Instruct the container to remove a component installed + /// without an explicit home. If the component was installed + /// with an explicit home, this operation will fail. + void remove_component (in ::Components::CCMObject cref) + raises (::Components::RemoveFailure); + + /// Returns a sequence of all homeless components. + ::Components::CCMObjectSeq get_components (); + }; + }; +}; + +#endif /* CIAO_COMPONENTSERVER_IDL_ */ diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc new file mode 100644 index 00000000000..24b9500d1bb --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer.mpc @@ -0,0 +1,99 @@ +project(CIAO_ComponentServer_IDL) : taoidldefaults, anytypecode { + idlflags += -Wb,stub_export_macro=CIAO_ComponentServer_stub_Export + idlflags += -Wb,stub_export_include=CIAO_ComponentServer_stub_export.h + idlflags += -Wb,skel_export_macro=CIAO_ComponentServer_svnt_Export + idlflags += -Wb,skel_export_include=CIAO_ComponentServer_svnt_export.h + + custom_only=1 + + IDL_Files { + CIAO_ComponentServer.idl + CIAO_ServerResources.idl + } +} + +project(CIAO_CS_Client_IDL) : taoidldefaults, anytypecode { + idlflags += -Wb,stub_export_macro=CIAO_ComponentServer_stub_Export + idlflags += -Wb,stub_export_include=CIAO_ComponentServer_stub_export.h + idlflags += -Wb,skel_export_macro=CIAO_CS_Client_svnt_Export + idlflags += -Wb,skel_export_include=CIAO_CS_Client_svnt_export.h + + custom_only=1 + + IDL_Files { + CIAO_CS_Client.idl + CIAO_Properties.idl + } +} + +project(CIAO_ComponentServer_stub) : ccm_componentserver_stub, taolib_with_idl, tao_output, \ + messaging, anytypecode, ciao_lib { + after += CIAO_ComponentServer_IDL CIAO_CS_Client_IDL + dynamicflags = CIAO_COMPONENTSERVER_STUB_BUILD_DLL + + IDL_Files { + } + Source_Files { + CIAO_ComponentServerC.cpp + CIAO_CS_ClientC.cpp + CIAO_ServerResourcesC.cpp + CIAO_PropertiesC.cpp + } + Header_Files { + CIAO_ComponentServer_stub_export.h + } +} + +project(CIAO_CS_Client_svnt) : ccm_svnt, ccm_componentserver_svnt, ciao_componentserver_stub, portableserver, \ + ciao_client, ciao_lib { + dynamicflags = CIAO_CS_CLIENT_SVNT_BUILD_DLL + after += CIAO_CS_Client_IDL + IDL_Files { + } + Source_Files { + CIAO_ServerActivator_Impl.cpp + CIAO_CS_ClientS.cpp + } + Header_Files { + CIAO_ServerActivator_Impl.h + CIAO_CS_ClientS.h + CIAO_CS_Client_svnt_export.h + } +} + +project(CIAO_ComponentServer_svnt) : ccm_componentserver_svnt, ciao_componentserver_stub, portableserver, ciao_componentserver_configurator, \ + ciao_session_container, naming, ciao_server { + + dynamicflags = CIAO_COMPONENTSERVER_SVNT_BUILD_DLL + after += CIAO_Basic_Configurator + libs += CIAO_Basic_Configurator + + IDL_Files { + } + Source_Files { + CIAO_ComponentServer_Impl.cpp + CIAO_ComponentServerS.cpp + CIAO_ServerResourcesS.cpp + CIAO_Container_Impl.cpp + Configurator_Factory.cpp + } + Header_Files { + CIAO_ComponentServer_svnt_export.h + } +} + +project(CIAO_ComponentServer_exe) : ccm_componentserver_svnt, portableserver, ciao_componentserver_svnt, \ + messaging, anytypecode, ciao_server, ciaoexe, ciao_session_container,\ + { + exename = ciao_componentserver + libs += CIAO_Basic_Configurator CIAO_Logger + after += CIAO_Basic_Configurator + macros += CIAO_BUILD_COMPONENTSERVER_EXE + Source_Files { + CIAO_ComponentServer.cpp + } + Inline_Files { + } + IDL_Files { + } +} diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp new file mode 100644 index 00000000000..7521f828288 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.cpp @@ -0,0 +1,245 @@ +#include "CIAO_ComponentServer_Impl.h" + +#include "ciao/CIAO_common.h" + +#include "CIAO_CS_ClientC.h" +#include "CIAO_Container_Impl.h" + +namespace CIAO +{ + namespace Deployment + { + CIAO_ComponentServer_i::CIAO_ComponentServer_i (const ACE_CString &uuid, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa) + : uuid_ (uuid), + orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + containers_ () + { + CIAO_TRACE("CIAO_ComponentServer_i::CIAO_ComponentServer_i"); + } + + // Destructor + CIAO_ComponentServer_i::~CIAO_ComponentServer_i (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::~CIAO_ComponentServer_i"); + } + + void + CIAO_ComponentServer_i::shutdown (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::shutdown"); + + CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_ComponentServer_i::shutdown - ORB shutdown request received at %C.\n", + this->uuid_.c_str ())); + + if (!this->containers_.is_empty ()) + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_ComponentServer_i::shutdown - ComponentServer %C still containers!\n", + this->uuid_.c_str ())); + + this->orb_->shutdown (); + } + + + ::Components::ConfigValues * + CIAO_ComponentServer_i::configuration (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::configuration"); + return this->config_values_.out (); + } + + + ::Components::Deployment::ServerActivator_ptr + CIAO_ComponentServer_i::get_server_activator (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::get_server_activator"); + return this->serv_act_.in (); + } + + ::Components::Deployment::Container_ptr + CIAO_ComponentServer_i::create_container (const ::Components::ConfigValues & config) + { + CIAO_TRACE("CIAO_ComponentServer_i::create_container"); + + try + { + CIAO_DEBUG ((LM_INFO, CLINFO "CIAO_ComponentServer_i::create_container - Request received with %u config values\n", + config.length ())); + + CORBA::PolicyList policies; + const char *name = 0; + CIAO_Container_i *cont = 0; + ACE_NEW_THROW_EX (cont, + CIAO_Container_i (config, 0, name, &policies, + this->orb_.in (), this->poa_.in ()), + CORBA::NO_MEMORY ()); + + CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_ComponentServer_i::create_container - " + "Container servant successfully allocated.\n")); + + PortableServer::ServantBase_var safe_config = cont; + CIAO::Deployment::Container_var cont_var = cont->_this (); + + this->containers_.insert (CIAO::Deployment::Container::_duplicate(cont_var.in ())); + + CIAO_DEBUG ((LM_INFO, CLINFO "CIAO_ComponentServer_i::create_container - Container successfully activated and stored," + "now manage %u containers\n", + this->containers_.size ())); + + return cont_var._retn (); + } + catch (const CORBA::NO_MEMORY &) + { + CIAO_ERROR ((LM_CRITICAL, CLINFO "CIAO_ComponentServer_Impl: Out of memory exception whilst creating container.\n")); + throw; + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, "CIAO_ComponentServer_Impl: Caught unknown exception\n")); + } + + throw Components::CreateFailure (); + } + + + + void + CIAO_ComponentServer_i::remove_container (::Components::Deployment::Container_ptr cref) + { + CIAO_TRACE("CIAO_ComponentServer_i::remove_container"); + + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_i::remove_container - remove request received.\n")); + + if (CORBA::is_nil (cref)) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ComponentServer_i::remove_container - " + "Error: Received nil container reference\n")); + throw Components::RemoveFailure (); + } + + if (this->containers_.is_empty ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ComponentServer_i::remove_container - " + "Error: I don't manage any containers!\n")); + throw Components::RemoveFailure (); + } + + try + { + CONTAINERS::ITERATOR i (this->containers_.begin ()); + + // @@ TODO: artifact from when this was a sequence, should probably use .find, + // which will work properly with the new parameterized set class. + for (CONTAINERS::iterator i = this->containers_.begin (); + i.done () != 1; i.advance ()) + { + if (CORBA::is_nil (*i)) + { + ACE_ERROR ((LM_WARNING, CLINFO + "CIAO_ComponentServer_i::remove_container - " + "Managed container reference is nil, skipping.\n")); + continue; + } + + if ((*i)->_is_equivalent (cref)) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_i::remove_container - Found container, invoking remove....\n")); + cref->remove (); + if (this->containers_.remove (*i) != 0) + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ComponentServer_i::remove_container - Unable to remove " + "container reference from internal structure....\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_ComponentServer_i::remove_container - Remove completed, destroying object, " + "now manage %u containers\n", this->containers_.size ())); + return; + } + } + } + catch (const CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_ComponentServer_i::remove_container - " + "Caught CORBA exception whilst removing container: %C\n", + ex._info ().c_str ())); + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_ComponentServer_i::remove_container - Error: Unknown exception caught while removing a container.\n")); + } + throw Components::RemoveFailure (); + } + + + ::Components::Deployment::Containers * + CIAO_ComponentServer_i::get_containers (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::get_containers"); + + ::Components::Deployment::Containers *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Components::Deployment::Containers (this->containers_.size ()), + CORBA::NO_MEMORY ()); + + ::Components::Deployment::Containers_var retval (tmp); + CORBA::ULong pos (0); + retval->length (this->containers_.size ()); + + for (CONTAINERS::iterator i = this->containers_.begin (); + i.done () != 1; i.advance ()) + { + retval[pos++] = ::CIAO::Deployment::Container::_duplicate (*i); + } + + return retval._retn (); + } + + + void + CIAO_ComponentServer_i::remove (void) + { + CIAO_TRACE("CIAO_ComponentServer_i::remove"); + + bool successful = true; + + for (CONTAINERS::iterator i = this->containers_.begin (); + i.done () != 1; i.advance ()) + { + try + { + (*i)->remove (); + } + catch (const CORBA::Exception &ex) + { + successful = false; + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ComponentServer_i::remove - " + "Intercepted CORBA exception while trying to remove a container:%C\n", + ex._info ().c_str ())); + } + catch (...) + { + successful = false; + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ComponentServer_i::remove - " + "Intercepted exception while trying to remove a container\n")); + } + } + + this->containers_.reset (); + + if (!successful) + throw ::Components::RemoveFailure (); + } + + void + CIAO_ComponentServer_i::init ( + ::Components::Deployment::ServerActivator_ptr sa, + Components::ConfigValues *cvs) + { + this->serv_act_ = ::Components::Deployment::ServerActivator::_duplicate(sa); + this->config_values_ = cvs; + } + } +} diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h new file mode 100644 index 00000000000..bf08fbbc7bb --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_Impl.h @@ -0,0 +1,78 @@ +/** + * @file CIAO_ComponentServer_Impl.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ + +#ifndef CIAO_COMPONENTSERVER_IMPL_H_ +#define CIAO_COMPONENTSERVER_IMPL_H_ + +#include "ciao/ComponentServer/CIAO_ComponentServerS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/String_Base.h" +#include "ace/Unbounded_Set_Ex.h" + +namespace CIAO +{ + namespace Deployment + { + class CIAO_ComponentServer_svnt_Export CIAO_ComponentServer_i + : public virtual POA_CIAO::Deployment::ComponentServer + { + public: + // Constructor + CIAO_ComponentServer_i (const ACE_CString &uuid, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa); + + // Destructor + virtual ~CIAO_ComponentServer_i (void); + + virtual void shutdown (void); + + virtual ::Components::ConfigValues * configuration (void); + + virtual + ::Components::Deployment::ServerActivator_ptr get_server_activator (void); + + virtual + ::Components::Deployment::Container_ptr create_container (const ::Components::ConfigValues & config); + + virtual + void remove_container (::Components::Deployment::Container_ptr cref); + + virtual + ::Components::Deployment::Containers * get_containers (void); + + virtual + void remove (void); + + void init (::Components::Deployment::ServerActivator_ptr sa, + Components::ConfigValues *cvs); + + private: + ACE_CString uuid_; + CORBA::ORB_var orb_; + PortableServer::POA_var poa_; + ::Components::Deployment::ServerActivator_var serv_act_; + Components::ConfigValues_var config_values_; + + template<typename T> + struct _is_equivalent + { + bool operator() (const T &a, const T &b) const + { + return a->_is_equivalent (const_cast <T&> (b)); + } + }; + + typedef ACE_Unbounded_Set_Ex <Container_var, + _is_equivalent<Container_var> > CONTAINERS; + + CONTAINERS containers_; + }; + } +} + +#endif diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_stub_export.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_stub_export.h new file mode 100644 index 00000000000..fa958277aae --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_ComponentServer_stub +// ------------------------------ +#ifndef CIAO_COMPONENTSERVER_STUB_EXPORT_H +#define CIAO_COMPONENTSERVER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_COMPONENTSERVER_STUB_HAS_DLL) +# define CIAO_COMPONENTSERVER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_COMPONENTSERVER_STUB_HAS_DLL */ + +#if !defined (CIAO_COMPONENTSERVER_STUB_HAS_DLL) +# define CIAO_COMPONENTSERVER_STUB_HAS_DLL 1 +#endif /* ! CIAO_COMPONENTSERVER_STUB_HAS_DLL */ + +#if defined (CIAO_COMPONENTSERVER_STUB_HAS_DLL) && (CIAO_COMPONENTSERVER_STUB_HAS_DLL == 1) +# if defined (CIAO_COMPONENTSERVER_STUB_BUILD_DLL) +# define CIAO_ComponentServer_stub_Export ACE_Proper_Export_Flag +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_COMPONENTSERVER_STUB_BUILD_DLL */ +# define CIAO_ComponentServer_stub_Export ACE_Proper_Import_Flag +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_COMPONENTSERVER_STUB_BUILD_DLL */ +#else /* CIAO_COMPONENTSERVER_STUB_HAS_DLL == 1 */ +# define CIAO_ComponentServer_stub_Export +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARATION(T) +# define CIAO_COMPONENTSERVER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_COMPONENTSERVER_STUB_HAS_DLL == 1 */ + +// Set CIAO_COMPONENTSERVER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_COMPONENTSERVER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_COMPONENTSERVER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_COMPONENTSERVER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_COMPONENTSERVER_STUB_NTRACE */ + +#if (CIAO_COMPONENTSERVER_STUB_NTRACE == 1) +# define CIAO_COMPONENTSERVER_STUB_TRACE(X) +#else /* (CIAO_COMPONENTSERVER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_COMPONENTSERVER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_COMPONENTSERVER_STUB_NTRACE == 1) */ + +#endif /* CIAO_COMPONENTSERVER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/CIAO_ComponentServer_svnt_export.h b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_svnt_export.h new file mode 100644 index 00000000000..1469845401d --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ComponentServer_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_ComponentServer_svnt +// ------------------------------ +#ifndef CIAO_COMPONENTSERVER_SVNT_EXPORT_H +#define CIAO_COMPONENTSERVER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_COMPONENTSERVER_SVNT_HAS_DLL) +# define CIAO_COMPONENTSERVER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_COMPONENTSERVER_SVNT_HAS_DLL */ + +#if !defined (CIAO_COMPONENTSERVER_SVNT_HAS_DLL) +# define CIAO_COMPONENTSERVER_SVNT_HAS_DLL 1 +#endif /* ! CIAO_COMPONENTSERVER_SVNT_HAS_DLL */ + +#if defined (CIAO_COMPONENTSERVER_SVNT_HAS_DLL) && (CIAO_COMPONENTSERVER_SVNT_HAS_DLL == 1) +# if defined (CIAO_COMPONENTSERVER_SVNT_BUILD_DLL) +# define CIAO_ComponentServer_svnt_Export ACE_Proper_Export_Flag +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_COMPONENTSERVER_SVNT_BUILD_DLL */ +# define CIAO_ComponentServer_svnt_Export ACE_Proper_Import_Flag +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_COMPONENTSERVER_SVNT_BUILD_DLL */ +#else /* CIAO_COMPONENTSERVER_SVNT_HAS_DLL == 1 */ +# define CIAO_ComponentServer_svnt_Export +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARATION(T) +# define CIAO_COMPONENTSERVER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_COMPONENTSERVER_SVNT_HAS_DLL == 1 */ + +// Set CIAO_COMPONENTSERVER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_COMPONENTSERVER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_COMPONENTSERVER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_COMPONENTSERVER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_COMPONENTSERVER_SVNT_NTRACE */ + +#if (CIAO_COMPONENTSERVER_SVNT_NTRACE == 1) +# define CIAO_COMPONENTSERVER_SVNT_TRACE(X) +#else /* (CIAO_COMPONENTSERVER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_COMPONENTSERVER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_COMPONENTSERVER_SVNT_NTRACE == 1) */ + +#endif /* CIAO_COMPONENTSERVER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp new file mode 100644 index 00000000000..e555bac7337 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.cpp @@ -0,0 +1,443 @@ +#include "CIAO_Container_Impl.h" + +#include "ace/Log_Msg.h" +#include "ccm/CCM_HomeC.h" +#include "ciao/CIAO_common.h" +#include "ciao/Server_init.h" +#include "ciao/Client_init.h" +#include "CIAO_PropertiesC.h" + +namespace CIAO +{ + namespace Deployment + { + // Constructor + CIAO_Container_i::CIAO_Container_i (const Components::ConfigValues &config, + const Static_Config_EntryPoints_Maps *static_entrypts, + const char *name, + const CORBA::PolicyList *policies, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + config_ (config.length ()), + static_entrypts_maps_ (static_entrypts) + { + CIAO_TRACE("CIAO_Container_i::CIAO_Container_i"); + + for (CORBA::ULong i = 0; i < config.length (); ++i) + { + this->config_[i] = config[i]; + } + + try + { + if (this->static_entrypts_maps_ == 0) + { + CIAO_DEBUG((LM_DEBUG, CLINFO "CIAO_Container_i: creating Session container with dynamic linkage\n")); + this->container_ = new CIAO::Session_Container (this->orb_.in (), this, false, + 0, name, policies); + } + else + { + CIAO_DEBUG((LM_DEBUG, CLINFO "CIAO_Container_i: creating Session container with static linkage\n")); + this->container_ = new CIAO::Session_Container (this->orb_.in (), this, true, + this->static_entrypts_maps_, + name, policies); + } + } + catch (...) + { + CIAO_ERROR((LM_ERROR, CLINFO "CIAO_Container_i::CIAO_Container_i - " + "Caught exception while allocating container implementation\n")); + throw; + } + } + + + // Destructor + CIAO_Container_i::~CIAO_Container_i (void) + { + CIAO_TRACE("CIAO_Container_i::~CIAO_Container_i"); + } + + ::Components::CCMObject_ptr + CIAO_Container_i::install_component (const char * id, + const char * entrypt, + const ::Components::ConfigValues & config) + { + CIAO_TRACE("CIAO_Container_i::install_component"); + + if (id == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_component - " + "No home ID provided\n")); + throw ::Components::Deployment::InvalidConfiguration (); + } + + Components::CCMObject_var comp; + + if (this->component_map_.find (id, comp) == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_component - " + "Component with id %C already installed, aborting\n", + id)); + throw Components::CreateFailure (); + } + + if (entrypt == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_component - " + "No executor entrypoint found.\n")); + throw ::Components::Deployment::InvalidConfiguration (); + } + + CIAO_DEBUG ((LM_INFO, CLINFO "CIAO_Container_i::install_component - " + "Attempting to install home with id [%C]\n", + id)); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_component - " + "Extracting ConfigValues from sequence of length [%u]\n", + config.length ())); + + CIAO::Utility::CONFIGVALUE_MAP cm; + CIAO::Utility::build_config_values_map (cm, config); + CORBA::Any val; + + const char *tmp; + CORBA::String_var exec_art, svnt_art, svnt_entry; + + if (cm.find (SVNT_ENTRYPT, val) == 0) + { + val >>= tmp; + svnt_entry = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_component - " + "Found Servant entrypoint %C\n", svnt_entry.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_component - " + "Error: No Servant entrypoint porovided, aborting installation\n")); + throw Components::InvalidConfiguration (); + } + + if (cm.find (SVNT_ARTIFACT, val) == 0) + { + val >>= tmp; + svnt_art = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_component - " + "Found Servant artifact %C\n", svnt_art.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_component - " + "Error: No Servant artifact porovided, aborting installation\n")); + throw Components::InvalidConfiguration (); + } + + + if (cm.find (EXEC_ARTIFACT, val) == 0) + { + val >>= tmp; + exec_art = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_component - " + "Found executor artifact: %C\n", exec_art.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_component - " + "Error: No Executor artifact porovided, aborting installation\n")); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_component - " + "Extraction resulted in map of [%u] values", cm.current_size ())); + + comp = this->container_->install_component (exec_art, + entrypt, + svnt_art, + svnt_entry, + id); + + if (this->component_map_.bind (id, + Components::CCMObject::_duplicate (comp.in ())) == -1) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_component - " + "Unable to bind componnet into component map\n")); + } + + + return comp._retn (); + } + + void + CIAO_Container_i::remove_component (::Components::CCMObject_ptr /*cref*/) + { + CIAO_TRACE("CIAO_Container_i::remove_component"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::CCMObjectSeq * + CIAO_Container_i::get_components (void) + { + CIAO_TRACE("CIAO_Container_i::get_components"); + throw CORBA::NO_IMPLEMENT (); + return 0; + } + + ::Components::ConfigValues * + CIAO_Container_i::configuration (void) + { + CIAO_TRACE("CIAO_Container_i::configuration"); + throw CORBA::NO_IMPLEMENT (); + return 0; + } + + ::Components::Deployment::ComponentServer_ptr + CIAO_Container_i::get_component_server (void) + { + CIAO_TRACE("CIAO_Container_i::get_component_server"); + throw CORBA::NO_IMPLEMENT (); + return 0; + } + + ::Components::CCMHome_ptr + CIAO_Container_i::install_home (const char * id, + const char * entrypt, + const ::Components::ConfigValues & config) + { + CIAO_TRACE("CIAO_Container_i::install_home"); + + if (id == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_home - " + "No home ID provided\n")); + throw ::Components::Deployment::InvalidConfiguration (); + } + + Components::CCMHome_var home; + + if (this->home_map_.find (id, home) == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_home - " + "Home with id %C already installed, aborting\n", + id)); + throw Components::CreateFailure (); + } + + if (entrypt == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::install_home - " + "No executor entrypoint found.\n")); + throw ::Components::Deployment::InvalidConfiguration (); + } + + CIAO_DEBUG ((LM_INFO, CLINFO "CIAO_Container_i::install_home - " + "Attempting to install home with id [%C]\n", + id)); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_home - " + "Extracting ConfigValues from sequence of length [%u]\n", + config.length ())); + + CIAO::Utility::CONFIGVALUE_MAP cm; + CIAO::Utility::build_config_values_map (cm, config); + CORBA::Any val; + + const char *tmp; + CORBA::String_var exec_art, svnt_art, svnt_entry; + if (cm.find (SVNT_ENTRYPT, val) == 0) + { + val >>= tmp; + svnt_entry = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_home - " + "Found Servant entrypoint %C\n", svnt_entry.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_home - " + "Error: No Servant entrypoint porovided, aborting installation\n")); + throw Components::InvalidConfiguration (); + } + + if (cm.find (SVNT_ARTIFACT, val) == 0) + { + val >>= tmp; + svnt_art = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_home - " + "Found Servant artifact %C\n", svnt_art.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_home - " + "Error: No Servant artifact porovided, aborting installation\n")); + throw Components::InvalidConfiguration (); + } + + + if (cm.find (EXEC_ARTIFACT, val) == 0) + { + val >>= tmp; + exec_art = tmp; + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_home - " + "Found executor artifact: %C\n", exec_art.in ())); + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_home - " + "Error: No Executor artifact porovided, aborting installation\n")); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_Container_i::install_home - " + "Extraction resulted in map of [%u] values", cm.current_size ())); + + + // extract config values here... + + //CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_Container_i::install_home - ", + //"Executor entrypoint [%C], servant entrypoint [%C], servant library [%C]\n", + //entrypt, svnt_entrypt.in (), svnt_library.in ())); + + home = this->container_->install_home (exec_art, + entrypt, + svnt_art, + svnt_entry, + id); + + if (this->home_map_.bind (id, + Components::CCMHome::_duplicate (home.in ())) == -1) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_Container_i::install_home - " + "Unable to bind home into home map\n")); + } + + return home._retn (); + } + + void + CIAO_Container_i::remove_home (::Components::CCMHome_ptr href) + { + CIAO_TRACE("CIAO_Container_i::remove_home"); + + ::Components::CCMHome_var home (href); + + Home_Iterator i = this->home_map_.begin (); + while (!i.done ()) + { + if (i->item ()->_is_equivalent (home.in ())) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_Container_i::remove_home - " + "Successfully found matching home\n")); + break; + } + i.advance (); + } + + if (i.done ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::remove_home - " + "Unable to find matching home managed by this container, throwing RemoveFailure\n")); + throw Components::RemoveFailure (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO "CIAO_Container_i::remove_home - " + "Invoking remove on the container impl for home %C.\n", + i->key ().c_str ())); + this->container_->uninstall_home (home.in ()); + CIAO_DEBUG ((LM_INFO, CLINFO "CIAO_Container_i::remove_home - " + "Successfully removed home %C\n", + i->key ().c_str ())); + + if (this->home_map_.unbind (i->key ()) != 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "CIAO_Container_i::remove_home - " + "Unable to unbind removed home with id %C from home map\n", + i->key ().c_str ())); + } + } + + ::Components::CCMHomes * + CIAO_Container_i::get_homes (void) + { + CIAO_TRACE("CIAO_Container_i::get_homes"); + + ::Components::CCMHomes * tmp_homes; + + ACE_NEW_THROW_EX (tmp_homes, + ::Components::CCMHomes (this->home_map_.current_size ()), + CORBA::NO_MEMORY ()); + + ::Components::CCMHomes_var retval (tmp_homes); + retval->length (this->home_map_.current_size ()); + Home_Iterator i = this->home_map_.begin (); + CORBA::ULong pos = 0; + while (!i.done ()) + { + retval[pos++] = ::Components::CCMHome::_duplicate (i->item ().in ()); + i.advance (); + } + + return retval._retn (); + } + + void + CIAO_Container_i::remove (void) + { + CIAO_TRACE("CIAO_Container_i::remove"); + + if (this->home_map_.current_size () != 0 || + this->component_map_.current_size () != 0) + { + CIAO_ERROR ((LM_WARNING, CLINFO "CIAO_Container_i::remove - " + "Attempting to remove container that still has %u homes and %u components installed\n", + this->home_map_.current_size (), + this->component_map_.current_size ())); + + } + + //this->container_->_remove_ref (); + } + + void + CIAO_Container_i::activate_component (::Components::CCMObject_ptr comp) + { + CIAO_TRACE ("CIAO_Container_i::activate_component"); + + this->container_->activate_component (comp); + } + + + void + CIAO_Container_i::passivate_component (::Components::CCMObject_ptr comp) + { + CIAO_TRACE ("CIAO_Container_i::passivate_component"); + + this->container_->passivate_component (comp); + } + + + PortableServer::POA_ptr + CIAO_Container_i::_default_POA (void) + { + CIAO_TRACE ("CIAO_Container_i::_default_POA"); + return PortableServer::POA::_duplicate (this->poa_.in ()); + } + } +} diff --git a/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h new file mode 100644 index 00000000000..3f85cc731ff --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_Container_Impl.h @@ -0,0 +1,114 @@ +/** + * @file CIAO_Container_Impl.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ + +#ifndef CIAO_CONTAINER_H_ +#define CIAO_CONTAINER_H_ + +#include "CIAO_ComponentServerS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Containers/Session/Session_Container.h" + +#include "CIAO_ComponentServer_svnt_export.h" + +namespace CIAO +{ + namespace Deployment + { + /** + * @class CIAO_Container + * @brief Implements external interface for CIAO container. + */ + class CIAO_ComponentServer_svnt_Export CIAO_Container_i + : public virtual POA_CIAO::Deployment::Container + { + public: + /// Constructor + CIAO_Container_i (const Components::ConfigValues &config, + const Static_Config_EntryPoints_Maps *, + const char *, + const CORBA::PolicyList *, + CORBA::ORB_ptr, + PortableServer::POA_ptr); + + /// Destructor + virtual ~CIAO_Container_i (void); + + virtual ::Components::CCMObject_ptr install_component ( + const char * id, + const char * entrypt, + const ::Components::ConfigValues & config); + + virtual void remove_component (::Components::CCMObject_ptr cref); + + virtual ::Components::CCMObjectSeq * get_components (void); + + virtual ::Components::ConfigValues * configuration (void); + + virtual + ::Components::Deployment::ComponentServer_ptr get_component_server (void); + + virtual ::Components::CCMHome_ptr install_home (const char * id, + const char * entrypt, + const ::Components::ConfigValues & config); + + virtual void remove_home (::Components::CCMHome_ptr href); + + virtual ::Components::CCMHomes * get_homes (void); + + virtual void remove (void); + + virtual void activate_component (::Components::CCMObject_ptr comp); + + virtual void passivate_component (::Components::CCMObject_ptr comp); + + virtual PortableServer::POA_ptr _default_POA (void); + + private: + /// Keep a pointer to the managing ORB serving this servant. + CORBA::ORB_var orb_; + + PortableServer::POA_var poa_; + + CIAO::Container_var container_; + + Components::ConfigValues config_; + + const Static_Config_EntryPoints_Maps* static_entrypts_maps_; + + /// To store all created CCMHome object + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + Components::CCMHome_var, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> CCMHome_Map; + + typedef CCMHome_Map::iterator Home_Iterator; + CCMHome_Map home_map_; + + /// To store all created Component object. + // @@Gan, see how this caching is duplicated.. + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + Components::CCMObject_var, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> CCMComponent_Map; + + typedef CCMComponent_Map::iterator Component_Iterator; + CCMComponent_Map component_map_; + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + ACE_CString, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> CCMNaming_Map; + CCMNaming_Map naming_map_; + }; + } +} +#endif /* CIAO_CONTAINER_H_ */ diff --git a/CIAO/ciao/ComponentServer/CIAO_Properties.idl b/CIAO/ciao/ComponentServer/CIAO_Properties.idl new file mode 100644 index 00000000000..41a3398a18a --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_Properties.idl @@ -0,0 +1,28 @@ +/** + * @file CIAO_Properties.idl + * @author William R. Otte + * $Id$ + * Standardizes names of configvalues used by CIAO. + */ + +#ifndef CIAO_PROPERTIES_IDL +#define CIAO_PROPERTIES_IDL + +module CIAO +{ + module Deployment + { + const string SVNT_ENTRYPT = "edu.vanderbilt.dre.CIAO.ServantEntrypoint"; + const string SVNT_ARTIFACT = "edu.vanderbilt.dre.CIAO.ServantArtifact"; + const string EXEC_ARTIFACT = "edu.vanderbilt.dre.CIAO.ExecutorArtifact"; + const string SERVER_RESOURCES = "edu.vanderbilt.dre.CIAO.ServerResources"; + const string SERVER_UUID = "edu.vanderbilt.dre.CIAO.ServerUUID"; + const string SERVER_EXECUTABLE = "edu.vanderbilt.dre.CIAO.ComponentServerExecutable"; + const string SERVER_ARGUMENTS = "edu.vanderbilt.dre.CIAO.ComponentServerArgs"; + const string SERVER_TIMEOUT = "edu.vanderbilt.dre.CIAO.ServerTimeout"; + const string SERVER_MULTITHREAD = "edu.vanderbilt.dre.CIAO.Multithreaded"; + const string REGISTER_NAMING = "edu.vanderbilt.dre.CIAO.RegisterNaming"; + + }; +}; +#endif /* CIAO_PROPERTIES_IDL */ diff --git a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp new file mode 100644 index 00000000000..9496216eea7 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.cpp @@ -0,0 +1,528 @@ +#include "CIAO_ServerActivator_Impl.h" + +#include "ace/Log_Msg.h" +#include "ace/UUID.h" +#include "ciao/CIAO_common.h" +#include "ciao/Client_init.h" +#include "ciao/CIAO_FailureReasonsC.h" + +#include "CIAO_ServerResourcesC.h" +#include "CIAO_ComponentServerC.h" +#include "CIAO_PropertiesC.h" + +namespace CIAO +{ + namespace Deployment + { + CIAO_ServerActivator_i::CIAO_ServerActivator_i (CORBA::ULong def_spawn_delay, + const char * default_cs_path, + const char * cs_args, + bool multithreaded, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa) + : spawn_delay_ (def_spawn_delay), + multithreaded_ (multithreaded), + orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), + cs_path_ (default_cs_path), + cs_args_ (cs_args), + mutex_ (), + condition_ (mutex_) + { + CIAO_TRACE (CLINFO "CIAO_ServerActivator_i::CIAO_ServerActivator_i"); + } + + CIAO_ServerActivator_i::~CIAO_ServerActivator_i(void) + { + } + + void + CIAO_ServerActivator_i::component_server_callback (::Components::Deployment::ComponentServer_ptr serverref, + const char * server_UUID, + ::Components::ConfigValues_out config) + { + CIAO_TRACE(CLINFO "CIAO_ServerActivator_i::component_server_callback"); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C\n", + server_UUID)); + + if (this->server_infos_.is_empty ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C, but I don't manage any.\n", + server_UUID)); + throw CORBA::BAD_PARAM (); + } + + //SERVER_INFOS::iterator i (this->server_infos_.begin ()); + //i.first (); + Server_Info *info = 0; + + for (SERVER_INFOS::iterator i (this->server_infos_.begin ()); + !i.done (); ++i) + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Comparing %C with %C\n", (*i)->uuid_.c_str (), server_UUID)); + if ((*i)->uuid_ == server_UUID) + { + info = (*i).get (); + } + } + + if (info == 0) + { CIAO_ERROR ((LM_WARNING, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C, which doesn't belong to me.\n", + server_UUID)); + throw CORBA::BAD_PARAM (); + } + + if (info->activated_) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C, which has already been configured.\n", + server_UUID)); + throw CORBA::BAD_INV_ORDER (); + } + + if (!CORBA::is_nil (info->ref_)) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C, which has already called back.\n", + server_UUID)); + throw CORBA::BAD_INV_ORDER (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Received callback from ComponentServer %C\n", + server_UUID)); + + info->ref_ = ::Components::Deployment::ComponentServer::_duplicate (serverref); + + this->create_component_server_config_values (*info, config); + + // @@TODO: May want to print out configvalues here. + CIAO_DEBUG ((LM_DEBUG, CLINFO + "CIAO_ServerActivator_i::component_server_callback - " + "Generated %u ConfigValues for ComponentServer %C\n", + config->length (), server_UUID)); + } + + void + CIAO_ServerActivator_i::configuration_complete (const char *server_UUID) + { + CIAO_TRACE (CLINFO "CIAO_ServerActivator_i::configuration_complete"); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Received configuration_complete from ComponentServer %C\n", + server_UUID)); + + try + { + if (this->server_infos_.is_empty ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Received callback from ComponentServer %C, but I don't manage any.\n", + server_UUID)); + throw CORBA::BAD_PARAM (); + } + + Server_Info *info = 0; + + for (SERVER_INFOS::ITERATOR j (this->server_infos_); + !j.done (); ++j) + { + if ((*j)->uuid_ == server_UUID) + { + info = (*j).get (); + } + } + + if (info == 0) + { + CIAO_ERROR ((LM_WARNING, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Received configuration_complete from ComponentServer %C, which doesn't belong to me.\n", + server_UUID)); + throw CORBA::BAD_PARAM (); + } + + if (info->activated_) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Received configuration_complete from ComponentServer %C, which has already been completed.\n", + server_UUID)); + throw CORBA::BAD_INV_ORDER (); + } + + if (CORBA::is_nil (info->ref_.in ())) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Received configuration_complete from ComponentServer %C, which has not called back.\n", + server_UUID)); + throw CORBA::BAD_INV_ORDER (); + } + + info->activated_ = true; + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::configuration_complete - " + "Caught unknown exception while processing configuration_complete\n")); + throw; + } + } + + ::Components::Deployment::ComponentServer_ptr + CIAO_ServerActivator_i::create_component_server (const ::Components::ConfigValues & config) + { + CIAO_TRACE(CLINFO "CIAO_ServerActivator_i::create_component_server"); + + Safe_Server_Info server (new Server_Info (config.length () + 1)); + + CIAO::Utility::build_config_values_map (*server->cmap_, config); + + ACE_CString cmd_options = this->construct_command_line (*server); + + CIAO_DEBUG ((LM_DEBUG, CLINFO + "CIAO_ServerActivator_i::create_component_server - ComponentServer arguments: %C\n", + cmd_options.c_str ())); + + server_infos_.insert_tail (server); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::create_component_server - " + "Attempting to spawn ComponentServer with UUID %C\n", + server->uuid_.c_str ())); + // Now we need to get a copy of the one that was inserted... + pid_t pid = this->spawn_component_server (*server, cmd_options); + ACE_UNUSED_ARG (pid); + + ACE_Time_Value timeout (this->spawn_delay_); + + CORBA::Any val; + + if (server->cmap_->find (SERVER_TIMEOUT, val) == 0) + { + CORBA::ULong t; + if (val >>= t) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_ServerActivator_i::create_component_server - " + "Using provided non-default server timeout of %u\n", t)); + timeout = ACE_Time_Value (t); + } + else + { + CIAO_ERROR ((LM_WARNING, CLINFO "CIAO_ServerActivator_i::create_component_server - " + "Failed to extract provided non-default server timeout from property '%C', " + "falling back to default timeout of %u\n", + this->spawn_delay_)); + } + } + + if (this->multithreaded_) + this->multi_threaded_wait_for_callback (*server, timeout/*, pid*/); + else + this->single_threaded_wait_for_callback (*server, timeout/*, pid*/); + + CIAO_DEBUG ((LM_DEBUG, CLINFO + "CIAO_ServerActivator_i::create_component_server - " + "ComponentServer %C successfully spawned and configured!\n", + server->uuid_.c_str ())); + + return ::Components::Deployment::ComponentServer::_duplicate (server->ref_.in ()); + } + + ACE_CString + CIAO_ServerActivator_i::construct_command_line (Server_Info &server) + { + CIAO_TRACE (CLINFO "CIAO_ServerActivator_i::construct_command_line"); + // Build our command line to launch the compoent server + ACE_CString cmd_options (this->cs_args_); + + CORBA::Any val; + + if (server.cmap_->find (SERVER_UUID, val) == 0) + { + // Nodeapplication has requested a custom uuid + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::construct_command_line - Using provided UUID\n")); + const char *uuid = 0; + val >>= uuid; + server.uuid_ = uuid; + } + else + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::construct_command_line - Using generated UUID\n")); + ACE_Utils::UUID uuid; + ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID (uuid); + server.uuid_ = *uuid.to_string (); + } + + CIAO_DEBUG ((LM_DEBUG, CLINFO + "CIAO_ServerActivator_i::construct_command_line - Creating component server " + " with UUID %C\n", server.uuid_.c_str ())); + + cmd_options += " -u "; + cmd_options += server.uuid_; + + if (server.cmap_->find (SERVER_RESOURCES, val) == 0) + { + // There may be command line arguments specified in the plan + ServerResource_var sr; + val >>= sr; + + // If command line options are specified through RTCCM descriptors, + // then we should honor these command line options as well. + for (CORBA::ULong arg_i = 0; + arg_i < sr->args.length (); + ++arg_i) + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::construct_command_line - Adding argument %C from ServerResource\n ", + sr->args[arg_i].in ())); + cmd_options += " "; // space between command line args + cmd_options += sr->args[arg_i]; + } + + // If service configuration file is specified through RTCCM + // descriptors, then we should honor it as well. + if (ACE_OS::strcmp (sr->svcconf.in (), "") != 0) + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::construct_command_line - Using SvcConf file %C\n ", + sr->svcconf.in ())); + cmd_options += " -ORBSvcConf "; + cmd_options += sr->svcconf; + } + } + + return cmd_options; + } + + pid_t + CIAO_ServerActivator_i::spawn_component_server (const Server_Info &si, + const ACE_CString &cmd_line) + { + CIAO_TRACE ("CIAO_ServerActivator_i::spawn_component_server"); + + ACE_Process_Options options; + + // Get my object reference + CORBA::Object_var obj = this->poa_->servant_to_reference (this); + CORBA::String_var ior = this->orb_->object_to_string (obj.in ()); + CORBA::Any val; + + const char *path = this->cs_path_.c_str (); + + if (si.cmap_->find (SERVER_EXECUTABLE, val) == 0) + { + val >>= path; + CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_ServerActivator_i::spawn_component_server - " + "Using provided component server executable:%C\n", path)); + } + else + { + CIAO_DEBUG ((LM_DEBUG, CLINFO "CIAO_ServerActivator_i::spawn_component_server - " + "Using default component server execuable\n")); + } + + options.command_line ("%s %s -c %s", + path, + cmd_line.c_str (), + ior.in ()); + + options.avoid_zombies (0); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::spawn_component_server - Spawning process, command line is %s\n", + options.command_line_buf ())); + + pid_t const pid = this->process_manager_.spawn (options, + &this->child_handler_); + + if (pid == ACE_INVALID_PID) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Failed to spawn a ComponentServer process\n")); + throw Components::CreateFailure (CIAO::SERVER_SPAWN_FAILURE); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::spawn_component_server - Process successfully spawned with pid %u\n", + pid)); + return pid; + } + + void + CIAO_ServerActivator_i:: + single_threaded_wait_for_callback (const Server_Info &si, + ACE_Time_Value &timeout) + { + CIAO_TRACE (CLINFO "CIAO_ServerActivator_i::single_threaded_wait_for_callback"); + // Below code is broken for thread-per-connection concurrency model, + // since the main thread is running ORB event loop and will spawn + // a different thread to handle the call <register_node_application>, + // the <perform_work> operation will not be invoked and finally + // a timeout will occur. For a similar reason, it won't work + // for thread-pool concurrency model. + while (true) + { + this->orb_->perform_work (timeout); + + if (timeout == ACE_Time_Value::zero) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::single_threaded_wait_for_callback - " + "Timed out while waiting for ComponentServer %C to call back.\n", + si.uuid_.c_str ())); + throw ::Components::CreateFailure (CIAO::CALLBACK_TIMEOUT_EXCEEDED); + } + + if (si.activated_) + { + break; + } + } + } + + void + CIAO_ServerActivator_i:: + multi_threaded_wait_for_callback (const Server_Info &si, + ACE_Time_Value &timeout) + { + CIAO_TRACE (CLINFO "CIAO_ServerActivator_i::multi_threaded_wait_for_callback"); + + // Wait for a conditional variable + ACE_GUARD_THROW_EX ( ACE_Thread_Mutex, + guard, + this->mutex_, + CORBA::NO_RESOURCES ()); + + while (! si.activated_ ) + if (this->condition_.wait (&timeout) == -1) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::multi_threaded_wait_for_callback - " + "Timed out while waiting for ComponentServer %C to call back.\n", + si.uuid_.c_str ())); + throw Components::CreateFailure (CIAO::CALLBACK_TIMEOUT_EXCEEDED); + } + } + + void + CIAO_ServerActivator_i::remove_component_server (::Components::Deployment::ComponentServer_ptr server) + { + CIAO_TRACE(CLINFO "CIAO_ServerActivator_i::remove_component_server"); + + if (this->server_infos_.is_empty ()) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "I don't manage any ComponentServers.\n")); + throw CORBA::BAD_PARAM (); + } + + Server_Info *info = 0; + + for (SERVER_INFOS::ITERATOR i (this->server_infos_); + !i.done (); ++i) + { + if ((*i)->ref_->_is_equivalent (server)) + { + info = (*i).get (); + } + } + + if (info == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "Failed to find equivalent ComponentServer under my management.\n")); + throw ::Components::RemoveFailure (); + } + + try + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "Calling remove () on ComponentServer %C\n", + info->uuid_.c_str ())); + server->remove (); + } + catch (::Components::RemoveFailure &) + { + CIAO_ERROR ((LM_WARNING, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "Received RemoveFailure exception from ComponentServer %C\n", + info->uuid_.c_str ())); + } + + // If this is a CIAO component server, call shutdown + CIAO::Deployment::ComponentServer_var ccs = + CIAO::Deployment::ComponentServer::_narrow (server); + if (!CORBA::is_nil (ccs)) + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "Calling shutdown () on ComponentServer %C\n", + info->uuid_.c_str ())); + ccs->shutdown (); + } + else + CIAO_DEBUG ((LM_TRACE, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "ComponentServer %C is not a CIAO_ComponentServer, not calling shutdown.\n", + info->uuid_.c_str ())); + + CIAO_DEBUG ((LM_INFO, CLINFO + "CIAO_ServerActivator_i::remove_component_server - " + "ComponentServer %C successfully shut down.\n", + info->uuid_.c_str ())); + } + + ::Components::Deployment::ComponentServers * + CIAO_ServerActivator_i::get_component_servers (void) + { + CIAO_TRACE(CLINFO "CIAO_ServerActivator_i::get_component_servers"); + + ::Components::Deployment::ComponentServers_var retval = new + Components::Deployment::ComponentServers (this->server_infos_.size ()); + + CORBA::ULong pos = 0; + + for (SERVER_INFOS::ITERATOR i (this->server_infos_); + !i.done (); ++i) + { + retval[pos++] = + ::Components::Deployment::ComponentServer::_duplicate ((*i)->ref_); + } + + return retval._retn (); + } + + void + CIAO_ServerActivator_i::create_component_server_config_values ( + const Server_Info &, + Components::ConfigValues_out &config) + { + ACE_NEW_THROW_EX (config, + Components::ConfigValues (0), + CORBA::NO_MEMORY ()); + } + } +} + diff --git a/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h new file mode 100644 index 00000000000..8eb539e88cd --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ServerActivator_Impl.h @@ -0,0 +1,189 @@ +/** + * @file CIAO_ServerActivator_Impl.h + * @author William R. Otte + */ + +#ifndef CIAO_SERVERACTIVATOR_H_ +#define CIAO_SERVERACTIVATOR_H_ + +#include "ace/Process_Manager.h" +#include "ace/Event_Handler.h" +#include "ace/Condition_T.h" +#include "ace/OS_NS_sys_wait.h" +#include "ace/Refcounted_Auto_Ptr.h" +#include "ace/Unbounded_Set_Ex.h" +#include "tao/PortableServer/PortableServer.h" +#include "ciao/Client_init.h" +#include "ciao/ComponentServer/CIAO_CS_ClientS.h" +#include "ciao/ComponentServer/CIAO_ComponentServerC.h" +#include "ciao/ComponentServer/CIAO_CS_Client_svnt_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Deployment + { + //namespace + //{ + /** + * @brief The signal handler class for the SIGCHLD handling to avoid + * zombies + */ + class Child_Handler : public virtual ACE_Event_Handler + { + public: + virtual int handle_signal (int, + siginfo_t *, + ucontext_t *) + { + // @@ Note that this code is not portable to all OS platforms + // since it uses print statements within signal handler context. + 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; + } + }; + // } + + + /** + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * @brief Default server activator for CIAO component servers. + * + * Implements the default component server activation strategy + * which is to spawn new processes. This is not thread-safe, + * nor is it intended to be. Containers are reated serially, + * so there will be only one actor *modifying* data at a particular + * point in time. + */ + class CIAO_CS_Client_svnt_Export CIAO_ServerActivator_i + : public virtual POA_CIAO::Deployment::ServerActivator + { + public: + // Constructor + CIAO_ServerActivator_i (CORBA::ULong def_spawn_delay, + const char * default_cs_path, + const char * cs_args, + bool multithreaded, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa_); + + // Destructor + virtual ~CIAO_ServerActivator_i (void); + + virtual + void component_server_callback ( + ::Components::Deployment::ComponentServer_ptr serverref, + const char * server_UUID, + ::Components::ConfigValues_out config); + + virtual void configuration_complete (const char *server_UUID); + + virtual + ::Components::Deployment::ComponentServer_ptr + create_component_server (const ::Components::ConfigValues & config); + + virtual + void remove_component_server ( + ::Components::Deployment::ComponentServer_ptr server); + + virtual + ::Components::Deployment::ComponentServers * get_component_servers (void); + + private: + struct Server_Info; + + /// Builds command line options based on configuration information. + /// May modify the uuid of the component server. + ACE_CString construct_command_line (Server_Info &si); + + /// Spawns the component server process, but does not wait for it + /// to call back. + pid_t spawn_component_server (const Server_Info &si, + const ACE_CString &cmd_line); + + /// This method is only applicable when our program is configured as + /// singled threaded . Internally it uses a <perform_work> blocking + /// call to wait for NA object to call back + void single_threaded_wait_for_callback (const Server_Info &si, + ACE_Time_Value &timeout); + + /// This method is only applicable when our program is configured as + /// multiple threaded. Internally it waits on a conditional variable + /// that could be modified by the callback servant which runs in + /// another thread + void multi_threaded_wait_for_callback (const Server_Info &si, + ACE_Time_Value &timeout); + + void create_component_server_config_values (const Server_Info &info, + Components::ConfigValues_out &config); + + struct Server_Info + { + Server_Info (size_t cmap_size_hint = 128) + : cmap_ (new CIAO::Utility::CONFIGVALUE_MAP (cmap_size_hint)), + ref_ (Components::Deployment::ComponentServer::_nil ()), + pid_ (ACE_INVALID_PID), + activated_ (false) {} + + typedef ACE_Refcounted_Auto_Ptr <CIAO::Utility::CONFIGVALUE_MAP, + ACE_Null_Mutex> CONFIGVALUE_MAP_PTR; + + ACE_CString uuid_; + CONFIGVALUE_MAP_PTR cmap_; + Components::Deployment::ComponentServer_var ref_; + pid_t pid_; + bool activated_; + }; + + typedef ACE_Refcounted_Auto_Ptr<Server_Info, ACE_Null_Mutex> Safe_Server_Info; + + struct _server_info + { + bool operator() (const Safe_Server_Info &a, const Safe_Server_Info &b) const + { + return a->uuid_ == b->uuid_; + } + }; + + // Presumably, there won't be too many component servers per node application + typedef ACE_Unbounded_Set_Ex <Safe_Server_Info, _server_info> SERVER_INFOS; + + /// Default args to pass to all componentservers. + ACE_CString default_args_; + + SERVER_INFOS server_infos_; + + ACE_Process_Manager process_manager_; + + Child_Handler child_handler_; + + CORBA::ULong spawn_delay_; + + /////*******NEW + bool multithreaded_; + + CORBA::ORB_var orb_; + + PortableServer::POA_var poa_; + + ACE_CString cs_path_; + + ACE_CString cs_args_; + + ACE_Thread_Mutex mutex_; + + ACE_Condition<ACE_Thread_Mutex> condition_; + }; + + + } +} +#endif /* CIAO_SERVERACTIVATOR_H_ */ diff --git a/CIAO/ciao/ComponentServer/CIAO_ServerResources.idl b/CIAO/ciao/ComponentServer/CIAO_ServerResources.idl new file mode 100644 index 00000000000..751569143c0 --- /dev/null +++ b/CIAO/ciao/ComponentServer/CIAO_ServerResources.idl @@ -0,0 +1,269 @@ +// $Id$ + +/** + * @file CIAO_ServerResources.idl + * + * @brief A collection of IDL data types for + * + * @author Nanbor Wang + */ + +#if !defined (CIAO_SERVERRESOURCES_IDL) +#define CIAO_SERVERRESOURCES_IDL + +#include <orb.idl> + +module CIAO +{ + module Deployment + { + /** + * @brief A single command line argument corresponds to a string as + * in the case of "argv". + */ + typedef string CommandlineArg; + /** + * @brief A list of command line arguments which a + * NodeApplicationManager will use to start up the NodeApplication + * this list is associated to. The command line arguments will be + * appended to the command line in order. + */ + typedef sequence<CommandlineArg> CommandlineArgs; + + /** + * @brief A string containing the filename of the svc.conf file the + * NodeApplication uses. The current approach of specifying + * svc.conf filename directly some harder problems such as + * distribution of svc.conf files and the relative/absolute path to + * the svc.conf file (the ServerResrouces xml document will have to + * assume the svc.conf file will be available at specific location.) + */ + typedef string SvcconfURI; + + /** + * @brief enumeration of ORB Resource Types (ORT) supported in RT + * extension. + */ + enum ORBResourceType + { + ORT_THREADPOOL, + ORT_THREADPOOLWITHLANES, + ORT_CONNECTIONBANDS + }; + + typedef short Priority; + + /** + * @brief Define a threadpool resource that an ORB must provide + */ + struct ORS_Threadpool + { + string Id; + unsigned long stacksize; + unsigned long static_threads; + unsigned long dynamic_threads; + Priority default_priority; + boolean allow_request_buffering; + unsigned long max_buffered_requests; + unsigned long max_request_buffer_size; + }; + + typedef sequence<ORS_Threadpool> ORS_ThreadpoolSeq; + + /** + * @brief Defines the configuration of a threadpool lane. We need + * to redefine it here to avoid dependency to RTCORBA library. + */ + struct ORS_ThreadpoolLane + { + Priority lane_priority; + unsigned long static_threads; + unsigned long dynamic_threads; + }; + + /** + * @brief Defines a set of threadpool lanes. We need + * to redefine it here to avoid dependency to RTCORBA library. + */ + typedef sequence<ORS_ThreadpoolLane> ORS_ThreadpoolLanes; + + /** + * @brief Defines a Threadpool with Lanes resource that an ORB + * must provide. + */ + struct ORS_ThreadpoolWithLanes + { + string Id; + unsigned long stacksize; + ORS_ThreadpoolLanes threadpool_lanes; + boolean allow_borrowing; + boolean allow_request_buffering; + unsigned long max_buffered_requests; + unsigned long max_request_buffer_size; + }; + + typedef sequence<ORS_ThreadpoolWithLanes> ORS_ThreadpoolWithLanesSeq; + + /** + * @brief Define a priority band for BandedConnection policies. + */ + struct ORS_PriorityBand + { + Priority low; + Priority high; + }; + /** + * @brief Define a list of priority bands for BandedConnection + * policies. + */ + typedef sequence<ORS_PriorityBand> ORS_PriorityBands; + + /** + * @brief Define the information needed to create a + * BandedConnection policy. This info can be referred to via its + * name (Id). + */ + struct ORS_ConnectionBands + { + string Id; + ORS_PriorityBands bands; + }; + + typedef sequence<ORS_ConnectionBands> ORS_ConnectionBandsSeq; + + /** + * @brief Collection of resources managed by the NodeApplication + * ORB. + */ + struct ORBResource + { + ORS_ThreadpoolSeq threadpool_list; + + ORS_ThreadpoolWithLanesSeq threadpool_with_lanes_list; + + ORS_ConnectionBandsSeq connection_bands_list; + }; + + typedef sequence<ORBResource, 1> ORBResources; + + // ================================================================= + + /** + * @brief PolicyType supported by DAnCE extension. Again, we are + * redefining these value to avoid dependencies to various ORB + * modules such as RTCORBA and DiffServ policy libraries. + * @JW This is a bad thing to redefine. Maybe we have to make a seperate + * IDL lib for these libraries, but redefinition is really a bad thing + */ + const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE = 40; + const CORBA::PolicyType THREADPOOL_POLICY_TYPE = 41; + const CORBA::PolicyType PRIORITY_BANDED_CONNECTION_POLICY_TYPE = 45; + const CORBA::PolicyType CLIENT_NETWORK_PRIORITY_TYPE = 86; + const CORBA::PolicyType NETWORK_PRIORITY_TYPE = 87; + + enum PriorityModel + { + CLIENT_PROPAGATED, + SERVER_DECLARED + }; + + enum NWPriorityModel + { + CLIENT_PROPAGATED_NWPRIORITY, + SERVER_DECLARED_NWPRIORITY + }; + + /** + * @brief Defines data required for creating a PriorityModel Policy + */ + struct PriorityModelPolicyDef + { + PriorityModel priority_model; + Priority server_priority; + }; + + /** + * @brief Defines data required for creating a server side DiffServ policy + */ + struct NWPriorityModelPolicyDef + { + NWPriorityModel nw_priority_model; + long request_dscp; + long reply_dscp; + }; + + /** + * @brief Defines data required for creating a client side DiffServ policy + */ + struct CNWPriorityModelPolicyDef + { + long request_dscp; + long reply_dscp; + }; + + /** + * @brief Define data required for creating a Threadpool policy + */ + struct ThreadpoolPolicyDef + { + /// Threadpool name defined in ORBResource + string Id; + }; + + /** + * @brief Define data required for creating a PriorityBandedConnection + * policy + */ + struct PriorityBandedConnectionPolicyDef + { + /// PriorityBands name defined in ORBResource + string Id; + }; + + union PolicyDef switch (CORBA::PolicyType) + { + case PRIORITY_MODEL_POLICY_TYPE: PriorityModelPolicyDef PriorityModelDef; + case THREADPOOL_POLICY_TYPE: ThreadpoolPolicyDef ThreadpoolDef; + case PRIORITY_BANDED_CONNECTION_POLICY_TYPE: PriorityBandedConnectionPolicyDef PriorityBandedConnectionDef; + case CLIENT_NETWORK_PRIORITY_TYPE: CNWPriorityModelPolicyDef CNWPriorityModelDef; + case NETWORK_PRIORITY_TYPE: NWPriorityModelPolicyDef NWPriorityModelDef; + }; + + /** + * @brief Define a set of policy definitions. + */ + typedef sequence<PolicyDef> PolicyDefs; + + /** + * @brief A policy set is named. + */ + struct PolicySet + { + /// Name of this policy set + string Id; + PolicyDefs policies; + }; + + /** + * @brief A list of all policy sets. + */ + typedef sequence<PolicySet> PolicySets; + + struct ORBConfigs + { + ORBResources orb_resources; + PolicySets policy_set; + }; + + struct ServerResource + { + string Id; + + CommandlineArgs args; + SvcconfURI svcconf; + ORBConfigs orb_config; + }; + }; +}; + +#endif /* CIAO_SERVERRESOURCES_IDL */ diff --git a/CIAO/ciao/ComponentServer/Configurator_Factory.cpp b/CIAO/ciao/ComponentServer/Configurator_Factory.cpp new file mode 100644 index 00000000000..9027da2559b --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurator_Factory.cpp @@ -0,0 +1,48 @@ +#include "Configurator_Factory.h" + +#include "ace/Arg_Shifter.h" +#include "ciao/CIAO_common.h" +#include "Configurators/Server_Configurator.h" + +namespace CIAO +{ + namespace Deployment + { + ComponentServer_Configurator * + Configurator_Factory::operator() (int &argc, ACE_TCHAR **argv) + { + CIAO_TRACE ("Configurator_Factory::operator()"); + bool const rt = this->parse_args (argc, argv); + + ComponentServer_Configurator *ptr = 0; + ACE_NEW_THROW_EX (ptr, + ComponentServer_Configurator (rt), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return ptr; + } + + bool + Configurator_Factory::parse_args (int &argc, ACE_TCHAR **argv) + { + CIAO_TRACE ("Configurator_Factory::parse_args"); + ACE_Arg_Shifter shifter (argc, argv); + bool retval = false; + + while (shifter.is_anything_left ()) + { + if (shifter.cur_arg_strncasecmp (ACE_TEXT("-r")) == 0) + { + retval = true; + shifter.consume_arg (); + } + else + { + shifter.ignore_arg (); + } + } + return retval; + } + } +} diff --git a/CIAO/ciao/ComponentServer/Configurator_Factory.h b/CIAO/ciao/ComponentServer/Configurator_Factory.h new file mode 100644 index 00000000000..374bcb244e8 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurator_Factory.h @@ -0,0 +1,38 @@ +/** + * @file Configurator_Factory.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * @author Nanbor Wang <> + * + * Factory for creating configurators, based on old NodeApplication_Options + * class + */ + +#ifndef CIAO_CONFIGURATOR_FACTORY_H +#define CIAO_CONFIGURATOR_FACTORY_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "CIAO_ComponentServer_svnt_export.h" + +namespace CIAO +{ + namespace Deployment + { + class ComponentServer_Configurator; + + class CIAO_ComponentServer_svnt_Export Configurator_Factory + { + public: + ComponentServer_Configurator * operator () (int &argc, ACE_TCHAR **argv); + + private: + bool parse_args (int &argc, ACE_TCHAR **argv); + }; + } +} +#include /**/ "ace/post.h" + +#endif diff --git a/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp new file mode 100755 index 00000000000..97f395947d4 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.cpp @@ -0,0 +1,240 @@ +// $Id$ + +#include "Basic_Config_Manager.h" +#include "ciao/CIAO_common.h" +#include "ace/SString.h" +#include "tao/SystemException.h" +#include "tao/DiffServPolicy/DiffServPolicy.h" +#include "tao/DiffServPolicy/Client_Network_Priority_Policy.h" +#include "tao/DiffServPolicy/Server_Network_Priority_Policy.h" + +namespace CIAO +{ + namespace Deployment + { + + void + Basic_Config_Manager::init (CORBA::ORB_ptr orb) + { + this->orb_ = CORBA::ORB::_duplicate (orb); + } + + int + Basic_Config_Manager::pre_orb_initialize (void) + { + return 0; + } + + int + Basic_Config_Manager::post_orb_initialize (CORBA::ORB_ptr) + { + return 0; + } + + void + Basic_Config_Manager::init_resources + (const ServerResource &server_resource) + { + CIAO_DEBUG ((LM_DEBUG,"Basic_Config_Manager::init_resources\n")); + + if (CORBA::is_nil (this->orb_.in())) + { + CIAO_ERROR ((LM_ERROR, + "Basic_Config_Manager has not been properly initialized\n")); + throw CORBA::INTERNAL (); + } + + const PolicySets &sets = server_resource.orb_config.policy_set; + for (CORBA::ULong i = 0; i < sets.length (); ++i) + { + CORBA::ULong np = sets[i].policies.length (); + if (np == 0) + continue; + + CORBA::PolicyList_var policy_list = new CORBA::PolicyList (np); + policy_list->length (np); + CORBA::ULong index = 0; + CORBA::ULong array_index = np; + + // Create a list of policies + for (CORBA::ULong pc = 0; pc < np; ++pc) + { + CORBA::Policy_var temp_policy = + this->create_single_policy (sets[i].policies[pc]); + + if (CORBA::is_nil (temp_policy.in ())) + { + array_index = array_index - 1; + policy_list->length (array_index); + } + else + { + policy_list[index] = temp_policy; + index = index + 1; + } + } + + // Bind the policy list to the name. The bind operation should + // surrender the ownership of the newly created PolicyList + // sequence to the map. + if (array_index != 0) + { + if (this->policy_map_.bind (sets[i].Id.in (), + policy_list) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Error binding Policy_Set with name: %C\n", + sets[i].Id.in ())); + throw CORBA::INTERNAL (); + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "Basic_Config_Manager::init_resource" + " added policy set : %C with %d policies\n", + sets[i].Id.in (), array_index)); + } + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "Basic_Config_Manager::init_resource" + " added policy set : %C with %d policies\n", + sets[i].Id.in (), array_index)); + } + } + } + + bool + Basic_Config_Manager::policy_exists (const char *name) + { + if (name == 0) + { + CIAO_ERROR ((LM_ERROR, + "Invalid name string found in " + "Basic_Config_Manager::policy_exists\n")); + throw CORBA::INTERNAL (); + } + + POLICY_MAP::ENTRY *entry = 0; + + if (this->policy_map_.find (name, entry) != 0) + { + return false; + } + + return true; + } + + CORBA::PolicyList * + Basic_Config_Manager::find_policies_by_name (const char *name) + { + if (name == 0) + { + CIAO_DEBUG ((LM_DEBUG, + "Invalid name string found in find_policies_by_name\n")); + throw CORBA::INTERNAL (); + } + + POLICY_MAP::ENTRY *entry = 0; + + CORBA::PolicyList_var retv; + + if (this->policy_map_.find (name, entry) != 0) + { + CIAO_DEBUG ((LM_DEBUG, + "Unable to find a PolicyList named %C\n", + name)); + retv = 0; + } + else + { + retv = new CORBA::PolicyList (entry->int_id_.in ()); + } + return retv._retn (); + } + + CORBA::Policy_ptr + Basic_Config_Manager::create_single_policy + (const PolicyDef &policy_def) + { + CORBA::Policy_var retv; + + switch (policy_def._d ()) + { + case TAO::NETWORK_PRIORITY_TYPE: + { + const NWPriorityModelPolicyDef &nw_tmp + = policy_def.NWPriorityModelDef (); + retv = this->orb_->_create_policy (TAO::NETWORK_PRIORITY_TYPE); + + TAO::NetworkPriorityPolicy_var nw_priority = + TAO::NetworkPriorityPolicy::_narrow (retv.in ()); + + nw_priority->network_priority_model ( + (TAO::NetworkPriorityModel) nw_tmp.nw_priority_model); + + nw_priority->request_diffserv_codepoint ( + (TAO::DiffservCodepoint) nw_tmp.request_dscp); + + nw_priority->reply_diffserv_codepoint ( + (TAO::DiffservCodepoint) nw_tmp.reply_dscp); + + retv = nw_priority._retn (); + + if (! CORBA::is_nil (retv.in ())) + CIAO_DEBUG ((LM_DEBUG, + "NAConfigManager::Create NetworkPriority policy: %d\n", + nw_tmp.nw_priority_model)); + } + break; + + case TAO::CLIENT_NETWORK_PRIORITY_TYPE: + { + const CNWPriorityModelPolicyDef &cnw_tmp + = policy_def.CNWPriorityModelDef (); + retv = this->orb_->_create_policy (TAO::CLIENT_NETWORK_PRIORITY_TYPE); + + TAO::NetworkPriorityPolicy_var cnw_priority = + TAO::NetworkPriorityPolicy::_narrow (retv.in ()); + + cnw_priority->request_diffserv_codepoint ( + (TAO::DiffservCodepoint) cnw_tmp.request_dscp); + + cnw_priority->reply_diffserv_codepoint ( + (TAO::DiffservCodepoint) cnw_tmp.reply_dscp); + + retv = cnw_priority._retn (); + + if (! CORBA::is_nil (retv.in ())) + CIAO_DEBUG ((LM_DEBUG, + "NAConfigManager::Create NetworkPriority policy \n")); + } + break; + + default: + retv = 0; + } + + return retv._retn (); + } + + } +} + +using CIAO::Deployment::Config_Manager; +using CIAO::Deployment::Basic_Config_Manager; + +extern "C" Basic_Config_Manager_Export Config_Manager *create_basic_config_manager (void); + +extern "C" +{ + Config_Manager * + create_basic_config_manager (void) + { + Basic_Config_Manager *config; + ACE_NEW_RETURN (config, Basic_Config_Manager, 0); + return config; + } +} + diff --git a/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.h b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.h new file mode 100755 index 00000000000..e599cc7eb04 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.h @@ -0,0 +1,79 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Basic_Config_Manager.h + * + * $Id$ + * + */ +//============================================================================= + + +#ifndef CIAO_NACONFIG_MANAGER_H +#define CIAO_NACONFIG_MANAGER_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Null_Mutex.h" +#include "ace/SString.h" +#include "ace/Hash_Map_Manager_T.h" +#include "ciao/ComponentServer/CIAO_ServerResourcesC.h" + +#include "Config_Manager.h" +#include "Basic_Config_Manager_export.h" + +namespace CIAO +{ + namespace Deployment + { + /** + */ + class Basic_Config_Manager_Export Basic_Config_Manager + : public Config_Manager + { + public: + virtual ~Basic_Config_Manager (void) {} + + virtual int pre_orb_initialize (void); + + virtual int post_orb_initialize (CORBA::ORB_ptr o); + + virtual void init (CORBA::ORB_ptr orb); + + /// Initializing the NAResource_Config_Manager + virtual void init_resources (const ServerResource &info); + + /// Query a policy set by name + virtual CORBA::PolicyList *find_policies_by_name (const char *name); + + virtual bool policy_exists (const char *name); + + private: + /// Cached an ORB reference. + CORBA::ORB_var orb_; + + CORBA::Policy_ptr create_single_policy + (const PolicyDef &policy_def); + + /// Hash_Map stuff. + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + CORBA::PolicyList_var, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> POLICY_MAP; + + /// Internal TP names to id map. + POLICY_MAP policy_map_; + }; +} + } + +#include /**/ "ace/post.h" +#endif /* CIAO_NACONFIG_MANAGER_H */ + diff --git a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.inl b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.inl index 67203a91ff8..67203a91ff8 100755 --- a/CIAO/DAnCE/NodeApplication/NAConfig_Manager.inl +++ b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager.inl diff --git a/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager_export.h b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager_export.h new file mode 100644 index 00000000000..51cb9778168 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Basic_Config_Manager_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Basic_Config_Manager +// ------------------------------ +#ifndef BASIC_CONFIG_MANAGER_EXPORT_H +#define BASIC_CONFIG_MANAGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BASIC_CONFIG_MANAGER_HAS_DLL) +# define BASIC_CONFIG_MANAGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BASIC_CONFIG_MANAGER_HAS_DLL */ + +#if !defined (BASIC_CONFIG_MANAGER_HAS_DLL) +# define BASIC_CONFIG_MANAGER_HAS_DLL 1 +#endif /* ! BASIC_CONFIG_MANAGER_HAS_DLL */ + +#if defined (BASIC_CONFIG_MANAGER_HAS_DLL) && (BASIC_CONFIG_MANAGER_HAS_DLL == 1) +# if defined (BASIC_CONFIG_MANAGER_BUILD_DLL) +# define Basic_Config_Manager_Export ACE_Proper_Export_Flag +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BASIC_CONFIG_MANAGER_BUILD_DLL */ +# define Basic_Config_Manager_Export ACE_Proper_Import_Flag +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BASIC_CONFIG_MANAGER_BUILD_DLL */ +#else /* BASIC_CONFIG_MANAGER_HAS_DLL == 1 */ +# define Basic_Config_Manager_Export +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARATION(T) +# define BASIC_CONFIG_MANAGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BASIC_CONFIG_MANAGER_HAS_DLL == 1 */ + +// Set BASIC_CONFIG_MANAGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BASIC_CONFIG_MANAGER_NTRACE) +# if (ACE_NTRACE == 1) +# define BASIC_CONFIG_MANAGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BASIC_CONFIG_MANAGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BASIC_CONFIG_MANAGER_NTRACE */ + +#if (BASIC_CONFIG_MANAGER_NTRACE == 1) +# define BASIC_CONFIG_MANAGER_TRACE(X) +#else /* (BASIC_CONFIG_MANAGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BASIC_CONFIG_MANAGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BASIC_CONFIG_MANAGER_NTRACE == 1) */ + +#endif /* BASIC_CONFIG_MANAGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/Configurators/Basic_Configurator_export.h b/CIAO/ciao/ComponentServer/Configurators/Basic_Configurator_export.h new file mode 100644 index 00000000000..098b4c87f0d --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Basic_Configurator_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Basic_Configurator +// ------------------------------ +#ifndef BASIC_CONFIGURATOR_EXPORT_H +#define BASIC_CONFIGURATOR_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BASIC_CONFIGURATOR_HAS_DLL) +# define BASIC_CONFIGURATOR_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BASIC_CONFIGURATOR_HAS_DLL */ + +#if !defined (BASIC_CONFIGURATOR_HAS_DLL) +# define BASIC_CONFIGURATOR_HAS_DLL 1 +#endif /* ! BASIC_CONFIGURATOR_HAS_DLL */ + +#if defined (BASIC_CONFIGURATOR_HAS_DLL) && (BASIC_CONFIGURATOR_HAS_DLL == 1) +# if defined (BASIC_CONFIGURATOR_BUILD_DLL) +# define Basic_Configurator_Export ACE_Proper_Export_Flag +# define BASIC_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BASIC_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BASIC_CONFIGURATOR_BUILD_DLL */ +# define Basic_Configurator_Export ACE_Proper_Import_Flag +# define BASIC_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BASIC_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BASIC_CONFIGURATOR_BUILD_DLL */ +#else /* BASIC_CONFIGURATOR_HAS_DLL == 1 */ +# define Basic_Configurator_Export +# define BASIC_CONFIGURATOR_SINGLETON_DECLARATION(T) +# define BASIC_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BASIC_CONFIGURATOR_HAS_DLL == 1 */ + +// Set BASIC_CONFIGURATOR_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BASIC_CONFIGURATOR_NTRACE) +# if (ACE_NTRACE == 1) +# define BASIC_CONFIGURATOR_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BASIC_CONFIGURATOR_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BASIC_CONFIGURATOR_NTRACE */ + +#if (BASIC_CONFIGURATOR_NTRACE == 1) +# define BASIC_CONFIGURATOR_TRACE(X) +#else /* (BASIC_CONFIGURATOR_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BASIC_CONFIGURATOR_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BASIC_CONFIGURATOR_NTRACE == 1) */ + +#endif /* BASIC_CONFIGURATOR_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/Configurators/ComponentServer_Configurator_export.h b/CIAO/ciao/ComponentServer/Configurators/ComponentServer_Configurator_export.h new file mode 100644 index 00000000000..9793cd0ed44 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/ComponentServer_Configurator_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ComponentServer_Configurator +// ------------------------------ +#ifndef COMPONENTSERVER_CONFIGURATOR_EXPORT_H +#define COMPONENTSERVER_CONFIGURATOR_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (COMPONENTSERVER_CONFIGURATOR_HAS_DLL) +# define COMPONENTSERVER_CONFIGURATOR_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && COMPONENTSERVER_CONFIGURATOR_HAS_DLL */ + +#if !defined (COMPONENTSERVER_CONFIGURATOR_HAS_DLL) +# define COMPONENTSERVER_CONFIGURATOR_HAS_DLL 1 +#endif /* ! COMPONENTSERVER_CONFIGURATOR_HAS_DLL */ + +#if defined (COMPONENTSERVER_CONFIGURATOR_HAS_DLL) && (COMPONENTSERVER_CONFIGURATOR_HAS_DLL == 1) +# if defined (COMPONENTSERVER_CONFIGURATOR_BUILD_DLL) +# define ComponentServer_Configurator_Export ACE_Proper_Export_Flag +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* COMPONENTSERVER_CONFIGURATOR_BUILD_DLL */ +# define ComponentServer_Configurator_Export ACE_Proper_Import_Flag +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* COMPONENTSERVER_CONFIGURATOR_BUILD_DLL */ +#else /* COMPONENTSERVER_CONFIGURATOR_HAS_DLL == 1 */ +# define ComponentServer_Configurator_Export +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARATION(T) +# define COMPONENTSERVER_CONFIGURATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* COMPONENTSERVER_CONFIGURATOR_HAS_DLL == 1 */ + +// Set COMPONENTSERVER_CONFIGURATOR_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (COMPONENTSERVER_CONFIGURATOR_NTRACE) +# if (ACE_NTRACE == 1) +# define COMPONENTSERVER_CONFIGURATOR_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define COMPONENTSERVER_CONFIGURATOR_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !COMPONENTSERVER_CONFIGURATOR_NTRACE */ + +#if (COMPONENTSERVER_CONFIGURATOR_NTRACE == 1) +# define COMPONENTSERVER_CONFIGURATOR_TRACE(X) +#else /* (COMPONENTSERVER_CONFIGURATOR_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define COMPONENTSERVER_CONFIGURATOR_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (COMPONENTSERVER_CONFIGURATOR_NTRACE == 1) */ + +#endif /* COMPONENTSERVER_CONFIGURATOR_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/ComponentServer/Configurators/Config_Manager.cpp b/CIAO/ciao/ComponentServer/Configurators/Config_Manager.cpp new file mode 100644 index 00000000000..47ee45a81a4 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Config_Manager.cpp @@ -0,0 +1,11 @@ +#include "Config_Manager.h" + +namespace CIAO +{ + namespace Deployment + { + Config_Manager::~Config_Manager (void) + { + } + } +} diff --git a/CIAO/ciao/ComponentServer/Configurators/Config_Manager.h b/CIAO/ciao/ComponentServer/Configurators/Config_Manager.h new file mode 100755 index 00000000000..2ce46aa980f --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Config_Manager.h @@ -0,0 +1,53 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Config_Manager.h + * + * $Id$ + * + */ +//============================================================================= + + +#ifndef CIAO_CONFIG_MANAGER_H +#define CIAO_CONFIG_MANAGER_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/ComponentServer/CIAO_ServerResourcesC.h" + +namespace CIAO +{ + namespace Deployment + { + /** + */ + class Config_Manager + { + public: + virtual ~Config_Manager (void) {}; + + virtual int pre_orb_initialize (void) = 0; + + virtual int post_orb_initialize (CORBA::ORB_ptr o) = 0; + + virtual void init_resources (const ServerResource &info) = 0; + + virtual void init (CORBA::ORB_ptr orb) = 0; + + virtual CORBA::PolicyList *find_policies_by_name (const char *name)= 0; + + virtual bool policy_exists (const char *name) = 0; + }; + } +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_MANAGER_H */ + diff --git a/CIAO/ciao/ComponentServer/Configurators/Configurators.mpc b/CIAO/ciao/ComponentServer/Configurators/Configurators.mpc new file mode 100644 index 00000000000..4fe1a9bddd6 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Configurators.mpc @@ -0,0 +1,21 @@ +project(CIAO_Basic_Configurator) : ccm_stub, ciao_componentserver_stub, ciao_lib { + dynamicflags += COMPONENTSERVER_CONFIGURATOR_BUILD_DLL + Source_Files { + Server_Configurator.cpp + } + Header_Files { + Server_Configurator.h + } +} + +project(CIAO_Basic_Config_Manager) : ciao_lib, ciao_config_manager, ciao_componentserver_stub, \ + diffservpolicy { + dynamicflags += BASIC_CONFIG_MANAGER_BUILD_DLL + Source_Files { + Basic_Config_Manager.cpp + } + Header_Files { + Basic_Config_Manager.h + } +} + diff --git a/CIAO/DAnCE/NodeApplication/NA_Configurator_Export.h b/CIAO/ciao/ComponentServer/Configurators/NA_Configurator_Export.h index 2e30fd59cc1..2e30fd59cc1 100755 --- a/CIAO/DAnCE/NodeApplication/NA_Configurator_Export.h +++ b/CIAO/ciao/ComponentServer/Configurators/NA_Configurator_Export.h diff --git a/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.cpp b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.cpp new file mode 100644 index 00000000000..e4c377e436a --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.cpp @@ -0,0 +1,46 @@ +// $Id$ + +#include "NoOp_Configurator.h" + +namespace CIAO +{ + namespace Deployment + { + + NoOp_Configurator::~NoOp_Configurator (void) + { + // Not much to do. + } + + int + NoOp_Configurator::pre_orb_initialize () + { + return 0; + } + + int + NoOp_Configurator::post_orb_initialize (CORBA::ORB_ptr) + { + return 0; + } + + int + NoOp_Configurator::init_resource_manager + (const ::Components::ConfigValues & /*properties*/) + { + // @@ Currently do thing. We should go over the resource struct in + // the future and throw exceptions if there are + // un-recognizable/supported stuff in it. + return 0; + } + + CORBA::PolicyList * + NoOp_Configurator::find_container_policies + (const ::Components::ConfigValues & /*properties*/) + { + // Not much to do. + + return 0; + } + } +} diff --git a/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.h b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.h new file mode 100644 index 00000000000..d84715d5bca --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.h @@ -0,0 +1,66 @@ +/** $Id$ + * @file NoOp_Configurator.h + * @brief This file contains the noop configurator. + */ + +#ifndef NOOP_CONFIGURATOR_H +#define NOOP_CONFIGURATOR_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include <ccm/CCM_StandardConfiguratorC.h> + +#include "ciao/ComponentServer/Configurators/Server_Configurator.h" +#include "NoOp_Configurator_export.h" + +namespace CIAO +{ + namespace Deployment + { + /** + * @class NoOP_Configurator + * + * @brief The NoOp_Configurator doesn't do anything. + */ + class NoOp_Configurator_Export NoOp_Configurator + : public ComponentServer_Configurator + { + public: + /// Default destructor. + virtual ~NoOp_Configurator (void); + + /** + * @brief "pre_orb_initialize" is called before ORB_init. + */ + virtual int pre_orb_initialize (void); + + /** + * @brief "post_orb_initialize" is called after NodeApplication + * get a hold at this object. + */ + virtual int post_orb_initialize (CORBA::ORB_ptr o); + + /** + * @brief "init_resource_manager" is called by NodeApplication when + * it receives an "install" commands. + */ + virtual int + init_resource_manager (const ::Components::ConfigValues &properties); + + /** + * @brief get a policyset by its name. + */ + virtual CORBA::PolicyList * + find_container_policies (const ::Components::ConfigValues &properties); + }; + } +} + +#include /**/ "ace/post.h" +#endif /* NOOP_CONFIGURATOR_H */ diff --git a/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.mpc b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.mpc new file mode 100644 index 00000000000..9bd13b08b33 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator.mpc @@ -0,0 +1,13 @@ +project(CIAO_NoOp_Configurator) : ccm_stub, ciao_componentserver_stub, ciao_lib { + after += CIAO_Basic_Configurator + libs += CIAO_Basic_Configurator + dynamicflags = NOOP_CONFIGURATOR_BUILD_DLL + Source_Files { + NoOp_Configurator.cpp + } + Header_Files { + NoOp_Configurator.h + } +} + + diff --git a/CIAO/DAnCE/NodeApplication/NoOp_Configurator_export.h b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator_export.h index b6b3a9ec841..b6b3a9ec841 100644 --- a/CIAO/DAnCE/NodeApplication/NoOp_Configurator_export.h +++ b/CIAO/ciao/ComponentServer/Configurators/NoOp/NoOp_Configurator_export.h diff --git a/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.cpp b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.cpp new file mode 100644 index 00000000000..6619a445db1 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.cpp @@ -0,0 +1,513 @@ +// $Id$ + +#include "RTConfig_Manager.h" +#include "ciao/CIAO_common.h" +#include "ace/SString.h" + +#if !defined (__ACE_INLINE__) +# include "RTConfig_Manager.inl" +#endif /* __ACE_INLINE__ */ + +void +CIAO::Deployment::RTResource_Config_Manager::init (CORBA::ORB_ptr orb) +{ + CORBA::Object_var object = + orb->resolve_initial_references ("RTORB"); + this->rtorb_ = RTCORBA::RTORB::_narrow (object.in ()); +} + +int +CIAO::Deployment::RTResource_Config_Manager::pre_orb_initialize (void) +{ + return 0; +} + +int +CIAO::Deployment::RTResource_Config_Manager::post_orb_initialize (CORBA::ORB_ptr) +{ + return 0; +} + +void +CIAO::Deployment::RTResource_Config_Manager::print_resources +(const ServerResource &server_resource) +{ + const ORBResource &orb_resource + = server_resource.orb_config.orb_resources[0]; + + CORBA::ULong i; + + // Creating and binding name with RT Threadpool + for (i = 0; i < orb_resource.threadpool_list.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, + "-RTResource_Config_Manager::print_resource threadpool: %C\n" + "\tStack size: %d\n" + "\tStatic: %d\n" + "\tDynamic %d\n" + "\tDefault Prio: %d\n" + "\tBuffering %C\n" + "\tMax Buffered: %d\n" + "\tBuffer Size %d\n", + orb_resource.threadpool_list[i].Id.in (), + orb_resource.threadpool_list[i].stacksize, + orb_resource.threadpool_list[i].static_threads, + orb_resource.threadpool_list[i].dynamic_threads, + orb_resource.threadpool_list[i].default_priority, + (orb_resource.threadpool_list[i].allow_request_buffering ? "Y" : "N"), + orb_resource.threadpool_list[i].max_buffered_requests, + orb_resource.threadpool_list[i].max_request_buffer_size)); + } + + for (i = 0; i < orb_resource.threadpool_with_lanes_list.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, + "-RTResource_Config_Manager::print_resource threadpool_with %d, lanes: %C\n", + orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (), + orb_resource.threadpool_with_lanes_list[i].Id.in ())); + + for (CORBA::ULong l = 0; + l < orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (); + ++l) + { + CIAO_DEBUG ((LM_DEBUG, + "\tLane %d:\n" + "\t\tPriority: %d\n" + "\t\tStatic: %d\n" + "\t\tDynamic: %d\n", + l, + orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].lane_priority, + orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].static_threads, + orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].dynamic_threads)); + } + CIAO_DEBUG ((LM_DEBUG, + "\tStack size: %d\n" + "\tBorrowing: %C\n" + "\tBuffering %C\n" + "\tMax Buffered: %d\n" + "\tBuffer Size %d\n", + orb_resource.threadpool_with_lanes_list[i].stacksize, + (orb_resource.threadpool_with_lanes_list[i].allow_borrowing ? "Y" : "N"), + (orb_resource.threadpool_with_lanes_list[i].allow_request_buffering ? "Y" : "N"), + orb_resource.threadpool_with_lanes_list[i].max_buffered_requests, + orb_resource.threadpool_with_lanes_list[i].max_request_buffer_size)); + } + + for (i = 0; i < orb_resource.connection_bands_list.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, + "-RTResource_Config_Manager::print_resource connection %d bands: %C\n", + orb_resource.connection_bands_list[i].bands.length (), + orb_resource.connection_bands_list[i].Id.in ())); + + for (CORBA::ULong l = 0; + l < orb_resource.connection_bands_list[i].bands.length (); + ++l) + { + CIAO_DEBUG ((LM_DEBUG, + "\tBand %d Prio: %d -- %d\n", + l, + orb_resource.connection_bands_list[i].bands[l].low, + orb_resource.connection_bands_list[i].bands[l].high)); + } + } +} + +void +CIAO::Deployment::RTResource_Config_Manager::init_resources +(const ServerResource &server_resource) +{ + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource.\n")); + + if (CORBA::is_nil (this->rtorb_.in())) + { + CIAO_ERROR ((LM_ERROR, + "RTResource_Config_Manager has not been properly initialized.\n")); + throw CORBA::INTERNAL (); + } + + this->print_resources (server_resource); + // return; + + const ORBResource &orb_resource + = server_resource.orb_config.orb_resources[0]; + + CORBA::ULong i; + + // Creating and binding name with RT Threadpool + for (i = 0; i < orb_resource.threadpool_list.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource threadpool: %C\n", + orb_resource.threadpool_list[i].Id.in ())); + RTCORBA::ThreadpoolId thr_id = + this->rtorb_->create_threadpool + (orb_resource.threadpool_list[i].stacksize, + orb_resource.threadpool_list[i].static_threads, + orb_resource.threadpool_list[i].dynamic_threads, + orb_resource.threadpool_list[i].default_priority, + orb_resource.threadpool_list[i].allow_request_buffering, + orb_resource.threadpool_list[i].max_buffered_requests, + orb_resource.threadpool_list[i].max_request_buffer_size); + // Simply pass back the exception here + // for now. We need to have a better way + // to handle execption here. + if (this->threadpool_map_.bind (orb_resource.threadpool_list[i].Id.in (), + thr_id) != 0) + { + CIAO_ERROR ((LM_ERROR, "Error binding thread pool Id: %C to map when initializing RTNodeApplication resources.\n", orb_resource.threadpool_list[i].Id.in ())); + throw CORBA::INTERNAL (); + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource added thread pool: %C\n", + orb_resource.threadpool_list[i].Id.in ())); + } + } + + for (i = 0; i < orb_resource.threadpool_with_lanes_list.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource threadpool_with %d, lanes: %C\n", + orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (), + orb_resource.threadpool_with_lanes_list[i].Id.in ())); + + // Duplicate RTCORBA lanes + RTCORBA::ThreadpoolLanes lanes + (orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length ()); + lanes.length (orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length ()); + + for (CORBA::ULong l = 0; + l < orb_resource.threadpool_with_lanes_list[i].threadpool_lanes.length (); + ++l) + { + lanes[l].lane_priority + = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].lane_priority; + lanes[l].static_threads + = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].static_threads; + lanes[l].dynamic_threads + = orb_resource.threadpool_with_lanes_list[i].threadpool_lanes[l].dynamic_threads; + } + + RTCORBA::ThreadpoolId thr_id = + this->rtorb_->create_threadpool_with_lanes + (orb_resource.threadpool_with_lanes_list[i].stacksize, + lanes, + orb_resource.threadpool_with_lanes_list[i].allow_borrowing, + orb_resource.threadpool_with_lanes_list[i].allow_request_buffering, + orb_resource.threadpool_with_lanes_list[i].max_buffered_requests, + orb_resource.threadpool_with_lanes_list[i].max_request_buffer_size); + // Simply pass back the exception here + // for now. We need to have a better way + // to handle execption here. + + if (this->threadpool_map_.bind (orb_resource.threadpool_with_lanes_list[i].Id.in (), + thr_id) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Error binding thread pool name: %C to map when " + "initializing RTNodeApplication resources.\n", + orb_resource.threadpool_with_lanes_list[i].Id.in ())); + throw CORBA::INTERNAL (); + } + + else + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource added thread pool with lanes: %C\n", + orb_resource.threadpool_with_lanes_list[i].Id.in ())); + } + } + + for (i = 0; i < orb_resource.connection_bands_list.length (); ++i) + { + RTCORBA::PriorityBands + safebands(orb_resource.connection_bands_list[i].bands.length ()); + safebands.length (orb_resource.connection_bands_list[i].bands.length ()); + + for (CORBA::ULong l = 0; + l < orb_resource.connection_bands_list[i].bands.length (); + ++l) + { + safebands[l].low = orb_resource.connection_bands_list[i].bands[l].low; + safebands[l].high = orb_resource.connection_bands_list[i].bands[l].high; + } + + if (this->priority_bands_map_.bind (orb_resource.connection_bands_list[i].Id.in (), + safebands) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Error binding priority bands name: %C to map " + "when initializing RTNodeApplication resources.\n", + orb_resource.connection_bands_list[i].Id.in ())); + throw CORBA::INTERNAL (); + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource added connection bands: %C\n", + orb_resource.connection_bands_list[i].Id.in ())); + } + } + + // now initialize the policy set part of it. + // server_resource.orb_config.policy_set + const PolicySets &sets = server_resource.orb_config.policy_set; + for (CORBA::ULong i = 0; i < sets.length (); ++i) + { + CORBA::ULong const np = sets[i].policies.length (); + if (np == 0) + continue; + + CORBA::PolicyList_var policy_list = new CORBA::PolicyList (np); + policy_list->length (np); + CORBA::ULong index = 0; + CORBA::ULong array_index = np; + + // Create a list of policies + for (CORBA::ULong pc = 0; pc < np; ++pc) + { + CORBA::Policy_var temp_policy = + this->create_single_policy (sets[i].policies[pc]); + if (CORBA::is_nil (temp_policy.in ())) + { + array_index = array_index - 1; + policy_list->length (array_index); + } + else + { + policy_list[index] = CORBA::Policy::_duplicate (temp_policy.in ()); + index = index + 1; + } + } + + // Bind the policy list to the name. The bind operation should + // surrender the ownership of the newly created PolicyList + // sequence to the map. + if (array_index != 0) + { + if (this->policy_map_.bind (sets[i].Id.in (), + policy_list._retn ()) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Error binding Policy_Set with name: %C\n", + sets[i].Id.in ())); + throw CORBA::INTERNAL (); + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource " + "added policy set: %C with %d policies\n", + sets[i].Id.in (), array_index)); + } + } + else + { + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::init_resource " + "added policy set: %C with %d policies\n", + sets[i].Id.in (), array_index)); + } + } +} + +void +CIAO::Deployment::RTResource_Config_Manager::fini () +{ + TP_MAP::ITERATOR iter = this->threadpool_map_.begin (); + TP_MAP::ITERATOR end = this->threadpool_map_.end (); + + for (; iter != end; ++iter) + { + this->rtorb_->destroy_threadpool ((*iter).int_id_); + } + +} + +RTCORBA::ThreadpoolId +CIAO::Deployment::RTResource_Config_Manager::find_threadpool_by_name (const char *name) +{ + if (name == 0) + { + CIAO_ERROR ((LM_ERROR, + "Invalid name string found in \"find_threadpool_by_name\"\n")); + throw CORBA::BAD_PARAM (); + } + + + RTCORBA::ThreadpoolId ret_id = 0; // return id + + if (this->threadpool_map_.find (name, ret_id) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Unable to find a threadpool named %C\n", + name)); + throw CORBA::INTERNAL (); + } + + return ret_id; +} + +RTCORBA::PriorityBands * +CIAO::Deployment::RTResource_Config_Manager::find_priority_bands_by_name (const char *name) +{ + if (name == 0) + { + CIAO_ERROR ((LM_ERROR, + "Invalid name string found in \"find_priority_bands_by_name\"\n")); + throw CORBA::BAD_PARAM (); + } + + PB_MAP::ENTRY *entry = 0; + + if (this->priority_bands_map_.find (name, entry) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Unable to find a connection bands named %C\n", + name)); + throw CORBA::INTERNAL (); + } + + RTCORBA::PriorityBands_var retv = new RTCORBA::PriorityBands; + (*retv.ptr ()) = (*entry->int_id_.ptr ()); + return retv._retn (); +} + +bool +CIAO::Deployment::RTResource_Config_Manager::policy_exists (const char *name) +{ + if (name == 0) + { + CIAO_DEBUG ((LM_DEBUG, + "Invalid name string found in " + "CIAO::Deployment::NAResource_Config_Manager::policy_exists\n")); + throw CORBA::INTERNAL (); + } + + POLICY_MAP::ENTRY *entry = 0; + + if (this->policy_map_.find (name, entry) != 0) + { + return false; + } + + return true; +} + +CORBA::PolicyList * +CIAO::Deployment::RTResource_Config_Manager::find_policies_by_name (const char *name) +{ + if (name == 0) + { + CIAO_ERROR ((LM_ERROR, + "Invalid name string found in \"find_policies_by_name\"\n")); + throw CORBA::BAD_PARAM (); + } + + + CIAO_DEBUG ((LM_DEBUG, "RTResource_Config_Manager::find_policies_by_name: %C\n", + name)); + + POLICY_MAP::ENTRY *entry = 0; + + if (this->policy_map_.find (name, entry) != 0) + { + CIAO_ERROR ((LM_ERROR, + "Unable to find a PolicyList named %C\n", + name)); + throw CORBA::INTERNAL (); + } + + // duplicate the sequence PolicyList. + CORBA::PolicyList_var retv = + new CORBA::PolicyList (entry->int_id_.in ()); + + CIAO_DEBUG ((LM_DEBUG, "RTResource_Config_Manager::find_policies_by_name ok.\n")); + + return retv._retn (); +} + +CORBA::Policy_ptr +CIAO::Deployment::RTResource_Config_Manager::create_single_policy +(const PolicyDef &policy_def) +{ + // if (CIAO::Deployment::debug_level () > 9) + CIAO_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager::create_single_policy: %d\n", + policy_def._d ())); + + CORBA::Policy_var retv; + + switch (policy_def._d ()) + { + case RTCORBA::PRIORITY_MODEL_POLICY_TYPE: + { + const PriorityModelPolicyDef &tmp + = policy_def.PriorityModelDef (); + + retv = this->rtorb_->create_priority_model_policy ((RTCORBA::PriorityModel) tmp.priority_model, + tmp.server_priority); + + if (! CORBA::is_nil (retv.in ())) + CIAO_DEBUG ((LM_DEBUG, + "Create PriorityModel policy: %d - %d\n", + tmp.priority_model, tmp.server_priority)); + } + break; + + case RTCORBA::THREADPOOL_POLICY_TYPE: + { + RTCORBA::ThreadpoolId tpid = + this->find_threadpool_by_name (policy_def.ThreadpoolDef().Id.in ()); + + retv = this->rtorb_->create_threadpool_policy (tpid); + + if (! CORBA::is_nil (retv.in ())) + CIAO_DEBUG ((LM_DEBUG, + "Create Threadpool policy: %C, TPid: %d\n", + policy_def.ThreadpoolDef().Id.in (), tpid)); + } + break; + + case RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE: + { + RTCORBA::PriorityBands_var bands = + this->find_priority_bands_by_name (policy_def.PriorityBandedConnectionDef().Id.in ()); + + retv = + this->rtorb_->create_priority_banded_connection_policy (bands.in ()); + + if (! CORBA::is_nil (retv.in ())) + { + CIAO_DEBUG ((LM_DEBUG, + "Created Banded Connection policy: %C\n", + policy_def.PriorityBandedConnectionDef().Id.in ())); + } + } + break; + + default: + retv = 0; + } + + return retv._retn (); +} + +CIAO::Deployment::RTResource_Config_Manager::~RTResource_Config_Manager () +{ + this->fini (); +} + +extern "C" CIAO_RTNA_Configurator_Export CIAO::Deployment::Config_Manager +*create_rt_config_manager (void); + +CIAO::Deployment::Config_Manager * +create_rt_config_manager (void) +{ + CIAO::Deployment::RTResource_Config_Manager *config; + ACE_NEW_RETURN (config, CIAO::Deployment::RTResource_Config_Manager, 0); + return config; +} diff --git a/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.h b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.h new file mode 100644 index 00000000000..071536a5fc6 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.h @@ -0,0 +1,138 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file RTConfig_Manager.h + * + * $Id$ + * + * This file contains classes that manage name to configuration + * mapping info in a RTComponentServer. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= + + +#ifndef CIAO_RTCONFIG_MANAGER_H +#define CIAO_RTCONFIG_MANAGER_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Null_Mutex.h" +#include "ace/SString.h" +#include "ace/Hash_Map_Manager_T.h" +#include "tao/RTCORBA/RTCORBA.h" +#include "ciao/ComponentServer/CIAO_ServerResourcesC.h" + +#include "ciao/ComponentServer/Configurators/Config_Manager.h" +#include "RTNA_Configurator_Export.h" + +namespace CIAO +{ + namespace Deployment + { + /** + * @brief RTResource_Config_Manager maintains a collection of + * RTCORBA related resources. + * + * This class is responsible to create and manage a list of RTCORBA + * related resources that are global to an RT ComponentServer. The + * information required to create and configure these resources are + * passed in via the @a info argument in the @c init method. These + * resources are identified by names and can be used to associate + * these resources with related RTPolicies. These resources are + * destoryed along with this class. + * + * Currently, the only resources supported (and managed) by this + * class are Threadpool and Threadpool_with_Lanes. + */ + class RTResource_Config_Manager : public Config_Manager + { + public: + RTResource_Config_Manager (void); + ~RTResource_Config_Manager (void); + + virtual void init (CORBA::ORB_ptr orb); + + virtual int pre_orb_initialize (void); + + virtual int post_orb_initialize (CORBA::ORB_ptr o); + + /// Initializing the RTResource_Config_Manager + virtual void init_resources (const ServerResource &info); + + /// Finalizing the RTResource_Config_Manager and the resources it + /// manages. + void fini (); + + /// Query a policy set by name + virtual CORBA::PolicyList *find_policies_by_name (const char *name); + + virtual bool policy_exists (const char *name); + + protected: + void print_resources (const ServerResource &info); + + /// Query a thread pool by name. + RTCORBA::ThreadpoolId find_threadpool_by_name (const char *name); + + + /// Query a priority bands info by name. + RTCORBA::PriorityBands *find_priority_bands_by_name (const char *name); + + private: + /// Cached an ORB reference. + CORBA::ORB_var orb_; + + // Cached an RTORB reference. + RTCORBA::RTORB_var rtorb_; + + /// Hash_Map stuff. + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + RTCORBA::ThreadpoolId, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> TP_MAP; + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + RTCORBA::PriorityBands_var, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> PB_MAP; + + /// Internal TP name to id map. + TP_MAP threadpool_map_; + + /// Internal PB name to priority bands map. + PB_MAP priority_bands_map_; + + /// create a single policy + CORBA::Policy_ptr create_single_policy + (const PolicyDef &policy_def); + + /// Hash_Map stuff. + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + CORBA::PolicyList_var, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> POLICY_MAP; + + /// Internal TP names to id map. + POLICY_MAP policy_map_; +}; +} +} + +#if defined (__ACE_INLINE__) +# include "RTConfig_Manager.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* CIAO_RTCONFIG_MANAGER_H */ + diff --git a/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.inl b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.inl new file mode 100644 index 00000000000..08aaef9f6ad --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/RT/RTConfig_Manager.inl @@ -0,0 +1,8 @@ +// $Id$ + + +ACE_INLINE +CIAO::Deployment::RTResource_Config_Manager::RTResource_Config_Manager () +{ +} + diff --git a/CIAO/DAnCE/NodeApplication/RTNA_Configurator_Export.h b/CIAO/ciao/ComponentServer/Configurators/RT/RTNA_Configurator_Export.h index 689a871c7e5..689a871c7e5 100644 --- a/CIAO/DAnCE/NodeApplication/RTNA_Configurator_Export.h +++ b/CIAO/ciao/ComponentServer/Configurators/RT/RTNA_Configurator_Export.h diff --git a/CIAO/ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp b/CIAO/ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp new file mode 100644 index 00000000000..91e8a3b3f36 --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/RTNodeApp_Configurator.cpp @@ -0,0 +1,108 @@ +// $Id$ + +#include "RTNodeApp_Configurator.h" +#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" +#include "tao/RTPortableServer/RTPortableServer.h" + +CIAO::RTNodeApp_Configurator::~RTNodeApp_Configurator () +{ +} + +int +CIAO::RTNodeApp_Configurator::pre_orb_initialize () +{ + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::pre_orb_init\n")); + + return 0; +} + +int +CIAO::RTNodeApp_Configurator::post_orb_initialize (CORBA::ORB_ptr o) +{ + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::post_orb_init\n")); + + this->orb_ = CORBA::ORB::_duplicate (o); + + CORBA::Object_var object = + this->orb_->resolve_initial_references ("RTORB"); + + this->rtorb_ = + RTCORBA::RTORB::_narrow (object.in ()); + + this->config_manager_.init (this->rtorb_.in ()); + + return 0; +} + +int +CIAO::RTNodeApp_Configurator::init_resource_manager +(const ::Deployment::Properties &properties) +{ + + // if (CIAO::debug_level () > 9) + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::init_resource_manager\n")); + // @@ Should we cache the properties that we consumed here? + + for (CORBA::ULong i = 0; i < properties.length (); ++i) + { + // if (CIAO::debug_level () > 9) + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::init_resource_manager processing property: %C\n", + properties[i].name.in ())); + + if (ACE_OS::strcmp ("CIAOServerResources", properties[i].name.in ()) == 0) + { + const CIAO::DAnCE::ServerResource *svr_resource; + if (properties[i].value >>= svr_resource) + { + this->config_manager_.init_resources (*svr_resource); + // Now we have the information to initialize the manager. + } + else + CIAO_ERROR_RETURN ((LM_ERROR, + "ERROR: RTNodeApp_Configurator::init_resource_manager unable to extract CIAOServerResources\n"), -1); + } + + // Ignore other stuff + } + + return 0; +} + +CORBA::PolicyList * +CIAO::RTNodeApp_Configurator::find_container_policies +(const ::Deployment::Properties &properties) +{ + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::find_container_policies\n")); + // @@ Should we cache the properties that we consumed here? + + for (CORBA::ULong i = 0; i < properties.length (); ++i) + { + CIAO_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::find_container_policies processing property: %C\n", + properties[i].name.in ())); + + if (ACE_OS::strcmp ("ContainerPolicySet", properties[i].name) == 0) + { + const char *policy_name = 0; + if (properties[i].value >>= policy_name) + { + return this->config_manager_.find_policies_by_name (policy_name); + } + else + CIAO_ERROR_RETURN ((LM_ERROR, + "ERROR: RTNodeApp_Configurator::find_container_policies unable to extract ContainerPolicySet\n"), 0); + } + } + + return 0; +} + + +extern "C" CIAO_RTNA_Configurator_Export CIAO::NodeApp_Configurator *create_nodeapp_configurator (void); + +CIAO::NodeApp_Configurator * +create_nodeapp_configurator (void) +{ + CIAO::RTNodeApp_Configurator *config = 0; + ACE_NEW_RETURN (config, CIAO::RTNodeApp_Configurator, 0); + return config; +} diff --git a/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h b/CIAO/ciao/ComponentServer/Configurators/RTNodeApp_Configurator.h index fc2388b6aff..fc2388b6aff 100644 --- a/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h +++ b/CIAO/ciao/ComponentServer/Configurators/RTNodeApp_Configurator.h diff --git a/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.cpp b/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.cpp new file mode 100755 index 00000000000..406817972de --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.cpp @@ -0,0 +1,334 @@ +// $Id$ + +#include "Server_Configurator.h" +#include "ace/Log_Msg.h" +#include "ciao/CIAO_common.h" +#include "ciao/ComponentServer/CIAO_ServerResourcesC.h" + +namespace CIAO +{ + namespace Deployment + { + + ComponentServer_Configurator::ComponentServer_Configurator (bool rt) + : rt_support_ (rt) + { + } + + ComponentServer_Configurator::~ComponentServer_Configurator (void) + { + // Not much to do. + } + + void + ComponentServer_Configurator::set_rt_support (void) + { + this->rt_support_ = 1; + } + + bool + ComponentServer_Configurator::rt_support (void) + { + return this->rt_support_; + } + + bool + ComponentServer_Configurator::create_config_managers (void) + { + typedef CIAO::Deployment::Config_Manager * (*na_intelligent_designer)(void); + typedef CIAO::Deployment::Config_Manager * (*rtna_intelligent_designer)(void); + CIAO::Deployment::Config_Manager* ptr = 0; + CIAO::Deployment::Config_Manager* rt_ptr = 0; + + int retval = this->config_dll_.open (/*ACE_DLL_PREFIX*/ ACE_TEXT ("CIAO_Basic_Config_Manager"), + ACE_DEFAULT_SHLIB_MODE, + 0); + + if (0 != retval) + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ComponentServer_Configurator - Error loading CIAO_Basic_Config_manager DLL: %p\n", + "dll.open"), + false); + } + + // Cast the void* to non-pointer type first - it's not legal to + // cast a pointer-to-object directly to a pointer-to-function. + void *void_ptr = + this->config_dll_.symbol (ACE_TEXT ("create_basic_config_manager")); + + ptrdiff_t tmp = reinterpret_cast<ptrdiff_t> (void_ptr); + + // "id" is for na_intelligent-designer. + na_intelligent_designer config_id = + reinterpret_cast<na_intelligent_designer> (tmp); + + if (0 == config_id) + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ComponentServer_Configurator - Error loading CIAO_Basic_Configurator entrypoint: %p\n", + "dll.symbol"), + false); + } + + ptr = config_id (); + + if (0 == ptr) + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ComponentServer_Configurator: Error creating ComponentServer_Configurator\n"), + false); + } + + this->na_config_manager_.reset (ptr); + + if (this->rt_support_) + { + int rt_retval = this->config_dll_.open (ACE_DLL_PREFIX ACE_TEXT ("CIAO_RTNA_Configurator"), + ACE_DEFAULT_SHLIB_MODE, + false); + + if (0 != rt_retval) + { + CIAO_ERROR_RETURN ((LM_ERROR, + "ComponentServer_Configurator - Error while loading CIAO_RTNA_Configurator: %p\n", + "dll.open"), + false); + } + + // Cast the void* to non-pointer type first - it's not legal to + // cast a pointer-to-object directly to a pointer-to-function. + void *rt_void_ptr = + this->config_dll_.symbol (ACE_TEXT ("create_rt_config_manager")); + ptrdiff_t rt_tmp = reinterpret_cast<ptrdiff_t> (rt_void_ptr); + + // "id" is for na_intelligent-designer. + rtna_intelligent_designer rt_config_id = + reinterpret_cast<rtna_intelligent_designer> (rt_tmp); + + if (0 == rt_config_id) + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ComponentServer_Configurator: Error while using RTNA entrypoint: %p", + "dll.symbol"), + false); + } + + rt_ptr = rt_config_id (); + + if (0 == rt_ptr) + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ComponentServer_Configurator: Error creating RTComponentServer_Configurator\n"), + false); + } + + this->rt_config_manager_.reset (rt_ptr); + } + + return true; + } + + int + ComponentServer_Configurator::pre_orb_initialize () + { + CIAO_DEBUG ((LM_TRACE,CLINFO "ComponentServer_Configurator::pre_orb_init\n")); + + (*this->na_config_manager_.get ()).pre_orb_initialize (); + if (this->rt_support_) + { + (*this->rt_config_manager_.get ()).pre_orb_initialize (); + } + + return 0; + } + + int + ComponentServer_Configurator::post_orb_initialize (CORBA::ORB_ptr o) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "ComponentServer_Configurator::post_orb_init\n")); + this->orb_ = CORBA::ORB::_duplicate (o); + + (*this->na_config_manager_.get ()).init (this->orb_.in ()); + if (this->rt_support_ == 1) + { + (*this->rt_config_manager_.get ()).init (this->orb_.in ()); + } + + (*this->na_config_manager_.get ()).post_orb_initialize (this->orb_.in ()); + if (this->rt_support_ == 1) + { + (*this->rt_config_manager_.get ()).post_orb_initialize (this->orb_.in ()); + } + + return 0; + } + + int + ComponentServer_Configurator::init_resource_manager + (const ::Components::ConfigValues &properties) + { + for (CORBA::ULong i = 0; i < properties.length (); ++i) + { + if (ACE_OS::strcmp ("CIAOServerResources", properties[i]->name ()) == 0) + { + const ServerResource *svr_resource; + if (properties[i]->value () >>= svr_resource) + { + (*this->na_config_manager_.get ()). + init_resources (*svr_resource); + + if (this->rt_support_ == 1) + { + (*this->rt_config_manager_.get ()). + init_resources (*svr_resource); + } + } + else + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ERROR: ComponentServer_Configurator::" + "init_resource_manager unable to extract" + "CIAOServerResources\n"), -1); + } + } + } + + return 0; + } + + CORBA::PolicyList * + ComponentServer_Configurator::find_container_policies + (const ::Components::ConfigValues &properties) + { + if (!this->na_config_manager_.get ()) + return 0; + + CORBA::PolicyList *configured_policies = 0; + CORBA::PolicyList *rt_configured_policies = 0; + + for (CORBA::ULong i = 0; i < properties.length (); ++i) + { + if (ACE_OS::strcmp ("ContainerPolicySet", properties[i]->name ()) == 0) + { + const char *policy_name; + if (properties[i]->value () >>= policy_name) + { + configured_policies = (*this->na_config_manager_.get ()). + find_policies_by_name (policy_name); + + CORBA::ULong p_length = 0; + if (configured_policies != 0) + { + p_length = configured_policies->length (); + } + + if (this->rt_support_ == 1) + { + rt_configured_policies = (*this->rt_config_manager_.get ()). + find_policies_by_name (policy_name); + } + + CORBA::PolicyList_var temp_policies; + CORBA::ULong rtp_length = 0; + if (rt_configured_policies != 0) + { + rtp_length = rt_configured_policies->length (); + temp_policies = rt_configured_policies; + } + else + { + return configured_policies; + } + + CORBA::ULong final_length = p_length + rtp_length; + temp_policies->length (final_length); + + for (CORBA::ULong i = 0; i < p_length; ++i) + { + temp_policies[i+rtp_length] = + CORBA::Policy::_duplicate ((*configured_policies)[i]); + } + return temp_policies._retn (); + } + else + { + CIAO_ERROR_RETURN ((LM_ERROR, + CLINFO "ERROR: ComponentServer_Configurator:" + "find_container_policies unable to extract" + "ContainerPolicySet\n"), 0); + } + } + } + return 0; + } + + CORBA::PolicyList * + ComponentServer_Configurator::find_policies_by_name (const char *policy_name) + { + if (!this->na_config_manager_.get ()) + return 0; + + CORBA::PolicyList *configured_policies = 0; + CORBA::PolicyList *rt_configured_policies = 0; + + configured_policies = (*this->na_config_manager_.get ()). + find_policies_by_name (policy_name); + + CORBA::ULong p_length = 0; + if (configured_policies != 0) + { + p_length = configured_policies->length (); + } + + if (this->rt_support_ == 1) + { + rt_configured_policies = (*this->rt_config_manager_.get ()). + find_policies_by_name (policy_name); + } + + CORBA::PolicyList_var temp_policies; + CORBA::ULong rtp_length = 0; + if (rt_configured_policies != 0) + { + rtp_length = rt_configured_policies->length (); + temp_policies = rt_configured_policies; + } + else + { + return configured_policies; + } + + CORBA::ULong final_length = p_length + rtp_length; + temp_policies->length (final_length); + + for (CORBA::ULong i = 0; i < p_length; ++i) + { + temp_policies[i+rtp_length] = + CORBA::Policy::_duplicate ((*configured_policies)[i]); + } + return temp_policies._retn (); + } + + bool + ComponentServer_Configurator::policy_exists (const char *policy_set_id) + { + if (!this->na_config_manager_.get ()) + return 0; + + bool result; + result = (*this->na_config_manager_.get ()). + policy_exists (policy_set_id); + + if (result == false) + { + if (this->rt_support_ == 1) + { + result = (*this->rt_config_manager_.get ()). + policy_exists (policy_set_id); + } + } + return result; + } + } +} diff --git a/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.h b/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.h new file mode 100644 index 00000000000..0943afb71ac --- /dev/null +++ b/CIAO/ciao/ComponentServer/Configurators/Server_Configurator.h @@ -0,0 +1,125 @@ +//$Id$ +/**======================================================== + * + * @file Server_Configurator.h + * + * @Brief This file contains the implementation of + * the basic ComponentServer_Configurator interface, the one + * that does nothing more + * + * @author Nanbor Wang <nanbor@exothermic.txcorp.com> + *========================================================*/ + +#ifndef COMPONENTSERVER_CONFIGURATOR_H +#define COMPONENTSERVER_CONFIGURATOR_H +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/DLL.h" +#include "ace/Auto_Ptr.h" +#include "ccm/CCM_StandardConfiguratorC.h" +#include "ComponentServer_Configurator_export.h" +#include "Config_Manager.h" + +namespace CIAO +{ + namespace Deployment + { + /** + * + * @class ComponentServer_Configurator + * + * @brief This class defines and implements the default + * ComponentServer_Configurator base class that's needed for configuring the + * ComponentServer application process. + **/ + class ComponentServer_Configurator_Export ComponentServer_Configurator + { + public: + + /// Default constructor. + ComponentServer_Configurator (bool rt); + + /// Default destructor. + virtual ~ComponentServer_Configurator (void); + + /** + * @brief "pre_orb_initialize" is called before ORB_init. + */ + virtual int pre_orb_initialize (void); + + /** + * @brief "post_orb_initialize" is called after ComponentServer + * get a hold at this object. + */ + virtual int post_orb_initialize (CORBA::ORB_ptr o); + + /** + * @brief "init_resource_manager" is called by ComponentServer when + * it receives an "install" commands. + */ + virtual int + init_resource_manager (const ::Components::ConfigValues &properties); + + /** + * @brief get a policyset by its name. + */ + virtual CORBA::PolicyList * + find_container_policies (const ::Components::ConfigValues &properties); + + /// @@ Perhaps we also need a finalizer method here. Perhaps we + /// even need to differentiate finalizer before ORB is destroyed + /// and the one after that. + + bool rt_support (void); + + void set_rt_support (void); + + virtual bool create_config_managers (void); + + bool policy_exists (const char *policy_set_id); + + CORBA::PolicyList * + find_policies_by_name (const char *name); + + protected: + + int rt_support_; + + CORBA::ORB_var orb_; + + auto_ptr<Config_Manager> rt_config_manager_; + + auto_ptr<Config_Manager> na_config_manager_; + + ACE_DLL config_dll_; + }; + } +} + +/** + * For dynamically linkable concrete ComponentServer_Configurator + * implementation, remember to create a factory method using "C" + * calling convention in the CPP file as follow: + + extern "C" EXPORT_MACRO CIAO::ComponentServer_Configurator *create_nodeapp_configurator (void); + + CIAO::ComponentServer_Configurator * + create_nodeapp_configurator (void) + { + concrete_ComponentServer_Configurator *config; + ACE_NEW_RETURN (config, concrete_ComponentServer_Configurator, 0); + return config; + } + +*/ + + +#include /**/ "ace/post.h" +#endif /* NODEAPP_CONFIGURATOR_H */ + diff --git a/CIAO/ciao/Components.idl b/CIAO/ciao/Components.idl deleted file mode 100644 index f58740eae6a..00000000000 --- a/CIAO/ciao/Components.idl +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -/** - * @@ This file is included in the generated executor - * mapping IDL file, and for now just includes - * CCM_Container.idl. - */ - -#if !defined (CIAO_COMPONENTS_IDL) -#define CIAO_COMPONENTS_IDL - -#include "ciao/CCM_Component.idl" -#include "ciao/CCM_KeylessCCMHome.idl" -#include "ciao/CCM_Home.idl" -#include "ciao/CCM_Object.idl" - -#endif /* CIAO_COMPONENTS_IDL */ - diff --git a/CIAO/ciao/Container_Base.cpp b/CIAO/ciao/Container_Base.cpp deleted file mode 100644 index 90e24c580e6..00000000000 --- a/CIAO/ciao/Container_Base.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#include "Container_Base.h" -#include "CIAO_common.h" - -#if !defined (__ACE_INLINE__) -# include "Container_Base.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - //////////////////////////////////////////////////////////////// - - Container::Container (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)), - container_impl_ (0) - { - } - - Container::Container (CORBA::ORB_ptr o, Container_Impl *container_impl) - : orb_ (CORBA::ORB::_duplicate (o)), - container_impl_ (container_impl) - { - } - - Container::~Container (void) - { - } - - CORBA::PolicyList - Container::get_receptacle_policy (const char* name) - { - CORBA::PolicyList policy_list; - - if (this->rec_pol_map_.find (name, policy_list) != 0) - { - ACE_DEBUG ((LM_DEBUG, - "Unable to find policies " - "for the receptacle %s\n", - name)); - policy_list.length (0); - } - - return policy_list; - } -} diff --git a/CIAO/ciao/Container_Base.h b/CIAO/ciao/Container_Base.h deleted file mode 100644 index 20bf91b29af..00000000000 --- a/CIAO/ciao/Container_Base.h +++ /dev/null @@ -1,162 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Container_Base.h - * - * $Id$ - * - * Header file for CIAO's container implementations - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_CONTAINER_BASE_H -#define CIAO_CONTAINER_BASE_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/CCM_ContainerC.h" - -#include "tao/PortableServer/PortableServer.h" - -#include "ace/Hash_Map_Manager_T.h" - -namespace CIAO -{ - class Dynamic_Component_Servant_Base; - class Container_Impl; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - CORBA::PolicyList, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> REC_POL_MAP; - typedef ACE_Hash_Map_Iterator<ACE_CString, - CORBA::PolicyList, - ACE_Null_Mutex> REC_POL_MAP_ITERATOR; - - /** - * @class Container - * - * @brief Common container interface definition. - * - * Perhaps we can use local interface to define these interfaces as - * we will also get reference counting automatically. - */ - class CIAO_SERVER_Export Container - { - public: - enum OA_Type - { - Component, - Facet_Consumer - }; - - Container (CORBA::ORB_ptr o); - Container (CORBA::ORB_ptr o, Container_Impl *container_impl); - - virtual ~Container (void) = 0; - - /// Get component's POA. - /** - * This operation does *NOT* increase the reference count of the - * POA. Look at the const qualifier in the method. - */ - PortableServer::POA_ptr the_POA (void) const; - PortableServer::POA_ptr the_facet_cons_POA (void) const; - - /// Get a reference to the underlying ORB. - CORBA::ORB_ptr the_ORB (void) const; - - /// Set the policy map for all the receptacles hosted in this container. - void set_receptacle_policy_map (::CIAO::REC_POL_MAP &rec_pol_map); - - /// get the receptacle policy given the receptacle name - CORBA::PolicyList get_receptacle_policy (const char *name); - - /// Initialize the container with a name. - virtual int init (const char *name = 0, - const CORBA::PolicyList *more_policies = 0) = 0; - - /// Install a new home - virtual Components::CCMHome_ptr ciao_install_home ( - const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name) = 0; - - // Uninstall a servant for component or home. - virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref) = 0; - - // Uninstall a servant for component. - virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid) = 0; - - virtual void add_servant_to_map (PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant) = 0; - - virtual void delete_servant_from_map (PortableServer::ObjectId &oid) = 0; - - virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p) = 0; - - protected: - /// Reference to the ORB - CORBA::ORB_var orb_; - - /// POA within which all the components in this container will be - /// activated. - PortableServer::POA_var component_poa_; - - /// POA within which all the facets and receptacles will be - /// activated. - /** - * Having two POA's allows us to associate different policies that - * are distinct from the component. - */ - PortableServer::POA_var facet_cons_poa_; - - PortableServer::POA_var home_servant_poa_; - Container_Impl *container_impl_; - ::CIAO::REC_POL_MAP rec_pol_map_; - - private: - /// Not allowed to be used - Container (void); - }; -} - -// Macro for registration of an OBV factory in the generated -// servant class. Similar to the macro for TAO in -// tao/ValueType/ValueFactory.h but here we take advantage of -// the fact that we have access to the current ORB indirectly -// through the context and container. -#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ - { \ - CORBA::ValueFactory factory = new FACTORY; \ - CORBA::ORB_ptr orb = \ - this->context_->_ciao_the_Container ()->the_ORB (); \ - CORBA::ValueFactory prev_factory = \ - orb->register_value_factory ( \ - VALUETYPE::_tao_obv_static_repository_id (), \ - factory); \ - CORBA::remove_ref (prev_factory); \ - CORBA::add_ref (factory); \ - } - -#if defined (__ACE_INLINE__) -# include "Container_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONTAINER_BASE_H */ diff --git a/CIAO/ciao/Container_Base.inl b/CIAO/ciao/Container_Base.inl deleted file mode 100644 index 5e5545320b3..00000000000 --- a/CIAO/ciao/Container_Base.inl +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -namespace CIAO -{ - ACE_INLINE PortableServer::POA_ptr - Container::the_POA (void) const - { - return this->component_poa_.in (); - } - - ACE_INLINE PortableServer::POA_ptr - Container::the_facet_cons_POA (void) const - { - return this->facet_cons_poa_.in (); - } - - ACE_INLINE CORBA::ORB_ptr - Container::the_ORB (void) const - { - return this->orb_.in (); - } - - ACE_INLINE void - Container::set_receptacle_policy_map (::CIAO::REC_POL_MAP &rec_pol_map) - { - for (::CIAO::REC_POL_MAP_ITERATOR it = rec_pol_map.begin (); - it != rec_pol_map.end (); - ++it) - { - this->rec_pol_map_.bind ((*it).ext_id_, (*it).int_id_); - } - } -} diff --git a/CIAO/ciao/Containers/CIAO_Servant_Activator.idl b/CIAO/ciao/Containers/CIAO_Servant_Activator.idl new file mode 100644 index 00000000000..18aa906e0e2 --- /dev/null +++ b/CIAO/ciao/Containers/CIAO_Servant_Activator.idl @@ -0,0 +1,24 @@ +/** + * @file CIAO_Servant_Activator.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * Local interface extensions for the CIAO servant activator. + */ + +#ifndef CIAO_SERVANT_ACTIVATOR_IDL +#define CIAO_SERVANT_ACTIVATOR_IDL + +#include "tao/PortableServer/ServantActivator.pidl" +#include "ciao/Servants/CIAO_Port_Activator.idl" + +module CIAO +{ + local interface Servant_Activator : PortableServer::ServantActivator + { + boolean update_port_activator (in PortableServer::ObjectId oid); + + boolean register_port_activator (in Port_Activator pa); + }; +}; + +#endif diff --git a/CIAO/ciao/Containers/CIAO_Servant_Activator.mpc b/CIAO/ciao/Containers/CIAO_Servant_Activator.mpc new file mode 100644 index 00000000000..da03a0bc11b --- /dev/null +++ b/CIAO/ciao/Containers/CIAO_Servant_Activator.mpc @@ -0,0 +1,17 @@ +// $Id$ + +project(CIAO_Servant_Activator_stub) : ciao_lib, portableserver, taoidldefaults, ciao_port_activator_stub { + dynamicflags = CIAO_SERVANT_ACTIVATOR_BUILD_DLL + idlflags += -Wb,stub_export_include=CIAO_Servant_Activator_export.h + idlflags += -Wb,stub_export_macro=CIAO_Servant_Activator_Export + idlflags += -SS + + IDL_Files { + CIAO_Servant_Activator.idl + } + Source_Files { + Servant_Activator.cpp + CIAO_Servant_ActivatorC.cpp + } +} + diff --git a/CIAO/ciao/Containers/CIAO_Servant_Activator_export.h b/CIAO/ciao/Containers/CIAO_Servant_Activator_export.h new file mode 100644 index 00000000000..c4015b3afe0 --- /dev/null +++ b/CIAO/ciao/Containers/CIAO_Servant_Activator_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Servant_Activator +// ------------------------------ +#ifndef CIAO_SERVANT_ACTIVATOR_EXPORT_H +#define CIAO_SERVANT_ACTIVATOR_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_SERVANT_ACTIVATOR_HAS_DLL) +# define CIAO_SERVANT_ACTIVATOR_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_SERVANT_ACTIVATOR_HAS_DLL */ + +#if !defined (CIAO_SERVANT_ACTIVATOR_HAS_DLL) +# define CIAO_SERVANT_ACTIVATOR_HAS_DLL 1 +#endif /* ! CIAO_SERVANT_ACTIVATOR_HAS_DLL */ + +#if defined (CIAO_SERVANT_ACTIVATOR_HAS_DLL) && (CIAO_SERVANT_ACTIVATOR_HAS_DLL == 1) +# if defined (CIAO_SERVANT_ACTIVATOR_BUILD_DLL) +# define CIAO_Servant_Activator_Export ACE_Proper_Export_Flag +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_SERVANT_ACTIVATOR_BUILD_DLL */ +# define CIAO_Servant_Activator_Export ACE_Proper_Import_Flag +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_SERVANT_ACTIVATOR_BUILD_DLL */ +#else /* CIAO_SERVANT_ACTIVATOR_HAS_DLL == 1 */ +# define CIAO_Servant_Activator_Export +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARATION(T) +# define CIAO_SERVANT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_SERVANT_ACTIVATOR_HAS_DLL == 1 */ + +// Set CIAO_SERVANT_ACTIVATOR_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_SERVANT_ACTIVATOR_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_SERVANT_ACTIVATOR_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_SERVANT_ACTIVATOR_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_SERVANT_ACTIVATOR_NTRACE */ + +#if (CIAO_SERVANT_ACTIVATOR_NTRACE == 1) +# define CIAO_SERVANT_ACTIVATOR_TRACE(X) +#else /* (CIAO_SERVANT_ACTIVATOR_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_SERVANT_ACTIVATOR_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_SERVANT_ACTIVATOR_NTRACE == 1) */ + +#endif /* CIAO_SERVANT_ACTIVATOR_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Containers/Container_Base.cpp b/CIAO/ciao/Containers/Container_Base.cpp new file mode 100644 index 00000000000..f34dfe6986a --- /dev/null +++ b/CIAO/ciao/Containers/Container_Base.cpp @@ -0,0 +1,50 @@ +// $Id$ + +#include "Container_Base.h" +#include "ciao/CIAO_common.h" + +#if !defined (__ACE_INLINE__) +# include "Container_Base.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + //////////////////////////////////////////////////////////////// + + Container_i::Container_i (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)), + container_impl_ (0) + { + } + + Container_i::Container_i (CORBA::ORB_ptr o, + Deployment::CIAO_Container_i *container_impl) + : orb_ (CORBA::ORB::_duplicate (o)), + container_impl_ (container_impl) + { + } + + Container_i::~Container_i (void) + { + } + + CORBA::PolicyList * + Container_i::get_receptacle_policy (const char* name) + { + CORBA::PolicyList_var policy_list; + + ACE_NEW_THROW_EX (policy_list, + CORBA::PolicyList (), + CORBA::NO_MEMORY ()); + + if (this->rec_pol_map_.find (name, policy_list) != 0) + { + CIAO_ERROR ((LM_DEBUG, CLINFO + "Container_i::get_receptacle_policy - No policies found " + "for the receptacle %s\n", + name)); + } + + return policy_list._retn (); + } +} diff --git a/CIAO/ciao/Containers/Container_Base.h b/CIAO/ciao/Containers/Container_Base.h new file mode 100644 index 00000000000..4efededf626 --- /dev/null +++ b/CIAO/ciao/Containers/Container_Base.h @@ -0,0 +1,177 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Container_Base.h + * + * $Id$ + * + * Header file for CIAO's container implementations + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + * @author Gan Deng <dengg@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_CONTAINER_BASE_H +#define CIAO_CONTAINER_BASE_H + +#include /**/ "ace/pre.h" + +#include "ciao/Containers/Container_Base_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Hash_Map_Manager_T.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/PortableServer.h" +#include "ccm/CCM_ContainerC.h" + +#include "ciao/Containers/Container_BaseC.h" + +namespace CIAO +{ + class Dynamic_Component_Servant_Base; + + namespace Deployment + { + class CIAO_Container_i; + } + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + CORBA::PolicyList, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> REC_POL_MAP; + typedef ACE_Hash_Map_Iterator<ACE_CString, + CORBA::PolicyList, + ACE_Null_Mutex> REC_POL_MAP_ITERATOR; + + /** + * @class Container + * + * @brief Common container interface definition. + * + * Perhaps we can use local interface to define these interfaces as + * we will also get reference counting automatically. + */ + class CIAO_Container_Base_Export Container_i : + public virtual Container, + public virtual ::CORBA::LocalObject + { + public: + Container_i (CORBA::ORB_ptr o); + Container_i (CORBA::ORB_ptr o, Deployment::CIAO_Container_i *container_impl); + + virtual ~Container_i (void) = 0; + + /// Initialize the container with a name. + virtual void init (const char *name = 0, + const CORBA::PolicyList *more_policies = 0) = 0; + + /// Get component's POA. + /** + * This operation does *NOT* increase the reference count of the + * POA. Look at the const qualifier in the method. + */ + virtual PortableServer::POA_ptr the_POA (void); + virtual PortableServer::POA_ptr the_port_POA (void); + + /// get the receptacle policy given the receptacle name + CORBA::PolicyList * get_receptacle_policy (const char *name); + + /// Install a new home + virtual Components::CCMHome_ptr install_home (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name) = 0; + + // Uninstall a servant for component or home. + virtual void uninstall_home (Components::CCMHome_ptr homeref) = 0; + + virtual Components::CCMObject_ptr install_component (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name) = 0; + + virtual void uninstall_component (Components::CCMObject_ptr compref) = 0; + + virtual CORBA::Object_ptr get_objref (PortableServer::Servant p) = 0; + + virtual CORBA::Object_ptr install_servant (PortableServer::Servant objref, + Container_Types::OA_Type type, + PortableServer::ObjectId_out oid) = 0; + + // Uninstall a servant for component. + virtual void uninstall_servant (PortableServer::Servant objref, + Container_Types::OA_Type type, + PortableServer::ObjectId_out oid) = 0; + + virtual void add_servant_to_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant) = 0; + + virtual void delete_servant_from_map (PortableServer::ObjectId &oid) = 0; + + /// Get a reference to the underlying ORB. + CORBA::ORB_ptr the_ORB (void) const; + + /// Set the policy map for all the receptacles hosted in this container. + void set_receptacle_policy_map (::CIAO::REC_POL_MAP &rec_pol_map); + + protected: + /// Reference to the ORB + CORBA::ORB_var orb_; + + /// POA within which all the components in this container will be + /// activated. + PortableServer::POA_var component_poa_; + + /// POA within which all the facets and receptacles will be + /// activated. + /** + * Having two POA's allows us to associate different policies that + * are distinct from the component. + */ + PortableServer::POA_var facet_cons_poa_; + + PortableServer::POA_var home_servant_poa_; + + Deployment::CIAO_Container_i *container_impl_; + + ::CIAO::REC_POL_MAP rec_pol_map_; + + private: + /// Not allowed to be used + Container_i (void); + }; +} + +/// Macro for registration of an OBV factory in the generated +/// servant class. Similar to the macro for TAO in +/// tao/ValueType/ValueFactory.h but here we take advantage of +/// the fact that we have access to the current ORB indirectly +/// through the context and container. +#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ + { \ + CORBA::ValueFactory factory = new FACTORY; \ + CORBA::ORB_ptr orb = \ + this->context_->_ciao_the_Container ()->the_ORB (); \ + CORBA::ValueFactory prev_factory = \ + orb->register_value_factory ( \ + VALUETYPE::_tao_obv_static_repository_id (), \ + factory); \ + CORBA::remove_ref (prev_factory); \ + CORBA::add_ref (factory); \ + } + +#if defined (__ACE_INLINE__) +# include "Container_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_CONTAINER_BASE_H */ diff --git a/CIAO/ciao/Containers/Container_Base.idl b/CIAO/ciao/Containers/Container_Base.idl new file mode 100644 index 00000000000..01a79b71a15 --- /dev/null +++ b/CIAO/ciao/Containers/Container_Base.idl @@ -0,0 +1,82 @@ +/** + * @file Container_Base.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * Container local interface. + */ + +#include "tao/PortableServer/PortableServer_include.pidl" +#include "ccm/CCM_Home.idl" +#include "ciao/Containers/CIAO_Servant_Activator.idl" + +module CIAO +{ + module Container_Types + { + enum OA_Type + { + COMPONENT_t, + HOME_t, + FACET_CONSUMER_t + }; + }; + + exception InvalidComponent + { + }; + + /** + * @interface Container + * @brief Internal container interfaces. + * + * This interface provides interfactes to two portions of the CIAO + * container architecture: The generic external container interface + * created by the component server, and the component specific container + * portions generated by the CIDL compiler (the component servant) + */ + local interface Container + { + CORBA::PolicyList get_receptacle_policy (in string name); + // **** Methods used by external container + Components::CCMHome install_home (in string primary_artifact, + in string entry_point, + in string servant_artifact, + in string servant_entrypoint, + in string name); + + void uninstall_home (in Components::CCMHome homeptr); + + Components::CCMObject install_component (in string primary_artifact, + in string entry_point, + in string servant_artifact, + in string servant_entrypoint, + in string name); + + void activate_component (in Components::CCMObject name); + + void passivate_component (in Components::CCMObject name); + + void uninstall_component (in Components::CCMObject compptr); + + // *** Methods used by component specific container portions + Object install_servant (in PortableServer::Servant svnt, + in Container_Types::OA_Type type, + out PortableServer::ObjectId oid); + + void uninstall_servant (in PortableServer::Servant compptr, + in Container_Types::OA_Type type, + out PortableServer::ObjectId oid); + + Servant_Activator ports_servant_activator (); + + Object generate_reference (in string obj_id, + in string repo_id, + in Container_Types::OA_Type type); + + Object get_objref (in PortableServer::Servant p); + + PortableServer::POA the_POA (); + + PortableServer::POA the_port_POA (); + }; +}; diff --git a/CIAO/ciao/Containers/Container_Base.inl b/CIAO/ciao/Containers/Container_Base.inl new file mode 100644 index 00000000000..b4198116983 --- /dev/null +++ b/CIAO/ciao/Containers/Container_Base.inl @@ -0,0 +1,33 @@ +// $Id$ + +namespace CIAO +{ + ACE_INLINE PortableServer::POA_ptr + Container_i::the_POA (void) + { + return this->component_poa_.in (); + } + + ACE_INLINE PortableServer::POA_ptr + Container_i::the_port_POA (void) + { + return this->facet_cons_poa_.in (); + } + + ACE_INLINE CORBA::ORB_ptr + Container_i::the_ORB (void) const + { + return this->orb_.in (); + } + + ACE_INLINE void + Container_i::set_receptacle_policy_map (::CIAO::REC_POL_MAP &rec_pol_map) + { + for (::CIAO::REC_POL_MAP_ITERATOR it = rec_pol_map.begin (); + it != rec_pol_map.end (); + ++it) + { + this->rec_pol_map_.bind ((*it).ext_id_, (*it).int_id_); + } + } +} diff --git a/CIAO/ciao/Containers/Container_Base_export.h b/CIAO/ciao/Containers/Container_Base_export.h new file mode 100644 index 00000000000..75279891cb6 --- /dev/null +++ b/CIAO/ciao/Containers/Container_Base_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Container_Base +// ------------------------------ +#ifndef CIAO_CONTAINER_BASE_EXPORT_H +#define CIAO_CONTAINER_BASE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_CONTAINER_BASE_HAS_DLL) +# define CIAO_CONTAINER_BASE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_CONTAINER_BASE_HAS_DLL */ + +#if !defined (CIAO_CONTAINER_BASE_HAS_DLL) +# define CIAO_CONTAINER_BASE_HAS_DLL 1 +#endif /* ! CIAO_CONTAINER_BASE_HAS_DLL */ + +#if defined (CIAO_CONTAINER_BASE_HAS_DLL) && (CIAO_CONTAINER_BASE_HAS_DLL == 1) +# if defined (CIAO_CONTAINER_BASE_BUILD_DLL) +# define CIAO_Container_Base_Export ACE_Proper_Export_Flag +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_CONTAINER_BASE_BUILD_DLL */ +# define CIAO_Container_Base_Export ACE_Proper_Import_Flag +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_CONTAINER_BASE_BUILD_DLL */ +#else /* CIAO_CONTAINER_BASE_HAS_DLL == 1 */ +# define CIAO_Container_Base_Export +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARATION(T) +# define CIAO_CONTAINER_BASE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_CONTAINER_BASE_HAS_DLL == 1 */ + +// Set CIAO_CONTAINER_BASE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_CONTAINER_BASE_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_CONTAINER_BASE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_CONTAINER_BASE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_CONTAINER_BASE_NTRACE */ + +#if (CIAO_CONTAINER_BASE_NTRACE == 1) +# define CIAO_CONTAINER_BASE_TRACE(X) +#else /* (CIAO_CONTAINER_BASE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_CONTAINER_BASE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_CONTAINER_BASE_NTRACE == 1) */ + +#endif /* CIAO_CONTAINER_BASE_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Containers/Containers.mpc b/CIAO/ciao/Containers/Containers.mpc new file mode 100644 index 00000000000..732c9437c4c --- /dev/null +++ b/CIAO/ciao/Containers/Containers.mpc @@ -0,0 +1,22 @@ +// $Id$ + +project(CIAO_Container_Base) : ciao_lib, ccm_svnt, ciao_servant_activator, ciao_port_activator_stub { + dynamicflags += CIAO_CONTAINER_BASE_BUILD_DLL + idlflags += -Wb,export_include=Container_Base_export.h + idlflags += -Wb,export_macro=CIAO_Container_Base_Export + + IDL_Files { + Container_Base.idl + } + Source_Files { + Container_Base.cpp + Container_BaseC.cpp + Container_BaseS.cpp + } + Inline_Files { + Container_Base.inl + } + Header_Files { + Container_Base.h + } +} diff --git a/CIAO/ciao/Containers/Servant_Activator.cpp b/CIAO/ciao/Containers/Servant_Activator.cpp new file mode 100644 index 00000000000..8f2355a6bbd --- /dev/null +++ b/CIAO/ciao/Containers/Servant_Activator.cpp @@ -0,0 +1,199 @@ +#include "Servant_Activator.h" + +#include "tao/PortableServer/PortableServer_Functions.h" +#include "ciao/CIAO_common.h" + +ACE_RCSID (ciao, + Servant_Activator_i, + "$Id$") + +namespace CIAO +{ + Servant_Activator_i::Servant_Activator_i (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)), + // @@ TODO, avoid this magic number + pa_ (64), + slot_index_ (0) + { + } + + Servant_Activator_i::~Servant_Activator_i (void) + { + CIAO_TRACE ("Servant_Activator_i::~Servant_Activator_i"); + /* _var should take care of this now. + { + ACE_GUARD (TAO_SYNCH_MUTEX, + guard, + this->mutex_); + + size_t const sz = this->slot_index_; + + for (size_t t = 0; t != sz; ++t) + { + Port_Activator *&tmp = this->pa_[t]; + + delete tmp; + } + } + */ + } + + bool + Servant_Activator_i::update_port_activator ( + const PortableServer::ObjectId &oid) + { + CIAO_TRACE ("Servant_Activator_i::update_port_activator"); + + CORBA::String_var str = + PortableServer::ObjectId_to_string (oid); + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->mutex_, + CORBA::NO_RESOURCES ()); + size_t const sz = this->slot_index_; + + for (size_t t = 0; t != sz; ++t) + { + Port_Activator_var tmp = this->pa_[t]; + + if (ACE_OS::strcmp (tmp->oid (), str.in ()) == 0) + { + tmp->oid ("dummy"); + } + } + } + + return true; + } + + PortableServer::Servant + Servant_Activator_i::incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr) + { + CIAO_TRACE ("Servant_Activator_i::incarnate"); + + CORBA::String_var str = + PortableServer::ObjectId_to_string (oid); + + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Activator_i::incarnate, " + "Attempting to activate port name [%C] \n", + str.in ())); + + { + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + guard, + this->mutex_, + CORBA::NO_RESOURCES ()); + + size_t const sz = this->slot_index_; + Port_Activator_var tmp; + + for (size_t t = 0; t != sz; ++t) + { + if (this->pa_.get (tmp, t) == -1) + { + throw CORBA::OBJECT_NOT_EXIST (); + } + + if (tmp == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Servant_Activator_i::incarnate ()," + " value from the array is null \n")); + continue; + } + + if (ACE_OS::strcmp (tmp->oid (), + str.in ()) == 0) + { + // 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. + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Activator_i::incarnate - Activating Port %C\n", + str.in ())); + + return this->pa_[t]->activate (oid); + } + } + } + + throw CORBA::OBJECT_NOT_EXIST (); + } + + void + Servant_Activator_i::etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr , + PortableServer::Servant servant, + CORBA::Boolean , + CORBA::Boolean) + { + CORBA::String_var str = + PortableServer::ObjectId_to_string (oid); + + size_t const sz = this->slot_index_; + Port_Activator *tmp = 0; + + for (size_t t = 0; t != sz; ++t) + { + Port_Activator_var pa; + if (this->pa_.get (pa, t) == -1) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Servant_Activator_i::etherealize - Could not get Port Activator\n")); + continue; + } + + if (tmp == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Servant_Activator_i::etherealize - Port Activator is NULL\n")); + continue; + } + + if (ACE_OS::strcmp (tmp->oid (), + str.in ()) == 0) + { + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Activator_i::etherealize - Deactivating Port %C\n", + str.in ())); + this->pa_[t]->deactivate (servant); + } + } + } + + bool + Servant_Activator_i::register_port_activator (Port_Activator *pa) + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + guard, + this->mutex_, + false); + + // @@ TODO, need to implement a better algorithm here. + // + if (this->slot_index_ >= this->pa_.size ()) + { + this->pa_.size ((this->slot_index_ + 1)); + } + + if (this->pa_.set (pa, this->slot_index_) == 0) + { + ++this->slot_index_; + + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Activator_i::" + "register_port_activator" + " with port name [%C]," + " the slot_index_ is [%d] \n", + pa->name (), + this->slot_index_)); + + return true; + } + + return false; + } +} diff --git a/CIAO/ciao/Containers/Servant_Activator.h b/CIAO/ciao/Containers/Servant_Activator.h new file mode 100644 index 00000000000..19eca30ae49 --- /dev/null +++ b/CIAO/ciao/Containers/Servant_Activator.h @@ -0,0 +1,108 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Servant_Activator.h + * + * $Id$ + * + * @authors Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_SERVANT_ACTIVATOR_H +#define CIAO_SERVANT_ACTIVATOR_H + +#include /**/ "ace/pre.h" + +#include "CIAO_Servant_Activator_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Array_Base.h" +#include "tao/PortableServer/ServantActivatorC.h" +#include "tao/LocalObject.h" +#include "ciao/Containers/CIAO_Servant_ActivatorC.h" + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +namespace CIAO +{ + class Port_Activator; + + /** + * @class Servant_Activator + * + * @brief Activator that is registered with the POA for facet and + * consumer servants. + * + * This class acts like a factory in some sense. This factory is + * registered with the POA with RETAIN policy. When the factory gets + * a call back as part of the upcall, this factory looks at the + * list of port activators registered, uses the OID to pick the + * right one (yes a linear algorithm is used), calls activate () on + * it which returns the servant for *that* port. + */ + class CIAO_Servant_Activator_Export Servant_Activator_i + : public virtual ::CIAO::Servant_Activator, + public virtual ::CORBA::LocalObject + { + public: + Servant_Activator_i (CORBA::ORB_ptr o); + + virtual ~Servant_Activator_i (void); + + virtual ::CORBA::Boolean update_port_activator ( + const ::PortableServer::ObjectId &oid); + + virtual ::CORBA::Boolean register_port_activator ( + ::CIAO::Port_Activator_ptr pa); + + /// Template methods overridden to get callbacks. + /** + * If you would like to know the details of the following two + * methods, please PortableServer documentation. This is probably + * not the place to document what these mean. + */ + virtual PortableServer::Servant incarnate ( + const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa); + + virtual void etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations); + /// Local helper methods + + private: + /// Pointer to our ORB + CORBA::ORB_var orb_; + + /// @@ This should be changed at some point of time so that we + /// don't land up with a linear algorithm + typedef ACE_Array_Base<Port_Activator_var> Port_Activators; + + /// Array of port activators + Port_Activators pa_; + + /// Running index of the slot that has been just filled in. + size_t slot_index_; + + /// Mutex that synchronizes access to the array. + TAO_SYNCH_MUTEX mutex_; + }; +} + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" + +#endif /*CIAO_SERVANT_ACTIVATOR_H*/ diff --git a/CIAO/ciao/Containers/Session/Session_Container.cpp b/CIAO/ciao/Containers/Session/Session_Container.cpp new file mode 100644 index 00000000000..70cf8cc9835 --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container.cpp @@ -0,0 +1,897 @@ +// $Id$ + +#include "Session_Container.h" + +#include "tao/Utils/PolicyList_Destroyer.h" +#include "ciao/CIAO_common.h" +#include "ciao/Containers/Servant_Activator.h" +#include "ccm/ComponentServer/CCM_ComponentServer_BaseC.h" +#include "ciao/ComponentServer/CIAO_ComponentServerC.h" +#include "ciao/Servants/Servant_Impl_Base.h" + +#if !defined (__ACE_INLINE__) +# include "Session_Container.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + /////////////////////////////////////////////////////////////// + + ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> + Session_Container::serial_number_ (0); + + Session_Container::Session_Container (CORBA::ORB_ptr o, + Deployment::CIAO_Container_i *container_impl, + bool static_config_flag, + const Static_Config_EntryPoints_Maps* maps, + const char *name, + const CORBA::PolicyList *more_policies) + : Container_i (o, container_impl), + number_ (0), + static_config_flag_ (static_config_flag), + static_entrypts_maps_ (maps), + sa_ (0) + { + this->init (name, more_policies); + } + + Session_Container::~Session_Container (void) + { + if (! CORBA::is_nil (this->component_poa_.in ())) + { + this->component_poa_->destroy (1, 1); + } + + if (! CORBA::is_nil (this->facet_cons_poa_.in ())) + { + this->facet_cons_poa_->destroy (1, 1); + } + + if (! CORBA::is_nil (this->home_servant_poa_.in ())) + { + this->home_servant_poa_->destroy (1, 1); + } + + // delete this->sa_; + } + + void + Session_Container::init (const char *name, + const CORBA::PolicyList *more_policies) + { + CIAO_TRACE ("Session_Container::init"); + + char buffer[MAXPATHLEN]; + + if (name == 0) + { + this->number_ = ++Session_Container::serial_number_; + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::init - " + "Constructing container name from serial number %u\n", + this->number_)); + ACE_OS::sprintf (buffer, + "CIAO::Session_Container-%ld", + this->number_); + name = buffer; + } + + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::init - " + "Initializing a container with name %C\n", + name)); + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references ("RootPOA"); + + if (CORBA::is_nil (poa_object.in ())) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO::Session_Container: Unable to initialize the POA.\n")); + throw Components::CreateFailure (); + } + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + this->create_component_POA (name, + more_policies, + root_poa.in ()); + + ACE_CString port_poa_name (name); + port_poa_name += ":Port_POA"; + this->create_facet_consumer_POA (port_poa_name.c_str (), + more_policies, + root_poa.in ()); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + poa_manager->activate (); + } + + void + Session_Container::create_component_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root) + { + 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 + // instead of simply assigning more_policies to the init policy + // list. + CORBA::PolicyList policies (0); + + if (p != 0) + { + policies = *p; + } + + PortableServer::POAManager_var poa_manager = + root->the_POAManager (); + + this->component_poa_ = + root->create_POA (name, poa_manager.in (), policies); + } + + void + Session_Container::create_facet_consumer_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root) + { + CIAO_TRACE ("Session_Container::create_facet_consumer_POA"); + + PortableServer::POAManager_var poa_manager = root->the_POAManager (); + CORBA::ULong p_length = 0; + + if (p != 0) + { + p_length = p->length (); + } + + TAO::Utils::PolicyList_Destroyer policies (p_length + 3); + policies.length (p_length + 3); + + policies[0] = + root->create_id_assignment_policy (PortableServer::USER_ID); + + // Servant Manager Policy + policies[1] = + root->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER); + + // Servant Retention Policy + policies[2] = + root->create_servant_retention_policy (PortableServer::RETAIN); + + for (CORBA::ULong i = 0; i < p_length; ++i) + { + policies[i+3] = (*p)[i]; + } + + this->facet_cons_poa_ = + root->create_POA (name, + poa_manager.in (), + policies); + + Servant_Activator_i *sa = 0; + ACE_NEW_THROW_EX (sa, + Servant_Activator_i (this->orb_.in ()), + CORBA::NO_MEMORY ()); + this->sa_ = sa; + + this->facet_cons_poa_->set_servant_manager (this->sa_.in ()); + } + + CORBA::Object_ptr + Session_Container::install_servant (PortableServer::Servant p, + Container_Types::OA_Type t, + PortableServer::ObjectId_out oid) + { + CIAO_TRACE ("Session_Container::install_servant"); + + PortableServer::POA_ptr tmp = 0; + + if (t == Container_Types::COMPONENT_t || + t == Container_Types::HOME_t) + { + tmp = this->component_poa_.in (); + } + else + { + tmp = this->facet_cons_poa_.in (); + } + + PortableServer::ObjectId_var tmp_id = tmp->activate_object (p); + + CORBA::Object_var objref = tmp->id_to_reference (tmp_id.in ()); + oid = tmp_id._retn (); + + return objref._retn (); + } + + //@@ Apparently we need to be cautious when handling the exception + // thrown here. We should make sure that new DnC interfaces + // NodeApplication/NodeApplicationManager etc will cache the new + // exceptions--> rethrow of new exceptions is needed. + // --Tao + Components::CCMHome_ptr + Session_Container::install_home (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name) + { + CIAO_TRACE ("Session_Container::install_home"); + + HomeFactory hcreator = 0; + HomeServantFactory screator = 0; + + if (this->static_config_flag_ == false) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_home - " + "Loading home [%C] from shared libraries\n", + name)); + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_home - " + "Executor library [%C] with entrypoint [%C]\n", + primary_artifact, entry_point)); + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_home - " + "Servant library [%C] with entrypoint [%C]\n", + servant_artifact, servant_entrypoint)); + + ACE_DLL executor_dll; + ACE_DLL servant_dll; + + if (primary_artifact == 0 || servant_artifact == 0) + { + ACE_CString exception; + + if (primary_artifact == 0) + { + exception = "Null component executor DLL name"; + } + + if (servant_artifact == 0) + { + exception = "Null component servant DLL name"; + } + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_home -" + "ERROR: %C\n", + exception.c_str ())); + + throw Components::Deployment::UnknownImplId (); + } + + if (executor_dll.open (primary_artifact, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_CString error ("Failed to open executor DLL: "); + error += primary_artifact; + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_home -" + "ERROR in opening the executor DLL [%C] \n", + primary_artifact)); + + throw Components::Deployment::UnknownImplId (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Executor DLL successfully opened\n")); + + if (servant_dll.open (servant_artifact, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_CString error ("Failed to open executor DLL: "); + error += servant_artifact; + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_home -" + "ERROR in opening the servant DLL [%C] \n", + servant_artifact)); + + throw Components::Deployment::UnknownImplId (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Servant DLL successfully openend.\n")); + + if (entry_point == 0 || servant_entrypoint == 0) + { + ACE_CString error ("Entry point is null for "); + + if (entry_point == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_home -" + "ERROR in opening the executor entry point " + "for executor DLL [%C] \n", + primary_artifact)); + error += primary_artifact; + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_home -" + "ERROR in opening the servant entry point " + "for servant DLL [%C] \n", + servant_artifact)); + error += servant_artifact; + } + + throw Components::Deployment::ImplEntryPointNotFound (); + } + + // We have to do this casting in two steps because the C++ + // standard forbids casting a pointer-to-object (including + // void*) directly to a pointer-to-function. + void *void_ptr = executor_dll.symbol (entry_point); + ptrdiff_t tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); + hcreator = reinterpret_cast<HomeFactory> (tmp_ptr); + + void_ptr = servant_dll.symbol (servant_entrypoint); + tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); + screator = reinterpret_cast<HomeServantFactory> (tmp_ptr); + } + else + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_home - Loading statically linked home [%C]\n", + name)); + + if (static_entrypts_maps_ == 0 + || static_entrypts_maps_->home_creator_funcptr_map_ == 0 + || static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0) + { + CIAO_DEBUG ((LM_ERROR, CLINFO + "Session_Container::install_home - ERROR: Static entrypoint " + "maps are null or imcomplete.\n")); + throw Components::Deployment::ImplEntryPointNotFound (); + } + + ACE_CString entry_point_str (entry_point); + static_entrypts_maps_->home_creator_funcptr_map_->find (entry_point_str, + hcreator); + + ACE_CString servant_entrypoint_str (servant_entrypoint); + static_entrypts_maps_->home_servant_creator_funcptr_map_->find (servant_entrypoint_str, + screator); + } + + if (hcreator == 0 || screator == 0) + { + ACE_CString error ("Entry point "); + + if (hcreator == 0) + { + error += entry_point; + error += " invalid in dll "; + error += primary_artifact; + } + else + { + error += servant_entrypoint; + error += " invalid in dll "; + error += servant_artifact; + } + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::ciao_install_home - Error:%C\n", + error.c_str ())); + + throw Components::Deployment::ImplEntryPointNotFound (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Loading home executor\n")); + Components::HomeExecutorBase_var home_executor = hcreator (); + + if (CORBA::is_nil (home_executor.in ())) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::ciao_install_hoe - Home executor factory failed. \n")); + throw Components::Deployment::InstallationFailure (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Loading home servant\n")); + PortableServer::Servant home_servant = screator (home_executor.in (), + this, + name); + + if (home_servant == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::ciao_install_home - Home servant factory failed.\n")); + throw Components::Deployment::InstallationFailure (); + } + + PortableServer::ServantBase_var safe (home_servant); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Installing home servant\n")); + + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->install_servant (home_servant, Container_Types::HOME_t, oid.out ()); + + Components::CCMHome_var homeref = + Components::CCMHome::_narrow (objref.in ()); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_home - Home successfully created with name\n")); + + return homeref._retn (); + } + + Components::CCMObject_ptr + Session_Container::install_component (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name) + { + CIAO_TRACE ("Session_Container::install_component"); + + ComponentFactory ccreator = 0; + ComponentServantFactory screator = 0; + + if (this->static_config_flag_ == false) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_component - " + "Loading component [%C] from shared libraries\n", + name)); + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_component - " + "Executor library [%C] with entrypoint [%C]\n", + primary_artifact, entry_point)); + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_component - " + "Servant library [%C] with entrypoint [%C]\n", + servant_artifact, servant_entrypoint)); + + ACE_DLL executor_dll, servant_dll; + + if (primary_artifact == 0 || servant_artifact == 0) + { + ACE_CString exception; + + if (primary_artifact == 0) + { + exception = "Null component executor DLL name"; + } + + if (servant_artifact == 0) + { + exception = "Null component servant DLL name"; + } + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_component -" + "ERROR: %C\n", + exception.c_str ())); + + throw Components::Deployment::UnknownImplId (); + } + + if (executor_dll.open (primary_artifact, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_CString error ("Failed to open executor DLL: "); + error += primary_artifact; + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_component -" + "ERROR in opening the executor DLL [%C] \n", + primary_artifact)); + + throw Components::Deployment::UnknownImplId (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Executor DLL successfully opened\n")); + + if (servant_dll.open (servant_artifact, + ACE_DEFAULT_SHLIB_MODE, + 0) != 0) + { + ACE_CString error ("Failed to open executor DLL: "); + error += servant_artifact; + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_component -" + "ERROR in opening the servant DLL [%C] \n", + servant_artifact)); + + throw Components::Deployment::UnknownImplId (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Servant DLL successfully openend.\n")); + + if (entry_point == 0 || servant_entrypoint == 0) + { + ACE_CString error ("Entry point is null for "); + + if (entry_point == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_component -" + "ERROR in opening the executor entry point " + "for executor DLL [%C] \n", + primary_artifact)); + error += primary_artifact; + } + else + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container.cpp -" + "Session_Container::ciao_install_component -" + "ERROR in opening the servant entry point " + "for servant DLL [%C] \n", + servant_artifact)); + error += servant_artifact; + } + + throw Components::Deployment::ImplEntryPointNotFound (); + } + + // We have to do this casting in two steps because the C++ + // standard forbids casting a pointer-to-object (including + // void*) directly to a pointer-to-function. + void *void_ptr = executor_dll.symbol (entry_point); + ACE_DEBUG ((LM_EMERGENCY, "***** vp: %u\n", void_ptr)); + ptrdiff_t tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); + ccreator = reinterpret_cast<ComponentFactory> (tmp_ptr); + ACE_DEBUG ((LM_EMERGENCY, "***** cc: %u\n", ccreator)); + void_ptr = servant_dll.symbol (servant_entrypoint); + tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); + screator = reinterpret_cast<ComponentServantFactory> (tmp_ptr); + } + else + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Session_Container::install_component - Loading statically linked component [%C]\n", + name)); + + if (static_entrypts_maps_ == 0 + || static_entrypts_maps_->component_creator_funcptr_map_ == 0 + || static_entrypts_maps_->component_servant_creator_funcptr_map_ == 0) + { + CIAO_DEBUG ((LM_ERROR, CLINFO + "Session_Container::install_component - ERROR: Static entrypoint " + "maps are null or imcomplete.\n")); + throw Components::Deployment::ImplEntryPointNotFound (); + } + + ACE_CString entry_point_str (entry_point); + static_entrypts_maps_->component_creator_funcptr_map_->find (entry_point_str, + ccreator); + + ACE_CString servant_entrypoint_str (servant_entrypoint); + static_entrypts_maps_->component_servant_creator_funcptr_map_->find (servant_entrypoint_str, + screator); + } + + if (ccreator == 0 || screator == 0) + { + ACE_CString error ("Entry point "); + + if (ccreator == 0) + { + error += entry_point; + error += " invalid in dll "; + error += primary_artifact; + } + else + { + error += servant_entrypoint; + error += " invalid in dll "; + error += servant_artifact; + } + + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::ciao_install_component - Error:%C\n", + error.c_str ())); + + throw Components::Deployment::ImplEntryPointNotFound (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Loading component executor\n")); + Components::EnterpriseComponent_var component_executor = ccreator (); + + if (CORBA::is_nil (component_executor.in ())) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::Ciao_install_hoe - Component executor factory failed. \n")); + throw Components::Deployment::InstallationFailure (); + } + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Loading component servant\n")); + PortableServer::Servant component_servant = screator (component_executor.in (), + this, + name); + + if (component_servant == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "Session_Container::ciao_install_component - Component servant factory failed.\n")); + throw Components::Deployment::InstallationFailure (); + } + + PortableServer::ServantBase_var safe (component_servant); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Installing component servant\n")); + + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->install_servant (component_servant, Container_Types::COMPONENT_t, oid.out ()); + + Components::CCMObject_var componentref = + Components::CCMObject::_narrow (objref.in ()); + + CIAO_DEBUG ((LM_TRACE, CLINFO + "Session_Container::install_component - Component successfully created\n")); + + return componentref._retn (); + } + + void + Session_Container::activate_component (Components::CCMObject_ptr compref) + { + CIAO_TRACE("Session_Container::activate_component"); + + try + { + + PortableServer::Servant svt; + + try + { + svt = this->component_poa_->reference_to_servant (compref); + } + catch (...) + { + throw InvalidComponent (); + } + + CIAO::Servant_Impl_Base *sess = dynamic_cast<CIAO::Servant_Impl_Base *> (svt); + + if (sess == 0) + throw CIAO::InvalidComponent (); + + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::activate_component - " + "Invoking CCM activate on provided component object reference.")); + sess->activate_component (); + } + catch (const CIAO::InvalidComponent &) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::activate_component - " + "Failed to retrieve servant and/or cast to servant pointer.\n")); + throw; + } + catch (const CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::activate_component - " + "Caught CORBA exception while activating a component: %C\n", + ex._info ().c_str ())); + throw; + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::activate_component - " + "Caught unknown C++ eception while activating a component.\n")); + throw; + } + } + + void + Session_Container::passivate_component (Components::CCMObject_ptr compref) + { + CIAO_TRACE ("Session_Container::passivate_component"); + + try + { + PortableServer::Servant svt; + + try + { + svt = this->component_poa_->reference_to_servant (compref); + } + catch (...) + { + throw InvalidComponent (); + } + + CIAO::Servant_Impl_Base *sess = dynamic_cast<CIAO::Servant_Impl_Base *> (svt); + + if (sess == 0) + throw CIAO::InvalidComponent (); + + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::passivate_component - " + "Invoking CCM activate on provided component object reference.")); + sess->passivate_component (); + } + catch (const CIAO::InvalidComponent &) + { + throw; + } + catch (const CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::passivate_component - " + "Caught CORBA exception while passivating a component: %C\n", + ex._info ().c_str ())); + throw; + } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::passivate_component - " + "Caught unknown C++ eception while passivating a component.\n")); + throw; + } + } + + void + Session_Container::uninstall (CORBA::Object_ptr objref, Container_Types::OA_Type y) + { + CIAO_TRACE ("Session_Container::uninstall"); + + PortableServer::Servant svnt; + + switch (y) + { + case Container_Types::COMPONENT_t: + case Container_Types::HOME_t: + svnt = this->component_poa_->reference_to_servant (objref); + break; + default: + svnt = this->facet_cons_poa_->reference_to_servant (objref); + break; + } + + PortableServer::ObjectId_var oid; + this->uninstall_servant (svnt, y, oid.out ()); + } + + void + Session_Container::uninstall_home (Components::CCMHome_ptr homeref) + { + CIAO_TRACE ("Session_Container::uninstall_home"); + + this->uninstall (homeref, Container_Types::HOME_t); + } + + void + Session_Container::uninstall_component (Components::CCMObject_ptr homeref) + { + CIAO_TRACE ("Session_Container::uninstall_component"); + + this->uninstall (homeref, Container_Types::COMPONENT_t); + } + + void + Session_Container::uninstall_servant (PortableServer::Servant svnt, + Container_Types::OA_Type t, + PortableServer::ObjectId_out oid) + { + CIAO_TRACE ("Session_Container::uninstall_servant"); + + PortableServer::POA_ptr tmp = 0; + + if ((t == Container_Types::COMPONENT_t) || + (t == Container_Types::HOME_t)) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::uninstall_servant - " + "Removing component or home servant\n")); + tmp = this->component_poa_.in (); + } + else + { + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::uninstall_servant - " + "Removing facet or consumer servant\n")); + tmp = this->facet_cons_poa_.in (); + } + + try + { + PortableServer::ObjectId_var tmp_id; + tmp_id = tmp->servant_to_id (svnt); + tmp->deactivate_object (tmp_id); + svnt->_remove_ref (); + + CIAO_DEBUG ((LM_TRACE, CLINFO "Session_Container::uninstall_servant - " + "Servant successfully removed, reference count is %u\n", + svnt->_refcount_value ())); + + oid = tmp_id._retn (); + } + catch (const CORBA::Exception &ex) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Session_Container::uninstall_servant - " + "Caught CORBA exception while uninstalling servant: %C\n", + ex._info ().c_str ())); + throw Components::RemoveFailure (); + } + + } + + void + Session_Container::add_servant_to_map (PortableServer::ObjectId &, + Dynamic_Component_Servant_Base*) + { + CIAO_TRACE ("Session_Container::add_servant_to_map"); + throw CORBA::NO_IMPLEMENT (); + } + + void + Session_Container::delete_servant_from_map (PortableServer::ObjectId &) + { + CIAO_TRACE ("Session_Container::delete_servant_from_map"); + throw CORBA::NO_IMPLEMENT (); + } + + void + Session_Container::deactivate_facet (const PortableServer::ObjectId &) + { + CIAO_TRACE ("Session_Container::deactivate_facet"); + } + + CORBA::Object_ptr + Session_Container::get_home_objref (PortableServer::Servant) + { + CIAO_TRACE ("Session_Container::get_home_objref"); + throw CORBA::NO_IMPLEMENT (); + } + + CORBA::Object_ptr + Session_Container::generate_reference (const char *obj_id, + const char *repo_id, + Container_Types::OA_Type t) + { + CIAO_TRACE ("Session_Container::generate_reference"); + + PortableServer::POA_ptr tmp = 0; + + if (t == Container_Types::COMPONENT_t || + t == Container_Types::HOME_t) + { + tmp = this->component_poa_.in (); + } + else + { + tmp = this->facet_cons_poa_.in (); + } + + PortableServer::ObjectId_var oid = + PortableServer::string_to_ObjectId (obj_id); + + CORBA::String_var str = PortableServer::ObjectId_to_string (oid.in ()); + + CORBA::Object_var objref = + tmp->create_reference_with_id (oid.in (), repo_id); + + return objref._retn (); + } +} diff --git a/CIAO/ciao/Containers/Session/Session_Container.h b/CIAO/ciao/Containers/Session/Session_Container.h new file mode 100644 index 00000000000..5fc0467bdfb --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container.h @@ -0,0 +1,231 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Session_Container.h + * + * $Id$ + * + * Header file for CIAO's container implementations + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + * @author Gan Deng <dengg@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_SESSION_CONTAINER_H +#define CIAO_SESSION_CONTAINER_H + +#include /**/ "ace/pre.h" + +#include "ciao/Containers/Session/Session_Container_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Servant_Base.h" +#include "ciao/Containers/Container_Base.h" + +namespace CIAO +{ + class Session_Container; + class Servant_Activator; + class Home_Servant_Impl_Base; + + namespace Deployment + { + class CIAO_Container_i; + } + + typedef ::Components::HomeExecutorBase_ptr (*HomeFactory) (void); + typedef ::PortableServer::Servant (*HomeServantFactory) (::Components::HomeExecutorBase_ptr p, + ::CIAO::Container_ptr c, + const char *ins_name); + typedef ::Components::EnterpriseComponent_ptr (*ComponentFactory) (void); + typedef ::PortableServer::Servant (*ComponentServantFactory) (::Components::EnterpriseComponent_ptr, + ::CIAO::Container_ptr, + const char *); + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + HomeFactory, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> + HOMECREATOR_FUNCPTR_MAP; + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + HomeServantFactory, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> + HOMESERVANTCREATOR_FUNCPTR_MAP; + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + ComponentFactory, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> + COMPONENTCREATOR_FUNCPTR_MAP; + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + ComponentServantFactory, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> + COMPONENTSERVANTCREATOR_FUNCPTR_MAP; + + + struct Session_Container_Export Static_Config_EntryPoints_Maps + { + /// Map of home creator entry point name and func ptr + HOMECREATOR_FUNCPTR_MAP* home_creator_funcptr_map_; + + /// Map of home servant creator entry point name and func ptr + HOMESERVANTCREATOR_FUNCPTR_MAP* home_servant_creator_funcptr_map_; + + /// Map of home creator entry point name and func ptr + COMPONENTCREATOR_FUNCPTR_MAP* component_creator_funcptr_map_; + + /// Map of home servant creator entry point name and func ptr + COMPONENTSERVANTCREATOR_FUNCPTR_MAP* component_servant_creator_funcptr_map_; + }; + + class Session_Container_Export Session_Container : public Container_i + { + public: + Session_Container (CORBA::ORB_ptr o, + Deployment::CIAO_Container_i *container_impl, + bool static_config_flag = false, + const Static_Config_EntryPoints_Maps* static_entrypts_maps =0, + const char *name = 0, + const CORBA::PolicyList *more_policies = 0); + + virtual ~Session_Container (void); + + /** + * @brief Simply installing a home executor into the component. + * + * This operation install a home executor into the component. It + * requires the name of the DLLs to executor and the servant glue + * code, and the entry points to the respective DLLs. Currently, + * we don't try to manage the lifetime of DLL objects, but we + * should at some later point. + * + * @retval Home objref of the installed home. + */ + /// Install a new home + virtual Components::CCMHome_ptr install_home (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name); + + virtual void uninstall_home (Components::CCMHome_ptr homeref); + + virtual Components::CCMObject_ptr install_component (const char *primary_artifact, + const char *entry_point, + const char *servant_artifact, + const char *servant_entrypoint, + const char *name); + + /// Activate component + virtual void activate_component (Components::CCMObject_ptr compref); + + virtual void passivate_component (Components::CCMObject_ptr compref); + + virtual void uninstall_component (Components::CCMObject_ptr compref); + + /// Uninstall a servant + virtual void uninstall_servant (PortableServer::Servant objref, + Container_Types::OA_Type type, + PortableServer::ObjectId_out oid); + + /// Install a servant for component or home. + virtual CORBA::Object_ptr install_servant (PortableServer::Servant p, + Container_Types::OA_Type type, + PortableServer::ObjectId_out oid); + + /// Get an object reference to a component or home from the servant. + virtual CORBA::Object_ptr get_objref (PortableServer::Servant p); + + /// Uninstall a servant for component or home. + void uninstall (CORBA::Object_ptr objref, Container_Types::OA_Type t); + + /// Uninstall a servant for component or home. + void uninstall (PortableServer::Servant svt, Container_Types::OA_Type t); + + virtual void add_servant_to_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant); + + virtual void delete_servant_from_map (PortableServer::ObjectId &oid); + + // @@Jai, could yo please add documentation? + /* + * @@Jai, you may want to consider moving these away from the + * container interface. I know what you are going to say + * :-). Consider using dynamic_cast <> to access + * add_servant_to_map, delete_servant_from_map and + * deactivate_facet from the Swapping_Conatiner's interface. It + * would make the base container interface much cleaner. + */ + virtual void deactivate_facet (const PortableServer::ObjectId &oid); + + virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p); + + /// Analog of the POA method that creates an object reference from + /// an object id string. + CORBA::Object_ptr generate_reference (const char *obj_id, + const char *repo_id, + Container_Types::OA_Type t); + + /// Return the servant activator factory that activates the + /// servants for facets and consumers. + ::CIAO::Servant_Activator_ptr ports_servant_activator (void); + + private: + + /// Initialize the container with a name. + virtual void init (const char *name = 0, + const CORBA::PolicyList *more_policies = 0); + + /// Create POA for the component. + /** + * This is the POA that is returned to the component applications + * if they need one. + */ + void create_component_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root); + + /// Create POA for the facets and consumers alone. + void create_facet_consumer_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root); + + /// Not allowed to be + Session_Container (void); + + protected: + unsigned long number_; + + /// Static variable to store the highest number we have given out until + /// now + static ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> serial_number_; + + const bool static_config_flag_; + const Static_Config_EntryPoints_Maps* static_entrypts_maps_; + + /// The servant activator factory used to activate facets and + /// consumer servants. + Servant_Activator_var sa_; + }; +} + +#if defined (__ACE_INLINE__) +# include "Session_Container.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_SESSION_CONTAINER_H */ diff --git a/CIAO/ciao/Containers/Session/Session_Container.idl b/CIAO/ciao/Containers/Session/Session_Container.idl new file mode 100644 index 00000000000..65021db65c8 --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container.idl @@ -0,0 +1,15 @@ +/** + * @file Session_Container.idl + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * Extends the basic container interface for session capabilities. + */ + +#include "ciao/Containers/Container_Base.idl" + +module CIAO +{ + local interface Session_Container : Container + { + }; +}; diff --git a/CIAO/ciao/Containers/Session/Session_Container.inl b/CIAO/ciao/Containers/Session/Session_Container.inl new file mode 100644 index 00000000000..03461c07ac6 --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container.inl @@ -0,0 +1,13 @@ +// $Id$ -*- C++ -*- + +ACE_INLINE CORBA::Object_ptr +CIAO::Session_Container::get_objref (PortableServer::Servant p) +{ + return this->the_POA ()->servant_to_reference (p); +} + +ACE_INLINE CIAO::Servant_Activator_ptr +CIAO::Session_Container::ports_servant_activator (void) +{ + return Servant_Activator::_duplicate(this->sa_.in ()); +} diff --git a/CIAO/ciao/Containers/Session/Session_Container.mpc b/CIAO/ciao/Containers/Session/Session_Container.mpc new file mode 100644 index 00000000000..3ce03fe4548 --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container.mpc @@ -0,0 +1,21 @@ +// -*- MPC -*- +// $Id$ + +project(CIAO_Session_Container) : ccm_svnt, ciao_lib, ciao_container_base, utils, \ + ccm_componentserver_stub, ciao_servant_activator, ciao_servant { + dynamicflags += SESSION_CONTAINER_BUILD_DLL + idlflags += -Wb,export_include=Session_Container_export.h + idlflags += -Wb,export_macro=Session_Container_Export + + IDL_Files { + } + Source_Files { + Session_Container.cpp + } + Inline_Files { + Session_Container.inl + } + Header_Files { + Session_Container.h + } +} diff --git a/CIAO/ciao/Containers/Session/Session_Container_export.h b/CIAO/ciao/Containers/Session/Session_Container_export.h new file mode 100644 index 00000000000..15b5e6140c3 --- /dev/null +++ b/CIAO/ciao/Containers/Session/Session_Container_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Session_Container +// ------------------------------ +#ifndef SESSION_CONTAINER_EXPORT_H +#define SESSION_CONTAINER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SESSION_CONTAINER_HAS_DLL) +# define SESSION_CONTAINER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SESSION_CONTAINER_HAS_DLL */ + +#if !defined (SESSION_CONTAINER_HAS_DLL) +# define SESSION_CONTAINER_HAS_DLL 1 +#endif /* ! SESSION_CONTAINER_HAS_DLL */ + +#if defined (SESSION_CONTAINER_HAS_DLL) && (SESSION_CONTAINER_HAS_DLL == 1) +# if defined (SESSION_CONTAINER_BUILD_DLL) +# define Session_Container_Export ACE_Proper_Export_Flag +# define SESSION_CONTAINER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SESSION_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SESSION_CONTAINER_BUILD_DLL */ +# define Session_Container_Export ACE_Proper_Import_Flag +# define SESSION_CONTAINER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SESSION_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SESSION_CONTAINER_BUILD_DLL */ +#else /* SESSION_CONTAINER_HAS_DLL == 1 */ +# define Session_Container_Export +# define SESSION_CONTAINER_SINGLETON_DECLARATION(T) +# define SESSION_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SESSION_CONTAINER_HAS_DLL == 1 */ + +// Set SESSION_CONTAINER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SESSION_CONTAINER_NTRACE) +# if (ACE_NTRACE == 1) +# define SESSION_CONTAINER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SESSION_CONTAINER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SESSION_CONTAINER_NTRACE */ + +#if (SESSION_CONTAINER_NTRACE == 1) +# define SESSION_CONTAINER_TRACE(X) +#else /* (SESSION_CONTAINER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SESSION_CONTAINER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SESSION_CONTAINER_NTRACE == 1) */ + +#endif /* SESSION_CONTAINER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.cpp b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.cpp new file mode 100644 index 00000000000..e25fbe1a9e4 --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.cpp @@ -0,0 +1,48 @@ +#include "ciao/Containers/Swapping/Dynamic_Component_Activator.h" +#include "ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h" +#include "ciao/Logger/Log_Macros.h" + +ACE_RCSID (ciao, + Dynamic_Component_Activator, + "$Id$") + +#if !defined (__ACE_INLINE__) +# include "Dynamic_Component_Activator.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + Dynamic_Component_Activator::Dynamic_Component_Activator (CORBA::ORB_ptr o) + : orb_ (CORBA::ORB::_duplicate (o)) + { + } + + Dynamic_Component_Activator::~Dynamic_Component_Activator (void) + { + } + + PortableServer::Servant + Dynamic_Component_Activator::incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr) + { + Dynamic_Component_Servant_Base* servant = 0; + PortableServer::ObjectId new_oid (oid); + + if (this->servant_map_.find (oid, servant) == 0) + { + return servant->create (new_oid); + } + + return 0; + } + + void + Dynamic_Component_Activator::etherealize ( + const PortableServer::ObjectId &, + PortableServer::POA_ptr, + PortableServer::Servant, + CORBA::Boolean, + CORBA::Boolean) + { + } +} diff --git a/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.h b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.h new file mode 100644 index 00000000000..8c59e8c8087 --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.h @@ -0,0 +1,102 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Dynamic_Component_Activator.h + * + * $Id$ + * + * @authors Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H +#define CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H + +#include /**/ "ace/pre.h" + +#include "ciao/Containers/Swapping/Swapping_Container_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Hash_Map_Manager_T.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/ServantActivatorC.h" +#include "ccm/CCM_ContainerC.h" +#include "ciao/Logger/Log_Macros.h" + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +namespace CIAO +{ + + class Dynamic_Component_Servant_Base; + /** + * @class Dynamic_Component_Activator + * + * @brief Activator that is registered with the POA for facet and + * consumer servants. + * + */ + class CIAO_Swapping_Container_Export Dynamic_Component_Activator + : public virtual PortableServer::ServantActivator, + public virtual ::CORBA::LocalObject + { + public: + Dynamic_Component_Activator (CORBA::ORB_ptr o); + + virtual ~Dynamic_Component_Activator (void); + + /// Template methods overridden to get callbacks. + /** + * If you would like to know the details of the following two + * methods, please PortableServer documentation. This is probably + * not the place to document what these mean. + */ + virtual PortableServer::Servant incarnate ( + const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa); + + virtual void etherealize ( + const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations); + + void add_servant_to_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant); + + void delete_servant_from_map (PortableServer::ObjectId &oid); + + private: + /// Pointer to our ORB + CORBA::ORB_var orb_; + + ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, + Dynamic_Component_Servant_Base *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + TAO_SYNCH_MUTEX> + servant_map_; + }; +} + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__ACE_INLINE__) +# include "Dynamic_Component_Activator.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H */ diff --git a/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.inl b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.inl new file mode 100644 index 00000000000..c35b7d498b6 --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Dynamic_Component_Activator.inl @@ -0,0 +1,24 @@ +// $Id$ + +namespace CIAO +{ + ACE_INLINE void + Dynamic_Component_Activator::add_servant_to_map( + PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant) + { + this->servant_map_.bind (oid, servant); + } + + ACE_INLINE void + Dynamic_Component_Activator::delete_servant_from_map( + PortableServer::ObjectId &oid) + { + Dynamic_Component_Servant_Base* servant = 0; + + if (this->servant_map_.unbind (oid, servant) != 0) + { + CIAO_DEBUG ((LM_DEBUG, "Invalid object reference\n")); + } + } +} diff --git a/CIAO/ciao/Containers/Swapping/Swapping_Container.cpp b/CIAO/ciao/Containers/Swapping/Swapping_Container.cpp new file mode 100644 index 00000000000..5bc8577a2c8 --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Swapping_Container.cpp @@ -0,0 +1,230 @@ +// $Id$ + +#include "Swapping_Container.h" +#include "ciao/Containers/Servant_Activator.h" +#include "ciao/Containers/Swapping/Dynamic_Component_Activator.h" +#include "ciao/Logger/Log_Macros.h" + +#include "tao/Utils/PolicyList_Destroyer.h" + +#if !defined (__ACE_INLINE__) +# include "Swapping_Container.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + + ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> + Swapping_Container::serial_number_ (0); + + Swapping_Container::Swapping_Container (CORBA::ORB_ptr o, + Deployment::CIAO_Container_i *container_impl) + : Session_Container (o, container_impl), + number_ (0) + { + } + + Swapping_Container::~Swapping_Container () + { + } + + PortableServer::POA_ptr + Swapping_Container::the_home_servant_POA (void) const + { + return this->home_servant_poa_.in (); + } + + CORBA::Object_ptr + Swapping_Container::get_home_objref (PortableServer::Servant p) + { + return this->the_home_servant_POA ()->servant_to_reference (p); + } + + void + Swapping_Container::deactivate_facet (const PortableServer::ObjectId &) + { + // @todo + // this->the_facet_cons_POA ()->deactivate_object (oid); + } + + void + Swapping_Container::init (const char *name, + const CORBA::PolicyList *more_policies) + { + char buffer[MAXPATHLEN]; + + if (name == 0) + { + this->number_ = ++Swapping_Container::serial_number_; + ACE_OS::sprintf (buffer, + "CIAO::Swapping_Container-%ld", + this->number_); + name = buffer; + } + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA"); + + if (CORBA::is_nil (poa_object.in ())) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "CIAO::Swapping_Container: Unable to initialize the POA.\n")); + } + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + this->create_servant_POA (name, more_policies, root_poa.in ()); + + this->create_home_servant_POA ("home servant POA", + more_policies, + root_poa.in ()); + + this->create_connections_POA (root_poa.in ()); + + PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); + + poa_manager->activate (); + } + + void + Swapping_Container::add_servant_to_map ( + PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant) + { + this->dsa_->add_servant_to_map (oid, servant); + } + + void + Swapping_Container::delete_servant_from_map ( + PortableServer::ObjectId &oid) + { + this->dsa_->delete_servant_from_map (oid); + } + + void + Swapping_Container::create_home_servant_POA ( + const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root) + { + CORBA::PolicyList policies (0); + + if (p != 0) + { + policies = *p; + } + + PortableServer::POAManager_var poa_manager = root->the_POAManager (); + + this->home_servant_poa_ = + root->create_POA (name, poa_manager.in (), policies); + } + + void + Swapping_Container::create_connections_POA (PortableServer::POA_ptr root) + { + PortableServer::POAManager_var poa_manager = + root->the_POAManager (); + + TAO::Utils::PolicyList_Destroyer policies (3); + policies.length (3); + + policies[0] = + root->create_id_assignment_policy (PortableServer::USER_ID); + + policies[1] = + root->create_request_processing_policy ( + PortableServer::USE_SERVANT_MANAGER); + + + // Servant Retention Policy. + policies[2] = + root->create_servant_retention_policy (PortableServer::RETAIN); + + this->facet_cons_poa_ = + root->create_POA ("facet_consumer_poa", poa_manager.in (), policies); + + ACE_NEW_THROW_EX (this->sa_, + Servant_Activator_i (this->orb_.in ()), + CORBA::NO_MEMORY ()); + + this->facet_cons_poa_->set_servant_manager (this->sa_); + } + + void + Swapping_Container::create_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root) + { + // @@ Jai, see how this method more or less does things (like + // setting policies) like create_connections_POA (). Could you + // please refactor them into a seperate method? + CORBA::PolicyList policies (0); + + if (p != 0) + { + policies = *p; + } + + PortableServer::POAManager_var poa_manager = + root->the_POAManager (); + + CORBA::ULong policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_id_assignment_policy (PortableServer::USER_ID); + + policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_request_processing_policy ( + PortableServer::USE_SERVANT_MANAGER); + + policy_length = policies.length (); + policies.length (policy_length + 1); + policies[policy_length] = + root->create_servant_retention_policy (PortableServer::RETAIN); + + this->component_poa_ = root->create_POA (name, poa_manager.in (), policies); + + ACE_NEW_THROW_EX (this->dsa_, + Dynamic_Component_Activator (this->orb_.in ()), + CORBA::NO_MEMORY ()); + + this->component_poa_->set_servant_manager (this->dsa_); + } + + void + Swapping_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref) + { + PortableServer::POA_ptr tmp = this->home_servant_poa_.in (); + PortableServer::ObjectId_var oid = + tmp->reference_to_id (homeref); + + tmp->deactivate_object (oid.in ()); + } + + CORBA::Object_ptr + Swapping_Container::install_servant (PortableServer::Servant p, + Container_Types::OA_Type t, + PortableServer::ObjectId_out ) + { + PortableServer::POA_ptr tmp = 0; + + if (t == Container_Types::COMPONENT_t) + { + tmp = this->home_servant_poa_.in (); + } + else + { + tmp = this->facet_cons_poa_.in (); + } + + PortableServer::ObjectId_var oid_var = tmp->activate_object (p); + + CORBA::Object_var objref = tmp->id_to_reference (oid_var.in ()); + + return objref._retn (); + } +} diff --git a/CIAO/ciao/Containers/Swapping/Swapping_Container.h b/CIAO/ciao/Containers/Swapping/Swapping_Container.h new file mode 100644 index 00000000000..988caf8c058 --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Swapping_Container.h @@ -0,0 +1,115 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Swapping_Container.h + * + * $Id$ + * + * Header file for CIAO's Dynamic Swapping container implementations + * + * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_SWAPPING_CONTAINER_H +#define CIAO_SWAPPING_CONTAINER_H + +#include /**/ "ace/pre.h" + +#include "ciao/Containers/Swapping/Swapping_Container_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Containers/Session/Session_Container.h" +#include "tao/PortableServer/Servant_Base.h" +#include "ciao/Containers/Container_Base.h" + +namespace CIAO +{ + class Dynamic_Component_Servant_Base; + class Dynamic_Component_Activator; + + class CIAO_Swapping_Container_Export Swapping_Container : public Session_Container + { + public: + Swapping_Container (CORBA::ORB_ptr o, Deployment::CIAO_Container_i *container_impl); + + virtual ~Swapping_Container (void); + + /// Initialize the container with a name. + virtual void init (const char *name = 0, + const CORBA::PolicyList *more_policies = 0); + + /// Install a servant for component or home. + virtual CORBA::Object_ptr install_servant (PortableServer::Servant p, + Container_Types::OA_Type type, + PortableServer::ObjectId_out oid); + + virtual CORBA::Object_ptr get_objref (PortableServer::Servant p); + + virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref); + + virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p); + + virtual void add_servant_to_map (PortableServer::ObjectId &oid, + Dynamic_Component_Servant_Base* servant); + + virtual void delete_servant_from_map (PortableServer::ObjectId &oid); + + virtual void deactivate_facet (const PortableServer::ObjectId &oid); + + PortableServer::POA_ptr the_home_servant_POA (void) const; + + private: + /// Create POA for the component. + void create_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root); + + void create_home_servant_POA (const char *name, + const CORBA::PolicyList *p, + PortableServer::POA_ptr root); + + void create_connections_POA (PortableServer::POA_ptr root); + + protected: + unsigned long number_; + + /// Static variable to store the highest number we have given out until + /// now + static ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> serial_number_; + + Dynamic_Component_Activator *dsa_; + }; +} + +// Macro for registration of an OBV factory in the generated +// servant class. Similar to the macro for TAO in +// tao/ValueType/ValueFactory.h but here we take advantage of +// the fact that we have access to the current ORB indirectly +// through the context and container. +// @@Jai, is this macro required here? +#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ + { \ + CORBA::ValueFactory factory = new FACTORY; \ + CORBA::ORB_ptr orb = \ + this->context_->_ciao_the_Container ()->the_ORB (); \ + CORBA::ValueFactory prev_factory = \ + orb->register_value_factory ( \ + VALUETYPE::_tao_obv_static_repository_id (), \ + factory); \ + CORBA::remove_ref (prev_factory); \ + CORBA::add_ref (factory); \ + } + +#if defined (__ACE_INLINE__) +# include "Swapping_Container.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_SWAPPING_CONTAINER_H */ diff --git a/CIAO/ciao/Swapping_Container.inl b/CIAO/ciao/Containers/Swapping/Swapping_Container.inl index 698eec0324d..698eec0324d 100644 --- a/CIAO/ciao/Swapping_Container.inl +++ b/CIAO/ciao/Containers/Swapping/Swapping_Container.inl diff --git a/CIAO/ciao/Containers/Swapping/Swapping_Container.mpc b/CIAO/ciao/Containers/Swapping/Swapping_Container.mpc new file mode 100644 index 00000000000..f5313a4e49e --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Swapping_Container.mpc @@ -0,0 +1,6 @@ +// $Id$ + +project(CIAO_Swapping_Container) : ciao_lib, ciao_container_base, utils, \ + ccm_componentserver_stub, ciao_servant_activator, ciao_session_container { + dynamicflags = SWAPPING_CONTAINER_BUILD_DLL +} diff --git a/CIAO/ciao/Containers/Swapping/Swapping_Container_export.h b/CIAO/ciao/Containers/Swapping/Swapping_Container_export.h new file mode 100644 index 00000000000..e0e25ac317d --- /dev/null +++ b/CIAO/ciao/Containers/Swapping/Swapping_Container_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Swapping_Container +// ------------------------------ +#ifndef SWAPPING_CONTAINER_EXPORT_H +#define SWAPPING_CONTAINER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SWAPPING_CONTAINER_HAS_DLL) +# define SWAPPING_CONTAINER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SWAPPING_CONTAINER_HAS_DLL */ + +#if !defined (SWAPPING_CONTAINER_HAS_DLL) +# define SWAPPING_CONTAINER_HAS_DLL 1 +#endif /* ! SWAPPING_CONTAINER_HAS_DLL */ + +#if defined (SWAPPING_CONTAINER_HAS_DLL) && (SWAPPING_CONTAINER_HAS_DLL == 1) +# if defined (SWAPPING_CONTAINER_BUILD_DLL) +# define CIAO_Swapping_Container_Export ACE_Proper_Export_Flag +# define SWAPPING_CONTAINER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SWAPPING_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SWAPPING_CONTAINER_BUILD_DLL */ +# define CIAO_Swapping_Container_Export ACE_Proper_Import_Flag +# define SWAPPING_CONTAINER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SWAPPING_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SWAPPING_CONTAINER_BUILD_DLL */ +#else /* SWAPPING_CONTAINER_HAS_DLL == 1 */ +# define CIAO_Swapping_Container_Export +# define SWAPPING_CONTAINER_SINGLETON_DECLARATION(T) +# define SWAPPING_CONTAINER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SWAPPING_CONTAINER_HAS_DLL == 1 */ + +// Set SWAPPING_CONTAINER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SWAPPING_CONTAINER_NTRACE) +# if (ACE_NTRACE == 1) +# define SWAPPING_CONTAINER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SWAPPING_CONTAINER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SWAPPING_CONTAINER_NTRACE */ + +#if (SWAPPING_CONTAINER_NTRACE == 1) +# define SWAPPING_CONTAINER_TRACE(X) +#else /* (SWAPPING_CONTAINER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SWAPPING_CONTAINER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SWAPPING_CONTAINER_NTRACE == 1) */ + +#endif /* SWAPPING_CONTAINER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Context_Impl_Base.cpp b/CIAO/ciao/Context_Impl_Base.cpp deleted file mode 100644 index 4074ee8c459..00000000000 --- a/CIAO/ciao/Context_Impl_Base.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -#include "Context_Impl_Base.h" -#include "Container_Base.h" - -#if !defined (__ACE_INLINE__) -# include "Context_Impl_Base.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - Context_Impl_Base::Context_Impl_Base (void) - { - // This constructor is here to keep MSVC happy and should - // not be used at all. This constructor should be removed - // in the future. Until then, we have the ACE_ASSERT - // below to detect a runtime call to this constructor. - ACE_ASSERT (0); - } - - Context_Impl_Base::Context_Impl_Base (Components::CCMHome_ptr home, - Session_Container * c) - : home_ (Components::CCMHome::_duplicate (home)), - container_ (c) - { - } - - Context_Impl_Base::~Context_Impl_Base (void) - { - } - - // Operations from ::Components::CCMContext. - - Components::Principal_ptr - Context_Impl_Base::get_caller_principal (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - Components::CCMHome_ptr - Context_Impl_Base::get_CCM_home (void) - { - return Components::CCMHome::_duplicate (this->home_.in ()); - } - - CORBA::Boolean - Context_Impl_Base::get_rollback_only (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - Components::Transaction::UserTransaction_ptr - Context_Impl_Base::get_user_transaction (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - CORBA::Boolean - Context_Impl_Base::is_caller_in_role (const char * /* role */) - { - throw CORBA::NO_IMPLEMENT (); - } - - void - Context_Impl_Base::set_rollback_only (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - CORBA::Object_ptr - Context_Impl_Base::resolve_service_reference(const char *) - { - throw CORBA::NO_IMPLEMENT (); - } -} diff --git a/CIAO/ciao/Context_Impl_Base.h b/CIAO/ciao/Context_Impl_Base.h deleted file mode 100644 index ea7246998d2..00000000000 --- a/CIAO/ciao/Context_Impl_Base.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Context_Impl_Base.h - * - * $Id$ - * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated context class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_CONTEXT_IMPL_BASE_H -#define CIAO_CONTEXT_IMPL_BASE_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/CCM_ContainerC.h" - -namespace Components -{ - class CCMHome; - typedef CCMHome *CCMHome_ptr; - - typedef - TAO_Objref_Var_T< - CCMHome - > - CCMHome_var; -} - -namespace CIAO -{ - class Session_Container; - - /** - * @class Context_Impl_Base - * - * @brief Non-template base class for Context_Impl. - * - * Holds the non-template parts of its child class - * Context_Impl. - */ - class CIAO_SERVER_Export Context_Impl_Base - : public virtual Components::CCMContext - { - public: - /// @todo This constructor should be declarated private but it seems - /// the compilers want it, have to sort this out in detail. - Context_Impl_Base (void); - - Context_Impl_Base (Components::CCMHome_ptr home, Session_Container * c); - - virtual ~Context_Impl_Base (void); - - // Operations from ::Components::CCMContext. - - virtual Components::Principal_ptr get_caller_principal (); - - virtual Components::CCMHome_ptr get_CCM_home (); - - virtual CORBA::Boolean get_rollback_only (); - - virtual Components::Transaction::UserTransaction_ptr get_user_transaction (); - - virtual CORBA::Boolean is_caller_in_role (const char *role); - - virtual void set_rollback_only (); - - virtual CORBA::Object_ptr resolve_service_reference(const char *service_id); - - // CIAO-specific. - - CIAO::Session_Container *_ciao_the_Container (void) const; - - // Accessors for the private member. - const char *_ciao_instance_id (void) const; - void _ciao_instance_id (const char *instance_id); - - protected: - Components::CCMHome_var home_; - Session_Container *container_; - - private: - CORBA::String_var ciao_instance_id_; - }; -} - -#if defined (__ACE_INLINE__) -# include "Context_Impl_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONTEXT_IMPL_BASE_H */ diff --git a/CIAO/ciao/Context_Impl_Base.inl b/CIAO/ciao/Context_Impl_Base.inl deleted file mode 100644 index 65f2ee55682..00000000000 --- a/CIAO/ciao/Context_Impl_Base.inl +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -namespace CIAO -{ - // CIAO-specific. - - ACE_INLINE CIAO::Session_Container * - Context_Impl_Base::_ciao_the_Container (void) const - { - return this->container_; - } - - ACE_INLINE const char * - Context_Impl_Base::_ciao_instance_id (void) const - { - return this->ciao_instance_id_.in (); - } - - ACE_INLINE void - Context_Impl_Base::_ciao_instance_id (const char *instance_id) - { - this->ciao_instance_id_ = instance_id; - } -} diff --git a/CIAO/ciao/Context_Impl_T.cpp b/CIAO/ciao/Context_Impl_T.cpp deleted file mode 100644 index 29558dafb0b..00000000000 --- a/CIAO/ciao/Context_Impl_T.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// $Id$ - -#ifndef CIAO_CONTEXT_IMPL_T_C -#define CIAO_CONTEXT_IMPL_T_C - -#include "Context_Impl_T.h" - -namespace CIAO -{ - template <typename BASE_CTX, - typename SVNT, - typename COMP> - Context_Impl<BASE_CTX, SVNT, COMP>::Context_Impl ( - Components::CCMHome_ptr the_home, - Session_Container *c, - SVNT *sv) - : Context_Impl_Base (the_home, c), - servant_ (sv) - { - } - - template <typename BASE_CTX, - typename SVNT, - typename COMP> - Context_Impl<BASE_CTX, SVNT, COMP>::~Context_Impl (void) - { - } - - // Operations from ::Components::SessionContext. - - template <typename BASE_CTX, - typename SVNT, - typename COMP> - CORBA::Object_ptr - Context_Impl<BASE_CTX, SVNT, COMP>::get_CCM_object (void) - { - if (CORBA::is_nil (this->component_.in ())) - { - CORBA::Object_var obj; - - try - { - obj = this->container_->get_objref (this->servant_); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Caught Exception \n"); - return CORBA::Object::_nil (); - } - - this->component_ = COMP::_narrow (obj.in ()); - - if (CORBA::is_nil (this->component_.in ())) - { - throw CORBA::INTERNAL (); - } - } - - return COMP::_duplicate (this->component_.in ()); - } -} - -#endif /* CIAO_CONTEXT_IMPL_T_C */ diff --git a/CIAO/ciao/Context_Impl_T.h b/CIAO/ciao/Context_Impl_T.h deleted file mode 100644 index 10929693962..00000000000 --- a/CIAO/ciao/Context_Impl_T.h +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Context_Impl_T.h - * - * $Id$ - * - * This file contains the declaration of a mixin base class for - * the generated context class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_CONTEXT_IMPL_T_H -#define CIAO_CONTEXT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "Context_Impl_Base.h" -#include "tao/LocalObject.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL -namespace CORBA -{ - class SystemException; -} - -namespace SecurityLevel2 -{ - class Credentials; -} -TAO_END_VERSIONED_NAMESPACE_DECL - -namespace Components -{ - typedef SecurityLevel2::Credentials Principal; - typedef Principal *Principal_ptr; - - class IllegalState; - - namespace Transaction - { - class UserTransaction; - typedef UserTransaction *UserTransaction_ptr; - } -} - -namespace CIAO -{ - class Session_Container; - - /** - * @class Context_Impl - * - * @brief Mixin base class for generated context. - * - * This class implements operations and contains parameterized - * members common to all generated servants. - */ - template <typename BASE_CTX, - typename SVNT, - typename COMP> - class Context_Impl : public virtual BASE_CTX, - public virtual Context_Impl_Base, - public virtual ::CORBA::LocalObject - { - public: - /// Type definition of the context type. - typedef BASE_CTX context_type; - - /// Type definition of the var type for the context. - typedef typename context_type::_var_type _var_type; - - /// Type definition of the servant type. - typedef SVNT servant_type; - - /// Type definition of the component type. - typedef COMP component_type; - - Context_Impl (Components::CCMHome_ptr the_home, - Session_Container *c, - SVNT *sv); - - virtual ~Context_Impl (void); - - // Operations from ::Components::SessionContext. - - virtual CORBA::Object_ptr get_CCM_object (); - - protected: - SVNT *servant_; - typename COMP::_var_type component_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Context_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Context_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONTEXT_IMPL_T_H */ diff --git a/CIAO/ciao/Contexts/Context.mpc b/CIAO/ciao/Contexts/Context.mpc new file mode 100644 index 00000000000..a016053c39c --- /dev/null +++ b/CIAO/ciao/Contexts/Context.mpc @@ -0,0 +1,16 @@ +//$Id$ +project(CIAO_Context_Impl) : ccm_svnt, ciao_container_base, portableserver { + dynamicflags = CONTEXT_IMPL_BUILD_DLL + Source_Files { + Context_Impl_Base.cpp + Context_Impl_T.cpp + } + Header_Files { + Context_Impl_Base.h + Context_Impl_T.h + Context_Impl_export.h + } + Inline_Files { + Context_Impl_Base.inl + } +} diff --git a/CIAO/ciao/Contexts/Context_Impl_Base.cpp b/CIAO/ciao/Contexts/Context_Impl_Base.cpp new file mode 100644 index 00000000000..d695b58025a --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_Base.cpp @@ -0,0 +1,76 @@ +// $Id$ + +#include "Context_Impl_Base.h" + +#if !defined (__ACE_INLINE__) +# include "Context_Impl_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include "ciao/Containers/Container_BaseC.h" + +namespace CIAO +{ + Context_Impl_Base::Context_Impl_Base (void) + { + // This constructor is here to keep MSVC happy and should + // not be used at all. This constructor should be removed + // in the future. Until then, we have the ACE_ASSERT + // below to detect a runtime call to this constructor. + ACE_ASSERT (0); + } + + Context_Impl_Base::Context_Impl_Base (Components::CCMHome_ptr home, + Container_ptr c) + : home_ (Components::CCMHome::_duplicate (home)), + container_ (Container::_duplicate (c)) + { + } + + Context_Impl_Base::~Context_Impl_Base (void) + { + } + + // Operations from ::Components::CCMContext. + + Components::Principal_ptr + Context_Impl_Base::get_caller_principal (void) + { + throw CORBA::NO_IMPLEMENT (); + } + + Components::CCMHome_ptr + Context_Impl_Base::get_CCM_home (void) + { + return Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + Context_Impl_Base::get_rollback_only (void) + { + throw CORBA::NO_IMPLEMENT (); + } + + Components::Transaction::UserTransaction_ptr + Context_Impl_Base::get_user_transaction (void) + { + throw CORBA::NO_IMPLEMENT (); + } + + CORBA::Boolean + Context_Impl_Base::is_caller_in_role (const char * /* role */) + { + throw CORBA::NO_IMPLEMENT (); + } + + void + Context_Impl_Base::set_rollback_only (void) + { + throw CORBA::NO_IMPLEMENT (); + } + + CORBA::Object_ptr + Context_Impl_Base::resolve_service_reference(const char *) + { + throw CORBA::NO_IMPLEMENT (); + } +} diff --git a/CIAO/ciao/Contexts/Context_Impl_Base.h b/CIAO/ciao/Contexts/Context_Impl_Base.h new file mode 100644 index 00000000000..0db40ef13e0 --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_Base.h @@ -0,0 +1,106 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Context_Impl_Base.h + * + * $Id$ + * + * This file contains the non-template declaration of a base class for + * the template mixin for the generated context class. + * + * @author Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_CONTEXT_IMPL_BASE_H +#define CIAO_CONTEXT_IMPL_BASE_H + +#include /**/ "ace/pre.h" + +#include "Context_Impl_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ccm/CCM_ContextC.h" + +namespace Components +{ + class CCMHome; + typedef CCMHome *CCMHome_ptr; + + typedef + TAO_Objref_Var_T< + CCMHome + > + CCMHome_var; +} + +namespace CIAO +{ + class Container; + typedef Container *Container_ptr; + typedef TAO_Objref_Var_T<Container> Container_var; + + /** + * @class Context_Impl_Base + * + * @brief Non-template base class for Context_Impl. + * + * Holds the non-template parts of its child class + * Context_Impl. + */ + class Context_Impl_Export Context_Impl_Base + : public virtual Components::CCMContext + { + public: + /// @todo This constructor should be declarated private but it seems + /// the compilers want it, have to sort this out in detail. + Context_Impl_Base (void); + + Context_Impl_Base (Components::CCMHome_ptr home, Container_ptr c); + + virtual ~Context_Impl_Base (void); + + // Operations from ::Components::CCMContext. + + virtual Components::Principal_ptr get_caller_principal (); + + virtual Components::CCMHome_ptr get_CCM_home (); + + virtual CORBA::Boolean get_rollback_only (); + + virtual Components::Transaction::UserTransaction_ptr get_user_transaction (); + + virtual CORBA::Boolean is_caller_in_role (const char *role); + + virtual void set_rollback_only (); + + virtual CORBA::Object_ptr resolve_service_reference(const char *service_id); + + // CIAO-specific. + + CIAO::Container_ptr _ciao_the_Container (void) const; + + // Accessors for the private member. + const char *_ciao_instance_id (void) const; + void _ciao_instance_id (const char *instance_id); + + protected: + Components::CCMHome_var home_; + Container_var container_; + + private: + CORBA::String_var ciao_instance_id_; + }; +} + +#if defined (__ACE_INLINE__) +# include "Context_Impl_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_CONTEXT_IMPL_BASE_H */ diff --git a/CIAO/ciao/Contexts/Context_Impl_Base.inl b/CIAO/ciao/Contexts/Context_Impl_Base.inl new file mode 100644 index 00000000000..7365d9c0b48 --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_Base.inl @@ -0,0 +1,24 @@ +// $Id$ + +namespace CIAO +{ + // CIAO-specific. + + ACE_INLINE CIAO::Container_ptr + Context_Impl_Base::_ciao_the_Container (void) const + { + return this->container_; + } + + ACE_INLINE const char * + Context_Impl_Base::_ciao_instance_id (void) const + { + return this->ciao_instance_id_.in (); + } + + ACE_INLINE void + Context_Impl_Base::_ciao_instance_id (const char *instance_id) + { + this->ciao_instance_id_ = instance_id; + } +} diff --git a/CIAO/ciao/Contexts/Context_Impl_T.cpp b/CIAO/ciao/Contexts/Context_Impl_T.cpp new file mode 100644 index 00000000000..630b0a0234f --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_T.cpp @@ -0,0 +1,63 @@ +// $Id$ + +#ifndef CIAO_CONTEXT_IMPL_T_C +#define CIAO_CONTEXT_IMPL_T_C + +#include "Context_Impl_T.h" + +namespace CIAO +{ + template <typename BASE_CTX, + typename SVNT, + typename COMP> + Context_Impl<BASE_CTX, SVNT, COMP>::Context_Impl ( + Components::CCMHome_ptr the_home, + Container_ptr c, + SVNT *sv) + : Context_Impl_Base (the_home, c), + servant_ (sv) + { + } + + template <typename BASE_CTX, + typename SVNT, + typename COMP> + Context_Impl<BASE_CTX, SVNT, COMP>::~Context_Impl (void) + { + } + + // Operations from ::Components::SessionContext. + + template <typename BASE_CTX, + typename SVNT, + typename COMP> + CORBA::Object_ptr + Context_Impl<BASE_CTX, SVNT, COMP>::get_CCM_object (void) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj; + + try + { + obj = this->container_->get_objref (this->servant_); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught Exception \n"); + return CORBA::Object::_nil (); + } + + this->component_ = COMP::_narrow (obj.in ()); + + if (CORBA::is_nil (this->component_.in ())) + { + throw CORBA::INTERNAL (); + } + } + + return COMP::_duplicate (this->component_.in ()); + } +} + +#endif /* CIAO_CONTEXT_IMPL_T_C */ diff --git a/CIAO/ciao/Contexts/Context_Impl_T.h b/CIAO/ciao/Contexts/Context_Impl_T.h new file mode 100644 index 00000000000..284251771cd --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_T.h @@ -0,0 +1,114 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Context_Impl_T.h + * + * $Id$ + * + * This file contains the declaration of a mixin base class for + * the generated context class. + * + * @author Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + + +#ifndef CIAO_CONTEXT_IMPL_T_H +#define CIAO_CONTEXT_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "Context_Impl_Base.h" +#include "tao/LocalObject.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL +namespace CORBA +{ + class SystemException; +} + +namespace SecurityLevel2 +{ + class Credentials; +} +TAO_END_VERSIONED_NAMESPACE_DECL + +namespace Components +{ + typedef SecurityLevel2::Credentials Principal; + typedef Principal *Principal_ptr; + + class IllegalState; + + namespace Transaction + { + class UserTransaction; + typedef UserTransaction *UserTransaction_ptr; + } +} + +namespace CIAO +{ + class Container; + typedef Container *Container_ptr; + + /** + * @class Context_Impl + * + * @brief Mixin base class for generated context. + * + * This class implements operations and contains parameterized + * members common to all generated servants. + */ + template <typename BASE_CTX, + typename SVNT, + typename COMP> + class Context_Impl : public virtual BASE_CTX, + public virtual Context_Impl_Base, + public virtual ::CORBA::LocalObject + { + public: + /// Type definition of the context type. + typedef BASE_CTX context_type; + + /// Type definition of the var type for the context. + typedef typename context_type::_var_type _var_type; + + /// Type definition of the servant type. + typedef SVNT servant_type; + + /// Type definition of the component type. + typedef COMP component_type; + + Context_Impl (Components::CCMHome_ptr the_home, + Container_ptr c, + SVNT *sv); + + virtual ~Context_Impl (void); + + // Operations from ::Components::SessionContext. + + virtual CORBA::Object_ptr get_CCM_object (); + + protected: + SVNT *servant_; + typename COMP::_var_type component_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Context_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Context_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_CONTEXT_IMPL_T_H */ diff --git a/CIAO/ciao/Contexts/Context_Impl_export.h b/CIAO/ciao/Contexts/Context_Impl_export.h new file mode 100644 index 00000000000..644dbfc00bb --- /dev/null +++ b/CIAO/ciao/Contexts/Context_Impl_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Context_Impl +// ------------------------------ +#ifndef CONTEXT_IMPL_EXPORT_H +#define CONTEXT_IMPL_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CONTEXT_IMPL_HAS_DLL) +# define CONTEXT_IMPL_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CONTEXT_IMPL_HAS_DLL */ + +#if !defined (CONTEXT_IMPL_HAS_DLL) +# define CONTEXT_IMPL_HAS_DLL 1 +#endif /* ! CONTEXT_IMPL_HAS_DLL */ + +#if defined (CONTEXT_IMPL_HAS_DLL) && (CONTEXT_IMPL_HAS_DLL == 1) +# if defined (CONTEXT_IMPL_BUILD_DLL) +# define Context_Impl_Export ACE_Proper_Export_Flag +# define CONTEXT_IMPL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONTEXT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONTEXT_IMPL_BUILD_DLL */ +# define Context_Impl_Export ACE_Proper_Import_Flag +# define CONTEXT_IMPL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONTEXT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONTEXT_IMPL_BUILD_DLL */ +#else /* CONTEXT_IMPL_HAS_DLL == 1 */ +# define Context_Impl_Export +# define CONTEXT_IMPL_SINGLETON_DECLARATION(T) +# define CONTEXT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONTEXT_IMPL_HAS_DLL == 1 */ + +// Set CONTEXT_IMPL_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONTEXT_IMPL_NTRACE) +# if (ACE_NTRACE == 1) +# define CONTEXT_IMPL_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONTEXT_IMPL_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONTEXT_IMPL_NTRACE */ + +#if (CONTEXT_IMPL_NTRACE == 1) +# define CONTEXT_IMPL_TRACE(X) +#else /* (CONTEXT_IMPL_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONTEXT_IMPL_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONTEXT_IMPL_NTRACE == 1) */ + +#endif /* CONTEXT_IMPL_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl b/CIAO/ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl new file mode 100644 index 00000000000..98bb309d39c --- /dev/null +++ b/CIAO/ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl @@ -0,0 +1,17 @@ +// $Id$ + +#include "ccm/CCM_Container.idl" +#include "tao/PortableServer/PortableServer_include.pidl" + +module CIAO +{ + local interface UpgradeableContext : ::Components::SessionContext + { + ::Components::ConsumerDescriptions get_registered_consumers + (in ::Components::FeatureName publisher_name) + raises (::Components::InvalidName, ::Components::InvalidConnection); + void deactivate_facet (in PortableServer::ObjectId oid); + void update_port_activator (in PortableServer::ObjectId oid); + void remove_facet (in Object reference); + }; +}; diff --git a/CIAO/ciao/Upgradeable_Context_Impl_T.cpp b/CIAO/ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.cpp index 839700d77c3..839700d77c3 100644 --- a/CIAO/ciao/Upgradeable_Context_Impl_T.cpp +++ b/CIAO/ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.cpp diff --git a/CIAO/ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.h b/CIAO/ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.h new file mode 100644 index 00000000000..d51d8483b35 --- /dev/null +++ b/CIAO/ciao/Contexts/Swapping/Upgradeable_Context_Impl_T.h @@ -0,0 +1,76 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Upgradeable_Context_Impl_T.h + * + * $Id$ + * + */ +//============================================================================= + + +#ifndef CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H +#define CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "ciao/CIAO_UpgradeableContextC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Context_Impl_T.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL +namespace CORBA +{ + class SystemException; +} +TAO_END_VERSIONED_NAMESPACE_DECL + +namespace CIAO +{ + template <typename BASE_CTX, + typename SVNT, + typename COMP> + class Upgradeable_Context_Impl + : public virtual Context_Impl<BASE_CTX, SVNT, COMP> + { + public: + Upgradeable_Context_Impl (Components::CCMHome_ptr the_home, + Session_Container *c, + SVNT *sv); + + virtual ~Upgradeable_Context_Impl (void); + + virtual void + deactivate_facet (const PortableServer::ObjectId &oid); + + virtual void + update_port_activator (const PortableServer::ObjectId &oid); + + virtual void + remove_facet (CORBA::Object_ptr reference); + + virtual ::Components::ConsumerDescriptions * + get_registered_consumers (const char *publisher_name) = 0; + + private: + /// Not to be used + Upgradeable_Context_Impl (void); + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Upgradeable_Context_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Upgradeable_Context_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H */ diff --git a/CIAO/ciao/Cookies.h b/CIAO/ciao/Cookies.h deleted file mode 100644 index dedd5da1da3..00000000000 --- a/CIAO/ciao/Cookies.h +++ /dev/null @@ -1,70 +0,0 @@ -// $Id$ - -/** - * @file Cookies.h - * - * A CIAO implementation of Cookie valuetype. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_COOKIES_H -#define CIAO_COOKIES_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Container_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_CookieC.h" - -#include "ace/Active_Map_Manager.h" - -namespace CIAO -{ - /** - * @class Cookie_Impl - * - * @brief A cookie implementation using an unsigned integer - * big enough to hold an address, even on a 64-bit machine. - */ - class CIAO_CONTAINER_Export Cookie_Impl - : public virtual OBV_Components::Cookie - { - public: - Cookie_Impl (void); - virtual ~Cookie_Impl (void); - - /// Initialize a @c Cookie with a @c ptrdiff_t - Cookie_Impl (ptrdiff_t const &key); - - /// Extract the @c CORBA::ULong - static bool extract (Components::Cookie const * const c, - ptrdiff_t &key); - }; - - /** - * @class Cookie_Impl_init - * - * @brief Valuefactory implementation for Cookie_Impl. - */ - class CIAO_CONTAINER_Export Cookie_Impl_init - : public virtual Components::Cookie_init - { - public: - virtual ~Cookie_Impl_init (void); - - virtual CORBA::ValueBase *create_for_unmarshal (void); - }; -} - -#if defined (__ACE_INLINE__) -#include "Cookies.inl" -#endif /* defined INLINE */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_COOKIES_H */ diff --git a/CIAO/ciao/CosPersistentState.idl b/CIAO/ciao/CosPersistentState.idl deleted file mode 100644 index a5211d071aa..00000000000 --- a/CIAO/ciao/CosPersistentState.idl +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -/** - * @@ This is just a temporary file. Since TAO does not have - * CosPersistentState at all, we use this file to define - * types necessary to get ComponentBase.idl to compile. - * - * Compile with - * tao_idl -Gv CosPersistentState.idl - */ - -#if !defined (CIAO_COSPERSISTENTSTATE_PIDL) -#define CIAO_COSPERSISTENTSTATE_PIDL - -module CosPersistentState { - - local interface CatalogBase - { - }; - - typedef sequence<octet> _TypeId; - typedef string Pid; -}; -#endif /* CIAO_COSPERSISTENTSTATE_PIDL */ diff --git a/CIAO/ciao/Dynamic_Component_Activator.cpp b/CIAO/ciao/Dynamic_Component_Activator.cpp deleted file mode 100644 index 5145f67d56b..00000000000 --- a/CIAO/ciao/Dynamic_Component_Activator.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "ciao/Dynamic_Component_Activator.h" -#include "ciao/Dynamic_Component_Servant_Base.h" - -ACE_RCSID (ciao, - Dynamic_Component_Activator, - "$Id$") - -#if !defined (__ACE_INLINE__) -# include "Dynamic_Component_Activator.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - Dynamic_Component_Activator::Dynamic_Component_Activator (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)) - { - } - - Dynamic_Component_Activator::~Dynamic_Component_Activator (void) - { - } - - PortableServer::Servant - Dynamic_Component_Activator::incarnate (const PortableServer::ObjectId &oid, - PortableServer::POA_ptr) - { - Dynamic_Component_Servant_Base* servant = 0; - PortableServer::ObjectId new_oid (oid); - - if (this->servant_map_.find (oid, servant) == 0) - { - return servant->create (new_oid); - } - - return 0; - } - - void - Dynamic_Component_Activator::etherealize ( - const PortableServer::ObjectId &, - PortableServer::POA_ptr, - PortableServer::Servant, - CORBA::Boolean, - CORBA::Boolean) - { - } -} diff --git a/CIAO/ciao/Dynamic_Component_Activator.h b/CIAO/ciao/Dynamic_Component_Activator.h deleted file mode 100644 index 06757a30a18..00000000000 --- a/CIAO/ciao/Dynamic_Component_Activator.h +++ /dev/null @@ -1,103 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dynamic_Component_Activator.h - * - * $Id$ - * - * @authors Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> - * Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H -#define CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/CCM_ContainerC.h" - -#include "tao/PortableServer/Key_Adapters.h" -#include "tao/LocalObject.h" -#include "tao/PortableServer/ServantActivatorC.h" - -#include "ace/Hash_Map_Manager_T.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -namespace CIAO -{ - - class Dynamic_Component_Servant_Base; - /** - * @class Dynamic_Component_Activator - * - * @brief Activator that is registered with the POA for facet and - * consumer servants. - * - */ - class CIAO_SERVER_Export Dynamic_Component_Activator - : public virtual PortableServer::ServantActivator, - public virtual ::CORBA::LocalObject - { - public: - Dynamic_Component_Activator (CORBA::ORB_ptr o); - - virtual ~Dynamic_Component_Activator (void); - - /// Template methods overridden to get callbacks. - /** - * If you would like to know the details of the following two - * methods, please PortableServer documentation. This is probably - * not the place to document what these mean. - */ - virtual PortableServer::Servant incarnate ( - const PortableServer::ObjectId &oid, - PortableServer::POA_ptr poa); - - virtual void etherealize ( - const PortableServer::ObjectId &oid, - PortableServer::POA_ptr adapter, - PortableServer::Servant servant, - CORBA::Boolean cleanup_in_progress, - CORBA::Boolean remaining_activations); - - void add_servant_to_map (PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant); - - void delete_servant_from_map (PortableServer::ObjectId &oid); - - private: - /// Pointer to our ORB - CORBA::ORB_var orb_; - - ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, - Dynamic_Component_Servant_Base *, - TAO_ObjectId_Hash, - ACE_Equal_To<PortableServer::ObjectId>, - TAO_SYNCH_MUTEX> - servant_map_; - }; -} - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "Dynamic_Component_Activator.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_DYNAMIC_COMPONENT_ACTIVATOR_H */ diff --git a/CIAO/ciao/Dynamic_Component_Activator.inl b/CIAO/ciao/Dynamic_Component_Activator.inl deleted file mode 100644 index 7faea9b0d15..00000000000 --- a/CIAO/ciao/Dynamic_Component_Activator.inl +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -namespace CIAO -{ - ACE_INLINE void - Dynamic_Component_Activator::add_servant_to_map( - PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant) - { - this->servant_map_.bind (oid, servant); - } - - ACE_INLINE void - Dynamic_Component_Activator::delete_servant_from_map( - PortableServer::ObjectId &oid) - { - Dynamic_Component_Servant_Base* servant = 0; - - if (this->servant_map_.unbind (oid, servant) != 0) - { - ACE_DEBUG ((LM_DEBUG, "Invalid object reference\n")); - } - } -} diff --git a/CIAO/ciao/Dynamic_Component_Servant_Base.cpp b/CIAO/ciao/Dynamic_Component_Servant_Base.cpp deleted file mode 100644 index 820dc71898c..00000000000 --- a/CIAO/ciao/Dynamic_Component_Servant_Base.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "ciao/Dynamic_Component_Servant_Base.h" - -ACE_RCSID (ciao, - Dynamic_Component_Servant_Base, - "$Id$") - -namespace CIAO -{ - Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base (void) - : container_ (0) - { - // This constructor is here to keep MSVC happy and should - // not be used at all. This constructor should be removed - // in the future. Until then, we have the ACE_ASSERT - // below to detect a runtime call to this constructor. - ACE_ASSERT (0); - } - - Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base - (Session_Container * c) - : container_ (c) - { - } - - Dynamic_Component_Servant_Base::~Dynamic_Component_Servant_Base (void) - { - } -} diff --git a/CIAO/ciao/Dynamic_Component_Servant_Base.h b/CIAO/ciao/Dynamic_Component_Servant_Base.h deleted file mode 100644 index 6e6173dd2af..00000000000 --- a/CIAO/ciao/Dynamic_Component_Servant_Base.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Dynamic_Component_Servant_Base.h - * - * $Id$ - * - */ -//============================================================================= - -#ifndef CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H -#define CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PortableServer.h" - -namespace CIAO -{ - class Session_Container; - - class CIAO_SERVER_Export Dynamic_Component_Servant_Base - { - public: - /// @todo Not to be used, no idea why this should be public, have to check this - Dynamic_Component_Servant_Base (void); - - explicit Dynamic_Component_Servant_Base (Session_Container *c); - - virtual ~Dynamic_Component_Servant_Base (void); - - virtual PortableServer::Servant - create (PortableServer::ObjectId &oid) = 0; - - virtual void destroy (PortableServer::ObjectId &oid) = 0; - - virtual void update_destroy_count () = 0; - - protected: - Session_Container *container_; - }; - -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H */ diff --git a/CIAO/ciao/Home_Servant_Impl_Base.cpp b/CIAO/ciao/Home_Servant_Impl_Base.cpp deleted file mode 100644 index 8829f170d90..00000000000 --- a/CIAO/ciao/Home_Servant_Impl_Base.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// $Id$ - -#include "Home_Servant_Impl_Base.h" - -namespace CIAO -{ - Home_Servant_Impl_Base::Home_Servant_Impl_Base (Session_Container * c) - : container_ (c) - { - } - - Home_Servant_Impl_Base::~Home_Servant_Impl_Base (void) - { - } - - // Operations for CCMHome interface. - - CORBA::IRObject_ptr - Home_Servant_Impl_Base::get_component_def (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - CORBA::IRObject_ptr - Home_Servant_Impl_Base::get_home_def (void) - { - throw CORBA::NO_IMPLEMENT (); - } - -} diff --git a/CIAO/ciao/Home_Servant_Impl_Base.h b/CIAO/ciao/Home_Servant_Impl_Base.h deleted file mode 100644 index 58011f5e634..00000000000 --- a/CIAO/ciao/Home_Servant_Impl_Base.h +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Home_Servant_Impl_Base.h - * - * $Id$ - * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated home servant class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_HOME_SERVANT_IMPL_BASE_H -#define CIAO_HOME_SERVANT_IMPL_BASE_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_HomeS.h" - -namespace CIAO -{ - class Session_Container; - - /** - * @class Home_Servant_Impl_Base - * - * @brief Non-template base class for Home_Servant_Impl. - * - * Holds the non-template parts of its child class - * Home_Servant_Impl. - */ - class CIAO_SERVER_Export Home_Servant_Impl_Base - : public virtual POA_Components::CCMHome - { - public: - Home_Servant_Impl_Base (Session_Container * c); - - virtual ~Home_Servant_Impl_Base (void); - - // Operations for CCMHome interface. - - virtual ::CORBA::IRObject_ptr get_component_def (void); - - virtual ::CORBA::IRObject_ptr get_home_def (void); - - virtual void - update_component_map (PortableServer::ObjectId &oid) = 0; - - protected: - Session_Container *container_; - - private: - /// Not to be used - Home_Servant_Impl_Base (void); - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_HOME_SERVANT_IMPL_BASE_H */ diff --git a/CIAO/ciao/Home_Servant_Impl_T.cpp b/CIAO/ciao/Home_Servant_Impl_T.cpp deleted file mode 100644 index 02e53985f11..00000000000 --- a/CIAO/ciao/Home_Servant_Impl_T.cpp +++ /dev/null @@ -1,212 +0,0 @@ -// $Id$ - -#ifndef CIAO_HOME_SERVANT_IMPL_T_C -#define CIAO_HOME_SERVANT_IMPL_T_C - -#include "Home_Servant_Impl_T.h" -#include "CIAO_common.h" - -namespace CIAO -{ - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::Home_Servant_Impl ( - typename EXEC::_ptr_type exe, - Session_Container * c, - const char *ins_name - ) - : Home_Servant_Impl_Base (c), - ins_name_ (ins_name), - executor_ (EXEC::_duplicate (exe)) - { - } - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::~Home_Servant_Impl (void) - { - CIAO_TRACE ("Home_Servant_Impl<>::destructor"); - - const OBJ_ITERATOR end = this->objref_map_.end (); - - for (OBJ_ITERATOR iter = this->objref_map_.begin (); - iter != end; - ++iter) - { - this->remove_component (((*iter).int_id_).in ()); - } - } - - // Operations for CCMHome interface. - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - void - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::remove_component ( - ::Components::CCMObject_ptr comp) - { - CIAO_TRACE ("Home_Servant_Impl<>::remove_component"); - - PortableServer::ObjectId_var oid = - this->container_->the_POA ()->reference_to_id (comp); - - Components::CCMObject_var ccm_obj_var = Components::CCMObject::_nil (); - if (objref_map_.find (oid.in (), ccm_obj_var) != 0) - { - ACE_DEBUG ((LM_DEBUG, "Invalid component object reference\n")); - return; - } - - typedef typename COMP_SVNT::_stub_type stub_type; - typename COMP_SVNT::_stub_var_type _ciao_comp = - stub_type::_narrow (ccm_obj_var.in ()); - - if (CORBA::is_nil (_ciao_comp.in ())) - { - throw Components::RemoveFailure (); - } - - _ciao_comp->remove (); - - if (CIAO::debug_level () > 3) - { - ACE_DEBUG ((LM_DEBUG, "Removed the component\n")); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - void - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::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) - { - ACE_DEBUG ((LM_DEBUG, "Invalid component object reference\n")); - return; - } - - return; - } - - // Operations for keyless home interface. - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - Components::CCMObject_ptr - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::create_component (void) - { - CIAO_TRACE ("Home_Servant_Impl<>::create_component"); - - return this->create (); - } - - // Operations for implicit home interface. - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - typename COMP_SVNT::_stub_ptr_type - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::create (void) - { - CIAO_TRACE ("Home_Servant_Impl<>::create"); - - if (this->executor_.in () == 0) - { - throw CORBA::INTERNAL (); - } - - ::Components::EnterpriseComponent_var _ciao_ec = - this->executor_->create (); - - typedef typename COMP_SVNT::_exec_type exec_type; - typename COMP_SVNT::_exec_type::_var_type _ciao_comp = - exec_type::_narrow (_ciao_ec.in ()); - - return this->_ciao_activate_component (_ciao_comp.in ()); - } - - // CIAO-specific operations. - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - typename COMP_SVNT::_stub_ptr_type - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::_ciao_activate_component ( - typename COMP_SVNT::_exec_type::_ptr_type exe) - { - CIAO_TRACE ("Home_Servant_Impl<>::_ciao_activate_component"); - - CORBA::Object_var hobj = this->container_->get_objref (this); - - Components::CCMHome_var home = - Components::CCMHome::_narrow (hobj.in ()); - - typedef typename COMP_SVNT::_stub_type stub_type; - COMP_SVNT *svt = 0; - ACE_NEW_RETURN (svt, - COMP_SVNT (exe, - home.in (), - this->ins_name_, - this, - this->container_), - stub_type::_nil ()); - - PortableServer::ServantBase_var safe (svt); - PortableServer::ObjectId_var oid; - - CORBA::Object_var objref = - this->container_->install_component (svt, oid.out ()); - - typedef typename COMP_SVNT::_stub_type stub_type; - typename COMP_SVNT::_stub_var_type ho = stub_type::_narrow (objref.in ()); - - Components::CCMObject_var ccmobjref = - Components::CCMObject::_narrow (objref.in ()); - - this->objref_map_.bind ( - oid.in (), - Components::CCMObject::_duplicate (ccmobjref.in ())); - - return ho._retn (); - } - - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - void - Home_Servant_Impl<BASE_SKEL, - EXEC, - COMP_SVNT>::_ciao_passivate_component ( - typename COMP_SVNT::_stub_ptr_type comp) - { - CIAO_TRACE ("Home_Servant_Impl<>::_ciao_passivate_component"); - - PortableServer::ObjectId_var oid; - this->container_->uninstall_component (comp, oid.out ()); - } -} - -#endif /* CIAO_HOME_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Home_Servant_Impl_T.h b/CIAO/ciao/Home_Servant_Impl_T.h deleted file mode 100644 index e1c9b8b9806..00000000000 --- a/CIAO/ciao/Home_Servant_Impl_T.h +++ /dev/null @@ -1,108 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Home_Servant_Impl_T.h - * - * $Id$ - * - * This file contains the declaration of a mixin base class for - * the generated home servant class. - * - * @authors Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_HOME_SERVANT_IMPL_T_H -#define CIAO_HOME_SERVANT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "Home_Servant_Impl_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Key_Adapters.h" -#include "ace/Hash_Map_Manager_T.h" - -namespace CIAO -{ - class Session_Container; - - /** - * @class Home_Servant_Impl - * - * @brief Mixin base class for generated home servant. - * - * This class implements operations - * common to all generated home servants. - */ - template <typename BASE_SKEL, - typename EXEC, - typename COMP_SVNT> - class Home_Servant_Impl - : public virtual BASE_SKEL, - public virtual Home_Servant_Impl_Base - { - public: - Home_Servant_Impl (typename EXEC::_ptr_type exe, - Session_Container * c, - const char *ins_name); - - virtual ~Home_Servant_Impl (void); - - // Operations for CCMHome interface. - - virtual void remove_component (Components::CCMObject_ptr comp); - - // Operations for keyless home interface. - - virtual ::Components::CCMObject_ptr create_component (); - - // Operations for implicit home interface. - - virtual typename COMP_SVNT::_stub_ptr_type create (); - - virtual void - update_component_map (PortableServer::ObjectId &oid); - - protected: - // CIAO-specific operations. - - typename COMP_SVNT::_stub_ptr_type - _ciao_activate_component (typename COMP_SVNT::_exec_type::_ptr_type exe); - - void - _ciao_passivate_component (typename COMP_SVNT::_stub_ptr_type comp); - - protected: - const char *ins_name_; - typename EXEC::_var_type executor_; - - typedef ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, - Components::CCMObject_var, - TAO_ObjectId_Hash, - ACE_Equal_To<PortableServer::ObjectId>, - TAO_SYNCH_MUTEX> - OBJREF_MAP; - - typedef OBJREF_MAP::iterator OBJ_ITERATOR; - - OBJREF_MAP objref_map_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Home_Servant_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Home_Servant_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_HOME_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Logger/CIAOLoggerFactory.h b/CIAO/ciao/Logger/CIAOLoggerFactory.h new file mode 100644 index 00000000000..0aadbc4091d --- /dev/null +++ b/CIAO/ciao/Logger/CIAOLoggerFactory.h @@ -0,0 +1,18 @@ +#ifndef LOGGERFACTORY_H_ +#define LOGGERFACTORY_H_ + +#include "ace/Service_Object.h" +#include "tao/ORB.h" +#include "ace/Log_Msg_Backend.h" + +namespace CIAO + { + + class CIAOLoggerFactory : public ACE_Service_Object + { + public: + virtual ACE_Log_Msg_Backend * get_logger_backend (CORBA::ORB_ptr orb) = 0; + }; +} // CIAO + +#endif /*LOGGERFACTORY_H_*/ diff --git a/CIAO/ciao/Logger/CIAO_Logger_Export.h b/CIAO/ciao/Logger/CIAO_Logger_Export.h new file mode 100644 index 00000000000..b1760b426f9 --- /dev/null +++ b/CIAO/ciao/Logger/CIAO_Logger_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Logger +// ------------------------------ +#ifndef CIAO_LOGGER_EXPORT_H +#define CIAO_LOGGER_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_LOGGER_HAS_DLL) +# define CIAO_LOGGER_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_LOGGER_HAS_DLL */ + +#if !defined (CIAO_LOGGER_HAS_DLL) +# define CIAO_LOGGER_HAS_DLL 1 +#endif /* ! CIAO_LOGGER_HAS_DLL */ + +#if defined (CIAO_LOGGER_HAS_DLL) && (CIAO_LOGGER_HAS_DLL == 1) +# if defined (CIAO_LOGGER_BUILD_DLL) +# define CIAO_Logger_Export ACE_Proper_Export_Flag +# define CIAO_LOGGER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_LOGGER_BUILD_DLL */ +# define CIAO_Logger_Export ACE_Proper_Import_Flag +# define CIAO_LOGGER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_LOGGER_BUILD_DLL */ +#else /* CIAO_LOGGER_HAS_DLL == 1 */ +# define CIAO_Logger_Export +# define CIAO_LOGGER_SINGLETON_DECLARATION(T) +# define CIAO_LOGGER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_LOGGER_HAS_DLL == 1 */ + +// Set CIAO_LOGGER_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_LOGGER_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_LOGGER_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_LOGGER_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_LOGGER_NTRACE */ + +#if (CIAO_LOGGER_NTRACE == 1) +# define CIAO_LOGGER_TRACE(X) +#else /* (CIAO_LOGGER_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_LOGGER_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_LOGGER_NTRACE == 1) */ + +#endif /* CIAO_LOGGER_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Logger/File_Logger_Backend.cpp b/CIAO/ciao/Logger/File_Logger_Backend.cpp new file mode 100644 index 00000000000..45c085748a0 --- /dev/null +++ b/CIAO/ciao/Logger/File_Logger_Backend.cpp @@ -0,0 +1,46 @@ + +#include "File_Logger_Backend.h" +#include "ace/OS.h" +#include "ace/Log_Record.h" +#include "ace/Log_Msg.h" +#include "ciao/CIAO_common.h" + +namespace CIAO +{ + + int + File_Logger_Backend::open (const ACE_TCHAR *) + { + CIAO_DEBUG ( (LM_DEBUG, CLINFO "Setting logger's output to file \"%s\"", this->filename_.c_str())); + this->fh_ = ACE_OS::fopen (this->filename_.c_str(), "w"); + if (0 == this->fh_) + { + ACE_CString s = "Failed to open log file \""; + s += this->filename_; + s += "\""; + throw LoggerError (s.c_str()); + } + return 0; + } + + int + File_Logger_Backend::close (void) + { + if (0 != this->fh_) + { + ACE_OS::fclose (this->fh_); + this->fh_ = 0; + } + return 0; + } + + ssize_t + File_Logger_Backend::log (ACE_Log_Record &log_record) + { + int res = log_record.print (0, ACE_Log_Msg::VERBOSE, this->fh_); + ACE_OS::fflush (this->fh_); + return res; + } + +} + diff --git a/CIAO/ciao/Logger/File_Logger_Backend.h b/CIAO/ciao/Logger/File_Logger_Backend.h new file mode 100644 index 00000000000..217dbef8438 --- /dev/null +++ b/CIAO/ciao/Logger/File_Logger_Backend.h @@ -0,0 +1,51 @@ +#ifndef FILE_LOGGER_BACKEND_H_ +#define FILE_LOGGER_BACKEND_H_ + +#include "ace/Log_Msg_Backend.h" +#include "ace/SString.h" +//#include "ace/String_Base.h" + +#include "CIAO_Logger_Export.h" + +namespace CIAO + { + + class CIAO_Logger_Export LoggerError + { + public: + LoggerError (const char * msg) + : errmsg_ (msg) {}; + ACE_CString errmsg_; + }; + + class CIAO_Logger_Export File_Logger_Backend : public ACE_Log_Msg_Backend + { + public: + File_Logger_Backend (const char * fname) + : fh_ (0), filename_ (fname) {} + + virtual ~File_Logger_Backend (void) + { + this->close(); + }; + + virtual int open (const ACE_TCHAR *logger_key); + + virtual int reset (void) + { + this->close(); + return this->open (0); + }; + + virtual int close (void); + + virtual ssize_t log (ACE_Log_Record &log_record); + + private: + FILE * fh_; + ACE_CString filename_; + }; + +} // CIAO + +#endif /*FILE_LOGGER_BACKEND_H_*/ diff --git a/CIAO/ciao/Logger/Log_Macros.h b/CIAO/ciao/Logger/Log_Macros.h new file mode 100644 index 00000000000..eb3f68a7870 --- /dev/null +++ b/CIAO/ciao/Logger/Log_Macros.h @@ -0,0 +1,81 @@ +/** + * @file Log_Macros.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * + * Macros used for logging in CIAO. + */ + +#ifndef CIAO_LOG_MACROS_H_ +#define CIAO_LOG_MACROS_H_ + +// default information printed with CIAO logging messages. + +#define CLINFO "(%P|%t) [%M] - %T - " + +#if (CIAO_NTRACE == 1) +# if !defined (ACE_NTRACE) +# define CIAO_TRACE(X) do {} while (0) +# define CIAO_ENABLE_TRACE(X) do {} while (0) +# define CIAO_DISABLE_TRACE(X) do {} while (0) +# else +# if (ACE_NTRACE == 0) +# error CIAO_TRACE cannot be disabled if ACE_TRACE is enabled +# else +# define CIAO_TRACE(X) do {} while (0) +# define CIAO_ENABLE_TRACE(X) do {} while (0) +# define CIAO_DISABLE_TRACE(X) do {} while (0) +# endif +# endif +#else +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_TRACE(X) ACE_TRACE_IMPL(X) +# define CIAO_ENABLE_TRACE() ACE_Trace::start_tracing () +# define CIAO_DISABLE_TRACE() ACE_Trace::stop_tracing () +# undef CLINFO // Make log messages indent with tracing. +# define CLINFO "%I(%P|%t) [%M] - %T - " +# include "ace/Trace.h" +#endif /* CIAO_NTRACE */ + +#if defined (CIAO_NLOGGING) +# define CIAO_ERROR(X) do {} while (0) +# define CIAO_DEBUG(X) do {} while (0) +#define CIAO_ERROR_RETURN(X, Y) return (Y) +#define CIAO_ERROR_BREAK(X) { break; } +#else +# if !defined (CIAO_ERROR) +# define CIAO_ERROR(X) \ + do { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \ + ace___->log X; \ + } while (0) +# endif +# if !defined (CIAO_DEBUG) +# define CIAO_DEBUG(X) \ + do { \ + 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 X; \ + } while (0) +# endif +# if !defined (CIAO_ERROR_RETURN) +# define CIAO_ERROR_RETURN(X, Y) \ + do { \ + int __ace_error = ACE_Log_Msg::last_error_adapter (); \ + ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ + ace___->conditional_set (__FILE__, __LINE__, Y, __ace_error); \ + ace___->log X; \ + return Y; \ + } while (0) +# endif +# if !defined (CIAO_ERROR_BREAK) +# define CIAO_ERROR_BREAK(X) { CIAO_ERROR (X); break; } +# endif +#endif + + +#endif diff --git a/CIAO/ciao/Logger/Logger.mpc b/CIAO/ciao/Logger/Logger.mpc new file mode 100644 index 00000000000..642071d4abe --- /dev/null +++ b/CIAO/ciao/Logger/Logger.mpc @@ -0,0 +1,18 @@ +// -*- MPC -*- +// $Id$ + +project(CIAO_Logger): ciao_lib, messaging { + sharedname = CIAO_Logger + dynamicflags = CIAO_LOGGER_BUILD_DLL + + Source_Files { + File_Logger_Backend.cpp + Logger_Service.cpp + } + Header_Files { + } +} + + + + diff --git a/CIAO/ciao/Logger/Logger_Service.cpp b/CIAO/ciao/Logger/Logger_Service.cpp new file mode 100644 index 00000000000..8e295b3fc74 --- /dev/null +++ b/CIAO/ciao/Logger/Logger_Service.cpp @@ -0,0 +1,151 @@ + +#include "Logger_Service.h" +#include "Log_Macros.h" +#include "ace/Get_Opt.h" +#include "ace/CORBA_macros.h" +#include "ace/Env_Value_T.h" +#include "tao/SystemException.h" + +namespace CIAO +{ + Logger_Service::Logger_Service (void) + : filename_ (""), + trace_ (false), + log_level_ (5) + { + } + + int + Logger_Service::init (int argc, ACE_TCHAR * argv[]) + { + // Get prospective values from the environment first, those given on + // command line can override + ACE_Env_Value<int> log ("CIAO_LOG_LEVEL", this->log_level_); + this->log_level_ = log; + + ACE_Env_Value<int> trace ("CIAO_TRACE_ENABLE", this->trace_); + this->trace_ = trace; + + ACE_Env_Value<const char *> filename ("CIAO_LOG_FILE", this->filename_.c_str ()); + this->filename_ = filename; + + this->parse_args (argc, argv); + this->set_levels (); + + return 0; + } + + void + Logger_Service::parse_args (int argc, ACE_TCHAR **argv) + { + const ACE_TCHAR *shortl = ACE_TEXT("-l"); + const ACE_TCHAR *longl = ACE_TEXT("--log-level"); + const ACE_TCHAR *tracel = ACE_TEXT("--trace"); + const ACE_TCHAR *traces = ACE_TEXT("-t"); + const ACE_TCHAR *lfl = ACE_TEXT("--log-file"); + const ACE_TCHAR *lfs = ACE_TEXT("-f"); + + // We need to actually FIND the -l option, as the get_opt won't ignore + // the ORB options and such. + for (int i = 0; i < argc; ++i) + { + if (ACE_OS::strncmp (argv[i], traces, 2) == 0 || + ACE_OS::strncmp (argv[i], tracel, 7) == 0) + { + this->trace_ = true; + continue; + } + + if (ACE_OS::strncmp (argv[i], shortl, 2) == 0 || + ACE_OS::strncmp (argv[i], longl,11 ) == 0) + { + if ((i + 1) < argc && *argv[i + 1] != '-') + { + int level = ACE_OS::atoi (argv[i + 1]); + + if (level != 0) + this->log_level_ = level; + } + } + + if (ACE_OS::strncmp (argv[i], lfs, 2) == 0 || + ACE_OS::strncmp (argv[i], lfl, 10 ) == 0) + { + if ((i + 1) < argc && *argv[i + 1] != '-') + { + this->filename_ = argv[i+1]; + } + } + } + } + + void + Logger_Service::set_levels (void) + { + if (this->trace_) + { + CIAO_ENABLE_TRACE (); + this->log_level_ = 10; + } + else + { + CIAO_DISABLE_TRACE (); + } + + u_long new_mask = 0; + + if (this->log_level_ >= 9) + { + new_mask |= LM_TRACE; + } + if (this->log_level_ >= 8) + { + new_mask |= LM_DEBUG; + } + if (this->log_level_ >= 7) + { + new_mask |= LM_INFO; + } + if (this->log_level_ >= 6) + { + new_mask |= LM_NOTICE; + } + if (this->log_level_ >= 5) + { + new_mask |= LM_WARNING; + } + if (this->log_level_ >= 4) + { + new_mask |= LM_ERROR; + } + if (this->log_level_ >= 3) + { + new_mask |= LM_CRITICAL; + } + if (this->log_level_ >= 2) + { + new_mask |= LM_ALERT; + } + if (this->log_level_ >= 1) + { + new_mask |= LM_EMERGENCY; + } + ACE_Log_Msg::instance()->priority_mask(new_mask, ACE_Log_Msg::PROCESS); + CIAO_DEBUG ( (LM_TRACE, CLINFO "Logging level is set to %i\n", this->log_level_)); + } + + ACE_Log_Msg_Backend * + Logger_Service::get_logger_backend (CORBA::ORB_ptr) + { + File_Logger_Backend * the_backend; + ACE_NEW_THROW_EX (the_backend, + File_Logger_Backend (this->filename_.c_str()), + CORBA::NO_MEMORY()); + return the_backend; + } + +} // CIAO + +using namespace CIAO; +ACE_FACTORY_DEFINE (CIAO_Logger, Logger_Service); + diff --git a/CIAO/ciao/Logger/Logger_Service.h b/CIAO/ciao/Logger/Logger_Service.h new file mode 100644 index 00000000000..5b5134f893d --- /dev/null +++ b/CIAO/ciao/Logger/Logger_Service.h @@ -0,0 +1,33 @@ +#ifndef CIAO_LOGGER_SERVICE_H_ +#define CIAO_LOGGER_SERVICE_H_ + +#include "CIAO_Logger_Export.h" +#include "CIAOLoggerFactory.h" +#include "File_Logger_Backend.h" + +namespace CIAO + { + + class CIAO_Logger_Export Logger_Service : public CIAOLoggerFactory + { + public: + Logger_Service (void); + + virtual int init (int argc, ACE_TCHAR * argv[]); + virtual ACE_Log_Msg_Backend * get_logger_backend (CORBA::ORB_ptr orb); + + private: + + void parse_args (int argc, ACE_TCHAR **argv); + void set_levels (void); + + ACE_CString filename_; + bool trace_; + int log_level_; + }; + +} // DAnCE + +ACE_FACTORY_DECLARE (CIAO_Logger, Logger_Service); + +#endif /*LOGGER_SERVICE_H_*/ diff --git a/CIAO/ciao/Object_Set_T.cpp b/CIAO/ciao/Object_Set_T.cpp deleted file mode 100644 index a423db92628..00000000000 --- a/CIAO/ciao/Object_Set_T.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// $Id$ - -#ifndef CIAO_OBJECT_SET_T_C -#define CIAO_OBJECT_SET_T_C - -#include "Object_Set_T.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if !defined (__ACE_INLINE__) -#include "Object_Set_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ciao, Object_Set_T, "$Id$") - -template <class T, class T_var> -CIAO::Object_Set<T, T_var>::Object_Set (CORBA::ULong init_capacity, - CORBA::ULong step) - : capacity_ (init_capacity), - size_ (0), - step_ (step) -{ - this->buffer_ = new T_var [this->capacity_]; -} - -template <class T, class T_var> -CIAO::Object_Set<T, T_var>::~Object_Set () -{ - delete[] this->buffer_; -} - -template <class T, class T_var> void -CIAO::Object_Set<T, T_var>::release () -{ - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - { - this->buffer_[i] = T::_nil (); - } -} - -template <class T, class T_var> CORBA::Long -CIAO::Object_Set<T, T_var>::add (T *objref) -{ - if (this->size_ == this->capacity_) - this->grow (); - - this->buffer_[this->size_] = T::_duplicate (objref); - return this->size_++; -} - -template<class T, class T_var> CORBA::Long -CIAO::Object_Set<T, T_var>::remove (T *objref) -{ - if (CORBA::is_nil (objref)) - return -1; - - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - if (objref->_is_equivalent (this->buffer_[i].in ())) // _is_equivalent could be unreliable? - { - --this->size_; - if (i != this->size_) - this->buffer_[i] = this->buffer_[this->size_]; - - this->buffer_[this->size_] = T::_nil (); - return 0; - } - return -1; // not found. -} - -template<class T, class T_var> CORBA::Long -CIAO::Object_Set<T, T_var>::remove_all (void) -{ - for (CORBA::ULong i = 0; i < this->size_; ++i) - this->buffer_[i] = T::_nil (); - - this->size_ = 0; - return 0; -} - -template <class T, class T_var> void -CIAO::Object_Set<T, T_var>::grow (void) -{ - CORBA::ULong new_capacity = this->capacity_ + this->step_; - T_var *newbuf = new T_var [new_capacity]; - this->capacity_ = new_capacity; - - CORBA::ULong i = 0; - for (; i < this->size_; ++i) - newbuf[i] = this->buffer_[i]; // this will hijack the object ownership - - delete[] this->buffer_; - this->buffer_ = newbuf; -} - -template <class T, class T_var> CORBA::ULong -CIAO::Object_Set<T, T_var>::copy (CORBA::ULong len, - T **buf) -{ - if (buf == 0) - return 0; - - if (len > this->size_) - len = this->size_; - - CORBA::ULong i = 0; - for (; i < len; ++i) - buf[i] = T::_duplicate (this->buffer_[i].in ()); - - return len; -} - -template <class T, class T_var> int -CIAO::Object_Set<T, T_var>::object_in_set (T *objref) -{ - if (CORBA::is_nil (objref)) // Don't count nil objref - return 0; - - CORBA::ULong i = 0; - - for (; i < this->size_; ++i) - if (objref->_is_equivalent (this->buffer_[i].in ())) // _is_equivalent could be unreliable? - return -1; - - return 0; -} -#endif /* CIAO_OBJECT_SET_T_C */ diff --git a/CIAO/ciao/Object_Set_T.h b/CIAO/ciao/Object_Set_T.h deleted file mode 100644 index bdfdbbc49fa..00000000000 --- a/CIAO/ciao/Object_Set_T.h +++ /dev/null @@ -1,129 +0,0 @@ -// $Id$ - -/** - * @file Object_Set_T.h - * - * Helper template classes for maintaining and managing object - * reference sets. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ - -#ifndef CIAO_OBJECT_SET_T_H -#define CIAO_OBJECT_SET_T_H -#include /**/ "ace/pre.h" - -#include "tao/ORB_Constants.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - /** - * @class Object_Set - * - * @brief A helper template class for maintaining and managing a set - * of object reference. - * - * This class provides a naive implementation of an object reference - * set. It is naive because it simply keeps object references in an - * objref_var array without checking for duplication. More - * importantly, it takes O(n) to to look for an object reference and - * return it. What we really need is a thread-safe hash_set<> like - * class here. Since this is mostly used only during setup/assemble - * time for a CIAO application, i.e., not on critical path, this - * class serves as a place holder for later, more efficient - * implementation. - */ - template <class T, class T_var> - class Object_Set - { - public: - /** - * Default contructor that also allows initializing the initial - * capacity of the set and the increment step. - */ - Object_Set (CORBA::ULong init_capacity = 10, - CORBA::ULong step = 10); - - /// Default destructor. - ~Object_Set (void); - - /// Adding a new object reference to the set. Return -1 if error - /// occurred. - CORBA::Long add (T *objref); - - /// Removing an object from the set. Return -1 if error occurred. - CORBA::Long remove (T *objref); - - /// 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); - - /** - * Get a copy of the object reference set into the incoming array - * @c buffer with capacity of @c size. @c buffer is usually - * allocated using a sequence's @c allocbuf method. Notice that - * caller is responsible to release the object references in - * buffer. - * - * @retval actual number of objrefs copied into @c buffer. - */ - CORBA::ULong copy (CORBA::ULong size, T **buffer); - - /** - * Check if an object is in the set. Return 0 if false. - */ - int object_in_set (T *objref); - - /// Query the current size the set contains. - CORBA::ULong size (void) const; - - /// Query the current capacity the set. - CORBA::ULong capacity (void) const; - - /** - * Release all object references. - */ - void release (void); - - protected: - /// Grow the internal array holding the object references. - void grow (void); - - /// Pointer to the dynamically allocated buffer that holds the - /// object references. - T_var *buffer_; - - /// Maximun capacity of this->buffer_; - CORBA::ULong capacity_; - - /// Current size in the set. - CORBA::ULong size_; - - /// How many more slots to add each time we expand the capacity of - /// this set. - CORBA::ULong step_; - }; - -} - -#if defined (__ACE_INLINE__) -#include "Object_Set_T.inl" -#endif /* !defined INLINE */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Object_Set_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Object_Set_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* CIAO_OBJECT_SET_T_H */ diff --git a/CIAO/ciao/Object_Set_T.inl b/CIAO/ciao/Object_Set_T.inl deleted file mode 100644 index cd9b8e1ab45..00000000000 --- a/CIAO/ciao/Object_Set_T.inl +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -template <class T, class T_var> ACE_INLINE CORBA::ULong -CIAO::Object_Set<T, T_var>::size (void) const -{ - return this->size_; -} - -template <class T, class T_var> ACE_INLINE CORBA::ULong -CIAO::Object_Set<T, T_var>::capacity (void) const -{ - return this->capacity_; -} - -template <class T, class T_var> ACE_INLINE T_var & -CIAO::Object_Set<T, T_var>::at (CORBA::ULong index) -{ - return this->buffer_[index]; -} diff --git a/CIAO/ciao/Port_Activator.cpp b/CIAO/ciao/Port_Activator.cpp deleted file mode 100644 index 3d48f18d819..00000000000 --- a/CIAO/ciao/Port_Activator.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "Port_Activator.h" - -ACE_RCSID (ciao, - Servant_Activator, - "$Id$") - -#if !defined (__ACE_INLINE__) -# include "Port_Activator.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - Port_Activator::Port_Activator (const char *oid, - const char *name, - Type t) - : oid_ (oid), - name_ (name), - t_ (t) - { - } - - Port_Activator::~Port_Activator (void) - { - } -} diff --git a/CIAO/ciao/Port_Activator.h b/CIAO/ciao/Port_Activator.h deleted file mode 100644 index 564647ce89d..00000000000 --- a/CIAO/ciao/Port_Activator.h +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- -//============================================================================= -/** - * @file Port_Activator.h - * - * $Id$ - * - * @authors Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_PORT_ACTIVATOR_H -#define CIAO_PORT_ACTIVATOR_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PortableServer.h" - -namespace CIAO -{ - /** - * @class Port_Activator - * - * @brief Base class for port activations - * - * This is a ABC for the Port_Activator_T <> template class where - * the bulk of the work is done. This class is simply a place holder - * so that we could use the pointer to this class to achieve - * polymorphism for facet and consumer servant activations. - * - */ - class CIAO_SERVER_Export Port_Activator - { - public: - enum Type - { - Facet, - Sink - }; - - Port_Activator (const char *oid, const char *name, Type t); - - virtual ~Port_Activator (void); - - /// Return the oid of port that this activator encapulates. - const char* oid (void) const; - - /// Set the oid - void oid (const char* oid); - - /// Return the oid of port that this activator encapulates. - const char* name (void) const; - - /// Activate the servant reponsible for this port. - /** - * There are intentionally no throw specifications. It is the - * caller's responsibility to handle CORBA and C++ - * specifications. - */ - virtual PortableServer::Servant activate ( - const PortableServer::ObjectId &oid) = 0; - - virtual void deactivate (const PortableServer::Servant servant) = 0; - - protected: - /// The object ID that is used to activate the servant within the - /// POA. - CORBA::String_var oid_; - - /// Name of the port - CORBA::String_var name_; - - /// What type of port is it, a consumer or facet. - Type const t_; - }; -} - -#if defined (__ACE_INLINE__) -# include "Port_Activator.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /*CIAO_PORT_ACTIVATOR_H*/ diff --git a/CIAO/ciao/Port_Activator.inl b/CIAO/ciao/Port_Activator.inl deleted file mode 100644 index 828f9fe317b..00000000000 --- a/CIAO/ciao/Port_Activator.inl +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -namespace CIAO -{ - ACE_INLINE const char* - Port_Activator::oid (void) const - { - return this->oid_.in (); - } - - ACE_INLINE void - Port_Activator::oid (const char* oid) - { - this->oid_ = oid; - } - - ACE_INLINE const char* - Port_Activator::name (void) const - { - return this->name_.in (); - } -} diff --git a/CIAO/ciao/Port_Activator_T.cpp b/CIAO/ciao/Port_Activator_T.cpp deleted file mode 100644 index c32d80af942..00000000000 --- a/CIAO/ciao/Port_Activator_T.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// $Id$ - -#ifndef CIAO_PORT_ACTIVATOR_T_CPP -#define CIAO_PORT_ACTIVATOR_T_CPP - -#include "Port_Activator_T.h" -#include "tao/CORBA_String.h" - -#include "ace/OS_NS_string.h" - - -namespace CIAO -{ - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::Port_Activator_T ( - const char *oid, - const char *name, - Port_Activator::Type t, - EXEC *e, - CONTEXT *c, - COMP_SERV *cc) - : Port_Activator (oid, name, t) - , executor_ (e) - , context_ (c) - , comp_serv_ (cc) - { - } - - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - void - Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::deactivate ( - const PortableServer::Servant servant) - { - SERVANT *s = dynamic_cast<SERVANT *> (servant); - s->_remove_ref (); - } - - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - PortableServer::Servant - Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::activate ( - const PortableServer::ObjectId &oid) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - - // An additional check, may not be necessary. Being on the safe - // side. - if (ACE_OS::strcmp (this->oid_.in (), str.in ()) == 0) - { - if (this->executor_ == 0 && this->t_ == Port_Activator::Facet) - { - CORBA::Object_var tmp = - this->comp_serv_->get_facet_executor (this->name_.in ()); - - this->executor_ = EXEC::_narrow (tmp.in ()); - } - - SERVANT *s = 0; - - ACE_NEW_THROW_EX (s, - SERVANT (this->executor_, - this->context_), - CORBA::NO_MEMORY ()); - return s; - } - - throw CORBA::OBJECT_NOT_EXIST (); - } -} - -#endif /*SERVANT_ACTIVATOR_T_CPP*/ diff --git a/CIAO/ciao/Port_Activator_T.h b/CIAO/ciao/Port_Activator_T.h deleted file mode 100644 index cb6635a6baa..00000000000 --- a/CIAO/ciao/Port_Activator_T.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Port_Activator_T.h - * - * $Id$ - * - * @authors Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_PORT_ACTIVATOR_T_H -#define CIAO_PORT_ACTIVATOR_T_H -#include /**/ "ace/pre.h" - -#include "ciao/Port_Activator.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -namespace CIAO -{ - /** - * @class Port_Activator_T - * - * @brief Concrete class that implements the strategy for creating - * the right type of servant for the ports in question. - * - * This class is parametrized by the servant type for the port, the - * executor type for the port, the context for the component and the - * component servant which instantiated this class within the - * container. - */ - template <typename SERV, - typename EXEC, - typename CONTEXT, - typename COMP_SERV> - class Port_Activator_T : public virtual Port_Activator - { - public: - typedef SERV SERVANT; - - Port_Activator_T (const char *oid, - const char *name, - Port_Activator::Type t, - EXEC *e, - CONTEXT *c, - COMP_SERV *cs); - - /// Template method from the base class, please see the base class - /// documentation for details. - PortableServer::Servant activate ( - const PortableServer::ObjectId &oid); - - void deactivate (const PortableServer::Servant servant); - - private: - /// The executor - EXEC *executor_; - - /// Context classes - CONTEXT *context_; - - /// Component servant which created <this> - COMP_SERV *comp_serv_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Port_Activator_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Port_Activator_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /*CIAO_SERVANT_ACTIVATOR_T_H*/ diff --git a/CIAO/ciao/Security.idl b/CIAO/ciao/Security.idl deleted file mode 100644 index 199ae210c31..00000000000 --- a/CIAO/ciao/Security.idl +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @@ This is just a temporary file. CIAO doesn't sue the security - * service in its implementation but just using this local - * interface below from the real security service pulls in - * 250Kb of footprint - * - * $Id$ - */ - -#if !defined (CIAO_SECURITY_IDL) -#define CIAO_SECURITY_IDL - -#pragma prefix "omg.org" - -module SecurityLevel2 { - -# pragma version SecurityLevel2 1.8 - - local interface Credentials - { - }; -}; -#endif /* CIAO_SECURITY_IDL */ diff --git a/CIAO/ciao/Servant_Activator.cpp b/CIAO/ciao/Servant_Activator.cpp deleted file mode 100644 index 96f9312c3a0..00000000000 --- a/CIAO/ciao/Servant_Activator.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include "Servant_Activator.h" -#include "Port_Activator.h" - -#include "CIAO_common.h" - -ACE_RCSID (ciao, - Servant_Activator, - "$Id$") - -namespace CIAO -{ - Servant_Activator::Servant_Activator (CORBA::ORB_ptr o) - : orb_ (CORBA::ORB::_duplicate (o)), - // @@ TODO, avoid this magic number - pa_ (64), - slot_index_ (0) - { - } - - Servant_Activator::~Servant_Activator (void) - { - { - ACE_GUARD (TAO_SYNCH_MUTEX, - guard, - this->mutex_); - - size_t const sz = this->slot_index_; - - for (size_t t = 0; t != sz; ++t) - { - Port_Activator *&tmp = this->pa_[t]; - - delete tmp; - } - } - } - - bool - Servant_Activator::update_port_activator ( - const PortableServer::ObjectId &oid) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - this->mutex_, - 0); - size_t const sz = this->slot_index_; - - for (size_t t = 0; t != sz; ++t) - { - Port_Activator *&tmp = this->pa_[t]; - - if (ACE_OS::strcmp (tmp->oid (), str.in ()) == 0) - { - tmp->oid ("dummy"); - } - } - } - - return true; - } - - PortableServer::Servant - Servant_Activator::incarnate (const PortableServer::ObjectId &oid, - PortableServer::POA_ptr) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - Servant_Activator::incarnate, " - "activating port name [%s] \n", - str.in ())); - } - - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - this->mutex_, - 0); - - size_t const sz = this->slot_index_; - Port_Activator *tmp = 0; - - for (size_t t = 0; t != sz; ++t) - { - if (this->pa_.get (tmp, t) == -1) - { - throw CORBA::OBJECT_NOT_EXIST (); - } - - if (tmp == 0) - { - if (CIAO::debug_level () > 9) - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) - Servant_Activator::incarnate ()," - " value from the array is null \n")); - continue; - } - - if (ACE_OS::strcmp (tmp->oid (), - str.in ()) == 0) - { - // 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. - if (CIAO::debug_level () > 5) - { - ACE_DEBUG ((LM_DEBUG, - "Activating Port %s\n", - str.in ())); - } - - return this->pa_[t]->activate (oid); - } - } - } - - throw CORBA::OBJECT_NOT_EXIST (); - } - - void - Servant_Activator::etherealize (const PortableServer::ObjectId &oid, - PortableServer::POA_ptr , - PortableServer::Servant servant, - CORBA::Boolean , - CORBA::Boolean) - { - CORBA::String_var str = - PortableServer::ObjectId_to_string (oid); - - size_t const sz = this->slot_index_; - Port_Activator *tmp = 0; - - for (size_t t = 0; t != sz; ++t) - { - if (this->pa_.get (tmp, t) == -1) - { - ACE_DEBUG ((LM_DEBUG, "Could not get Port Activator\n")); - continue; - } - - if (tmp == 0) - { - ACE_DEBUG ((LM_DEBUG, "Port Activator is NULL\n")); - continue; - } - - if (ACE_OS::strcmp (tmp->oid (), - str.in ()) == 0) - { - ACE_DEBUG ((LM_DEBUG, - "Deactivating Port %s\n", - str.in ())); - this->pa_[t]->deactivate (servant); - } - } - } - - bool - Servant_Activator::register_port_activator (Port_Activator *pa) - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, - guard, - this->mutex_, - false); - - // @@ TODO, need to implement a better algorithm here. - // - if (this->slot_index_ >= this->pa_.size ()) - { - this->pa_.size ((this->slot_index_ + 1)); - } - - if (this->pa_.set (pa, this->slot_index_) == 0) - { - ++this->slot_index_; - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - Servant_Activator::" - "register_port_activator" - " with port name [%s]," - " the slot_index_ is [%d] \n", - pa->name (), - this->slot_index_)); - } - - return true; - } - - return false; - } -} diff --git a/CIAO/ciao/Servant_Activator.h b/CIAO/ciao/Servant_Activator.h deleted file mode 100644 index c5211ee1022..00000000000 --- a/CIAO/ciao/Servant_Activator.h +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Activator.h - * - * $Id$ - * - * @authors Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_SERVANT_ACTIVATOR_H -#define CIAO_SERVANT_ACTIVATOR_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ServantActivatorC.h" -#include "tao/LocalObject.h" - -#include "ace/Array_Base.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -namespace CIAO -{ - class Port_Activator; - - /** - * @class Servant_Activator - * - * @brief Activator that is registered with the POA for facet and - * consumer servants. - * - * This class acts like a factory in some sense. This factory is - * registered with the POA with RETAIN policy. When the factory gets - * a call back as part of the upcall, this factory looks at the - * list of port activators registered, uses the OID to pick the - * right one (yes a linear algorithm is used), calls activate () on - * it which returns the servant for *that* port. - */ - class CIAO_SERVER_Export Servant_Activator - : public virtual PortableServer::ServantActivator, - public virtual ::CORBA::LocalObject - { - public: - Servant_Activator (CORBA::ORB_ptr o); - - virtual ~Servant_Activator (void); - - bool update_port_activator (const PortableServer::ObjectId &oid); - - /// Template methods overridden to get callbacks. - /** - * If you would like to know the details of the following two - * methods, please PortableServer documentation. This is probably - * not the place to document what these mean. - */ - virtual PortableServer::Servant incarnate ( - const PortableServer::ObjectId &oid, - PortableServer::POA_ptr poa); - - virtual void etherealize ( - const PortableServer::ObjectId &oid, - PortableServer::POA_ptr adapter, - PortableServer::Servant servant, - CORBA::Boolean cleanup_in_progress, - CORBA::Boolean remaining_activations); - - /// Local helper methods - bool register_port_activator (Port_Activator *pa); - - private: - /// Pointer to our ORB - CORBA::ORB_var orb_; - - /// @@ This should be changed at some point of time so that we - /// don't land up with a linear algorithm - typedef ACE_Array_Base<Port_Activator *> Port_Activators; - - /// Array of port activators - Port_Activators pa_; - - /// Running index of the slot that has been just filled in. - size_t slot_index_; - - /// Mutex that synchronizes access to the array. - TAO_SYNCH_MUTEX mutex_; - }; -} - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" - -#endif /*CIAO_SERVANT_ACTIVATOR_H*/ diff --git a/CIAO/ciao/Servant_Impl_Base.cpp b/CIAO/ciao/Servant_Impl_Base.cpp deleted file mode 100644 index 951bba9d574..00000000000 --- a/CIAO/ciao/Servant_Impl_Base.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// $Id$ - -#include "Servant_Impl_Base.h" - -#include "StandardConfigurator_Impl.h" -#include "Session_Container.h" - -namespace CIAO -{ - Servant_Impl_Base::Servant_Impl_Base (Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c) - : home_ (Components::CCMHome::_duplicate (home)), - home_servant_ (home_servant), - container_ (c) - { - } - - Servant_Impl_Base::~Servant_Impl_Base (void) - { - } - - // Operations for CCMObject interface. - - ::Components::PrimaryKeyBase * - Servant_Impl_Base::get_primary_key (void) - { - throw ::Components::NoKeyAvailable (); - } - - CORBA::IRObject_ptr - Servant_Impl_Base::get_component_def (void) - { - throw CORBA::NO_IMPLEMENT (); - } - - void - Servant_Impl_Base::configuration_complete (void) - { - // CIAO to-do - } - - void - Servant_Impl_Base::remove (void) - { - try - { - // Removing Facets - Components::FacetDescriptions_var facets = this->get_all_facets (); - - CORBA::ULong const facet_len = facets->length (); - - for (CORBA::ULong i = 0; i < facet_len; ++i) - { - PortableServer::ObjectId_var facet_id = - this->container_->the_facet_cons_POA ()->reference_to_id ( - facets[i]->facet_ref ()); - - CIAO::Servant_Activator *sa = - this->container_->ports_servant_activator (); - - sa->update_port_activator (facet_id.in ()); - - this->container_->the_facet_cons_POA ()->deactivate_object ( - facet_id); - } - - // Removed Facets - - // Removing Consumers - Components::ConsumerDescriptions_var consumers = - this->get_all_consumers (); - - CORBA::ULong const consumer_len = consumers->length (); - - for (CORBA::ULong j = 0; j < consumer_len; ++j) - { - PortableServer::ObjectId_var cons_id = - this->container_->the_facet_cons_POA ()->reference_to_id ( - consumers[j]->consumer ()); - - CIAO::Servant_Activator *sa = - this->container_->ports_servant_activator (); - sa->update_port_activator (cons_id.in ()); - - this->container_->the_facet_cons_POA ()->deactivate_object ( - cons_id); - } - - Components::SessionComponent_var temp = this->get_executor (); - temp->ccm_remove (); - - CORBA::Object_var objref = this->container_->get_objref (this); - - Components::CCMObject_var ccmobjref = - Components::CCMObject::_narrow (objref.in ()); - - PortableServer::ObjectId_var oid; - - this->container_->uninstall_component (ccmobjref.in (), oid.out ()); - - this->home_servant_->update_component_map (oid); - } - catch (const CORBA::Exception& ex) - { - ex._tao_print_exception ("Port not active\n"); - } - } - - ::Components::ConnectionDescriptions * - Servant_Impl_Base::get_connections (const char * /* name */) - { - throw CORBA::NO_IMPLEMENT (); - } - - ::Components::ComponentPortDescription * - Servant_Impl_Base::get_all_ports (void) - { - OBV_Components::ComponentPortDescription *cps = 0; - ACE_NEW_RETURN (cps, - OBV_Components::ComponentPortDescription, - 0); - ::Components::ComponentPortDescription_var retv = cps; - - ::Components::FacetDescriptions_var facets_desc = - this->get_all_facets (); - - ::Components::ReceptacleDescriptions_var receptacle_desc = - this->get_all_receptacles (); - - ::Components::ConsumerDescriptions_var consumer_desc = - this->get_all_consumers (); - - ::Components::EmitterDescriptions_var emitter_desc = - this->get_all_emitters (); - - ::Components::PublisherDescriptions_var publisher_desc = - this->get_all_publishers (); - - retv->facets (facets_desc.in ()); - retv->receptacles (receptacle_desc.in ()); - retv->consumers (consumer_desc.in ()); - retv->emitters (emitter_desc.in ()); - retv->publishers (publisher_desc.in ()); - - return retv._retn (); - } - - CORBA::Object_ptr - Servant_Impl_Base::provide_facet (const char *name) - { - if (0 == name) - { - throw Components::InvalidName (); - } - - CORBA::Object_ptr retval = this->lookup_facet (name); - - if (CORBA::is_nil (retval)) - { - throw Components::InvalidName (); - } - - return retval; - } - - Components::FacetDescriptions * - Servant_Impl_Base::get_named_facets ( - const ::Components::NameList & names) - { - Components::FacetDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::FacetDescriptions, - 0); - Components::FacetDescriptions_var safe_retval = retval; - CORBA::ULong const len = names.length (); - safe_retval->length (len); - - for (CORBA::ULong i = 0; i < len; ++i) - { - ::Components::FacetDescription *tmp = - this->lookup_facet_description (names[i]); - - if (0 == tmp) - { - throw Components::InvalidName (); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::FacetDescriptions * - Servant_Impl_Base::get_all_facets (void) - { - ::Components::FacetDescriptions *tmp = 0; - ACE_NEW_RETURN (tmp, - ::Components::FacetDescriptions, - 0); - - ::Components::FacetDescriptions_var retval = tmp; - - retval->length (this->facet_table_.size ()); - CORBA::ULong i = 0UL; - - for (FacetTable::const_iterator iter = this->facet_table_.begin (); - iter != this->facet_table_.end (); - ++iter, ++i) - { - retval[i] = iter->second; - } - - return retval._retn (); - } - - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_all_consumers (void) - { - ::Components::ConsumerDescriptions *tmp = 0; - ACE_NEW_THROW_EX (tmp, - ::Components::ConsumerDescriptions ( - this->consumer_table_.size ()), - CORBA::NO_MEMORY ()); - - ::Components::ConsumerDescriptions_var retval = tmp; - - retval->length (this->consumer_table_.size ()); - CORBA::ULong i = 0UL; - - for (ConsumerTable::const_iterator iter = this->consumer_table_.begin (); - iter != this->consumer_table_.end (); - ++iter, ++i) - { - retval[i] = iter->second; - } - - return retval._retn (); - } - - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::get_consumer (const char *sink_name) - { - if (0 == sink_name) - { - throw Components::InvalidName (); - } - - Components::EventConsumerBase_ptr retval = - this->lookup_consumer (sink_name); - - if (CORBA::is_nil (retval)) - { - throw Components::InvalidName (); - } - - return retval; - } - - ::Components::ConsumerDescriptions * - Servant_Impl_Base::get_named_consumers ( - const ::Components::NameList & names) - { - Components::ConsumerDescriptions *retval = 0; - ACE_NEW_RETURN (retval, - ::Components::ConsumerDescriptions, - 0); - Components::ConsumerDescriptions_var safe_retval = retval; - CORBA::ULong const len = names.length (); - safe_retval->length (len); - - for (CORBA::ULong i = 0; i < len; ++i) - { - ::Components::ConsumerDescription *tmp = - this->lookup_consumer_description (names[i]); - - if (0 == tmp) - { - throw Components::InvalidName (); - } - - safe_retval[i] = tmp; - } - - return safe_retval._retn (); - } - - ::Components::EmitterDescriptions * - Servant_Impl_Base::get_named_emitters ( - const ::Components::NameList & /* names */) - { - throw CORBA::NO_IMPLEMENT (); - } - - ::Components::ReceptacleDescriptions * - - Servant_Impl_Base::get_all_receptacles (void) - { - 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 * - Servant_Impl_Base::get_named_receptacles ( - const ::Components::NameList & /* names */) - { - throw ::CORBA::NO_IMPLEMENT (); - } - - ::Components::PublisherDescriptions * - Servant_Impl_Base::get_named_publishers ( - const ::Components::NameList & /* names */) - { - throw ::CORBA::NO_IMPLEMENT (); - } - - /// Protected operations. - void - Servant_Impl_Base::add_facet (const char *port_name, - ::CORBA::Object_ptr port_ref) - { - if (0 == port_name || ::CORBA::is_nil (port_ref)) - { - throw ::CORBA::BAD_PARAM (); - return; - } - - ::Components::FacetDescription *fd = 0; - ACE_NEW (fd, - ::OBV_Components::FacetDescription ( - port_name, - port_ref->_interface_repository_id (), - port_ref)); - ::Components::FacetDescription_var safe = fd; - - FacetTable::value_type entry; - entry.first = port_name; - entry.second = safe._retn (); - - { - ACE_WRITE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - - (void) this->facet_table_.insert (entry); - } - } - - CORBA::Object_ptr - Servant_Impl_Base::lookup_facet (const char *port_name) - { - if (0 == port_name) - { - return CORBA::Object::_nil (); - } - - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - CORBA::Object::_nil ()); - - FacetTable::const_iterator iter = - this->facet_table_.find (port_name); - - if (iter == this->facet_table_.end ()) - { - return CORBA::Object::_nil (); - } - - return CORBA::Object::_duplicate (iter->second->facet_ref ()); - } - - ::Components::FacetDescription * - Servant_Impl_Base::lookup_facet_description (const char *port_name) - { - if (0 == port_name) - { - /// Calling function will throw InvalidName after getting this. - return 0; - } - - ::Components::FacetDescription_var fd; - - { - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - 0); - FacetTable::const_iterator iter = - this->facet_table_.find (port_name); - - if (iter != this->facet_table_.end ()) - { - fd = iter->second; - } - } - - 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 (); - // 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 ( - cookie, - recept_ref)); - ::Components::ConnectionDescription_var cd_safe = cd; - ::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 ( - cookie, - recept_ref)); - ::Components::ConnectionDescription_var cd_safe = cd; - ::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, - ::Components::EventConsumerBase_ptr port_ref) - { - if (0 == port_name || ::CORBA::is_nil (port_ref)) - { - throw ::CORBA::BAD_PARAM (); - return; - } - - ::Components::ConsumerDescription *cd = 0; - ACE_NEW (cd, - ::OBV_Components::ConsumerDescription); - ::Components::ConsumerDescription_var safe = cd; - - cd->name (port_name); - cd->type_id (port_ref->_interface_repository_id ()); - cd->consumer (port_ref); - - ConsumerTable::value_type entry; - entry.first = port_name; - entry.second = safe._retn (); - - ACE_WRITE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - - (void) this->consumer_table_.insert (entry); - } - - ::Components::EventConsumerBase_ptr - Servant_Impl_Base::lookup_consumer (const char *port_name) - { - if (0 == port_name) - { - return ::Components::EventConsumerBase::_nil (); - } - - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - ::Components::EventConsumerBase::_nil ()); - - ConsumerTable::const_iterator iter = - this->consumer_table_.find (port_name); - - if (iter == this->consumer_table_.end ()) - { - return ::Components::EventConsumerBase::_nil (); - } - - return - ::Components::EventConsumerBase::_duplicate ( - iter->second->consumer ()); - } - - ::Components::ConsumerDescription * - Servant_Impl_Base::lookup_consumer_description ( - const char *port_name) - { - if (0 == port_name) - { - /// Calling function will throw InvalidName after getting this. - return 0; - } - - ::Components::ConsumerDescription_var cd; - ConsumerTable::const_iterator iter; - - { - ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, - mon, - this->lock_, - 0); - - iter = this->consumer_table_.find (port_name); - - if (iter != this->consumer_table_.end ()) - { - cd = iter->second; - } - } - - return cd._retn (); - } - - ::Components::StandardConfigurator_ptr - Servant_Impl_Base::get_standard_configurator (void) - { - // Create the configurator servant. - StandardConfigurator_Impl *config_impl = 0; - - ACE_NEW_THROW_EX (config_impl, - StandardConfigurator_Impl (this), - CORBA::NO_MEMORY ()); - - - Components::StandardConfigurator_var configurator = - config_impl->_this (); - - return configurator._retn (); - } - - PortableServer::POA_ptr - Servant_Impl_Base::_default_POA (void) - { - return - PortableServer::POA::_duplicate (container_->the_POA ()); - } -} - diff --git a/CIAO/ciao/Servant_Impl_Base.h b/CIAO/ciao/Servant_Impl_Base.h deleted file mode 100644 index 7fdc47dd860..00000000000 --- a/CIAO/ciao/Servant_Impl_Base.h +++ /dev/null @@ -1,215 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Impl_Base.h - * - * $Id$ - * - * This file contains the non-template declaration of a base class for - * the template mixin for the generated servant class. - * - * @author Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_SERVANT_IMPL_BASE_H -#define CIAO_SERVANT_IMPL_BASE_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Home_Servant_Impl_Base.h" -#include "Servant_Activator.h" - -#include "CCM_ContainerC.h" -#include "CCM_ObjectS.h" -#include "CCM_StandardConfiguratorC.h" - -#include "ace/Hash_Map_Manager_T.h" -#include "ace/Array_Map.h" - -namespace CIAO -{ - class Session_Container; - - /** - * @class Servant_Impl_Base - * - * @brief Non-template base class for Servant_Impl. - * - * Holds the non-template parts of its child class - * Servant_Impl. - */ - class CIAO_SERVER_Export Servant_Impl_Base - : public virtual POA_Components::CCMObject - { - public: - Servant_Impl_Base (Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c); - - virtual ~Servant_Impl_Base (void); - - /// Operations for CCMObject interface. - - virtual ::Components::PrimaryKeyBase * get_primary_key (void); - - virtual CORBA::IRObject_ptr get_component_def (void); - - virtual Components::SessionComponent_ptr get_executor (void) = 0; - - virtual void configuration_complete (void); - - virtual void remove (void); - - virtual ::Components::ConnectionDescriptions * - get_connections (const char *name); - - virtual ::Components::ComponentPortDescription * get_all_ports (void); - - virtual CORBA::Object_ptr provide_facet (const char *name); - - virtual ::Components::FacetDescriptions * - get_named_facets (const ::Components::NameList & names); - - virtual ::Components::FacetDescriptions * get_all_facets (void); - - virtual ::Components::ConsumerDescriptions * get_all_consumers (void); - - virtual ::Components::EventConsumerBase_ptr - get_consumer (const char *sink_name); - - virtual ::Components::ConsumerDescriptions * - get_named_consumers (const ::Components::NameList & names); - - virtual ::Components::EmitterDescriptions * - get_named_emitters (const ::Components::NameList & names); - - virtual ::Components::ReceptacleDescriptions * - get_named_receptacles (const ::Components::NameList & names); - - virtual ::Components::ReceptacleDescriptions * - get_all_receptacles (void); - - virtual ::Components::PublisherDescriptions * - get_named_publishers (const ::Components::NameList & names); - - /// Operation to set attributes on the component. - virtual void set_attributes (const Components::ConfigValues &descr) = 0; - - // Creates and returns the StandardConfigurator for the component. - virtual ::Components::StandardConfigurator_ptr - get_standard_configurator (void); - - /// Override that returns the (passed-in) default POA of our member - /// component's container, to ensure that we get registered - /// to that POA when _this() is called. - virtual PortableServer::POA_ptr _default_POA (void); - - protected: - void add_facet (const char *port_name, - ::CORBA::Object_ptr port_ref); - - CORBA::Object_ptr lookup_facet (const char *port_name); - - ::Components::FacetDescription *lookup_facet_description ( - 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); - - ::Components::EventConsumerBase_ptr lookup_consumer ( - const char *port_name); - - ::Components::ConsumerDescription *lookup_consumer_description ( - const char *port_name); - - /// Called from generated servant class to help with - /// get_all_*() methods. - - template<typename T_var> - static void describe_simplex_receptacle ( - const char *port_name, - const char *port_type_repo_id, - T_var &connection, - ::Components::ReceptacleDescriptions_var &descriptions, - CORBA::ULong slot - ); - - template<typename T_var> - static void describe_multiplex_receptacle ( - const char *port_name, - const char *port_type_repo_id, - ACE_Array_Map<ptrdiff_t, T_var> &objrefs, - ::Components::ReceptacleDescriptions_var &descriptions, - CORBA::ULong slot - ); - - template<typename T_var> - static void describe_pub_event_source ( - const char *port_name, - const char *port_type_repo_id, - ACE_Array_Map<ptrdiff_t, T_var> &consumers, - ::Components::PublisherDescriptions_var &descriptions, - CORBA::ULong slot - ); - - template<typename T_var> - static void describe_emit_event_source ( - const char *port_name, - const char *port_type_repo_id, - T_var &consumer_ref, - ::Components::EmitterDescriptions_var &descriptions, - CORBA::ULong slot - ); - - protected: - typedef ACE_Array_Map<ACE_CString, - ::Components::FacetDescription_var> - FacetTable; - - typedef ACE_Array_Map<ACE_CString, - ::Components::ConsumerDescription_var> - ConsumerTable; - - typedef ACE_Hash_Map_Manager_Ex<const char *, - ::Components::ReceptacleDescription_var, - ACE_Hash<const char *>, - ACE_Equal_To<const char *>, - 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_; - - private: - /// For internal locking of table reads and writes. - TAO_SYNCH_MUTEX lock_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Servant_Impl_Utils_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Servant_Impl_Utils_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Servant_Impl_T.cpp b/CIAO/ciao/Servant_Impl_T.cpp deleted file mode 100644 index 81eb60789d6..00000000000 --- a/CIAO/ciao/Servant_Impl_T.cpp +++ /dev/null @@ -1,251 +0,0 @@ -// $Id$ - -#ifndef CIAO_SERVANT_IMPL_T_C -#define CIAO_SERVANT_IMPL_T_C - -#include "Servant_Impl_T.h" -#include "CCM_EntityContextC.h" - -namespace CIAO -{ - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::Servant_Impl ( - EXEC * exe, - Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c - ) - : Servant_Impl_Base (home, home_servant, c), - activated_ (false), - pre_activated_ (false), - post_activated_ (false), - executor_ (EXEC::_duplicate (exe)) - { - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::~Servant_Impl (void) - { - // ********************************************************************** - /* - try - { - ::Components::SessionComponent_var scom = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - - if (! ::CORBA::is_nil (scom.in ())) - { - scom->ccm_remove (); - } - } - catch (const CORBA::Exception& ex) - { - } - */ - // ********************************************************************* - - this->context_->_remove_ref (); - } - - // Operations for CCMObject interface. - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - CORBA::Boolean - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::same_component ( - CORBA::Object_ptr object_ref - ) - { - if (::CORBA::is_nil (object_ref)) - { - throw ::CORBA::BAD_PARAM (); - } - - ::CORBA::Object_var the_other = - object_ref->_get_component (); - - ::CORBA::Object_var me = - this->context_->get_CCM_object (); - - return me->_is_equivalent (the_other.in ()); - - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - ::Components::CCMHome_ptr - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::get_ccm_home ( - ) - { - return this->context_->get_CCM_home (); - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - Components::SessionComponent_ptr - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::get_executor ( - ) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - return temp._retn (); - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - CORBA::Object_ptr - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::_get_component ( - ) - { - ::Components::SessionContext_var sc = - ::Components::SessionContext::_narrow ( - this->context_ - ); - - if (! ::CORBA::is_nil (sc.in ())) - { - return sc->get_CCM_object (); - } - - ::Components::EntityContext_var ec = - ::Components::EntityContext::_narrow ( - this->context_ - ); - - if (! ::CORBA::is_nil (ec.in ())) - { - return ec->get_CCM_object (); - } - - throw CORBA::INTERNAL (); - } - - // CIAO-specific operations. - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::activate_component ( - ) - { - if (this->is_activated () == 0) - { - this->ciao_preactivate (); - - this->ciao_activate (); - - this->ciao_postactivate (); - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_preactivate ( - ) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - - if (! ::CORBA::is_nil (temp.in ())) - { - if (this->pre_activated_ == 0) - { - this->pre_activated_ = 1; - temp->ciao_preactivate (); - } - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_activate () - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - - if (! ::CORBA::is_nil (temp.in ())) - { - if (this->activated_ == 0) - { - this->activated_ = 1; - temp->ccm_activate (); - } - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_postactivate ( - ) - { - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - - if (! ::CORBA::is_nil (temp.in ())) - { - if (this->post_activated_ == 0) - { - this->post_activated_ = 1; - temp->ciao_postactivate (); - } - } - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - CORBA::Boolean - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::is_activated ( - ) - { - return this->pre_activated_; - } - - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - void - Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_passivate ( - ) - { - // @@ Jai, could you please see why this is required? - ::Components::SessionComponent_var temp = - ::Components::SessionComponent::_narrow ( - this->executor_.in () - ); - - if (! ::CORBA::is_nil (temp.in ())) - temp->ccm_passivate (); - - this->pre_activated_ = 0; - this->activated_ = 0; - this->post_activated_ = 0; - } -} - -#endif /* CIAO_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Servant_Impl_T.h b/CIAO/ciao/Servant_Impl_T.h deleted file mode 100644 index f86fcd0c046..00000000000 --- a/CIAO/ciao/Servant_Impl_T.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Impl_T.h - * - * $Id$ - * - * This file contains the declaration of a mixin base class for - * the generated servant class. - * - * @authors Boris Kolpackov <boris@dre.vanderbilt.edu> - * Jeff Parsons <j.parsons@vanderbilt.edu> - */ -//============================================================================= - - -#ifndef CIAO_SERVANT_IMPL_T_H -#define CIAO_SERVANT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "Servant_Impl_Base.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -namespace CIAO -{ - class Session_Container; - - /** - * @class Servant_Impl - * - * @brief Mixin base class for generated servant. - * - * This class implements navigation and other operations - * common to all generated servants. - */ - template <typename BASE_SKEL, - typename EXEC, - typename CONTEXT> - class Servant_Impl : public virtual BASE_SKEL, - public virtual Servant_Impl_Base - { - public: - Servant_Impl (EXEC * exe, - Components::CCMHome_ptr home, - Home_Servant_Impl_Base *home_servant, - Session_Container * c); - - virtual ~Servant_Impl (void); - - // Operations for CCMObject interface. - - virtual CORBA::Boolean - same_component (CORBA::Object_ptr object_ref); - - virtual ::Components::CCMHome_ptr - get_ccm_home (); - - virtual CORBA::Object_ptr - _get_component (); - - virtual Components::SessionComponent_ptr - get_executor (); - - // CIAO-specific operations. - - void - ciao_preactivate (); - - void - ciao_activate (); - - void - ciao_postactivate (); - - /// @@NOTE: The busted operation. - void - ciao_passivate (); - - CORBA::Boolean - is_activated (); - - void - activate_component (); - - protected: - - CORBA::Boolean activated_; - CORBA::Boolean pre_activated_; - CORBA::Boolean post_activated_; - - /// Initialized in this constructor. - typename EXEC::_var_type executor_; - - /// Initialized in the derived, generated servant constructor. - CONTEXT * context_; - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Servant_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Servant_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Servant_Impl_Utils_T.cpp b/CIAO/ciao/Servant_Impl_Utils_T.cpp deleted file mode 100644 index 7738d2a7208..00000000000 --- a/CIAO/ciao/Servant_Impl_Utils_T.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// $Id$ - -#ifndef CIAO_SERVANT_IMPL_UTILS_T_C -#define CIAO_SERVANT_IMPL_UTILS_T_C - -#include "Servant_Impl_Base.h" -#include "ciao/Cookies.h" - -namespace CIAO -{ - template<typename T_var> - void - Servant_Impl_Base::describe_simplex_receptacle ( - const char *port_name, - const char *port_type_repo_id, - T_var &connection, - ::Components::ReceptacleDescriptions_var &descriptions, - CORBA::ULong slot) - { - ::Components::ReceptacleDescription *elem = 0; - ACE_NEW (elem, - ::OBV_Components::ReceptacleDescription); - ::Components::ReceptacleDescription_var safe_elem = elem; - - elem->name (port_name); - elem->type_id (port_type_repo_id); - elem->is_multiple (false); - elem->connections ().length (1UL); - - ::Components::ConnectionDescription *conn = 0; - ACE_NEW (conn, ::OBV_Components::ConnectionDescription); - ::Components::ConnectionDescription_var safe_conn = conn; - - conn->ck (0); - conn->objref (connection.in ()); - - elem->connections ()[0UL] = safe_conn._retn (); - descriptions[slot] = safe_elem._retn (); - } - - template<typename T_var> - void - Servant_Impl_Base::describe_multiplex_receptacle ( - const char *port_name, - const char *port_type_repo_id, - ACE_Array_Map<ptrdiff_t, T_var> &objrefs, - ::Components::ReceptacleDescriptions_var &descriptions, - CORBA::ULong slot - ) - { - ::Components::ReceptacleDescription *elem = 0; - ACE_NEW (elem, - ::OBV_Components::ReceptacleDescription); - ::Components::ReceptacleDescription_var safe_elem = elem; - - elem->name (port_name); - elem->type_id (port_type_repo_id); - elem->is_multiple (true); - elem->connections ().length (objrefs.size ()); - - CORBA::ULong seq_slot = 0UL; - ::Components::ConnectionDescription *conn = 0; - - typedef typename ACE_Array_Map<ptrdiff_t, T_var>::const_iterator - CONST_ITERATOR; - - for (CONST_ITERATOR iter = objrefs.begin (); - iter != objrefs.end (); - ++iter, ++seq_slot) - { - ACE_NEW (conn, - ::OBV_Components::ConnectionDescription); - ::Components::ConnectionDescription_var safe_conn = conn; - - ::Components::Cookie *key_cookie = 0; - ACE_NEW (key_cookie, - CIAO::Cookie_Impl (iter->first)); - - // Valuetype member set operation calls add_ref. - conn->ck (key_cookie); - CORBA::remove_ref (key_cookie); - - conn->objref (iter->second.in ()); - - elem->connections ()[seq_slot] = safe_conn._retn (); - } - - descriptions[slot] = safe_elem._retn (); - } - - template<typename T_var> - void - Servant_Impl_Base::describe_pub_event_source ( - const char *port_name, - const char *port_type_repo_id, - ACE_Array_Map<ptrdiff_t, T_var> &consumers, - ::Components::PublisherDescriptions_var &descriptions, - CORBA::ULong slot - ) - { - ::Components::PublisherDescription *elem = 0; - ACE_NEW (elem, - ::OBV_Components::PublisherDescription); - ::Components::PublisherDescription_var safe_elem = elem; - - elem->name (port_name); - elem->type_id (port_type_repo_id); - elem->consumer ().length (consumers.size ()); - - ptrdiff_t map_slot = 0UL; - ::Components::SubscriberDescription *sub = 0; - - typedef typename ACE_Array_Map<ptrdiff_t, T_var>::const_iterator - CONST_ITERATOR; - - for (CONST_ITERATOR iter = consumers.begin (); - iter != consumers.end (); - ++iter, ++map_slot) - { - ACE_NEW (sub, - ::OBV_Components::SubscriberDescription); - ::Components::SubscriberDescription_var safe_sub = sub; - - ::Components::Cookie *key_cookie = 0; - ACE_NEW (key_cookie, - CIAO::Cookie_Impl (iter->first)); - - // Valuetype member set operation calls add_ref. - sub->ck (key_cookie); - CORBA::remove_ref (key_cookie); - - sub->consumer (iter->second.in ()); - - elem->consumer ()[map_slot] = safe_sub._retn (); - } - - descriptions[slot] = safe_elem._retn (); - } - - template<typename T_var> - void - Servant_Impl_Base::describe_emit_event_source ( - const char *port_name, - const char *port_type_repo_id, - T_var &consumer_ref, - ::Components::EmitterDescriptions_var &descriptions, - CORBA::ULong slot - ) - { - ::Components::EmitterDescription *elem = 0; - ACE_NEW (elem, - ::OBV_Components::EmitterDescription); - ::Components::EmitterDescription_var safe_elem = elem; - - elem->name (port_name); - elem->type_id (port_type_repo_id); - - // Valuetype 'set' call increments the reference count. - elem->consumer (consumer_ref.in ()); - - descriptions[slot] = safe_elem._retn (); - } -} - -#endif /* CIAO_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Servants/CIAO_Port_Activator.idl b/CIAO/ciao/Servants/CIAO_Port_Activator.idl new file mode 100644 index 00000000000..593a9b33ce0 --- /dev/null +++ b/CIAO/ciao/Servants/CIAO_Port_Activator.idl @@ -0,0 +1,37 @@ +/** + * @file CIAO_Port_Activator.idl + * @author Wiliam R. Otte <wotte@dre.vanderbilt.edu + * $Id$ + * Local interface describing servant activators for component ports. + */ + +#ifndef CIAO_PORT_ACTIVATOR_IDL_ +#define CIAO_PORT_ACTIVATOR_IDL_ + +#include "tao/PortableServer/ServantActivator.pidl" + +module CIAO +{ + module Port_Activator_Types + { + enum Type + { + FACET, + SINK + }; + }; + + local interface Port_Activator + { + // OID of port this activator encapsulates + attribute string oid; + // name of the port + readonly attribute string name; + + PortableServer::Servant activate (in PortableServer::ObjectId oid); + + void deactivate (in PortableServer::Servant servant); + }; +}; + +#endif diff --git a/CIAO/ciao/Servants/CIAO_Port_Activator_export.h b/CIAO/ciao/Servants/CIAO_Port_Activator_export.h new file mode 100644 index 00000000000..7da2bf79f70 --- /dev/null +++ b/CIAO/ciao/Servants/CIAO_Port_Activator_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Port_Activator +// ------------------------------ +#ifndef CIAO_PORT_ACTIVATOR_EXPORT_H +#define CIAO_PORT_ACTIVATOR_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_PORT_ACTIVATOR_HAS_DLL) +# define CIAO_PORT_ACTIVATOR_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_PORT_ACTIVATOR_HAS_DLL */ + +#if !defined (CIAO_PORT_ACTIVATOR_HAS_DLL) +# define CIAO_PORT_ACTIVATOR_HAS_DLL 1 +#endif /* ! CIAO_PORT_ACTIVATOR_HAS_DLL */ + +#if defined (CIAO_PORT_ACTIVATOR_HAS_DLL) && (CIAO_PORT_ACTIVATOR_HAS_DLL == 1) +# if defined (CIAO_PORT_ACTIVATOR_BUILD_DLL) +# define CIAO_Port_Activator_Export ACE_Proper_Export_Flag +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_PORT_ACTIVATOR_BUILD_DLL */ +# define CIAO_Port_Activator_Export ACE_Proper_Import_Flag +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_PORT_ACTIVATOR_BUILD_DLL */ +#else /* CIAO_PORT_ACTIVATOR_HAS_DLL == 1 */ +# define CIAO_Port_Activator_Export +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARATION(T) +# define CIAO_PORT_ACTIVATOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_PORT_ACTIVATOR_HAS_DLL == 1 */ + +// Set CIAO_PORT_ACTIVATOR_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_PORT_ACTIVATOR_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_PORT_ACTIVATOR_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_PORT_ACTIVATOR_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_PORT_ACTIVATOR_NTRACE */ + +#if (CIAO_PORT_ACTIVATOR_NTRACE == 1) +# define CIAO_PORT_ACTIVATOR_TRACE(X) +#else /* (CIAO_PORT_ACTIVATOR_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_PORT_ACTIVATOR_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_PORT_ACTIVATOR_NTRACE == 1) */ + +#endif /* CIAO_PORT_ACTIVATOR_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Servants/CIAO_Servant_Impl_export.h b/CIAO/ciao/Servants/CIAO_Servant_Impl_export.h new file mode 100644 index 00000000000..c624a706b48 --- /dev/null +++ b/CIAO/ciao/Servants/CIAO_Servant_Impl_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Servant_Impl +// ------------------------------ +#ifndef CIAO_SERVANT_IMPL_EXPORT_H +#define CIAO_SERVANT_IMPL_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_SERVANT_IMPL_HAS_DLL) +# define CIAO_SERVANT_IMPL_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_SERVANT_IMPL_HAS_DLL */ + +#if !defined (CIAO_SERVANT_IMPL_HAS_DLL) +# define CIAO_SERVANT_IMPL_HAS_DLL 1 +#endif /* ! CIAO_SERVANT_IMPL_HAS_DLL */ + +#if defined (CIAO_SERVANT_IMPL_HAS_DLL) && (CIAO_SERVANT_IMPL_HAS_DLL == 1) +# if defined (CIAO_SERVANT_IMPL_BUILD_DLL) +# define CIAO_Servant_Impl_Export ACE_Proper_Export_Flag +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_SERVANT_IMPL_BUILD_DLL */ +# define CIAO_Servant_Impl_Export ACE_Proper_Import_Flag +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_SERVANT_IMPL_BUILD_DLL */ +#else /* CIAO_SERVANT_IMPL_HAS_DLL == 1 */ +# define CIAO_Servant_Impl_Export +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARATION(T) +# define CIAO_SERVANT_IMPL_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_SERVANT_IMPL_HAS_DLL == 1 */ + +// Set CIAO_SERVANT_IMPL_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_SERVANT_IMPL_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_SERVANT_IMPL_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_SERVANT_IMPL_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_SERVANT_IMPL_NTRACE */ + +#if (CIAO_SERVANT_IMPL_NTRACE == 1) +# define CIAO_SERVANT_IMPL_TRACE(X) +#else /* (CIAO_SERVANT_IMPL_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_SERVANT_IMPL_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_SERVANT_IMPL_NTRACE == 1) */ + +#endif /* CIAO_SERVANT_IMPL_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Servants/Home_Servant_Impl_Base.cpp b/CIAO/ciao/Servants/Home_Servant_Impl_Base.cpp new file mode 100644 index 00000000000..eeeedb34d59 --- /dev/null +++ b/CIAO/ciao/Servants/Home_Servant_Impl_Base.cpp @@ -0,0 +1,31 @@ +// $Id$ + +#include "Home_Servant_Impl_Base.h" +#include "ciao/Containers/Container_Base.h" + +namespace CIAO +{ + Home_Servant_Impl_Base::Home_Servant_Impl_Base (Container_ptr c) + : container_ (Container::_duplicate(c)) + { + } + + Home_Servant_Impl_Base::~Home_Servant_Impl_Base (void) + { + } + + // Operations for CCMHome interface. + + CORBA::IRObject_ptr + Home_Servant_Impl_Base::get_component_def (void) + { + throw CORBA::NO_IMPLEMENT (); + } + + CORBA::IRObject_ptr + Home_Servant_Impl_Base::get_home_def (void) + { + throw CORBA::NO_IMPLEMENT (); + } + +} diff --git a/CIAO/ciao/Servants/Home_Servant_Impl_Base.h b/CIAO/ciao/Servants/Home_Servant_Impl_Base.h new file mode 100644 index 00000000000..f1c6de82b60 --- /dev/null +++ b/CIAO/ciao/Servants/Home_Servant_Impl_Base.h @@ -0,0 +1,67 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Home_Servant_Impl_Base.h + * + * $Id$ + * + * This file contains the non-template declaration of a base class for + * the template mixin for the generated home servant class. + * + * @author Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_HOME_SERVANT_IMPL_BASE_H +#define CIAO_HOME_SERVANT_IMPL_BASE_H + +#include /**/ "ace/pre.h" + +#include "CIAO_Servant_Impl_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ccm/CCM_HomeS.h" +#include "ciao/Containers/Container_BaseC.h" + +namespace CIAO +{ + /** + * @class Home_Servant_Impl_Base + * + * @brief Non-template base class for Home_Servant_Impl. + * + * Holds the non-template parts of its child class + * Home_Servant_Impl. + */ + class CIAO_Servant_Impl_Export Home_Servant_Impl_Base + : public virtual POA_Components::CCMHome + { + public: + Home_Servant_Impl_Base (Container_ptr c); + + virtual ~Home_Servant_Impl_Base (void); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr get_component_def (void); + + virtual ::CORBA::IRObject_ptr get_home_def (void); + + virtual void update_component_map (PortableServer::ObjectId &oid) = 0; + + protected: + Container_var container_; + + private: + /// Not to be used + Home_Servant_Impl_Base (void); + }; +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_HOME_SERVANT_IMPL_BASE_H */ diff --git a/CIAO/ciao/Servants/Home_Servant_Impl_T.cpp b/CIAO/ciao/Servants/Home_Servant_Impl_T.cpp new file mode 100644 index 00000000000..3cb723724a7 --- /dev/null +++ b/CIAO/ciao/Servants/Home_Servant_Impl_T.cpp @@ -0,0 +1,216 @@ +// $Id$ + +#ifndef CIAO_HOME_SERVANT_IMPL_T_C +#define CIAO_HOME_SERVANT_IMPL_T_C + +#include "Home_Servant_Impl_T.h" +#include "ccm/CCM_ObjectC.h" +#include "ccm/CCM_EnterpriseComponentC.h" +#include "ciao/Containers/Container_BaseC.h" +#include "ciao/CIAO_common.h" + + +namespace CIAO +{ + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::Home_Servant_Impl ( + typename EXEC::_ptr_type exe, + Container_ptr c, + const char *ins_name + ) + : Home_Servant_Impl_Base (c), + ins_name_ (ins_name), + executor_ (EXEC::_duplicate (exe)) + { + } + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::~Home_Servant_Impl (void) + { + CIAO_TRACE ("Home_Servant_Impl<>::destructor"); + + const OBJ_ITERATOR end = this->objref_map_.end (); + + for (OBJ_ITERATOR iter = this->objref_map_.begin (); + iter != end; + ++iter) + { + this->remove_component (((*iter).int_id_).in ()); + } + } + + // Operations for CCMHome interface. + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + void + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::remove_component ( + ::Components::CCMObject_ptr comp) + { + CIAO_TRACE ("Home_Servant_Impl<>::remove_component"); + + PortableServer::ObjectId_var oid = + this->container_->the_POA ()->reference_to_id (comp); + + Components::CCMObject_var ccm_obj_var = Components::CCMObject::_nil (); + if (objref_map_.find (oid.in (), ccm_obj_var) != 0) + { + CIAO_ERROR ((LM_WARNING, CLINFO "Home_Servant_Impl<>::remove_component - Invalid component object reference\n")); + throw Components::RemoveFailure (); + } + + typedef typename COMP_SVNT::_stub_type stub_type; + typename COMP_SVNT::_stub_var_type _ciao_comp = + stub_type::_narrow (ccm_obj_var.in ()); + + if (CORBA::is_nil (_ciao_comp.in ())) + { + throw Components::RemoveFailure (); + } + + _ciao_comp->remove (); + + CIAO_DEBUG ((LM_INFO, CLINFO "Home_Servant_Impl<>::remove_component - Removed the component\n")); + } + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + void + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::update_component_map ( + PortableServer::ObjectId &oid) + { + CIAO_TRACE ("Home_Servant_Impl<>::update_component_map"); + + Components::CCMObject_var ccm_obj_ptr; + if (objref_map_.unbind (oid, ccm_obj_ptr) != 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Home_Servant_Impl<>::update_component_map - " + "Invalid component object reference\n")); + return; + } + + return; + } + + // Operations for keyless home interface. + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + Components::CCMObject_ptr + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::create_component (void) + { + CIAO_TRACE ("Home_Servant_Impl<>::create_component"); + + return this->create (); + } + + // Operations for implicit home interface. + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + typename COMP_SVNT::_stub_ptr_type + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::create (void) + { + CIAO_TRACE ("Home_Servant_Impl<>::create"); + + if (this->executor_.in () == 0) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Home_Servant_Impl<>:create - nil executor reference\n")); + throw CORBA::INTERNAL (); + } + + ::Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (); + + typedef typename COMP_SVNT::_exec_type exec_type; + typename COMP_SVNT::_exec_type::_var_type _ciao_comp = + exec_type::_narrow (_ciao_ec.in ()); + + return this->_ciao_activate_component (_ciao_comp.in ()); + } + + // CIAO-specific operations. + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + typename COMP_SVNT::_stub_ptr_type + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::_ciao_activate_component ( + typename COMP_SVNT::_exec_type::_ptr_type exe) + { + CIAO_TRACE ("Home_Servant_Impl<>::_ciao_activate_component"); + + CORBA::Object_var hobj = this->container_->get_objref (this); + + Components::CCMHome_var home = + Components::CCMHome::_narrow (hobj.in ()); + + typedef typename COMP_SVNT::_stub_type stub_type; + COMP_SVNT *svt = 0; + ACE_NEW_THROW_EX (svt, + COMP_SVNT (exe, + home.in (), + this->ins_name_, + this, + this->container_), + CORBA::NO_MEMORY ()); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_servant (svt, + Container_Types::COMPONENT_t, + oid.out ()); + + typedef typename COMP_SVNT::_stub_type stub_type; + typename COMP_SVNT::_stub_var_type ho = stub_type::_narrow (objref.in ()); + + Components::CCMObject_var ccmobjref = + Components::CCMObject::_narrow (objref.in ()); + + this->objref_map_.bind ( + oid.in (), + Components::CCMObject::_duplicate (ccmobjref.in ())); + + return ho._retn (); + } + + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + void + Home_Servant_Impl<BASE_SKEL, + EXEC, + COMP_SVNT>::_ciao_passivate_component ( + typename COMP_SVNT::_stub_ptr_type comp) + { + CIAO_TRACE ("Home_Servant_Impl<>::_ciao_passivate_component"); + + this->container_->uninstall_component (comp); + } +} + +#endif /* CIAO_HOME_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Servants/Home_Servant_Impl_T.h b/CIAO/ciao/Servants/Home_Servant_Impl_T.h new file mode 100644 index 00000000000..a6f035c1708 --- /dev/null +++ b/CIAO/ciao/Servants/Home_Servant_Impl_T.h @@ -0,0 +1,110 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Home_Servant_Impl_T.h + * + * $Id$ + * + * This file contains the declaration of a mixin base class for + * the generated home servant class. + * + * @authors Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + + +#ifndef CIAO_HOME_SERVANT_IMPL_T_H +#define CIAO_HOME_SERVANT_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "Home_Servant_Impl_Base.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Hash_Map_Manager_T.h" +#include "tao/PortableServer/Key_Adapters.h" + +namespace CIAO +{ + class Container; + typedef Container *Container_ptr; + + + /** + * @class Home_Servant_Impl + * + * @brief Mixin base class for generated home servant. + * + * This class implements operations + * common to all generated home servants. + */ + template <typename BASE_SKEL, + typename EXEC, + typename COMP_SVNT> + class Home_Servant_Impl + : public virtual BASE_SKEL, + public virtual Home_Servant_Impl_Base + { + public: + Home_Servant_Impl (typename EXEC::_ptr_type exe, + Container_ptr c, + const char *ins_name); + + virtual ~Home_Servant_Impl (void); + + // Operations for CCMHome interface. + + virtual void remove_component (Components::CCMObject_ptr comp); + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr create_component (); + + // Operations for implicit home interface. + + virtual typename COMP_SVNT::_stub_ptr_type create (); + + virtual void + update_component_map (PortableServer::ObjectId &oid); + + protected: + // CIAO-specific operations. + + typename COMP_SVNT::_stub_ptr_type + _ciao_activate_component (typename COMP_SVNT::_exec_type::_ptr_type exe); + + void + _ciao_passivate_component (typename COMP_SVNT::_stub_ptr_type comp); + + protected: + const char *ins_name_; + typename EXEC::_var_type executor_; + + typedef ACE_Hash_Map_Manager_Ex<PortableServer::ObjectId, + Components::CCMObject_var, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + TAO_SYNCH_MUTEX> + OBJREF_MAP; + + typedef OBJREF_MAP::iterator OBJ_ITERATOR; + + OBJREF_MAP objref_map_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Home_Servant_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Home_Servant_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_HOME_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Servants/Port_Activator.cpp b/CIAO/ciao/Servants/Port_Activator.cpp new file mode 100644 index 00000000000..35f7b3981d0 --- /dev/null +++ b/CIAO/ciao/Servants/Port_Activator.cpp @@ -0,0 +1,25 @@ +#include "Port_Activator.h" + +ACE_RCSID (ciao, + Servant_Activator, + "$Id$") + +#if !defined (__ACE_INLINE__) +# include "Port_Activator.inl" +#endif /* __ACE_INLINE__ */ + +namespace CIAO +{ + Port_Activator_i::Port_Activator_i (const char *oid, + const char *name, + Port_Activator_Types::Type t) + : oid_ (oid), + name_ (name), + t_ (t) + { + } + + Port_Activator_i::~Port_Activator_i (void) + { + } +} diff --git a/CIAO/ciao/Servants/Port_Activator.h b/CIAO/ciao/Servants/Port_Activator.h new file mode 100644 index 00000000000..994ac418991 --- /dev/null +++ b/CIAO/ciao/Servants/Port_Activator.h @@ -0,0 +1,86 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file Port_Activator.h + * + * $Id$ + * + * @authors Bala Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_PORT_ACTIVATOR_H +#define CIAO_PORT_ACTIVATOR_H + +#include /**/ "ace/pre.h" + +#include "CIAO_Servant_Impl_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/PortableServer.h" +#include "ciao/Servants/CIAO_Port_ActivatorC.h" + +namespace CIAO +{ + /** + * @class Port_Activator_i + * + * @brief Base class for port activations + * + * This is a ABC for the Port_Activator_T <> template class where + * the bulk of the work is done. This class is simply a place holder + * so that we could use the pointer to this class to achieve + * polymorphism for facet and consumer servant activations. + * + */ + class CIAO_Servant_Impl_Export Port_Activator_i : + public virtual Port_Activator + { + public: + Port_Activator_i (const char *oid, const char *name, Port_Activator_Types::Type t); + + virtual ~Port_Activator_i (void); + + /// Return the oid of port that this activator encapulates. + virtual char* oid (void); + + /// Set the oid + virtual void oid (const char* oid); + + /// Return the oid of port that this activator encapulates. + virtual char* name (void); + + /// Activate the servant reponsible for this port. + /** + * There are intentionally no throw specifications. It is the + * caller's responsibility to handle CORBA and C++ + * specifications. + */ + virtual PortableServer::Servant activate ( + const PortableServer::ObjectId &oid) = 0; + + virtual void deactivate (::PortableServer::Servant servant) = 0; + + protected: + /// The object ID that is used to activate the servant within the + /// POA. + CORBA::String_var oid_; + + /// Name of the port + CORBA::String_var name_; + + /// What type of port is it, a consumer or facet. + Port_Activator_Types::Type const t_; + }; +} + +#if defined (__ACE_INLINE__) +# include "Port_Activator.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /*CIAO_PORT_ACTIVATOR_H*/ diff --git a/CIAO/ciao/Servants/Port_Activator.inl b/CIAO/ciao/Servants/Port_Activator.inl new file mode 100644 index 00000000000..65ef76d56d9 --- /dev/null +++ b/CIAO/ciao/Servants/Port_Activator.inl @@ -0,0 +1,22 @@ +// $Id$ + +namespace CIAO +{ + ACE_INLINE char* + Port_Activator_i::oid (void) + { + return CORBA::string_dup(this->oid_.in ()); + } + + ACE_INLINE void + Port_Activator_i::oid (const char* oid) + { + this->oid_ = oid; + } + + ACE_INLINE char* + Port_Activator_i::name (void) + { + return CORBA::string_dup(this->name_.in ()); + } +} diff --git a/CIAO/ciao/Servants/Port_Activator_T.cpp b/CIAO/ciao/Servants/Port_Activator_T.cpp new file mode 100644 index 00000000000..c46ba91e7ad --- /dev/null +++ b/CIAO/ciao/Servants/Port_Activator_T.cpp @@ -0,0 +1,80 @@ +// $Id$ + +#ifndef CIAO_PORT_ACTIVATOR_T_CPP +#define CIAO_PORT_ACTIVATOR_T_CPP + +#include "Port_Activator_T.h" +#include "tao/CORBA_String.h" + +#include "ace/OS_NS_string.h" + + +namespace CIAO +{ + template <typename SERV, + typename EXEC, + typename CONTEXT, + typename COMP_SERV> + Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::Port_Activator_T ( + const char *oid, + const char *name, + Port_Activator_Types::Type t, + EXEC *e, + CONTEXT *c, + COMP_SERV *cc) + : Port_Activator_i (oid, name, t) + , executor_ (e) + , context_ (c) + , comp_serv_ (cc) + { + } + + template <typename SERV, + typename EXEC, + typename CONTEXT, + typename COMP_SERV> + void + Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::deactivate ( + PortableServer::Servant servant) + { + SERVANT *s = dynamic_cast<SERVANT *> (servant); + s->_remove_ref (); + } + + template <typename SERV, + typename EXEC, + typename CONTEXT, + typename COMP_SERV> + PortableServer::Servant + Port_Activator_T<SERV, EXEC, CONTEXT, COMP_SERV>::activate ( + const PortableServer::ObjectId &oid) + { + CORBA::String_var str = + PortableServer::ObjectId_to_string (oid); + + // An additional check, may not be necessary. Being on the safe + // side. + if (ACE_OS::strcmp (this->oid_.in (), str.in ()) == 0) + { + if (this->executor_ == 0 && this->t_ == Port_Activator_Types::FACET) + { + CORBA::Object_var tmp = + this->comp_serv_->get_facet_executor (this->name_.in ()); + + this->executor_ = EXEC::_narrow (tmp.in ()); + } + + SERVANT *s = 0; + + ACE_NEW_THROW_EX (s, + SERVANT (this->executor_, + this->context_), + CORBA::NO_MEMORY ()); + return s; + } + + throw CORBA::OBJECT_NOT_EXIST (); + } +} + +#endif /*SERVANT_ACTIVATOR_T_CPP*/ diff --git a/CIAO/ciao/Servants/Port_Activator_T.h b/CIAO/ciao/Servants/Port_Activator_T.h new file mode 100644 index 00000000000..4e40d895e8e --- /dev/null +++ b/CIAO/ciao/Servants/Port_Activator_T.h @@ -0,0 +1,80 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Port_Activator_T.h + * + * $Id$ + * + * @authors Bala Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_PORT_ACTIVATOR_T_H +#define CIAO_PORT_ACTIVATOR_T_H +#include /**/ "ace/pre.h" + +#include "ciao/Servants/Port_Activator.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CIAO +{ + /** + * @class Port_Activator_T + * + * @brief Concrete class that implements the strategy for creating + * the right type of servant for the ports in question. + * + * This class is parametrized by the servant type for the port, the + * executor type for the port, the context for the component and the + * component servant which instantiated this class within the + * container. + */ + template <typename SERV, + typename EXEC, + typename CONTEXT, + typename COMP_SERV> + class Port_Activator_T : public virtual Port_Activator_i + { + public: + typedef SERV SERVANT; + + Port_Activator_T (const char *oid, + const char *name, + Port_Activator_Types::Type t, + EXEC *e, + CONTEXT *c, + COMP_SERV *cs); + + /// Template method from the base class, please see the base class + /// documentation for details. + virtual PortableServer::Servant activate (const PortableServer::ObjectId &oid); + + virtual void deactivate (PortableServer::Servant servant); + + private: + /// The executor + EXEC *executor_; + + /// Context classes + CONTEXT *context_; + + /// Component servant which created <this> + COMP_SERV *comp_serv_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Port_Activator_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Port_Activator_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" +#endif /*CIAO_SERVANT_ACTIVATOR_T_H*/ diff --git a/CIAO/ciao/Servants/Servant_Impl_Base.cpp b/CIAO/ciao/Servants/Servant_Impl_Base.cpp new file mode 100644 index 00000000000..c24d47438fb --- /dev/null +++ b/CIAO/ciao/Servants/Servant_Impl_Base.cpp @@ -0,0 +1,753 @@ +// $Id$ + +#include "Servant_Impl_Base.h" + +#include "StandardConfigurator_Impl.h" +#include "ciao/CIAO_common.h" +#include "ciao/Containers/Container_BaseC.h" + + +namespace CIAO +{ + Servant_Impl_Base::Servant_Impl_Base (Components::CCMHome_ptr home, + Home_Servant_Impl_Base *home_servant, + Container_ptr c) + : home_ (Components::CCMHome::_duplicate (home)), + home_servant_ (home_servant), + container_ (Container::_duplicate (c)) + { + } + + Servant_Impl_Base::~Servant_Impl_Base (void) + { + } + + // Operations for CCMObject interface. + + ::Components::PrimaryKeyBase * + Servant_Impl_Base::get_primary_key (void) + { + CIAO_TRACE("Servant_Impl_Base::get_primary_key"); + throw ::Components::NoKeyAvailable (); + } + + CORBA::IRObject_ptr + Servant_Impl_Base::get_component_def (void) + { + CIAO_TRACE("Servant_Impl_Base::get_component_def"); + throw CORBA::NO_IMPLEMENT (); + } + + void + Servant_Impl_Base::configuration_complete (void) + { + CIAO_TRACE("Servant_Impl_Base::configuration_complete (void)"); + // CIAO to-do + } + + void + Servant_Impl_Base::remove (void) + { + CIAO_TRACE("Servant_Impl_Base::remove (void)"); + try + { + // Removing Facets + Components::FacetDescriptions_var facets = this->get_all_facets (); + + CORBA::ULong const facet_len = facets->length (); + + for (CORBA::ULong i = 0; i < facet_len; ++i) + { + PortableServer::ObjectId_var facet_id = + this->container_->the_port_POA ()->reference_to_id ( + facets[i]->facet_ref ()); + + CIAO::Servant_Activator *sa = + this->container_->ports_servant_activator (); + + sa->update_port_activator (facet_id.in ()); + + this->container_->the_port_POA ()->deactivate_object ( + facet_id); + } + + // Removed Facets + + // Removing Consumers + Components::ConsumerDescriptions_var consumers = + this->get_all_consumers (); + + CORBA::ULong const consumer_len = consumers->length (); + + for (CORBA::ULong j = 0; j < consumer_len; ++j) + { + PortableServer::ObjectId_var cons_id = + this->container_->the_port_POA ()->reference_to_id ( + consumers[j]->consumer ()); + + CIAO::Servant_Activator *sa = + this->container_->ports_servant_activator (); + sa->update_port_activator (cons_id.in ()); + + this->container_->the_port_POA ()->deactivate_object ( + cons_id); + } + + Components::SessionComponent_var temp = this->get_executor (); + temp->ccm_remove (); + + CORBA::Object_var objref = this->container_->get_objref (this); + + Components::CCMObject_var ccmobjref = + Components::CCMObject::_narrow (objref.in ()); + + PortableServer::ObjectId_var oid; + + this->container_->uninstall_servant (this, + Container_Types::COMPONENT_t, + oid.out ()); + + if (this->home_servant_) + this->home_servant_->update_component_map (oid); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Port not active\n"); + } + } + + ::Components::ConnectionDescriptions * + Servant_Impl_Base::get_connections (const char * /* name */) + { + CIAO_TRACE("Servant_Impl_Base::get_connections (const char * /* name */)"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::ComponentPortDescription * + Servant_Impl_Base::get_all_ports (void) + { + CIAO_TRACE("Servant_Impl_Base::get_all_ports (void)"); + OBV_Components::ComponentPortDescription *cps = 0; + ACE_NEW_THROW_EX (cps, + OBV_Components::ComponentPortDescription, + CORBA::NO_MEMORY ()); + ::Components::ComponentPortDescription_var retv = cps; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + Servant_Impl_Base::provide_facet (const char *name) + { + CIAO_TRACE("Servant_Impl_Base::provide_facet (const char *name)"); + if (0 == name) + { + throw Components::InvalidName (); + } + + CORBA::Object_ptr retval = this->lookup_facet (name); + + if (CORBA::is_nil (retval)) + { + throw Components::InvalidName (); + } + + return retval; + } + + Components::FacetDescriptions * + Servant_Impl_Base::get_named_facets ( + const ::Components::NameList & names) + { + CIAO_TRACE("Servant_Impl_Base::get_named_facets"); + Components::FacetDescriptions *retval = 0; + ACE_NEW_THROW_EX (retval, + ::Components::FacetDescriptions, + CORBA::NO_MEMORY ()); + Components::FacetDescriptions_var safe_retval = retval; + CORBA::ULong const len = names.length (); + safe_retval->length (len); + + for (CORBA::ULong i = 0; i < len; ++i) + { + ::Components::FacetDescription *tmp = + this->lookup_facet_description (names[i]); + + if (0 == tmp) + { + throw Components::InvalidName (); + } + + safe_retval[i] = tmp; + } + + return safe_retval._retn (); + } + + ::Components::FacetDescriptions * + Servant_Impl_Base::get_all_facets (void) + { + CIAO_TRACE ("Servant_Impl_Base::get_all_facets (void)"); + ::Components::FacetDescriptions *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Components::FacetDescriptions, + CORBA::NO_MEMORY ()); + + ::Components::FacetDescriptions_var retval = tmp; + + retval->length (this->facet_table_.size ()); + CORBA::ULong i = 0UL; + + for (FacetTable::const_iterator iter = this->facet_table_.begin (); + iter != this->facet_table_.end (); + ++iter, ++i) + { + retval[i] = iter->second; + } + + return retval._retn (); + } + + + ::Components::ConsumerDescriptions * + Servant_Impl_Base::get_all_consumers (void) + { + CIAO_TRACE("Servant_Impl_Base::get_all_consumers (void)"); + ::Components::ConsumerDescriptions *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Components::ConsumerDescriptions ( + this->consumer_table_.size ()), + CORBA::NO_MEMORY ()); + + ::Components::ConsumerDescriptions_var retval = tmp; + + retval->length (this->consumer_table_.size ()); + CORBA::ULong i = 0UL; + + for (ConsumerTable::const_iterator iter = this->consumer_table_.begin (); + iter != this->consumer_table_.end (); + ++iter, ++i) + { + retval[i] = iter->second; + } + + return retval._retn (); + } + + + ::Components::EventConsumerBase_ptr + Servant_Impl_Base::get_consumer (const char *sink_name) + { + CIAO_TRACE("Servant_Impl_Base::get_consumer (const char *sink_name)"); + if (0 == sink_name) + { + throw Components::InvalidName (); + } + + Components::EventConsumerBase_ptr retval = + this->lookup_consumer (sink_name); + + if (CORBA::is_nil (retval)) + { + throw Components::InvalidName (); + } + + return retval; + } + + ::Components::ConsumerDescriptions * + Servant_Impl_Base::get_named_consumers ( + const ::Components::NameList & names) + { + CIAO_TRACE("Servant_Impl_Base::get_named_consumers"); + Components::ConsumerDescriptions *retval = 0; + ACE_NEW_THROW_EX (retval, + ::Components::ConsumerDescriptions, + CORBA::NO_MEMORY ()); + Components::ConsumerDescriptions_var safe_retval = retval; + CORBA::ULong const len = names.length (); + safe_retval->length (len); + + for (CORBA::ULong i = 0; i < len; ++i) + { + ::Components::ConsumerDescription *tmp = + this->lookup_consumer_description (names[i]); + + if (0 == tmp) + { + throw Components::InvalidName (); + } + + safe_retval[i] = tmp; + } + + return safe_retval._retn (); + } + + ::Components::EmitterDescriptions * + Servant_Impl_Base::get_named_emitters ( + const ::Components::NameList & /* names */) + { + CIAO_TRACE("Servant_Impl_Base::get_named_emitters"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::ReceptacleDescriptions * + Servant_Impl_Base::get_all_receptacles (void) + { + CIAO_TRACE(" Servant_Impl_Base::get_all_receptacles (void)"); + CIAO_DEBUG ((LM_TRACE, CLINFO "Servant_Impl_Base::get_all_receptacles\n")); + + ::Components::ReceptacleDescriptions *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Components::ReceptacleDescriptions, + CORBA::NO_MEMORY ()); + + ::Components::ReceptacleDescriptions_var retval = tmp; + + retval->length (this->receptacle_table_.current_size ()); + CORBA::ULong i = 0; + + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Servant_Impl_Base::get_all_receptacles - Building sequence of length %d\n", + retval->length())); + + for (ReceptacleTable::iterator iter = this->receptacle_table_.begin (); + iter != this->receptacle_table_.end (); + ++iter, ++i) + { + CIAO_DEBUG ((LM_TRACE, CLINFO + "Servant_Impl_Base::get_all_receptacles - Starting loop iteration...\n", + retval->length())); + + ReceptacleTable::ENTRY & entry = *iter; + retval[i] = entry.int_id_; + } + + CIAO_DEBUG ((LM_TRACE, CLINFO "Servant_Impl_Base::get_all_receptacles - Escaped loop.\n")); + return retval._retn (); + } + + ::Components::ReceptacleDescriptions * + Servant_Impl_Base::get_named_receptacles ( + const ::Components::NameList & /* names */) + { + CIAO_TRACE("Servant_Impl_Base::get_named_receptacles"); + throw ::CORBA::NO_IMPLEMENT (); + } + + ::Components::PublisherDescriptions * + Servant_Impl_Base::get_named_publishers ( + const ::Components::NameList & /* names */) + { + CIAO_TRACE("Servant_Impl_Base::get_named_publishers"); + throw ::CORBA::NO_IMPLEMENT (); + } + + /// Protected operations. + void + Servant_Impl_Base::add_facet (const char *port_name, + ::CORBA::Object_ptr port_ref) + { + CIAO_TRACE("Servant_Impl_Base::add_facet"); + if (0 == port_name || ::CORBA::is_nil (port_ref)) + { + throw ::CORBA::BAD_PARAM (); + return; + } + + ::Components::FacetDescription *fd = 0; + ACE_NEW_THROW_EX (fd, + ::OBV_Components::FacetDescription (port_name, + port_ref->_interface_repository_id (), + port_ref), + CORBA::NO_MEMORY ()); + ::Components::FacetDescription_var safe = fd; + + FacetTable::value_type entry; + entry.first = port_name; + entry.second = safe._retn (); + + { + ACE_WRITE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, mon, this->lock_, + CORBA::NO_RESOURCES ()); + + (void) this->facet_table_.insert (entry); + } + } + + CORBA::Object_ptr + Servant_Impl_Base::lookup_facet (const char *port_name) + { + CIAO_TRACE("Servant_Impl_Base::lookup_facet"); + if (0 == port_name) + { + return CORBA::Object::_nil (); + } + + ACE_READ_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + mon, + this->lock_, + CORBA::NO_RESOURCES ()); + + FacetTable::const_iterator iter = + this->facet_table_.find (port_name); + + if (iter == this->facet_table_.end ()) + { + return CORBA::Object::_nil (); + } + + return CORBA::Object::_duplicate (iter->second->facet_ref ()); + } + + ::Components::FacetDescription * + Servant_Impl_Base::lookup_facet_description (const char *port_name) + { + CIAO_TRACE("Servant_Impl_Base::lookup_facet_description"); + if (0 == port_name) + { + /// Calling function will throw InvalidName after getting this. + return 0; + } + + ::Components::FacetDescription_var fd; + + { + ACE_READ_GUARD_RETURN (TAO_SYNCH_MUTEX, + mon, + this->lock_, + 0); + FacetTable::const_iterator iter = + this->facet_table_.find (port_name); + + if (iter != this->facet_table_.end ()) + { + fd = iter->second; + } + } + + return fd._retn (); + } + + void + Servant_Impl_Base::add_receptacle (const char *receptacle_name, + CORBA::Object_ptr recept_ref, + ::Components::Cookie * cookie) + { + CIAO_TRACE("Servant_Impl_Base::add_receptacle"); + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Impl_Base::add_receptacle - attempting to add new connection to receptacle (%C)\n", + receptacle_name)); + + ::Components::ReceptacleDescription_var safe; + ::Components::ReceptacleDescription *rd = 0; + + if (this->receptacle_table_.find (receptacle_name, + safe) == -1) + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Servant_Impl_Base::add_receptacle - Found no receptacle named (%C), creating it...\n", + receptacle_name)); + + ACE_NEW_THROW_EX (rd, + OBV_Components::ReceptacleDescription, + CORBA::NO_MEMORY ()); + safe = rd; + + rd->name (receptacle_name); + rd->type_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_THROW_EX (cd, + OBV_Components::ConnectionDescription (cookie, + recept_ref), + CORBA::NO_MEMORY ()); + ::Components::ConnectionDescription_var cd_safe = cd; + ::Components::ConnectionDescriptions cds (1); + + cds.length (1); + cds[0] = cd_safe; + rd->connections (cds); + } + else + { + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Servant_Impl_Base::add_receptacle - Found a receptacle named (%C)\n", + receptacle_name)); + rd = safe.inout (); + + ::Components::ConnectionDescription *cd = 0; + ACE_NEW_THROW_EX (cd, + OBV_Components::ConnectionDescription (cookie, + recept_ref), + CORBA::NO_MEMORY ()); + ::Components::ConnectionDescription_var cd_safe = cd; + ::Components::ConnectionDescriptions & cds = rd->connections (); + CORBA::ULong old_length = cds.length (); + cds.length (old_length + 1); + cds [old_length] = cd_safe; + + CIAO_DEBUG ((LM_DEBUG, CLINFO + "Servant_Impl_Base::add_receptacle - Added new connection to " + "existing receptacle named (%C)\n", + receptacle_name)); + } + + if (this->receptacle_table_.bind (receptacle_name, safe) == 0) + { + CIAO_DEBUG ((LM_INFO, CLINFO + "Servant_Impl_Base::add_receptacle - Successfully added new receptacle named (%C)\n", + receptacle_name)); + } + } + + void + Servant_Impl_Base::add_consumer (const char *port_name, + ::Components::EventConsumerBase_ptr port_ref) + { + CIAO_TRACE("Servant_Impl_Base::add_consumer"); + if (0 == port_name || ::CORBA::is_nil (port_ref)) + { + CIAO_ERROR ((LM_ERROR, CLINFO "Servant_Impl_Base::add_consumer - Bad port name [%C] or bad objref\n", + port_name)); + throw ::CORBA::BAD_PARAM (); + return; + } + + ::Components::ConsumerDescription *cd = 0; + ACE_NEW_THROW_EX (cd, + ::OBV_Components::ConsumerDescription, + CORBA::NO_MEMORY ()); + + ::Components::ConsumerDescription_var safe = cd; + + cd->name (port_name); + cd->type_id (port_ref->_interface_repository_id ()); + cd->consumer (port_ref); + + ConsumerTable::value_type entry; + entry.first = port_name; + entry.second = safe._retn (); + + ACE_WRITE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, mon, this->lock_, + CORBA::NO_RESOURCES ()); + + (void) this->consumer_table_.insert (entry); + } + + ::Components::EventConsumerBase_ptr + Servant_Impl_Base::lookup_consumer (const char *port_name) + { + CIAO_TRACE("Servant_Impl_Base::lookup_consumer"); + if (0 == port_name) + { + return ::Components::EventConsumerBase::_nil (); + } + + ACE_READ_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + mon, + this->lock_, + CORBA::NO_RESOURCES ()); + + ConsumerTable::const_iterator iter = + this->consumer_table_.find (port_name); + + if (iter == this->consumer_table_.end ()) + { + return ::Components::EventConsumerBase::_nil (); + } + + return + ::Components::EventConsumerBase::_duplicate ( + iter->second->consumer ()); + } + + ::Components::ConsumerDescription * + Servant_Impl_Base::lookup_consumer_description ( + const char *port_name) + { + CIAO_TRACE("Servant_Impl_Base::lookup_consumer_description"); + if (0 == port_name) + { + /// Calling function will throw InvalidName after getting this. + return 0; + } + + ::Components::ConsumerDescription_var cd; + ConsumerTable::const_iterator iter; + + { + ACE_READ_GUARD_THROW_EX (TAO_SYNCH_MUTEX, + mon, + this->lock_, + CORBA::NO_RESOURCES ()); + + iter = this->consumer_table_.find (port_name); + + if (iter != this->consumer_table_.end ()) + { + cd = iter->second; + } + } + + return cd._retn (); + } + + ::Components::StandardConfigurator_ptr + Servant_Impl_Base::get_standard_configurator (void) + { + CIAO_TRACE("Servant_Impl_Base::get_standard_configurator (void)"); + // Create the configurator servant. + StandardConfigurator_Impl *config_impl = 0; + + ACE_NEW_THROW_EX (config_impl, + StandardConfigurator_Impl (this), + CORBA::NO_MEMORY ()); + + + Components::StandardConfigurator_var configurator = + config_impl->_this (); + + return configurator._retn (); + } + + void + Servant_Impl_Base::activate_component (void) + { + CIAO_TRACE ("Servant_Impl_Base::activate_component"); + throw CORBA::NO_IMPLEMENT (); + } + + + void + Servant_Impl_Base::passivate_component (void) + { + CIAO_TRACE ("Servant_Impl_Base::passivate_component"); + throw CORBA::NO_IMPLEMENT (); + } + + Components::SessionComponent_ptr + Servant_Impl_Base::get_executor (void) + { + CIAO_TRACE ("Servant_Impl_Base::get_executor"); + throw CORBA::NO_IMPLEMENT (); + } + + void + Servant_Impl_Base::set_attributes (const Components::ConfigValues &/*descr*/) + { + CIAO_TRACE ("Servant_Impl_Base::set_attributes"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::CCMHome_ptr + Servant_Impl_Base::get_ccm_home (void) + { + CIAO_TRACE ("Servant_Impl_Base::get_ccm_home"); + throw CORBA::NO_IMPLEMENT (); + } + + PortableServer::POA_ptr + Servant_Impl_Base::_default_POA (void) + { + CIAO_TRACE("Servant_Impl_Base::_default_POA (void)"); + return + PortableServer::POA::_duplicate (container_->the_POA ()); + } + + ::Components::Cookie * + Servant_Impl_Base::subscribe (const char *, + ::Components::EventConsumerBase_ptr) + { + CIAO_TRACE ("Servant_Impl_Base::subscribe"); + throw CORBA::NO_IMPLEMENT (); + } + + + ::Components::EventConsumerBase_ptr + Servant_Impl_Base::unsubscribe (const char *, + ::Components::Cookie *) + { + CIAO_TRACE ("Servant_Impl_Base::unsubscribe"); + throw CORBA::NO_IMPLEMENT (); + } + + void + Servant_Impl_Base::connect_consumer (const char *, + ::Components::EventConsumerBase_ptr) + { + CIAO_TRACE ("Servant_Impl_Base::connect_consumer"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::EventConsumerBase_ptr + Servant_Impl_Base::disconnect_consumer (const char *) + { + CIAO_TRACE ("Servant_Impl_Base::disconnect_consumer"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::EmitterDescriptions * + Servant_Impl_Base::get_all_emitters (void) + { + CIAO_TRACE ("Servant_Impl_Base::get_all_emitters"); + throw CORBA::NO_IMPLEMENT (); + } + + ::Components::PublisherDescriptions * + Servant_Impl_Base::get_all_publishers (void) + { + CIAO_TRACE ("Servant_Impl_Base::get_all_publishers"); + throw CORBA::NO_IMPLEMENT (); + } + + ::CORBA::Boolean + Servant_Impl_Base::same_component (::CORBA::Object_ptr) + { + CIAO_TRACE ("Servant_Impl_Base::same_component"); + throw CORBA::NO_IMPLEMENT (); + } + + + ::Components::Cookie * + Servant_Impl_Base::connect (const char *, + ::CORBA::Object_ptr) + { + CIAO_TRACE ("Servant_Impl_Base::connect"); + throw CORBA::NO_IMPLEMENT (); + } + + ::CORBA::Object_ptr + Servant_Impl_Base::disconnect (const char *, + ::Components::Cookie *) + { + CIAO_TRACE ("Servant_Impl_Base::disconnect"); + throw CORBA::NO_IMPLEMENT (); + } +} + diff --git a/CIAO/ciao/Servants/Servant_Impl_Base.h b/CIAO/ciao/Servants/Servant_Impl_Base.h new file mode 100644 index 00000000000..ad43b47f04f --- /dev/null +++ b/CIAO/ciao/Servants/Servant_Impl_Base.h @@ -0,0 +1,245 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Servant_Impl_Base.h + * + * $Id$ + * + * This file contains the non-template declaration of a base class for + * the template mixin for the generated servant class. + * + * @author Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_SERVANT_IMPL_BASE_H +#define CIAO_SERVANT_IMPL_BASE_H + +#include /**/ "ace/pre.h" + +#include "CIAO_Servant_Impl_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Home_Servant_Impl_Base.h" +#include "ciao/Containers/CIAO_Servant_ActivatorC.h" + +#include "ace/Hash_Map_Manager_T.h" +#include "ace/Array_Map.h" +#include "ccm/CCM_ContainerC.h" +#include "ccm/CCM_ObjectS.h" +#include "ccm/CCM_StandardConfiguratorC.h" + + + +namespace CIAO +{ + class Container; + typedef Container *Container_ptr; + typedef TAO_Objref_Var_T<Container> Container_var; + + /** + * @class Servant_Impl_Base + * + * @brief Non-template base class for Servant_Impl. + * + * Holds the non-template parts of its child class + * Servant_Impl. + */ + class CIAO_Servant_Impl_Export Servant_Impl_Base + : public virtual POA_Components::CCMObject + { + protected: + Servant_Impl_Base (Components::CCMHome_ptr home, + Home_Servant_Impl_Base *home_servant, + Container_ptr c); + + public: + virtual ~Servant_Impl_Base (void); + + /// Operations for CCMObject interface. + + virtual ::Components::PrimaryKeyBase * get_primary_key (void); + + virtual CORBA::IRObject_ptr get_component_def (void); + + virtual Components::SessionComponent_ptr get_executor (void); + + virtual void configuration_complete (void); + + virtual void activate_component (void); + + virtual void passivate_component (void); + + virtual ::Components::CCMHome_ptr get_ccm_home (void); + + virtual void remove (void); + + virtual ::Components::ConnectionDescriptions * + get_connections (const char *name); + + virtual ::Components::ComponentPortDescription * get_all_ports (void); + + virtual CORBA::Object_ptr provide_facet (const char *name); + + virtual ::Components::FacetDescriptions * + get_named_facets (const ::Components::NameList & names); + + virtual ::Components::FacetDescriptions * get_all_facets (void); + + virtual ::Components::ConsumerDescriptions * get_all_consumers (void); + + virtual ::Components::EventConsumerBase_ptr + get_consumer (const char *sink_name); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers (const ::Components::NameList & names); + + virtual ::Components::EmitterDescriptions * + get_named_emitters (const ::Components::NameList & names); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles (const ::Components::NameList & names); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles (void); + + virtual ::Components::PublisherDescriptions * + get_named_publishers (const ::Components::NameList & names); + + /// Operation to set attributes on the component. + virtual void set_attributes (const Components::ConfigValues &descr); + + // Creates and returns the StandardConfigurator for the component. + virtual ::Components::StandardConfigurator_ptr + get_standard_configurator (void); + + /// Override that returns the (passed-in) default POA of our member + /// component's container, to ensure that we get registered + /// to that POA when _this() is called. + virtual PortableServer::POA_ptr _default_POA (void); + + virtual ::Components::Cookie * subscribe (const char * publisher_name, + ::Components::EventConsumerBase_ptr subscriber); + + virtual ::Components::EventConsumerBase_ptr unsubscribe (const char * publisher_name, + ::Components::Cookie * ck); + + virtual void connect_consumer (const char * emitter_name, + ::Components::EventConsumerBase_ptr consumer); + + virtual ::Components::EventConsumerBase_ptr disconnect_consumer (const char * source_name); + + virtual ::Components::EmitterDescriptions * get_all_emitters (void); + + virtual ::Components::PublisherDescriptions * get_all_publishers (void); + + virtual ::CORBA::Boolean same_component (::CORBA::Object_ptr object_ref); + + virtual ::Components::Cookie * connect (const char * name, + ::CORBA::Object_ptr connection); + + virtual ::CORBA::Object_ptr disconnect (const char * name, + ::Components::Cookie * ck); + + + protected: + void add_facet (const char *port_name, + ::CORBA::Object_ptr port_ref); + + CORBA::Object_ptr lookup_facet (const char *port_name); + + ::Components::FacetDescription *lookup_facet_description ( + 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); + + ::Components::EventConsumerBase_ptr lookup_consumer ( + const char *port_name); + + ::Components::ConsumerDescription *lookup_consumer_description ( + const char *port_name); + + /// Called from generated servant class to help with + /// get_all_*() methods. + + template<typename T_var> + static void describe_simplex_receptacle ( + const char *port_name, + const char *port_type_repo_id, + T_var &connection, + ::Components::ReceptacleDescriptions_var &descriptions, + CORBA::ULong slot); + + template<typename T_var> + static void describe_multiplex_receptacle ( + const char *port_name, + const char *port_type_repo_id, + ACE_Array_Map<ptrdiff_t, T_var> &objrefs, + ::Components::ReceptacleDescriptions_var &descriptions, + CORBA::ULong slot); + + template<typename T_var> + static void describe_pub_event_source ( + const char *port_name, + const char *port_type_repo_id, + ACE_Array_Map<ptrdiff_t, T_var> &consumers, + ::Components::PublisherDescriptions_var &descriptions, + CORBA::ULong slot); + + template<typename T_var> + static void describe_emit_event_source ( + const char *port_name, + const char *port_type_repo_id, + T_var &consumer_ref, + ::Components::EmitterDescriptions_var &descriptions, + CORBA::ULong slot); + + protected: + typedef ACE_Array_Map<ACE_CString, + ::Components::FacetDescription_var> + FacetTable; + + typedef ACE_Array_Map<ACE_CString, + ::Components::ConsumerDescription_var> + ConsumerTable; + + typedef ACE_Hash_Map_Manager_Ex<const char *, + ::Components::ReceptacleDescription_var, + ACE_Hash<const char *>, + ACE_Equal_To<const char *>, + ACE_Null_Mutex> + ReceptacleTable; + + FacetTable facet_table_; + ConsumerTable consumer_table_; + ReceptacleTable receptacle_table_; + Components::CCMHome_var home_; + Home_Servant_Impl_Base *home_servant_; + Container_var container_; + + private: + /// For internal locking of table reads and writes. + TAO_SYNCH_MUTEX lock_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Servant_Impl_Utils_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Servant_Impl_Utils_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Servants/Servant_Impl_T.cpp b/CIAO/ciao/Servants/Servant_Impl_T.cpp new file mode 100644 index 00000000000..8c3b00a09d0 --- /dev/null +++ b/CIAO/ciao/Servants/Servant_Impl_T.cpp @@ -0,0 +1,239 @@ +// $Id$ + +#ifndef CIAO_SERVANT_IMPL_T_C +#define CIAO_SERVANT_IMPL_T_C + +#include "Servant_Impl_T.h" +#include <ccm/CCM_EntityContextC.h> + +namespace CIAO +{ + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::Servant_Impl ( + EXEC * exe, + Components::CCMHome_ptr home, + Home_Servant_Impl_Base *home_servant, + Container_ptr c + ) + : Servant_Impl_Base (home, home_servant, c), + activated_ (false), + configuration_completed_ (false), + executor_ (EXEC::_duplicate (exe)) + { + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::~Servant_Impl (void) + { + CIAO_DEBUG ((LM_INFO, "Servant_Impl_T::~Servant_Impl - " + "Executor object reference count is %u\n", + this->executor_->_refcount_value ())); + + // ********************************************************************** + /* + try + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ); + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (); + } + } + catch (const CORBA::Exception& ex) + { + } + */ + // ********************************************************************* + + this->context_->_remove_ref (); + } + + // Operations for CCMObject interface. + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + CORBA::Boolean + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::same_component ( + CORBA::Object_ptr object_ref + ) + { + if (::CORBA::is_nil (object_ref)) + { + throw ::CORBA::BAD_PARAM (); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (); + + return me->_is_equivalent (the_other.in ()); + + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + ::Components::CCMHome_ptr + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::get_ccm_home ( + ) + { + return this->context_->get_CCM_home (); + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + Components::SessionComponent_ptr + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::get_executor ( + ) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ); + return temp._retn (); + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + CORBA::Object_ptr + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::_get_component ( + ) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (); + } + + throw CORBA::INTERNAL (); + } + + // CIAO-specific operations. + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + void + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::activate_component ( + ) + { + if (this->configuration_completed_ == 1) + { + this->ciao_activate (); + } + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + void + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::passivate_component ( + ) + { + if (this->activated_ == 1) + { + this->ciao_passivate (); + } + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + void + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::configuration_complete ( + ) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ); + + if (! ::CORBA::is_nil (temp.in ())) + { + if (this->configuration_completed_ == 0) + { + this->configuration_completed_ = 1; + temp->configuration_complete (); + } + } + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + void + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_activate () + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ); + + if (! ::CORBA::is_nil (temp.in ())) + { + if (this->activated_ == 0) + { + this->activated_ = 1; + temp->ccm_activate (); + } + } + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + CORBA::Boolean + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::is_activated ( + ) + { + return this->activated_; + } + + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + void + Servant_Impl<BASE_SKEL, EXEC, CONTEXT>::ciao_passivate ( + ) + { + // @@ Jai, could you please see why this is required? + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ); + + if (! ::CORBA::is_nil (temp.in ())) + temp->ccm_passivate (); + + this->activated_ = 0; + } +} + +#endif /* CIAO_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Servants/Servant_Impl_T.h b/CIAO/ciao/Servants/Servant_Impl_T.h new file mode 100644 index 00000000000..10c25af865b --- /dev/null +++ b/CIAO/ciao/Servants/Servant_Impl_T.h @@ -0,0 +1,111 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Servant_Impl_T.h + * + * $Id$ + * + * This file contains the declaration of a mixin base class for + * the generated servant class. + * + * @authors Boris Kolpackov <boris@dre.vanderbilt.edu> + * Jeff Parsons <j.parsons@vanderbilt.edu> + */ +//============================================================================= + + +#ifndef CIAO_SERVANT_IMPL_T_H +#define CIAO_SERVANT_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "Servant_Impl_Base.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + /** + * @class Servant_Impl + * + * @brief Mixin base class for generated servant. + * + * This class implements navigation and other operations + * common to all generated servants. + */ + template <typename BASE_SKEL, + typename EXEC, + typename CONTEXT> + class Servant_Impl : public virtual BASE_SKEL, + public virtual Servant_Impl_Base + { + public: + Servant_Impl (EXEC * exe, + Components::CCMHome_ptr home, + Home_Servant_Impl_Base *home_servant, + Container_ptr c); + + virtual ~Servant_Impl (void); + + // Operations for CCMObject interface. + + virtual CORBA::Boolean + same_component (CORBA::Object_ptr object_ref); + + virtual ::Components::CCMHome_ptr + get_ccm_home (); + + virtual CORBA::Object_ptr + _get_component (); + + virtual Components::SessionComponent_ptr + get_executor (); + + // CIAO-specific operations. + + void + configuration_complete (); + + void + ciao_activate (); + + /// @@NOTE: The busted operation. + void + ciao_passivate (); + + CORBA::Boolean + is_activated (); + + virtual void + activate_component (); + + virtual void + passivate_component (); + + protected: + + CORBA::Boolean activated_; + CORBA::Boolean configuration_completed_; + + /// Initialized in this constructor. + typename EXEC::_var_type executor_; + + /// Initialized in the derived, generated servant constructor. + CONTEXT * context_; + }; +} + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Servant_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Servant_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_SERVANT_IMPL_T_H */ diff --git a/CIAO/ciao/Servants/Servant_Impl_Utils_T.cpp b/CIAO/ciao/Servants/Servant_Impl_Utils_T.cpp new file mode 100644 index 00000000000..ce20e0f2a7b --- /dev/null +++ b/CIAO/ciao/Servants/Servant_Impl_Utils_T.cpp @@ -0,0 +1,182 @@ +// $Id$ + +#ifndef CIAO_SERVANT_IMPL_UTILS_T_C +#define CIAO_SERVANT_IMPL_UTILS_T_C + +#include "ciao/Servants/Servant_Impl_Base.h" +#include "ciao/Valuetype_Factories/Cookies.h" +#include "ciao/CIAO_common.h" + +namespace CIAO +{ + template<typename T_var> + void + Servant_Impl_Base::describe_simplex_receptacle ( + const char *port_name, + const char *port_type_repo_id, + T_var &connection, + ::Components::ReceptacleDescriptions_var &descriptions, + CORBA::ULong slot) + { + CIAO_TRACE ("Servant_Impl_Base::describe_simplex_receptacle"); + + ::Components::ReceptacleDescription *elem = 0; + ACE_NEW_THROW_EX (elem, + ::OBV_Components::ReceptacleDescription, + CORBA::NO_MEMORY ()); + + ::Components::ReceptacleDescription_var safe_elem = elem; + + elem->name (port_name); + elem->type_id (port_type_repo_id); + elem->is_multiple (false); + elem->connections ().length (1UL); + + ::Components::ConnectionDescription *conn = 0; + ACE_NEW (conn, ::OBV_Components::ConnectionDescription); + ::Components::ConnectionDescription_var safe_conn = conn; + + conn->ck (0); + conn->objref (connection.in ()); + + elem->connections ()[0UL] = safe_conn._retn (); + descriptions[slot] = safe_elem._retn (); + } + + template<typename T_var> + void + Servant_Impl_Base::describe_multiplex_receptacle ( + const char *port_name, + const char *port_type_repo_id, + ACE_Array_Map<ptrdiff_t, T_var> &objrefs, + ::Components::ReceptacleDescriptions_var &descriptions, + CORBA::ULong slot + ) + { + CIAO_TRACE ("Servant_Impl_Base::describe_multiplex_receptacle"); + + ::Components::ReceptacleDescription *elem = 0; + ACE_NEW_THROW_EX (elem, + ::OBV_Components::ReceptacleDescription, + CORBA::NO_MEMORY ()); + + ::Components::ReceptacleDescription_var safe_elem = elem; + + elem->name (port_name); + elem->type_id (port_type_repo_id); + elem->is_multiple (true); + elem->connections ().length (objrefs.size ()); + + CORBA::ULong seq_slot = 0UL; + ::Components::ConnectionDescription *conn = 0; + + typedef typename ACE_Array_Map<ptrdiff_t, T_var>::const_iterator + CONST_ITERATOR; + + for (CONST_ITERATOR iter = objrefs.begin (); + iter != objrefs.end (); + ++iter, ++seq_slot) + { + ACE_NEW_THROW_EX (conn, + ::OBV_Components::ConnectionDescription, + CORBA::NO_MEMORY ()); + ::Components::ConnectionDescription_var safe_conn = conn; + + ::Components::Cookie *key_cookie = 0; + ACE_NEW_THROW_EX (key_cookie, + CIAO::Cookie_Impl (iter->first), + CORBA::NO_MEMORY ()); + + // Valuetype member set operation calls add_ref. + conn->ck (key_cookie); + CORBA::remove_ref (key_cookie); + + conn->objref (iter->second.in ()); + + elem->connections ()[seq_slot] = safe_conn._retn (); + } + + descriptions[slot] = safe_elem._retn (); + } + + template<typename T_var> + void + Servant_Impl_Base::describe_pub_event_source ( + const char *port_name, + const char *port_type_repo_id, + ACE_Array_Map<ptrdiff_t, T_var> &consumers, + ::Components::PublisherDescriptions_var &descriptions, + CORBA::ULong slot + ) + { + CIAO_TRACE ("Servant_Impl_Base::describe_pub_event_source"); + + ::Components::PublisherDescription *elem = 0; + ACE_NEW_THROW_EX (elem, + ::OBV_Components::PublisherDescription, + CORBA::NO_MEMORY ()); + + ::Components::PublisherDescription_var safe_elem = elem; + + elem->name (port_name); + elem->type_id (port_type_repo_id); + elem->consumer ().length (consumers.size ()); + + ptrdiff_t map_slot = 0UL; + ::Components::SubscriberDescription *sub = 0; + + typedef typename ACE_Array_Map<ptrdiff_t, T_var>::const_iterator + CONST_ITERATOR; + + for (CONST_ITERATOR iter = consumers.begin (); + iter != consumers.end (); + ++iter, ++map_slot) + { + ACE_NEW_THROW_EX (sub, + ::OBV_Components::SubscriberDescription, + CORBA::NO_MEMORY ()); + ::Components::SubscriberDescription_var safe_sub = sub; + + ::Components::Cookie *key_cookie = 0; + ACE_NEW (key_cookie, + CIAO::Cookie_Impl (iter->first)); + + // Valuetype member set operation calls add_ref. + sub->ck (key_cookie); + CORBA::remove_ref (key_cookie); + + sub->consumer (iter->second.in ()); + + elem->consumer ()[map_slot] = safe_sub._retn (); + } + + descriptions[slot] = safe_elem._retn (); + } + + template<typename T_var> + void + Servant_Impl_Base::describe_emit_event_source ( + const char *port_name, + const char *port_type_repo_id, + T_var &consumer_ref, + ::Components::EmitterDescriptions_var &descriptions, + CORBA::ULong slot) + { + CIAO_TRACE ("Servant_Impl_Base::describe_emit_event_source"); + ::Components::EmitterDescription *elem = 0; + ACE_NEW_THROW_EX (elem, + ::OBV_Components::EmitterDescription, + CORBA::NO_MEMORY ()); + ::Components::EmitterDescription_var safe_elem = elem; + + elem->name (port_name); + elem->type_id (port_type_repo_id); + + // Valuetype 'set' call increments the reference count. + elem->consumer (consumer_ref.in ()); + + descriptions[slot] = safe_elem._retn (); + } +} + +#endif /* CIAO_SERVANT_IMPL_T_C */ diff --git a/CIAO/ciao/Servants/Servants.mpc b/CIAO/ciao/Servants/Servants.mpc new file mode 100644 index 00000000000..253fef4a4b8 --- /dev/null +++ b/CIAO/ciao/Servants/Servants.mpc @@ -0,0 +1,51 @@ +project(CIAO_Port_Activator_stub) : portableserver, taoidldefaults, ciao_lib { + dynamicflags = CIAO_PORT_ACTIVATOR_BUILD_DLL + idlflags += -Wb,stub_export_include=CIAO_Port_Activator_export.h + idlflags += -Wb,stub_export_macro=CIAO_Port_Activator_Export + idlflags += -SS + IDL_Files { + CIAO_Port_Activator.idl + } + + Source_Files { + CIAO_Port_ActivatorC.cpp + } + + Header_Files { + } +} + +project(CIAO_Servant_Impl) : ciao_servant_activator, ciao_port_activator_stub, ciao_container_base, ccm_svnt { + dynamicflags = CIAO_SERVANT_IMPL_BUILD_DLL + IDL_Files { + } + + Source_Files { + Home_Servant_Impl_Base.cpp + Home_Servant_Impl_T.cpp + Servant_Impl_Base.cpp + Servant_Impl_T.cpp + StandardConfigurator_Impl.cpp + Port_Activator.cpp + Port_Activator_T.cpp + } + + Template_Files { + Servant_Impl_Utils_T.cpp + } + + Header_Files { + CIAO_Servant_Impl_export.h + Home_Servant_Impl_Base.h + Home_Servant_Impl_T.h + Servant_Impl_Base.h + Servant_Impl_T.h + StandardConfigurator_Impl.h + Port_Activator.h + Port_Activator_T.h + } + + Inline_Files { + Port_Activator.inl + } +} diff --git a/CIAO/ciao/StandardConfigurator_Impl.cpp b/CIAO/ciao/Servants/StandardConfigurator_Impl.cpp index 59b683fb82b..59b683fb82b 100644 --- a/CIAO/ciao/StandardConfigurator_Impl.cpp +++ b/CIAO/ciao/Servants/StandardConfigurator_Impl.cpp diff --git a/CIAO/ciao/Servants/StandardConfigurator_Impl.h b/CIAO/ciao/Servants/StandardConfigurator_Impl.h new file mode 100644 index 00000000000..4f49e216b88 --- /dev/null +++ b/CIAO/ciao/Servants/StandardConfigurator_Impl.h @@ -0,0 +1,73 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file StandardConfigurator_Impl.h + * + * $Id$ + * + * This file contains implementation for the servant of + * Components::StandardConfigurator interface. + * + * @author Jules White <jules@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_STANDARDCONFIGURATOR_IMPL_H +#define CIAO_STANDARDCONFIGURATOR_IMPL_H + +# include /**/ "ace/pre.h" + +#include "CIAO_Servant_Impl_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ccm/CCM_StandardConfiguratorS.h" + +namespace CIAO +{ + class Servant_Impl_Base; +} + +namespace CIAO +{ + /** + * @class StandardConfigurator_Impl + * + * @brief Servant implementation for Components::StandardConfigurator + * + * This class implements the Components::StandardConfigurator + * interface as defined by the CCM spcification. This class aids + * in setting the initial values of component attributes that are + * defined in the meta data. + */ + class CIAO_Servant_Impl_Export StandardConfigurator_Impl + : public virtual POA_Components::StandardConfigurator + { + public: + /// Constructor + StandardConfigurator_Impl (Servant_Impl_Base* toconfigure); + + /// Destructor + virtual ~StandardConfigurator_Impl (void); + + /// This method will call set_attributes on the component that is + /// being configured, i.e, the template method from + /// StandardConfigurator interface. + virtual void set_configuration (const Components::ConfigValues & descr); + + void configure (Components::CCMObject_ptr comp); + + private: + /// The component whose attributes are going to be configured via + /// set_attributes + Servant_Impl_Base* const component_; + }; + +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_STANDARDCONFIGURATOR_IMPL_H */ diff --git a/CIAO/ciao/Servants/Swapping/CIAO_SwapExec.idl b/CIAO/ciao/Servants/Swapping/CIAO_SwapExec.idl new file mode 100644 index 00000000000..b52f7db782a --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/CIAO_SwapExec.idl @@ -0,0 +1,12 @@ +// $Id$ + +#include "ccm/CCM_EnterpriseComponent.idl" + +module CIAO +{ + local interface Swap_Exec : ::Components::EnterpriseComponent + { + Components::EnterpriseComponent incarnate (); + Components::EnterpriseComponent etherealize (); + }; +}; diff --git a/CIAO/ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h b/CIAO/ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h new file mode 100644 index 00000000000..672c412e343 --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_Swapping_Servant +// ------------------------------ +#ifndef CIAO_SWAPPING_SERVANT_EXPORT_H +#define CIAO_SWAPPING_SERVANT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_SWAPPING_SERVANT_HAS_DLL) +# define CIAO_SWAPPING_SERVANT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CIAO_SWAPPING_SERVANT_HAS_DLL */ + +#if !defined (CIAO_SWAPPING_SERVANT_HAS_DLL) +# define CIAO_SWAPPING_SERVANT_HAS_DLL 1 +#endif /* ! CIAO_SWAPPING_SERVANT_HAS_DLL */ + +#if defined (CIAO_SWAPPING_SERVANT_HAS_DLL) && (CIAO_SWAPPING_SERVANT_HAS_DLL == 1) +# if defined (CIAO_SWAPPING_SERVANT_BUILD_DLL) +# define CIAO_Swapping_Servant_Export ACE_Proper_Export_Flag +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_SWAPPING_SERVANT_BUILD_DLL */ +# define CIAO_Swapping_Servant_Export ACE_Proper_Import_Flag +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_SWAPPING_SERVANT_BUILD_DLL */ +#else /* CIAO_SWAPPING_SERVANT_HAS_DLL == 1 */ +# define CIAO_Swapping_Servant_Export +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARATION(T) +# define CIAO_SWAPPING_SERVANT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_SWAPPING_SERVANT_HAS_DLL == 1 */ + +// Set CIAO_SWAPPING_SERVANT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_SWAPPING_SERVANT_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_SWAPPING_SERVANT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_SWAPPING_SERVANT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_SWAPPING_SERVANT_NTRACE */ + +#if (CIAO_SWAPPING_SERVANT_NTRACE == 1) +# define CIAO_SWAPPING_SERVANT_TRACE(X) +#else /* (CIAO_SWAPPING_SERVANT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_SWAPPING_SERVANT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_SWAPPING_SERVANT_NTRACE == 1) */ + +#endif /* CIAO_SWAPPING_SERVANT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp new file mode 100644 index 00000000000..5127e369f92 --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.cpp @@ -0,0 +1,28 @@ +#include "ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h" + +ACE_RCSID (ciao, + Dynamic_Component_Servant_Base, + "$Id$") + +namespace CIAO +{ + Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base (void) + : container_ (0) + { + // This constructor is here to keep MSVC happy and should + // not be used at all. This constructor should be removed + // in the future. Until then, we have the ACE_ASSERT + // below to detect a runtime call to this constructor. + ACE_ASSERT (0); + } + + Dynamic_Component_Servant_Base::Dynamic_Component_Servant_Base + (Session_Container * c) + : container_ (c) + { + } + + Dynamic_Component_Servant_Base::~Dynamic_Component_Servant_Base (void) + { + } +} diff --git a/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h new file mode 100644 index 00000000000..75f32819036 --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_Base.h @@ -0,0 +1,54 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Dynamic_Component_Servant_Base.h + * + * $Id$ + * + */ +//============================================================================= + +#ifndef CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H +#define CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H + +#include /**/ "ace/pre.h" + +#include "ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/PortableServer.h" + +namespace CIAO +{ + class Session_Container; + + class CIAO_Swapping_Servant_Export Dynamic_Component_Servant_Base + { + public: + /// @todo Not to be used, no idea why this should be public, have to check this + Dynamic_Component_Servant_Base (void); + + explicit Dynamic_Component_Servant_Base (Session_Container *c); + + virtual ~Dynamic_Component_Servant_Base (void); + + virtual PortableServer::Servant + create (PortableServer::ObjectId &oid) = 0; + + virtual void destroy (PortableServer::ObjectId &oid) = 0; + + virtual void update_destroy_count () = 0; + + protected: + Session_Container *container_; + }; + +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_DYNAMIC_COMPONENT_SERVANT_BASE__H */ diff --git a/CIAO/ciao/Dynamic_Component_Servant_T.cpp b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_T.cpp index a69d568264a..a69d568264a 100644 --- a/CIAO/ciao/Dynamic_Component_Servant_T.cpp +++ b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_T.cpp diff --git a/CIAO/ciao/Dynamic_Component_Servant_T.h b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_T.h index 244a51b1891..244a51b1891 100644 --- a/CIAO/ciao/Dynamic_Component_Servant_T.h +++ b/CIAO/ciao/Servants/Swapping/Dynamic_Component_Servant_T.h diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.cpp index d33d197ee7e..d33d197ee7e 100644 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp +++ b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.cpp diff --git a/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h new file mode 100644 index 00000000000..749eefe4ce7 --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_Base.h @@ -0,0 +1,63 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Swapping_Servant_Home_Impl_Base.h + * + * $Id$ + * + */ +//============================================================================= + +#ifndef CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H +#define CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H + +#include /**/ "ace/pre.h" + +#include "ciao/Servants/Swapping/CIAO_Swapping_Servant_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "CCM_HomeS.h" + +namespace CIAO +{ + class Swapping_Container; + + /** + * @class Swapping_Home_Servant_Impl_Base + * + */ + // @@ Jai, why are you inheriting from "home" here? What is the + // point? + // @@ JAI, probably my class naming convention was the problem. + // This is a home implementation and that is why inheriting from + // "home". + // + class CIAO_Swapping_Servant_Export Swapping_Home_Servant_Impl_Base + : public virtual POA_Components::CCMHome + { + public: + Swapping_Home_Servant_Impl_Base (Swapping_Container * c); + + virtual ~Swapping_Home_Servant_Impl_Base (void); + + // Operations for CCMHome interface. + virtual ::CORBA::IRObject_ptr get_component_def (void); + + virtual ::CORBA::IRObject_ptr get_home_def (void); + + protected: + Swapping_Container *container_; + + private: + /// Not to be used + Swapping_Home_Servant_Impl_Base (void); + }; +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H */ diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.cpp index fbc804ca1aa..fbc804ca1aa 100644 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_T.cpp +++ b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.cpp diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_T.h b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.h index e6c59a6f37d..e6c59a6f37d 100644 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_T.h +++ b/CIAO/ciao/Servants/Swapping/Swapping_Servant_Home_Impl_T.h diff --git a/CIAO/ciao/Servants/Swapping/Swapping_Servants.mpc b/CIAO/ciao/Servants/Swapping/Swapping_Servants.mpc new file mode 100644 index 00000000000..0815af50445 --- /dev/null +++ b/CIAO/ciao/Servants/Swapping/Swapping_Servants.mpc @@ -0,0 +1,6 @@ +// $Id$ + +project(CIAO_Swapping_Servants) : ciao_lib, ciao_container_base, utils, \ + ccm_componentserver_stub, ciao_servant_activator, ciao_session_container { + dynamicflags = CIAO_SWAPPING_SERVANT_BUILD_DLL +} diff --git a/CIAO/ciao/Server_init.cpp b/CIAO/ciao/Server_init.cpp index 393bcb6b664..3294c9ff9f8 100644 --- a/CIAO/ciao/Server_init.cpp +++ b/CIAO/ciao/Server_init.cpp @@ -2,49 +2,21 @@ #include "Server_init.h" +#include <ccm/CCM_ComponentC.h> +#include <ccm/CCM_StandardConfiguratorC.h> +#include "Valuetype_Factories/Cookies.h" #include "CIAO_common.h" -#include "CCM_ComponentC.h" -#include "CCM_StandardConfiguratorC.h" -#include "Cookies.h" +#include "Client_init.h" namespace CIAO { int Server_init (CORBA::ORB_ptr o) { + Client_init (o); CIAO_REGISTER_VALUE_FACTORY (o, CIAO::Cookie_Impl_init, Components::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; } @@ -69,9 +41,50 @@ namespace CIAO // -------------------------------------------------------------- // Implementation of NameUtility class // -------------------------------------------------------------- + bool NameUtility::bind_name (const char *namestr, + CORBA::Object_ptr obj, + CosNaming::NamingContextExt_var &root) + { + if (namestr == 0) + { + CIAO_ERROR ((LM_WARNING, CLINFO + "NameUtility::bind_name - " + "called with null name, aborting registration. \n")); + return false; + } + + CosNaming::Name name; + NameUtility::create_name (namestr, name); - void NameUtility::CreateContextPath (const CosNaming::NamingContextExt_ptr nc, - const CosNaming::Name& name) + if (name.length () > 1) + { + // This name has contexts, create them. + name.length (name.length () - 1); + Utility::NameUtility::create_context_path (root.in (), name); + name.length (name.length () + 1); + } + + return NameUtility::bind_object_path (root.in (), name, obj); + } + + void + NameUtility::create_name (const char *namestr, CosNaming::Name &name) + { + ACE_Auto_Basic_Array_Ptr<char> namebfr (ACE::strnew (namestr)); + ACE_Tokenizer tok (namebfr.get ()); + + tok.delimiter ('/'); + + for (char *p = tok.next (); p; p=tok.next ()) + { + CORBA::ULong pos = name.length (); + name.length (pos + 1); + name[pos].id = CORBA::string_dup (p); + } + } + + void NameUtility::create_context_path (const CosNaming::NamingContextExt_ptr nc, + const CosNaming::Name& name) { bool isNotFound = false; CORBA::ULong lengthMissing = 0; @@ -82,22 +95,26 @@ namespace CIAO try { tmpCtxVar = nc->bind_new_context (name); - ACE_DEBUG ((LM_DEBUG, "Bound Context.\n\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::CreateContextPath - Bound Context.\n\n")); } catch (const CosNaming::NamingContext::AlreadyBound&) { - ACE_DEBUG ((LM_DEBUG, "Context Already Bound.\n\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::CreateContextPath - Context Already Bound.\n\n")); } catch (const CosNaming::NamingContext::NotFound& nf) { - ACE_DEBUG ((LM_DEBUG, "Context not found.\n\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::CreateContextPath - Context not found.\n\n")); isNotFound = true; lengthMissing = nf.rest_of_name.length (); } if (lengthMissing == name.length ()) { - ACE_ERROR ((LM_ERROR, "Null name length.\n\n")); + CIAO_ERROR ((LM_ERROR, CLINFO + "NameUtility::CreateContextPath - Null name length.\n\n")); } if (isNotFound) @@ -107,31 +124,33 @@ namespace CIAO ++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", + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::CreateContextPath - What's left of the name:%C\n", newSCName.in ())); } tmpCtxVar = nc->bind_new_context (tmpName); - ACE_DEBUG ((LM_DEBUG, "Bound New Context.\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::CreateContextPath - Bound New Context.\n")); } } } //--------------------------------------------------------------------------------------------- - void NameUtility::BindObjectPath (const CosNaming::NamingContextExt_ptr nc, - const CosNaming::Name& name, - const CORBA::Object_ptr obj) + bool NameUtility::bind_object_path (const CosNaming::NamingContextExt_ptr nc, + const CosNaming::Name& name, + const CORBA::Object_ptr obj) { CosNaming::Name tmpName; CORBA::String_var newSCName = nc->to_string (name); - ACE_DEBUG ((LM_DEBUG, "The name is: %s\n", newSCName.in ())); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::BindObjectPath - The name is: %C\n", newSCName.in ())); try { @@ -140,16 +159,24 @@ namespace CIAO catch (const CosNaming::NamingContext::NotFound&) { - ACE_DEBUG ((LM_DEBUG, "Name not found, doing new bind.\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO + "NameUtility::BindObjectPath - Name not found, doing new bind.\n")); nc->bind (name, obj); } + catch (...) + { + CIAO_ERROR ((LM_ERROR, CLINFO + "NameUtility::BindObjectPath - Caught exception while binding name in nameing service.\n")); + return false; + } + return true; } //--------------------------------------------------------------------------------------------- CosNaming::BindingList * - NameUtility::listBindings (const CosNaming::NamingContext_ptr nc, - const CosNaming::Name& name, - CORBA::ULong max_list_size) + NameUtility::list_bindings (const CosNaming::NamingContext_ptr nc, + const CosNaming::Name& name, + CORBA::ULong max_list_size) { CosNaming::BindingList_var basicListV; CosNaming::BindingIterator_var bIterV; @@ -166,10 +193,11 @@ namespace CIAO objV = nc->resolve (name); tmpContextV = CosNaming::NamingContext::_narrow (objV.in ()); } - + if (CORBA::is_nil (tmpContextV.in ())) { - ACE_ERROR ((LM_ERROR, "listBindings: Nil context.\n")); + CIAO_ERROR ((LM_ERROR, CLINFO + "NameUtility::listBindings: Nil context.\n")); return 0; } @@ -189,7 +217,7 @@ namespace CIAO // 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]; @@ -198,7 +226,7 @@ namespace CIAO // Re-calculate 'max_remaining' max_remaining = max_list_size - basicListV->length(); } - + bIterV->destroy (); } @@ -207,7 +235,7 @@ namespace CIAO //--------------------------------------------------------------------------------------------- void - NameUtility::recursiveUnbind (const CosNaming::NamingContext_ptr nc, + NameUtility::recursive_unbind (const CosNaming::NamingContext_ptr nc, const CosNaming::Name& name) { CORBA::Object_var objV; @@ -215,11 +243,11 @@ namespace CIAO objV = nc->resolve(name); tmpContextV = CosNaming::NamingContext::_narrow (objV.in ()); - + if (CORBA::is_nil (tmpContextV.in ())) { - ACE_ERROR ((LM_ERROR, - "recursiveUnbind: Nil context reference.\n")); + CIAO_ERROR ((LM_ERROR, CLINFO + "NameUtility::recursiveUnbind - Nil context reference.\n")); return; } @@ -227,9 +255,9 @@ namespace CIAO CosNaming::Name tmpName; tmpName.length (0); - blV = NameUtility::listBindings(tmpContextV.in (), - tmpName, - 10000); // 'max_list_size' + blV = NameUtility::list_bindings (tmpContextV.in (), + tmpName, + 10000); // 'max_list_size' for (CORBA::ULong i = 0; i < blV->length (); ++i) { @@ -241,10 +269,10 @@ namespace CIAO } else if ((*blV)[i].binding_type==CosNaming::ncontext) { - NameUtility::recursiveUnbind(tmpContextV.in (), tmpName); + NameUtility::recursive_unbind (tmpContextV.in (), tmpName); } } - + nc->unbind (name); tmpContextV->destroy (); } diff --git a/CIAO/ciao/Server_init.h b/CIAO/ciao/Server_init.h index b801d195c5f..db9b126f37d 100644 --- a/CIAO/ciao/Server_init.h +++ b/CIAO/ciao/Server_init.h @@ -8,6 +8,7 @@ * * @author Nanbor Wang <nanbor@cs.wustl.edu> * @author Gan Deng <dengg@dre.vanderbilt.edu> + * @author William R. Otte <wotte@dre.vanderbilt.edu> */ #ifndef CIAO_SERVER_INIT_H @@ -21,7 +22,9 @@ #pragma once #endif /* ! ACE_LACKS_PRAGMA_ONCE */ -#include <orbsvcs/CosNamingC.h> +#include "ace/SString.h" +#include "orbsvcs/CosNamingC.h" +#include "ccm/CCM_StandardConfiguratorC.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace CORBA @@ -49,41 +52,48 @@ 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 <dipa.suri@lmco.com>. - * - * The concept/code are derived from - * http://www.informit.com/articles/article.asp?p=23266&seqNum=6 - */ - + * A utility class to bind naming context. This class is contributed by + * Dipa Suri <dipa.suri@lmco.com>. + * + * The concept/code are derived from + * http://www.informit.com/articles/article.asp?p=23266&seqNum=6 + */ + public: + static bool bind_name (const char *namestr, + CORBA::Object_ptr obj, + CosNaming::NamingContextExt_var &root); + + static void create_name (const char *namestr, CosNaming::Name &); + /// For each 'NameComponent' in 'name', create a corresponding 'NamingContext'. - static void CreateContextPath (const CosNaming::NamingContextExt_ptr, - const CosNaming::Name &); + static void create_context_path (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_ptr); + static bool bind_object_path (const CosNaming::NamingContextExt_ptr, + const CosNaming::Name&, + const CORBA::Object_ptr); /// 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); + static CosNaming::BindingList * list_bindings (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&); + static void recursive_unbind (const CosNaming::NamingContext_ptr, + const CosNaming::Name&); + }; } } diff --git a/CIAO/ciao/Session_Container.cpp b/CIAO/ciao/Session_Container.cpp deleted file mode 100644 index 76779a21100..00000000000 --- a/CIAO/ciao/Session_Container.cpp +++ /dev/null @@ -1,534 +0,0 @@ -// $Id$ - -#include "Session_Container.h" -#include "Servant_Activator.h" - -#include "DAnCE/Deployment/Deployment_CoreC.h" -#include "CIAO_common.h" - -#include "tao/Utils/PolicyList_Destroyer.h" - -#if !defined (__ACE_INLINE__) -# include "Session_Container.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - /////////////////////////////////////////////////////////////// - - ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> - 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) - { - } - - Session_Container::~Session_Container (void) - { - if (! CORBA::is_nil (this->component_poa_.in ())) - { - this->component_poa_->destroy (1, 1); - } - - if (! CORBA::is_nil (this->facet_cons_poa_.in ())) - { - this->facet_cons_poa_->destroy (1, 1); - } - - if (! CORBA::is_nil (this->home_servant_poa_.in ())) - { - this->home_servant_poa_->destroy (1, 1); - } - - delete this->sa_; - } - - int - Session_Container::init (const char *name, - const CORBA::PolicyList *more_policies) - { - CIAO_TRACE ("Session_Container::init"); - - char buffer[MAXPATHLEN]; - - if (name == 0) - { - this->number_ = ++Session_Container::serial_number_; - ACE_OS::sprintf (buffer, - "CIAO::Session_Container-%ld", - this->number_); - name = buffer; - } - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references ("RootPOA"); - - if (CORBA::is_nil (poa_object.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - } - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in ()); - - this->create_component_POA (name, - more_policies, - root_poa.in ()); - - ACE_CString port_poa_name (name); - port_poa_name += ":Port_POA"; - this->create_facet_consumer_POA (port_poa_name.c_str (), - more_policies, - root_poa.in ()); - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (); - - poa_manager->activate (); - - return 0; - } - - void - Session_Container::create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root) - { - 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 - // instead of simply assigning more_policies to the init policy - // list. - CORBA::PolicyList policies (0); - - if (p != 0) - { - policies = *p; - } - - PortableServer::POAManager_var poa_manager = - root->the_POAManager (); - - this->component_poa_ = - root->create_POA (name, - poa_manager.in (), - policies); - } - - void - Session_Container::create_facet_consumer_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root) - { - CIAO_TRACE ("Session_Container::create_facet_consumer_POA"); - - PortableServer::POAManager_var poa_manager = root->the_POAManager (); - CORBA::ULong p_length = 0; - - if (p != 0) - { - p_length = p->length (); - } - - TAO::Utils::PolicyList_Destroyer policies (p_length + 3); - policies.length (p_length + 3); - - policies[0] = - root->create_id_assignment_policy (PortableServer::USER_ID); - - // Servant Manager Policy - policies[1] = - root->create_request_processing_policy ( - PortableServer::USE_SERVANT_MANAGER); - - // Servant Retention Policy - policies[2] = - root->create_servant_retention_policy (PortableServer::RETAIN); - - for (CORBA::ULong i = 0; i < p_length; ++i) - { - policies[i+3] = (*p)[i]; - } - - this->facet_cons_poa_ = - root->create_POA (name, - poa_manager.in (), - policies); - - ACE_NEW_THROW_EX (this->sa_, - Servant_Activator (this->orb_.in ()), - CORBA::NO_MEMORY ()); - - this->facet_cons_poa_->set_servant_manager (this->sa_); - } - - CORBA::Object_ptr - Session_Container::install_servant (PortableServer::Servant p, - Container::OA_Type t) - { - CIAO_TRACE ("Session_Container::install_servant"); - - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - { - tmp = this->component_poa_.in (); - } - else - { - tmp = this->facet_cons_poa_.in (); - } - - PortableServer::ObjectId_var oid = tmp->activate_object (p); - - CORBA::Object_var objref = tmp->id_to_reference (oid.in ()); - - return objref._retn (); - } - - CORBA::Object_ptr - Session_Container::install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid) - { - CIAO_TRACE ("Session_Container::install_component"); - PortableServer::ObjectId_var id = - this->component_poa_->activate_object (p); - - CORBA::Object_var objref = - this->component_poa_->id_to_reference (id.in ()); - - oid = id._retn (); - - return objref._retn (); - } - - - //@@ Apparently we need to be cautious when handling the exception - // thrown here. We should make sure that new DnC interfaces - // NodeApplication/NodeApplicationManager etc will cache the new - // exceptions--> rethrow of new exceptions is needed. - // --Tao - Components::CCMHome_ptr - Session_Container::ciao_install_home (const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name) - { - CIAO_TRACE ("Session_Container::ciao_install_home"); - - HomeFactory hcreator = 0; - ServantFactory screator = 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; - - if (exe_dll_name == 0) - { - exception = "Null component executor DLL name"; - } - - if (sv_dll_name == 0) - { - exception = "Null component servant DLL name"; - } - - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Session_Container.cpp -" - "Session_Container::ciao_install_home -" - "ERROR: %s\n", - exception.c_str ())); - - throw Deployment::UnknownImplId ( - "Session_Container::ciao_install_home", - exception.c_str ()); - } - - if (executor_dll.open (exe_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0) - { - ACE_CString error ("Failed to open executor DLL: "); - error += exe_dll_name; - - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Session_Container.cpp -" - "Session_Container::ciao_install_home -" - "ERROR in opening the executor DLL [%s] \n", - exe_dll_name)); - - throw Deployment::UnknownImplId ( - "Session_Container::ciao_install_home", - error.c_str ()); - } - - if (servant_dll.open (sv_dll_name, - ACE_DEFAULT_SHLIB_MODE, - 0) != 0) - { - ACE_CString error ("Failed to open executor DLL: "); - error += sv_dll_name; - - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Session_Container.cpp -" - "Session_Container::ciao_install_home -" - "ERROR in opening the servant DLL [%s] \n", - sv_dll_name)); - - throw Deployment::UnknownImplId ( - "Session_Container::ciao_install_home", - error.c_str ()); - } - - if (exe_entrypt == 0 || sv_entrypt == 0) - { - ACE_CString error ("Entry point is null for "); - - if (exe_entrypt == 0) - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Session_Container.cpp -" - "Session_Container::ciao_install_home -" - "ERROR in opening the executor entry point " - "for executor DLL [%s] \n", - exe_dll_name)); - error += exe_dll_name; - } - else - { - ACE_ERROR ((LM_ERROR, - "CIAO (%P|%t) Session_Container.cpp -" - "Session_Container::ciao_install_home -" - "ERROR in opening the servant entry point " - "for servant DLL [%s] \n", - sv_dll_name)); - error += sv_dll_name; - } - - throw Deployment::ImplEntryPointNotFound ( - "Session_Container::ciao_install_home", - error.c_str ()); - } - - // We have to do this casting in two steps because the C++ - // standard forbids casting a pointer-to-object (including - // void*) directly to a pointer-to-function. - void *void_ptr = executor_dll.symbol (exe_entrypt); - ptrdiff_t tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); - hcreator = reinterpret_cast<HomeFactory> (tmp_ptr); - - void_ptr = servant_dll.symbol (sv_entrypt); - tmp_ptr = reinterpret_cast<ptrdiff_t> (void_ptr); - screator = reinterpret_cast<ServantFactory> (tmp_ptr); - } - else - { - if (static_entrypts_maps_ == 0 - || static_entrypts_maps_->home_creator_funcptr_map_ == 0 - || static_entrypts_maps_->home_servant_creator_funcptr_map_ == 0) - { - throw Deployment::ImplEntryPointNotFound (); - } - - ACE_CString exe_entrypt_str (exe_entrypt); - static_entrypts_maps_->home_creator_funcptr_map_->find (exe_entrypt_str, - hcreator); - - ACE_CString sv_entrypt_str (sv_entrypt); - static_entrypts_maps_->home_servant_creator_funcptr_map_->find ( - sv_entrypt_str, - screator - ); - } - - if (hcreator == 0 || screator == 0) - { - ACE_CString error ("Entry point "); - - if (hcreator == 0) - { - error += exe_entrypt; - error += " invalid in dll "; - error += exe_dll_name; - } - else - { - error += sv_entrypt; - error += " invalid in dll "; - error += sv_dll_name; - } - - throw Deployment::ImplEntryPointNotFound ( - "SessionContainer::ciao_install_home", - error.c_str ()); - } - - Components::HomeExecutorBase_var home_executor = hcreator (); - - if (CORBA::is_nil (home_executor.in ())) - { - throw Deployment::InstallationFailure ( - "SessionContainer::ciao_install_home", - "Executor entrypoint failed to create a home."); - } - - PortableServer::Servant home_servant = screator (home_executor.in (), - this, - ins_name); - - if (home_servant == 0) - { - throw Deployment::InstallationFailure ( - "SessionContainer::ciao_install_home", - "Servant entrypoing failed to create a home."); - } - - PortableServer::ServantBase_var safe (home_servant); - - CORBA::Object_var objref = - this->install_servant (home_servant, Container::Component); - - Components::CCMHome_var homeref = - Components::CCMHome::_narrow (objref.in ()); - - return homeref._retn (); - } - - void - Session_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref) - { - CIAO_TRACE ("Session_Container::ciao_uninstall_home"); - - this->uninstall (homeref, Container::Component); - } - - void - Session_Container::uninstall (CORBA::Object_ptr objref, - Container::OA_Type t) - { - CIAO_TRACE ("Session_Container::uninstall"); - - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - { - tmp = this->component_poa_.in (); - } - else - { - tmp = this->facet_cons_poa_.in (); - } - - PortableServer::ObjectId_var oid = - tmp->reference_to_id (objref); - - tmp->deactivate_object (oid.in ()); - } - - void - Session_Container::uninstall (PortableServer::Servant svt, - Container::OA_Type t) - { - CIAO_TRACE ("Session_Container::uninstall"); - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - { - tmp = this->component_poa_.in (); - } - else - { - tmp = this->facet_cons_poa_.in (); - } - - PortableServer::ObjectId_var oid = tmp->servant_to_id (svt); - - tmp->deactivate_object (oid.in ()); - } - - void - Session_Container::uninstall_component (Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid) - { - CIAO_TRACE ("Session_Container::uninstall_component"); - - PortableServer::ObjectId_var id = - this->component_poa_->reference_to_id (objref); - - this->component_poa_->deactivate_object (id.in ()); - - oid = id._retn (); - } - - void - Session_Container::add_servant_to_map (PortableServer::ObjectId &, - Dynamic_Component_Servant_Base*) - { - CIAO_TRACE ("Session_Container::add_servant_to_map"); - } - - void - Session_Container::deactivate_facet (const PortableServer::ObjectId &) - { - CIAO_TRACE ("Session_Container::deactivate_facet"); - } - - void - Session_Container::delete_servant_from_map (PortableServer::ObjectId &) - { - CIAO_TRACE ("Session_Container::delete_servant_from_map"); - } - - CORBA::Object_ptr - Session_Container::get_home_objref (PortableServer::Servant) - { - CIAO_TRACE ("Session_Container::get_home_objref"); - throw CORBA::NO_IMPLEMENT (); - } - - CORBA::Object_ptr - Session_Container::generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t) - { - CIAO_TRACE ("Session_Container::generate_reference"); - - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - { - tmp = this->component_poa_.in (); - } - else - { - tmp = this->facet_cons_poa_.in (); - } - - PortableServer::ObjectId_var oid = - PortableServer::string_to_ObjectId (obj_id); - - CORBA::String_var str = PortableServer::ObjectId_to_string (oid.in ()); - - CORBA::Object_var objref = - tmp->create_reference_with_id (oid.in (), repo_id); - - return objref._retn (); - } -} diff --git a/CIAO/ciao/Session_Container.h b/CIAO/ciao/Session_Container.h deleted file mode 100644 index d96ef7b22bc..00000000000 --- a/CIAO/ciao/Session_Container.h +++ /dev/null @@ -1,189 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Session_Container.h - * - * $Id$ - * - * Header file for CIAO's container implementations - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_SESSION_CONTAINER_H -#define CIAO_SESSION_CONTAINER_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/Container_Base.h" - -#include "tao/PortableServer/Servant_Base.h" - -namespace CIAO -{ - class Session_Container; - class Servant_Activator; - - typedef ::Components::HomeExecutorBase_ptr (*HomeFactory) (void); - typedef ::PortableServer::Servant (*ServantFactory) ( - ::Components::HomeExecutorBase_ptr p, - ::CIAO::Session_Container *c, - const char *ins_name); - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - HomeFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMECREATOR_FUNCPTR_MAP; - - typedef ACE_Hash_Map_Manager_Ex<ACE_CString, - ServantFactory, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - HOMESERVANTCREATOR_FUNCPTR_MAP; - - struct Static_Config_EntryPoints_Maps - { - /// Map of home creator entry point name and func ptr - HOMECREATOR_FUNCPTR_MAP* home_creator_funcptr_map_; - - /// Map of home servant creator entry point name and func ptr - HOMESERVANTCREATOR_FUNCPTR_MAP* home_servant_creator_funcptr_map_; - }; - - class CIAO_SERVER_Export Session_Container : public Container - { - public: - Session_Container (CORBA::ORB_ptr o, - Container_Impl *container_impl, - bool static_config_flag = false, - const Static_Config_EntryPoints_Maps* static_entrypts_maps =0); - - virtual ~Session_Container (void); - - /// Initialize the container with a name. - virtual int init (const char *name = 0, - const CORBA::PolicyList *more_policies = 0); - - /** - * @brief Simply installing a home executor into the component. - * - * This operation install a home executor into the component. It - * requires the name of the DLLs to executor and the servant glue - * code, and the entry points to the respective DLLs. Currently, - * we don't try to manage the lifetime of DLL objects, but we - * should at some later point. - * - * @retval Home objref of the installed home. - */ - virtual Components::CCMHome_ptr ciao_install_home ( - const char *exe_dll_name, - const char *exe_entrypt, - const char *sv_dll_name, - const char *sv_entrypt, - const char *ins_name); - - /// Uninstall a servant for component or home. - virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref); - - /// Uninstall a servant for component. - virtual void uninstall_component (::Components::CCMObject_ptr objref, - PortableServer::ObjectId_out oid); - - /// Install a servant for component or home. - virtual CORBA::Object_ptr install_servant (PortableServer::Servant p, - Container::OA_Type t); - - /// Install a component servant. - CORBA::Object_ptr install_component (PortableServer::Servant p, - PortableServer::ObjectId_out oid); - - /// Get an object reference to a component or home from the servant. - virtual CORBA::Object_ptr get_objref (PortableServer::Servant p); - - /// Uninstall a servant for component or home. - void uninstall (CORBA::Object_ptr objref, Container::OA_Type t); - - /// Uninstall a servant for component or home. - void uninstall (PortableServer::Servant svt, Container::OA_Type t); - - virtual void add_servant_to_map (PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant); - - virtual void delete_servant_from_map (PortableServer::ObjectId &oid); - - // @@Jai, could yo please add documentation? - /* - * @@Jai, you may want to consider moving these away from the - * container interface. I know what you are going to say - * :-). Consider using dynamic_cast <> to access - * add_servant_to_map, delete_servant_from_map and - * deactivate_facet from the Swapping_Conatiner's interface. It - * would make the base container interface much cleaner. - */ - virtual void deactivate_facet (const PortableServer::ObjectId &oid); - - virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p); - - /// Analog of the POA method that creates an object reference from - /// an object id string. - CORBA::Object_ptr generate_reference (const char *obj_id, - const char *repo_id, - Container::OA_Type t); - - /// Return the servant activator factory that activates the - /// servants for facets and consumers. - Servant_Activator *ports_servant_activator (void) const; - - private: - /// Create POA for the component. - /** - * This is the POA that is returned to the component applications - * if they need one. - */ - void create_component_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root); - - /// Create POA for the facets and consumers alone. - void create_facet_consumer_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root); - - /// Not allowed to be - Session_Container (void); - - protected: - unsigned long number_; - - /// Static variable to store the highest number we have given out until - /// now - static ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> serial_number_; - - const bool static_config_flag_; - const Static_Config_EntryPoints_Maps* static_entrypts_maps_; - - /// The servant activator factory used to activate facets and - /// consumer servants. - Servant_Activator *sa_; - }; -} - -#if defined (__ACE_INLINE__) -# include "Session_Container.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_SESSION_CONTAINER_H */ diff --git a/CIAO/ciao/Session_Container.inl b/CIAO/ciao/Session_Container.inl deleted file mode 100644 index 1c6bc7a075c..00000000000 --- a/CIAO/ciao/Session_Container.inl +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -*- C++ -*- - -ACE_INLINE CORBA::Object_ptr -CIAO::Session_Container::get_objref (PortableServer::Servant p) -{ - return this->the_POA ()->servant_to_reference (p); -} - -ACE_INLINE CIAO::Servant_Activator * -CIAO::Session_Container::ports_servant_activator (void) const -{ - return this->sa_; -} diff --git a/CIAO/ciao/StandardConfigurator_Impl.h b/CIAO/ciao/StandardConfigurator_Impl.h deleted file mode 100644 index c651ba4e783..00000000000 --- a/CIAO/ciao/StandardConfigurator_Impl.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file StandardConfigurator_Impl.h - * - * $Id$ - * - * This file contains implementation for the servant of - * Components::StandardConfigurator interface. - * - * @author Jules White <jules@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_STANDARDCONFIGURATOR_IMPL_H -#define CIAO_STANDARDCONFIGURATOR_IMPL_H - -# include /**/ "ace/pre.h" - -#include "CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_StandardConfiguratorS.h" - -namespace CIAO -{ - class Servant_Impl_Base; -} - -namespace CIAO -{ - /** - * @class StandardConfigurator_Impl - * - * @brief Servant implementation for Components::StandardConfigurator - * - * This class implements the Components::StandardConfigurator - * interface as defined by the CCM spcification. This class aids - * in setting the initial values of component attributes that are - * defined in the meta data. - */ - class CIAO_SERVER_Export StandardConfigurator_Impl - : public virtual POA_Components::StandardConfigurator - { - public: - /// Constructor - StandardConfigurator_Impl (Servant_Impl_Base* toconfigure); - - /// Destructor - virtual ~StandardConfigurator_Impl (void); - - /// This method will call set_attributes on the component that is - /// being configured, i.e, the template method from - /// StandardConfigurator interface. - virtual void set_configuration (const Components::ConfigValues & descr); - - void configure (Components::CCMObject_ptr comp); - - private: - /// The component whose attributes are going to be configured via - /// set_attributes - Servant_Impl_Base* component_; - }; - -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_STANDARDCONFIGURATOR_IMPL_H */ diff --git a/CIAO/ciao/Swapping_Container.cpp b/CIAO/ciao/Swapping_Container.cpp deleted file mode 100644 index 68973599306..00000000000 --- a/CIAO/ciao/Swapping_Container.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// $Id$ - -#include "Swapping_Container.h" -#include "ciao/Servant_Activator.h" -#include "ciao/Dynamic_Component_Activator.h" - -#include "tao/Utils/PolicyList_Destroyer.h" - -#if !defined (__ACE_INLINE__) -# include "Swapping_Container.inl" -#endif /* __ACE_INLINE__ */ - -namespace CIAO -{ - - ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> - Swapping_Container::serial_number_ (0); - - Swapping_Container::Swapping_Container (CORBA::ORB_ptr o, - Container_Impl *container_impl) - : Session_Container (o, container_impl), - number_ (0) - { - } - - Swapping_Container::~Swapping_Container () - { - } - - PortableServer::POA_ptr - Swapping_Container::the_home_servant_POA (void) const - { - return this->home_servant_poa_.in (); - } - - CORBA::Object_ptr - Swapping_Container::get_home_objref (PortableServer::Servant p) - { - return this->the_home_servant_POA ()->servant_to_reference (p); - } - - void - Swapping_Container::deactivate_facet (const PortableServer::ObjectId &oid) - { - this->the_facet_cons_POA ()->deactivate_object (oid); - } - - int - Swapping_Container::init (const char *name, - const CORBA::PolicyList *more_policies) - { - char buffer[MAXPATHLEN]; - - if (name == 0) - { - this->number_ = ++Swapping_Container::serial_number_; - ACE_OS::sprintf (buffer, - "CIAO::Swapping_Container-%ld", - this->number_); - name = buffer; - } - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA"); - - if (CORBA::is_nil (poa_object.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - } - - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in ()); - - this->create_servant_POA (name, more_policies, root_poa.in ()); - - this->create_home_servant_POA ("home servant POA", - more_policies, - root_poa.in ()); - - this->create_connections_POA (root_poa.in ()); - - PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); - - poa_manager->activate (); - - return 0; - } - - void - Swapping_Container::add_servant_to_map ( - PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant) - { - this->dsa_->add_servant_to_map (oid, servant); - } - - void - Swapping_Container::delete_servant_from_map ( - PortableServer::ObjectId &oid) - { - this->dsa_->delete_servant_from_map (oid); - } - - void - Swapping_Container::create_home_servant_POA ( - const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root) - { - CORBA::PolicyList policies (0); - - if (p != 0) - { - policies = *p; - } - - PortableServer::POAManager_var poa_manager = root->the_POAManager (); - - this->home_servant_poa_ = - root->create_POA (name, poa_manager.in (), policies); - } - - void - Swapping_Container::create_connections_POA (PortableServer::POA_ptr root) - { - PortableServer::POAManager_var poa_manager = - root->the_POAManager (); - - TAO::Utils::PolicyList_Destroyer policies (3); - policies.length (3); - - policies[0] = - root->create_id_assignment_policy (PortableServer::USER_ID); - - policies[1] = - root->create_request_processing_policy ( - PortableServer::USE_SERVANT_MANAGER); - - - // Servant Retention Policy. - policies[2] = - root->create_servant_retention_policy (PortableServer::RETAIN); - - this->facet_cons_poa_ = - root->create_POA ("facet_consumer_poa", poa_manager.in (), policies); - - ACE_NEW_THROW_EX (this->sa_, - Servant_Activator (this->orb_.in ()), - CORBA::NO_MEMORY ()); - - this->facet_cons_poa_->set_servant_manager (this->sa_); - } - - void - Swapping_Container::create_servant_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root) - { - // @@ Jai, see how this method more or less does things (like - // setting policies) like create_connections_POA (). Could you - // please refactor them into a seperate method? - CORBA::PolicyList policies (0); - - if (p != 0) - { - policies = *p; - } - - PortableServer::POAManager_var poa_manager = - root->the_POAManager (); - - CORBA::ULong policy_length = policies.length (); - policies.length (policy_length + 1); - policies[policy_length] = - root->create_id_assignment_policy (PortableServer::USER_ID); - - policy_length = policies.length (); - policies.length (policy_length + 1); - policies[policy_length] = - root->create_request_processing_policy ( - PortableServer::USE_SERVANT_MANAGER); - - policy_length = policies.length (); - policies.length (policy_length + 1); - policies[policy_length] = - root->create_servant_retention_policy (PortableServer::RETAIN); - - this->component_poa_ = root->create_POA (name, poa_manager.in (), policies); - - ACE_NEW_THROW_EX (this->dsa_, - Dynamic_Component_Activator (this->orb_.in ()), - CORBA::NO_MEMORY ()); - - this->component_poa_->set_servant_manager (this->dsa_); - } - - void - Swapping_Container::ciao_uninstall_home (Components::CCMHome_ptr homeref) - { - PortableServer::POA_ptr tmp = this->home_servant_poa_.in (); - PortableServer::ObjectId_var oid = - tmp->reference_to_id (homeref); - - tmp->deactivate_object (oid.in ()); - } - - CORBA::Object_ptr - Swapping_Container::install_servant (PortableServer::Servant p, - Container::OA_Type t) - { - PortableServer::POA_ptr tmp = 0; - - if (t == Container::Component) - { - tmp = this->home_servant_poa_.in (); - } - else - { - tmp = this->facet_cons_poa_.in (); - } - - PortableServer::ObjectId_var oid = tmp->activate_object (p); - - CORBA::Object_var objref = tmp->id_to_reference (oid.in ()); - - return objref._retn (); - } -} diff --git a/CIAO/ciao/Swapping_Container.h b/CIAO/ciao/Swapping_Container.h deleted file mode 100644 index 784de1a6e3c..00000000000 --- a/CIAO/ciao/Swapping_Container.h +++ /dev/null @@ -1,111 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Swapping_Container.h - * - * $Id$ - * - * Header file for CIAO's Dynamic Swapping container implementations - * - * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> - * Balachandran Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_SWAPPING_CONTAINER_H -#define CIAO_SWAPPING_CONTAINER_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/Session_Container.h" - -namespace CIAO -{ - class Dynamic_Component_Servant_Base; - class Dynamic_Component_Activator; - - class CIAO_SERVER_Export Swapping_Container : public Session_Container - { - public: - Swapping_Container (CORBA::ORB_ptr o, Container_Impl *container_impl); - - virtual ~Swapping_Container (void); - - /// Initialize the container with a name. - virtual int init (const char *name = 0, - const CORBA::PolicyList *more_policies = 0); - - virtual CORBA::Object_ptr install_servant (PortableServer::Servant p, - Container::OA_Type t); - - virtual CORBA::Object_ptr get_objref (PortableServer::Servant p); - - virtual void ciao_uninstall_home (Components::CCMHome_ptr homeref); - - virtual CORBA::Object_ptr get_home_objref (PortableServer::Servant p); - - virtual void add_servant_to_map (PortableServer::ObjectId &oid, - Dynamic_Component_Servant_Base* servant); - - virtual void delete_servant_from_map (PortableServer::ObjectId &oid); - - virtual void deactivate_facet (const PortableServer::ObjectId &oid); - - PortableServer::POA_ptr the_home_servant_POA (void) const; - - private: - /// Create POA for the component. - void create_servant_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root); - - void create_home_servant_POA (const char *name, - const CORBA::PolicyList *p, - PortableServer::POA_ptr root); - - void create_connections_POA (PortableServer::POA_ptr root); - - protected: - unsigned long number_; - - /// Static variable to store the highest number we have given out until - /// now - static ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> serial_number_; - - Dynamic_Component_Activator *dsa_; - }; -} - -// Macro for registration of an OBV factory in the generated -// servant class. Similar to the macro for TAO in -// tao/ValueType/ValueFactory.h but here we take advantage of -// the fact that we have access to the current ORB indirectly -// through the context and container. -// @@Jai, is this macro required here? -#define CIAO_REGISTER_OBV_FACTORY(FACTORY, VALUETYPE) \ - { \ - CORBA::ValueFactory factory = new FACTORY; \ - CORBA::ORB_ptr orb = \ - this->context_->_ciao_the_Container ()->the_ORB (); \ - CORBA::ValueFactory prev_factory = \ - orb->register_value_factory ( \ - VALUETYPE::_tao_obv_static_repository_id (), \ - factory); \ - CORBA::remove_ref (prev_factory); \ - CORBA::add_ref (factory); \ - } - -#if defined (__ACE_INLINE__) -# include "Swapping_Container.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_SWAPPING_CONTAINER_H */ diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h b/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h deleted file mode 100644 index 0064c39a744..00000000000 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Swapping_Servant_Home_Impl_Base.h - * - * $Id$ - * - */ -//============================================================================= - -#ifndef CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H -#define CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_Server_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CCM_HomeS.h" - -namespace CIAO -{ - class Swapping_Container; - - /** - * @class Swapping_Home_Servant_Impl_Base - * - */ - // @@ Jai, why are you inheriting from "home" here? What is the - // point? - // @@ JAI, probably my class naming convention was the problem. - // This is a home implementation and that is why inheriting from - // "home". - // - class CIAO_SERVER_Export Swapping_Home_Servant_Impl_Base - : public virtual POA_Components::CCMHome - { - public: - Swapping_Home_Servant_Impl_Base (Swapping_Container * c); - - virtual ~Swapping_Home_Servant_Impl_Base (void); - - // Operations for CCMHome interface. - virtual ::CORBA::IRObject_ptr get_component_def (void); - - virtual ::CORBA::IRObject_ptr get_home_def (void); - - protected: - Swapping_Container *container_; - - private: - /// Not to be used - Swapping_Home_Servant_Impl_Base (void); - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_SWAPPING_SERVANT_HOME_IMPL_BASE_H */ diff --git a/CIAO/ciao/Upgradeable_Context_Impl_T.h b/CIAO/ciao/Upgradeable_Context_Impl_T.h deleted file mode 100644 index d37088b39bc..00000000000 --- a/CIAO/ciao/Upgradeable_Context_Impl_T.h +++ /dev/null @@ -1,88 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Upgradeable_Context_Impl_T.h - * - * $Id$ - * - */ -//============================================================================= - - -#ifndef CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H -#define CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H - -#include /**/ "ace/pre.h" - -#include "ciao/CIAO_UpgradeableContextC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciao/Context_Impl_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL -namespace CORBA -{ - class SystemException; -} -TAO_END_VERSIONED_NAMESPACE_DECL - -namespace CIAO -{ - template <typename BASE_CTX, - typename SVNT, - typename COMP> - class Upgradeable_Context_Impl - : public virtual Context_Impl<BASE_CTX, SVNT, COMP> - { - public: - /// Type definition of the context type. - typedef BASE_CTX context_type; - - /// Type definition of the var type for the context. - typedef typename context_type::_var_type _var_type; - - /// Type definition of the servant type. - typedef SVNT servant_type; - - /// Type definition of the component type. - typedef COMP component_type; - - Upgradeable_Context_Impl (Components::CCMHome_ptr the_home, - Session_Container *c, - SVNT *sv); - - virtual ~Upgradeable_Context_Impl (void); - - virtual void - deactivate_facet (const PortableServer::ObjectId &oid); - - virtual void - update_port_activator (const PortableServer::ObjectId &oid); - - virtual void - remove_facet (CORBA::Object_ptr reference); - - virtual ::Components::ConsumerDescriptions * - get_registered_consumers (const char *publisher_name) = 0; - - private: - /// Not to be used - Upgradeable_Context_Impl (void); - }; -} - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Upgradeable_Context_Impl_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Upgradeable_Context_Impl_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_UPGRADEABLE_CONTEXT_IMPL_T_H */ diff --git a/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp b/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp new file mode 100644 index 00000000000..30a12b438b3 --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/ConfigValue.cpp @@ -0,0 +1,43 @@ +// $Id$ +#include "ConfigValue.h" + +ACE_RCSID (ciao, + ConfigValue, + "$Id$") + +namespace CIAO +{ + ConfigValue_impl::ConfigValue_impl() + { + CORBA::Any any; + any <<= CORBA::Short(0); + name((const char*)""); + value(any); + } + + + ConfigValue_impl::ConfigValue_impl(const char* the_name, + const CORBA::Any& the_value) + : OBV_Components::ConfigValue() + { + CORBA::Any any = the_value; + name( the_name ); + value( any ); + } + + CORBA::ValueBase* ConfigValue_impl::_copy_value() + { + return new ConfigValue_impl(name(),value()); + } + + ConfigValue_impl::~ConfigValue_impl() + throw () + { + } + + CORBA::ValueBase * + ConfigValueFactory::create_for_unmarshal () + { + return new ConfigValue_impl(); + } +} diff --git a/CIAO/ciao/Valuetype_Factories/ConfigValue.h b/CIAO/ciao/Valuetype_Factories/ConfigValue.h new file mode 100644 index 00000000000..3592c045f79 --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/ConfigValue.h @@ -0,0 +1,38 @@ +// $Id$ + + +#ifndef CIAO_CONFIG_VALUE_H +#define CIAO_CONFIG_VALUE_H +#include /**/ "ace/pre.h" + +#include "ccm/CCM_StandardConfiguratorC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ConfigValue_Export.h" +// #include "ace/Active_Map_Manager.h" + +namespace CIAO +{ + class ConfigValue_Factory_Export ConfigValue_impl + : public virtual OBV_Components::ConfigValue, + public virtual CORBA::DefaultValueRefCountBase + { + public: + ConfigValue_impl(); + ConfigValue_impl(const char* the_name, const CORBA::Any& the_value); + ~ConfigValue_impl() throw(); + virtual CORBA::ValueBase* _copy_value(); + }; + + class ConfigValueFactory : virtual public Components::ConfigValue_init + { + public: + CORBA::ValueBase * create_for_unmarshal (); + }; +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_VALUE_H */ diff --git a/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h b/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h new file mode 100644 index 00000000000..71ec6ce9491 --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/ConfigValue_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl ConfigValue_Factory +// ------------------------------ +#ifndef CONFIGVALUE_FACTORY_EXPORT_H +#define CONFIGVALUE_FACTORY_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (CONFIGVALUE_FACTORY_HAS_DLL) +# define CONFIGVALUE_FACTORY_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && CONFIGVALUE_FACTORY_HAS_DLL */ + +#if !defined (CONFIGVALUE_FACTORY_HAS_DLL) +# define CONFIGVALUE_FACTORY_HAS_DLL 1 +#endif /* ! CONFIGVALUE_FACTORY_HAS_DLL */ + +#if defined (CONFIGVALUE_FACTORY_HAS_DLL) && (CONFIGVALUE_FACTORY_HAS_DLL == 1) +# if defined (CONFIGVALUE_FACTORY_BUILD_DLL) +# define ConfigValue_Factory_Export ACE_Proper_Export_Flag +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CONFIGVALUE_FACTORY_BUILD_DLL */ +# define ConfigValue_Factory_Export ACE_Proper_Import_Flag +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CONFIGVALUE_FACTORY_BUILD_DLL */ +#else /* CONFIGVALUE_FACTORY_HAS_DLL == 1 */ +# define ConfigValue_Factory_Export +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARATION(T) +# define CONFIGVALUE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CONFIGVALUE_FACTORY_HAS_DLL == 1 */ + +// Set CONFIGVALUE_FACTORY_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CONFIGVALUE_FACTORY_NTRACE) +# if (ACE_NTRACE == 1) +# define CONFIGVALUE_FACTORY_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CONFIGVALUE_FACTORY_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CONFIGVALUE_FACTORY_NTRACE */ + +#if (CONFIGVALUE_FACTORY_NTRACE == 1) +# define CONFIGVALUE_FACTORY_TRACE(X) +#else /* (CONFIGVALUE_FACTORY_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CONFIGVALUE_FACTORY_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CONFIGVALUE_FACTORY_NTRACE == 1) */ + +#endif /* CONFIGVALUE_FACTORY_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Valuetype_Factories/Cookie_Export.h b/CIAO/ciao/Valuetype_Factories/Cookie_Export.h new file mode 100644 index 00000000000..277717f4d5c --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/Cookie_Export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl Cookie_Factory +// ------------------------------ +#ifndef COOKIE_FACTORY_EXPORT_H +#define COOKIE_FACTORY_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (COOKIE_FACTORY_HAS_DLL) +# define COOKIE_FACTORY_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && COOKIE_FACTORY_HAS_DLL */ + +#if !defined (COOKIE_FACTORY_HAS_DLL) +# define COOKIE_FACTORY_HAS_DLL 1 +#endif /* ! COOKIE_FACTORY_HAS_DLL */ + +#if defined (COOKIE_FACTORY_HAS_DLL) && (COOKIE_FACTORY_HAS_DLL == 1) +# if defined (COOKIE_FACTORY_BUILD_DLL) +# define Cookie_Factory_Export ACE_Proper_Export_Flag +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* COOKIE_FACTORY_BUILD_DLL */ +# define Cookie_Factory_Export ACE_Proper_Import_Flag +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* COOKIE_FACTORY_BUILD_DLL */ +#else /* COOKIE_FACTORY_HAS_DLL == 1 */ +# define Cookie_Factory_Export +# define COOKIE_FACTORY_SINGLETON_DECLARATION(T) +# define COOKIE_FACTORY_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* COOKIE_FACTORY_HAS_DLL == 1 */ + +// Set COOKIE_FACTORY_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (COOKIE_FACTORY_NTRACE) +# if (ACE_NTRACE == 1) +# define COOKIE_FACTORY_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define COOKIE_FACTORY_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !COOKIE_FACTORY_NTRACE */ + +#if (COOKIE_FACTORY_NTRACE == 1) +# define COOKIE_FACTORY_TRACE(X) +#else /* (COOKIE_FACTORY_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define COOKIE_FACTORY_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (COOKIE_FACTORY_NTRACE == 1) */ + +#endif /* COOKIE_FACTORY_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/ciao/Cookies.cpp b/CIAO/ciao/Valuetype_Factories/Cookies.cpp index 0d32ffe9d89..0d32ffe9d89 100644 --- a/CIAO/ciao/Cookies.cpp +++ b/CIAO/ciao/Valuetype_Factories/Cookies.cpp diff --git a/CIAO/ciao/Valuetype_Factories/Cookies.h b/CIAO/ciao/Valuetype_Factories/Cookies.h new file mode 100644 index 00000000000..8fd92b348f8 --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/Cookies.h @@ -0,0 +1,70 @@ +// $Id$ + +/** + * @file Cookies.h + * + * A CIAO implementation of Cookie valuetype. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef CIAO_COOKIES_H +#define CIAO_COOKIES_H + +#include /**/ "ace/pre.h" + +#include "Cookie_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ccm/CCM_CookieC.h" + +#include "ace/Active_Map_Manager.h" + +namespace CIAO +{ + /** + * @class Cookie_Impl + * + * @brief A cookie implementation using an unsigned integer + * big enough to hold an address, even on a 64-bit machine. + */ + class Cookie_Factory_Export Cookie_Impl + : public virtual OBV_Components::Cookie + { + public: + Cookie_Impl (void); + virtual ~Cookie_Impl (void); + + /// Initialize a @c Cookie with a @c ptrdiff_t + Cookie_Impl (ptrdiff_t const &key); + + /// Extract the @c CORBA::ULong + static bool extract (Components::Cookie const * const c, + ptrdiff_t &key); + }; + + /** + * @class Cookie_Impl_init + * + * @brief Valuefactory implementation for Cookie_Impl. + */ + class Cookie_Factory_Export Cookie_Impl_init + : public virtual Components::Cookie_init + { + public: + virtual ~Cookie_Impl_init (void); + + virtual CORBA::ValueBase *create_for_unmarshal (void); + }; +} + +#if defined (__ACE_INLINE__) +#include "Cookies.inl" +#endif /* defined INLINE */ + +#include /**/ "ace/post.h" + +#endif /* CIAO_COOKIES_H */ diff --git a/CIAO/ciao/Cookies.inl b/CIAO/ciao/Valuetype_Factories/Cookies.inl index 406485110c4..406485110c4 100644 --- a/CIAO/ciao/Cookies.inl +++ b/CIAO/ciao/Valuetype_Factories/Cookies.inl diff --git a/CIAO/ciao/Valuetype_Factories/Factories.mpc b/CIAO/ciao/Valuetype_Factories/Factories.mpc new file mode 100644 index 00000000000..c03e88e1ec8 --- /dev/null +++ b/CIAO/ciao/Valuetype_Factories/Factories.mpc @@ -0,0 +1,23 @@ +//$Id$ +project(CCM_Cookie_Factory) : ccm_stub, ciao_lib { + dynamicflags = COOKIE_FACTORY_BUILD_DLL + Source_Files { + Cookies.cpp + } + Header_Files { + Cookies.h + } + Inline_Files { + Cookies.inl + } +} + +project(CCM_ConfigValue_Factory) : ccm_stub, ciao_lib { + dynamicflags = CONFIGVALUE_FACTORY_BUILD_DLL + Source_Files { + ConfigValue.cpp + } + Header_Files { + ConfigValue.h + } +} diff --git a/CIAO/ciao/Version.h b/CIAO/ciao/Version.h index a00f0ea1115..2cf6e336e89 100644 --- a/CIAO/ciao/Version.h +++ b/CIAO/ciao/Version.h @@ -6,4 +6,4 @@ #define CIAO_MAJOR_VERSION 0 #define CIAO_MINOR_VERSION 6 #define CIAO_BETA_VERSION 8 -#define CIAO_VERSION "0.6.8" +#define CIAO_VERSION "0.6.3" diff --git a/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.cpp b/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.cpp deleted file mode 100644 index 4b0c6bb85ec..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_EventService_Factory_impl.cpp - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards <g.edwards@vanderbilt.edu> - */ -//============================================================================= - -#include "CIAO_EventService_Factory_impl.h" - -#include "ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.h" - -namespace CIAO -{ - EventService_Factory_impl::EventService_Factory_impl (void) - { - } - - EventService_Factory_impl::EventService_Factory_impl ( - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa) - : orb_ (CORBA::ORB::_duplicate (orb)), - poa_ (PortableServer::POA::_duplicate (poa)) - { - } - - EventService_Factory_impl::~EventService_Factory_impl (void) - { - } - - CIAO_Event_Service_ptr - EventService_Factory_impl::create (EventServiceType type, - const char * ec_name) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO::EventService_Factory_impl::create_event_service\n")); - - EventServiceBase * event_service = 0; - - switch (type) - { - case RTEC: - ACE_NEW_RETURN (event_service, - RTEventService (this->orb_.in (), - this->poa_.in (), - ec_name), - 0); - break; - - default: - ACE_ERROR_RETURN ((LM_ERROR, "CIAO::EventService_Factory_impl::" - "create_event_service: unsupported type.\n"), - 0); - - } - - // Activate the servant. - PortableServer::ObjectId_var oid = - this->poa_->activate_object (event_service); - - CORBA::Object_var obj = poa_->id_to_reference (oid.in()); - - CIAO_Event_Service_var service = - CIAO_Event_Service::_narrow (obj.in ()); - - return service._retn (); - } - - int - EventService_Factory_impl::Initializer (void) - { - return - ACE_Service_Config::process_directive ( - ace_svc_desc_EventService_Factory_impl); - } - - void EventService_Factory_impl::initialize ( - CORBA::ORB_ptr orb, PortableServer::POA_ptr poa) - { - this->orb_ = CORBA::ORB::_duplicate (orb); - this->poa_ = PortableServer::POA::_duplicate (poa); - } - - ACE_STATIC_SVC_DEFINE ( - EventService_Factory_impl, - ACE_TEXT ("CIAO_EventService_Factory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (EventService_Factory_impl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0 - ) - - ACE_FACTORY_DEFINE (CIAO_EVENTS, EventService_Factory_impl) -} // namespace CIAO diff --git a/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.h b/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.h deleted file mode 100644 index f7ef9d029cd..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_EventService_Factory_impl.h +++ /dev/null @@ -1,79 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_EventService_Factory_impl.h - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards <g.edwards@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_EVENTSERVICE_FACTORY_IMPL_H -#define CIAO_EVENTSERVICE_FACTORY_IMPL_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Events_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h" - -namespace CIAO -{ - class CIAO_EVENTS_Export EventService_Factory_impl - : public ACE_Service_Object - { - public: - EventService_Factory_impl (void); - - EventService_Factory_impl (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa); - - virtual ~EventService_Factory_impl (void); - - /// A factory method which creates an CIAO_Event_Service object. - virtual CIAO_Event_Service_ptr create (EventServiceType type, - const char * ec_name); - - virtual void initialize (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa); - - /// Used to force the initialization. - static int Initializer (void); - - private: - /// Reference to the ORB. - CORBA::ORB_var orb_; - - /// Reference to the Root POA - PortableServer::POA_var poa_; - }; - - ACE_STATIC_SVC_DECLARE (EventService_Factory_impl) - ACE_FACTORY_DECLARE (CIAO_EVENTS, EventService_Factory_impl) -} - -#if defined (ACE_HAS_BROKEN_STATIC_CONSTRUCTORS) - -typedef int (*CIAO_Module_Initializer) (void); - -static CIAO_Module_Initializer -CIAO_Requires_EventService_Initializer = - &CIAO::EventService_Factory_impl::Initializer; - -#else - -static int -CIAO_Requires_EventService_Initializer = - CIAO::EventService_Factory_impl::Initializer (); - -#endif /* ACE_HAS_BROKEN_STATIC_CONSTRUCTORS */ - -#include /**/ "ace/post.h" - -#endif /* CIAO_EVENTSERVICE_FACTORY_IMPL_H */ diff --git a/CIAO/ciaosvcs/Events/CIAO_Events.mpc b/CIAO/ciaosvcs/Events/CIAO_Events.mpc deleted file mode 100644 index 95e5ce239c8..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project (CIAO_Events) : orbsvcslib, orbsvcs_output, ciao_rtevent_dnc { - - sharedname = CIAO_Events - idlflags += -Wb,export_include=CIAO_Events_Export.h \ - -Wb,export_macro=CIAO_EVENTS_Export - dynamicflags = CIAO_EVENTS_BUILD_DLL - - Source_Files { - CIAO_EventService_Factory_impl.cpp - } - - Header_Files { - CIAO_EventService_Factory_impl.h - CIAO_Events_Export.h - } - - IDL_Files { - } -} diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp deleted file mode 100644 index d806e81801d..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//============================================================================= -/** - * @file CIAO_EventServiceBase.cpp - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - */ -//============================================================================= - -#include "CIAO_EventServiceBase.h" - -namespace CIAO -{ - EventServiceBase::EventServiceBase (void) - { - } - - EventServiceBase::~EventServiceBase (void) - { - } - - void - EventServiceBase::ciao_push_event (Components::EventBase * /* evt */, - const char * /* source_id */, - CORBA::TypeCode_ptr /* tc */) - { - } -} diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h deleted file mode 100644 index 67187fde382..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_EventServiceBase.h - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards <g.edwards@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_EVENTSERVICEBASE_H -#define CIAO_EVENTSERVICEBASE_H - -#include /**/ "ace/pre.h" - -#include "CIAO_Events_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_EventsS.h" - -namespace CIAO -{ - /** - * @class EventServiceBase - * - * An abstract base servant class to implement the CIAO_Event_Service - * interface. The derived classes will provide appropriate - * implementations of the connect, disconnect, and push methods depending on - * the event mechanism used. - */ - class CIAO_EVENTS_Export EventServiceBase - : public virtual POA_CIAO::CIAO_Event_Service - { - public: - EventServiceBase (void); - - virtual ~EventServiceBase (void); - - /// A factory method for Supplier_Config objects - virtual Supplier_Config_ptr create_supplier_config (void) = 0; - - /// A factory method for Consumer_Config objects - virtual Consumer_Config_ptr create_consumer_config (void) = 0; - - /** - * @fn void connect_event_supplier (Supplier_Config_ptr supplier_config) - * - * Connects an event supplier using the options specified by - * @c supplier_config. - */ - virtual void connect_event_supplier (Supplier_Config_ptr supplier_config) = 0; - - /** - * @fn void connect_event_consumer (Consumer_Config_ptr consumer_config) - * - * Connects an event consumer using the options specified by - * @c consumer_config. - */ - virtual void connect_event_consumer (Consumer_Config_ptr consumer_config) = 0; - - /** - * @fn void disconnect_event_supplier () - * - * Disconnects the event supplier associated with this object. - */ - virtual void disconnect_event_supplier (const char * consumer_id) = 0; - - /** - * @fn void disconnect_event_consumer (CONNECTION_ID consumer_id) - * - * Disconnects the event consumer with UUID @c consumer_id. - */ - virtual void disconnect_event_consumer (const char * consumer_id) = 0; - - /** - * @fn void push_event (Components::EventBase * ev) - * - * Pushes event @c ev to all consumers. - */ - virtual void push_event (Components::EventBase * ev) = 0; - - /** - * Pushes event @c ev to all consumers. The source id of the - * supplier is specified through @c source_id. - */ - virtual void ciao_push_event (::Components::EventBase * evt, - const char * source_id, - ::CORBA::TypeCode_ptr tc); - }; - - class Event_Consumer_Config_Base - : public virtual POA_CIAO::Consumer_Config - { - public: - virtual void start_conjunction_group (::CORBA::Long size) = 0; - - virtual void start_disjunction_group (::CORBA::Long size) = 0; - - virtual void insert_source (const char * source_id) = 0; - - virtual void insert_type (::CORBA::Long event_type) = 0; - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_EVENTSERVICEBASE_H */ diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl deleted file mode 100644 index 266f8b472e9..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -/** - * @file CIAO_Events.idl - * - * @author George Edwards <g.edwards@vanderbilt.edu> - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * - * @brief Interfaces for configuring CIAO's event mechanism. - */ - -#if !defined (CIAO_EVENTS_IDL) -#define CIAO_EVENTS_IDL - -#include "ciao/CCM_EventConsumerBase.idl" -#include "ciao/CCM_Base.idl" - -module CIAO -{ - /// A component's UUID + port name. - typedef string CONNECTION_ID; - - enum EventServiceType - { - EC, - RTEC, - NOTIFY, - RTNOTIFY - }; - - interface Supplier_Config - { - attribute CONNECTION_ID supplier_id; - - readonly attribute EventServiceType service_type; - - void destroy (); - }; - - interface Consumer_Config - { - attribute CONNECTION_ID consumer_id; - - readonly attribute EventServiceType service_type; - - attribute Components::EventConsumerBase consumer; - - void start_conjunction_group (in long size); - - void start_disjunction_group (in long size); - - void insert_source (in CONNECTION_ID source_id); - - void insert_type (in long event_type); - - void destroy (); - }; - - interface CIAO_Event_Service : Components::EventConsumerBase - { - Supplier_Config create_supplier_config (); - - Consumer_Config create_consumer_config (); - - void connect_event_supplier (in Supplier_Config supplier_conf); - - void connect_event_consumer (in Consumer_Config consumer_conf); - - void disconnect_event_supplier (in CONNECTION_ID conn_id) - raises (Components::InvalidConnection); - - void disconnect_event_consumer (in CONNECTION_ID conn_id) - raises (Components::InvalidConnection); - - //void push_event (in Components::EventBase ev); - }; -}; - -#endif /* CIAO_EVENTS_IDL */ diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc deleted file mode 100644 index a4c36f0148f..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base.mpc +++ /dev/null @@ -1,26 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project (CIAO_Events_Base) : orbsvcslib, orbsvcs_output, ciao_client_dnc, ciao_container_dnc { - sharedname = CIAO_Events_Base - idlflags += -Wb,export_include=CIAO_Events_Export.h \ - -Wb,export_macro=CIAO_EVENTS_Export - dynamicflags = CIAO_EVENTS_BUILD_DLL - - IDL_Files { - CIAO_Events.idl - } - - Source_Files { - CIAO_EventServiceBase.cpp - CIAO_EventsC.cpp - CIAO_EventsS.cpp - } - - Header_Files { - CIAO_Events_Export.h - CIAO_EventsC.h - CIAO_EventsS.h - CIAO_EventServiceBase.h - } -} diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h b/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h deleted file mode 100644 index e6a738b9c1e..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_EVENTS -// ------------------------------ -#ifndef CIAO_EVENTS_EXPORT_H -#define CIAO_EVENTS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_EVENTS_HAS_DLL) -# define CIAO_EVENTS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_EVENTS_HAS_DLL */ - -#if !defined (CIAO_EVENTS_HAS_DLL) -# define CIAO_EVENTS_HAS_DLL 1 -#endif /* ! CIAO_EVENTS_HAS_DLL */ - -#if defined (CIAO_EVENTS_HAS_DLL) && (CIAO_EVENTS_HAS_DLL == 1) -# if defined (CIAO_EVENTS_BUILD_DLL) -# define CIAO_EVENTS_Export ACE_Proper_Export_Flag -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_EVENTS_BUILD_DLL */ -# define CIAO_EVENTS_Export ACE_Proper_Import_Flag -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_EVENTS_BUILD_DLL */ -#else /* CIAO_EVENTS_HAS_DLL == 1 */ -# define CIAO_EVENTS_Export -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_EVENTS_HAS_DLL == 1 */ - -// Set CIAO_EVENTS_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_EVENTS_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_EVENTS_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_EVENTS_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_EVENTS_NTRACE */ - -#if (CIAO_EVENTS_NTRACE == 1) -# define CIAO_EVENTS_TRACE(X) -#else /* (CIAO_EVENTS_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_EVENTS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_EVENTS_NTRACE == 1) */ - -#endif /* CIAO_EVENTS_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/ciaosvcs/Events/CIAO_Events_Export.h b/CIAO/ciaosvcs/Events/CIAO_Events_Export.h deleted file mode 100644 index e6a738b9c1e..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_Events_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_EVENTS -// ------------------------------ -#ifndef CIAO_EVENTS_EXPORT_H -#define CIAO_EVENTS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_EVENTS_HAS_DLL) -# define CIAO_EVENTS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_EVENTS_HAS_DLL */ - -#if !defined (CIAO_EVENTS_HAS_DLL) -# define CIAO_EVENTS_HAS_DLL 1 -#endif /* ! CIAO_EVENTS_HAS_DLL */ - -#if defined (CIAO_EVENTS_HAS_DLL) && (CIAO_EVENTS_HAS_DLL == 1) -# if defined (CIAO_EVENTS_BUILD_DLL) -# define CIAO_EVENTS_Export ACE_Proper_Export_Flag -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_EVENTS_BUILD_DLL */ -# define CIAO_EVENTS_Export ACE_Proper_Import_Flag -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_EVENTS_BUILD_DLL */ -#else /* CIAO_EVENTS_HAS_DLL == 1 */ -# define CIAO_EVENTS_Export -# define CIAO_EVENTS_SINGLETON_DECLARATION(T) -# define CIAO_EVENTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_EVENTS_HAS_DLL == 1 */ - -// Set CIAO_EVENTS_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_EVENTS_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_EVENTS_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_EVENTS_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_EVENTS_NTRACE */ - -#if (CIAO_EVENTS_NTRACE == 1) -# define CIAO_EVENTS_TRACE(X) -#else /* (CIAO_EVENTS_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_EVENTS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_EVENTS_NTRACE == 1) */ - -#endif /* CIAO_EVENTS_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEVENT_Export.h b/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEVENT_Export.h deleted file mode 100644 index d79e4a4581f..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEVENT_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_RTEVENT -// ------------------------------ -#ifndef CIAO_RTEVENT_EXPORT_H -#define CIAO_RTEVENT_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_RTEVENT_HAS_DLL) -# define CIAO_RTEVENT_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_RTEVENT_HAS_DLL */ - -#if !defined (CIAO_RTEVENT_HAS_DLL) -# define CIAO_RTEVENT_HAS_DLL 1 -#endif /* ! CIAO_RTEVENT_HAS_DLL */ - -#if defined (CIAO_RTEVENT_HAS_DLL) && (CIAO_RTEVENT_HAS_DLL == 1) -# if defined (CIAO_RTEVENT_BUILD_DLL) -# define CIAO_RTEVENT_Export ACE_Proper_Export_Flag -# define CIAO_RTEVENT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_RTEVENT_BUILD_DLL */ -# define CIAO_RTEVENT_Export ACE_Proper_Import_Flag -# define CIAO_RTEVENT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_RTEVENT_BUILD_DLL */ -#else /* CIAO_RTEVENT_HAS_DLL == 1 */ -# define CIAO_RTEVENT_Export -# define CIAO_RTEVENT_SINGLETON_DECLARATION(T) -# define CIAO_RTEVENT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_RTEVENT_HAS_DLL == 1 */ - -// Set CIAO_RTEVENT_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_RTEVENT_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_RTEVENT_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_RTEVENT_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_RTEVENT_NTRACE */ - -#if (CIAO_RTEVENT_NTRACE == 1) -# define CIAO_RTEVENT_TRACE(X) -#else /* (CIAO_RTEVENT_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_RTEVENT_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_RTEVENT_NTRACE == 1) */ - -#endif /* CIAO_RTEVENT_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp b/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp deleted file mode 100644 index 400c8508a9f..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp +++ /dev/null @@ -1,763 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_RTEvent.cpp - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards <g.edwards@vanderbilt.edu> - */ -//============================================================================= - -#include "CIAO_RTEvent.h" -#include "SimpleAddressServer.h" - -#include "ciao/CIAO_common.h" - -#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" - -#include "tao/ORB_Core.h" - -#include <sstream> - -namespace CIAO -{ - RTEventService::RTEventService (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * ec_name) : - orb_ (CORBA::ORB::_duplicate (orb)), - root_poa_ (PortableServer::POA::_duplicate (poa)) - { - this->create_rt_event_channel (ec_name); - } - - RTEventService::~RTEventService (void) - { - } - - Supplier_Config_ptr - RTEventService::create_supplier_config (void) - { - RTEvent_Supplier_Config_impl * supplier_config = 0; - ACE_NEW_RETURN (supplier_config, - RTEvent_Supplier_Config_impl (this->root_poa_.in ()), - Supplier_Config::_nil ()); - RTEvent_Supplier_Config_var return_rtec = - supplier_config->_this (); - return return_rtec._retn (); - } - - - Consumer_Config_ptr - RTEventService::create_consumer_config (void) - { - RTEvent_Consumer_Config_impl * consumer_config = 0; - ACE_NEW_RETURN (consumer_config, - RTEvent_Consumer_Config_impl (this->root_poa_.in ()), - Consumer_Config::_nil ()); - RTEvent_Consumer_Config_var return_rtec = - consumer_config->_this (); - return return_rtec._retn (); - } - - - // @@TODO: We might want to maintain a map for managing multiple proxy consumers - // to multiple event suppliers. - void - RTEventService::connect_event_supplier ( - Supplier_Config_ptr supplier_config) - { - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO::RTEventService::connect_event_supplier\n")); - } - - RTEvent_Supplier_Config_ptr rt_config = - RTEvent_Supplier_Config::_narrow (supplier_config); - - if (CORBA::is_nil (rt_config)) - { - throw CORBA::BAD_PARAM (); - } - - // Get a proxy push consumer from the EventChannel. - RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = - this->rt_event_channel_->for_suppliers (); - - RtecEventChannelAdmin::ProxyPushConsumer_var proxy_push_consumer = - supplier_admin->obtain_push_consumer(); - - // Create and register supplier servant - RTEventServiceSupplier_impl * supplier_servant = 0; - ACE_NEW (supplier_servant, - RTEventServiceSupplier_impl (root_poa_.in ())); - RtecEventComm::PushSupplier_var push_supplier = - supplier_servant->_this (); - - RtecEventChannelAdmin::SupplierQOS_var qos = - rt_config->rt_event_qos (); - - ACE_SupplierQOS_Factory supplier_qos; - supplier_qos.insert (ACE_ES_EVENT_SOURCE_ANY, ACE_ES_EVENT_ANY, 0, 1); - - supplier_qos.insert (ACE_ES_EVENT_SOURCE_ANY, - ACE_ES_EVENT_ANY, - 0, // handle to the rt_info structure - 1); - - proxy_push_consumer->connect_push_supplier ( - push_supplier.in (), - supplier_qos.get_SupplierQOS ()); - - this->proxy_consumer_map_.bind (supplier_config->supplier_id (), - proxy_push_consumer._retn ()); - } - - void - RTEventService::connect_event_consumer ( - Consumer_Config_ptr consumer_config) - { - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, "CIAO::RTEventService::connect_event_consumer\n")); - } - - RTEvent_Consumer_Config_ptr rt_config = - RTEvent_Consumer_Config::_narrow (consumer_config); - - if (CORBA::is_nil (rt_config)) - { - throw CORBA::BAD_PARAM (); - } - - Components::EventConsumerBase_var consumer = - consumer_config->consumer (); - - if (CORBA::is_nil (consumer.in ())) - { - ACE_DEBUG ((LM_DEBUG, "nil event consumer\n")); - } - - RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = - this->rt_event_channel_->for_consumers (); - - RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier = - consumer_admin->obtain_push_supplier (); - - // Create and register consumer servant. - RTEventServiceConsumer_impl * consumer_servant = 0; - ACE_NEW (consumer_servant, - RTEventServiceConsumer_impl ( - root_poa_.in (), - consumer.in ())); - RtecEventComm::PushConsumer_var push_consumer = - consumer_servant->_this (); - - RtecEventChannelAdmin::ConsumerQOS_var qos = - rt_config->rt_event_qos (); - - ACE_DEBUG ((LM_DEBUG, - "\n======== ConsumerQoS length is: %d\n\n", - qos->dependencies.length ())); - - if (qos->dependencies.length () == 0) - { - qos->dependencies.length (1); - qos->dependencies[0].event.header.type = ACE_ES_EVENT_ANY; - qos->dependencies[0].event.header.source = ACE_ES_EVENT_SOURCE_ANY; - qos->dependencies[0].rt_info = 0; - - ACE_DEBUG ((LM_DEBUG, - "\n======== Normalized ConsumerQoS length is: %d\n\n", - qos->dependencies.length ())); - } - - proxy_supplier->connect_push_consumer (push_consumer.in (), - qos.in ()); - - ACE_CString consumer_id = consumer_config->consumer_id (); - - this->proxy_supplier_map_.bind (consumer_id.c_str (), - proxy_supplier._retn ()); - } - - void - RTEventService::disconnect_event_supplier (const char * connection_id) - { - RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer; - - this->proxy_consumer_map_.unbind (connection_id, proxy_consumer); - - proxy_consumer->disconnect_push_consumer (); - } - - void - RTEventService::disconnect_event_consumer (const char * connection_id) - { - RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier; - - this->proxy_supplier_map_.unbind (connection_id, proxy_supplier); - - proxy_supplier->disconnect_push_supplier (); - } - - void - RTEventService::push_event (Components::EventBase * /* ev */) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "------CIAO::RTEventService::push_event------\n")); - } - } - - void - RTEventService::ciao_push_event (Components::EventBase * ev, - const char * source_id, - CORBA::TypeCode_ptr tc) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "------CIAO::RTEventService::ciao_push_event------\n")); - } - RtecEventComm::EventSet events (1); - events.length (1); - - ACE_Hash<ACE_CString> hasher; - - events[0].header.source = hasher (source_id); - events[0].header.type = ACE_ES_EVENT_ANY; - events[0].header.ttl = 10; - - // We can't use the Any insert operator here, since it will put the - // EventBase typecode into the Any, and the actual eventtype's fields - // (if any) will get truncated when the Any is demarshaled. So the - // signature of this method has been changed to pass in the derived - // typecode, and TAO-specific methods are used to assign it as the - // Any's typecode and encode the value. This incurs an extra - // encoding, which we may want to try to optimize someday. - TAO_OutputCDR out; - out << ev; - TAO_InputCDR in (out); - TAO::Unknown_IDL_Type *unk = 0; - ACE_NEW (unk, - TAO::Unknown_IDL_Type (tc, in)); - events[0].data.any_value.replace (unk); - - ACE_DEBUG ((LM_DEBUG, - "******* push event for source string: %s\n", - source_id)); - ACE_DEBUG ((LM_DEBUG, - "******* push event for source id: %i\n", - events[0].header.source)); - - RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer; - - if (this->proxy_consumer_map_.find (source_id, proxy_consumer) != 0) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO (%P|%t) - RTEventService::ciao_push_event, " - "Error in finding the proxy consumer object.\n")); - throw Components::BadEventType (); - } - - proxy_consumer->push (events); - } - - void - RTEventService::create_rt_event_channel (const char * /* ec_name */) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO::EventService_Factory_impl::" - "create_rt_event_channel\n")); - } - - TAO_EC_Default_Factory::init_svcs (); - - TAO_EC_Event_Channel_Attributes attributes (this->root_poa_.in (), - this->root_poa_.in ()); - TAO_EC_Event_Channel * ec_servant = 0; - ACE_NEW (ec_servant, TAO_EC_Event_Channel (attributes)); - ec_servant->activate (); - this->rt_event_channel_ = ec_servant->_this (); - } - - ::CORBA::Boolean - RTEventService::create_addr_serv (const char * name, - ::CORBA::UShort port, - const char * address) - { - ACE_DEBUG ((LM_ERROR, - "Create an address server using port [%d]\n", - port)); - - // Initialize the address server with the desired address. - // This will be used by the sender object and the multicast - // receiver. - ACE_INET_Addr send_addr (port, address); - - SimpleAddressServer * addr_srv_impl = - new SimpleAddressServer (send_addr); - - PortableServer::ObjectId_var addr_srv_oid = - this->root_poa_->activate_object (addr_srv_impl); - CORBA::Object_var addr_srv_obj = - this->root_poa_->id_to_reference (addr_srv_oid.in()); - RtecUDPAdmin::AddrServer_var addr_srv = - RtecUDPAdmin::AddrServer::_narrow (addr_srv_obj.in()); - - this->addr_serv_map_.bind ( - name, - RtecUDPAdmin::AddrServer::_duplicate (addr_srv.in ())); - - return true; - } - - ::CORBA::Boolean - RTEventService::create_sender (const char * addr_serv_id) - { - ACE_DEBUG ((LM_DEBUG, - "Create a Sender object with addr_serv_id: %s\n", - addr_serv_id )); - - // We need a local socket to send the data, open it and check - // that everything is OK: - TAO_ECG_Refcounted_Endpoint endpoint(new TAO_ECG_UDP_Out_Endpoint); - - if (endpoint->dgram ().open (ACE_Addr::sap_any) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open send endpoint\n"), - 1); - } - - RtecUDPAdmin::AddrServer_var addr_srv; - - if (this->addr_serv_map_.find (addr_serv_id, addr_srv) != 0) - { - return false; - } - - // Now we setup the sender: - TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender = - TAO_ECG_UDP_Sender::create(); - sender->init (this->rt_event_channel_.in (), - addr_srv.in (), - endpoint); - - // Set up the subscription and connect to the EC. - ACE_ConsumerQOS_Factory cons_qos_fact; - cons_qos_fact.start_disjunction_group (); - cons_qos_fact.insert (ACE_ES_EVENT_SOURCE_ANY, ACE_ES_EVENT_ANY, 0); - RtecEventChannelAdmin::ConsumerQOS sub = - cons_qos_fact.get_ConsumerQOS (); - sub.is_gateway = 1; - sender->connect (sub); - - return true; - } - - ::CORBA::Boolean - RTEventService::create_receiver (const char * addr_serv_id, - ::CORBA::Boolean is_multicast, - ::CORBA::UShort listen_port) - { - ACE_DEBUG ((LM_DEBUG, - "Create a receiver object with addr_serv_id: %s\n", - addr_serv_id )); - - // Create and initialize the receiver - TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver = - TAO_ECG_UDP_Receiver::create(); - - // AddressServer is necessary when "multicast" is - // enabled, but not for "udp". - if (is_multicast) - { - TAO_ECG_UDP_Out_Endpoint endpoint; - - if (endpoint.dgram ().open (ACE_Addr::sap_any) == -1) - { - ACE_DEBUG ((LM_ERROR, "Cannot open send endpoint\n")); - return false; - } - - // TAO_ECG_UDP_Receiver::init() takes a TAO_ECG_Refcounted_Endpoint. - // If we don't clone our endpoint and - // pass &endpoint, the receiver will - // attempt to delete endpoint during shutdown. - TAO_ECG_Refcounted_Endpoint clone (new TAO_ECG_UDP_Out_Endpoint (endpoint)); - - RtecUDPAdmin::AddrServer_var addr_srv; - - if (this->addr_serv_map_.find (addr_serv_id, addr_srv) != 0) - { - return false; - } - - receiver->init (this->rt_event_channel_.in (), - clone, - addr_srv.in ()); - } - else - { - TAO_ECG_Refcounted_Endpoint nil_endpoint; - receiver->init (this->rt_event_channel_.in (), nil_endpoint, 0); - } - - // Setup the registration and connect to the event channel - ACE_SupplierQOS_Factory supp_qos_fact; - supp_qos_fact.insert (ACE_ES_EVENT_SOURCE_ANY, ACE_ES_EVENT_ANY, 0, 1); - RtecEventChannelAdmin::SupplierQOS pub = - supp_qos_fact.get_SupplierQOS (); - receiver->connect (pub); - - // Create the appropriate event handler - // and register it with the reactor. - - if (is_multicast) - { - auto_ptr<TAO_ECG_Mcast_EH> mcast_eh ( - new TAO_ECG_Mcast_EH (receiver.in ())); - mcast_eh->reactor (this->orb_->orb_core ()->reactor ()); - mcast_eh->open (this->rt_event_channel_.in ()); - mcast_eh.release (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "\nUDP Event Handler Port [%d]\n", - listen_port)); - - TAO_ECG_UDP_EH * udp_eh = new TAO_ECG_UDP_EH (receiver.in ()); - - udp_eh->reactor (this->orb_->orb_core ()->reactor ()); - - ACE_INET_Addr local_addr (listen_port); - - if (udp_eh->open (local_addr) == -1) - { - ACE_ERROR ((LM_ERROR, - "Cannot open event handler on port [%d]\n", - listen_port)); - return false; - } - } - - return true; - } - - - ::RtecEventChannelAdmin::EventChannel_ptr - RTEventService::tao_rt_event_channel (void) - { - return this->rt_event_channel_.in (); - } - - ////////////////////////////////////////////////////////////////////// - /// Supplier Servant Implementation - ////////////////////////////////////////////////////////////////////// - - RTEventServiceSupplier_impl::RTEventServiceSupplier_impl ( - PortableServer::POA_ptr poa) - : poa_ (PortableServer::POA::_duplicate (poa)) - { - } - - void - RTEventServiceSupplier_impl::disconnect_push_supplier (void) - { - PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); - this->poa_->deactivate_object (oid); - this->_remove_ref (); - } - - ////////////////////////////////////////////////////////////////////// - /// Consumer Servant Implementation - ////////////////////////////////////////////////////////////////////// - - RTEventServiceConsumer_impl::RTEventServiceConsumer_impl ( - PortableServer::POA_ptr poa, - Components::EventConsumerBase_ptr consumer) - : poa_ (PortableServer::POA::_duplicate (poa)), - event_consumer_ (Components::EventConsumerBase::_duplicate (consumer)) - { - } - - void - RTEventServiceConsumer_impl::push (const RtecEventComm::EventSet& events) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "CIAO::RTEventServiceConsumer_impl::push\n")); - } - - for (CORBA::ULong i = 0; i < events.length (); ++i) - { - std::ostringstream out; - out << "Received event," - << " type: " << events[i].header.type - << " source: " << events[i].header.source; - - ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized - - Components::EventBase * ev = 0; - - try - { - TAO::Unknown_IDL_Type *unk = - dynamic_cast<TAO::Unknown_IDL_Type *> ( - events[i].data.any_value.impl ()); - TAO_InputCDR for_reading (unk->_tao_get_cdr ()); - - if (for_reading >> ev) - { - ev->_add_ref (); - this->event_consumer_->push_event (ev); - } - else - { - ACE_ERROR ((LM_ERROR, "CIAO::RTEventServiceConsumer_impl::push(), " - "failed to extract event\n")); - } - } - catch (const CORBA::Exception& ex) - { - ACE_ERROR ((LM_ERROR, - "CORBA EXCEPTION caught\n")); - ex._tao_print_exception ("RTEventServiceConsumer_impl::push()\n"); - } - } - } - - void - RTEventServiceConsumer_impl::disconnect_push_consumer (void) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO::RTEventServiceConsumer_impl::" - "disconnect_push_consumer\n")); - } - - PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); - this->poa_->deactivate_object (oid); - this->_remove_ref (); - } - - ////////////////////////////////////////////////////////////////////// - /// Supplier Config Implementation - ////////////////////////////////////////////////////////////////////// - - RTEvent_Supplier_Config_impl::RTEvent_Supplier_Config_impl ( - PortableServer::POA_ptr poa) - : service_type_ (RTEC), - poa_ (PortableServer::POA::_duplicate (poa)) - { - } - - RTEvent_Supplier_Config_impl::~RTEvent_Supplier_Config_impl (void) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "RTEvent_Supplier_Config_impl::" - "~RTEvent_Supplier_Config_impl\n")); - } - } - - void - RTEvent_Supplier_Config_impl::supplier_id (const char * supplier_id) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "supplier's id: %s\n", supplier_id)); - } - - this->supplier_id_ = supplier_id; - - ACE_Hash<ACE_CString> hasher; - - RtecEventComm::EventSourceID source_id = - hasher (this->supplier_id_.c_str ()); - - this->qos_.insert (ACE_ES_EVENT_SOURCE_ANY, - ACE_ES_EVENT_ANY, - 0, // handle to the rt_info structure - 1); - - ACE_DEBUG ((LM_DEBUG, "supplier's source id is: %d\n", source_id)); - } - - CONNECTION_ID - RTEvent_Supplier_Config_impl::supplier_id (void) - { - return CORBA::string_dup (this->supplier_id_.c_str ()); - } - - EventServiceType - RTEvent_Supplier_Config_impl::service_type (void) - { - return this->service_type_; - } - - RtecEventChannelAdmin::SupplierQOS * - RTEvent_Supplier_Config_impl::rt_event_qos (void) - { - RtecEventChannelAdmin::SupplierQOS * supplier_qos = 0; - ACE_NEW_RETURN (supplier_qos, - RtecEventChannelAdmin::SupplierQOS ( - this->qos_.get_SupplierQOS ()), - 0); - return supplier_qos; - } - - void - RTEvent_Supplier_Config_impl::destroy (void) - { - PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); - this->poa_->deactivate_object (oid); - this->_remove_ref (); - } - - ////////////////////////////////////////////////////////////////////// - /// Consumer Config Implementation - ////////////////////////////////////////////////////////////////////// - - RTEvent_Consumer_Config_impl::RTEvent_Consumer_Config_impl ( - PortableServer::POA_ptr poa) - : service_type_ (RTEC), - poa_ (PortableServer::POA::_duplicate (poa)) - { - } - - RTEvent_Consumer_Config_impl::~RTEvent_Consumer_Config_impl (void) - { - ACE_DEBUG ((LM_DEBUG, - "RTEvent_Consumer_Config_impl::" - "~RTEvent_Consumer_Config_impl\n")); - } - - void - RTEvent_Consumer_Config_impl::start_conjunction_group (CORBA::Long size) - { - ACE_DEBUG ((LM_DEBUG, - "RTEvent_Consumer_Config_impl::start_conjunction_group\n")); - - this->qos_.start_conjunction_group (size); - } - - void - RTEvent_Consumer_Config_impl::start_disjunction_group (CORBA::Long size) - { - // Note, since we only support basic builder here... - if (size == 0L) - { - this->qos_.start_disjunction_group (); - } - else - { - this->qos_.start_disjunction_group (size); - } - } - - void - RTEvent_Consumer_Config_impl::insert_source (const char * source_id) - { - ACE_Hash<ACE_CString> hasher; - RtecEventComm::EventSourceID int_source_id = hasher (source_id); - - ACE_DEBUG ((LM_DEBUG, "******* the source string is: %s\n", source_id)); - ACE_DEBUG ((LM_DEBUG, "******* the source id is: %i\n", int_source_id)); - - this->qos_.insert_source (int_source_id, 0); - } - - void - RTEvent_Consumer_Config_impl::insert_type (CORBA::Long event_type) - { - if (event_type == 0L) - { - this->qos_.insert_type (ACE_ES_EVENT_ANY, 0); - } - else - { - this->qos_.insert_type (event_type, 0); - } - } - - void - RTEvent_Consumer_Config_impl::consumer_id (const char * consumer_id) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "RTEvent_Consumer_Config_impl::set_consumer_id:%s\n", - consumer_id)); - } - - this->consumer_id_ = consumer_id; - } - - void - RTEvent_Consumer_Config_impl::consumer ( - Components::EventConsumerBase_ptr consumer) - { - this->consumer_ = Components::EventConsumerBase::_duplicate (consumer); - } - - CONNECTION_ID - RTEvent_Consumer_Config_impl::consumer_id (void) - { - return CORBA::string_dup (this->consumer_id_.c_str ()); - } - - EventServiceType - RTEvent_Consumer_Config_impl::service_type (void) - { - return this->service_type_; - } - - Components::EventConsumerBase_ptr - RTEvent_Consumer_Config_impl::consumer (void) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, - "RTEvent_Consumer_Config_impl::get_consumer\n")); - } - - return Components::EventConsumerBase::_duplicate (this->consumer_.in ()); - } - - RtecEventChannelAdmin::ConsumerQOS * - RTEvent_Consumer_Config_impl::rt_event_qos (void) - { - RtecEventChannelAdmin::ConsumerQOS * consumer_qos = 0; - ACE_NEW_RETURN (consumer_qos, - RtecEventChannelAdmin::ConsumerQOS ( - this->qos_.get_ConsumerQOS ()), - 0); - - return consumer_qos; - } - - void - RTEvent_Consumer_Config_impl::destroy (void) - { - if (CIAO::debug_level () > 10) - { - ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::destroy\n")); - } - - PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); - this->poa_->deactivate_object (oid); - this->_remove_ref (); - } -} diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.h b/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.h deleted file mode 100644 index 270c8c80d5e..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.h +++ /dev/null @@ -1,283 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file CIAO_RTEvent.h - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards <g.edwards@vanderbilt.edu> - */ -//============================================================================= - -#ifndef CIAO_RTEVENT_H -#define CIAO_RTEVENT_H - -#include /**/ "ace/pre.h" - -#include "CIAO_RTEVENT_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CIAO_RTEventS.h" - -#include "ciaosvcs/Events/CIAO_Events_Base/CIAO_EventServiceBase.h" - -#include "orbsvcs/orbsvcs/Event_Utilities.h" -#include "orbsvcs/orbsvcs/Event/EC_Event_Channel.h" -#include "orbsvcs/orbsvcs/Event/EC_Default_Factory.h" -#include "orbsvcs/Event/ECG_Mcast_EH.h" -#include "orbsvcs/Event/ECG_UDP_Sender.h" -#include "orbsvcs/Event/ECG_UDP_Receiver.h" -#include "orbsvcs/Event/ECG_UDP_EH.h" - -namespace CIAO -{ - /** - * @class RTEventService - * - * An implementation of EventServiceBase using the RT event channel. - * - * @@ (GD) There should be a place where the deployment tool could - * specify the RT Event Channel service configuration file. - * This should be the place where the RtecEventChannel servant was - * first time initialized. - */ - class CIAO_RTEVENT_Export RTEventService - : public virtual EventServiceBase, - public virtual POA_CIAO::CIAO_RT_Event_Service - { - public: - RTEventService (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - const char * ec_name); - - virtual ~RTEventService (void); - - virtual Supplier_Config_ptr create_supplier_config (void); - virtual Consumer_Config_ptr create_consumer_config (void); - - virtual void connect_event_supplier ( - CIAO::Supplier_Config_ptr supplier_config); - - virtual void connect_event_consumer ( - CIAO::Consumer_Config_ptr consumer_config); - - virtual void disconnect_event_supplier (const char * consumer_id); - virtual void disconnect_event_consumer (const char * connection_id); - - virtual void push_event (Components::EventBase * ev); - - virtual void ciao_push_event (Components::EventBase * evt, - const char * source_id, - CORBA::TypeCode_ptr tc); - - virtual ::CORBA::Boolean create_addr_serv (const char * name, - ::CORBA::UShort port, - const char * address); - - virtual ::CORBA::Boolean create_sender (const char * addr_serv_id); - - virtual ::CORBA::Boolean create_receiver (const char * addr_serv_id, - ::CORBA::Boolean is_multicast, - ::CORBA::UShort listen_port); - - virtual - ::RtecEventChannelAdmin::EventChannel_ptr tao_rt_event_channel (void); - - private: - // @@ (GD) This is the place where use could provide a parameter - // which specifies the event channel service configuration file. - void create_rt_event_channel (const char * ec_name); - - private: - /// Reference to the ORB - CORBA::ORB_var orb_; - - /// Reference to the Root POA - PortableServer::POA_var root_poa_; - - /** - * @var RtecEventChannelAdmin::EventChannel_var rt_event_channel_ - * - * Reference to the RT event channel. - */ - RtecEventChannelAdmin::EventChannel_var rt_event_channel_; - - /** - * @var ACE_Hash_Map_Manager<> proxy_supplier_map_ - * - * Mapping of each event sink to a proxy supplier for disconnect purposes. - */ - ACE_Hash_Map_Manager_Ex<ACE_CString, - RtecEventChannelAdmin::ProxyPushConsumer_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - proxy_consumer_map_; - - /** - * @var ACE_Hash_Map_Manager<> proxy_supplier_map_ - * - * Mapping of each event sink to a proxy supplier for disconnect purposes. - */ - ACE_Hash_Map_Manager_Ex<ACE_CString, - RtecEventChannelAdmin::ProxyPushSupplier_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - proxy_supplier_map_; - - /** - * @var ACE_Hash_Map_Manager<> addr_serv_map_ - * - * A map which managers a set of address servers for event channel - * federation purpose. - */ - ACE_Hash_Map_Manager_Ex<ACE_CString, - RtecUDPAdmin::AddrServer_var, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> - addr_serv_map_; - }; - - /** - * @class RTEventServiceSupplier_impl - * - * An implementation of the PushSupplier interface. - */ - class RTEventServiceSupplier_impl - : public virtual POA_RtecEventComm::PushSupplier - { - public: - RTEventServiceSupplier_impl (PortableServer::POA_ptr poa); - - virtual void disconnect_push_supplier (void); - - private: - PortableServer::POA_var poa_; - }; - - /** - * @class RTEventServiceConsumer_impl - * - * An implementation of the PushConsumer interface. - */ - class RTEventServiceConsumer_impl - : public virtual POA_RtecEventComm::PushConsumer - { - public: - RTEventServiceConsumer_impl (PortableServer::POA_ptr poa, - Components::EventConsumerBase_ptr consumer); - - virtual void push (const RtecEventComm::EventSet& events); - - virtual void disconnect_push_consumer (void); - - private: - PortableServer::POA_var poa_; - - Components::EventConsumerBase_var event_consumer_; - }; - - /** - * @class RTEvent_Consumer_Config_impl - * - * Implementation of the RTEvent_Consumer_Config IDL interface that - * configures TAO's RT event channel. An object of this type will be returned - * from @c CIAO::Container::create_consumer_config () when @c RTEC is - * specified as the event service type. - */ - class RTEvent_Consumer_Config_impl - : public virtual POA_CIAO::RTEvent_Consumer_Config, - public virtual Event_Consumer_Config_Base - { - public: - RTEvent_Consumer_Config_impl (PortableServer::POA_ptr poa); - - virtual ~RTEvent_Consumer_Config_impl (void); - - virtual void start_conjunction_group (CORBA::Long size); - - virtual void start_disjunction_group (CORBA::Long size); - - virtual void insert_source (const char * source_id); - - virtual void insert_type (::CORBA::Long event_type); - - virtual void consumer_id (const char * consumer_id); - - virtual CONNECTION_ID consumer_id (); - - virtual void consumer (Components::EventConsumerBase_ptr consumer); - - virtual Components::EventConsumerBase_ptr consumer (); - - virtual EventServiceType service_type (); - - //@@ (GD) There should be a place where the deployment tool could - // set up the rt_event_qos properties for Consumer Config. - - virtual RtecEventChannelAdmin::ConsumerQOS * rt_event_qos (void); - - virtual void destroy (void); - - private: - ACE_CString consumer_id_; - - Components::EventConsumerBase_var consumer_; - - EventServiceType service_type_; - - ACE_ConsumerQOS_Factory qos_; - - PortableServer::POA_var poa_; - }; - - /** - * @class RTEvent_Supplier_Config_impl - * - * Implementation of the RTEvent_Supplier_Config IDL interface that - * configures TAO's RT event channel. An object of this type will be returned - * from @c CIAO::Container::create_supplier_config () when @c RTEC is - * specified as the event service type. - */ - class RTEvent_Supplier_Config_impl - : public virtual POA_CIAO::RTEvent_Supplier_Config - { - public: - RTEvent_Supplier_Config_impl (PortableServer::POA_ptr poa); - - virtual ~RTEvent_Supplier_Config_impl (void); - - void supplier_id (const char * supplier_id); - - CONNECTION_ID supplier_id (void); - - EventServiceType service_type (void); - - //@@ (GD) There should be a place where the deployment tool could - // set up the rt_event_qos properties for Supplier Config. - - RtecEventChannelAdmin::SupplierQOS * rt_event_qos (void); - - virtual void destroy (void); - - private: - ACE_CString supplier_id_; - - EventServiceType service_type_; - - ACE_SupplierQOS_Factory qos_; - - PortableServer::POA_var poa_; - }; -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_RTEVENT_H */ diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl b/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl deleted file mode 100644 index 072bf1f89a1..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -/** - * @file CIAO_RTEvent.idl - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - * @author George Edwards - * - * @brief Interfaces for configuring CIAO's RT event channel. - */ - -#include <ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl> -#include <orbsvcs/orbsvcs/RtecEventChannelAdmin.idl> - -module CIAO -{ - interface RTEvent_Consumer_Config : - Consumer_Config - { - //void start_logical_and_group (in long size); - - //void start_negation (); - - //void insert_bitmasked_value (in long source_mask, - // in long type_mask, - // in long source_value, - // in long type_value); - - readonly attribute RtecEventChannelAdmin::ConsumerQOS rt_event_qos; - }; - - interface RTEvent_Supplier_Config : - Supplier_Config - { - readonly attribute RtecEventChannelAdmin::SupplierQOS rt_event_qos; - }; - - interface CIAO_RT_Event_Service : - CIAO_Event_Service - { - boolean create_addr_serv (in string name, - in unsigned short port, - in string address); - - boolean create_sender (in string addr_serv_id); - - boolean create_receiver (in string addr_serv_id, - in boolean is_multicast, - in unsigned short listen_port); - - RtecEventChannelAdmin::EventChannel tao_rt_event_channel (); - }; - -}; diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.mpc b/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.mpc deleted file mode 100644 index 9fb0ca78c19..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.mpc +++ /dev/null @@ -1,28 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project (CIAO_RTEvent) : naming, rtevent_serv, ciao_events_base_dnc, ace_output { - sharedname = CIAO_RTEvent - idlflags += -Wb,export_include=CIAO_RTEVENT_Export.h \ - -Wb,export_macro=CIAO_RTEVENT_Export - dynamicflags = CIAO_RTEVENT_BUILD_DLL - - IDL_Files { - CIAO_RTEvent.idl - } - - Source_Files { - CIAO_RTEvent.cpp - CIAO_RTEventC.cpp - CIAO_RTEventS.cpp - SimpleAddressServer.cpp - } - - Header_Files { - CIAO_RTEvent.h - CIAO_RTEventC.h - CIAO_RTEventS.h - CIAO_RTEVENT_Export.h - SimpleAddressServer.h - } -} diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp deleted file mode 100644 index 266e535072c..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ */ - -#include "SimpleAddressServer.h" - -#include <ace/INET_Addr.h> - -SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) -{ -#if defined (ACE_HAS_IPV6) - if (address.get_type() == PF_INET6) - { - RtecUDPAdmin::UDP_Addr_v6 v6; - sockaddr_in6 *in6 = - reinterpret_cast<sockaddr_in6 *>(address.get_addr()); - ACE_OS::memcpy (v6.ipaddr,&in6->sin6_addr,16); - v6.port = address.get_port_number(); - this->address_.v6_addr (v6); - return; - } -#endif /* ACE_HAS_IPV6 */ - RtecUDPAdmin::UDP_Addr v4; - v4.ipaddr = address.get_ip_address (); - v4.port = address.get_port_number (); - this->address_.v4_addr (v4); -} - -SimpleAddressServer::SimpleAddressServer (const RtecUDPAdmin::UDP_Addr& addr) -{ - this->address_.v4_addr (addr); -} - -void -SimpleAddressServer::get_addr (const RtecEventComm::EventHeader&, - RtecUDPAdmin::UDP_Addr& address) -{ - if (this->address_._d( ) == RtecUDPAdmin::Rtec_inet6) - { - throw CORBA::DATA_CONVERSION (0, CORBA::COMPLETED_YES); - } - - address = this->address_.v4_addr (); -} - -void -SimpleAddressServer::get_address (const RtecEventComm::EventHeader&, - RtecUDPAdmin::UDP_Address_out address) -{ - address = this->address_; -} diff --git a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h b/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h deleted file mode 100644 index 84df8020618..00000000000 --- a/CIAO/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h +++ /dev/null @@ -1,35 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SimpleAddressServer.h - * - * $Id$ - * - * @author Gan Deng <dengg@dre.vanderbilt.edu> - */ -//============================================================================= - -#ifndef SIMPLEADDRESSSERVER_H -#define SIMPLEADDRESSSERVER_H - -#include <orbsvcs/RtecUDPAdminS.h> - -class SimpleAddressServer : public POA_RtecUDPAdmin::AddrServer -{ -public: - SimpleAddressServer (const ACE_INET_Addr& address); - - SimpleAddressServer (const RtecUDPAdmin::UDP_Addr& addr); - - virtual void get_addr (const RtecEventComm::EventHeader& header, - RtecUDPAdmin::UDP_Addr& address); - - virtual void get_address (const RtecEventComm::EventHeader& header, - RtecUDPAdmin::UDP_Address_out address); - -private: - RtecUDPAdmin::UDP_Address address_; -}; - -#endif diff --git a/CIAO/docs/CIAO_Style_Guide.txt b/CIAO/docs/CIAO_Style_Guide.txt new file mode 100644 index 00000000000..28c3245bc76 --- /dev/null +++ b/CIAO/docs/CIAO_Style_Guide.txt @@ -0,0 +1,60 @@ +Error/Debug messages +======================== +ciao_debug_level () and associated environment are no longer used. +Instead, there are error message levels, in order from least to most +severe: + +LM_TRACE +LM_DEBUG +LM_INFO +LM_NOTICE +LM_WARNING +LM_ERROR +LM_CRITICAL +LM_ALERT +LM_EMERGENCY + +Please use the full range. Severity LM_TRACE through LM_NOTICE should +use ACE_DEBUG. LM_WARNING through LM_EMERGENCY should use ACE_ERROR. + +The verbosity of the logging output, i.e. which severity of logging +messages are output, is configured at runtime from the command line of +any CIAO executable with --log-level. + +Examples of usage: +LM_TRACE should be used for gratuitous tracing flow of execution +messages, and insignificant debug values. Feel free to be as detailed +as possible here, the purpose is to make our lives easier when users +are having problems. LM_DEBUG should be used to report significant +debugging values and configuration parameters. LM_INFO should be used +to report subactions (e.g. activiation of ports, establishment of +connections), and LM_NOTICE should be used to report significant +actions (e.g., component installation complete, container creation). + +Debug messages should begin with "ClassName::MethodName - ". +There is a macro in CIAO_common.h called CLINFO. This macro expands +to a set of default log message decorators, and should be prepended to +any and all debug messages and error messages, e.g.: + +ACE_DEBUG((LM_INFO, CLINFO + "Servant_Activator::etherialize - Your message here")); + +It is VERY IMPORTANT to follow this format for EVERY MESSAGE to make +it easier to filter and make sense of logging output. + +All methods (no exceptions!) must have a CIAO_TRACE statement at the +beginning. + +Memory Allocation +======================= +All calls to allocate memory should use ACE_NEW_THROW_EX with +CORBA::NO_MEMORY, e.g.: + +ACE_NEW_THROW_EX(pointer_var, constructor, CORBA::NO_MEMORY); + +Locking +======================= +Use gards as much as possible, using the _THROW_EX versions of the +acquisition macros throwing CORBA::NO_RESOURCES. + + diff --git a/CIAO/docs/TODO.html b/CIAO/docs/TODO.html index 0b7ff8fd774..77a80edcdbc 100644 --- a/CIAO/docs/TODO.html +++ b/CIAO/docs/TODO.html @@ -90,19 +90,6 @@ accomplishment) : to inform the components that the configuration is infact complete. (ETA - 2004/09)</li><p> - <li> We have now two proprietary methods in the <CODE> - SessionComponent </CODE> interface called <CODE> ciao_preactivate () - </CODE> and <CODE> ciao_postactivate () </CODE> which has to be - overridden by the executor code irrespective of whether the executor - implements them or not. These were added to help components to know - activation status of other components in the assembly. This could - create problems for interoperability of the executor code. A better - to way is to have the CIDL generate C++ code instead of executor IDL. - The generated C++ code from the CIDL could provide default - implementations which could be overridden by the executor code if so - desired. This would make the executor code more portable. Obviously - we also should retain executor IDL generation using some command line - options. (ETA - 2004/09). </li> <p> <li> Need to develop tools that would allow components to be added dynamically to an existing assembly and remove components diff --git a/CIAO/docs/schema/Basic_Deployment_Data.xsd b/CIAO/docs/schema/Basic_Deployment_Data.xsd index c857bd54858..9588919909a 100644 --- a/CIAO/docs/schema/Basic_Deployment_Data.xsd +++ b/CIAO/docs/schema/Basic_Deployment_Data.xsd @@ -2,8 +2,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" targetNamespace="http://www.omg.org/Deployment"> + <xsd:import namespace="http://www.omg.org/XMI" + schemaLocation="XMI.xsd" /> + + <xsd:complexType name="IdRef"> + <xsd:attributeGroup ref="xmi:LinkAttribs" /> + </xsd:complexType> + <xsd:simpleType name="TCKind"> <xsd:restriction base="xsd:NCName"> <xsd:enumeration value="tk_null"/> @@ -54,6 +62,7 @@ <xsd:element name="struct" type="Deployment:StructType"/> <xsd:element name="value" type="Deployment:ValueType"/> <xsd:element name="sequence" type="Deployment:SequenceType"/> + <xsd:element name="alias" type="Deployment:AliasType"/> </xsd:choice> <!-- @@ -63,11 +72,11 @@ <xsd:element name="boundedString" type="Deployment:BoundedStringType"/> <xsd:element name="fixed" type="Deployment:FixedType"/> <xsd:element name="array" type="Deployment:ArrayType"/> - <xsd:element name="alias" type="Deployment:AliasType"/> + <xsd:element name="union" type="Deployment:UnionType"/> --> </xsd:sequence> - <xsd:attribute name="id" type="xsd:ID"/> + <xsd:attribute ref="xmi:id" /> </xsd:complexType> <xsd:complexType name="DataValue"> @@ -90,7 +99,7 @@ <!-- <xsd:element name="fixed" type="xsd:string"/> --> <!-- <xsd:element name="any" type="Deployment:Any"/> --> <!-- <xsd:element name="typecode" type="Deployment:DataType"/> --> - <!-- <xsd:element name="element" type="Deployment:DataValue"/> --> + <xsd:element name="element" type="Deployment:DataValue"/> <!-- <xsd:element name="discriminator" type="Deployment:DataValue"/> --> <!-- <xsd:element name="value" type="Deployment:DataValue"/> --> <!-- <xsd:element name="boxedValue" type="Deployment:DataValue"/> --> @@ -98,6 +107,14 @@ </xsd:choice> </xsd:complexType> + <xsd:complexType name="AliasType"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="typeId" type="xsd:string"/> + <xsd:element name="elementType" type="Deployment:DataType"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="EnumType"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> @@ -148,7 +165,7 @@ <xsd:complexType name="SequenceType"> <xsd:sequence> - <xsd:element name="bound" type="xsd:string" minOccurs="0" /> + <xsd:element name="bound" type="xsd:unsignedInt" minOccurs="0" /> <xsd:element name="elementType" type="Deployment:DataType"/> </xsd:sequence> </xsd:complexType> @@ -225,18 +242,18 @@ <xsd:element name="deployRequirement" type="Deployment:Requirement" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="deployedResource" type="Deployment:ResourceDeploymentDescription" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> - <xsd:attribute name="id" type="xsd:ID"/> + <xsd:attribute ref="xmi:id" /> </xsd:complexType> <xsd:complexType name="MonolithicDeploymentDescription"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="source" type="xsd:string" maxOccurs="unbounded"/> - <xsd:element name="artifact" type="xsd:IDREF" maxOccurs="unbounded"/> <!-- ArtifactDeploymentDescription --> + <xsd:element name="artifact" type="Deployment:IdRef" maxOccurs="unbounded"/> <!-- ArtifactDeploymentDescription --> <xsd:element name="execParameter" type="Deployment:Property" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="deployRequirement" type="Deployment:Requirement" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> - <xsd:attribute name="id" type="xsd:ID"/> + <xsd:attribute ref="xmi:id" /> </xsd:complexType> <xsd:simpleType name="ResourceUsageKind"> @@ -263,12 +280,12 @@ <xsd:element name="name" type="xsd:string"/> <xsd:element name="node" type="xsd:string"/> <xsd:element name="source" type="xsd:string"/> - <xsd:element name="implementation" type="xsd:IDREF"/> <!-- MonolithicDeploymentDescription --> + <xsd:element name="implementation" type="Deployment:IdRef"/> <!-- MonolithicDeploymentDescription --> <xsd:element name="configProperty" type="Deployment:Property" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="deployedResource" type="Deployment:InstanceResourceDeploymentDescription" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="deployedSharedResource" type="Deployment:InstanceResourceDeploymentDescription" minOccurs="0"/> </xsd:sequence> - <xsd:attribute name="id" type="xsd:ID"/> + <xsd:attribute ref="xmi:id" /> </xsd:complexType> <xsd:simpleType name="CCMComponentPortKind"> @@ -314,13 +331,16 @@ <xsd:element name="portName" type="xsd:string"/> <xsd:element name="provider" type="xsd:string" minOccurs="0"/> <xsd:element name="kind" type="Deployment:CCMComponentPortKind"/> - <xsd:element name="instance" type="xsd:IDREF"/> <!-- InstanceDeploymentDescription --> + <xsd:element name="instance" type="Deployment:IdRef"/> <!-- InstanceDeploymentDescription --> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ExternalReferenceEndpoint"> <xsd:sequence> <xsd:element name="location" type="xsd:string"/> + <xsd:element name="provider" type="xsd:boolean"/> + <xsd:element name="portName" type="xsd:string" minOccurs="0" /> + <xsd:element name="supportedType" type="xsd:string" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> @@ -372,18 +392,10 @@ </xsd:sequence> </xsd:complexType> - <xsd:complexType name="ComponentPackageReference"> - <xsd:sequence> - <xsd:element name="requiredUUID" type="xsd:string" minOccurs="0" /> - <xsd:element name="requiredName" type="xsd:string" minOccurs="0" /> - <xsd:element name="requiredType" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="SubcomponentPortEndpoint"> <xsd:sequence> <xsd:element name="portName" type="xsd:string"/> - <xsd:element name="instance" type="xsd:IDREF"/> <!-- SubcomponentInstantiationDescription --> + <xsd:element name="instance" type="Deployment:IdRef"/> <!-- SubcomponentInstantiationDescription --> </xsd:sequence> </xsd:complexType> @@ -397,4 +409,19 @@ </xsd:sequence> </xsd:complexType> + <xsd:simpleType name="PlanLocalityKind"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="SameProcess"/> + <xsd:enumeration value="DifferentProcess"/> + <xsd:enumeration value="NoConstraint"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:complexType name="PlanLocality"> + <xsd:sequence> + <xsd:element name="constraint" type="Deployment:PlanLocalityKind"/> + <xsd:element name="constrainedInstance" type="Deployment:IdRef"/> <!-- InstanceDeploymentDescription --> + </xsd:sequence> + </xsd:complexType> + </xsd:schema> diff --git a/CIAO/docs/schema/CIAOEvents.txt b/CIAO/docs/schema/CIAOEvents.txt deleted file mode 100644 index d5aae8b8bc3..00000000000 --- a/CIAO/docs/schema/CIAOEvents.txt +++ /dev/null @@ -1,339 +0,0 @@ - How to integrate TAO Real-Time Event Service into CIAO deployments - -To integrate the TAO Real-Time Event Service into a CIAO application, you -need to use a CIAO-specific extension type of XML descriptor to "describe" -how your Real-Time Event Service should be configured. - -An XML file with the ending extension called .ced (CIAO Events Descriptor) -which contains information about the configurations of EventService is -used for such a purpose. Once the .ced file defines the details of -the event service configurations, this file can be referenced within a -deployment plan descriptor (.cdp), which defines how CCM components -can use such services. - -1. A Simple Example - -Below "ciao-events-example.ced" file shows a simple example, which can -be found at $CIAO_ROOT/examples/Hello/descriptor_events/ciao-events-example.ced - - <CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>svc.conf</svc_cfg_file> - </eventServiceConfiguration> - </CIAO:CIAOEvents> - -The fields of the <eventServiceConfiguration> element are described below: - -- <name> identifier for this real-time event service, which can be later - referenced in a deployment plan. -- <node> node name of the node in the deloyment plan, where the - EventService is running on. The node name should correspond - to one of the node names given in the deployment plan descriptor. - -- <type> type of the event channel, possible values are: - EC - CORBA Event Service - RTEC - TAO Real-Time Event Service - NOTIFY - CORBA Notification Service - RTNOTIFY - TAO Real-Time Notification Service - - Currently only the RTEC type is implemented. - -- <svc_cfg_file> path to the service configuration file, which configures the Event Service. - -To integrate this information into the deployemnt plan, you have to -add the following XML description to the end of the deployment plan. -An example of this can be found at -$CIAO_ROOT/examples/Hello/descriptor_events/flattened_deploymentplan_events.cdp - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example.ced</string> - </value> - </value> - - </infoProperty> - -The string value has to contain the concrete filename of the.ced file. -A conventional connection between two event ports looks like the following -in the deployment plan: - - <connection> - <name>click_out_click_in</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -This has to be changed to achieve a connection through an EventService. -Assuming there should be an event connection between the port -"click_out" of the component "Hello-Sender" and the port -"click_in" of the component "Hello-Receiver". Two connections -have to be declared in the deployment plan: -One from the "click_out" port to the external EventService and -one from the "click_in" port to the same event EventService. - -The following example shows how this looks like in practice: - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - -Note that the value of the <location> elemnt of the <externalReference> -corresponds to the <name> element in the .ced file. - -At deployment time, you can use the plan_launcher utility to specify -the .cdp file, and DAnCE will automatically find the .ced file, parse it -and then do all the event service installation and configuration for you. - -2. More Complex Examples - -This example will show some additional QoS configurations, including -event filtering and event channel federation. - -2.1 Event Filtering Configuration - -CIAO event service allows event filtering based on event source id, i.e., -one can configure that one event sink is only receiving events -published from particular event sources. - -An example of such a configuration can be found at: - -$CIAO_ROOT/examples/Hello/descriptors_events/ciao-events-example-with-filters.ced - -For example, below configuration illustrates that an event filter named -<my_filter_01> is a DISJUNCTION type of filter, and it refereces to two -event ports: <Hello-Sender-idd_click_out> and <Hello-Sender-idd-02_click_out>. -The <Hello-Sender-idd_click_out> port means an event source port is on the -<Hello-Sender-idd> component instance with port name <click_out>. Likewise, -the <Hello-Sender-idd-02_click_out> port means an event source port on the -<Hello-Sender-idd-02> component with port name <click_out>. - -The general way, <source> names are put together is, to use the elements -<instance id="INSTANCE-ID"> and the -<connection><internalEndpoint><portName>PORT-NAME</...> -of the .cdp file and combine them by a "_" character, like this: -<source>INSTANCE-ID_PORT-NAME</source>. This assures, that every source is -identified by a unique name. - - <filter> - <name>my_filter_01</name> - <type>DISJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - <source>Hello-Sender-idd-02_click_out</source> - </filter> - -DISJUNCTION filter type can also reference to one event source, which means -the filter will accept events published from this particular event source only. -An example of such a configuration is shown below: - - <filter> - <name>my_filter_02</name> - <type>DISJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - </filter> - -Similarly, in constrast fo the DISJUNCTION type of filter, -one can also configure CONJUNCTION type of filers, as shown below: - - <filter> - <name>my_filter_03</name> - <type>CONJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - <source>Hello-Sender-idd-02_click_out</source> - </filter> - -Currently CONJUNCTION and DISJUNCTION filters are implemented. -NEGATION filters can be added in the future. -The "Logical AND" filter does not apply to the CIAO event service, -because the bit-mask mechanism does not conform to the level of abstraction -of the CCM. - -Of course, once you define event filters, these filters can be referenced -in a deployment plan descriptor (.cdp). For example, in below deployment -plan descriptor: - -$CIAO_ROOT/examples/Hello/descriptor_events/flattened_deploymentplan_with_filters.cdp - -One can define an event filtering mechanism like this: - - <connection> - <name>hello_event_ec_consumer_connection</name> - - <!-- The position of the below "deployRequirement" element matters --> - <deployRequirement> - <resourceType>EventFilter</resourceType> - <name>my_filter_01</name> - <property> - <name>EventFilter</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>my_filter_01</string> - </value> - </value> - </property> - </deployRequirement> - - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - -As we can see, the <deployRequirement> XML tag can refer a named event -filter defined in the .ced file. - -2.2 Event Channel Federation Configuration - -CIAO event service allows event channels to be federated through -event channel gateways. An example of this can be found at: - -$CIAO_ROOT/examples/Hello/descriptors_events/ciao-events-federation-mcast.ced - -In this example, two real-time event channels are defined, ES_01 and ES_02. -ES_01 is associated with a UDP Sender gateway object, and ES_02 is associated -with a UDP Receiver gatway object. Once ES_01 receives an event, it will -try to forward this event to other event channels through its UDP Sender gatway -object. - -When defining a UDP Sender gatway object, the remote event channel's host name -and port name must be defined, which is through an XML tag called <addr_serv>. -In our example, we use the multicast address 224.9.9.2. - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>224.9.9.2</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - -Likewise, when defining a UDP Receiver gatway object, we need to define -the actual address server, which has an IP address and port number, which -is illustrated in the below <addr_serv> XML element. Once this XML element -is defined, it can be referenced in the <udp_receiver> element as shown -below. The <udp_receiver> element also defines whether this is a muticast -or not through the <is_multicast> XML tag, and defines a <listen_port> -for its event handler. In practice, this <listen_port> is redundant to the -the <port> defined in the <addr_serv>. -The port number is only necessary for unicast connections. For multicast -connections, no port number needs to be given (neither in the <addr_serv> -field nor in the <listen_port> field). - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>224.9.9.2</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>true</is_multicast> - - <!-- Listen port for this EC's event handler --> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - -Note that for now, only UDP federation (either unicast or multicast) is supported. -CORBA gateway federation is not implemented for CIAO. - -Once the event channel federation configuration is defined in the .ced -file, the majority of the configuration effort is done. The rest of the -thing is quite simple, as shown in the below deployment plan descriptor: - -$CIAO_ROOT/examples/Hello/descriptor_events/flattened_deploymentplan_federation_mcast.cdp - -Basically, you only need to describe which event channels you want to -connect to (e.g., ES_01 or ES_02), as illustrated below, and that's it. - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - -The connection between the two event channels is set up, by only using the -addresses in the .ced file. It is transparent for the .cdp file, how the -event channels are federated. diff --git a/CIAO/docs/schema/Deployment.xsd b/CIAO/docs/schema/Deployment.xsd index fd4ffe5bc7d..591aa588d74 100644 --- a/CIAO/docs/schema/Deployment.xsd +++ b/CIAO/docs/schema/Deployment.xsd @@ -18,7 +18,7 @@ <!-- Top-level elements. --> <xsd:element name="domain" type="Deployment:Domain"/> - <xsd:element name="deploymentPlan" type="Deployment:DeploymentPlan"/> + <xsd:element name="DeploymentPlan" type="Deployment:deploymentPlan"/> <xsd:element name="implementationArtifactDescription" type="Deployment:ImplementationArtifactDescription" /> <xsd:element name="componentInterfaceDescription" type="Deployment:ComponentInterfaceDescription"/> <xsd:element name="componentImplementationDescription" type="Deployment:ComponentImplementationDescription"/> diff --git a/CIAO/docs/schema/Spec_Defined_XMI.xsd b/CIAO/docs/schema/Spec_Defined_XMI.xsd index f4adac91934..eac893f37c8 100644 --- a/CIAO/docs/schema/Spec_Defined_XMI.xsd +++ b/CIAO/docs/schema/Spec_Defined_XMI.xsd @@ -1,35 +1,35 @@ <?xml version="1.0" ?> <xsd:schema targetNamespace="http://www.omg.org/XMI" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'> - <xsd:attribute name="id" type="xsd:ID" /> - <xsd:attributeGroup name="IdentityAttribs"> - <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" /> - </xsd:attributeGroup> - <xsd:attributeGroup name="LinkAttribs"> - <xsd:attribute name="href" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" /> - </xsd:attributeGroup> - <xsd:attributeGroup name="ObjectAttribs"> - <xsd:attributeGroup ref="xmi:IdentityAttribs" /> - <xsd:attributeGroup ref="xmi:LinkAttribs" /> - <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" /> - </xsd:attributeGroup> - <xsd:complexType name="Extension"> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:any processContents="lax" /> - </xsd:choice> - <xsd:attribute ref="xmi:id" /> - <xsd:attributeGroup ref="xmi:ObjectAttribs" /> - <xsd:attribute name="extender" type="xsd:string" use="optional" /> - <xsd:attribute name="extenderID" type="xsd:string" use="optional" /> - </xsd:complexType> - <xsd:element name="Extension" type="xmi:Extension" /> - <xsd:complexType name="Any"> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:any processContents="skip" /> - </xsd:choice> - <xsd:anyAttribute processContents="skip" /> - </xsd:complexType> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'> + <xsd:attribute name="id" type="xsd:ID" /> + <xsd:attributeGroup name="IdentityAttribs"> + <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="LinkAttribs"> + <xsd:attribute name="href" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="ObjectAttribs"> + <xsd:attributeGroup ref="xmi:IdentityAttribs" /> + <xsd:attributeGroup ref="xmi:LinkAttribs" /> + <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" /> + </xsd:attributeGroup> + <xsd:complexType name="Extension"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="lax" /> + </xsd:choice> + <xsd:attribute ref="xmi:id" /> + <xsd:attributeGroup ref="xmi:ObjectAttribs" /> + <xsd:attribute name="extender" type="xsd:string" use="optional" /> + <xsd:attribute name="extenderID" type="xsd:string" use="optional" /> + </xsd:complexType> + <xsd:element name="Extension" type="xmi:Extension" /> + <xsd:complexType name="Any"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="skip" /> + </xsd:choice> + <xsd:anyAttribute processContents="skip" /> + </xsd:complexType> </xsd:schema> diff --git a/CIAO/docs/schema/XMI.xsd b/CIAO/docs/schema/XMI.xsd new file mode 100644 index 00000000000..afb17f9d3b5 --- /dev/null +++ b/CIAO/docs/schema/XMI.xsd @@ -0,0 +1,39 @@ +<?xml version="1.0" ?> +<!-- This is a slightly modified XMI schema that has some elements not currently supported by XSC commented out --> +<xsd:schema targetNamespace="http://www.omg.org/XMI" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'> + <xsd:attribute name="id" type="xsd:ID" /> + <xsd:attributeGroup name="IdentityAttribs"> + <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="LinkAttribs"> + <xsd:attribute name="href" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="ObjectAttribs"> + <xsd:attributeGroup ref="xmi:IdentityAttribs" /> + <xsd:attributeGroup ref="xmi:LinkAttribs" /> + <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" /> + <!-- <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" /> --> + </xsd:attributeGroup> + <xsd:complexType name="Extension"> +<!-- <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="lax" /> + </xsd:choice> --> + <xsd:attribute ref="xmi:id" /> + <xsd:attributeGroup ref="xmi:ObjectAttribs" /> + <xsd:attribute name="extender" type="xsd:string" use="optional" /> + <xsd:attribute name="extenderID" type="xsd:string" use="optional" /> + </xsd:complexType> + <xsd:element name="extension" type="xmi:Extension" /> +<!-- <xsd:complexType name="Any"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="skip" /> + </xsd:choice> + <xsd:anyAttribute processContents="skip" /> + </xsd:complexType> --> +</xsd:schema> diff --git a/CIAO/docs/schema/cdp.xsd b/CIAO/docs/schema/cdp.xsd index 4fa69acd3fe..2b798f3e43e 100644 --- a/CIAO/docs/schema/cdp.xsd +++ b/CIAO/docs/schema/cdp.xsd @@ -5,13 +5,13 @@ targetNamespace="http://www.omg.org/Deployment"> <xsd:include schemaLocation="ccd.xsd" /> - - <xsd:complexType name="DeploymentPlan"> + <!-- Note: name deploymentPlan should be DeploymentPlan, this is a hack to make XSC happy --> + <xsd:complexType name="deploymentPlan"> <xsd:sequence> - <xsd:element name="label" type="xsd:string" minOccurs="0"/> + <xsd:element name="label" type="xsd:string" minOccurs="0"/> <xsd:element name="UUID" type="xsd:string" minOccurs="0"/> <xsd:element name="realizes" type="Deployment:ComponentInterfaceDescription" minOccurs="0" /> - <xsd:element name="implementation" type="Deployment:MonolithicDeploymentDescription" maxOccurs="unbounded" /> + <xsd:element name="implementation" type="Deployment:MonolithicDeploymentDescription" minOccurs="0" maxOccurs="unbounded" /> <xsd:element name="instance" type="Deployment:InstanceDeploymentDescription" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="connection" type="Deployment:PlanConnectionDescription" minOccurs="0" maxOccurs="unbounded"/> <!-- potentially recursive, not used @@ -19,7 +19,8 @@ --> <xsd:element name="dependsOn" type="Deployment:ImplementationDependency" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="artifact" type="Deployment:ArtifactDeploymentDescription" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="infoProperty" type="Deployment:Property" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="infoProperty" type="Deployment:Property" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="localityConstraint" type="Deployment:PlanLocality" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> diff --git a/CIAO/docs/schema/cid.xsd b/CIAO/docs/schema/cid.xsd index d01247061d3..fdcd66c3044 100644 --- a/CIAO/docs/schema/cid.xsd +++ b/CIAO/docs/schema/cid.xsd @@ -9,6 +9,14 @@ <xsd:include schemaLocation="iad.xsd" /> <xsd:include schemaLocation="pcd.xsd" /> <xsd:include schemaLocation="cpd.xsd" /> + + <xsd:complexType name="ComponentPackageReference"> + <xsd:sequence> + <xsd:element name="requiredUUID" type="xsd:string" minOccurs="0" /> + <xsd:element name="requiredName" type="xsd:string" minOccurs="0" /> + <xsd:element name="requiredType" type="Deployment:ComponentInterfaceDescription"/> + </xsd:sequence> + </xsd:complexType> <xsd:complexType name="SubcomponentInstantiationDescription"> <xsd:sequence> @@ -26,7 +34,7 @@ <xsd:complexType name="SubcomponentPropertyReference"> <xsd:sequence> <xsd:element name="propertyName" type="xsd:string"/> - <xsd:element name="instance" type="xsd:IDREF"/> + <xsd:element name="instance" type="Deployment:IdRef"/> </xsd:sequence> </xsd:complexType> diff --git a/CIAO/docs/tutorials/Quoter/Simple/01.html b/CIAO/docs/tutorials/Quoter/Simple/01.html index 1ea57484540..6b3cdf7c50f 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/01.html +++ b/CIAO/docs/tutorials/Quoter/Simple/01.html @@ -1,421 +1,222 @@ <!-- $Id$ --> -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" - xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns="http://www.w3.org/TR/REC-html40"> - <head> - <title>Getting Started</title> - <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> - <meta name="ProgId" content="Word.Document"> - <meta name="Generator" content="Microsoft Word 11"> - <meta name="Originator" content="Microsoft Word 11"> - <link rel="File-List" href="01_files/filelist.xml"> - <link rel="Edit-Time-Data" href="01_files/editdata.mso"> <!--[if !mso]> -<STYLE> -v\:* {behavior:url(#default#VML);} -o\:* {behavior:url(#default#VML);} -w\:* {behavior:url(#default#VML);} -.shape {behavior:url(#default#VML);} -</STYLE> -<![endif]--> <!--[if gte mso 9]><xml> - <o:DocumentProperties> - <o:Author>Abdullah Sowayan</o:Author> - <o:LastAuthor>Abdullah Sowayan</o:LastAuthor> - <o:Revision>24</o:Revision> - <o:TotalTime>250</o:TotalTime> - <o:Created>2006-10-09T18:21:00Z</o:Created> - <o:LastSaved>2007-03-08T01:16:00Z</o:LastSaved> - <o:Pages>1</o:Pages> - <o:Words>878</o:Words> - <o:Characters>5011</o:Characters> - <o:Company>Maritime Systems & Sensors</o:Company> - <o:Lines>41</o:Lines> - <o:Paragraphs>11</o:Paragraphs> - <o:CharactersWithSpaces>5878</o:CharactersWithSpaces> - <o:Version>11.5606</o:Version> - </o:DocumentProperties> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:WordDocument> - <w:ValidateAgainstSchemas/> - <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> - <w:IgnoreMixedContent>false</w:IgnoreMixedContent> - <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> - <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> - </w:WordDocument> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> - </w:LatentStyles> -</xml><![endif]--> - <style> <!-- /* Font Definitions */ @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:1627421319 -2147483648 8 0 66047 0;} - /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - h3 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:3; font-size:13.5pt; font-family:"Times New Roman"; font-weight:bold;} - a:link, span.MsoHyperlink {color:#000FFF; text-decoration:underline; text-underline:single;} - a:visited, span.MsoHyperlinkFollowed {color:#FF0F0F; text-decoration:underline; text-underline:single;} - p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - address {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; font-style:italic;} - code {font-family:"Courier New"; mso-ascii-font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:"Courier New"; mso-bidi-font-family:"Courier New";} - p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-noshow:yes; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:8.0pt; font-family:Tahoma; mso-fareast-font-family:"Times New Roman";} - @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} - div.Section1 {page:Section1;} - /* List Definitions */ @list l0 {mso-list-id:137387275; mso-list-type:hybrid; mso-list-template-ids:268987612 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l0:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.75in; mso-level-number-position:left; margin-left:.75in; text-indent:-.25in; font-family:Symbol;} - @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1 {mso-list-id:425031842; mso-list-type:hybrid; mso-list-template-ids:158504358 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l1:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:1.75in; mso-level-number-position:left; margin-left:1.75in; text-indent:-.25in; font-family:Symbol;} - @list l1:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2 {mso-list-id:632565866; mso-list-type:hybrid; mso-list-template-ids:542421050 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l2:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:1.25in; mso-level-number-position:left; margin-left:1.25in; text-indent:-.25in; font-family:Symbol;} - @list l2:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3 {mso-list-id:974944555; mso-list-type:hybrid; mso-list-template-ids:1880366448 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l3:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:1.25in; mso-level-number-position:left; margin-left:1.25in; text-indent:-.25in; font-family:Symbol;} - @list l3:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4 {mso-list-id:1876190917; mso-list-type:hybrid; mso-list-template-ids:-767374784 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l4:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:1.75in; mso-level-number-position:left; margin-left:1.75in; text-indent:-.25in; font-family:Symbol;} - @list l4:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - ol {margin-bottom:0in;} - ul {margin-bottom:0in;} - --></style> - <!--[if gte mso 10]> +<html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>Getting Started</title> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style> - /* Style Definitions */ - table.MsoNormalTable - {mso-style-name:"Table Normal"; - mso-tstyle-rowband-size:0; - mso-tstyle-colband-size:0; - mso-style-noshow:yes; - mso-style-parent:""; - mso-padding-alt:0in 5.4pt 0in 5.4pt; - mso-para-margin:0in; - mso-para-margin-bottom:.0001pt; - mso-pagination:widow-orphan; - font-size:10.0pt; +<!-- +@font-face { +font-family:Tahoma; +panose-1:2 11 6 4 3 5 4 4 2 4; +} +h3 { + font-size:13.5pt; font-family:"Times New Roman"; - mso-ansi-language:#0400; - mso-fareast-language:#0400; - mso-bidi-language:#0400;} + font-weight:bold; +} +a:link, span.MsoHyperlink { + color:#000FFF; + text-decoration:underline; + text-underline:single; +} +a:visited, span.MsoHyperlinkFollowed { + color:#FF0F0F; + text-decoration:underline; + text-underline:single; +} +p { + font-size:12.0pt; + font-family:"Times New Roman"; +} +address { + font-size:12.0pt; + font-family:"Times New Roman"; + font-style:italic; +} +code { + font-family:"Courier New"; +} +p.MsoAcetate, li.MsoAcetate, div.MsoAcetate { + font-size:8.0pt; + font-family:Tahoma; +} +div.Section1 { + page:Section1 +} +--> </style> -<![endif]--> <!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp --> <!--[if gte mso 9]><xml> - <o:shapedefaults v:ext="edit" spidmax="10242"/> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <o:shapelayout v:ext="edit"> - <o:idmap v:ext="edit" data="1"/> - </o:shapelayout></xml><![endif]--> - </head> - <body bgcolor="white" lang="EN-US" link="#000fff" vlink="#ff0f0f" style='tab-interval: -.5in'> - <h3 align="center" style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%; TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'>Step 1: Define your interfaces and -component types<o:p></o:p></span></h3> - <h3 align="center" style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%; TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'><img width="447" height="350" id="_x0000_i1025" src="images/step1.jpg"><o:p></o:p> - </span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='COLOR:black'><o:p> </o:p> - </span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>Please make sure to read the following article to under -the Stock Quoter system architecture before delving further into the tutorial:<o:p></o:p></span></h3> - <p style='MARGIN:0in 0in 0pt 0.75in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; mso-list:l0 level1 lfo2; tab-stops:list .75in' - class="Section1"><![if !supportLists]><span style='FONT-FAMILY:Symbol; -mso-fareast-font-family:Symbol; -mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> -</span></span> - </span><![endif]><a href="http://www.cuj.com/documents/s=9152/cujexp0404vinoski/">The - CORBA Component Model, Part 2: Defining Components with the IDL 3.x Types</a></p> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><o:p> </o:p> - </span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%'>Directory Structure:<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>The tutorial relies on the following directory -structure. Create Quoter and all its subdirectories as shown below. We will -describe the purpose of these directories later in the tutorial.<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; TEXT-INDENT:0.5in; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>Quoter<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><span style='mso-spacerun:yes'> -</span>|---- descriptors<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><span style='mso-spacerun:yes'> -</span>|---- Stock_Base<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><span style='mso-spacerun:yes'> -</span>|---- Distributor<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><span style='mso-spacerun:yes'> -</span>|---- Broker<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'><o:p> </o:p> - </span></h3> - <h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%'>Preliminaries:<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt 0.75in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; mso-list:l0 level1 lfo2; tab-stops:list .75in' - class="Section1"><![if !supportLists]><span style='FONT-WEIGHT:normal; +<!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp --> +</head> +<body bgcolor="#FFFFFF" lang="EN-US" link="#000fff" vlink="#ff0f0f"> +<h3 align="center" style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%; TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'>Step 1: Define your interfaces and + component types</span></h3> +<h3 align="center" style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%; TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'><img width="447" height="350" id="_x0000_i1025" src="images/step1.jpg"> </span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='COLOR:black'> </span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>Please make sure to read the following article to under + the Stock Quoter system architecture before delving further into the tutorial:</span></h3> +<p style='MARGIN:0in 0in 0pt 0.75in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; ' + class="Section1"><span style='FONT-FAMILY:Symbol; +'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><a href="http://www.cuj.com/documents/s=9152/cujexp0404vinoski/">The + CORBA Component Model, Part 2: Defining Components with the IDL 3.x Types</a></p> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> </span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%'>Directory Structure:</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>The tutorial relies on the following directory + structure. Create Quoter and all its subdirectories as shown below. We will + describe the purpose of these directories later in the tutorial.</span></h3> +<h3 style='MARGIN:0in 0in 0pt; TEXT-INDENT:0.5in; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>Quoter</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> |---- descriptors</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> |---- Stock_Base</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> |---- Distributor</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> |---- Broker</span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'> </span></h3> +<h3 style='MARGIN:0in 0in 0pt; LINE-HEIGHT:150%' class="Section1"><span style='FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%'>Preliminaries:</span></h3> +<h3 style='MARGIN:0in 0in 0pt 0.75in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; ' + class="Section1"><span style='FONT-WEIGHT:normal; FONT-SIZE:12pt; COLOR:black; LINE-HEIGHT:150%; FONT-FAMILY:Symbol; -mso-fareast-font-family:Symbol; -mso-bidi-font-family:Symbol; -mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> -</span></span> - </span><![endif]><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>We use the Make -Project Creator (MPC) throughout this tutorial. Understanding MPC will aid you -in understanding this tutorial. For more information on MPC please look at the -following:<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt 1.5in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; mso-list:l0 level3 lfo2; tab-stops:list 1.5in' - class="Section1"><![if !supportLists]><span style='FONT-WEIGHT:normal; +'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>We use the Make + Project Creator (MPC) throughout this tutorial. Understanding MPC will aid you + in understanding this tutorial. For more information on MPC please look at the + following:</span></h3> +<h3 style='MARGIN:0in 0in 0pt 1.5in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; ' + class="Section1"><span style='FONT-WEIGHT:normal; FONT-SIZE:12pt; COLOR:black; LINE-HEIGHT:150%; -mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>1.<span style="FONT:7pt 'Times New Roman'"> -</span></span> - </span><![endif]><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>MPC <a href="http://downloads.ociweb.com/MPC/MakeProjectCreator.pdf">Chapter</a> in -TAO’s Developer’s Guide 1.4a.<o:p></o:p></span></h3> - <h3 style='MARGIN:0in 0in 0pt 1.5in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; mso-list:l0 level3 lfo2; tab-stops:list 1.5in' - class="Section1"><![if !supportLists]><span style='FONT-WEIGHT:normal; +'>1.<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>MPC <a href="http://downloads.ociweb.com/MPC/MakeProjectCreator.pdf">Chapter</a> in + TAO’s Developer’s Guide 1.4a.</span></h3> +<h3 style='MARGIN:0in 0in 0pt 1.5in; TEXT-INDENT:-0.25in; LINE-HEIGHT:150%; ' + class="Section1"><span style='FONT-WEIGHT:normal; FONT-SIZE:12pt; COLOR:black; LINE-HEIGHT:150%; -mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>2.<span style="FONT:7pt 'Times New Roman'"> -</span></span> - </span><![endif]><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;mso-bidi-font-weight:bold'>$ACE_ROOT/MPC/README<o:p></o:p></span></h3> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><b><span style='COLOR:black'>Interface -Design:</span></b><span style='COLOR:black'><o:p></o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.75in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l0 level1 lfo2;tab-stops:list .75in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>In the <i style='mso-bidi-font-style:normal'>Quoter/<span style='mso-bidi-font-style:italic'>Stock_Base </span></i><span style='mso-bidi-font-style:italic'>sub-</span>directory, place an idl file </span><code><i><span style='FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:150%'>Stock_Base.idl</span></i></code><span style='COLOR:black'> that you could copy from <a href="Stock_Base/Stock_Base.idl">here</a> . This file defines the interfaces -and events that will be used by both StockDistributor and StockBroker components. We put -together the common interface definitions so the base library can be shared by -both components, reducing the size of "real" components.<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.75in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l0 level1 lfo2;tab-stops:list .75in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file -to generate the make files for us. From the <i style='mso-bidi-font-style:normal'>Quoter/<span style='mso-bidi-font-style:italic'>Stock_Base</span></i><span style='mso-bidi-font-style: -italic'> subdirectory, type the following command:</span><o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"> -generate_component_mpc.pl –n Stock_Base<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span><span style='COLOR:black;mso-bidi-font-style:italic'> </span><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.75in;LINE-HEIGHT:150%'><span style='COLOR:black;mso-bidi-font-style:italic'>The command above will generate -a <i>Stock_Base.mpc</i> file that contains two projects <i>Stock_Base_stub </i>and -<i>Stock_Base_skel </i>for the Stub and Servant code respectively. In addition, -the command above will generate export files that will portably handle platform -specific issues of import/export declarations of dynamically linked libraries -(DLLs). After executing the command above you should see the following output -on your screen.<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic">The -following commands have been executed:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCK_BASE_STUB > Stock_Base_stub_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCK_BASE_SKEL > Stock_Base_skel_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.75in;TEXT-INDENT:-1.25in;LINE-HEIGHT:150%;mso-list:l1 level1 lfo4;tab-stops:list .75in 1.75in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-style:italic'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-style:italic'>The MPC file should look like <a href="Stock_Base/Stock_Base.mpc">this</a>. </span><span style="COLOR: +'>2.<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='FONT-WEIGHT:normal;FONT-SIZE:12pt;COLOR:black;LINE-HEIGHT:150%;'>$ACE_ROOT/MPC/README</span></h3> +<p style='LINE-HEIGHT:150%'><b><span style='COLOR:black'>Interface + Design:</span></b><span style='COLOR:black'> </span></p> +<p style='MARGIN-LEFT:0.75in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>In the <i>Quoter/Stock_Base </i>sub-directory, place an idl file </span><code><i><span style='FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:150%'>Stock_Base.idl</span></i></code><span style='COLOR:black'> that you could copy from <a href="Stock_Base/Stock_Base.idl">here</a> . This file defines the interfaces + and events that will be used by both StockDistributor and StockBroker components. We put + together the common interface definitions so the base library can be shared by + both components, reducing the size of "real" components.</span></p> +<p style='MARGIN-LEFT:0.75in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file + to generate the make files for us. From the <i>Quoter/Stock_Base</i> subdirectory, type the following command:</span></p> +<p style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_component_mpc.pl –n Stock_Base</span></p> +<p style='MARGIN-LEFT:0.75in;LINE-HEIGHT:150%'><span style='COLOR:black;'>The command above will generate + a <i>Stock_Base.mpc</i> file that contains two projects <i>Stock_Base_stub </i>and <i>Stock_Base_skel </i>for the Stub and Servant code respectively. In addition, + the command above will generate export files that will portably handle platform + specific issues of import/export declarations of dynamically linked libraries + (DLLs). After executing the command above you should see the following output + on your screen.</span></p> +<p style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; ">The + following commands have been executed:</span></p> +<p style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCK_BASE_STUB > Stock_Base_stub_export.h</span></p> +<p style='MARGIN-LEFT:0.5in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCK_BASE_SKEL > Stock_Base_skel_export.h</span></p> +<p style='MARGIN-LEFT:1.75in;TEXT-INDENT:-1.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>The MPC file should look like <a href="Stock_Base/Stock_Base.mpc">this</a>. </span><span style="COLOR: black; FONT-FAMILY: -'Courier New'; mso-bidi-font-style: -italic"><o:p></o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><b><span style='COLOR:black'>Component -Design:</span></b><span style='COLOR:black'><o:p></o:p> - </span></p> - <p class="MsoNormal" style='TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><b style='mso-bidi-font-weight:normal'><span style='COLOR:black'>Distributor:</span></b><span style='COLOR:black'> <o:p></o:p></span></p> - <![if !supportLists]> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l3 level1 lfo6;tab-stops:list 1.25in'><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>In the </span><code><i><span style='FONT-SIZE:10pt; +'Courier New'; "> </span></p> +<p style='LINE-HEIGHT:150%'><b><span style='COLOR:black'>Component + Design:</span></b><span style='COLOR:black'> </span></p> +<p style='TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><b><span style='COLOR:black'>Distributor:</span></b><span style='COLOR:black'> </span></p> +<p style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>In the </span><code><i><span style='FONT-SIZE:10pt; COLOR:black; -LINE-HEIGHT:150%'>Quoter/Distributor </span></i></code><code><span style="COLOR:black;LINE-HEIGHT:150%;FONT-FAMILY:'Times New Roman';mso-bidi-font-style:italic;mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt">sub-directory</span></code><span style='COLOR:black'>, place an idl file </span><code><i><span style='FONT-SIZE: +LINE-HEIGHT:150%'>Quoter/Distributor </span></i></code><code><span style="COLOR:black;LINE-HEIGHT:150%;FONT-FAMILY:'Times New Roman';">sub-directory</span></code><span style='COLOR:black'>, place an idl file </span><code><i><span style='FONT-SIZE: 10pt;COLOR: black;LINE-HEIGHT: 150%'>StockDistributor.idl</span></i></code><span style='COLOR:black'> that looks like <a href="Distributor/StockDistributor.idl">this</a>. -This file defines the StockDistributor component interfaces.<o:p></o:p><![if - !supportLists]></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l3 level1 lfo6;tab-stops:list 1.25in'><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file -to generate the make files for us. From the <i style='mso-bidi-font-style:normal'>Quoter/<span style='mso-bidi-font-style:italic'>Distributor </span></i><span style='mso-bidi-font-style:italic'><span style='mso-spacerun:yes'> </span>sub-directory, type the following -command</span></span></p> - <P class="MsoNormal" style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"> - <o:p>generate_component_mpc.pl -p Stock_Base -c -StockDistributorDriver StockDistributor</o:p> - </SPAN></P> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:1.25in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p></o:p> - </span> </p> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;LINE-HEIGHT:150%'><span style='COLOR:black;mso-bidi-font-style:italic'>The command above takes a few optional parameter. The -p -option states that the <FONT face="Courier" size="2">StockDistributor</FONT> -component has a dependency on <FONT face="Courier" size="2">Stock_Base<FONT face="Times New Roman" size="3">, - the -c option causes the script to generates make files for a simple driver - program. In this tutorial, we use a simple driver program to demonstrate how a - non-CCM applications can interact with Components.</FONT></FONT></span></p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; mso-bidi-font-style: italic"></SPAN> </P> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; mso-bidi-font-style: italic">The command above will generate -a <i>StockDistirubotor.mpc</i> file that -contains several projects that will build the Stub, Servant, and Executor -code respectively. In addition, the command above will generate export files -that will portably handle platform specific issues of import/export -declarations of dynamically linked libraries (DLLs). After executing the command -above you should see the following output on your screen.<o:p></o:p></SPAN></P> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic">The -following commands have been executed:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKDISTRIBUTOR_STUB > StockDistributor_stub_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKDISTRIBUTOR_SVNT > StockDistributor_svnt_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKDISTRIBUTOR_EXEC > -StockDistributor_exec_export.h</span></p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.5in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'; mso-bidi-font-style: italic"></SPAN> </P> - <SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'; mso-bidi-font-style: italic"> - <o:p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 150%; mso-list: l4 level1 lfo8; tab-stops: list 1.25in 1.75in"><SPAN style="COLOR: black; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-bidi-font-style: italic"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'"> -</SPAN></SPAN> - </SPAN><SPAN style="COLOR: black; mso-bidi-font-style: italic">Next we write a simple driver -program (<CODE><I><SPAN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 150%">StockDistributorDriver.cpp)</SPAN></I></CODE> -that will control the <FONT face="Courier" size="2">StockDistributor</FONT> -component. The simple driver program controls when the <FONT face="Courier" size="2">StockDistributor </FONT>component publishes stock quotes, the rates of -publication, and when publication of stock quotes stops. The simple driver -program should look like </SPAN><SPAN style="COLOR: black; mso-bidi-font-style: italic"><A href="Distributor/StockDistributorDriver.cpp">this</A>. </SPAN></P> - </o:p> - </SPAN> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><o:p></o:p> - </span></p> - <![if !supportLists]> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l4 level1 lfo8;tab-stops:list 1.25in 1.75in'><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-style:italic'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-style:italic'>The -generated </span><span style='COLOR:black;mso-bidi-font-style:italic'> MPC file should -look like <a href="Distributor/StockDistributor.mpc">this</a>. </span></p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 150%; mso-list: l4 level1 lfo8; tab-stops: list 1.25in 1.75in"><SPAN style="COLOR: black; mso-bidi-font-style: italic"></SPAN> </P> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><o:p></o:p> - </span></p> - <p class="MsoNormal" style='TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><b style='mso-bidi-font-weight:normal'><span style='COLOR:black'>Broker:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l2 level1 lfo10;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>In the </span><code><i><span style='FONT-SIZE:10pt; + This file defines the StockDistributor component interfaces. </span></p> +<p style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file + to generate the make files for us. From the <i>Quoter/Distributor </i><span> </span>sub-directory, type the following + command</span></p> +<P style="MARGIN-LEFT: 0.5in; TEXT-INDENT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"> generate_component_mpc.pl -p Stock_Base -c + StockDistributorDriver StockDistributor </SPAN></P> +<p style='MARGIN-LEFT:1.25in;LINE-HEIGHT:150%'><span style='COLOR:black;'>The command above takes a few optional parameter. The -p + option states that the <FONT face="Courier" size="2">StockDistributor</FONT> component has a dependency on <FONT face="Courier" size="2">Stock_Base<FONT face="Times New Roman" size="3">, + the -c option causes the script to generates make files for a simple driver + program. In this tutorial, we use a simple driver program to demonstrate how a + non-CCM applications can interact with Components.</FONT></FONT></span></p> +<P style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; ">The command above will generate + a <i>StockDistirubotor.mpc</i> file that + contains several projects that will build the Stub, Servant, and Executor + code respectively. In addition, the command above will generate export files + that will portably handle platform specific issues of import/export + declarations of dynamically linked libraries (DLLs). After executing the command + above you should see the following output on your screen.</SPAN></P> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; ">The + following commands have been executed:</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKDISTRIBUTOR_STUB > StockDistributor_stub_export.h</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKDISTRIBUTOR_SVNT > StockDistributor_svnt_export.h</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKDISTRIBUTOR_EXEC > + StockDistributor_exec_export.h</span></p> +<SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'; "> +<P style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 150%; "><SPAN style="COLOR: black; FONT-FAMILY: Symbol; ">·<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN> </SPAN><SPAN style="COLOR: black; ">Next we write a simple driver + program (<CODE><I><SPAN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 150%">StockDistributorDriver.cpp)</SPAN></I></CODE> that will control the <FONT face="Courier" size="2">StockDistributor</FONT> component. The simple driver program controls when the <FONT face="Courier" size="2">StockDistributor </FONT>component publishes stock quotes, the rates of + publication, and when publication of stock quotes stops. The simple driver + program should look like </SPAN><SPAN style="COLOR: black; "><A href="Distributor/StockDistributorDriver.cpp">this</A>. </SPAN></P> +</SPAN> +<p style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>The + generated </span><span style='COLOR:black;'> MPC file should + look like <a href="Distributor/StockDistributor.mpc">this</a>. </span></p> +<p style='TEXT-INDENT:0.5in;LINE-HEIGHT:150%'><b><span style='COLOR:black'>Broker:</span></b></p> +<p style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>In the </span><code><i><span style='FONT-SIZE:10pt; COLOR:black; -LINE-HEIGHT:150%'>Quoter/Broker</span></i></code><span style='COLOR:black'> <code><span style="LINE-HEIGHT:150%;FONT-FAMILY:'Times New Roman';mso-bidi-font-style:italic;mso-ansi-font-size:12.0pt;mso-bidi-font-size:12.0pt">sub-directory,</span></code> -place an idl file </span><code><i><span style='FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:150%'>StockBroker.id</span></i></code><code><span style='FONT-SIZE:10pt; +LINE-HEIGHT:150%'>Quoter/Broker</span></i></code><span style='COLOR:black'> <code><span style="LINE-HEIGHT:150%;FONT-FAMILY:'Times New Roman';">sub-directory,</span></code> place an idl file </span><code><i><span style='FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:150%'>StockBroker.id</span></i></code><code><span style='FONT-SIZE:10pt; COLOR:black; LINE-HEIGHT:150%'>l</span></code><span style='COLOR:black'> that -looks like <a href="Broker/StockBroker.idl">this</a>. This file defines the -StockBroker component interface.<b style='mso-bidi-font-weight:normal'><o:p></o:p></b></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;mso-list:l2 level1 lfo10;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file -to generate the make files for us. From the <i style='mso-bidi-font-style:normal'>Quoter/<span style='mso-bidi-font-style:italic'>Broker</span></i><span style='mso-bidi-font-style: -italic'> sub-directory, type the following command:</span><o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:1.25in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'"> - <o:p> - <SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"> - <o:p>generate_component_mpc.pl --p Stock_Base -c StockBrokerDriver StockBroker</o:p> - </SPAN> - </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:1.25in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;LINE-HEIGHT:150%'><span style='COLOR:black;mso-bidi-font-style:italic'><SPAN style="COLOR: black; mso-bidi-font-style: italic">The -command above takes a few optional parameter. The -p option states that the -<FONT face="Courier" size="2">StockBroker</FONT> component has a dependency on <FONT face="Courier" size="2">Stock_Base<FONT face="Times New Roman" size="3">, - the -c option causes the script to generates make files for a simple driver - program. In this tutorial, we use a simple driver program to demonstrate how a - non-CCM applications can interact with Components.</FONT></FONT></SPAN> - </span></p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; mso-bidi-font-style: italic"><SPAN style="COLOR: black; mso-bidi-font-style: italic"></SPAN> - </SPAN> </P> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; mso-bidi-font-style: italic"><SPAN style="COLOR: black; mso-bidi-font-style: italic">The command above will -generate a <I>StockBroker.mpc</I> file that contains several projects that -will build the Stub, Servant, and Executor code respectively. In addition, the -command above will generate export files that will portably handle platform -specific issues of import/export declarations of dynamically linked libraries -(DLLs). After executing the command above you should see the following output on -your screen.</SPAN> - </SPAN></P> - <p class="MsoNormal" style='MARGIN-LEFT:1.25in;TEXT-INDENT:0.75in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic">The -following commands have been executed:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKBROKER_STUB > StockBroker_stub_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKBROKER_SVNT > StockBroker_svnt_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic"><span style='mso-spacerun:yes'> -</span>generate_export_file.pl STOCKBROKER_EXEC > StockBroker_exec_export.h<o:p></o:p></span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><o:p> </o:p> - </span><span style='COLOR:black'></p> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 150%; mso-list: l4 level1 lfo8; tab-stops: list 1.25in 1.75in"><SPAN style="COLOR: black; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-bidi-font-style: italic"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'"> -</SPAN></SPAN> - </SPAN><SPAN style="COLOR: black; mso-bidi-font-style: italic">Next we write a simple driver -program (<CODE><I><SPAN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 150%">StockBrokerDriver.cpp)</SPAN></I></CODE> -that would control the <FONT face="Courier" size="2">StockBroker</FONT> component. -The simple driver program controls what stocks the <FONT face="Courier" size="2">StockBroker </FONT>component subscribes to. The simple driver program -should look like </SPAN><SPAN style="COLOR: black; mso-bidi-font-style: italic"><A href="Broker/StockBrokerDriver.cpp">this</A>. </SPAN></P> - <P class="MsoNormal" style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"> - <o:p></o:p></SPAN></P> - <p class="MsoNormal" style='MARGIN-LEFT:1.75in;TEXT-INDENT:-0.75in;LINE-HEIGHT:150%;mso-list:l4 level1 lfo8;tab-stops:list 1.25in 1.75in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-style:italic'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-style:italic'><SPAN style="COLOR: black; mso-bidi-font-style: italic">The generated </SPAN><SPAN style="COLOR: black; mso-bidi-font-style: italic">MPC file should look like -</SPAN> - <a href="Broker/StockBroker.mpc">this</a>. </span><span style="COLOR: + looks like <a href="Broker/StockBroker.idl">this</a>. This file defines the + StockBroker component interface.</span></p> +<p style='MARGIN-LEFT:1.25in;TEXT-INDENT:-0.25in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Next, we need to create a Make Project Creator (MPC) file + to generate the make files for us. From the <i>Quoter/Broker</i> sub-directory, type the following command:</span></p> +<p style='MARGIN-LEFT:0.5in;TEXT-INDENT:1.25in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'"> <SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"> generate_component_mpc.pl + -p Stock_Base -c StockBrokerDriver StockBroker </SPAN> </span></p> +<p style='MARGIN-LEFT:1.25in;LINE-HEIGHT:150%'><span style='COLOR:black;'><SPAN style="COLOR: black; ">The + command above takes a few optional parameter. The -p option states that the <FONT face="Courier" size="2">StockBroker</FONT> component has a dependency on <FONT face="Courier" size="2">Stock_Base<FONT face="Times New Roman" size="3">, + the -c option causes the script to generates make files for a simple driver + program. In this tutorial, we use a simple driver program to demonstrate how a + non-CCM applications can interact with Components.</FONT></FONT></SPAN> </span></p> +<P style="MARGIN-LEFT: 1.25in; LINE-HEIGHT: 150%"><SPAN style="COLOR: black; "><SPAN style="COLOR: black; ">The command above will + generate a <I>StockBroker.mpc</I> file that contains several projects that + will build the Stub, Servant, and Executor code respectively. In addition, the + command above will generate export files that will portably handle platform + specific issues of import/export declarations of dynamically linked libraries + (DLLs). After executing the command above you should see the following output on + your screen.</SPAN> </SPAN></P> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; ">The + following commands have been executed:</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKBROKER_STUB > StockBroker_stub_export.h</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKBROKER_SVNT > StockBroker_svnt_export.h</span></p> +<p style='MARGIN-LEFT:1.5in;LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> generate_export_file.pl STOCKBROKER_EXEC > StockBroker_exec_export.h</span></p> +<P style="MARGIN-LEFT: 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: 150%; "><SPAN style="COLOR: black; FONT-FAMILY: Symbol; ">·<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN> </SPAN><SPAN style="COLOR: black; ">Next we write a simple driver + program (<CODE><I><SPAN style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 150%">StockBrokerDriver.cpp)</SPAN></I></CODE> that would control the <FONT face="Courier" size="2">StockBroker</FONT> component. + The simple driver program controls what stocks the <FONT face="Courier" size="2">StockBroker </FONT>component subscribes to. The simple driver program + should look like </SPAN><SPAN style="COLOR: black; "><A href="Broker/StockBrokerDriver.cpp">this</A>. </SPAN></P> +<p style='MARGIN-LEFT:1.75in;TEXT-INDENT:-0.75in;LINE-HEIGHT:150%;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'><SPAN style="COLOR: black; ">The generated </SPAN><SPAN style="COLOR: black; ">MPC file should look like </SPAN> <a href="Broker/StockBroker.mpc">this</a>. </span><span style="COLOR: black; FONT-FAMILY: -'Courier New'; mso-bidi-font-style: -italic"><o:p></o:p> - </span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><br> - <b style='mso-bidi-font-weight:normal'>Note:<o:p></o:p></b></span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'>To -understand the meaning of different parameters passed to </span><span style="COLOR:black; FONT-FAMILY:'Courier New'">generate_component_mpc.pl<span style='mso-bidi-font-style:italic'></span></span><span style='COLOR:black; -mso-bidi-font-style:italic'>click <a href="../../../generate_component_mpc.html">here</a> -or type the</span><span style='COLOR:black'> following command:<o:p></o:p></span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'">generate_component_mpc.pl<span style='mso-bidi-font-style:italic'> --h</span></span><span style='COLOR:black'><br style='mso-special-character: -line-break'><![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'><![endif]><o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'><a href="index.html">Previous</a><span style='mso-tab-count: -8'> </span> - <a href="02.html">Next</a><o:p></o:p> - </span></p> - <div class="MsoNormal" align="center" style='LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <DIV class="Section1"> - <address style='LINE-HEIGHT:150%'><span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming - Xiong<br> - </a> - </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a></address> - <ADDRESS style="LINE-HEIGHT: 150%"> </ADDRESS> - <ADDRESS style="LINE-HEIGHT: 150%">$Id$</ADDRESS> - </DIV> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><o:p> </o:p> - </span></p> - </body> +'Courier New'; "> </span></p> +<p style='LINE-HEIGHT:150%'><span style='COLOR:black'><br> + <b>Note:</b></span></p> +<p style='LINE-HEIGHT:150%'><span style='COLOR:black'>To + understand the meaning of different parameters passed to </span><span style="COLOR:black; FONT-FAMILY:'Courier New'">generate_component_mpc.pl</span><span style='COLOR:black; +'>click <a href="../../../generate_component_mpc.html">here</a> or type the</span><span style='COLOR:black'> following command:</span></p> +<p style='LINE-HEIGHT:150%'><span style="COLOR:black; FONT-FAMILY:'Courier New'">generate_component_mpc.pl -h</span><span style='COLOR:black'><br> + <br> + </span></p> +<p align="center" style='LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'><a href="index.html">Previous</a> <a href="02.html">Next</a> </span></p> +<div align="center" style='LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> +<DIV class="Section1"> + <address style='LINE-HEIGHT:150%'> + <span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming + Xiong<br> + </a> </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a> + </address> + <ADDRESS style="LINE-HEIGHT: 150%"> + + </ADDRESS> + <ADDRESS style="LINE-HEIGHT: 150%"> + $Id$ + </ADDRESS> +</DIV> +</body> </html> diff --git a/CIAO/docs/tutorials/Quoter/Simple/02.html b/CIAO/docs/tutorials/Quoter/Simple/02.html index 2a5a0f20a1c..36417b6da43 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/02.html +++ b/CIAO/docs/tutorials/Quoter/Simple/02.html @@ -1,202 +1,107 @@ <!-- $Id$ --> -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" - xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns="http://www.w3.org/TR/REC-html40"> - <head> - <title>Getting Started</title> - <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> - <meta name="ProgId" content="Word.Document"> - <meta name="Generator" content="Microsoft Word 11"> - <meta name="Originator" content="Microsoft Word 11"> - <link rel="File-List" href="02_files/filelist.xml"> - <link rel="Edit-Time-Data" href="02_files/editdata.mso"> <!--[if !mso]> -<STYLE> -v\:* {behavior:url(#default#VML);} -o\:* {behavior:url(#default#VML);} -w\:* {behavior:url(#default#VML);} -.shape {behavior:url(#default#VML);} -</STYLE> -<![endif]--> <!--[if gte mso 9]><xml> - <o:DocumentProperties> - <o:Author>Abdullah Sowayan</o:Author> - <o:LastAuthor>Abdullah Sowayan</o:LastAuthor> - <o:Revision>11</o:Revision> - <o:TotalTime>90</o:TotalTime> - <o:Created>2006-10-09T19:28:00Z</o:Created> - <o:LastSaved>2007-03-08T01:17:00Z</o:LastSaved> - <o:Pages>1</o:Pages> - <o:Words>443</o:Words> - <o:Characters>2531</o:Characters> - <o:Company>Maritime Systems & Sensors</o:Company> - <o:Lines>21</o:Lines> - <o:Paragraphs>5</o:Paragraphs> - <o:CharactersWithSpaces>2969</o:CharactersWithSpaces> - <o:Version>11.5606</o:Version> - </o:DocumentProperties> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:WordDocument> - <w:ValidateAgainstSchemas/> - <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> - <w:IgnoreMixedContent>false</w:IgnoreMixedContent> - <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> - <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> - </w:WordDocument> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> - </w:LatentStyles> -</xml><![endif]--> - <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - h3 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:3; font-size:13.5pt; font-family:"Times New Roman";} - a:link, span.MsoHyperlink {color:#000FFF; text-decoration:underline; text-underline:single;} - a:visited, span.MsoHyperlinkFollowed {color:#FF0F0F; text-decoration:underline; text-underline:single;} - address {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman";} - code {font-family:"Courier New"; mso-ascii-font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:"Courier New"; mso-bidi-font-family:"Courier New";} - @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} - div.Section1 {page:Section1;} - /* List Definitions */ @list l0 {mso-list-id:555236070; mso-list-type:hybrid; mso-list-template-ids:2061531284 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} - @list l0:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:1.25in; mso-level-number-position:left; margin-left:1.25in; text-indent:-.25in; font-family:Symbol;} - @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - ol {margin-bottom:0in;} - ul {margin-bottom:0in;} - --></style> - <!--[if gte mso 10]> +<html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>Getting Started</title> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style> - /* Style Definitions */ - table.MsoNormalTable - {mso-style-name:"Table Normal"; - mso-tstyle-rowband-size:0; - mso-tstyle-colband-size:0; - mso-style-noshow:yes; - mso-style-parent:""; - mso-padding-alt:0in 5.4pt 0in 5.4pt; - mso-para-margin:0in; - mso-para-margin-bottom:.0001pt; - mso-pagination:widow-orphan; - font-size:10.0pt; +<!-- +h3 { + font-size:13.5pt; font-family:"Times New Roman"; - mso-ansi-language:#0400; - mso-fareast-language:#0400; - mso-bidi-language:#0400;} +} +a:link, span.MsoHyperlink { + color:#000FFF; + text-decoration:underline; + text-underline:single; +} +a:visited, span.MsoHyperlinkFollowed { + color:#FF0F0F; + text-decoration:underline; + text-underline:single; +} +address { + font-size:12.0pt; + font-family:"Times New Roman"; +} +code { + font-family:"Courier New"; +} +div.Section1 { + page:Section1 +} +--> </style> -<![endif]--> <!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp --> <!--[if gte mso 9]><xml> - <o:shapedefaults v:ext="edit" spidmax="5122"/> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <o:shapelayout v:ext="edit"> - <o:idmap v:ext="edit" data="1"/> - </o:shapelayout></xml><![endif]--> - </head> - <body bgcolor="white" lang="EN-US" link="#000fff" vlink="#ff0f0f" style='tab-interval: -.5in'> - <div class="Section1"> - <h3 align="center" style='MARGIN:0in 0in 0pt;LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'>Step 2: Implement your components<o:p></o:p></span></h3> - <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img width="634" height="376" id="_x0000_i1025" src="images/step2.jpg"><o:p></o:p> - </span></h3> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><b><span style='COLOR:black'>Writing -CIDL files:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Distributor:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'>In <i style='mso-bidi-font-style: -normal'>Quoter/Distributor </i>sub-directory, place a cidl file -StockDistributor.cidl that looks like <a href="Distributor/StockDistributor.cidl">this</a>. -<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'>The MPC files we generated -earlier automatically invoked the CIDLC compiler to generate the Servants, Executors, -and Contexts for us. To reduce the amount of work and typing we need to do, we -will next instruct the CIDLC compiler to generate an empty StockDistributor Executor -implementation (Object implementation in the figure above). In the <i style='mso-bidi-font-style:normal'>Quoter/Distributor - </i>sub-directory, type -the following:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.5in'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-weight:bold"> cidlc -I$TAO_ROOT -I$TAO_ROOT/tao --I$CIAO_ROOT/ciao --gen-exec-impl StockDistributor.cidl<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in'><span style='COLOR:black'>The above command will generate a -<i style='mso-bidi-font-style:normal'>StockDistributor_exec.h </i>and <i style='mso-bidi-font-style:normal'> - StockDistributor_exec.cpp </i>files. These -generated files greatly reduced the amount of work we do. We’ll edit -those files later in the tutorial to insert our business logic in the -Distributor component.<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in'><span style='COLOR:black'><o:p> </o:p> - </span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 0.5in'><b style='mso-bidi-font-weight:normal'><span style='COLOR:black'>Broker:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'>In <i style='mso-bidi-font-style: -normal'>Quoter/Broker </i>sub-directory, place a cidl file StockBroker.cidl that -looks like <a href="Broker/StockBroker.cidl">this</a>. <o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'> The MPC files we -generated earlier automatically invoked the CIDLC compiler to generate the -Servants, Executors, and Contexts for us. To reduce the amount of work and typing we -need to do, we will next instruct the CIDLC compiler to generate an empty StockBroker -Executor implementation (Object implementation in the figure above). In the <i style='mso-bidi-font-style:normal'>Quoter/Broker - </i>sub-directory, type the -following:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.5in'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-weight:bold">cidlc -I$TAO_ROOT --I$TAO_ROOT/tao -I$CIAO_ROOT/ciao --gen-exec-impl StockBroker.cidl<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in'><span style='COLOR:black'>The above command will generate a -<i style='mso-bidi-font-style:normal'>StockBroker_exec.h </i>and <i style='mso-bidi-font-style:normal'>StockBroker_exec.cpp - </i>files. These generated -files greatly reduced the amount of work we do. We’ll edit those files -later in the tutorial to insert our business logic in the Broker component.<o:p></o:p></span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'><br> - <b style='mso-bidi-font-weight:normal'>Note:<o:p></o:p></b></span></p> - <p class="MsoNormal" style='LINE-HEIGHT:150%'><span style='COLOR:black'>To -understand the meaning of different parameters passed to the CIDLC compiler -click <a href="../../../cidlc.html">here</a> or <span style='mso-bidi-font-style: -italic'>type the</span> following command:<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><span style="COLOR:black; FONT-FAMILY:'Courier New'; mso-bidi-font-style:italic">cidlc --h</span><span style='COLOR: +<!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp --> +</head> +<body bgcolor="#FFFFFF" lang="EN-US" link="#000fff" vlink="#ff0f0f"> +<div class="Section1"> + <h3 align="center" style='MARGIN:0in 0in 0pt;LINE-HEIGHT:150%;TEXT-ALIGN:center'><span style='COLOR:black'>Step 2: Implement your components</span></h3> + <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img width="634" height="376" id="_x0000_i1025" src="images/step2.jpg"> </span></h3> + <p style='MARGIN-BOTTOM:12pt'><b><span style='COLOR:black'>Writing + CIDL files:</span></b></p> + <p style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Distributor:</span></b></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>In <i>Quoter/Distributor </i>sub-directory, place a cidl file + StockDistributor.cidl that looks like <a href="Distributor/StockDistributor.cidl">this</a>. </span></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>The MPC files we generated + earlier automatically invoked the CIDLC compiler to generate the Servants, Executors, + and Contexts for us. To reduce the amount of work and typing we need to do, we + will next instruct the CIDLC compiler to generate an empty StockDistributor Executor + implementation (Object implementation in the figure above). In the <i>Quoter/Distributor </i>sub-directory, type + the following:</span></p> + <p style='MARGIN:0in 0in 12pt 1.5in'><span style="COLOR:black; FONT-FAMILY:'Courier New'; "> cidlc -I$TAO_ROOT -I$TAO_ROOT/tao + -I$CIAO_ROOT/ciao --gen-exec-impl StockDistributor.cidl</span></p> + <p style='MARGIN:0in 0in 12pt 1.25in'><span style='COLOR:black'>The above command will generate a <i>StockDistributor_exec.h </i>and <i> StockDistributor_exec.cpp </i>files. These + generated files greatly reduced the amount of work we do. We’ll edit + those files later in the tutorial to insert our business logic in the + Distributor component.</span></p> + <p style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Broker:</span></b></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>In <i>Quoter/Broker </i>sub-directory, place a cidl file StockBroker.cidl that + looks like <a href="Broker/StockBroker.cidl">this</a>. </span></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'> The MPC files we + generated earlier automatically invoked the CIDLC compiler to generate the + Servants, Executors, and Contexts for us. To reduce the amount of work and typing we + need to do, we will next instruct the CIDLC compiler to generate an empty StockBroker + Executor implementation (Object implementation in the figure above). In the <i>Quoter/Broker </i>sub-directory, type the + following:</span></p> + <p style='MARGIN:0in 0in 12pt 1.5in'><span style="COLOR:black; FONT-FAMILY:'Courier New'; ">cidlc -I$TAO_ROOT + -I$TAO_ROOT/tao -I$CIAO_ROOT/ciao --gen-exec-impl StockBroker.cidl</span></p> + <p style='MARGIN:0in 0in 12pt 1.25in'><span style='COLOR:black'>The above command will generate a <i>StockBroker_exec.h </i>and <i>StockBroker_exec.cpp </i>files. These generated + files greatly reduced the amount of work we do. We’ll edit those files + later in the tutorial to insert our business logic in the Broker component.</span></p> + <p style='LINE-HEIGHT:150%'><span style='COLOR:black'><br> + <b>Note:</b></span></p> + <p style='LINE-HEIGHT:150%'><span style='COLOR:black'>To + understand the meaning of different parameters passed to the CIDLC compiler + click <a href="../../../cidlc.html">here</a> or type the following command:</span></p> + <p style='MARGIN-BOTTOM:12pt'><span style="COLOR:black; FONT-FAMILY:'Courier New'; ">cidlc --h</span><span style='COLOR: black'><br> -<br style='mso-special-character:line-break'><![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'><![endif]><o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><b><span style='COLOR:black'>Implement -the Components:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Distributor:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'>The CIDLC compiler generated an -empty </span><i style='mso-bidi-font-style:normal'><span style='COLOR:black'>StockDistributor_exec.h -</span></i><span style='COLOR:black'>and <i style='mso-bidi-font-style:normal'>StockDistributor_exec.cpp - </i>files for us. You should now add your business logic to the executors. Look -into <i style='mso-bidi-font-style:normal'><a href="Distributor/StockDistributor_exec.h">StockDistributor_exec.h</a> - </i>and <i style='mso-bidi-font-style:normal'><a href="Distributor/StockDistributor_exec.cpp"> - StockDistributor_exec.cpp</a> </i>to see how we implemented this.<span style='mso-bidi-font-weight:bold'> - <o:p></o:p> - </span></span></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 0.5in'><b style='mso-bidi-font-weight:normal'><span style='COLOR:black'>Broker:<o:p></o:p></span></b></p> - <p class="MsoNormal" style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo2;tab-stops:list 1.25in'><![if - !supportLists]><span style='COLOR:black;FONT-FAMILY:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black;mso-bidi-font-weight:bold'>The CIDLC compiler generated an -empty </span><i style='mso-bidi-font-style:normal'><span style='COLOR:black'>StockBroker_exec.h -</span></i><span style='COLOR:black'>and <i style='mso-bidi-font-style:normal'>StockBroker_exec.cpp </i>files for us. You should now add your business logic to the executors. Look -into <i style='mso-bidi-font-style:normal'><a href="Broker/StockBroker_exec.h">StockBroker_exec.h</a> </i>and <i style='mso-bidi-font-style:normal'> - <a href="Broker/StockBroker_exec.cpp">StockBroker_exec.cpp</a> </i>to see how we implemented this.<span style='mso-bidi-font-weight:bold'> - <o:p></o:p> - </span></span></p> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'><o:p> </o:p> - </span></p> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><a href="01.html">Previous</a><span style='mso-tab-count: -8'> </span> - <a href="03.html">Next</a><o:p></o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <address><span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming Xiong<br> - </a> - </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a></address> - <ADDRESS> </ADDRESS> - <ADDRESS>$Id$</ADDRESS> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - </div> - </body> + <br> + <br> + </span></p> + <p style='MARGIN-BOTTOM:12pt'><b><span style='COLOR:black'>Implement + the Components:</span></b></p> + <p style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Distributor:</span></b></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>The CIDLC compiler generated an + empty </span><i><span style='COLOR:black'>StockDistributor_exec.h </span></i><span style='COLOR:black'>and <i>StockDistributor_exec.cpp </i>files for us. You should now add your business logic to the executors. Look + into <i><a href="Distributor/StockDistributor_exec.h">StockDistributor_exec.h</a> </i>and <i><a href="Distributor/StockDistributor_exec.cpp"> StockDistributor_exec.cpp</a> </i>to see how we implemented this. </span></p> + <p style='MARGIN:0in 0in 12pt 0.5in'><b><span style='COLOR:black'>Broker:</span></b></p> + <p style='MARGIN:0in 0in 12pt 1.25in;TEXT-INDENT:-0.25in;'><span style='COLOR:black;FONT-FAMILY:Symbol;'>·<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black;'>The CIDLC compiler generated an + empty </span><i><span style='COLOR:black'>StockBroker_exec.h </span></i><span style='COLOR:black'>and <i>StockBroker_exec.cpp </i>files for us. You should now add your business logic to the executors. Look + into <i><a href="Broker/StockBroker_exec.h">StockBroker_exec.h</a> </i>and <i> <a href="Broker/StockBroker_exec.cpp">StockBroker_exec.cpp</a> </i>to see how we implemented this. </span></p> + <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><a href="01.html">Previous</a> <a href="03.html">Next</a> </span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <address> + <span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming Xiong<br> + </a> </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a> + </address> + <ADDRESS> + + </ADDRESS> + <ADDRESS> + $Id$ + </ADDRESS> +</div> +</body> </html> diff --git a/CIAO/docs/tutorials/Quoter/Simple/03.html b/CIAO/docs/tutorials/Quoter/Simple/03.html index ee2cafc370a..13a05f1d8f5 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/03.html +++ b/CIAO/docs/tutorials/Quoter/Simple/03.html @@ -1,694 +1,437 @@ <!-- $Id$ --> -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" - xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" - xmlns="http://www.w3.org/TR/REC-html40"> - <head> - <title>Getting Started</title> - <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> - <meta name="ProgId" content="Word.Document"> - <meta name="Generator" content="Microsoft Word 11"> - <meta name="Originator" content="Microsoft Word 11"> - <link rel="File-List" href="03_files/filelist.xml"> - <link rel="Edit-Time-Data" href="03_files/editdata.mso"> <!--[if !mso]> -<STYLE> -v\:* {behavior:url(#default#VML);} -o\:* {behavior:url(#default#VML);} -w\:* {behavior:url(#default#VML);} -.shape {behavior:url(#default#VML);} -</STYLE> -<![endif]--> - <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place" /> - <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceType" /> - <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceName" /> <!--[if gte mso 9]><xml> - <o:DocumentProperties> - <o:Author>Abdullah Sowayan</o:Author> - <o:LastAuthor>Abdullah Sowayan</o:LastAuthor> - <o:Revision>13</o:Revision> - <o:TotalTime>54</o:TotalTime> - <o:Created>2006-10-09T22:26:00Z</o:Created> - <o:LastSaved>2007-03-08T01:18:00Z</o:LastSaved> - <o:Pages>1</o:Pages> - <o:Words>2585</o:Words> - <o:Characters>14741</o:Characters> - <o:Company>Maritime Systems & Sensors</o:Company> - <o:Lines>122</o:Lines> - <o:Paragraphs>34</o:Paragraphs> - <o:CharactersWithSpaces>17292</o:CharactersWithSpaces> - <o:Version>11.5606</o:Version> - </o:DocumentProperties> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:WordDocument> - <w:ValidateAgainstSchemas/> - <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> - <w:IgnoreMixedContent>false</w:IgnoreMixedContent> - <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> - <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> - </w:WordDocument> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> - </w:LatentStyles> -</xml><![endif]--> <!--[if !mso]> -<OBJECT id=ieooui classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D></OBJECT> -<STYLE> -st1\:*{behavior:url(#ieooui) } -</STYLE> -<![endif]--> - <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - h3 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:3; font-size:13.5pt; font-family:"Times New Roman"; font-weight:bold;} - a:link, span.MsoHyperlink {color:#000FFF; text-decoration:underline; text-underline:single;} - a:visited, span.MsoHyperlinkFollowed {color:#FF0F0F; text-decoration:underline; text-underline:single;} - p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - address {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; font-style:italic;} - code {font-family:"Courier New"; mso-ascii-font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:"Courier New"; mso-bidi-font-family:"Courier New";} - kbd {font-family:"Courier New"; mso-ascii-font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:"Courier New"; mso-bidi-font-family:"Courier New";} - pre {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; font-size:10.0pt; font-family:"Courier New"; mso-fareast-font-family:"Times New Roman";} - @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} - div.Section1 {page:Section1;} - /* List Definitions */ @list l0 {mso-list-id:154345203; mso-list-template-ids:-289649766;} - @list l0:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1 {mso-list-id:201526982; mso-list-template-ids:-336678638;} - @list l1:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} - @list l1:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2 {mso-list-id:777020325; mso-list-template-ids:-483995422;} - @list l2:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} - @list l2:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3 {mso-list-id:907959882; mso-list-template-ids:323885252;} - @list l3:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l3:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4 {mso-list-id:1065254837; mso-list-template-ids:1089662206;} - @list l4:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l4:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l5 {mso-list-id:1084494006; mso-list-template-ids:-1504120978;} - @list l5:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l5:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l6 {mso-list-id:1153565371; mso-list-template-ids:-169696680;} - @list l6:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l6:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l7 {mso-list-id:1832599161; mso-list-template-ids:-966728002;} - @list l7:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} - @list l7:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l7:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8 {mso-list-id:1956401533; mso-list-template-ids:-909756440;} - @list l8:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l9 {mso-list-id:2012949130; mso-list-type:hybrid; mso-list-template-ids:990837084 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} - @list l9:level1 {mso-level-tab-stop:39.0pt; mso-level-number-position:left; margin-left:39.0pt; text-indent:-.25in;} - @list l9:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l9:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l8:level1 lfo5 {mso-level-start-at:4;} - @list l1:level2 lfo7 {mso-level-number-format:arabic; mso-level-numbering:continue; mso-level-text:"%2\."; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:0in; text-indent:0in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} - ol {margin-bottom:0in;} - ul {margin-bottom:0in;} - --></style> - <!--[if gte mso 10]> +<html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>Getting Started</title> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style> - /* Style Definitions */ - table.MsoNormalTable - {mso-style-name:"Table Normal"; - mso-tstyle-rowband-size:0; - mso-tstyle-colband-size:0; - mso-style-noshow:yes; - mso-style-parent:""; - mso-padding-alt:0in 5.4pt 0in 5.4pt; - mso-para-margin:0in; - mso-para-margin-bottom:.0001pt; - mso-pagination:widow-orphan; - font-size:10.0pt; +<!-- +h3 { + font-size:13.5pt; + font-family:"Times New Roman"; + font-weight:bold; +} +a:link, span.MsoHyperlink { + color:#000FFF; + text-decoration:underline; + text-underline:single; +} +a:visited, span.MsoHyperlinkFollowed { + color:#FF0F0F; + text-decoration:underline; + text-underline:single; +} +p { + font-size:12.0pt; + font-family:"Times New Roman"; +} +address { + font-size:12.0pt; font-family:"Times New Roman"; - mso-ansi-language:#0400; - mso-fareast-language:#0400; - mso-bidi-language:#0400;} + font-style:italic; +} +code { + font-family:"Courier New"; +} +kbd { + font-family:"Courier New"; +} +pre { + tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; + font-size:10.0pt; + font-family:"Courier New"; +} +div.Section1 { + page:Section1 +} +--> </style> -<![endif]--> <!-- $Id$ --> <!--[if gte mso 9]><xml> - <o:shapedefaults v:ext="edit" spidmax="6146"/> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <o:shapelayout v:ext="edit"> - <o:idmap v:ext="edit" data="1"/> - </o:shapelayout></xml><![endif]--> - </head> - <body bgcolor="white" lang="EN-US" link="#000fff" vlink="#ff0f0f" style='tab-interval: -.5in'> - <div class="Section1"> - <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>Step 3: -Package your components<o:p></o:p></span></h3> - <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img width="572" height="358" id="_x0000_i1025" src="images/step3.jpg"><o:p></o:p> - </span></h3> - <p class="MsoNormal"><b><span style='COLOR:red'><o:p> </o:p> - </span></b></p> - <p class="MsoNormal"><b>Brief Introduction to CosMIC:<o:p></o:p></b></p> - <p class="MsoNormal" style='mso-layout-grid-align:none'>The Component Synthesis - using Model Integrated Computing (CoSMIC) project is a MDA toolset being - developed by the Institute for Software Integrated Systems (ISIS) at - <st1:place w:st="on"> - <st1:PlaceName w:st="on">Vanderbilt</st1:PlaceName> - <st1:PlaceType w:st="on">University</st1:PlaceType> - </st1:place> - to:</p> - <p class="MsoNormal" style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;tab-stops:list 39.0pt;mso-layout-grid-align:none;mso-list:l9 level1 lfo1'><![if - !supportLists]><span style='mso-list:Ignore'>1.<span style="FONT:7pt 'Times New Roman'"> -</span></span><![endif]><i>Model and</i> <i>analyze </i>distributed real-time and embedded - application functionality and QoS requirements.</p> - <p class="MsoNormal" style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;tab-stops:list 39.0pt;mso-layout-grid-align:none;mso-list:l9 level1 lfo1'><![if - !supportLists]><span style='mso-list:Ignore'>2.<span style="FONT:7pt 'Times New Roman'"> -</span></span><![endif]><i>Synthesize</i> CCM-specific deployment metadata required to deliver - end-to-end QoS to DRE applications.</p> - <p class="MsoNormal" style='mso-layout-grid-align:none'><o:p> </o:p></p> - <p class="MsoNormal" style='mso-layout-grid-align:none'>The CoSMIC toolsuite - provides modeling of DRE systems, their QoS requirements, and QoS adaptation - policies used for DRE application QoS management. The component behavior, their - interactions, and QoS requirements are modeled using a domain specific modeling - language that adheres to - <span style='COLOR:black'>the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG - Deployment & Configuration (D&C) specification (ptc/2003-07-08)</a></span>. - CoSMIC enables modeling the standards-based CCM components. - </p> - <p class="MsoNormal" style='mso-layout-grid-align:none'><o:p> </o:p></p> - <p class="MsoNormal" style='mso-layout-grid-align:none'>Hand-writing the required - XML descriptors to configure our components is tedious and error prone. We - therefore utilize CosMIC (we specifically use a subset of CosMIC called PICML, - which stands for Platform-Independent Component Modeling Language) to generate - the bulk of descriptors for us.</p> - <p class="MsoNormal" style='mso-layout-grid-align:none'><o:p> </o:p></p> - <p class="MsoNormal" style='mso-layout-grid-align:none'>For more information on - CosMIC, please refer to the following article:</p> - <p class="MsoNormal" style='mso-layout-grid-align:none'><span style='mso-bidi-font-weight:bold'><a href="http://www.cs.wustl.edu/~schmidt/PDF/mamad2003.pdf">CoSMIC: - An MDA Generative Tool for Distributed Real-time and Embedded Applications</a>.<o:p></o:p></span></p> - <p class="MsoNormal" style='mso-layout-grid-align:none'><span style='mso-bidi-font-weight:bold'><o:p> </o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <p class="MsoNormal" style='mso-layout-grid-align:none'><span style='mso-bidi-font-weight:bold'><o:p> </o:p> - </span></p> - <p class="MsoNormal"><b><span style='COLOR:black'>Importing IDL to PICML</span></b><span style='COLOR:black'><br> -<br> - To quick start our Stock Quoter modeling process in GME, CoSMIC -introduces <em>idl_to_picml</em> , which is an executable program that imports -the IDL files you just created into PICML.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l3 level1 lfo2'> - Make sure <code> - <span style='FONT-SIZE:10pt'>%COSMIC_ROOT%\bin</span></code> is included in - the PATH variable, e.g., c:\Program Files\ISIS\CoSMIC\bin.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l3 level1 lfo2'> - Open a command prompt, run VCVARS32.BAT from the MSVC .NET folder if you - haven't done so. It will set the environment for using Microsoft Visual Studio - .NET tools so that <i>idl_to_picml</i> works properly.<br> - in my machine, VCVARS32.bat is in C:\Program Files\Microsoft Visual Studio .NET - 2003\Vc7\bin<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l3 level1 lfo2'> - In the same command prompt, change directory to <code> - <span style='FONT-SIZE:10pt'>MyQuoter\</span></code>, and type the - following command:<br> - > <kbd> - <span style='FONT-SIZE:10pt'> - idl_to_picml -x MyQuoter -r . </span></kbd><br> - <em>idl_to_picml</em> will parse your IDL files and generated a <code> - <span style='FONT-SIZE:10pt'>MyQuoter.xme</span></code> file in the <code> - <span style='FONT-SIZE:10pt'>MyQuoter</span></code> directory. Note that if - -x option is not used, the default xme file name will be <code> - <span style='FONT-SIZE:10pt'>PICML_default_xme_file.xme.</span></code><br> - <LI class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list .5in; mso-list: l3 level1 lfo2"> - Start GME, select <strong>File->Import xml..</strong>, and choose the xme - file just generated. You should be able to see an imported PICML model similar - to the one shown in Figure 2.<o:p></o:p> - </LI> - </ol> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="960" height="719" id="_x0000_i1027" src="images/fig2.jpg"><br> -<br> -Figure 2<o:p></o:p></span></p> - <p><span style='COLOR:black'> In the Browser of the generated model, the <em>PredefinedTypes</em> -folder contains a bunch of atomic datatype elements that will be referenced by -other modeling parts later. You don't have to worry about them for now. The -models in <em>InterfaceDefinitions</em> folder are the PICML representations -ofthe IDL files you just imported. Double-click to open <em>Broker</em>, it -will show you a white, document-like entity which represents a -<<FileRef>> instance and a yellow box-shaped entity representing a -<<Package>> instance. Their equivalent representations in IDL files -are "#include" and "module" respectively. Figure 3 gives -you a clear view of GME representation of all the 3 idl files created. We will -cover the other folders in the next section.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="218" height="364" id="_x0000_i1028" src="images/fig3.jpg"><br> -<br> -Figure 3<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>Now -we are ready to model the rest of the Stock Quoter systems.<br> -<br style='mso-special-character:line-break'><![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'><![endif]><o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3>Building Stock Quoter system in PICML<span style='COLOR:black'><o:p></o:p> - </span></h3> - <p><span style='COLOR:black'>This section describes modeling the Quoter -application using PICML. If you have trouble producing a functioning model from -this tutorial, please see the, <a href="Model/Quoter.xme">pre-built Quoter model</a> which is provided for your reference. This model contains all -elements created as part of this tutorial.<o:p></o:p></span></p> - <div> - <p class="MsoNormal"><strong><span style='COLOR:black'>Note:</span></strong><span style='COLOR:black'> To import an XML file in GME, select <em>File->Import - XML..</em> from GME and choose your XML model<o:p></o:p></span></p> - </div> - <p><span style='COLOR:black'>The PICML paradigm is designed for the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG - Deployment & Configuration (D&C) specification (ptc/2003-07-08)</a>, so the modeling process -is straightforward if you are familiar with the specification. Please see the <a href="../../../releasenotes/dance.html">DAnCE - project</a> for more -information. For those who hate specification (including me, :-)), an <a href="http://www.cs.wustl.edu/%7Eschmidt/PDF/DAnCE.pdf">overview - of D&C</a> -and as well as a <a href="http://www.cs.wustl.edu/%7Eschmidt/OMG-CCM-Tutorial.ppt">tutorial of D&C - and CCM</a> can help to reduce the learning curve. In addition, it is -also helpful to read through Chapter 32 of TAO's Developer's Guide 1.4a (CIAO -and CCM) which thoroughly describes the various descriptors required for a -component (*.iad, *.ccd, *.cid, etc). <o:p></o:p></span></p> - <h3><span style='COLOR:black'>Table of Contents<o:p></o:p></span></h3> - <ul type="disc"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#1">ImplementationArtifacts</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#2">ComponentImplementations</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#3">ComponentPackages</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#4">PackageConfiguration</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#5">TopLevelPackage</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#6">Targets</a><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l2 level1 lfo3'> - <a href="#7">DeploymentPlan</a><o:p></o:p></li> - </ul> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <p><span style='COLOR:black'>The complete PICML Quoter model consists of -modeling elements distributed across various folders. If you used <em>idl_to_picml</em> -to generate the initial model, you will see that it has created all these -folders and some of the tedious boilerplate modeling for us. The rest of the -section will explain the purpose of each folder as well as the modeling -entities contained in these folders. We will also show how to model some of the -folders that have to be done by hand.<o:p></o:p></span></p> - <p><b><span style='BACKGROUND:silver;COLOR:red;FONT-VARIANT:small-caps;mso-highlight:silver'>Important:</span></b><span style='BACKGROUND:silver;COLOR:black;mso-highlight:silver'> The interpreters that generate deployment -artifacts expect very strict constraints in the model. When you finish your -model, and any time you wish to generate anything, it is a good idea to check -constraints by clicking on <em>File->Check->Check All</em> in GME. This -will help you find many logic errors in your model.</span><span style='COLOR:black'><o:p></o:p> - </span></p> - <h3><span style='COLOR:black'>ImplementationArtifacts<o:p></o:p></span></h3> - <p><span style='COLOR:black'>This folder contains implementation artifacts -associated with components. <em>idl_to_picml</em> has created these artifacts -for us, with their dependency relationships correctly captured. Figure 4 shows -the Implementation Artifacts for <em>Broker</em>.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="883" height="528" id="_x0000_i1031" src="images/fig4.jpg"><br> -Figure 4.<o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><a name="1"></a><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><span style='COLOR:black'>ComponentImplementation<a name="2"></a><o:p></o:p></span></h3> - <p><span style='COLOR:black'>This folder contains models that describe the implementations -of component interfaces. In the Quoter example, we will have two monolithic -component implementations - named <em>StockDistributorImplementation</em> and <em>StockBrokerImplementation</em> -- and an assembly component implementation named <em>StockQuoter</em>, which is -an assembly of <em>StockDistributorImplementation</em> and <em>StockBrokerImplementaion</em>. -<em>idl_to_picml</em> has created the monolithic component implementations for -us, as shown in figure 5 for example, but we have to specify the connections -between them in order to construct a Quoter system.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="894" height="617" id="_x0000_i1033" src="images/fig5.jpg"><br> -Figure 5<o:p></o:p></span></p> - <p><span style='COLOR:black'>Assembly components provide a boundary for the composition -of monolithic components and even other assemblies. Assembly components do not -provide actual implementations for their interface, it is a virtual component -that delegates its ports and attributes to one or more of the entities it -contains. There are slight differences between modeling an assembly and -modeling a monolithic component. Since the assembly is a virtual component, it -is not necessary to model a </span><code><span style='FONT-SIZE:10pt; +<!-- $Id$ --> +</head> +<body bgcolor="#FFFFFF" lang="EN-US" link="#000fff" vlink="#ff0f0f"> +<div class="Section1"> + <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>Step 3: + Package your components</span></h3> + <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img width="572" height="358" id="_x0000_i1025" src="images/step3.jpg"> </span></h3> + <p><b>Brief Introduction to CosMIC:</b></p> + <p>The Component Synthesis + using Model Integrated Computing (CoSMIC) project is a MDA toolset being + developed by the Institute for Software Integrated Systems (ISIS) at + <st1:place w:st="on"> + <st1:PlaceName w:st="on"> + Vanderbilt + <st1:PlaceType w:st="on"> + University + + to:</p> + <p style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;'>1.<span style="FONT:7pt 'Times New Roman'"> </span><i>Model and</i> <i>analyze </i>distributed real-time and embedded + application functionality and QoS requirements.</p> + <p style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;'>2.<span style="FONT:7pt 'Times New Roman'"> </span><i>Synthesize</i> CCM-specific deployment metadata required to deliver + end-to-end QoS to DRE applications.</p> + <p>The CoSMIC toolsuite + provides modeling of DRE systems, their QoS requirements, and QoS adaptation + policies used for DRE application QoS management. The component behavior, their + interactions, and QoS requirements are modeled using a domain specific modeling + language that adheres to <span style='COLOR:black'>the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG + Deployment & Configuration (D&C) specification (ptc/2003-07-08)</a></span>. + CoSMIC enables modeling the standards-based CCM components. </p> + <p>Hand-writing the required + XML descriptors to configure our components is tedious and error prone. We + therefore utilize CosMIC (we specifically use a subset of CosMIC called PICML, + which stands for Platform-Independent Component Modeling Language) to generate + the bulk of descriptors for us.</p> + <p>For more information on + CosMIC, please refer to the following article:</p> + <p><a href="http://www.cs.wustl.edu/~schmidt/PDF/mamad2003.pdf">CoSMIC: + An MDA Generative Tool for Distributed Real-time and Embedded Applications</a>.</p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <p><b><span style='COLOR:black'>Importing IDL to PICML</span></b><span style='COLOR:black'><br> + <br> + To quick start our Stock Quoter modeling process in GME, CoSMIC + introduces <em>idl_to_picml</em> , which is an executable program that imports + the IDL files you just created into PICML.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> Make sure <code> <span style='FONT-SIZE:10pt'>%COSMIC_ROOT%\bin</span></code> is included in + the PATH variable, e.g., c:\Program Files\ISIS\CoSMIC\bin. + <li style='COLOR:black;'> Open a command prompt, run VCVARS32.BAT from the MSVC .NET folder if you + haven't done so. It will set the environment for using Microsoft Visual Studio + .NET tools so that <i>idl_to_picml</i> works properly.<br> + in my machine, VCVARS32.bat is in C:\Program Files\Microsoft Visual Studio .NET + 2003\Vc7\bin + <li style='COLOR:black;'> In the same command prompt, change directory to <code> <span style='FONT-SIZE:10pt'>MyQuoter\</span></code>, and type the + following command:<br> + > <kbd> <span style='FONT-SIZE:10pt'> idl_to_picml -x MyQuoter -r . </span></kbd><br> + <em>idl_to_picml</em> will parse your IDL files and generated a <code> <span style='FONT-SIZE:10pt'>MyQuoter.xme</span></code> file in the <code> <span style='FONT-SIZE:10pt'>MyQuoter</span></code> directory. Note that if + -x option is not used, the default xme file name will be <code> <span style='FONT-SIZE:10pt'>PICML_default_xme_file.xme.</span></code><br> + <LI style="COLOR: black; "> Start GME, select <strong>File->Import xml..</strong>, and choose the xme + file just generated. You should be able to see an imported PICML model similar + to the one shown in Figure 2. </LI> + </ol> + <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="960" height="719" id="_x0000_i1027" src="images/fig2.jpg"><br> + <br> + Figure 2</span></p> + <p><span style='COLOR:black'> In the Browser of the generated model, the <em>PredefinedTypes</em> folder contains a bunch of atomic datatype elements that will be referenced by + other modeling parts later. You don't have to worry about them for now. The + models in <em>InterfaceDefinitions</em> folder are the PICML representations + ofthe IDL files you just imported. Double-click to open <em>Broker</em>, it + will show you a white, document-like entity which represents a + <<FileRef>> instance and a yellow box-shaped entity representing a + <<Package>> instance. Their equivalent representations in IDL files + are "#include" and "module" respectively. Figure 3 gives + you a clear view of GME representation of all the 3 idl files created. We will + cover the other folders in the next section.</span></p> + <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="218" height="364" id="_x0000_i1028" src="images/fig3.jpg"><br> + <br> + Figure 3</span></p> + <p style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>Now + we are ready to model the rest of the Stock Quoter systems.<br> + <br> + <br> + </span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3>Building Stock Quoter system in PICML<span style='COLOR:black'> </span></h3> + <p><span style='COLOR:black'>This section describes modeling the Quoter + application using PICML. If you have trouble producing a functioning model from + this tutorial, please see the, <a href="Model/Quoter.xme">pre-built Quoter model</a> which is provided for your reference. This model contains all + elements created as part of this tutorial.</span></p> + <p><strong><span style='COLOR:black'>Note:</span></strong><span style='COLOR:black'> To import an XML file in GME, select <em>File->Import + XML..</em> from GME and choose your XML model</span></p> + <p><span style='COLOR:black'>The PICML paradigm is designed for the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG + Deployment & Configuration (D&C) specification (ptc/2003-07-08)</a>, so the modeling process + is straightforward if you are familiar with the specification. Please see the <a href="../../../releasenotes/dance.html">DAnCE + project</a> for more + information. For those who hate specification (including me, :-)), an <a href="http://www.cs.wustl.edu/%7Eschmidt/PDF/DAnCE.pdf">overview + of D&C</a> and as well as a <a href="http://www.cs.wustl.edu/%7Eschmidt/OMG-CCM-Tutorial.ppt">tutorial of D&C + and CCM</a> can help to reduce the learning curve. In addition, it is + also helpful to read through Chapter 32 of TAO's Developer's Guide 1.4a (CIAO + and CCM) which thoroughly describes the various descriptors required for a + component (*.iad, *.ccd, *.cid, etc). </span></p> + <h3><span style='COLOR:black'>Table of Contents</span></h3> + <ul type="disc"> + <li style='COLOR:black;'> <a href="#1">ImplementationArtifacts</a> + <li style='COLOR:black;'> <a href="#2">ComponentImplementations</a> + <li style='COLOR:black;'> <a href="#3">ComponentPackages</a> + <li style='COLOR:black;'> <a href="#4">PackageConfiguration</a> + <li style='COLOR:black;'> <a href="#5">TopLevelPackage</a> + <li style='COLOR:black;'> <a href="#6">Targets</a> + <li style='COLOR:black;'> <a href="#7">DeploymentPlan</a></li> + </ul> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <p><span style='COLOR:black'>The complete PICML Quoter model consists of + modeling elements distributed across various folders. If you used <em>idl_to_picml</em> to generate the initial model, you will see that it has created all these + folders and some of the tedious boilerplate modeling for us. The rest of the + section will explain the purpose of each folder as well as the modeling + entities contained in these folders. We will also show how to model some of the + folders that have to be done by hand.</span></p> + <p><b><span style='BACKGROUND:silver;COLOR:red;FONT-VARIANT:small-caps;'>Important:</span></b><span style='BACKGROUND:silver;COLOR:black;'> The interpreters that generate deployment + artifacts expect very strict constraints in the model. When you finish your + model, and any time you wish to generate anything, it is a good idea to check + constraints by clicking on <em>File->Check->Check All</em> in GME. This + will help you find many logic errors in your model.</span><span style='COLOR:black'> </span></p> + <h3><span style='COLOR:black'>ImplementationArtifacts</span></h3> + <p><span style='COLOR:black'>This folder contains implementation artifacts + associated with components. <em>idl_to_picml</em> has created these artifacts + for us, with their dependency relationships correctly captured. Figure 4 shows + the Implementation Artifacts for <em>Broker</em>.</span></p> + <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="883" height="528" id="_x0000_i1031" src="images/fig4.jpg"><br> + Figure 4.</span></p> + <div align="center" style='TEXT-ALIGN:center'><a name="1"></a><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><span style='COLOR:black'>ComponentImplementation<a name="2"></a></span></h3> + <p><span style='COLOR:black'>This folder contains models that describe the implementations + of component interfaces. In the Quoter example, we will have two monolithic + component implementations - named <em>StockDistributorImplementation</em> and <em>StockBrokerImplementation</em> - and an assembly component implementation named <em>StockQuoter</em>, which is + an assembly of <em>StockDistributorImplementation</em> and <em>StockBrokerImplementaion</em>. <em>idl_to_picml</em> has created the monolithic component implementations for + us, as shown in figure 5 for example, but we have to specify the connections + between them in order to construct a Quoter system.</span></p> + <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="894" height="617" id="_x0000_i1033" src="images/fig5.jpg"><br> + Figure 5</span></p> + <p><span style='COLOR:black'>Assembly components provide a boundary for the composition + of monolithic components and even other assemblies. Assembly components do not + provide actual implementations for their interface, it is a virtual component + that delegates its ports and attributes to one or more of the entities it + contains. There are slight differences between modeling an assembly and + modeling a monolithic component. Since the assembly is a virtual component, it + is not necessary to model a </span><code><span style='FONT-SIZE:10pt; COLOR:black'>MonolithicImplementation</span></code><span style='COLOR:black'>. -Instead, <em>instances</em> of other components are placed within the assembly -and connected. Let's try to assemble the <em>StockQuoter</em>.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l0 level1 lfo4'> - Right click the <em>ComponentImplementations</em> folder, choose <strong>Insert - Model->ComponentImplementationContainer</strong>, rename it as - "StockQuoterImplementation" in the Attribute Panel. Double click to open it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l0 level1 lfo4'> - From the Part Browser, drag a <<ComponentAssembly>> to the modeling - window, name it "StockQuoter". Double click to open it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l0 level1 lfo4'> - Now we will create two instances for interfaces <em>StockBroker</em> and <em>StockDistributor</em>. - To do that, expand the folder <em> - <span style="FONT-SIZE:10pt; - FONT-FAMILY:'Courier New'">InterfaceDefinitions</span></em>, then expand the <em> - <span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/</span></em> - <em>Broker</em>, then <em> - <span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/</span></em> - <em>Broker/ Stock</em> until the interface definition of <em>StockBroker</em> shows. - While expanding the tree, always keep the "StockQuoter" - <<ComponentAssembly>> window open. Then drag <code> - <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker</span></code> - in the browser to the "StockQuoter" <<ComponentAssembly>> window - while pressing ALT key. Repeat the same steps for <code> - <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Distributor/Stock/StockDistributor</span></code>, - and you will see two instances of component interfaces have been created as - shown in Figure 6 (the black line in the figure only indicates .mapping)<o:p></o:p></li> - </ol> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="696" id="_x0000_i1034" src="images/fig6.jpg"><br> -<br> -Figure 6<o:p></o:p></span></p> - <ol start="4" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l8 level1 lfo5'> - Create an <<PublishConnector>>.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l8 level1 lfo5'> - Now assemble the components together according to <a href="images/fig1.jpg">Figure - 1</a>(make sure you change to connect mode <img border="0" width="32" height="32" id="_x0000_i1035" src="Icons/AddConnMode.gif">) - and the resulting assembly model should look like Figure 7. Note that to create - connections between StockDistributor.notify_out and StockBroker.notify_in, you - will need the intermediate connector <<PublishConnector>>.<o:p></o:p></li> - </ol> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1036" src="images/fig7.jpg"><!-- hhmts end -->><br> -<br> -Figure 7<o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><a name="3"></a><span style='COLOR:black'>ComponentPackage<o:p></o:p></span></h3> - <p class="MsoNormal"><span style='COLOR:black'>This folder contains deployable -component packages. Every instance in an assembly should have a corresponding -monolithic implementation and packaged in a ComponentPackagebe To create a -package for <em>StockBroker</em>.instance<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l1 level1 lfo6'> - Right click folder <em>ComponentPackage</em>s , insert a - <<PackageContainer>>, name it "Broker"; Double click to open it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l1 level1 lfo6'> - From the PartBrowser, add the following:<o:p></o:p> - <ul type="circle"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l1 level2 lfo6'> - a <<ComponentPackage>> named "Broker";<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l1 level2 lfo6'> - a <<ComponentImplementationReference>> named "Broker";<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l1 level2 lfo6'> - a <<ComponentRef>> named "Broker";<o:p></o:p></li> - </ul> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l1 level1 lfo6'> - Refer the <<ComponentImplementationReference>> <em>Broker</em> to <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockBroker</span></code>Implementation/StockBrokerMonolithicImpl. - Refer the <<ComponentRef>> <em>Broker</em> to <code> - <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker</span></code>. - To create a reference in GME, simply drag the tree node in the Browser "into" - the reference model. For example, you should drag the tree node <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockBroker</span></code>Implementation/StockBrokerMonolithicImpl - into <<ComponentImplementationReference>> <em>Broker.</em> Check - GME manual(tutorials) for more information.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l1 level1 lfo6'> - Switch to Connect Mode and create two connections according to the following - relationship.<o:p></o:p> - <ul type="circle"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l1 level2 lfo6'> - <<ComponentImplementationReference>> <em>Broker</em> implements - <<ComponentPackage>> <em>Broker</em>;<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l1 level2 lfo6'> - <<ComponentPackage>> <em>Broker</em> realizes - <<ComponentRef>> <em>Broker</em>.<o:p></o:p></li> - </ul> - </li> - </ol> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;mso-margin-top-alt:auto'><span style='COLOR:black'><br> -<br> - The model you built should resemble Figure 8.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;mso-margin-top-alt:auto'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1038" src="images/fig8.jpg"><!-- hhmts start -->><br> -<br> -Figure 8<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='COLOR:black'>Now create a -ComponentPackage/StockDistributor following the same steps. <o:p></o:p></span></p> - <ol start="5" type="1"> - <li class="MsoNormal" style='LIST-STYLE-POSITION:outside;COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l1 level1 lfo6'> - <br> - We will also need to create a package for the assembly component StockQuoter. - Remember assembly component is a virtual component, it does not "realize" a - certain interface, so different from the Broker and Distributor packages, the - StockQuoter does not need a <<ComponentRef>>. To create this model: - <o:p></o:p></li> - </ol> - <p class="MsoNormal" style='MARGIN-LEFT:0.5in;TEXT-INDENT:-0.25in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level2 lfo7'><![if - !supportLists]><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';mso-fareast-font-family:'Courier New';mso-bidi-font-size:12.0pt"><span style='mso-list:Ignore'>1.<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Insert a <<ComponentPackage>> named -"StockQuoter"<o:p></o:p></span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level2 lfo7'><![if - !supportLists]><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';mso-fareast-font-family:'Courier New';mso-bidi-font-size:12.0pt"><span style='mso-list:Ignore'>2.<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Add a <<ComponentImplementationReference>> -named "StockQuoter", refer it to MyQuoter</span><code><span style='FONT-SIZE:10pt;COLOR:black'>/ComponentImplementations/StockQuoter/StockQuoter</span></code><span style='COLOR:black'><o:p></o:p> - </span></p> - <p class="MsoNormal" style='MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level2 lfo7'><![if - !supportLists]><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';mso-fareast-font-family:'Courier New';mso-bidi-font-size:12.0pt"><span style='mso-list:Ignore'>3.<span style="FONT:7pt 'Times New Roman'"> </span></span> - </span><![endif]><span style='COLOR:black'>Switch to connect mode and connect -<<ComponentImplementationReference>> StockQuoter with -<<ComponentPackage>> StockQuoter, as in Figure 9.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1039" src="images/fig9.jpg"><!-- Created: Sat Nov 27 15:25:06 CST 1999 --><!-- hhmts start -->><br> -<br> -Figure 9<o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><a name="4"></a><span style='COLOR:black'>PackageConfiguration<o:p></o:p></span></h3> - <p class="MsoNormal"><span style='COLOR:black'>This folder contains just one -model capturing specific configuration of Component packages.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l6 level1 lfo8'> - In the folder <em>PackageConfiguratio</em>n, and create a - <<PackageConfigurationContainer>>, name it "Default", click to open - it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l6 level1 lfo8'> - Add a <<PackageConfiguration>> named "default" and a - <<ComponentPackageReference>>, name it "StockQuoter", connect - "Default" to "StockQuoter"<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l6 level1 lfo8'> - Refer <<ComponentPackageReference>> StockQuoter to - <<ComponentPackage>> <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentPackage/StockQuoter/StockQuoter</span></code><span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'"><br> - <code>(Not <<ComponentImplementationReference>></code></span> - <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentPackage/StockQuoter/StockQuoter!) </span></code><o:p></o:p></li> - </ol> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><a name="5"></a><span style='COLOR:black'>ToplevelPackage<o:p></o:p></span></h3> - <p class="MsoNormal"><span style='COLOR:black'>This folder contains one model -capturing information about the top-level element that will be fed to the -application.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l4 level1 lfo9'> - In the folder <em>ToplevelPackage</em>, and create a - <<ToplevelPackageContainer>>, name it "Default", double click to - open it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l4 level1 lfo9'> - Add a <<ToplevelPackage>> named "ToplevelPackage" and a - <<PackageConfigurationReference>>, name it "Default", connect - "ToplevelPackage" to "Default"<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l4 level1 lfo9'> - Refer "Default" to My<code><span style='FONT-SIZE:10pt'>Quoter/PackageConfiguration/Default/Default</span></code><o:p></o:p></li> - </ol> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><a name="6"></a><span style='COLOR:black'>Targets<o:p></o:p></span></h3> - <p class="MsoNormal"><span style='COLOR:black'>This folder contains -domain-specific models capturing information about the target environment in -which component-based application will be deployed. In this Quoter example, we -can either deploy the two components into ONE host, or into TWO different host. -We will deploy the Quoter into two different host.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l5 level1 lfo10'> - In the folder <i>Targets</i>, insert a new <<Domain>> named - "Domain"; double click to open it.<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l5 level1 lfo10'> - From the Part Browser, add two <<Node>> named "Broker" and - "Distributor" respectively.<o:p></o:p></li> - </ol> - <p class="MsoNormal"><span style='COLOR:black'><br> -Now we are ready to deploy our Components to the actual physical environment.<o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <h3><a name="7"></a><span style='COLOR:black'>DeploymentPlan<o:p></o:p></span></h3> - <p class="MsoNormal"><span style='COLOR:black'>This folder contains a plan model -that captures information about the assignment of component to nodes.<o:p></o:p></span></p> - <ol start="1" type="1"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l7 level1 lfo11'> - In the folder <em>DeploymentPlan</em>, insert a model - <<DeploymentPlan>>; name it "Plan", click to open it<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list .5in;mso-list:l7 level1 lfo11'> - From the PartBrowser, add the following:<o:p></o:p> - <ul type="circle"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l7 level2 lfo11'> - Two <<CollocationGroup>><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l7 level2 lfo11'> - Two <<NodeReference>> named "Node_Broker" and "Node_Distributor" - respectively, refering to <code> - <span style='FONT-SIZE:10pt'>MyQuoter/Targets/Domain/Broker</span></code> and - <code> - <span style='FONT-SIZE:10pt'>MyQuoter/Targets/Domain/Distributor</span></code> - respectively<o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;tab-stops:list 1.0in;mso-list:l7 level2 lfo11'> - Two <<ComponentRef>> named "StockBroker" and "StockDistributor" - respectively, refering to <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockBroker</span></code> - and <code> - <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockDistributor</span></code> - respectively. Note that the <<ComponentRef>> in DeploymentPlan is - not referring to the interface, but rather the actual instance of the - implementation.<o:p></o:p></li> - </ul> - <li class="MsoNormal" style='MARGIN-BOTTOM:12pt;COLOR:black;mso-margin-top-alt:auto;tab-stops:list .5in;mso-list:l7 level1 lfo11'> - Switch to Connect Mode, connect one <<CollocationGroup>> to - <<NodeReference>> <em>Node_Broker</em>, connect another - <<CollocationGroup>> to <<NodeReference>> <em>Node_Distributor</em>. - Now the model looks like the following.<o:p></o:p></li> - </ol> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;mso-margin-top-alt:auto'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1044" src="images/fig10.jpg"><br> -<br> -Figure 10.<o:p></o:p></span></p> - <ol start="4" type="1"> - <li class="MsoNormal" style='MARGIN-BOTTOM:12pt;COLOR:black;mso-margin-top-alt:auto;tab-stops:list .5in;mso-list:l7 level1 lfo11'> - Now we need to associate <<ComponentRef>> StockBroker to the - <<CollocationGroup>> running on the <<NodeReference>> - Broker, and <<ComponentRef>> StockDistributor to the - <<CollocationGroup>> running on the <<NodeReference>> - Distributor. To do that, switch the Edit Mode Bar to Set Mode (<img border="0" width="32" height="32" id="_x0000_i1045" src="Icons/SetMode.gif">), - and move the cursor to the <<CollocationGroup>> running on - <<NodeReference>> Distributor, right-click on it. You will find the - cursor is changed to set mode cursor, and only the - <<CollocationGroup>> you clicked in is highlighted, as shown in - Figure 11.<o:p></o:p></li> - </ol> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1046" src="images/fig11.jpg"><!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp -->><br> -<br> -Figure 11<o:p></o:p></span></p> - <p><span style='COLOR:black'>Now move your cursor to -<<ComponentRef>> StockDistributor, and left-click it, so that -it looks like Figure 12.<o:p></o:p></span></p> - <p class="MsoNormal" align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1047" src="images/fig12.jpg"> - - <br> -<br> -Figure 12<o:p></o:p></span></p> - <p style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>This operation -associates <em>StockDistributor</em> component to the -<<CollocationGroup>> running on <em>Distributor</em> node. To do -the same with Broker, just right-click on another -<<CollocationGroup>>, and left-click on StockBroker -<<CollocationGroup>> which is highlighted.<o:p></o:p></span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <p><a name="8"></a><span style='COLOR:black'>Up to this point, we are basically -done with the modeling part. Before we generate anything from this model -though, please <b>DO</b> remember to check the constraints of the model as we -mentioned earlier.<o:p></o:p></span></p> - <p><span style='COLOR:black'>After we are done with the modeling, the -Deploymentplan interpreter that comes along with PICML will help us -to generate a Plan.cdp file. Please make sure you generate -this file to MyQuoter/descriptors. Note that to get the example working</span><span style="COLOR:black; FONT-FAMILY:'Courier New'">,</span><span style='COLOR:black'>a -Node -Map file should be created to map logical nodes to NodeManager object -references,e.g:<o:p></o:p></span></p> - <pre wrap=""><span style='COLOR:black'>DistributorNode corbaloc:iiop:localhost:30000/NodeManager<o:p></o:p></span></pre> - <pre><span -style='COLOR:black'>BrokerNode<span style='mso-spacerun:yes'> </span>corbaloc:iiop:localhost:40000/NodeManager<o:p></o:p></span></pre> - <pre><span -style='COLOR:black'><o:p> </o:p></span></pre> - <pre><span style='COLOR:black'><o:p> </o:p></span></pre> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span style='COLOR:black'><a href="02.html">Previous</a><span style='mso-tab-count: -8'> </span> - <a href="04.html">Next</a><o:p></o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <address style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming - Xiong<br> - </a> - </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a></address> - <p class="MsoNormal" style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span style='COLOR:black'><o:p> </o:p> - </span></p> - <P class="MsoNormal" style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="COLOR: black"> - <o:p>$Id$</o:p> - </SPAN><o:p> </o:p></P> - </div> - </body> + Instead, <em>instances</em> of other components are placed within the assembly + and connected. Let's try to assemble the <em>StockQuoter</em>.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> Right click the <em>ComponentImplementations</em> folder, choose <strong>Insert + Model->ComponentImplementationContainer</strong>, rename it as + "StockQuoterImplementation" in the Attribute Panel. Double click to open it. + <li style='COLOR:black;'> From the Part Browser, drag a <<ComponentAssembly>> to the modeling + window, name it "StockQuoter". Double click to open it. + <li style='COLOR:black;'> Now we will create two instances for interfaces <em>StockBroker</em> and <em>StockDistributor</em>. + To do that, expand the folder <em> <span style="FONT-SIZE:10pt; + FONT-FAMILY:'Courier New'">InterfaceDefinitions</span></em>, then expand the <em> <span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/</span></em> <em>Broker</em>, then <em> <span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/</span></em> <em>Broker/ Stock</em> until the interface definition of <em>StockBroker</em> shows. + While expanding the tree, always keep the "StockQuoter" + <<ComponentAssembly>> window open. Then drag <code> <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker</span></code> in the browser to the "StockQuoter" <<ComponentAssembly>> window + while pressing ALT key. Repeat the same steps for <code> <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Distributor/Stock/StockDistributor</span></code>, + and you will see two instances of component interfaces have been created as + shown in Figure 6 (the black line in the figure only indicates .mapping)</li> + </ol> + <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="696" id="_x0000_i1034" src="images/fig6.jpg"><br> + <br> + Figure 6</span></p> + <ol start="4" type="1"> + <li style='COLOR:black;'> Create an <<PublishConnector>>. + <li style='COLOR:black;'> Now assemble the components together according to <a href="images/fig1.jpg">Figure + 1</a>(make sure you change to connect mode <img border="0" width="32" height="32" id="_x0000_i1035" src="Icons/AddConnMode.gif">) + and the resulting assembly model should look like Figure 7. Note that to create + connections between StockDistributor.notify_out and StockBroker.notify_in, you + will need the intermediate connector <<PublishConnector>>.</li> + </ol> + <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1036" src="images/fig7.jpg"> + <!-- hhmts end --> + ><br> + <br> + Figure 7</span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><a name="3"></a><span style='COLOR:black'>ComponentPackage</span></h3> + <p><span style='COLOR:black'>This folder contains deployable + component packages. Every instance in an assembly should have a corresponding + monolithic implementation and packaged in a ComponentPackagebe To create a + package for <em>StockBroker</em>.instance</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> Right click folder <em>ComponentPackage</em>s , insert a + <<PackageContainer>>, name it "Broker"; Double click to open it. + <li style='COLOR:black;'> From the PartBrowser, add the following: + <ul type="circle"> + <li style='COLOR:black;'> a <<ComponentPackage>> named "Broker"; + <li style='COLOR:black;'> a <<ComponentImplementationReference>> named "Broker"; + <li style='COLOR:black;'> a <<ComponentRef>> named "Broker";</li> + </ul> + <li style='COLOR:black;'> Refer the <<ComponentImplementationReference>> <em>Broker</em> to <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockBroker</span></code>Implementation/StockBrokerMonolithicImpl. + Refer the <<ComponentRef>> <em>Broker</em> to <code> <span style='FONT-SIZE:10pt'>MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker</span></code>. + To create a reference in GME, simply drag the tree node in the Browser "into" + the reference model. For example, you should drag the tree node <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockBroker</span></code>Implementation/StockBrokerMonolithicImpl + into <<ComponentImplementationReference>> <em>Broker.</em> Check + GME manual(tutorials) for more information. + <li style='COLOR:black;'> Switch to Connect Mode and create two connections according to the following + relationship. + <ul type="circle"> + <li style='COLOR:black;'> <<ComponentImplementationReference>> <em>Broker</em> implements + <<ComponentPackage>> <em>Broker</em>; + <li style='COLOR:black;'> <<ComponentPackage>> <em>Broker</em> realizes + <<ComponentRef>> <em>Broker</em>.</li> + </ul> + </li> + </ol> + <p style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;'><span style='COLOR:black'><br> + <br> + The model you built should resemble Figure 8.</span></p> + <p align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1038" src="images/fig8.jpg"> + <!-- hhmts start --> + ><br> + <br> + Figure 8</span></p> + <p style='MARGIN-LEFT:0.5in;'><span style='COLOR:black'>Now create a + ComponentPackage/StockDistributor following the same steps. </span></p> + <ol start="5" type="1"> + <li style='LIST-STYLE-POSITION:outside;COLOR:black;'> <br> + We will also need to create a package for the assembly component StockQuoter. + Remember assembly component is a virtual component, it does not "realize" a + certain interface, so different from the Broker and Distributor packages, the + StockQuoter does not need a <<ComponentRef>>. To create this model: </li> + </ol> + <p style='MARGIN-LEFT:0.5in;TEXT-INDENT:-0.25in;'><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';'Courier New';">1.<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Insert a <<ComponentPackage>> named + "StockQuoter"</span></p> + <p style='MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;'><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';'Courier New';">2.<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Add a <<ComponentImplementationReference>> + named "StockQuoter", refer it to MyQuoter</span><code><span style='FONT-SIZE:10pt;COLOR:black'>/ComponentImplementations/StockQuoter/StockQuoter</span></code><span style='COLOR:black'> </span></p> + <p style='MARGIN-LEFT:1in;TEXT-INDENT:-0.25in;'><span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:'Courier New';'Courier New';">3.<span style="FONT:7pt 'Times New Roman'"> </span> </span><span style='COLOR:black'>Switch to connect mode and connect + <<ComponentImplementationReference>> StockQuoter with + <<ComponentPackage>> StockQuoter, as in Figure 9.</span></p> + <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="445" id="_x0000_i1039" src="images/fig9.jpg"> + <!-- Created: Sat Nov 27 15:25:06 CST 1999 --> + <!-- hhmts start --> + ><br> + <br> + Figure 9</span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><a name="4"></a><span style='COLOR:black'>PackageConfiguration</span></h3> + <p><span style='COLOR:black'>This folder contains just one + model capturing specific configuration of Component packages.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> In the folder <em>PackageConfiguratio</em>n, and create a + <<PackageConfigurationContainer>>, name it "Default", click to open + it. + <li style='COLOR:black;'> Add a <<PackageConfiguration>> named "default" and a + <<ComponentPackageReference>>, name it "StockQuoter", connect + "Default" to "StockQuoter" + <li style='COLOR:black;'> Refer <<ComponentPackageReference>> StockQuoter to + <<ComponentPackage>> <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentPackage/StockQuoter/StockQuoter</span></code><span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'"><br> + <code>(Not <<ComponentImplementationReference>></code></span> <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentPackage/StockQuoter/StockQuoter!) </span></code></li> + </ol> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><a name="5"></a><span style='COLOR:black'>ToplevelPackage</span></h3> + <p><span style='COLOR:black'>This folder contains one model + capturing information about the top-level element that will be fed to the + application.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> In the folder <em>ToplevelPackage</em>, and create a + <<ToplevelPackageContainer>>, name it "Default", double click to + open it. + <li style='COLOR:black;'> Add a <<ToplevelPackage>> named "ToplevelPackage" and a + <<PackageConfigurationReference>>, name it "Default", connect + "ToplevelPackage" to "Default" + <li style='COLOR:black;'> Refer "Default" to My<code><span style='FONT-SIZE:10pt'>Quoter/PackageConfiguration/Default/Default</span></code></li> + </ol> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><a name="6"></a><span style='COLOR:black'>Targets</span></h3> + <p><span style='COLOR:black'>This folder contains + domain-specific models capturing information about the target environment in + which component-based application will be deployed. In this Quoter example, we + can either deploy the two components into ONE host, or into TWO different host. + We will deploy the Quoter into two different host.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> In the folder <i>Targets</i>, insert a new <<Domain>> named + "Domain"; double click to open it. + <li style='COLOR:black;'> From the Part Browser, add two <<Node>> named "Broker" and + "Distributor" respectively.</li> + </ol> + <p><span style='COLOR:black'><br> + Now we are ready to deploy our Components to the actual physical environment.</span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <h3><a name="7"></a><span style='COLOR:black'>DeploymentPlan</span></h3> + <p><span style='COLOR:black'>This folder contains a plan model + that captures information about the assignment of component to nodes.</span></p> + <ol start="1" type="1"> + <li style='COLOR:black;'> In the folder <em>DeploymentPlan</em>, insert a model + <<DeploymentPlan>>; name it "Plan", click to open it + <li style='COLOR:black;'> From the PartBrowser, add the following: + <ul type="circle"> + <li style='COLOR:black;'> Two <<CollocationGroup>> + <li style='COLOR:black;'> Two <<NodeReference>> named "Node_Broker" and "Node_Distributor" + respectively, refering to <code> <span style='FONT-SIZE:10pt'>MyQuoter/Targets/Domain/Broker</span></code> and <code> <span style='FONT-SIZE:10pt'>MyQuoter/Targets/Domain/Distributor</span></code> respectively + <li style='COLOR:black;'> Two <<ComponentRef>> named "StockBroker" and "StockDistributor" + respectively, refering to <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockBroker</span></code> and <code> <span style='FONT-SIZE:10pt'>MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockDistributor</span></code> respectively. Note that the <<ComponentRef>> in DeploymentPlan is + not referring to the interface, but rather the actual instance of the + implementation.</li> + </ul> + <li style='MARGIN-BOTTOM:12pt;COLOR:black;'> Switch to Connect Mode, connect one <<CollocationGroup>> to + <<NodeReference>> <em>Node_Broker</em>, connect another + <<CollocationGroup>> to <<NodeReference>> <em>Node_Distributor</em>. + Now the model looks like the following.</li> + </ol> + <p align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1044" src="images/fig10.jpg"><br> + <br> + Figure 10.</span></p> + <ol start="4" type="1"> + <li style='MARGIN-BOTTOM:12pt;COLOR:black;'> Now we need to associate <<ComponentRef>> StockBroker to the + <<CollocationGroup>> running on the <<NodeReference>> + Broker, and <<ComponentRef>> StockDistributor to the + <<CollocationGroup>> running on the <<NodeReference>> + Distributor. To do that, switch the Edit Mode Bar to Set Mode (<img border="0" width="32" height="32" id="_x0000_i1045" src="Icons/SetMode.gif">), + and move the cursor to the <<CollocationGroup>> running on + <<NodeReference>> Distributor, right-click on it. You will find the + cursor is changed to set mode cursor, and only the + <<CollocationGroup>> you clicked in is highlighted, as shown in + Figure 11.</li> + </ol> + <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1046" src="images/fig11.jpg"> + <!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp --> + ><br> + <br> + Figure 11</span></p> + <p><span style='COLOR:black'>Now move your cursor to + <<ComponentRef>> StockDistributor, and left-click it, so that + it looks like Figure 12.</span></p> + <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" width="1076" height="530" id="_x0000_i1047" src="images/fig12.jpg"> <br> + <br> + Figure 12</span></p> + <p style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>This operation + associates <em>StockDistributor</em> component to the + <<CollocationGroup>> running on <em>Distributor</em> node. To do + the same with Broker, just right-click on another + <<CollocationGroup>>, and left-click on StockBroker + <<CollocationGroup>> which is highlighted.</span></p> + <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <p><a name="8"></a><span style='COLOR:black'>Up to this point, we are basically + done with the modeling part. Before we generate anything from this model + though, please <b>DO</b> remember to check the constraints of the model as we + mentioned earlier.</span></p> + <p><span style='COLOR:black'>After we are done with the modeling, the + Deploymentplan interpreter that comes along with PICML will help us + to generate a Plan.cdp file. Please make sure you generate + this file to MyQuoter/descriptors. Note that to get the example working</span><span style="COLOR:black; FONT-FAMILY:'Courier New'">,</span><span style='COLOR:black'>a + Node + Map file should be created to map logical nodes to NodeManager object + references,e.g:</span></p> + <pre wrap=""><span style='COLOR:black'>DistributorNode corbaloc:iiop:localhost:30000/NodeManager</span></pre> + <pre><span +style='COLOR:black'>BrokerNode corbaloc:iiop:localhost:40000/NodeManager</span></pre> + <pre><span +style='COLOR:black'> </span></pre> + <pre><span style='COLOR:black'> </span></pre> + <p align="center" style='TEXT-ALIGN:center;'><span style='COLOR:black'><a href="02.html">Previous</a> <a href="04.html">Next</a> </span></p> + <div align="center" style='TEXT-ALIGN:center;'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> + <address> + <span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming + Xiong<br> + </a> </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a> + </address> + <P><SPAN style="COLOR: black"> $Id$ </SPAN> </P> +</div> +</body> </html> diff --git a/CIAO/docs/tutorials/Quoter/Simple/04.html b/CIAO/docs/tutorials/Quoter/Simple/04.html index 0695b3b100d..b4338971620 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/04.html +++ b/CIAO/docs/tutorials/Quoter/Simple/04.html @@ -1,265 +1,161 @@ <!-- $Id$ --> -<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" - xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" - xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns="http://www.w3.org/TR/REC-html40"> - <head> - <title>Building a Stock Quoter with TAO - A Tutorial</title> - <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> - <meta name="ProgId" content="Word.Document"> - <meta name="Generator" content="Microsoft Word 11"> - <meta name="Originator" content="Microsoft Word 11"> - <link rel="File-List" href="04_files/filelist.xml"> - <link rel="Edit-Time-Data" href="04_files/editdata.mso"> <!--[if !mso]> -<STYLE> -v\:* {behavior:url(#default#VML);} -o\:* {behavior:url(#default#VML);} -w\:* {behavior:url(#default#VML);} -.shape {behavior:url(#default#VML);} -</STYLE> -<![endif]--> <!--[if gte mso 9]><xml> - <o:DocumentProperties> - <o:Author>Abdullah Sowayan</o:Author> - <o:LastAuthor>Abdullah Sowayan</o:LastAuthor> - <o:Revision>5</o:Revision> - <o:TotalTime>4</o:TotalTime> - <o:Created>2006-11-06T21:26:00Z</o:Created> - <o:LastSaved>2007-03-08T01:20:00Z</o:LastSaved> - <o:Pages>1</o:Pages> - <o:Words>292</o:Words> - <o:Characters>1668</o:Characters> - <o:Company>Lockheed Martin</o:Company> - <o:Lines>13</o:Lines> - <o:Paragraphs>3</o:Paragraphs> - <o:CharactersWithSpaces>1957</o:CharactersWithSpaces> - <o:Version>11.5606</o:Version> - </o:DocumentProperties> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:WordDocument> - <w:ValidateAgainstSchemas/> - <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> - <w:IgnoreMixedContent>false</w:IgnoreMixedContent> - <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> - <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> - </w:WordDocument> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> - </w:LatentStyles> -</xml><![endif]--> - <style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} - /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - h3 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:3; font-size:13.5pt; font-family:"Times New Roman"; font-weight:bold;} - a:link, span.MsoHyperlink {color:#000FFF; text-decoration:underline; text-underline:single;} - a:visited, span.MsoHyperlinkFollowed {color:#FF0F0F; text-decoration:underline; text-underline:single;} - p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} - address {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; font-style:italic;} - code {font-family:"Courier New"; mso-ascii-font-family:"Courier New"; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:"Courier New"; mso-bidi-font-family:"Courier New";} - @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} - div.Section1 {page:Section1;} - /* List Definitions */ @list l0 {mso-list-id:67775701; mso-list-template-ids:1355323582;} - @list l0:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} - @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1 {mso-list-id:170876734; mso-list-template-ids:1310460404;} - @list l1:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} - @list l1:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l1:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2 {mso-list-id:333609146; mso-list-template-ids:-1273693138;} - @list l2:level1 {mso-level-number-format:bullet; mso-level-text:\F0A7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Wingdings;} - @list l2:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} - @list l2:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} - @list l3 {mso-list-id:909120102; mso-list-template-ids:116433128;} - @list l3:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} - @list l4 {mso-list-id:1387752558; mso-list-template-ids:245692192;} - @list l4:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} - @list l5 {mso-list-id:1450973280; mso-list-template-ids:2147393542;} - @list l5:level1 {mso-level-number-format:bullet; mso-level-text:\F0A7; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Wingdings;} - ol {margin-bottom:0in;} - ul {margin-bottom:0in;} - --></style> - <!--[if gte mso 10]> +<html xmlns="http://www.w3.org/TR/REC-html40"> +<head> +<title>Building a Stock Quoter with TAO - A Tutorial</title> +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <style> - /* Style Definitions */ - table.MsoNormalTable - {mso-style-name:"Table Normal"; - mso-tstyle-rowband-size:0; - mso-tstyle-colband-size:0; - mso-style-noshow:yes; - mso-style-parent:""; - mso-padding-alt:0in 5.4pt 0in 5.4pt; - mso-para-margin:0in; - mso-para-margin-bottom:.0001pt; - mso-pagination:widow-orphan; - font-size:10.0pt; +<!-- +@font-face { +font-family:Wingdings; +panose-1:5 0 0 0 0 0 0 0 0 0; +} +h3 { + font-size:13.5pt; font-family:"Times New Roman"; - mso-ansi-language:#0400; - mso-fareast-language:#0400; - mso-bidi-language:#0400;} + font-weight:bold; +} +a:link, span.MsoHyperlink { + color:#000FFF; + text-decoration:underline; + text-underline:single; +} +a:visited, span.MsoHyperlinkFollowed { + color:#FF0F0F; + text-decoration:underline; + text-underline:single; +} +p { + font-size:12.0pt; + font-family:"Times New Roman"; +} +address { + font-size:12.0pt; + font-family:"Times New Roman"; + font-style:italic; +} +code { + font-family:"Courier New"; +} +div.Section1 { + page:Section1 +} +--> </style> -<![endif]--> <!-- $Id$ --> <!--[if gte mso 9]><xml> - <o:shapedefaults v:ext="edit" spidmax="5122"/> -</xml><![endif]--> <!--[if gte mso 9]><xml> - <o:shapelayout v:ext="edit"> - <o:idmap v:ext="edit" data="1"/> - </o:shapelayout></xml><![endif]--> - </head> - <body bgcolor="white" lang="EN-US" link="#000fff" vlink="#ff0f0f" style='tab-interval: -.5in'> - <h3 align="center" style='TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'>Step 6: -System Deployment<o:p></o:p></span></h3> - <h3 align="center" style='TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'><img width="432" height="223" id="_x0000_i1025" src="images/step6.jpg"><o:p></o:p> - </span></h3> - <p class="MsoNormal"><span style='COLOR:black'>Now that we have all the -components and driver programs successfully built, along with the Deploymentplan -generated by PICML, we will be able to run our application<br> -<br> -From different command prompts in </span><code><span style='FONT-SIZE:10pt; -COLOR:black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/descriptors</span></code><span style='COLOR:black'> directory: <o:p></o:p></span></p> - <DIV class="Section1"> - <UL type="disc"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3;tab-stops:list .5in'> - Start NodeManagers (NodeDameon) by running:</li></UL> - </DIV> - <P class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo3; tab-stops: list .5in"> <FONT face="Courier New" size="2"> - %CIAO_ROOT%/bin/NodeManager -ORBListenendpoints iiop://localhost:30000 -s - %CIAO_ROOT%/bin/NodeApplication -d 1000</FONT></P> - <P class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo3; tab-stops: list .5in"><FONT face="Courier New" size="2"></FONT> </P> - <P class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo3; tab-stops: list .5in"><FONT face="Courier New" size="2"> %CIAO_ROOT%/bin/NodeManager - -ORBListenendpoints iiop://localhost:40000 -s %CIAO_ROOT%/bin/NodeApplication - -d 1000</FONT></P> - <UL type="disc"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3;tab-stops:list .5in'> - Start the execution manager:</li></UL> - <P class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l1 level1 lfo3; tab-stops: list .5in"> - <code> - <span style='FONT-SIZE:10pt'>%CIAO_ROOT%/bin/Execution_Manager - -o ior -i NodeMap.dat</span></code> <o:p></o:p> - </P> - <p><span style='COLOR:black'>The </span><code><span style='FONT-SIZE:10pt; +<!-- $Id$ --> +</head> +<body bgcolor="#FFFFFF" lang="EN-US" link="#000fff" vlink="#ff0f0f"> +<h3 align="center" style='TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'>Step 6: + System Deployment</span></h3> +<h3 align="center" style='TEXT-ALIGN:center' class="Section1"><span style='COLOR:black'><img width="432" height="223" id="_x0000_i1025" src="images/step6.jpg"> </span></h3> +<p><span style='COLOR:black'>Now that we have all the + components and driver programs successfully built, along with the Deploymentplan + generated by PICML, we will be able to run our application<br> + <br> + From different command prompts in </span><code><span style='FONT-SIZE:10pt; +COLOR:black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/descriptors</span></code><span style='COLOR:black'> directory: </span></p> +<DIV class="Section1"> + <UL type="disc"> + <li style='COLOR:black;'> Start NodeManagers (NodeDameon) by running:</li> + </UL> +</DIV> +<P style="COLOR: black; "> <FONT face="Courier New" size="2"> + %CIAO_ROOT%/bin/NodeManager -ORBListenendpoints iiop://localhost:30000 -s + %CIAO_ROOT%/bin/NodeApplication -d 1000</FONT></P> +<P style="COLOR: black; "><FONT face="Courier New" size="2"> %CIAO_ROOT%/bin/NodeManager + -ORBListenendpoints iiop://localhost:40000 -s %CIAO_ROOT%/bin/NodeApplication + -d 1000</FONT></P> +<UL type="disc"> + <li style='COLOR:black;'> Start the execution manager:</li> +</UL> +<P style="COLOR: black; "> + <code> <span style='FONT-SIZE:10pt'>%CIAO_ROOT%/bin/Execution_Manager + -o ior -i NodeMap.dat</span></code> </P> +<p><span style='COLOR:black'>The </span><code><span style='FONT-SIZE:10pt; COLOR:black'>NodeMap.dat</span></code><span style='COLOR:black'> file describes -the deployment daemons CIAO's Execution_Manager will contact to instantiate -ComponentServer's, home's, and component instances. Each line specify the name -of a installation "destination" and the corresponding IOR for the -CIAO_Daemon.<o:p></o:p></span></p> - <ul type="square"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo6;tab-stops:list .5in'> - <em>NOTE</em>: As one can see, we use the "NodeMap.dat" file to instruct the - Execution_Manager how to find the endpoint of each individual NodeManager - (i.e., Node Daemon) where component(s) will be deployed, so this is - non-standard. We plan to use Naming Service to do this in the future.<o:p></o:p></li> - </ul> - <ul type="disc"> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo9;tab-stops:list .5in'> - Start the plan_launcher by running <code> - <span style='FONT-SIZE:10pt'>%CIAO_ROOT%/bin/plan_launcher - -p Plan.cdp -k file://ior</span></code><o:p></o:p> - <li class="MsoNormal" style='COLOR:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo9;tab-stops:list .5in'> - By now the components should be successfully deployed. You may run the driver - program to start the application. e.g. you can try the following<o:p></o:p> - : - <UL> - <LI class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l0 level1 lfo9; tab-stops: list .5in"> - Instruct the StockDistributor component to start publishing stock quotes:</LI></UL> - </li> - </ul> - <P class="MsoNormal" style="MARGIN-BOTTOM: 12pt"><span style='COLOR:black'> -</span><code><span style='FONT-SIZE:10pt;COLOR:black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.exe --o</span></code></P> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <LI> - <span style='COLOR:black'>Instruct the StockBroker - to subscirbe to MSFT stock -publications: </span></LI></UL> - </UL> - <P><SPAN style="COLOR: black"> -</SPAN><code><span style='FONT-SIZE: + the deployment daemons CIAO's Execution_Manager will contact to instantiate + ComponentServer's, home's, and component instances. Each line specify the name + of a installation "destination" and the corresponding IOR for the + CIAO_Daemon.</span></p> +<ul type="square"> + <li style='COLOR:black;'> <em>NOTE</em>: As one can see, we use the "NodeMap.dat" file to instruct the + Execution_Manager how to find the endpoint of each individual NodeManager + (i.e., Node Daemon) where component(s) will be deployed, so this is + non-standard. We plan to use Naming Service to do this in the future.</li> +</ul> +<ul type="disc"> + <li style='COLOR:black;'> Start the plan_launcher by running <code> <span style='FONT-SIZE:10pt'>%CIAO_ROOT%/bin/plan_launcher + -p Plan.cdp -k file://ior</span></code> + <li style='COLOR:black;'> By now the components should be successfully deployed. You may run the driver + program to start the application. e.g. you can try the following + : + <UL> + <LI style="COLOR: black; "> Instruct the StockDistributor component to start publishing stock quotes:</LI> + </UL> + </li> +</ul> +<P style="MARGIN-BOTTOM: 12pt"><span style='COLOR:black'> </span><code><span style='FONT-SIZE:10pt;COLOR:black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.exe + -o</span></code></P> +<UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <LI> <span style='COLOR:black'>Instruct the StockBroker + to subscirbe to MSFT stock + publications: </span></LI> + </UL> +</UL> +<P><SPAN style="COLOR: black"> </SPAN><code><span style='FONT-SIZE: 10pt;COLOR: black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.exe --s MSFT</span></code></P> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <LI> - <CODE> - <SPAN style="FONT-SIZE: 10pt; COLOR: black"> - <SPAN style="COLOR: black"> - <FONT face="Times New Roman"><FONT size="3">Instruct the StockBroker to subscirbe - to IBM stock publications</FONT>:</FONT></SPAN> - </SPAN></CODE></LI></UL> - </UL> - <P><span style='COLOR:black'> - </span><code><span style='FONT-SIZE: + -s MSFT</span></code></P> +<UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <LI> <CODE> <SPAN style="FONT-SIZE: 10pt; COLOR: black"> <SPAN style="COLOR: black"> <FONT face="Times New Roman"><FONT size="3">Instruct the StockBroker to subscirbe + to IBM stock publications</FONT>:</FONT></SPAN> </SPAN></CODE></LI> + </UL> +</UL> +<P><span style='COLOR:black'> </span><code><span style='FONT-SIZE: 10pt;COLOR: black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.exe --s IBM</span></code></P> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <UL dir="ltr" style="MARGIN-RIGHT: 0px"> - <LI> - <CODE> - <SPAN style="FONT-SIZE: 10pt; COLOR: black"></SPAN></CODE><span style='COLOR:black'><SPAN style="COLOR: black">Instruct the StockBroker to unsubscirbe to MSFT stock - publications:</SPAN> - </span></LI></UL> - </UL> - <SPAN style="COLOR: black"> + -s IBM</span></code></P> +<UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <UL dir="ltr" style="MARGIN-RIGHT: 0px"> + <LI> <CODE> </CODE><span style='COLOR:black'><SPAN style="COLOR: black">Instruct the StockBroker to unsubscirbe to MSFT stock + publications:</SPAN> </span></LI> + </UL> +</UL> +<SPAN style="COLOR: black"> <P> </SPAN><code><span style='FONT-SIZE: 10pt;COLOR: black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.exe --u MSFT</span></code><span style='COLOR:black'></P> + -u MSFT</span></code><span style='COLOR:black'></P> <UL> - <UL> - <LI> - <SPAN style="COLOR: black"> - <SPAN style="COLOR: black">Instruct the - StockDistributor component to stop publishing stock -quotes:</SPAN></LI></UL> - </UL> </span> - <P> </SPAN><code><span style='FONT-SIZE: + <UL> + <LI> <SPAN style="COLOR: black"> <SPAN style="COLOR: black">Instruct the + StockDistributor component to stop publishing stock + quotes:</SPAN></LI> + </UL> +</UL> +</span> +<P> </SPAN><code><span style='FONT-SIZE: 10pt;COLOR: black'>%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.exe -–f</span></code><code><span style='FONT-SIZE:10pt'><o:p></o:p> - </span></code></P> - <P><CODE><SPAN style="FONT-SIZE: 10pt"></SPAN></CODE><code><span style='FONT-SIZE: -10pt'> </P> - <UL> - <DIV class="MsoNormal" style="MARGIN-BOTTOM: 12pt"> - <LI class="MsoNormal" style="COLOR: black; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-list: l2 level1 lfo6; tab-stops: list .5in"> - <FONT color="#ff0000"><EM>NOTE</EM>: Windows uses %VARIABLE% to fetch the values of - environment variables. Linux/Unix uses $VARIABLE to fetch the values of - environment variables. As such, if you're running this tutorial on Linux/Unix - operating system, change the above commands to use $VARIABLE instead of - %VARIABLE% when you run the programs.</FONT></SPAN></CODE></LI></DIV> - </UL> - <p class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><a href="03.html">Previous</a><span style='mso-tab-count: -8'> </span> - <o:p></o:p> - </span></p> - <div class="MsoNormal" align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> - <hr size="2" width="100%" align="center"> - </span></div> - <address><span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming Xiong<br> - </a> - </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a></address> - <p class="MsoNormal"><span style='COLOR:black'><o:p> </o:p> - </span></p> - <P class="MsoNormal"><SPAN style="COLOR: black">$Id$</SPAN></P> - <p class="MsoNormal" style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'><o:p> </o:p> - </span></p> - </body> + –f</span></code><code><span style='FONT-SIZE:10pt'> </span></code></P> +<UL> + <DIV style="MARGIN-BOTTOM: 12pt"> + <LI style="COLOR: black; "> <FONT color="#ff0000"><EM>NOTE</EM>: Windows uses %VARIABLE% to fetch the values of + environment variables. Linux/Unix uses $VARIABLE to fetch the values of + environment variables. As such, if you're running this tutorial on Linux/Unix + operating system, change the above commands to use $VARIABLE instead of + %VARIABLE% when you run the programs.</FONT></SPAN></CODE></LI> + </DIV> +</UL> +<p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><a href="03.html">Previous</a> </span></p> +<div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'> + <hr size="2" width="100%" align="center"> + </span></div> +<address> +<span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming Xiong<br> +</a> </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a> +</address> +<P><SPAN style="COLOR: black">$Id$</SPAN></P> +</body> </html> diff --git a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc index 25c0840871b..f18ab6d17c6 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc +++ b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker.mpc @@ -32,7 +32,7 @@ project(Stock_Base_StockBroker_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Stock_Base_StockBroker_stub) : ciao_client_dnc { +project(Stock_Base_StockBroker_stub) : ccm_stub { avoids += ace_for_tao after += Stock_Base_StockBroker_idl_gen Stock_Base_stub libs += Stock_Base_stub @@ -57,7 +57,7 @@ project(Stock_Base_StockBroker_stub) : ciao_client_dnc { } } -project(Stock_Base_StockBroker_exec) : ciao_component_dnc { +project(Stock_Base_StockBroker_exec) : ciao_executor { avoids += ace_for_tao after += Stock_Base_StockBroker_cidl_gen Stock_Base_StockBroker_stub sharedname = StockBroker_exec @@ -85,7 +85,7 @@ project(Stock_Base_StockBroker_exec) : ciao_component_dnc { } -project(Stock_Base_StockBroker_svnt) : ciao_servant_dnc { +project(Stock_Base_StockBroker_svnt) : ciao_servant { avoids += ace_for_tao after += Stock_Base_skel Stock_Base_StockBroker_exec sharedname = StockBroker_svnt @@ -118,7 +118,7 @@ project(Stock_Base_StockBroker_svnt) : ciao_servant_dnc { } } -project (Stock_Base_StockBrokerDriver) : ciao_client_dnc, valuetype { +project (Stock_Base_StockBrokerDriver) : ccm_stub, valuetype { avoids += ace_for_tao exename = StockBrokerDriver after += Stock_Base_StockBroker_stub diff --git a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp index 556aed2a5ae..3d99bd4976f 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp +++ b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.cpp @@ -130,12 +130,7 @@ namespace CIDL_StockBroker_Impl } void - StockBroker_exec_i::ciao_preactivate () - { - } - - void - StockBroker_exec_i::ciao_postactivate () + StockBroker_exec_i::configuration_complete () { } diff --git a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h index b89e30ec48a..4730410cf23 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h +++ b/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBroker_exec.h @@ -74,9 +74,7 @@ namespace CIDL_StockBroker_Impl virtual void set_session_context (::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); diff --git a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc index 5c88528692f..30f1d0024ac 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc +++ b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor.mpc @@ -32,7 +32,7 @@ project(Stock_Base_StockDistributor_cidl_gen) : ciaocidldefaults, taoidldefaults } } -project(Stock_Base_StockDistributor_stub) : ciao_client_dnc { +project(Stock_Base_StockDistributor_stub) : ccm_stub { avoids += ace_for_tao after += Stock_Base_StockDistributor_idl_gen Stock_Base_stub libs += Stock_Base_stub @@ -57,7 +57,7 @@ project(Stock_Base_StockDistributor_stub) : ciao_client_dnc { } } -project(Stock_Base_StockDistributor_exec) : ciao_component_dnc { +project(Stock_Base_StockDistributor_exec) : ciao_executor { avoids += ace_for_tao after += Stock_Base_StockDistributor_cidl_gen Stock_Base_StockDistributor_stub sharedname = StockDistributor_exec @@ -85,7 +85,7 @@ project(Stock_Base_StockDistributor_exec) : ciao_component_dnc { } -project(Stock_Base_StockDistributor_svnt) : ciao_servant_dnc { +project(Stock_Base_StockDistributor_svnt) : ciao_servant { avoids += ace_for_tao after += Stock_Base_skel Stock_Base_StockDistributor_exec sharedname = StockDistributor_svnt @@ -118,7 +118,7 @@ project(Stock_Base_StockDistributor_svnt) : ciao_servant_dnc { } } -project (Stock_Base_StockDistributorDriver) : ciao_client_dnc, valuetype { +project (Stock_Base_StockDistributorDriver) : ccm_stub, valuetype { avoids += ace_for_tao exename = StockDistributorDriver after += Stock_Base_StockDistributor_stub diff --git a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp index c63e1fc0e72..6bac21fff89 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp +++ b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.cpp @@ -116,14 +116,11 @@ namespace CIDL_StockDistributor_Impl pulse_Generator::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), - this, - handle, - close_mask)); - } + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), + this, + handle, + close_mask)); return 0; } @@ -272,12 +269,7 @@ namespace CIDL_StockDistributor_Impl } void - StockDistributor_exec_i::ciao_preactivate () - { - } - - void - StockDistributor_exec_i::ciao_postactivate () + StockDistributor_exec_i::configuration_complete () { } diff --git a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h index 08b14272f70..9de7936fcd1 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h +++ b/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributor_exec.h @@ -163,10 +163,7 @@ namespace CIDL_StockDistributor_Impl ::Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (); - - virtual void - ciao_postactivate (); + configuration_complete (); virtual void ccm_activate (); diff --git a/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc b/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc index 8109fdb92f0..e6dd72b5e41 100644 --- a/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc +++ b/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base.mpc @@ -14,7 +14,7 @@ project(Stock_Base_idl_gen) : taoidldefaults, anytypecode { } } -project(Stock_Base_stub) : ciao_client_dnc { +project(Stock_Base_stub) : ccm_stub { avoids += ace_for_tao after += Stock_Base_idl_gen libs += @@ -40,7 +40,7 @@ project(Stock_Base_stub) : ciao_client_dnc { } -project(Stock_Base_skel) : ciao_component_dnc { +project(Stock_Base_skel) : ciao_executor { avoids += ace_for_tao after += Stock_Base_stub sharedname = Stock_Base_skel diff --git a/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc b/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc index 5572651b0ce..8962e761c59 100644 --- a/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc +++ b/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc @@ -34,7 +34,7 @@ project(BMClosedED_lem_gen) : ciaocidldefaults, taoidldefaults { } -project(BMClosedED_stub): ciao_client_dnc { +project(BMClosedED_stub): ccm_stub { after += BasicSP_stub BMClosedED_stub_gen sharedname = BMClosedED_stub includes += $(CIAO_ROOT)/examples/BasicSP @@ -59,7 +59,7 @@ project(BMClosedED_stub): ciao_client_dnc { } -project(BMClosedED_exec) : ciao_component_dnc { +project(BMClosedED_exec) : ciao_executor { after += BMClosedED_stub BMClosedED_lem_gen BasicSP_exec sharedname = BMClosedED_exec libs += BMClosedED_stub @@ -88,7 +88,7 @@ project(BMClosedED_exec) : ciao_component_dnc { } -project(BMClosedED_svnt) : ciao_servant_dnc { +project(BMClosedED_svnt) : ciao_servant { after += BasicSP_svnt BMClosedED_exec includes += $(CIAO_ROOT)/examples/BasicSP diff --git a/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp b/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp index 08a3402dcbc..e30388511ce 100644 --- a/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp +++ b/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp @@ -31,14 +31,11 @@ void MyImpl::BMClosedED_exec_i::push_in_avail (BasicSP::DataAvailable *) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "BMClosedED - Doing computations \n")); - - ACE_DEBUG ((LM_DEBUG, - "BMClosedED - Doing data fetch \n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "BMClosedED - Doing computations \n")); + + ACE_DEBUG ((LM_EMERGENCY, + "BMClosedED - Doing data fetch \n")); // Refresh position BasicSP::ReadData_var dat @@ -46,7 +43,7 @@ MyImpl::BMClosedED_exec_i::push_in_avail (BasicSP::DataAvailable *) if (CORBA::is_nil (dat.in ())) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "BMClosedED - got nil from get_connection \n")); throw CORBA::BAD_INV_ORDER (); @@ -55,12 +52,9 @@ MyImpl::BMClosedED_exec_i::push_in_avail (BasicSP::DataAvailable *) CORBA::String_var str = dat->get_data (); - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "BMClosedED - Display data is [%s] \n", - str.in ())); - } + ACE_DEBUG ((LM_EMERGENCY, + "BMClosedED - Display data is [%s] \n", + str.in ())); if (ACE_OS::strcmp (str.in (), "BM DEVICE DATA") == 0) { @@ -80,11 +74,8 @@ MyImpl::BMClosedED_exec_i::set_session_context ( Components::SessionContext_ptr ctx ) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMClosedED_exec_i::set_session_context\n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMClosedED_exec_i::set_session_context\n")); this->context_ = BasicSP::CCM_BMClosedED_Context::_narrow (ctx); @@ -97,31 +88,22 @@ MyImpl::BMClosedED_exec_i::set_session_context ( } void -MyImpl::BMClosedED_exec_i::ciao_preactivate () +MyImpl::BMClosedED_exec_i::configuration_complete () { } void MyImpl::BMClosedED_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMClosedED_exec_i::ccm_activate\n")); - } - -} - -void -MyImpl::BMClosedED_exec_i::ciao_postactivate () -{ + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMClosedED_exec_i::ccm_activate\n")); } void MyImpl::BMClosedED_exec_i::ccm_passivate () { // if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::BMClosedED_exec_i::ccm_passivate\n")); } @@ -129,10 +111,23 @@ void MyImpl::BMClosedED_exec_i::ccm_remove () { // if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::BMClosedED_exec_i::ccm_remove\n")); } +extern "C" BMCLOSEDED_EXEC_Export ::Components::EnterpriseComponent_ptr +create_BasicSP_BMClosedED_Impl (void) +{ + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + MyImpl::BMClosedED_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; +} + /// Default ctor. MyImpl::BMClosedEDHome_exec_i::BMClosedEDHome_exec_i () { diff --git a/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h b/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h index 508b5d99d06..df241e09315 100644 --- a/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h +++ b/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h @@ -54,16 +54,12 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (); + configuration_complete (); virtual void ccm_activate (); virtual void - ciao_postactivate (); - - - virtual void ccm_passivate (); virtual void @@ -77,6 +73,9 @@ namespace MyImpl BasicSP::CCM_BMClosedED_Context_var context_; }; + extern "C" BMCLOSEDED_EXEC_Export ::Components::EnterpriseComponent_ptr + create_BasicSP_BMClosedED_Impl (void); + /** * @class BMClosedEDHome_exec_i * diff --git a/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc b/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc index eb6561475e9..d45b363898e 100644 --- a/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc +++ b/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc @@ -34,7 +34,7 @@ project(BMDevice_lem_gen) : ciaocidldefaults, taoidldefaults { } -project(BMDevice_stub): ciao_client_dnc { +project(BMDevice_stub): ccm_stub { after += BasicSP_stub BMDevice_stub_gen sharedname = BMDevice_stub includes += $(CIAO_ROOT)/examples/BasicSP @@ -62,7 +62,7 @@ project(BMDevice_stub): ciao_client_dnc { } -project(BMDevice_exec) : ciao_component_dnc { +project(BMDevice_exec) : ciao_executor { after += BMDevice_stub BMDevice_lem_gen BasicSP_exec sharedname = BMDevice_exec @@ -90,7 +90,7 @@ project(BMDevice_exec) : ciao_component_dnc { } } -project(BMDevice_svnt) : ciao_servant_dnc { +project(BMDevice_svnt) : ciao_servant { after += BasicSP_svnt BMDevice_exec includes += $(CIAO_ROOT)/examples/BasicSP diff --git a/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp b/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp index b57c811a373..781e8707d95 100644 --- a/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp +++ b/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp @@ -30,11 +30,8 @@ MyImpl::BMDevice_exec_i::push_timeout (BasicSP::TimeOut *) // Notify others BasicSP::DataAvailable_var event = new OBV_BasicSP::DataAvailable; - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "BMDevice, received a timeout from EC \n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "BMDevice, received a timeout from EC \n")); this->context_->push_data_available (event); } @@ -43,11 +40,8 @@ MyImpl::BMDevice_exec_i::push_timeout (BasicSP::TimeOut *) void MyImpl::BMDevice_exec_i:: set_session_context (Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDevice_exec_i::set_session_context\n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDevice_exec_i::set_session_context\n")); this->context_ = BasicSP::CCM_BMDevice_Context::_narrow (ctx); @@ -60,44 +54,42 @@ MyImpl::BMDevice_exec_i:: set_session_context (Components::SessionContext_ptr ct } void -MyImpl::BMDevice_exec_i::ciao_preactivate () +MyImpl::BMDevice_exec_i::configuration_complete () { } void MyImpl::BMDevice_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDevice_exec_i::ccm_activate\n")); - } - + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDevice_exec_i::ccm_activate\n")); } void -MyImpl::BMDevice_exec_i::ciao_postactivate () +MyImpl::BMDevice_exec_i::ccm_passivate () { + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDevice_exec_i::ccm_passivate\n")); } void -MyImpl::BMDevice_exec_i::ccm_passivate () +MyImpl::BMDevice_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDevice_exec_i::ccm_passivate\n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDevice_exec_i::ccm_remove\n")); } -void -MyImpl::BMDevice_exec_i::ccm_remove () +extern "C" BMDEVICE_EXEC_Export ::Components::EnterpriseComponent_ptr +create_BasicSP_BMDevice_Impl (void) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDevice_exec_i::ccm_remove\n")); - } + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + MyImpl::BMDevice_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; } /// Default ctor. diff --git a/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h b/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h index 5a8b7a09004..16d97b47e32 100644 --- a/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h +++ b/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h @@ -52,13 +52,10 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (); + configuration_complete (); virtual void ccm_activate (); - virtual void - ciao_postactivate (); - virtual void ccm_passivate (); @@ -74,6 +71,9 @@ namespace MyImpl MyImpl::ReadData_Impl* data_read_; }; + extern "C" BMDEVICE_EXEC_Export ::Components::EnterpriseComponent_ptr + create_BasicSP_BMDevice_Impl (void); + /** * @class BMDeviceHome_exec_i * diff --git a/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc b/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc index d8d3f5cf486..580b71430de 100644 --- a/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc +++ b/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc @@ -33,7 +33,7 @@ project(BMDisplay_lem_gen) : ciaocidldefaults, taoidldefaults { } } -project(BMDisplay_stub): ciao_client_dnc { +project(BMDisplay_stub): ccm_stub { after += BasicSP_stub BMDisplay_stub_gen sharedname = BMDisplay_stub includes += $(CIAO_ROOT)/examples/BasicSP @@ -62,7 +62,7 @@ project(BMDisplay_stub): ciao_client_dnc { -project(BMDisplay_exec) : ciao_component_dnc { +project(BMDisplay_exec) : ciao_executor { after += BMDisplay_stub BMDisplay_lem_gen BasicSP_exec sharedname = BMDisplay_exec @@ -94,7 +94,7 @@ project(BMDisplay_exec) : ciao_component_dnc { } -project(BMDisplay_svnt) : ciao_servant_dnc { +project(BMDisplay_svnt) : ciao_servant { after += BasicSP_svnt BMDisplay_exec includes += $(CIAO_ROOT)/examples/BasicSP diff --git a/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp b/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp index 516f8465f8c..b8e9e543408 100644 --- a/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp +++ b/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp @@ -22,15 +22,11 @@ MyImpl::BMDisplay_exec_i::push_data_ready ( { ACE_UNUSED_ARG (ev); - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "BMDisplay - Doing computations \n")); - - ACE_DEBUG ((LM_DEBUG, - "BMDisplay - Doing data fetch \n")); - } - + ACE_DEBUG ((LM_EMERGENCY, + "BMDisplay - Doing computations \n")); + + ACE_DEBUG ((LM_EMERGENCY, + "BMDisplay - Doing data fetch \n")); // Refresh position BasicSP::ReadData_var dat = this->context_->get_connection_comp_data (); @@ -41,7 +37,7 @@ MyImpl::BMDisplay_exec_i::push_data_ready ( CORBA::String_var str = dat->get_data (); - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "BMDisplay - Display data is [%s] \n", str.in ())); @@ -53,12 +49,8 @@ MyImpl::BMDisplay_exec_i::set_session_context ( Components::SessionContext_ptr ctx ) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDisplay_exec_i::set_session_context\n")); - } - + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDisplay_exec_i::set_session_context\n")); this->context_ = BasicSP::CCM_BMDisplay_Context::_narrow (ctx); @@ -68,7 +60,7 @@ MyImpl::BMDisplay_exec_i::set_session_context ( } void -MyImpl::BMDisplay_exec_i::ciao_preactivate ( +MyImpl::BMDisplay_exec_i::configuration_complete ( ) { } @@ -76,39 +68,36 @@ MyImpl::BMDisplay_exec_i::ciao_preactivate ( void MyImpl::BMDisplay_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDisplay_exec_i::ccm_activate\n")); - } - + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDisplay_exec_i::ccm_activate\n")); } void -MyImpl::BMDisplay_exec_i::ciao_postactivate ( +MyImpl::BMDisplay_exec_i::ccm_passivate ( ) { + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDisplay_exec_i::ccm_passivate\n")); } void -MyImpl::BMDisplay_exec_i::ccm_passivate ( - ) +MyImpl::BMDisplay_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDisplay_exec_i::ccm_passivate\n")); - } + ACE_DEBUG ((LM_EMERGENCY, + "MyImpl::BMDisplay_exec_i::ccm_remove\n")); } -void -MyImpl::BMDisplay_exec_i::ccm_remove () +extern "C" BMDISPLAY_EXEC_Export ::Components::EnterpriseComponent_ptr +create_BasicSP_BMDisplay_Impl (void) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::BMDisplay_exec_i::ccm_remove\n")); - } + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + MyImpl::BMDisplay_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; } /// Default ctor. diff --git a/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h b/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h index 8783b52ff4d..c56d57a3825 100644 --- a/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h +++ b/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h @@ -46,15 +46,12 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (); + configuration_complete (); virtual void ccm_activate (); virtual void - ciao_postactivate (); - - virtual void ccm_passivate (); virtual void @@ -64,6 +61,9 @@ namespace MyImpl BasicSP::CCM_BMDisplay_Context_var context_; }; + extern "C" BMDISPLAY_EXEC_Export ::Components::EnterpriseComponent_ptr + create_BasicSP_BMDisplay_Impl (void); + /** * @class BMDisplayHome_exec_impl * diff --git a/CIAO/examples/BasicSP/BasicSP.mpc b/CIAO/examples/BasicSP/BasicSP.mpc index 90b1de44e52..97377aa445b 100644 --- a/CIAO/examples/BasicSP/BasicSP.mpc +++ b/CIAO/examples/BasicSP/BasicSP.mpc @@ -11,27 +11,31 @@ project(BasicSP_stub_gen): taoidldefaults, anytypecode { IDL_Files { BasicSP.idl } - } -project(BasicSP_lem_gen) : ciaocidldefaults, taoidldefaults { +project(BasicSP_lem_gen) : ciaocidldefaults { custom_only = 1 - idlflags += -Wb,stub_export_macro=BASICSP_EXEC_Export \ - -Wb,stub_export_include=BasicSP_exec_export.h \ - -SS cidlflags -= -- cidlflags += --lem-force-all -- CIDL_Files { BasicSP.idl } +} + +project(BasicSP_lem_gen_idl) : taoidldefaults { + custom_only = 1 + after += BasicSP_lem_gen + idlflags += -Wb,stub_export_macro=BASICSP_EXEC_Export \ + -Wb,stub_export_include=BasicSP_exec_export.h \ + -SS IDL_Files { BasicSPE.idl } } -project(BasicSP_stub): ciao_client_dnc { +project(BasicSP_stub): ccm_stub { after += BasicSP_stub_gen sharedname = BasicSP_stub dynamicflags = BASICSP_STUB_BUILD_DLL @@ -39,23 +43,18 @@ project(BasicSP_stub): ciao_client_dnc { IDL_Files { } - Header_Files { BasicSPC.h } - Source_Files { BasicSPC.cpp } - Inline_Files { - } - } -project(BasicSP_exec) : ciao_component_dnc { - after += BasicSP_stub BasicSP_lem_gen +project(BasicSP_exec) : ciao_executor { + after += BasicSP_stub BasicSP_lem_gen_idl sharedname = BasicSP_exec libs += BasicSP_stub dynamicflags = BASICSP_EXEC_BUILD_DLL @@ -63,24 +62,20 @@ project(BasicSP_exec) : ciao_component_dnc { IDL_Files { } - Header_Files { BasicSP_exec.h BasicSP_exec_export.h BasicSPEC.h } - Source_Files { BasicSP_exec.cpp BasicSPEC.cpp } - Inline_Files { - } } -project(BasicSP_svnt) : ciao_servant_dnc { +project(BasicSP_svnt) : ciao_servant { after += BasicSP_exec sharedname = BasicSP_svnt libs += BasicSP_stub BasicSP_exec @@ -88,24 +83,17 @@ project(BasicSP_svnt) : ciao_servant_dnc { dynamicflags = BASICSP_SVNT_BUILD_DLL IDL_Files { - } - CIDL_Files { - } - Header_Files { BasicSPS.h BasicSP_svnt.h } - Source_Files { BasicSPS.cpp BasicSP_svnt.cpp } - Inline_Files { - } } diff --git a/CIAO/examples/BasicSP/EC/EC.mpc b/CIAO/examples/BasicSP/EC/EC.mpc index 1a3a17ef3e9..dbdb468cca7 100644 --- a/CIAO/examples/BasicSP/EC/EC.mpc +++ b/CIAO/examples/BasicSP/EC/EC.mpc @@ -34,7 +34,7 @@ project(EC_lem_gen) : ciaocidldefaults, taoidldefaults { } -project(EC_stub): ciao_client_dnc { +project(EC_stub): ccm_stub { after += BasicSP_stub EC_stub_gen sharedname = EC_stub includes += $(CIAO_ROOT)/examples/BasicSP @@ -61,7 +61,7 @@ project(EC_stub): ciao_client_dnc { } -project(EC_exec) : ciao_component_dnc { +project(EC_exec) : ciao_executor { after += EC_stub EC_lem_gen BasicSP_exec sharedname = EC_exec @@ -89,7 +89,7 @@ project(EC_exec) : ciao_component_dnc { } } -project(EC_svnt) : ciao_servant_dnc { +project(EC_svnt) : ciao_servant { after += BasicSP_svnt EC_exec includes += $(CIAO_ROOT)/examples/BasicSP @@ -118,7 +118,7 @@ project(EC_svnt) : ciao_servant_dnc { } -project (EC_client) : ciao_client_dnc { +project (EC_client) : ccm_stub { after += EC_stub exename = client libs += EC_stub BasicSP_stub @@ -141,7 +141,7 @@ project (EC_client) : ciao_client_dnc { } -project (EC_controller) : ciao_client_dnc { +project (EC_controller) : ccm_stub { after += EC_stub exename = controller includes += $(CIAO_ROOT)/examples/BasicSP diff --git a/CIAO/examples/BasicSP/EC/EC_exec.cpp b/CIAO/examples/BasicSP/EC/EC_exec.cpp index 52929f35378..e71368dad6c 100644 --- a/CIAO/examples/BasicSP/EC/EC_exec.cpp +++ b/CIAO/examples/BasicSP/EC/EC_exec.cpp @@ -1,7 +1,7 @@ // $Id$ #include "EC_exec.h" -#include "CIAO_common.h" +#include "ciao/CIAO_common.h" #include "ace/Timer_Queue.h" #include "ace/Reactor.h" @@ -35,8 +35,7 @@ MyImpl::timeout_Handler::close_h () this->done_ = 1; this->reactor ()->notify (); - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "Waiting\n")); + ACE_DEBUG ((LM_EMERGENCY, "Waiting\n")); return this->wait (); } @@ -79,12 +78,11 @@ int MyImpl::timeout_Handler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), - this, - handle, - close_mask)); + ACE_DEBUG ((LM_EMERGENCY, + ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), + this, + handle, + close_mask)); return 0; } @@ -95,7 +93,7 @@ MyImpl::timeout_Handler::handle_timeout (const ACE_Time_Value &, { this->pulse_callback_->pulse (); - // ACE_DEBUG ((LM_DEBUG, + // ACE_DEBUG ((LM_EMERGENCY, // ACE_TEXT ("[%x] with count #%05d timed out at %d.%d!\n"), // this, // tv.sec (), @@ -179,8 +177,7 @@ MyImpl::EC_exec_i::active () void MyImpl::EC_exec_i::set_session_context (Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::set_session_context\n")); + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::EC_exec_i::set_session_context\n")); this->context_ = BasicSP::CCM_EC_Context::_narrow (ctx); @@ -192,37 +189,29 @@ MyImpl::EC_exec_i::set_session_context (Components::SessionContext_ptr ctx) } void -MyImpl::EC_exec_i::ciao_preactivate () +MyImpl::EC_exec_i::configuration_complete () { } void MyImpl::EC_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_activate\n")); + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::EC_exec_i::ccm_activate\n")); this->pulser_.open_h (); } void -MyImpl::EC_exec_i::ciao_postactivate () -{ -} - -void MyImpl::EC_exec_i::ccm_passivate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_passivate\n")); + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::EC_exec_i::ccm_passivate\n")); this->pulser_.close_h (); } void MyImpl::EC_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_remove\n")); + ACE_DEBUG ((LM_EMERGENCY, "MyImpl::EC_exec_i::ccm_remove\n")); } void @@ -230,9 +219,8 @@ MyImpl::EC_exec_i::pulse (void) { try { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Pushing BasicSP::TimeOut event!\n"))); + ACE_DEBUG ((LM_EMERGENCY, + ACE_TEXT ("Pushing BasicSP::TimeOut event!\n"))); BasicSP::TimeOut_var ev = new OBV_BasicSP::TimeOut (); @@ -245,6 +233,19 @@ MyImpl::EC_exec_i::pulse (void) } } +extern "C" EC_EXEC_Export ::Components::EnterpriseComponent_ptr +create_BasicSP_EC_Impl (void) +{ + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + MyImpl::EC_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; +} + MyImpl::ECHome_exec_i::ECHome_exec_i () { } diff --git a/CIAO/examples/BasicSP/EC/EC_exec.h b/CIAO/examples/BasicSP/EC/EC_exec.h index 4b91f72a2d3..67d0171082b 100644 --- a/CIAO/examples/BasicSP/EC/EC_exec.h +++ b/CIAO/examples/BasicSP/EC/EC_exec.h @@ -70,6 +70,9 @@ namespace MyImpl ACE_Thread_Manager thr_mgr_; }; + extern "C" EC_EXEC_Export ::Components::EnterpriseComponent_ptr + create_BasicSP_EC_Impl (void); + /** * @class EC_exec_i * @@ -107,13 +110,10 @@ namespace MyImpl virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/examples/BasicSP/EC/controller.cpp b/CIAO/examples/BasicSP/EC/controller.cpp index 8fe37ea5fa5..40a27d1e58e 100644 --- a/CIAO/examples/BasicSP/EC/controller.cpp +++ b/CIAO/examples/BasicSP/EC/controller.cpp @@ -11,8 +11,8 @@ #include "ace/Get_Opt.h" #include "ace/streams.h" -const char *rategen_ior_ = 0; -int rate = 2; +const char *rategen_ior_ = "file://rategen.ior"; +int rate = 3; int turn_on = 1; int @@ -101,7 +101,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { pulser->hertz (rate); - ACE_DEBUG ((LM_DEBUG, "Start up the Event services\n")); + ACE_DEBUG ((LM_EMERGENCY, "Start up the Event services\n")); pulser->start (); } @@ -109,7 +109,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { pulser->stop (); - ACE_DEBUG ((LM_DEBUG, "Stop the ES\n")); + ACE_DEBUG ((LM_EMERGENCY, "Stop the ES\n")); } orb->destroy (); diff --git a/CIAO/examples/BasicSP/descriptors/BasicSP.cdp b/CIAO/examples/BasicSP/descriptors/BasicSP.cdp deleted file mode 100644 index 9679a125e55..00000000000 --- a/CIAO/examples/BasicSP/descriptors/BasicSP.cdp +++ /dev/null @@ -1,649 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:deploymentPlan xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>1D6FDF7A-96B6-42C0-8C29-D9135ACD5491</UUID> - - <implementation id="_B89013A8-AE19-4719-BC89-A68C5FB57A83"> - <name>BasicSP.ComponentImplementations.BMClosedED.BMClosedED</name> - <source/> - <artifact>_2DB384A3-5C66-49DF-8F82-B5197B27B69D</artifact> - <artifact>_A4A6CF39-DC3C-4FBC-AC22-1F3140506315</artifact> - <artifact>_E7F6E4B9-39FD-4984-A445-CFAB41B12FCD</artifact> - </implementation> - - <implementation id="_0BA28CFB-6384-4CB8-8802-FBE2265F621C"> - <name>BasicSP.ComponentImplementations.BMDevice.BMDevice</name> - <source/> - <artifact>_65B95763-506E-43FF-BF45-74D39F3D6722</artifact> - <artifact>_224BE213-886F-4B13-93D3-306823AF3CCE</artifact> - <artifact>_48EAED0D-B445-49B6-A76D-7DFAB05DD062</artifact> - </implementation> - - <implementation id="_E6D5AE4E-0F9A-4BCB-9F8B-83BE7CD7796E"> - <name>BasicSP.ComponentImplementations.BMDisplay_Windows.BMDisplay_Windows</name> - <source/> - <artifact>_5015E55E-3D64-4A41-A828-93118654490F</artifact> - <artifact>_673E9592-F577-4EF4-96E7-A64EA82D2AAE</artifact> - <artifact>_2621661F-D144-4317-AEEE-118E8AFAAC7E</artifact> - </implementation> - - <implementation id="_903A5BA3-3794-4D58-A5A6-143EEF7EEB2A"> - <name>BasicSP.ComponentImplementations.EC_Windows.EC_Windows</name> - <source/> - <artifact>_3F773C52-78B8-49D1-8E0C-8C7DD346B3D9</artifact> - <artifact>_D2F6D6D3-A06D-426D-A179-484F35A6AE98</artifact> - <artifact>_DE25A81F-758F-4E23-87A8-C54ED43A36CD</artifact> - </implementation> - - <implementation id="_49DC6AC8-76B6-4166-B953-88CCAED17955"> - <name>BasicSP.ComponentImplementations.BMClosedED_Windows.BMClosedED_Windows</name> - <source/> - <artifact>_396EF214-CE5E-4A3B-8F0F-5DB1F6A23F12</artifact> - <artifact>_6D5A2477-3CD7-4AE6-BB00-D9948E77058B</artifact> - <artifact>_D1890470-82F5-4832-8C99-2E6DF64C636F</artifact> - </implementation> - - <implementation id="_6E94C415-564F-4DFE-A587-C37248382137"> - <name>BasicSP.ComponentImplementations.BMDevice_Windows.BMDevice_Windows</name> - <source/> - <artifact>_62852846-B6C5-4779-9E79-52B67E3DE268</artifact> - <artifact>_DED02302-3E81-4A6E-B71D-8821D6CEB2FE</artifact> - <artifact>_5060A846-E6AA-402D-A14C-774B914BF9EF</artifact> - </implementation> - - <implementation id="_5E0BC014-4F05-4374-9B21-03DBA0142B7F"> - <name>BasicSP.ComponentImplementations.BMDisplay.BMDisplay</name> - <source/> - <artifact>_EA190017-CEC5-48D4-AB26-34E40E6BCD03</artifact> - <artifact>_9D3A55F7-B7F9-4612-ABB5-A5FC5B69D710</artifact> - <artifact>_19089E67-07B1-47C4-A7F4-DC4F3EA81227</artifact> - </implementation> - - <implementation id="_D2F1AA1B-4E16-46AC-9A1B-9F04253F14BD"> - <name>BasicSP.ComponentImplementations.EC.EC</name> - <source/> - <artifact>_63C63797-2B3A-46F1-82B5-81DC6FAE6042</artifact> - <artifact>_219F2FAB-E96E-4CB4-B1F6-22CFFE7667F9</artifact> - <artifact>_AE86F474-9286-4AA2-8000-2C5813EB65A6</artifact> - </implementation> - - <implementation id="_71359436-E878-492B-86E9-660414403D25"> - <name>BasicSP.ComponentImplementations.BasicSPAsmImplementation.BasicSPAsmMonolithicImpl</name> - <source/> - <artifact>_66FB9FB8-EB86-48BD-9378-E0F68F34887B</artifact> - <artifact>_67BF3864-3AE9-4401-A661-50D2558FF7BF</artifact> - <artifact>_ADF31B15-6CCE-4BAF-A379-2592EC613B4E</artifact> - </implementation> - - <instance id="BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED"> - <name>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</name> - <node>BMDisplay</node> - <source/> - <implementation>_B89013A8-AE19-4719-BC89-A68C5FB57A83</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>BMClosedED.ior</string> - </value> - </value> - </configProperty> - </instance> - - <instance id="BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice"> - <name>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</name> - <node>BMDisplay</node> - <source/> - <implementation>_0BA28CFB-6384-4CB8-8802-FBE2265F621C</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>BMDevice.ior</string> - </value> - </value> - </configProperty> - </instance> - - <instance id="BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplay"> - <name>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplay</name> - <node>BMDisplay</node> - <source/> - <implementation>_E6D5AE4E-0F9A-4BCB-9F8B-83BE7CD7796E</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>BMDisplay.ior</string> - </value> - </value> - </configProperty> - </instance> - - <instance id="BasicSP.ComponentImplementations.BasicSP.BasicSP.EC"> - <name>BasicSP.ComponentImplementations.BasicSP.BasicSP.EC</name> - <node>EC</node> - <source/> - <implementation>_903A5BA3-3794-4D58-A5A6-143EEF7EEB2A</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>EC.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>datain_data_readBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedEDBasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</name> - <internalEndpoint> - <portName>datain</portName> - <kind>SimplexReceptacle</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</instance> - </internalEndpoint> - <internalEndpoint> - <portName>data_read</portName> - <kind>Facet</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</instance> - </internalEndpoint> - </connection> - - <connection> - <name>comp_data_dataoutBasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplayBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</name> - <internalEndpoint> - <portName>comp_data</portName> - <kind>SimplexReceptacle</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplay</instance> - </internalEndpoint> - <internalEndpoint> - <portName>dataout</portName> - <kind>Facet</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</instance> - </internalEndpoint> - </connection> - - <connection> - <name>timeout_timeoutBasicSP.ComponentImplementations.BasicSP.BasicSP.ECBasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</name> - <internalEndpoint> - <portName>timeout</portName> - <kind>EventPublisher</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.EC</instance> - </internalEndpoint> - <internalEndpoint> - <portName>timeout</portName> - <kind>EventConsumer</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</instance> - </internalEndpoint> - </connection> - - <connection> - <name>data_available_in_availBasicSP.ComponentImplementations.BasicSP.BasicSP.BMDeviceBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</name> - <internalEndpoint> - <portName>data_available</portName> - <kind>EventPublisher</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDevice</instance> - </internalEndpoint> - <internalEndpoint> - <portName>in_avail</portName> - <kind>EventConsumer</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</instance> - </internalEndpoint> - </connection> - - <connection> - <name>out_avail_data_readyBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedEDBasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplay</name> - <internalEndpoint> - <portName>out_avail</portName> - <kind>EventPublisher</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedED</instance> - </internalEndpoint> - <internalEndpoint> - <portName>data_ready</portName> - <kind>EventConsumer</kind> - <instance>BasicSP.ComponentImplementations.BasicSP.BasicSP.BMDisplay</instance> - </internalEndpoint> - </connection> - - <artifact id="_2DB384A3-5C66-49DF-8F82-B5197B27B69D"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_exec</name> - <source/> - <node/> - <location>BMClosedED_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMClosedEDHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_E7F6E4B9-39FD-4984-A445-CFAB41B12FCD"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_stub</name> - <source/> - <node/> - <location>BMClosedED_stub</location> - </artifact> - - <artifact id="_A4A6CF39-DC3C-4FBC-AC22-1F3140506315"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_svnt</name> - <source/> - <node/> - <location>BMClosedED_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMClosedEDHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_396EF214-CE5E-4A3B-8F0F-5DB1F6A23F12"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_exec_Windows</name> - <source/> - <node/> - <location>BMClosedED_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMClosedEDHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_D1890470-82F5-4832-8C99-2E6DF64C636F"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_stub_Windows</name> - <source/> - <node/> - <location>BMClosedED_stub</location> - </artifact> - - <artifact id="_6D5A2477-3CD7-4AE6-BB00-D9948E77058B"> - <name>BasicSP.ImplementationArtifacts.BMClosedED.BMClosedED_svnt_Windows</name> - <source/> - <node/> - <location>BMClosedED_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMClosedEDHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_65B95763-506E-43FF-BF45-74D39F3D6722"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_exec</name> - <source/> - <node/> - <location>BMDevice_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDeviceHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_224BE213-886F-4B13-93D3-306823AF3CCE"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_stub</name> - <source/> - <node/> - <location>BMDevice_stub</location> - </artifact> - - <artifact id="_48EAED0D-B445-49B6-A76D-7DFAB05DD062"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_svnt</name> - <source/> - <node/> - <location>BMDevice_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDeviceHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_DED02302-3E81-4A6E-B71D-8821D6CEB2FE"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_svnt_Windows</name> - <source/> - <node/> - <location>BMDevice_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDeviceHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_5060A846-E6AA-402D-A14C-774B914BF9EF"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_stub_Windows</name> - <source/> - <node/> - <location>BMDevice_stub</location> - </artifact> - - <artifact id="_62852846-B6C5-4779-9E79-52B67E3DE268"> - <name>BasicSP.ImplementationArtifacts.BMDevice.BMDevice_exec_Windows</name> - <source/> - <node/> - <location>BMDevice_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDeviceHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_19089E67-07B1-47C4-A7F4-DC4F3EA81227"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_exec</name> - <source/> - <node/> - <location>BMDisplay_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDisplayHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_9D3A55F7-B7F9-4612-ABB5-A5FC5B69D710"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_svnt</name> - <source/> - <node/> - <location>BMDisplay_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDisplayHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_EA190017-CEC5-48D4-AB26-34E40E6BCD03"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_stub</name> - <source/> - <node/> - <location>BMDisplay_stub</location> - </artifact> - - <artifact id="_2621661F-D144-4317-AEEE-118E8AFAAC7E"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_exec_Windows</name> - <source/> - <node/> - <location>BMDisplay_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDisplayHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_673E9592-F577-4EF4-96E7-A64EA82D2AAE"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_svnt_Windows</name> - <source/> - <node/> - <location>BMDisplay_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BMDisplayHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_5015E55E-3D64-4A41-A828-93118654490F"> - <name>BasicSP.ImplementationArtifacts.BMDisplay.BMDisplay_stub_Windows</name> - <source/> - <node/> - <location>BMDisplay_stub</location> - </artifact> - - <artifact id="_219F2FAB-E96E-4CB4-B1F6-22CFFE7667F9"> - <name>BasicSP.ImplementationArtifacts.EC.EC_exec</name> - <source/> - <node/> - <location>EC_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_ECHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_AE86F474-9286-4AA2-8000-2C5813EB65A6"> - <name>BasicSP.ImplementationArtifacts.EC.EC_svnt</name> - <source/> - <node/> - <location>EC_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_ECHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_63C63797-2B3A-46F1-82B5-81DC6FAE6042"> - <name>BasicSP.ImplementationArtifacts.EC.EC_stub</name> - <source/> - <node/> - <location>EC_stub</location> - </artifact> - - <artifact id="_3F773C52-78B8-49D1-8E0C-8C7DD346B3D9"> - <name>BasicSP.ImplementationArtifacts.EC.EC_stub_Windows</name> - <source/> - <node/> - <location>EC_stub</location> - </artifact> - - <artifact id="_D2F6D6D3-A06D-426D-A179-484F35A6AE98"> - <name>BasicSP.ImplementationArtifacts.EC.EC_svnt_Windows</name> - <source/> - <node/> - <location>EC_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_ECHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_DE25A81F-758F-4E23-87A8-C54ED43A36CD"> - <name>BasicSP.ImplementationArtifacts.EC.EC_exec_Windows</name> - <source/> - <node/> - <location>EC_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_ECHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_C1990F73-87B6-42AF-93CA-858EC98A4D87"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_stub</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_96FC1B6C-062F-4C29-867F-2C26352279CF"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_svnt</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_E7C42E93-353F-4D17-96C5-3DAF63647247"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_svnt_Windows</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_5CF0BFBB-81CE-4FA4-85C2-36287EF9495A"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_stub_Windows</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_513FCD8E-7AFD-415B-9CB2-913FDD4A90FA"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_exec</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_03E19F2A-9CA2-4050-A0D7-5277E3BD9BF2"> - <name>BasicSP.ImplementationArtifacts.CommonArtifacts.BasicSP_exec_Windows</name> - <source/> - <node/> - <location/> - </artifact> - - <artifact id="_66FB9FB8-EB86-48BD-9378-E0F68F34887B"> - <name>BasicSP.ImplementationArtifacts.BasicSPAsmArtifacts.BasicSPAsm_stub</name> - <source/> - <node/> - <location>BasicSPAsm_stub</location> - </artifact> - - <artifact id="_67BF3864-3AE9-4401-A661-50D2558FF7BF"> - <name>BasicSP.ImplementationArtifacts.BasicSPAsmArtifacts.BasicSPAsm_svnt</name> - <source/> - <node/> - <location>BasicSPAsm_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BasicSPAsmHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_ADF31B15-6CCE-4BAF-A379-2592EC613B4E"> - <name>BasicSP.ImplementationArtifacts.BasicSPAsmArtifacts.BasicSPAsm_exec</name> - <source/> - <node/> - <location>BasicSPAsm_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_BasicSP_BasicSPAsmHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - -</Deployment:deploymentPlan> diff --git a/CIAO/examples/BasicSP/descriptors/BasicSP.dat b/CIAO/examples/BasicSP/descriptors/BasicSP.dat index f6723ab42fb..2131aeec973 100644 --- a/CIAO/examples/BasicSP/descriptors/BasicSP.dat +++ b/CIAO/examples/BasicSP/descriptors/BasicSP.dat @@ -1,2 +1,4 @@ -EC corbaloc:iiop:localhost:10000/NodeManager -BMDisplay corbaloc:iiop:localhost:20000/NodeManager
\ No newline at end of file +EC corbaloc:iiop:localhost:10000/EC.NodeManager +BMDisplay corbaloc:iiop:localhost:20000/BMDisplay.NodeManager +BMClosedED corbaloc:iiop:localhost:30000/BMClosedED.NodeManager +BMDevice corbaloc:iiop:localhost:40000/BMDevice.NodeManager diff --git a/CIAO/examples/BasicSP/descriptors/BasicSP_Homed.cdp b/CIAO/examples/BasicSP/descriptors/BasicSP_Homed.cdp new file mode 100644 index 00000000000..81ac15e7fe5 --- /dev/null +++ b/CIAO/examples/BasicSP/descriptors/BasicSP_Homed.cdp @@ -0,0 +1,504 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>BasicSP_Homed</label> + <UUID>BasicSP_Homed</UUID> + <implementation xmi:id="ECHomeImplementation"> + <name>ECHomeImplementation</name> + <source/> + <artifact xmi:idref="EC_ExecArtifact" /> + <artifact xmi:idref="EC_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_ECHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_ECHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="BMClosedEDHomeImplementation"> + <name>BMClosedEDHomeImplementation</name> + <source/> + <artifact xmi:idref="BMClosedED_ExecArtifact" /> + <artifact xmi:idref="BMClosedED_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedEDHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedEDHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="BMDeviceHomeImplementation"> + <name>BMDeviceHomeImplementation</name> + <source/> + <artifact xmi:idref="BMDevice_ExecArtifact" /> + <artifact xmi:idref="BMDevice_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDeviceHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDeviceHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="BMDisplayHomeImplementation"> + <name>BMDisplayHomeImplementation</name> + <source/> + <artifact xmi:idref="BMDisplay_ExecArtifact" /> + <artifact xmi:idref="BMDisplay_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplayHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplayHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay_exec</string> + </value> + </value> + </execParameter> + </implementation> + <implementation xmi:id="ECComponentImplementation"> + <name>ECComponentImplementation</name> + <source/> + <artifact xmi:idref="EC_ExecArtifact" /> + <artifact xmi:idref="EC_SvntArtifact" /> + <artifact xmi:idref="EC_StubArtifact" /> + </implementation> + <implementation xmi:id="BMClosedEDComponentImplementation"> + <name>BMClosedEDComponentImplementation</name> + <source/> + <artifact xmi:idref="BMClosedED_ExecArtifact" /> + <artifact xmi:idref="BMClosedED_SvntArtifact" /> + <artifact xmi:idref="BMClosedED_StubArtifact" /> + </implementation> + <implementation xmi:id="BMDeviceComponentImplementation"> + <name>BMDeviceComponentImplementation</name> + <source/> + <artifact xmi:idref="BMDevice_ExecArtifact" /> + <artifact xmi:idref="BMDevice_SvntArtifact" /> + <artifact xmi:idref="BMDevice_StubArtifact" /> + </implementation> + <implementation xmi:id="BMDisplayComponentImplementation"> + <name>BMDisplayComponentImplementation</name> + <source/> + <artifact xmi:idref="BMDisplay_ExecArtifact" /> + <artifact xmi:idref="BMDisplay_SvntArtifact" /> + <artifact xmi:idref="BMDisplay_StubArtifact" /> + </implementation> + <instance xmi:id="ECHomeInstance"> + <name>ECHome</name> + <node>EC</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ECHomeImplementation" /> + </instance> + <instance xmi:id="BMClosedEDHomeInstance"> + <name>BMClosedEDHome</name> + <node>BMClosedED</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMClosedEDHomeImplementation" /> + </instance> + <instance xmi:id="BMDeviceHomeInstance"> + <name>BMDeviceHome</name> + <node>BMDevice</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDeviceHomeImplementation" /> + </instance> + <instance xmi:id="BMDisplayHomeInstance"> + <name>BMDisplayHome</name> + <node>BMDisplay</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDisplayHomeImplementation" /> + </instance> + <instance xmi:id="ECComponentInstance"> + <name>ECComponent</name> + <node>EC</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ECComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ECHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rategen.ior</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="BMClosedEDComponentInstance"> + <name>BMClosedEDComponent</name> + <node>BMClosedED</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMClosedEDComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedEDHome</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="BMDeviceComponentInstance"> + <name>BMDeviceComponent</name> + <node>BMDevice</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDeviceComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDeviceHome</string> + </value> + </value> + </configProperty> + </instance> + <instance xmi:id="BMDisplayComponentInstance"> + <name>BMDisplayComponent</name> + <node>BMDisplay</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDisplayComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplayHome</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>datain_data_readBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedEDBMDeviceComponentInstance</name> + <internalEndpoint> + <portName>datain</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>data_read</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>comp_data_dataoutBMDisplayComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>comp_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="BMDisplayComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>dataout</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>timeout_timeoutECComponentInstanceBMDeviceComponentInstance</name> + <internalEndpoint> + <portName>timeout</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="ECComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>timeout</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>data_available_in_availBMDeviceComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>data_available</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>in_avail</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>out_avail_data_readyBMDisplayComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>out_avail</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>data_ready</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMDisplayComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="BMDisplay_ExecArtifact"> + <name>BMDisplay_exec</name> + <source/> + <node/> + <location>BMDisplay_exec</location> + </artifact> + <artifact xmi:id="BMDisplay_SvntArtifact"> + <name>BMDisplay_svnt</name> + <source/> + <node/> + <location>BMDisplay_svnt</location> + </artifact> + <artifact xmi:id="BMDisplay_StubArtifact"> + <name>BMDisplay_stub</name> + <source/> + <node/> + <location>BMDisplay_stub</location> + </artifact> + <artifact xmi:id="BMClosedED_ExecArtifact"> + <name>BMClosedED_exec</name> + <source/> + <node/> + <location>BMClosedED_exec</location> + </artifact> + <artifact xmi:id="BMClosedED_SvntArtifact"> + <name>BMClosedED_svnt</name> + <source/> + <node/> + <location>BMClosedED_svnt</location> + </artifact> + <artifact xmi:id="BMClosedED_StubArtifact"> + <name>BMClosedED_stub</name> + <source/> + <node/> + <location>BMClosedED_stub</location> + </artifact> + <artifact xmi:id="BMDevice_ExecArtifact"> + <name>BMDevice_exec</name> + <source/> + <node/> + <location>BMDevice_exec</location> + </artifact> + <artifact xmi:id="BMDevice_SvntArtifact"> + <name>BMDevice_svnt</name> + <source/> + <node/> + <location>BMDevice_svnt</location> + </artifact> + <artifact xmi:id="BMDevice_StubArtifact"> + <name>BMDevice_stub</name> + <source/> + <node/> + <location>BMDevice_stub</location> + </artifact> + <artifact xmi:id="EC_ExecArtifact"> + <name>EC_exec</name> + <source/> + <node/> + <location>EC_exec</location> + </artifact> + <artifact xmi:id="EC_SvntArtifact"> + <name>EC_svnt</name> + <source/> + <node/> + <location>EC_svnt</location> + </artifact> + <artifact xmi:id="EC_StubArtifact"> + <name>EC_stub</name> + <source/> + <node/> + <location>EC_stub</location> + </artifact> +</Deployment:DeploymentPlan>
\ No newline at end of file diff --git a/CIAO/examples/BasicSP/descriptors/BasicSP_Unhomed.cdp b/CIAO/examples/BasicSP/descriptors/BasicSP_Unhomed.cdp new file mode 100644 index 00000000000..468192ce95e --- /dev/null +++ b/CIAO/examples/BasicSP/descriptors/BasicSP_Unhomed.cdp @@ -0,0 +1,408 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>BasicSP_Unhomed</label> + <UUID>BasicSP_Unhomed</UUID> + + <implementation xmi:id="BMDisplayComponentImplementation"> + <name>BMDisplayComponentImplementation</name> + <source/> + <artifact xmi:idref="BMDisplay_ExecArtifact" /> + <artifact xmi:idref="BMDisplay_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplay_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplay_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="BMClosedEDComponentImplementation"> + <name>BMClosedEDComponentImplementation</name> + <source/> + <artifact xmi:idref="BMClosedED_ExecArtifact" /> + <artifact xmi:idref="BMClosedED_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedED_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedED_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="BMDeviceComponentImplementation"> + <name>BMDeviceComponentImplementation</name> + <source/> + <artifact xmi:idref="BMDevice_ExecArtifact" /> + <artifact xmi:idref="BMDevice_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDevice_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDevice_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="ECComponentImplementation"> + <name>ECComponentImplementation</name> + <source/> + <artifact xmi:idref="EC_ExecArtifact" /> + <artifact xmi:idref="EC_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_EC_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_EC_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC_exec</string> + </value> + </value> + </execParameter> + </implementation> + <instance xmi:id="BMDisplayComponentInstance"> + <name>BMDisplayComponent</name> + <node>BMDisplay</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDisplayComponentImplementation" /> + </instance> + <instance xmi:id="BMClosedEDComponentInstance"> + <name>BMClosedEDComponent</name> + <node>BMClosedED</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMClosedEDComponentImplementation" /> + </instance> + <instance xmi:id="BMDeviceComponentInstance"> + <name>BMDeviceComponent</name> + <node>BMDevice</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="BMDeviceComponentImplementation" /> + </instance> + <instance xmi:id="ECComponentInstance"> + <name>ECComponent</name> + <node>EC</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="ECComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>rategen.ior</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>datain_data_readBasicSP.ComponentImplementations.BasicSP.BasicSP.BMClosedEDBMDeviceComponentInstance</name> + <internalEndpoint> + <portName>datain</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>data_read</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>comp_data_dataoutBMDisplayComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>comp_data</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="BMDisplayComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>dataout</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>timeout_timeoutECComponentInstanceBMDeviceComponentInstance</name> + <internalEndpoint> + <portName>timeout</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="ECComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>timeout</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>data_available_in_availBMDeviceComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>data_available</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="BMDeviceComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>in_avail</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + </connection> + + <connection> + <name>out_avail_data_readyBMDisplayComponentInstanceBMDisplayComponentInstance</name> + <internalEndpoint> + <portName>out_avail</portName> + <provider>false</provider> + <kind>EventPublisher</kind> + <instance xmi:idref="BMClosedEDComponentInstance" /> + </internalEndpoint> + <internalEndpoint> + <portName>data_ready</portName> + <provider>true</provider> + <kind>EventConsumer</kind> + <instance xmi:idref="BMDisplayComponentInstance" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="BMDisplay_ExecArtifact"> + <name>BMDisplay_exec</name> + <source/> + <node/> + <location>BMDisplay_exec</location> + </artifact> + <artifact xmi:id="BMDisplay_SvntArtifact"> + <name>BMDisplay_svnt</name> + <source/> + <node/> + <location>BMDisplay_svnt</location> + </artifact> + <artifact xmi:id="BMDisplay_StubArtifact"> + <name>BMDisplay_stub</name> + <source/> + <node/> + <location>BMDisplay_stub</location> + </artifact> + <artifact xmi:id="BMClosedED_ExecArtifact"> + <name>BMClosedED_exec</name> + <source/> + <node/> + <location>BMClosedED_exec</location> + </artifact> + <artifact xmi:id="BMClosedED_SvntArtifact"> + <name>BMClosedED_svnt</name> + <source/> + <node/> + <location>BMClosedED_svnt</location> + </artifact> + <artifact xmi:id="BMClosedED_StubArtifact"> + <name>BMClosedED_stub</name> + <source/> + <node/> + <location>BMClosedED_stub</location> + </artifact> + <artifact xmi:id="EC_ExecArtifact"> + <name>EC_exec</name> + <source/> + <node/> + <location>EC_exec</location> + </artifact> + <artifact xmi:id="EC_SvntArtifact"> + <name>EC_svnt</name> + <source/> + <node/> + <location>EC_svnt</location> + </artifact> + <artifact xmi:id="EC_StubArtifact"> + <name>EC_stub</name> + <source/> + <node/> + <location>EC_stub</location> + </artifact> + <artifact xmi:id="BMDevice_ExecArtifact"> + <name>BMDevice_exec</name> + <source/> + <node/> + <location>BMDevice_exec</location> + </artifact> + <artifact xmi:id="BMDevice_SvntArtifact"> + <name>BMDevice_svnt</name> + <source/> + <node/> + <location>BMDevice_svnt</location> + </artifact> + <artifact xmi:id="BMDevice_StubArtifact"> + <name>BMDevice_stub</name> + <source/> + <node/> + <location>BMDevice_stub</location> + </artifact> +</Deployment:DeploymentPlan>
\ No newline at end of file diff --git a/CIAO/examples/BasicSP/descriptors/run_test.pl b/CIAO/examples/BasicSP/descriptors/run_test.pl index 668207a717a..577f9d1432d 100755 --- a/CIAO/examples/BasicSP/descriptors/run_test.pl +++ b/CIAO/examples/BasicSP/descriptors/run_test.pl @@ -1,6 +1,6 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; + & eval 'exec perl -S $0 $argv:q' + if 0; # $Id$ # -*- perl -*- @@ -14,107 +14,92 @@ $DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; $daemons_running = 0; $em_running = 0; $ns_running = 0; -$pl_running = 0; -$daemons = 2; -@ports = ( 10000, 20000 ); -@iorfiles = ( "NodeManager1.ior", "NodeManager2.ior" ); -@componentiorfiles = ("BMDevice.ior", "BMDisplay.ior", "BMClosedED.ior", "EC.ior"); - +$daemons = 4; +@ports = ( 10000, 20000, 30000, 40000 ); +@iorfiles = ( "NodeApp1.ior", "NodeApp2.ior", "NodeApp3.ior", "NodeApp4.ior" ); +@nodenames = ( "EC", "BMDisplay", "BMClosedED", "BMDevice" ); $status = 0; $dat_file = "BasicSP.dat"; -$cdp_file = "BasicSP.cdp"; -$emior_file = "EM.ior"; -$nsior_file = "ns.ior"; -$damior_file = "DAM.ior"; +$cdp_file = "BasicSP_Unhomed.cdp"; $controller_exec = "$CIAO_ROOT/examples/BasicSP/EC/controller"; -$nsior = PerlACE::LocalFile ($nsior_file); -$emior = PerlACE::LocalFile ($emior_file); -$damior = PerlACE::LocalFile ($damior_file); +$nsior = PerlACE::LocalFile ("ns.ior"); + +unlink $nsior; -$PL = 0; +$E = 0; $EM = 0; # Delete if there are any .ior files. sub delete_ior_files { - for ($i = 0; $i < @iorfiles; ++$i) { + for ($i = 0; $i < $daemons; ++$i) { unlink $iorfiles[$i]; } - for ($i = 0; $i < @componentiorfiles; ++$i) { - unlink $componentiorfiles[$i]; - } - unlink $nsior; - unlink $emior; - unlink $damior; -} - -sub run_node_daemons { - for ($i = 0; $i < @iorfiles; ++$i) { - $iorfile = $iorfiles[$i]; - $port = $ports[$i]; - - $iiop = "iiop://localhost:$port"; - $node_app = "$CIAO_ROOT/bin/NodeApplication"; - - $d_cmd = "$CIAO_ROOT/bin/NodeManager"; - $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; - - $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); - $result = $Daemons[$i]->Spawn (); - push(@processes, $Daemons[$i]); - - if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of node daemon $i could not be found\n"; - for (; $i >= 0; --$i) { - $Daemons[$i]->Kill (); - $Daemons[$i]->TimedWait (1); - } - return -1; - } - } - return 0; + unlink PerlACE::LocalFile ("EM.ior"); + unlink PerlACE::LocalFile ("rategen.ior"); + unlink PerlACE::LocalFile ("DAM.ior"); + unlink PerlACE::LocalFile ("ns.ior"); } sub kill_node_daemons { - for ($i = 0; $i < $daemons; ++$i) { - $Daemons[$i]->Kill (); - $Daemons[$i]->TimedWait (1); - } + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } } sub kill_open_processes { - if ($daemons_running == 1) { - kill_node_daemons (); - } + if ($daemons_running == 1) { + kill_node_daemons (); + } - if ($em_running == 1) { - $EM->Kill (); - $EM->TimedWait (1); - } + if ($em_running == 1) { + $EM->Kill (); + $EM->TimedWait (1); + } - if ($ns_running == 1) { - $NS->Kill (); - $NS->TimedWait (1); - } + if ($ns_running == 1) { + $NS->Kill (); + $NS->TimedWait (1); + } - if ($pl1_running == 1) { - $PL1->Kill(); - $PL1->TimedWait (1); - } +} - if ($pl2_running == 1) { - $PL2->Kill(); - $PL2->TimedWait (1); - } +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; + + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --instance-nc corbaloc:rir:/NameService"; + print "$d_param\n"; + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + 30) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} - delete_ior_files(); +if ($#ARGV == 0) +{ + $cdp_file = $ARGV[0]; } delete_ior_files (); - # Invoke naming service $NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); @@ -123,7 +108,8 @@ $NS->Spawn (); print STDERR "Starting Naming Service\n"; -if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1) { +if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1) +{ print STDERR "ERROR: cannot find naming service IOR file\n"; $NS->Kill (); exit 1; @@ -134,25 +120,26 @@ $ns_running = 1; # Set up NamingService environment $ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + # Invoke node daemons. print "Invoking node daemons\n"; $status = run_node_daemons (); if ($status != 0) { - print STDERR "ERROR: Unable to execute the node daemons\n"; - kill_open_processes (); - exit 1; + print STDERR "ERROR: Unable to execute the node daemons\n"; + kill_open_processes (); + exit 1; } $daemons_running = 1; # Invoke execution manager. print "Invoking execution manager\n"; -$EM = new PerlACE::Process ("$CIAO_ROOT/bin/Execution_Manager", - "-o $emior_file -i $dat_file"); +$EM = new PerlACE::Process ("$DAnCE/bin/dance_execution_manager", + "-eEM.ior --node-map $dat_file"); $EM->Spawn (); -if (PerlACE::waitforfile_timed ("$emior_file", +if (PerlACE::waitforfile_timed ("EM.ior", $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: The ior file of execution manager could not be found\n"; @@ -162,30 +149,24 @@ if (PerlACE::waitforfile_timed ("$emior_file", $em_running = 1; -# Deploy the application -print "Invoking plan_launcher - deploy the application -\n"; -$PL1 = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-p $cdp_file -k file://$emior_file -o $damior_file"); -$PL1->Spawn (); +# Invoke executor - start the application -. +print "Invoking executor - start the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-x $cdp_file -k file://EM.ior"); -$pl1_running = 1; +$E->SpawnWaitKill (5000); -if (PerlACE::waitforfile_timed ("$damior_file", - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of domain application manager could not be found\n"; +if (PerlACE::waitforfile_timed ( + "rategen.ior", + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: The ior file of receiver could not be found\n"; kill_open_processes (); exit 1; } - -sleep (10); - -# Invoke executor - start the application -. -print "Starting the application\n"; -$controller = new PerlACE::Process ("$controller_exec", - "-k file://$componentiorfiles[3] -o"); +print "Invoking the controller\n"; +$controller = new PerlACE::Process ("$controller_exec", "-o"); $result = $controller->SpawnWaitKill (3000); if ($result != 0) { @@ -193,28 +174,18 @@ if ($result != 0) { $status = 1; } -sleep (10); - +sleep 10; # Invoke executor - stop the application -. -print "Stopping the application\n"; -$controller = new PerlACE::Process ("$controller_exec", - "-k file://$componentiorfiles[3] -f"); -$result = $controller->SpawnWaitKill (3000); +print "Invoking executor - stop the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-k file://EM.ior -x $cdp_file -q"); +$E->SpawnWaitKill (3000); -if ($result != 0) { - print STDERR "ERROR: The controller returned $result\n"; - $status = 1; -} +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; -# Invoke executor - stop the application -. -print "Invoking plan_launcher - tearing down the application\n"; -$PL2 = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-k file://$emior_file -p $cdp_file -i file://$damior_file"); -$PL2->Spawn(); - -$pl2_running = 1; - -sleep(5); +delete_ior_files (); +kill_open_processes (); -kill_open_processes(); +exit $status; diff --git a/CIAO/DevGuideExamples/CIAO.mwc b/CIAO/examples/DevGuideExamples/CIAO.mwc index dd297256b34..dd297256b34 100644 --- a/CIAO/DevGuideExamples/CIAO.mwc +++ b/CIAO/examples/DevGuideExamples/CIAO.mwc diff --git a/CIAO/DevGuideExamples/Messenger/Administrator.cidl b/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl index d980177be03..d980177be03 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator.cidl +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator.cidl diff --git a/CIAO/DevGuideExamples/Messenger/Administrator.idl b/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl index 67bb016e157..67bb016e157 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator.idl diff --git a/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc b/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc new file mode 100644 index 00000000000..2b869e58f51 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p Messenger Administrator" + +project(Messenger_Administrator_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=ADMINISTRATOR_STUB_Export \ + -Wb,stub_export_include=Administrator_stub_export.h \ + -Wb,skel_export_macro=ADMINISTRATOR_SVNT_Export \ + -Wb,skel_export_include=Administrator_svnt_export.h + + IDL_Files { + Administrator.idl + } +} + +project(Messenger_Administrator_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro ADMINISTRATOR_SVNT_Export \ + --svnt-export-include Administrator_svnt_export.h + idlflags += -Wb,export_macro=ADMINISTRATOR_EXEC_Export \ + -Wb,export_include=Administrator_exec_export.h \ + -SS + + CIDL_Files { + Administrator.cidl + } + + IDL_Files { + AdministratorE.idl + } +} + +project(Messenger_Administrator_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_Administrator_idl_gen Messenger_stub + libs += Messenger_stub + + sharedname = Administrator_stub + dynamicflags = ADMINISTRATOR_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + AdministratorC.cpp + } + + Header_Files { + AdministratorC.h + Administrator_stub_export.h + } + + Inline_Files { + AdministratorC.inl + } +} + +project(Messenger_Administrator_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_Administrator_cidl_gen Messenger_Administrator_stub + sharedname = Administrator_exec + libs += Administrator_stub Messenger_stub + + dynamicflags = ADMINISTRATOR_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + AdministratorEC.cpp + Administrator_exec_i.cpp + } + + Header_Files { + AdministratorEC.h + Administrator_exec_i.h + Administrator_exec_export.h + } + + Inline_Files { + AdministratorEC.inl + } +} + + +project(Messenger_Administrator_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_svnt Messenger_Administrator_exec + sharedname = Administrator_svnt + libs += Administrator_exec \ + Administrator_stub \ + Messenger_svnt \ + Messenger_stub + + dynamicflags = ADMINISTRATOR_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + AdministratorS.cpp + Administrator_svnt.cpp + } + + Header_Files { + AdministratorS.h + Administrator_svnt.h + Administrator_svnt_export.h + } + + Inline_Files { + AdministratorS.inl + } +} + + diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_Client.cpp b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp index 15378b35b78..15378b35b78 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_Client.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client.cpp diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp index 399faa40389..399faa40389 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.cpp diff --git a/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc new file mode 100644 index 00000000000..ad52beff2fe --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL2.mpc @@ -0,0 +1,45 @@ +// $Id$ + +project(Administrator_Client_IDL2_Compile): taoidl3toidl2defaults { + // ensures that only idl3-to-idl2 processing is performed + custom_only = 1 + + idl3toidl2flags += -I. -o idl2 + + IDL3TOIDL2_Files { + gendir = idl2 + Runnable.idl + Publication.idl + Message.idl + History.idl + Administrator.idl + Messenger.idl + } +} + +project(Administrator_Client_IDL2): ccm_stub, valuetype { + after += Administrator_Client_IDL2_Compile + + exename = Administrator_Client_IDL2 + idlflags += -Sm -Iidl2 -o idl2 -SS + + IDL_Files { + gendir = idl2 + idl2/Runnable_IDL2.idl + idl2/Publication_IDL2.idl + idl2/Message_IDL2.idl + idl2/History_IDL2.idl + idl2/Administrator_IDL2.idl + idl2/Messenger_IDL2.idl + } + + Source_Files { + Administrator_Client_IDL2.cpp + idl2/Administrator_IDL2C.cpp + idl2/Messenger_IDL2C.cpp + idl2/Publication_IDL2C.cpp + idl2/Runnable_IDL2C.cpp + idl2/History_IDL2C.cpp + idl2/Message_IDL2C.cpp + } +} diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp index 6e83b57165f..6e83b57165f 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.cpp diff --git a/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc new file mode 100644 index 00000000000..5ac2cd88709 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_Client_IDL3.mpc @@ -0,0 +1,29 @@ +// $Id$ + +// @file Administrator_Client_IDL3.mpc +// +// @author Don Busch <busch_d@ociweb.com> + +project(Administrator_Client_IDL3): ccm_stub, valuetype { + after += Messenger_stub + libs += Messenger_stub + after += Administrator_Client_IDL2_Compile + + exename = Administrator_Client_IDL3 + + IDL_Files { + // IDL stubs are linked from the Messenger_stub library; + // this empty section prevents all of the IDL stub code from + // being linked into this executable as well + } + + Header_Files { + // this empty section prevents all of the header files + // being includes in this project + } + + Source_Files { + Administrator_Client_IDL3.cpp + } +} + diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_exec_export.h b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h index 6cfb8385b61..6cfb8385b61 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_exec_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_export.h diff --git a/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp new file mode 100644 index 00000000000..a3318827a85 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.cpp @@ -0,0 +1,260 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Administrator_exec_i.h" +#include "ciao/CIAO_common.h" + +// MY CODE +#include <iostream> +#include <string> + +namespace CIDL_Administrator_Impl +{ + //================================================================== + // Component Executor Implementation Class: Administrator_exec_i + //================================================================== + + Administrator_exec_i::Administrator_exec_i (void) + { + } + + Administrator_exec_i::~Administrator_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + Administrator_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Administrator_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Administrator_exec_i::ccm_activate () + { + // Your code here. + + // MY CODE + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_activate\n" ))); + + // Activate the Task + this->activate(); + } + + void + Administrator_exec_i::ccm_passivate () + { + // Your code here. + + // MY CODE + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_passivate\n" ))); + } + + void + Administrator_exec_i::ccm_remove () + { + // Your code here. + ACE_DEBUG((LM_INFO, ACE_TEXT("ccm_remove\n"))); + } + + void + Administrator_exec_i::configuration_complete (void) + { + ACE_DEBUG ((LM_INFO, ACE_TEXT("configuration_complete\n"))); + } + + // Overridden from ACE_Task_Base + int + Administrator_exec_i::svc() + { + enum SelectionType { START=1, STOP, CHANGE_PERIOD, CHANGE_TEXT,EXIT }; + + bool done = false; + do { + std::cout << "\nWhat do you want to do to the Messenger(s)?" << std::endl; + std::cout << START << ". Start" << std::endl; + std::cout << STOP << ". Stop" << std::endl; + std::cout << CHANGE_PERIOD << ". Change Publication Period" << std::endl; + std::cout << CHANGE_TEXT << ". Change Publication Text" << std::endl; + std::cout << EXIT << ". Exit" << std::endl; + + char selection_text[10]; + std::cout << "Please enter a selection: "; + std::cin.getline( selection_text, sizeof(selection_text) ); + int selection = ACE_OS::atoi(selection_text); + + switch (selection) { + case START: + startPublishing(); + break; + case STOP: + stopPublishing(); + break; + case CHANGE_PERIOD: + changePublicationPeriod(); + break; + case CHANGE_TEXT: + changePublicationText(); + break; + case EXIT: { + done = true; + break; + } + default: + std::cout << "Please enter a valid option" << std::endl; + } + } while ( !done ); + + return 0; + } + + void Administrator_exec_i::startPublishing() + { + // Get the attached Runnable facet(s) + ::Administrator::runnablesConnections_var connections = + this->context_->get_connections_runnables(); + + std::cout << "Starting Publication" << std::endl; + for ( unsigned int i = 0; i < connections->length(); ++i ) { + Runnable_var runnable = (*connections)[i].objref; + runnable->start(); + } + } + + void Administrator_exec_i::stopPublishing() + { + // Get the attached Runnable facet(s) + ::Administrator::runnablesConnections_var connections = + this->context_->get_connections_runnables(); + + std::cout << "Stopping Publication" << std::endl; + for ( unsigned int i = 0; i < connections->length(); ++i ) { + Runnable_var runnable = (*connections)[i].objref; + runnable->stop(); + } + } + + void Administrator_exec_i::changePublicationPeriod() + { + // Get the attached Publication facet(s) + ::Administrator::contentConnections_var contents = + this->context_->get_connections_content(); + + char period[10]; + std::cout << "Please enter a new period in seconds: "; + std::cin.getline( period, sizeof( period ) ); + for ( unsigned int i = 0; i < contents->length(); ++i ) { + Publication_var publication = (*contents)[i].objref; + publication->period( ACE_OS::atoi(period) ); + } + } + + void Administrator_exec_i::changePublicationText() + { + // Get the attached Publication facet(s) + ::Administrator::contentConnections_var contents = + this->context_->get_connections_content(); + + char buffer[1024]; + std::cout << "Please enter new text: "; + std::cin.getline( buffer, sizeof(buffer) ); + for ( unsigned int i = 0; i < contents->length(); ++i ) { + Publication_var publication = (*contents)[i].objref; + publication->text( buffer ); + } + } + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Administrator_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Administrator_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: AdministratorHome_exec_i + //================================================================== + + AdministratorHome_exec_i::AdministratorHome_exec_i (void) + { + } + + AdministratorHome_exec_i::~AdministratorHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + AdministratorHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Administrator_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_AdministratorHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + AdministratorHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} diff --git a/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h new file mode 100644 index 00000000000..405202583c7 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_exec_i.h @@ -0,0 +1,112 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_ADMINISTRATOR_EXEC_H +#define CIAO_ADMINISTRATOR_EXEC_H + +#include /**/ "ace/pre.h" + +#include "AdministratorEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Administrator_exec_export.h" +#include "tao/LocalObject.h" + +#include "ace/Task.h" + +namespace CIDL_Administrator_Impl +{ + class ADMINISTRATOR_EXEC_Export Administrator_exec_i + : public virtual Administrator_Exec, + public virtual ::CORBA::LocalObject, + public virtual ACE_Task_Base + { + public: + Administrator_exec_i (void); + virtual ~Administrator_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + // Overridden from ACE_Task_Base + int svc(); + + private: + + void startPublishing(); + void stopPublishing(); + void changePublicationPeriod(); + void changePublicationText(); + + ::CCM_Administrator_Context_var context_; + }; + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Administrator_Impl (void); + + class ADMINISTRATOR_EXEC_Export AdministratorHome_exec_i + : public virtual AdministratorHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + AdministratorHome_exec_i (void); + virtual ~AdministratorHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" ADMINISTRATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_AdministratorHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_ADMINISTRATOR_EXEC_H */ diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_stub_export.h b/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h index 22b4ec62ce4..22b4ec62ce4 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_stub_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_stub_export.h diff --git a/CIAO/DevGuideExamples/Messenger/Administrator_svnt_export.h b/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h index 6c79eef8299..6c79eef8299 100644 --- a/CIAO/DevGuideExamples/Messenger/Administrator_svnt_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Administrator_svnt_export.h diff --git a/CIAO/DevGuideExamples/Messenger/History.idl b/CIAO/examples/DevGuideExamples/Messenger/History.idl index c83cadf03bb..c83cadf03bb 100644 --- a/CIAO/DevGuideExamples/Messenger/History.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/History.idl diff --git a/CIAO/DevGuideExamples/Messenger/History_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp index be3e056f5cf..be3e056f5cf 100644 --- a/CIAO/DevGuideExamples/Messenger/History_exec_i.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.cpp diff --git a/CIAO/DevGuideExamples/Messenger/History_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h index afcdaf414f9..afcdaf414f9 100644 --- a/CIAO/DevGuideExamples/Messenger/History_exec_i.h +++ b/CIAO/examples/DevGuideExamples/Messenger/History_exec_i.h diff --git a/CIAO/DevGuideExamples/Messenger/Message.idl b/CIAO/examples/DevGuideExamples/Messenger/Message.idl index 2e3aee687b0..2e3aee687b0 100644 --- a/CIAO/DevGuideExamples/Messenger/Message.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Message.idl diff --git a/CIAO/DevGuideExamples/Messenger/Messenger.cidl b/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl index 08559aafe0e..08559aafe0e 100644 --- a/CIAO/DevGuideExamples/Messenger/Messenger.cidl +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger.cidl diff --git a/CIAO/DevGuideExamples/Messenger/Messenger.idl b/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl index 518dcfee754..518dcfee754 100644 --- a/CIAO/DevGuideExamples/Messenger/Messenger.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger.idl diff --git a/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc b/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc new file mode 100644 index 00000000000..caad4b867f7 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger.mpc @@ -0,0 +1,153 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl Messenger" + +project(Messenger_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=MESSENGER_STUB_Export \ + -Wb,stub_export_include=Messenger_stub_export.h \ + -Wb,skel_export_macro=MESSENGER_SVNT_Export \ + -Wb,skel_export_include=Messenger_svnt_export.h + + IDL_Files { + Runnable.idl + Publication.idl + Message.idl + History.idl + Messenger.idl + } +} + +project(Messenger_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro MESSENGER_SVNT_Export \ + --svnt-export-include Messenger_svnt_export.h + idlflags += -Wb,export_macro=MESSENGER_EXEC_Export \ + -Wb,export_include=Messenger_exec_export.h \ + -SS + + CIDL_Files { + Messenger.cidl + } + + IDL_Files { + MessengerE.idl + } +} + +project(Messenger_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_idl_gen + libs += + + sharedname = Messenger_stub + dynamicflags = MESSENGER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + RunnableC.cpp + PublicationC.cpp + MessageC.cpp + HistoryC.cpp + MessengerC.cpp + } + + Header_Files { + RunnableC.h + PublicationC.h + MessageC.h + HistoryC.h + MessengerC.h + Messenger_stub_export.h + } + + Inline_Files { + RunnableC.inl + PublicationC.inl + MessageC.inl + HistoryC.inl + MessengerC.inl + } +} + +project(Messenger_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_cidl_gen Messenger_stub + sharedname = Messenger_exec + libs += Messenger_stub + + dynamicflags = MESSENGER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + MessengerEC.cpp + Messenger_exec_i.cpp + Publication_exec_i.cpp + History_exec_i.cpp + Runnable_exec_i.cpp + } + + Header_Files { + MessengerEC.h + Messenger_exec_i.h + Publication_exec_i.h + History_exec_i.h + Runnable_exec_i.h + Messenger_exec_export.h + } + + Inline_Files { + MessengerEC.inl + } +} + + +project(Messenger_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_exec + sharedname = Messenger_svnt + libs += Messenger_exec \ + Messenger_stub + + dynamicflags = MESSENGER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + RunnableS.cpp + PublicationS.cpp + MessageS.cpp + HistoryS.cpp + MessengerS.cpp + Messenger_svnt.cpp + } + + Header_Files { + RunnableS.h + PublicationS.h + MessageS.h + HistoryS.h + MessengerS.h + Messenger_svnt.h + Messenger_svnt_export.h + } + + Inline_Files { + RunnableS.inl + PublicationS.inl + MessageS.inl + HistoryS.inl + MessengerS.inl + } +} + + diff --git a/CIAO/DevGuideExamples/Messenger/Messenger_exec_export.h b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h index 7aa56acc1c9..7aa56acc1c9 100644 --- a/CIAO/DevGuideExamples/Messenger/Messenger_exec_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_export.h diff --git a/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp new file mode 100644 index 00000000000..6a651b61fa8 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.cpp @@ -0,0 +1,254 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Messenger_exec_i.h" +#include "ciao/CIAO_common.h" + +// MY CODE +#include "ace/OS.h" +#include "History_exec_i.h" +#include "Runnable_exec_i.h" +#include "Publication_exec_i.h" + +namespace CIDL_Messenger_Impl +{ + //================================================================== + // Component Executor Implementation Class: Messenger_exec_i + //================================================================== + + Messenger_exec_i::Messenger_exec_i () + : subject_( "Test Subject" ), + user_( "ciao_user" ) + { + this->control_ = new Runnable_exec_i(); + this->history_ = new History_exec_i(); + this->content_ = new Publication_exec_i( + "The quick brown fox jumped over the lazy dog", + 2 ); + } + + Messenger_exec_i::~Messenger_exec_i (void) + { + this->control_->_remove_ref(); + this->history_->_remove_ref(); + this->content_->_remove_ref(); + } + + // MY CODE + int Messenger_exec_i::svc() { + + ACE_DEBUG((LM_INFO, ACE_TEXT("svc()\n"))); + + while (1) + { + ACE_OS::sleep( this->content_->period() ); + + // get the run_lock from the Runnable executor; we have an + // agreement with the Runnable executor that we must posess the + // run_lock to publish + ACE_Guard<ACE_Mutex> guard( this->control_->get_run_lock() ); + + // create a message to publish + ::Message_var msg = new ::OBV_Message(); + msg->subject( this->subject() ); + msg->text( this->content_->text() ); + msg->user( CORBA::string_dup( this->user_.c_str() ) ); + + // add the message to the message history + this->history_->add( msg.in() ); + + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::svc: publishing message\n") )); + + // publish to all interested consumers + this->context_->push_message_publisher( msg.in() ); + + ACE_DEBUG((LM_INFO, + ACE_TEXT("Published Message on subject %s\n User %s\n Text %s\n"), + msg->subject(), + msg->user(), + msg->text() )); + } + + ACE_DEBUG((LM_INFO, ACE_TEXT("svc(): Gracefully stopping publication\n"))); + return 0; + } + + // Supported or inherited operations. + + // Attribute operations. + + char* + Messenger_exec_i::subject () + { + return CORBA::string_dup( this->subject_.c_str() ); + } + + void + Messenger_exec_i::subject ( const char* subject) + { + this->subject_ = CORBA::string_dup( subject ); + } + + // Port operations. + + ::CCM_Runnable_ptr + Messenger_exec_i::get_control () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->control_->_add_ref(); + return this->control_; + } + + ::CCM_Publication_ptr + Messenger_exec_i::get_content () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->content_->_add_ref(); + return this->content_; + } + + ::CCM_History_ptr + Messenger_exec_i::get_message_history () + { + // Your code here. + + // MY CODE + + // bump up ref count because we give up ownership when we return this + this->history_->_add_ref(); + return this->history_; + } + + // Operations from Components::SessionComponent + + void + Messenger_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Messenger_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Messenger_exec_i::configuration_complete () + { + /* Your code here. */ + } + + void + Messenger_exec_i::ccm_activate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_activate\n"))); + this->activate(); + } + + void + Messenger_exec_i::ccm_passivate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_passivate\n"))); + } + + void + Messenger_exec_i::ccm_remove () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Messenger_exec_i::ccm_remove\n"))); + } + + + extern "C" MESSENGER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Messenger_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Messenger_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: MessengerHome_exec_i + //================================================================== + + MessengerHome_exec_i::MessengerHome_exec_i (void) + { + } + + MessengerHome_exec_i::~MessengerHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + MessengerHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Messenger_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_MessengerHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + MessengerHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h new file mode 100644 index 00000000000..0cf2ffb8411 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger_exec_i.h @@ -0,0 +1,136 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_MESSENGER_EXEC_H +#define CIAO_MESSENGER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "MessengerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Messenger_exec_export.h" +#include "tao/LocalObject.h" + +// MY CODE +#include <string> +#include "ace/Task.h" + +namespace CIDL_Messenger_Impl +{ + class Runnable_exec_i; + class Publication_exec_i; + class History_exec_i; + + class MESSENGER_EXEC_Export Messenger_exec_i + : public virtual Messenger_Exec, + public virtual ::CORBA::LocalObject, + public virtual ACE_Task_Base + { + public: + Messenger_exec_i (void); + virtual ~Messenger_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + virtual char * + subject (); + + virtual void + subject (const char * subject); + + // Port operations. + + virtual ::CCM_Runnable_ptr + get_control (); + + virtual ::CCM_Publication_ptr + get_content (); + + virtual ::CCM_History_ptr + get_message_history (); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + // MY CODE + virtual int svc(); + + private: + ::CCM_Messenger_Context_var context_; + + // MY CODE + Runnable_exec_i* control_; + Publication_exec_i* content_; + History_exec_i* history_; + + std::string subject_; + const std::string user_; + }; + + extern "C" MESSENGER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Messenger_Impl (void); + + class MESSENGER_EXEC_Export MessengerHome_exec_i + : public virtual MessengerHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + MessengerHome_exec_i (void); + virtual ~MessengerHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" MESSENGER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_MessengerHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_MESSENGER_EXEC_H */ + diff --git a/CIAO/DevGuideExamples/Messenger/Messenger_stub_export.h b/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h index 7e4502b434f..7e4502b434f 100644 --- a/CIAO/DevGuideExamples/Messenger/Messenger_stub_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger_stub_export.h diff --git a/CIAO/DevGuideExamples/Messenger/Messenger_svnt_export.h b/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h index 088b1c1ccbc..088b1c1ccbc 100644 --- a/CIAO/DevGuideExamples/Messenger/Messenger_svnt_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Messenger_svnt_export.h diff --git a/CIAO/DevGuideExamples/Messenger/Publication.idl b/CIAO/examples/DevGuideExamples/Messenger/Publication.idl index 43cf29228cc..43cf29228cc 100644 --- a/CIAO/DevGuideExamples/Messenger/Publication.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Publication.idl diff --git a/CIAO/DevGuideExamples/Messenger/Publication_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp index c232cb9ac77..c232cb9ac77 100644 --- a/CIAO/DevGuideExamples/Messenger/Publication_exec_i.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.cpp diff --git a/CIAO/DevGuideExamples/Messenger/Publication_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h index b0f0cad8975..b0f0cad8975 100644 --- a/CIAO/DevGuideExamples/Messenger/Publication_exec_i.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Publication_exec_i.h diff --git a/CIAO/DevGuideExamples/Messenger/Receiver.cidl b/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl index 1deaf19ed2d..1deaf19ed2d 100644 --- a/CIAO/DevGuideExamples/Messenger/Receiver.cidl +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver.cidl diff --git a/CIAO/DevGuideExamples/Messenger/Receiver.idl b/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl index 2d22feceb70..2d22feceb70 100644 --- a/CIAO/DevGuideExamples/Messenger/Receiver.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver.idl diff --git a/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc b/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc new file mode 100644 index 00000000000..d58c54029cc --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver.mpc @@ -0,0 +1,121 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -p Messenger Receiver" + +project(Messenger_Receiver_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h + + IDL_Files { + Receiver.idl + } +} + +project(Messenger_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro RECEIVER_SVNT_Export \ + --svnt-export-include Receiver_svnt_export.h + idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ + -Wb,export_include=Receiver_exec_export.h \ + -SS + + CIDL_Files { + Receiver.cidl + } + + IDL_Files { + ReceiverE.idl + } +} + +project(Messenger_Receiver_stub) : ccm_stub { + avoids += ace_for_tao + after += Messenger_Receiver_idl_gen Messenger_stub + libs += Messenger_stub + + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReceiverC.cpp + } + + Header_Files { + ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + ReceiverC.inl + } +} + +project(Messenger_Receiver_exec) : ciao_executor { + avoids += ace_for_tao + after += Messenger_Receiver_cidl_gen Messenger_Receiver_stub + sharedname = Receiver_exec + libs += Receiver_stub Messenger_stub + + dynamicflags = RECEIVER_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + ReceiverEC.cpp + Receiver_exec_i.cpp + } + + Header_Files { + ReceiverEC.h + Receiver_exec_i.h + Receiver_exec_export.h + } + + Inline_Files { + ReceiverEC.inl + } +} + + +project(Messenger_Receiver_svnt) : ciao_servant { + avoids += ace_for_tao + after += Messenger_svnt Messenger_Receiver_exec + sharedname = Receiver_svnt + libs += Receiver_exec \ + Receiver_stub \ + Messenger_svnt \ + Messenger_stub + + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + CIDL_Files { + } + + IDL_Files { + } + + Source_Files { + ReceiverS.cpp + Receiver_svnt.cpp + } + + Header_Files { + ReceiverS.h + Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + ReceiverS.inl + } +} + + diff --git a/CIAO/DevGuideExamples/Messenger/Receiver_exec_export.h b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h index 9ae7b9ce799..9ae7b9ce799 100644 --- a/CIAO/DevGuideExamples/Messenger/Receiver_exec_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_export.h diff --git a/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp new file mode 100644 index 00000000000..84b452874c6 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.cpp @@ -0,0 +1,178 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Receiver_exec_i.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_Receiver_Impl +{ + //================================================================== + // Component Executor Implementation Class: Receiver_exec_i + //================================================================== + + Receiver_exec_i::Receiver_exec_i (void) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + void + Receiver_exec_i::push_message_consumer ( + ::Message * ev) + { + /* Your code here. */ + + // MY CODE + + CORBA::String_var subject = ev->subject(); + CORBA::String_var user = ev->user(); + CORBA::String_var text = ev->text(); + + ACE_DEBUG((LM_INFO, + ACE_TEXT("Received Message:\n Subject: %s\n User: %s\n Text: %s\n"), + subject.in(), + user.in(), + text.in() )); + + // Use the history to (inefficiently) get the total number of messages + // published on this item so far + ::History_var history = + this->context_->get_connection_message_history(); + ::Messages_var messages = history->get_all(); + ACE_DEBUG((LM_INFO, + ACE_TEXT(" Subject \"%s\" has published %d messages so far\n"), + subject.in(), + messages->length() )); + } + + // Operations from Components::SessionComponent + + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::CCM_Receiver_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::configuration_complete\n"))); + } + + void + Receiver_exec_i::ccm_activate () + { + // Your code here. + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_activate\n"))); + } + + void + Receiver_exec_i::ccm_passivate () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_passivate\n"))); + } + + void + Receiver_exec_i::ccm_remove () + { + /* Your code here. */ + ACE_DEBUG((LM_INFO, ACE_TEXT("Receiver_exec_i::ccm_remove\n"))); + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN (retval, + Receiver_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + + //================================================================== + // Home Executor Implementation Class: ReceiverHome_exec_i + //================================================================== + + ReceiverHome_exec_i::ReceiverHome_exec_i (void) + { + } + + ReceiverHome_exec_i::~ReceiverHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + ReceiverHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Receiver_exec_i, + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_ReceiverHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + ReceiverHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} diff --git a/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h new file mode 100644 index 00000000000..e2df7a70750 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver_exec_i.h @@ -0,0 +1,105 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_RECEIVER_EXEC_H +#define CIAO_RECEIVER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "ReceiverEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Receiver_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_Receiver_Impl +{ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual void + push_message_consumer ( + ::Message *ev); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::CCM_Receiver_Context_var context_; + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Receiver_Impl (void); + + class RECEIVER_EXEC_Export ReceiverHome_exec_i + : public virtual ReceiverHome_Exec, + public virtual ::CORBA::LocalObject + { + public: + ReceiverHome_exec_i (void); + virtual ~ReceiverHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_ReceiverHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_RECEIVER_EXEC_H */ + diff --git a/CIAO/DevGuideExamples/Messenger/Receiver_stub_export.h b/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h index ad411db973f..ad411db973f 100644 --- a/CIAO/DevGuideExamples/Messenger/Receiver_stub_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver_stub_export.h diff --git a/CIAO/DevGuideExamples/Messenger/Receiver_svnt_export.h b/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h index 51ed45dc299..51ed45dc299 100644 --- a/CIAO/DevGuideExamples/Messenger/Receiver_svnt_export.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Receiver_svnt_export.h diff --git a/CIAO/DevGuideExamples/Messenger/Runnable.idl b/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl index 61515b7c17a..61515b7c17a 100644 --- a/CIAO/DevGuideExamples/Messenger/Runnable.idl +++ b/CIAO/examples/DevGuideExamples/Messenger/Runnable.idl diff --git a/CIAO/DevGuideExamples/Messenger/Runnable_exec_i.cpp b/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp index a98cc736006..a98cc736006 100644 --- a/CIAO/DevGuideExamples/Messenger/Runnable_exec_i.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.cpp diff --git a/CIAO/DevGuideExamples/Messenger/Runnable_exec_i.h b/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h index 7bde31dd299..7bde31dd299 100644 --- a/CIAO/DevGuideExamples/Messenger/Runnable_exec_i.h +++ b/CIAO/examples/DevGuideExamples/Messenger/Runnable_exec_i.h diff --git a/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc new file mode 100644 index 00000000000..caae6351bbc --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/Messenger_StaticDAnCE.mpc @@ -0,0 +1,18 @@ +// -*- MPC -*- +// $Id$ + +project(Messenger_StaticDAnCE) { + exename = Messenger_StaticDAnCE + requires += dummy_label + + libs += Receiver_stub Administrator_stub Messenger_stub + libs += Receiver_svnt Administrator_svnt Messenger_svnt + libs += Receiver_exec Administrator_exec Messenger_exec + libpaths += .. + + after += Receiver_exec Administrator_exec Messenger_exec + + Source_Files { + StaticDAnCEApp.cpp + } +} diff --git a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/README.txt b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt index 71cfbcf947f..71cfbcf947f 100644 --- a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/README.txt +++ b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/README.txt diff --git a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp index daf16e8cbba..daf16e8cbba 100644 --- a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp +++ b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/StaticDAnCEApp.cpp diff --git a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/plan.h b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h index a5732221e75..a5732221e75 100644 --- a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/plan.h +++ b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/plan.h diff --git a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl index 825faac5456..825faac5456 100644 --- a/CIAO/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl +++ b/CIAO/examples/DevGuideExamples/Messenger/StaticDAnCE/run_test.pl diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.ccd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd index 23ba49bb84c..23ba49bb84c 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.ccd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.ccd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.cid b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid index af9e9a4c677..af9e9a4c677 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.cid +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cid diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.cpd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd index 972966462e6..972966462e6 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator.cpd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator.cpd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad index 81b7a16da7a..81b7a16da7a 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Exec.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad index 931fc371710..931fc371710 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Stub.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad index 6774a107ef0..6774a107ef0 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Administrator_Svnt.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp index d01ec12e2db..d01ec12e2db 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application-flattened.cdp diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Application.cdp b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp index 9e774373c2f..9e774373c2f 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Application.cdp +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.cdp diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Application.pcd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd index 70635a4850b..70635a4850b 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Application.pcd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Application.pcd diff --git a/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat b/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat new file mode 100644 index 00000000000..91fbbfd4d20 --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/ApplicationNodeMap.dat @@ -0,0 +1,5 @@ +Administrator_Node corbaloc:iiop:localhost:11000/Administrator_Node.NodeManager +First_Receiver_Node corbaloc:iiop:localhost:22000/First_Receiver_Node.NodeManager +Second_Receiver_Node corbaloc:iiop:localhost:33000/Second_Receiver_Node.NodeManager +Messenger_Node corbaloc:iiop:localhost:44000/Messenger_Node.NodeManager + diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Deployment.xsd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd index ae9bc21965d..ae9bc21965d 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Deployment.xsd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Deployment.xsd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Domain.cdd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd index 54a8c1f5a82..54a8c1f5a82 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Domain.cdd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Domain.cdd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Libraries.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad index d861613c157..d861613c157 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Libraries.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Libraries.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.ccd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd index cf79d7fb9f7..cf79d7fb9f7 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.ccd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.ccd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.cid b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid index c4e934f1ee2..c4e934f1ee2 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.cid +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cid diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.cpd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd index ee624b9bce5..ee624b9bce5 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger.cpd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger.cpd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd index c048d99133d..c048d99133d 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.ccd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid index bd0bf4e56ce..bd0bf4e56ce 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cid diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd index a719ad571c9..a719ad571c9 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/MessengerAssembly.cpd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad index 0b8cef2092c..0b8cef2092c 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Exec.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad index 50447209f50..50447209f50 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Stub.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad index 29b83d63e53..29b83d63e53 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Messenger_Svnt.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/README_15a b/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a index ac466837dc4..ac466837dc4 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/README_15a +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/README_15a diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.ccd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd index 3094ae368dc..3094ae368dc 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.ccd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.ccd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.cid b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid index c5c85d648da..c5c85d648da 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.cid +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cid diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.cpd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd index 8b8ff890fa2..8b8ff890fa2 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver.cpd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver.cpd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad index adcee103c94..adcee103c94 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Exec.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad index 63d7e37cc8e..63d7e37cc8e 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Stub.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad index 8e3bf58d965..8e3bf58d965 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/Receiver_Svnt.iad diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/XMI.xsd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd index f4adac91934..f4adac91934 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/XMI.xsd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/XMI.xsd diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/admin.dat b/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat index f5815bb1f60..f5815bb1f60 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/admin.dat +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/admin.dat diff --git a/CIAO/DevGuideExamples/Messenger/descriptors/package.tpd b/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd index f481b6bd789..f481b6bd789 100644 --- a/CIAO/DevGuideExamples/Messenger/descriptors/package.tpd +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/package.tpd diff --git a/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl b/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl new file mode 100644 index 00000000000..e7554bfefae --- /dev/null +++ b/CIAO/examples/DevGuideExamples/Messenger/descriptors/run_test.pl @@ -0,0 +1,117 @@ +# $Id$ + +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +use Env (ACE_ROOT); +use lib "$ACE_ROOT/bin"; +use PerlACE::Run_Test; + +$emior= PerlACE::LocalFile ("em.ior"); +unlink $emior; +$plior= PerlACE::LocalFile ("pl.ior"); +unlink $plior; + +if (defined $ENV{'CIAO_ROOT'}) { + $CIAO_ROOT = $ENV{'CIAO_ROOT'}; +} +else { + $CIAO_ROOT = $ACE_ROOT/TAO/CIAO; +} + +if (defined $ENV{'DANCE_ROOT'}) { + $DANCE_ROOT = $ENV{'DANCE_ROOT'}; +} +else { + $DANCE_ROOT = $ACE_ROOT/TAO/CIAO/DAnCE; +} + + +$NA = new PerlACE::Process ("$CIAO_ROOT/bin/ciao_componentserver"); +$NA_cmd = $NA->Executable (); + +$NA1 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:11000 -s $NA_cmd -n Administrator_Node"); + +$NA2 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:22000 -s $NA_cmd -n First_Receiver_Node"); + +$NA3 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:33000 -s $NA_cmd -n Second_Receiver_Node"); + +$NA4 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_node_manager", + "-ORBEndpoint iiop://localhost:44000 -s $NA_cmd -n Messenger_Node"); + +# Each Node Manager lauches a Node Application process. +open(STDIN, "<admin.dat"); +$Ret1 = $NA1->Spawn (); +if($Ret1 == -1) { + print STDERR "ERROR: Administrator returned <$Ret1>\n" +} + +$Ret2 = $NA2->Spawn (); +if($Ret2 == -1) { + print STDERR "ERROR: Receiver 1 returned <$Ret2>\n" +} + +$Ret3 = $NA3->Spawn (); +if($Ret3 == -1) { + print STDERR "ERROR: Receiver 2 returned <$Ret3>\n" +} + +$Ret4 = $NA4->Spawn (); +if($Ret4 == -1) { + print STDERR "ERROR: Messenger returned <$Ret4>\n" +} + +#Start an Execution Manager +$EM = new PerlACE::Process ("$DANCE_ROOT/bin/dance_execution_manager", "-e$emior --node-map ApplicationNodeMap.dat"); + +$Ret5 = $EM->Spawn (); +if($Ret5 == -1) { + print STDERR "ERROR: Execution Manager returned <$Ret5>\n" +} + +if (PerlACE::waitforfile_timed ($emior, 5) == -1) { + print STDERR "ERROR: cannot find file <$emior>\n"; + $EM->Kill(); + unlink $emior; + exit 1; +} + +sleep(5); +#Start the plan laucnher +$EX = new PerlACE::Process ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x Application-flattened_Unhomed.cdp -k file://$emior "); + +#Stop the plan launcher +$EX2 = new PerlACE::Process ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$emior -x Application-flattened_Unhomed.cdp"); + +$Ret6 = $EX->Spawn (); +if($Ret6 == -1) { + print STDERR "ERROR: plan launcher returned <$Ret6>\n" +} + +sleep(10); + +$Ret7 = $EX2->Spawn (); +if($Ret7 == -1) { + print STDERR "ERROR: plan launcher (shutdown) returned <$Ret7>\n" +} + +sleep(5); + +$NA1->Kill(); +$NA2->Kill(); +$NA3->Kill(); +$NA4->Kill(); +$EX->Kill(); +$EX2->Kill(); +$EM->Kill(); + +unlink $emior; +unlink $plior; + +exit 0; diff --git a/CIAO/DevGuideExamples/readme.txt b/CIAO/examples/DevGuideExamples/readme.txt index f6efa4d084f..f6efa4d084f 100644 --- a/CIAO/DevGuideExamples/readme.txt +++ b/CIAO/examples/DevGuideExamples/readme.txt diff --git a/CIAO/examples/Display/Display_Base/Display_Base.mpc b/CIAO/examples/Display/Display_Base/Display_Base.mpc index 6527818b9fc..5602deff2bb 100644 --- a/CIAO/examples/Display/Display_Base/Display_Base.mpc +++ b/CIAO/examples/Display/Display_Base/Display_Base.mpc @@ -14,7 +14,7 @@ project(Display_Base_idl_gen) : taoidldefaults, anytypecode { } } -project(Display_Base_stub) : ciao_client_dnc { +project(Display_Base_stub) : ccm_stub { avoids += ace_for_tao after += Display_Base_idl_gen libs += @@ -40,7 +40,7 @@ project(Display_Base_stub) : ciao_client_dnc { } -project(Display_Base_skel) : ciao_component_dnc { +project(Display_Base_skel) : ciao_executor { avoids += ace_for_tao after += Display_Base_stub sharedname = Display_Base_skel diff --git a/CIAO/examples/Display/GPS/GPS.mpc b/CIAO/examples/Display/GPS/GPS.mpc index 36b64317045..c3f4e021b0a 100644 --- a/CIAO/examples/Display/GPS/GPS.mpc +++ b/CIAO/examples/Display/GPS/GPS.mpc @@ -32,7 +32,7 @@ project(Display_GPS_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Display_GPS_stub) : ciao_client_dnc { +project(Display_GPS_stub) : ccm_stub { avoids += ace_for_tao after += Display_GPS_idl_gen Display_Base_stub libs += Display_Base_stub @@ -57,7 +57,7 @@ project(Display_GPS_stub) : ciao_client_dnc { } } -project(Display_GPS_exec) : ciao_component_dnc { +project(Display_GPS_exec) : ciao_executor { avoids += ace_for_tao after += Display_GPS_cidl_gen Display_GPS_stub sharedname = GPS_exec @@ -85,7 +85,7 @@ project(Display_GPS_exec) : ciao_component_dnc { } -project(Display_GPS_svnt) : ciao_servant_dnc { +project(Display_GPS_svnt) : ciao_servant { avoids += ace_for_tao after += Display_Base_skel Display_GPS_exec sharedname = GPS_svnt diff --git a/CIAO/examples/Display/GPS/GPS_exec.cpp b/CIAO/examples/Display/GPS/GPS_exec.cpp index a350934a443..1ed6d95ca2f 100644 --- a/CIAO/examples/Display/GPS/GPS_exec.cpp +++ b/CIAO/examples/Display/GPS/GPS_exec.cpp @@ -1,7 +1,8 @@ + // $Id$ #include "GPS_exec.h" -#include "CIAO_common.h" +#include "ciao/CIAO_common.h" #include "ace/OS_NS_time.h" @@ -76,8 +77,7 @@ MyImpl::GPS_exec_i::posy () void MyImpl::GPS_exec_i::set_session_context (Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::set_session_context\n")); + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::set_session_context\n")); this->context_ = HUDisplay::CCM_GPS_Context::_narrow (ctx); @@ -88,34 +88,26 @@ MyImpl::GPS_exec_i::set_session_context (Components::SessionContext_ptr ctx) } void -MyImpl::GPS_exec_i::ciao_preactivate () +MyImpl::GPS_exec_i::configuration_complete () { } void MyImpl::GPS_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_activate\n")); -} - -void -MyImpl::GPS_exec_i::ciao_postactivate () -{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_activate\n")); } void MyImpl::GPS_exec_i::ccm_passivate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_passivate\n")); + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_passivate\n")); } void MyImpl::GPS_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_remove\n")); + ACE_DEBUG ((LM_DEBUG, "MyImpl::GPS_exec_i::ccm_remove\n")); } /// Default ctor. diff --git a/CIAO/examples/Display/GPS/GPS_exec.h b/CIAO/examples/Display/GPS/GPS_exec.h index 4af001a983d..d4b17876c4a 100644 --- a/CIAO/examples/Display/GPS/GPS_exec.h +++ b/CIAO/examples/Display/GPS/GPS_exec.h @@ -10,7 +10,7 @@ #include "GPS_exec_export.h" #include "GPSEC.h" -#include "CIAO_common.h" +#include "ciao/CIAO_common.h" #include "ace/OS_NS_time.h" #include "tao/LocalObject.h" @@ -48,12 +48,10 @@ namespace MyImpl // Operations from Components::SessionComponent void set_session_context (Components::SessionContext_ptr ctx); - void ciao_preactivate (); + void configuration_complete (); void ccm_activate (); - void ciao_postactivate (); - void ccm_passivate (); void ccm_remove (); diff --git a/CIAO/examples/Display/GPS/GPS_tracing_exec.cpp b/CIAO/examples/Display/GPS/GPS_tracing_exec.cpp index 4a5b7374180..3db8a56c193 100644 --- a/CIAO/examples/Display/GPS/GPS_tracing_exec.cpp +++ b/CIAO/examples/Display/GPS/GPS_tracing_exec.cpp @@ -79,7 +79,7 @@ MyImpl::GPS_tracing_exec_i::set_session_context ( } void -MyImpl::GPS_tracing_exec_i::ciao_preactivate () +MyImpl::GPS_tracing_exec_i::configuraton_complete () { } @@ -91,11 +91,6 @@ MyImpl::GPS_tracing_exec_i::ccm_activate () } void -MyImpl::GPS_tracing_exec_i::ciao_postactivate () -{ -} - -void MyImpl::GPS_tracing_exec_i::ccm_passivate () { if (CIAO::debug_level () > 0) diff --git a/CIAO/examples/Display/GPS/GPS_tracing_exec.h b/CIAO/examples/Display/GPS/GPS_tracing_exec.h index 4e39719ff6e..a03432cc42c 100644 --- a/CIAO/examples/Display/GPS/GPS_tracing_exec.h +++ b/CIAO/examples/Display/GPS/GPS_tracing_exec.h @@ -55,15 +55,12 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (); + configuration_complete (); virtual void ccm_activate (); virtual void - ciao_postactivate (); - - virtual void ccm_passivate (); virtual void diff --git a/CIAO/examples/Display/NavDisplay/NavDisplay.mpc b/CIAO/examples/Display/NavDisplay/NavDisplay.mpc index 5e10b1fd58c..bd3fbe2171f 100644 --- a/CIAO/examples/Display/NavDisplay/NavDisplay.mpc +++ b/CIAO/examples/Display/NavDisplay/NavDisplay.mpc @@ -32,7 +32,7 @@ project(Display_NavDisplay_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Display_NavDisplay_stub) : ciao_client_dnc { +project(Display_NavDisplay_stub) : ccm_stub { avoids += ace_for_tao after += Display_NavDisplay_idl_gen Display_Base_stub libs += Display_Base_stub @@ -57,7 +57,7 @@ project(Display_NavDisplay_stub) : ciao_client_dnc { } } -project(Display_NavDisplay_exec) : ciao_component_dnc { +project(Display_NavDisplay_exec) : ciao_executor { avoids += ace_for_tao after += Display_NavDisplay_cidl_gen Display_NavDisplay_stub sharedname = NavDisplay_exec @@ -85,7 +85,7 @@ project(Display_NavDisplay_exec) : ciao_component_dnc { } -project(Display_NavDisplay_svnt) : ciao_servant_dnc { +project(Display_NavDisplay_svnt) : ciao_servant { avoids += ace_for_tao after += Display_Base_skel Display_NavDisplay_exec sharedname = NavDisplay_svnt diff --git a/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp b/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp index da1dbbd5ad1..6d9c50a0c52 100644 --- a/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp +++ b/CIAO/examples/Display/NavDisplay/NavDisplay_exec.cpp @@ -21,7 +21,7 @@ MyImpl::NavDisplay_exec_impl::push_Refresh (HUDisplay::tick *ev) ACE_UNUSED_ARG (ev); // ACE_DEBUG ((LM_DEBUG, -// ACE_TEXT ("NAVDISPLAY: Received Refresh Event\n"))); +// ACE_TEXT ("NAVDISPLAY: Received Refresh Event\n"))); // Refresh position HUDisplay::position_var loc = @@ -47,12 +47,8 @@ void MyImpl::NavDisplay_exec_impl::set_session_context ( Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::NavDisplay_exec_impl::set_session_context\n")); - } - + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::set_session_context\n")); this->context_ = HUDisplay::CCM_NavDisplay_Context::_narrow (ctx); @@ -64,43 +60,22 @@ MyImpl::NavDisplay_exec_impl::set_session_context ( } void -MyImpl::NavDisplay_exec_impl::ciao_preactivate (void) +MyImpl::NavDisplay_exec_impl::configuration_complete (void) { } void MyImpl::NavDisplay_exec_impl::ccm_activate (void) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::NavDisplay_exec_impl::ccm_activate\n")); - } -} - -void -MyImpl::NavDisplay_exec_impl::ciao_postactivate (void) -{ -} - -void -MyImpl::NavDisplay_exec_impl::ccm_passivate (void) -{ - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::NavDisplay_exec_impl::ccm_passivate\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::ccm_activate\n")); } void MyImpl::NavDisplay_exec_impl::ccm_remove (void) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::NavDisplay_exec_impl::ccm_remove\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::NavDisplay_exec_impl::ccm_remove\n")); } /// Default ctor. diff --git a/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h b/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h index a23e570dcc0..ef3fd8007dd 100644 --- a/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h +++ b/CIAO/examples/Display/NavDisplay/NavDisplay_exec.h @@ -45,15 +45,13 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (void); - virtual void - ccm_activate (void); + configuration_complete (void); virtual void - ciao_postactivate (void); + ccm_activate (void); virtual void - ccm_passivate (void); + ccm_passivate (void) {}; virtual void ccm_remove (void); diff --git a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc index f990dca9c60..1111fd0a2be 100644 --- a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc +++ b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI.mpc @@ -1,6 +1,6 @@ // $Id$ -project(Display_NavDisplayGUI_exec) : ciao_component_dnc, qt { +project(Display_NavDisplayGUI_exec) : ciao_executor, qt { avoids += ace_for_tao after += Display_NavDisplay_cidl_gen \ Display_NavDisplay_stub @@ -48,7 +48,7 @@ project(Display_NavDisplayGUI_exec) : ciao_component_dnc, qt { } } -project(Display_NavDisplayGUI_svnt) : ciao_servant_dnc { +project(Display_NavDisplayGUI_svnt) : ciao_servant { avoids += ace_for_tao requires += qt after += Display_Base_skel Display_NavDisplayGUI_exec diff --git a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp index 677bd3c64ab..fe273c2e84d 100644 --- a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp +++ b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.cpp @@ -101,7 +101,7 @@ MyImpl::NavDisplayGUI_exec_impl::set_session_context (Components::SessionContext } void -MyImpl::NavDisplayGUI_exec_impl::ciao_preactivate (void) +MyImpl::NavDisplayGUI_exec_impl::configuration_complete (void) { } @@ -143,11 +143,6 @@ MyImpl::NavDisplayGUI_exec_impl::ccm_activate (void) } void -MyImpl::NavDisplayGUI_exec_impl::ciao_postactivate (void) -{ -} - -void MyImpl::NavDisplayGUI_exec_impl::ccm_passivate (void) { if (CIAO::debug_level () > 0) diff --git a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h index 587bd699b94..7b7ccb239db 100644 --- a/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h +++ b/CIAO/examples/Display/NavDisplayGUI_exec/NavDisplayGUI_exec.h @@ -49,15 +49,12 @@ namespace MyImpl set_session_context (Components::SessionContext_ptr ctx); virtual void - ciao_preactivate (void); + configuration_complete (void); virtual void ccm_activate (void); virtual void - ciao_postactivate (void); - - virtual void ccm_passivate (void); virtual void diff --git a/CIAO/examples/Display/RateGen/RateGen.mpc b/CIAO/examples/Display/RateGen/RateGen.mpc index 325af07da63..c7a0190a0c5 100644 --- a/CIAO/examples/Display/RateGen/RateGen.mpc +++ b/CIAO/examples/Display/RateGen/RateGen.mpc @@ -32,7 +32,7 @@ project(Display_RateGen_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Display_RateGen_stub) : ciao_client_dnc { +project(Display_RateGen_stub) : ccm_stub { avoids += ace_for_tao after += Display_RateGen_idl_gen Display_Base_stub libs += Display_Base_stub @@ -57,7 +57,7 @@ project(Display_RateGen_stub) : ciao_client_dnc { } } -project(Display_RateGen_exec) : ciao_component_dnc { +project(Display_RateGen_exec) : ciao_executor { avoids += ace_for_tao after += Display_RateGen_cidl_gen Display_RateGen_stub sharedname = RateGen_exec @@ -85,7 +85,7 @@ project(Display_RateGen_exec) : ciao_component_dnc { } -project(Display_RateGen_svnt) : ciao_servant_dnc { +project(Display_RateGen_svnt) : ciao_servant { avoids += ace_for_tao after += Display_Base_skel Display_RateGen_exec sharedname = RateGen_svnt @@ -118,7 +118,7 @@ project(Display_RateGen_svnt) : ciao_servant_dnc { } } -project (Display_controller) : ciao_client_dnc, valuetype { +project (Display_controller) : ccm_stub, valuetype { avoids += ace_for_tao exename = controller after += Display_RateGen_stub diff --git a/CIAO/examples/Display/RateGen/RateGen_exec.cpp b/CIAO/examples/Display/RateGen/RateGen_exec.cpp index 41782966074..1e5db3c78d2 100644 --- a/CIAO/examples/Display/RateGen/RateGen_exec.cpp +++ b/CIAO/examples/Display/RateGen/RateGen_exec.cpp @@ -1,7 +1,7 @@ // $Id$ #include "RateGen_exec.h" -#include "CIAO_common.h" +#include "ciao/CIAO_common.h" #include "ace/Timer_Queue.h" #include "ace/Reactor.h" @@ -35,10 +35,7 @@ MyImpl::Pulse_Handler::close_h () this->done_ = 1; this->reactor ()->notify (); - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, "Waiting\n")); - } + ACE_DEBUG ((LM_DEBUG, "Waiting\n")); return this->wait (); } @@ -86,14 +83,12 @@ int MyImpl::Pulse_Handler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), - this, - handle, - close_mask)); - } + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), + this, + handle, + close_mask)); return 0; } @@ -196,11 +191,8 @@ MyImpl::RateGen_exec_i::set_session_context ( Components::SessionContext_ptr ctx ) { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::RateGen_exec_i::set_session_context\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RateGen_exec_i::set_session_context\n")); this->context_ = HUDisplay::CCM_RateGen_Context::_narrow (ctx); @@ -214,35 +206,24 @@ MyImpl::RateGen_exec_i::set_session_context ( } void -MyImpl::RateGen_exec_i::ciao_preactivate () +MyImpl::RateGen_exec_i::configuration_complete () { } void MyImpl::RateGen_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::RateGen_exec_i::ccm_activate\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RateGen_exec_i::ccm_activate\n")); this->pulser_.open_h (); } void -MyImpl::RateGen_exec_i::ciao_postactivate () -{ -} - -void MyImpl::RateGen_exec_i::ccm_passivate () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::RateGen_exec_i::ccm_passivate\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RateGen_exec_i::ccm_passivate\n")); this->pulser_.close_h (); } @@ -250,11 +231,8 @@ MyImpl::RateGen_exec_i::ccm_passivate () void MyImpl::RateGen_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - { - ACE_DEBUG ((LM_DEBUG, - "MyImpl::RateGen_exec_i::ccm_remove\n")); - } + ACE_DEBUG ((LM_DEBUG, + "MyImpl::RateGen_exec_i::ccm_remove\n")); } void diff --git a/CIAO/examples/Display/RateGen/RateGen_exec.h b/CIAO/examples/Display/RateGen/RateGen_exec.h index 0599f81b83a..6aae4dc4855 100644 --- a/CIAO/examples/Display/RateGen/RateGen_exec.h +++ b/CIAO/examples/Display/RateGen/RateGen_exec.h @@ -105,12 +105,10 @@ namespace MyImpl virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/examples/Display/RateGen/controller.cpp b/CIAO/examples/Display/RateGen/controller.cpp index cb40f778df0..311ce0a1419 100644 --- a/CIAO/examples/Display/RateGen/controller.cpp +++ b/CIAO/examples/Display/RateGen/controller.cpp @@ -12,7 +12,7 @@ * RateGen. */ -const char *rategen_ior_ = 0; +const ACE_TCHAR *rategen_ior_ = 0; int rate = 2; int turn_on = 1; @@ -55,7 +55,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) if (rategen_ior_ == 0) { - rategen_ior_ = "file://RateGen.ior"; + rategen_ior_ = ACE_TEXT("file://RateGen.ior"); } if (rate == 0) diff --git a/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc b/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc index 01fcc996184..3fd5fcd83a8 100644 --- a/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc +++ b/CIAO/examples/Hello/Hello_Base/Hello_Base.mpc @@ -14,7 +14,7 @@ project(Hello_Base_idl_gen) : taoidldefaults, anytypecode { } } -project(Hello_Base_stub) : ciao_client_dnc { +project(Hello_Base_stub) : ccm_stub { avoids += ace_for_tao after += Hello_Base_idl_gen libs += @@ -40,7 +40,7 @@ project(Hello_Base_stub) : ciao_client_dnc { } -project(Hello_Base_skel) : ciao_component_dnc { +project(Hello_Base_skel) : ccm_svnt { avoids += ace_for_tao after += Hello_Base_stub sharedname = Hello_Base_skel diff --git a/CIAO/examples/Hello/ReDaC-Usage.html b/CIAO/examples/Hello/ReDaC-Usage.html deleted file mode 100644 index eb9b8c729b7..00000000000 --- a/CIAO/examples/Hello/ReDaC-Usage.html +++ /dev/null @@ -1,308 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<!--//$Id$ --> - - - - <title>ReDaC Service Usage</title> -</head> - - -<body style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" alink="#0000ff" link="#000fff" vlink="#ff0f0f"> - - -<hr> -<h2>Simple Tutorial for using ReDaC (<span style="font-style: italic;">Redeployment and Reconfiguration</span>)</h2> - - -<span style="font-weight: bold;">Prerequisite</span><b>:<br> - - -<br> - - -</b>Before you proceed further, please read the <a href="./step-by-step.html">step-by-step</a> tutorial -page first.<b><br> - - -<br> - - -</b><b>Note:</b> -<br> - - -<ul> - - - <li>ReDaC is a middleware service provided by the <a href="http://www.cs.wustl.edu/%7Eschmidt/ACE_wrappers/TAO/CIAO/docs/releasenotes/dance.html">DAnCE</a> -framework.</li> - - - <li>ReDaC service is used for redeployment and/or -reconfiguration of your running component-based application on -the fly without shutting down your application. </li> - - - <li>ReDaC currently works for CIAO QoS-enabled component -middleware only.</li> - - -</ul> - - -<hr> -<h2>Example Description</h2> - - -We will use the Hello example to illustrate how one could use ReDaC -service to perform redeployment and reconfiguration. -<hr> -<h3>Initial Deployment</h3> - - -Below steps are required for the initial deployment of your application, -which is performed by DAnCE. The below steps are different from those -presented in the <a href="./step-by-step.html">step-by-step</a> -tutorial page in the sense that we pass different command line options -to the <span style="font-style: italic;">Plan_Launcher</span> -client:<br> - - -<ul> - - - <li> Go into the <em> descriptors </em> directory -Start NodeManagers (NodeDameons) by running <code> -run_NodeDaemons.pl </code> </li> - - - - <ul> - - - <li>This step is the same as the one presented in the - <a href="step-by-step.html">step-by-step</a> -tutorial page. </li> - - - - </ul> - - - <li> Start the execution manager: <code>$CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager --o EM.ior -i NodeManagerMap.dat </code> </li> - - - - <ul> - - - <li> As one can see, we use the -"NodeManagerMap.dat" file to instruct the Execution_Manager how to find -the endpoint of each individual NodeManager (i.e., Node Daemon) where -component(s) will be deployed.</li> - - - - </ul> - - - - <ul> - - - <li>This step is the same as the one presented in the - <a href="step-by-step.html">step-by-step</a> -tutorial page. </li> - - - - </ul> - - - <li> Start the plan launcher: <code> -$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p -flattened_deploymentplan_without_ns.cdp -k file://EM.ior -o DAM.ior</code> </li> - - - - <ul> - - - <li>After this, components should be deployed -successfully. </li> - - - <li>This step is different from the one presented -in the - <a href="step-by-step.html">step-by-step</a> -tutorial page in the way that we added an additional "<code>-o</code>" -option when running <code>Plan_Launcher</code>, which -dumps an IOR file of DAnCE's DomainApplicationManager. With -this option added, the <code>plan_launcher </code>will -exit immediately after the application is deployed, instead of staying -in the interactive mode. (As a normal user, you don't need to worry -about the details of what exactly a DomainApplicationManager is.)</li> - - - - </ul> - - -</ul> - - -<hr> -<h3>Redeployment and Reconfiguration</h3> - - -Basically, you could use ReDaC service in two ways. <br> - - -<ol style="font-weight: bold;"> - - - <li>Use ReDaC service <span style="font-style: italic;">directly</span> -through DAnCE's <span style="font-style: italic;">Plan_Launcher</span> -client</li> - - - <li><span style="font-weight: bold;">Use ReDaC -service <span style="font-style: italic;">programmatically</span> -by writing your own client</span></li> - - -</ol> - - -This tutorial illustrates how exactly you could use ReDaC.<br> - - -<br style="font-weight: bold;"> - - -<span style="font-weight: bold;">Use ReDaC service through -</span><span style="font-style: italic; font-weight: bold;">Plan_Launcher</span><span style="font-weight: bold;"> of DAnCE:</span><br> - - -<ul> - - - <li>As we've already mentioned, you should first deploy your -Hello application with DAnCE, which is described in the above "Initial -Deployment" section of this tutorial.<code> </code> - </li> - - - <li> - - <p> Use ReDaC service through <code>Plan_Launcher</code>'s -"-r" command line option to perform redeployment and reconfiguration.<br> - - -Run the command - <code>$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -r -flattened_deploymentplan_without_ns_add.cdp </code>will add -additional components to the existing running assembly.</p> - - - </li> - - - <li> - - <p>Run the command - <code>$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -r -flattened_deploymentplan_without_ns_remove.cdp </code>will -remove components from the existing running assembly.</p> - - - </li> - - - <li>Run the command - <code></code><code>$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher --i file://DAM.ior</code> will tear down your entire application -completely.</li> - - -</ul> - - -<br> - - -<div style="margin-left: 40px;"><span style="font-weight: bold;">NOTE: </span>By -using ReDaC through Plan_Launcher, as a user you must provide a new -DeploymentPlan (.cdp) XML file, which captures the new deployment and -configuration settings of your application, and the Plan_UUID of the -new DeploymentPlan should be the same as the one of the old -(running) DeploymentPlan. Otherwise, DAnCE will think you want to -deploy a totally different deployment plan, instead of applying some -changes to the existing plan. One could use <a href="http://www.dre.vanderbilt.edu/cosmic">CoSMIC</a> MDD tool to create such a deployment plan XML file.<br> - -</div> - - -<br> - - -<span style="font-weight: bold;">Use ReDaC service <span style="font-style: italic;">programmatically</span>:</span><span style="font-weight: bold;"></span> -<ul> - - - - <p> You could also use ReDaC service programmatically by writing your -own client to invoke ReDaC service. Basically, to accomplish this, your -client program needs to:</p> - - - <ol> - - <li>Obtain the <code>ExecutionManager</code> object reference, either through naming service or through IOR file.</li> - - <li>Invoke the operation <code>perform_redeployment</code> on this interface by passing a single argument type called <code>DeploymentPlan</code>.</li> - - - </ol> - - -</ul> - - -<div style="margin-left: 40px;">The IDL signature of this operation is as follows:<br> - -<code><br> - - void perform_redeployment (in DeploymentPlan new_plan)<br> - - raises (PlanError,<br> - - InstallationFailure,<br> - - UnknownImplId,<br> - - ImplEntryPointNotFound,<br> - - InvalidConnection,<br> - - InvalidProperty,<br> - - ::Components::RemoveFailure);</code><br> - -</div> - - -<br> -<div style="margin-left: 40px;">In order to simplify the creation of a the <code>"new_plan", </code>we are implementing a utility class which allows a developer to easily manipulate a deployment plan data structure.</div> - - -<hr> -<b>Email: </b> -<address>ciao-users@cse.wustl.edu</address> - - -</body> -</html> diff --git a/CIAO/examples/Hello/Receiver/Receiver.mpc b/CIAO/examples/Hello/Receiver/Receiver.mpc index 94054fa4ce1..6a0a3cfa2c5 100644 --- a/CIAO/examples/Hello/Receiver/Receiver.mpc +++ b/CIAO/examples/Hello/Receiver/Receiver.mpc @@ -32,7 +32,7 @@ project(Hello_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Hello_Receiver_stub) : ciao_client_dnc { +project(Hello_Receiver_stub) : ccm_stub { avoids += ace_for_tao after += Hello_Receiver_idl_gen Hello_Base_stub libs += Hello_Base_stub @@ -57,7 +57,7 @@ project(Hello_Receiver_stub) : ciao_client_dnc { } } -project(Hello_Receiver_exec) : ciao_component_dnc { +project(Hello_Receiver_exec) : ciao_executor { avoids += ace_for_tao after += Hello_Receiver_cidl_gen Hello_Receiver_stub sharedname = Hello_Receiver_exec @@ -85,7 +85,7 @@ project(Hello_Receiver_exec) : ciao_component_dnc { } -project(Hello_Receiver_svnt) : ciao_servant_dnc { +project(Hello_Receiver_svnt) : ciao_servant { avoids += ace_for_tao after += Hello_Base_skel Hello_Receiver_exec sharedname = Hello_Receiver_svnt diff --git a/CIAO/examples/Hello/Receiver/Receiver_exec.cpp b/CIAO/examples/Hello/Receiver/Receiver_exec.cpp index b2de2e9c7ab..ab2635814fc 100644 --- a/CIAO/examples/Hello/Receiver/Receiver_exec.cpp +++ b/CIAO/examples/Hello/Receiver/Receiver_exec.cpp @@ -36,7 +36,7 @@ namespace CIDL_Receiver_Impl { //Get the message from the Sender first. ACE_DEBUG ((LM_DEBUG, - "Receiver - Informed by the Sender with message [%s]\n", + "Receiver - Informed by the Sender with message [%C]\n", ev->data ())); Hello::ReadMessage_var rev @@ -48,7 +48,7 @@ namespace CIDL_Receiver_Impl CORBA::String_var str = rev->get_message (); ACE_DEBUG ((LM_DEBUG, - "Receiver - Got message from the server [%s] \n", + "Receiver - Got message from the server [%C]\n", str.in () )); } @@ -68,10 +68,10 @@ namespace CIDL_Receiver_Impl } void - Receiver_exec_i::ciao_preactivate () + Receiver_exec_i::configuration_complete () { ACE_DEBUG ((LM_DEBUG, - "Receiver_exec_i::ciao_preactivate\n")); + "Receiver_exec_i::configuration_complete\n")); } void @@ -81,13 +81,6 @@ namespace CIDL_Receiver_Impl } void - Receiver_exec_i::ciao_postactivate () - { - ACE_DEBUG ((LM_DEBUG, - "Receiver_exec_i::ciao_postactivate\n")); - } - - void Receiver_exec_i::ccm_passivate () { ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::ccm_passivate\n")); diff --git a/CIAO/examples/Hello/Receiver/Receiver_exec.h b/CIAO/examples/Hello/Receiver/Receiver_exec.h index 2e1d473a34a..e24520126c7 100644 --- a/CIAO/examples/Hello/Receiver/Receiver_exec.h +++ b/CIAO/examples/Hello/Receiver/Receiver_exec.h @@ -58,15 +58,10 @@ namespace CIDL_Receiver_Impl // Operations from Components::SessionComponent virtual void set_session_context (::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - - virtual void ciao_postactivate (); - - virtual void ccm_passivate (); - virtual void ccm_remove (); protected: diff --git a/CIAO/examples/Hello/Sender/Sender.mpc b/CIAO/examples/Hello/Sender/Sender.mpc index 0f26536a785..85f9fd94d1f 100644 --- a/CIAO/examples/Hello/Sender/Sender.mpc +++ b/CIAO/examples/Hello/Sender/Sender.mpc @@ -32,7 +32,7 @@ project(Hello_Sender_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Hello_Sender_stub) : ciao_client_dnc { +project(Hello_Sender_stub) : ccm_stub { avoids += ace_for_tao after += Hello_Sender_idl_gen Hello_Base_stub libs += Hello_Base_stub @@ -57,7 +57,7 @@ project(Hello_Sender_stub) : ciao_client_dnc { } } -project(Hello_Sender_exec) : ciao_component_dnc { +project(Hello_Sender_exec) : ciao_executor { avoids += ace_for_tao after += Hello_Sender_cidl_gen Hello_Sender_stub sharedname = Hello_Sender_exec @@ -85,7 +85,7 @@ project(Hello_Sender_exec) : ciao_component_dnc { } -project(Hello_Sender_svnt) : ciao_servant_dnc { +project(Hello_Sender_svnt) : ciao_servant { avoids += ace_for_tao after += Hello_Base_skel Hello_Sender_exec sharedname = Hello_Sender_svnt @@ -118,7 +118,7 @@ project(Hello_Sender_svnt) : ciao_servant_dnc { } } -project (Hello_starter) : ciao_client_dnc, valuetype { +project (Hello_starter) : ccm_stub, valuetype { avoids += ace_for_tao exename = starter after += Hello_Sender_stub diff --git a/CIAO/examples/Hello/Sender/Sender_exec.cpp b/CIAO/examples/Hello/Sender/Sender_exec.cpp index 05834007ace..e2c27d3e202 100644 --- a/CIAO/examples/Hello/Sender/Sender_exec.cpp +++ b/CIAO/examples/Hello/Sender/Sender_exec.cpp @@ -26,7 +26,7 @@ namespace CIDL_Sender_Impl char* Message_Impl::get_message () { - ACE_DEBUG ((LM_DEBUG, "Sender sending out message: [%s]\n", component_.message_.in ())); + ACE_DEBUG ((LM_EMERGENCY, "Sender sending out message: [%C]\n", component_.message_.in ())); return CORBA::string_dup (component_.message_.in ()); } @@ -50,7 +50,7 @@ namespace CIDL_Sender_Impl Sender_exec_i::hertz (CORBA::Long hertz) { this->hertz_ = hertz; - ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::Hertz:%d\n", this->hertz_)); + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::Hertz:%d\n", this->hertz_)); } CORBA::Long @@ -75,7 +75,7 @@ namespace CIDL_Sender_Impl Hello::CCM_ReadMessage_ptr Sender_exec_i::get_push_message () { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec.i::get_push_message called\n ")); return ( new Message_Impl (*this) ); } @@ -85,31 +85,31 @@ namespace CIDL_Sender_Impl { Hello::TimeOut_var event = new OBV_Hello::TimeOut; event->data ("ACE/TAO/CIAO"); - ACE_DEBUG ((LM_DEBUG, "Sender initiates the process.\n")); + ACE_DEBUG ((LM_EMERGENCY, "Sender initiates the process.\n")); this->context_->push_click_out (event.in ()); - ACE_DEBUG ((LM_DEBUG, "My current color is:")); + ACE_DEBUG ((LM_EMERGENCY, "My current color is:")); switch (this->color_) { case ::Hello::empty: - ACE_DEBUG ((LM_DEBUG, "ERROR: Enum attribute initialization failed.\n")); + ACE_DEBUG ((LM_EMERGENCY, "ERROR: Enum attribute initialization failed.\n")); break; case ::Hello::white: - ACE_DEBUG ((LM_DEBUG, "white\n")); + ACE_DEBUG ((LM_EMERGENCY, "white\n")); break; case ::Hello::red: - ACE_DEBUG ((LM_DEBUG, "red\n")); + ACE_DEBUG ((LM_EMERGENCY, "red\n")); break; case ::Hello::yellow: - ACE_DEBUG ((LM_DEBUG, "yellow\n")); + ACE_DEBUG ((LM_EMERGENCY, "yellow\n")); break; default: - ACE_DEBUG ((LM_DEBUG, "Unknown color!\n")); + ACE_DEBUG ((LM_EMERGENCY, "Unknown color!\n")); } } @@ -117,7 +117,7 @@ namespace CIDL_Sender_Impl void Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) { - ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::set_session_context\n")); + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::set_session_context\n")); this->context_ = ::Hello::CCM_Sender_Context::_narrow (ctx); @@ -129,36 +129,29 @@ namespace CIDL_Sender_Impl } void - Sender_exec_i::ciao_preactivate () + Sender_exec_i::configuration_complete () { - ACE_DEBUG ((LM_DEBUG, - "Sender_exec_i::ciao_preactivate\n")); + ACE_DEBUG ((LM_EMERGENCY, + "Sender_exec_i::configuration_complete\n")); } void Sender_exec_i::ccm_activate () { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::ccm_activate\n")); } void - Sender_exec_i::ciao_postactivate () - { - ACE_DEBUG ((LM_DEBUG, - "Sender_exec_i::ciao_postactivate\n")); - } - - void Sender_exec_i::ccm_passivate () { - ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::ccm_passivate\n")); + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::ccm_passivate\n")); } void Sender_exec_i::ccm_remove () { - ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::ccm_remove\n")); + ACE_DEBUG ((LM_EMERGENCY, "Sender_exec_i::ccm_remove\n")); } SenderHome_exec_i::SenderHome_exec_i () @@ -172,7 +165,7 @@ namespace CIDL_Sender_Impl ::Components::EnterpriseComponent_ptr SenderHome_exec_i::create () { - ACE_DEBUG ((LM_DEBUG, "(%P|%t) creating SenderHome \n")); + ACE_DEBUG ((LM_EMERGENCY, "(%P|%t) creating SenderHome \n")); ::Components::EnterpriseComponent_ptr retval = ::Components::EnterpriseComponent::_nil (); diff --git a/CIAO/examples/Hello/Sender/Sender_exec.h b/CIAO/examples/Hello/Sender/Sender_exec.h index 1a3d186dfc5..cf68e2b689f 100644 --- a/CIAO/examples/Hello/Sender/Sender_exec.h +++ b/CIAO/examples/Hello/Sender/Sender_exec.h @@ -95,12 +95,10 @@ namespace CIDL_Sender_Impl // Operations from Components::SessionComponent virtual void set_session_context (::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); @@ -166,6 +164,9 @@ namespace CIDL_Sender_Impl create (); }; + extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Hello_Sender_Impl (void); + extern "C" SENDER_EXEC_Export ::Components::HomeExecutorBase_ptr create_Hello_SenderHome_Impl (void); } diff --git a/CIAO/examples/Hello/Sender/starter.cpp b/CIAO/examples/Hello/Sender/starter.cpp index 1ce3ceced18..3900c541fc1 100644 --- a/CIAO/examples/Hello/Sender/starter.cpp +++ b/CIAO/examples/Hello/Sender/starter.cpp @@ -4,7 +4,7 @@ #include "ace/Get_Opt.h" // IOR file of the Sender -const char * ior = 0; +const ACE_TCHAR * ior = 0; const char * message = 0; int @@ -39,7 +39,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) if (ior == 0) { - ior = "file://Sender.ior"; + ior = ACE_TEXT("file://Sender.ior"); } return 0; diff --git a/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp b/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp index 443ad7b0de3..8d22e0ea906 100644 --- a/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp +++ b/CIAO/examples/Hello/descriptors/DeploymentPlan.cdp @@ -1,31 +1,181 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:deploymentPlan xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Hello_Deployment_1</label> + <UUID>Hello_Deployment_1</UUID> - <UUID>7A745844-C5AB-4402-8D3C-55B68A26B099</UUID> + <!-- Implementations declarations --> - <implementation id="_E91CFCB0-66F0-41A3-99CE-12AEDFACAC8E"> - <name>Hello.ComponentImplementations.ReceiverImplementation.ReceiverMonolithicImpl</name> + <!-- Home implementation --> + <implementation xmi:id="Hello_ReceiverHomeImplementation"> + <name>Hello_ReceiverHomeImplementation</name> <source/> - <artifact>_3D49EF00-0613-471E-A251-84263431CE61</artifact> - <artifact>_B1AD305F-9124-4C36-8502-C5878C6841C7</artifact> - <artifact>_6A3DCF45-7624-4AB1-95CA-A0DDF99053BB</artifact> + <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> + <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_ReceiverHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_ReceiverHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_Receiver_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_Receiver_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Hello_ReceiverComponentImplementation"> + <name>Hello_ReceiverComponentImplementation</name> + <source/> + <artifact xmi:idref="Hello_Receiver_ExecArtifact" /> + <artifact xmi:idref="Hello_Receiver_SvntArtifact" /> + </implementation> + + <implementation xmi:id="Hello_SenderHomeImplementation"> + <name>Hello_SenderHomeImplementation</name> + <source/> + <artifact xmi:idref="Hello_Sender_ExecArtifact" /> + <artifact xmi:idref="Hello_Sender_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see §10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_SenderHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_SenderHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_Sender_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_Sender_exec</string> + </value> + </value> + </execParameter> </implementation> - <implementation id="_CE2EE8B8-BCF7-4E25-B3DB-0BFE5CED3A1C"> - <name>Hello.ComponentImplementations.SenderImplementation.SenderMonolithicImpl</name> + <implementation xmi:id="Hello_SenderComponentImplementation"> + <name>Hello_SenderComponentImplementation</name> <source/> - <artifact>_887DACE6-A0CD-4E0D-B84A-407B4FDB2D4A</artifact> - <artifact>_CB2D05F4-48C0-4567-9D59-534F461A81E7</artifact> - <artifact>_E2E0B980-BA79-43FB-AFC3-788B979E0413</artifact> + <artifact xmi:idref="Hello_Sender_ExecArtifact" /> + <artifact xmi:idref="Hello_Sender_SvntArtifact" /> </implementation> - <instance id="Hello.ComponentImplementations.Hello.Hello.Receiver"> - <name>Hello.ComponentImplementations.Hello.Hello.Receiver</name> + <instance xmi:id="Hello_ReceiverHomeInstance"> + <name>Hello_ReceiverHome</name> <node>ReceiverNode</node> + <!-- hostname --> <source/> - <implementation>_E91CFCB0-66F0-41A3-99CE-12AEDFACAC8E</implementation> + <implementation xmi:idref="Hello_ReceiverHomeImplementation" /> <configProperty> - <name>ComponentIOR</name> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReceiverHome.ior</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>ReceiverHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Hello_ReceiverComponentInstance"> + <name>Hello_ReceiverComponent</name> + <node>ReceiverNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Hello_ReceiverComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_ReceiverHome</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> <value> <type> <kind>tk_string</kind> @@ -36,7 +186,7 @@ </value> </configProperty> <configProperty> - <name>RegisterNaming</name> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> <value> <type> <kind>tk_string</kind> @@ -48,30 +198,50 @@ </configProperty> </instance> - <instance id="Hello.ComponentImplementations.Hello.Hello.Sender"> - <name>Hello.ComponentImplementations.Hello.Hello.Sender</name> + <instance xmi:id="Hello_SenderHomeInstance"> + <name>Hello_SenderHome</name> <node>SenderNode</node> + <!-- hostname --> <source/> - <implementation>_CE2EE8B8-BCF7-4E25-B3DB-0BFE5CED3A1C</implementation> + <implementation xmi:idref="Hello_SenderHomeImplementation" /> <configProperty> - <name>ComponentIOR</name> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>Sender.ior</string> + <string>SenderHome.ior</string> </value> </value> </configProperty> <configProperty> - <name>RegisterNaming</name> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> <value> <type> <kind>tk_string</kind> </type> <value> - <string>Sender</string> + <string>SenderHome</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Hello_SenderComponentInstance"> + <name>Hello_SenderComponent</name> + <node>SenderNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Hello_SenderComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello_SenderHome</string> </value> </value> </configProperty> @@ -105,120 +275,87 @@ </value> </value> </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender.ior</string> + </value> + </value> + </configProperty> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender</string> + </value> + </value> + </configProperty> </instance> - + <connection> - <name>read_message_push_messageHello.ComponentImplementations.Hello.Hello.ReceiverHello.ComponentImplementations.Hello.Hello.Sender</name> + <name>MessageConnection</name> <internalEndpoint> <portName>read_message</portName> + <provider>false</provider> <kind>SimplexReceptacle</kind> - <instance>Hello.ComponentImplementations.Hello.Hello.Receiver</instance> + <instance xmi:idref="Hello_ReceiverComponentInstance" /> </internalEndpoint> <internalEndpoint> <portName>push_message</portName> + <provider>true</provider> <kind>Facet</kind> - <instance>Hello.ComponentImplementations.Hello.Hello.Sender</instance> + <instance xmi:idref="Hello_SenderComponentInstance" /> </internalEndpoint> </connection> <connection> - <name>click_out_click_inHello.ComponentImplementations.Hello.Hello.SenderHello.ComponentImplementations.Hello.Hello.Receiver</name> + <name>EventConnection</name> <internalEndpoint> <portName>click_out</portName> + <provider>false</provider> <kind>EventPublisher</kind> - <instance>Hello.ComponentImplementations.Hello.Hello.Sender</instance> + <instance xmi:idref="Hello_SenderComponentInstance" /> </internalEndpoint> <internalEndpoint> <portName>click_in</portName> + <provider>true</provider> <kind>EventConsumer</kind> - <instance>Hello.ComponentImplementations.Hello.Hello.Receiver</instance> + <instance xmi:idref="Hello_ReceiverComponentInstance" /> </internalEndpoint> </connection> - <artifact id="_3D49EF00-0613-471E-A251-84263431CE61"> - <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_stub</name> + <!-- Artifacts declarations --> + <artifact xmi:id="Hello_Receiver_ExecArtifact"> + <name>Hello_Receiver_exec</name> <source/> <node/> - <location>Hello_Receiver_stub</location> + <location>Hello_Receiver_exec</location> </artifact> - - <artifact id="_B1AD305F-9124-4C36-8502-C5878C6841C7"> - <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_svnt</name> + <artifact xmi:id="Hello_Receiver_SvntArtifact"> + <name>Hello_Receiver_svnt</name> <source/> <node/> <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> </artifact> - <artifact id="_6A3DCF45-7624-4AB1-95CA-A0DDF99053BB"> - <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_exec</name> + <artifact xmi:id="Hello_Sender_ExecArtifact"> + <name>Hello_Sender_exec</name> <source/> <node/> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_887DACE6-A0CD-4E0D-B84A-407B4FDB2D4A"> - <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_stub</name> - <source/> - <node/> - <location>Hello_Sender_stub</location> + <location>Hello_Sender_exec</location> </artifact> - - <artifact id="_CB2D05F4-48C0-4567-9D59-534F461A81E7"> - <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_svnt</name> + <artifact xmi:id="Hello_Sender_SvntArtifact"> + <name>Hello_Sender_svnt</name> <source/> <node/> <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_E2E0B980-BA79-43FB-AFC3-788B979E0413"> - <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_exec</name> - <source/> - <node/> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> </artifact> -</Deployment:deploymentPlan> +</Deployment:DeploymentPlan> diff --git a/CIAO/examples/Hello/descriptors/Hello.cid b/CIAO/examples/Hello/descriptors/Hello.cid deleted file mode 100644 index f7abad71ded..00000000000 --- a/CIAO/examples/Hello/descriptors/Hello.cid +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentImplementationDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Hello Example Assembly</label> - <UUID>effd4bd0-6db0-4c50-9bb7-db9decebae1c</UUID> - <assemblyImpl> - <instance xmi:id="a_Sender"> - <name>Sender_Instance</name> - <package href="Sender.cpd"/> - - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <configProperty> - <name>hertz</name> - <value> - <type> - <kind>tk_long</kind> - </type> - <value> - <long>50</long> - </value> - </value> - </configProperty> - </instance> - - <!-- ***************************** --> - - <instance xmi:id="a_Receiver"> - <name>Receiver_Instance</name> - <package href="Receiver.cpd"/> - - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>Messages</name> - <internalEndpoint> - <portName>read_message</portName> - <instance xmi:idref="a_Receiver"/> - </internalEndpoint> - <internalEndpoint> - <portName>push_message</portName> - <instance xmi:idref="a_Sender"/> - </internalEndpoint> - </connection> - <connection> - <name>Events</name> - <internalEndpoint> - <portName>click_in</portName> - <instance xmi:idref="a_Receiver"/> - </internalEndpoint> - <internalEndpoint> - <portName>click_out</portName> - <instance xmi:idref="a_Sender"/> - </internalEndpoint> - </connection> - </assemblyImpl> -</Deployment:ComponentImplementationDescription> diff --git a/CIAO/examples/Hello/descriptors/Hello.cpd b/CIAO/examples/Hello/descriptors/Hello.cpd deleted file mode 100644 index 52b0e9a6c1d..00000000000 --- a/CIAO/examples/Hello/descriptors/Hello.cpd +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentPackageDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Hello Example Package</label> - <UUID>823e4287-f53c-4caa-8619-f3dfda4c4998</UUID> - <implementation> - <name>Hello</name> - <referencedImplementation href="Hello.cid"/> - </implementation> -</Deployment:ComponentPackageDescription> diff --git a/CIAO/examples/Hello/descriptors/Libraries.iad b/CIAO/examples/Hello/descriptors/Libraries.iad deleted file mode 100644 index 6112a23ca3b..00000000000 --- a/CIAO/examples/Hello/descriptors/Libraries.iad +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Common Libraries</label> - <UUID>6bae4fcd-c71c-44b4-a0d4-0e4199ce1a49</UUID> - <location>$ACE_ROOT/lib/libACE</location> - <location>$ACE_ROOT/lib/libTAO</location> - <location>$ACE_ROOT/lib/libCIAO_DnC_Client</location> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/NodeManagerMap.dat b/CIAO/examples/Hello/descriptors/NodeManagerMap.dat index 9880f37997e..69199c0a089 100644 --- a/CIAO/examples/Hello/descriptors/NodeManagerMap.dat +++ b/CIAO/examples/Hello/descriptors/NodeManagerMap.dat @@ -1,2 +1,2 @@ -SenderNode corbaloc:iiop:localhost:60001/NodeManager -ReceiverNode corbaloc:iiop:localhost:60002/NodeManager
\ No newline at end of file +SenderNode corbaloc:iiop:localhost:60001/Sender.NodeManager +ReceiverNode corbaloc:iiop:localhost:60002/Receiver.NodeManager
\ No newline at end of file diff --git a/CIAO/examples/Hello/descriptors/Receiver.ccd b/CIAO/examples/Hello/descriptors/Receiver.ccd deleted file mode 100644 index a5167d03e7a..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver.ccd +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentInterfaceDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Component </label> - <UUID>589462ed-e88f-4f96-a7a7-359cdc333d63</UUID> - <specificType>IDL:Hello/Receiver:1.0</specificType> - <supportedType>IDL:Hello/Receiver:1.0</supportedType> - <idlFile>Receiver.idl</idlFile> - <port> - <name>click_in</name> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <provider>false</provider> - <supportedType>IDL:Hello/TimeOut:1.0</supportedType> - <specificType>IDL:Hello/TimeOut:1.0</specificType> - <kind>EventConsumer</kind> - </port> - - <port> - <name>read_message</name> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <provider>false</provider> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <kind>SimplexReceptacle</kind> - </port> - -</Deployment:ComponentInterfaceDescription> diff --git a/CIAO/examples/Hello/descriptors/Receiver.cid b/CIAO/examples/Hello/descriptors/Receiver.cid deleted file mode 100644 index 18d379e7eba..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver.cid +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentImplementationDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Implementation</label> - <UUID>0a52c9de-7852-42e4-aac7-bf478169a21a</UUID> - <implements href="Receiver.ccd"/> - <monolithicImpl> - <primaryArtifact> - <name>Receiver_Stub</name> - <referencedArtifact href="Receiver_Stub.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Receiver_Svnt</name> - <referencedArtifact href="Receiver_Svnt.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Receiver_Exec</name> - <referencedArtifact href="Receiver_Exec.iad"/> - </primaryArtifact> - </monolithicImpl> -</Deployment:ComponentImplementationDescription> diff --git a/CIAO/examples/Hello/descriptors/Receiver.cpd b/CIAO/examples/Hello/descriptors/Receiver.cpd deleted file mode 100644 index 3cddb924834..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver.cpd +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentPackageDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Package</label> - <UUID>a5923ef4-9c62-4458-9fa4-869b53d834ca</UUID> - <realizes href="Receiver.ccd"/> - <implementation> - <name>Receiver</name> - <referencedImplementation href="Receiver.cid"/> - </implementation> -</Deployment:ComponentPackageDescription> diff --git a/CIAO/examples/Hello/descriptors/Receiver_Exec.iad b/CIAO/examples/Hello/descriptors/Receiver_Exec.iad deleted file mode 100644 index f039e8cd68b..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver_Exec.iad +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Executor Artifact</label> - <UUID>412f8156-7913-4651-9110-f7a3f98c7a83</UUID> - <location>Hello_Receiver_exec</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> - <dependsOn> - <name>Receiver_Stub</name> - <referencedArtifact href="Receiver_Stub.iad"/> - </dependsOn> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/Receiver_Stub.iad b/CIAO/examples/Hello/descriptors/Receiver_Stub.iad deleted file mode 100644 index f226d9b0d92..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver_Stub.iad +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Stub Artifact</label> - <UUID>4d02c22b-768e-4d1a-bf07-76da2f5d1fbf</UUID> - <location>Hello_Receiver_stub</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/Receiver_Svnt.iad b/CIAO/examples/Hello/descriptors/Receiver_Svnt.iad deleted file mode 100644 index 535ccf10d8d..00000000000 --- a/CIAO/examples/Hello/descriptors/Receiver_Svnt.iad +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Receiver Servant Artifact</label> - <UUID>ad052b10-0806-43c7-9ccc-2dfeda0e0e03</UUID> - <location>Hello_Receiver_svnt</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> - <dependsOn> - <name>Receiver_Stub</name> - <referencedArtifact href="Receiver_Stub.iad"/> - </dependsOn> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender.ccd b/CIAO/examples/Hello/descriptors/Sender.ccd deleted file mode 100644 index cf07fe0ef75..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender.ccd +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentInterfaceDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Sender Component</label> - <UUID>803f8fc7-55de-4a20-81eb-ae951d85b7f4</UUID> - <specificType>IDL:Hello/Sender:1.0</specificType> - <supportedType>IDL:Hello/Sender:1.0</supportedType> - <property> - <name>local_message</name> - <type> - <kind>tk_string</kind> - </type> - </property> - <port> - <name>supports</name> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <provider>true</provider> - <supportedType>IDL:Hello/trigger:1.0</supportedType> - <kind>Facet</kind> - </port> - <port> - <name>click_out</name> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <provider>true</provider> - <supportedType>IDL:Hello/TimeOut:1.0</supportedType> - <specificType>IDL:Hello/TimeOut:1.0</specificType> - <kind>EventPublisher</kind> - </port> - <port> - <name>push_message</name> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <provider>true</provider> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <kind>Facet</kind> - </port> - -</Deployment:ComponentInterfaceDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender.cid b/CIAO/examples/Hello/descriptors/Sender.cid deleted file mode 100644 index c6e02fc2d25..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender.cid +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentImplementationDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Sender Implementation</label> - <UUID>789e1be2-703f-4bd3-af50-b400eef91fd0</UUID> - <implements href="Sender.ccd"/> - <monolithicImpl> - <primaryArtifact> - <name>Sender_Stub</name> - <referencedArtifact href="Sender_Stub.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Sender_Svnt</name> - <referencedArtifact href="Sender_Svnt.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Sender_Exec</name> - <referencedArtifact href="Sender_Exec.iad"/> - </primaryArtifact> - </monolithicImpl> -</Deployment:ComponentImplementationDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender.cpd b/CIAO/examples/Hello/descriptors/Sender.cpd deleted file mode 100644 index df2c441be3f..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender.cpd +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ComponentPackageDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Sender Package</label> - <UUID>07ebf947-2174-4a3b-bd37-bcb92986eaf4</UUID> - <realizes href="Sender.ccd"/> - <implementation> - <name>Sender</name> - <referencedImplementation href="Sender.cid"/> - </implementation> -</Deployment:ComponentPackageDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender_Exec.iad b/CIAO/examples/Hello/descriptors/Sender_Exec.iad deleted file mode 100644 index a5d70fe8504..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender_Exec.iad +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Sender Executor Artifact</label> - <UUID>5e4f2366-3810-4d4c-a269-5788a525cbe1</UUID> - <location>Hello_Sender_exec</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> - <dependsOn> - <name>Sender_Stub</name> - <referencedArtifact href="Sender_Stub.iad"/> - </dependsOn> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender_Stub.iad b/CIAO/examples/Hello/descriptors/Sender_Stub.iad deleted file mode 100644 index 13c28534aaf..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender_Stub.iad +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Sender Stub Artifact</label> - <UUID>93bbdf7d-d3f7-4227-bb75-b0562ac15b92</UUID> - <location>Hello_Sender_stub</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/Sender_Svnt.iad b/CIAO/examples/Hello/descriptors/Sender_Svnt.iad deleted file mode 100644 index dd4a6f02027..00000000000 --- a/CIAO/examples/Hello/descriptors/Sender_Svnt.iad +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:ImplementationArtifactDescription - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - <label>Sender Servant Artifact</label> - <UUID>04e4d246-e6eb-4b0e-8e32-60b996497cea</UUID> - <location>Hello_Receiver_svnt</location> - <dependsOn> - <name>ACE</name> - <referencedArtifact href="Libraries.iad"/> - </dependsOn> - <dependsOn> - <name>Sender_Stub</name> - <referencedArtifact href="Sender_Stub.iad"/> - </dependsOn> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> -</Deployment:ImplementationArtifactDescription> diff --git a/CIAO/examples/Hello/descriptors/run_test.pl b/CIAO/examples/Hello/descriptors/run_test.pl index a3df657cab1..81811665eff 100755 --- a/CIAO/examples/Hello/descriptors/run_test.pl +++ b/CIAO/examples/Hello/descriptors/run_test.pl @@ -17,6 +17,7 @@ $ns_running = 0; $daemons = 2; @ports = ( 60001, 60002 ); @iorfiles = ( "NodeApp1.ior", "NodeApp2.ior" ); +@nodenames = ( "Sender", "Receiver" ); $status = 0; $dat_file = "NodeManagerMap.dat"; $cdp_file = "DeploymentPlan.cdp"; @@ -69,21 +70,21 @@ sub run_node_daemons { { $iorfile = $iorfiles[$i]; $port = $ports[$i]; - + $nodename = $nodenames[$i]; $iiop = "iiop://localhost:$port"; - $node_app = "$CIAO_ROOT/bin/NodeApplication"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; - $d_cmd = "$CIAO_ROOT/bin/NodeManager"; - $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --instance-nc corbaloc:rir:/NameService"; $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); $result = $Daemons[$i]->Spawn (); push(@processes, $Daemons[$i]); if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { + 30) == -1) { print STDERR - "ERROR: The ior file of node daemon $i could not be found\n"; + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; for (; $i >= 0; --$i) { $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); } @@ -130,12 +131,12 @@ $daemons_running = 1; # Invoke execution manager. print "Invoking execution manager\n"; -$EM = new PerlACE::Process ("$CIAO_ROOT/bin/Execution_Manager", - "-o EM.ior -i $dat_file"); +$EM = new PerlACE::Process ("$DAnCE/bin/dance_execution_manager", + "-eEM.ior --node-map $dat_file"); $EM->Spawn (); if (PerlACE::waitforfile_timed ("EM.ior", - $PerlACE::wait_interval_for_process_creation) == -1) { + $PerlACE::wait_interval_for_process_creation) == -1) { print STDERR "ERROR: The ior file of execution manager could not be found\n"; kill_open_processes (); @@ -147,8 +148,8 @@ $em_running = 1; # Invoke executor - start the application -. print "Invoking executor - start the application -\n"; $E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-p DeploymentPlan.cdp -k file://EM.ior -o DAM.ior"); + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-x DeploymentPlan.cdp -k file://EM.ior"); $E->SpawnWaitKill (5000); @@ -179,8 +180,8 @@ if ($result != 0) { # Invoke executor - stop the application -. print "Invoking executor - stop the application -\n"; $E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-k file://EM.ior -i file://DAM.ior"); + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-k file://EM.ior -x DeploymentPlan.cdp -q"); $E->SpawnWaitKill (3000); print "Executor returned.\n"; diff --git a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan.cdp b/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan.cdp deleted file mode 100644 index 083484ca185..00000000000 --- a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan.cdp +++ /dev/null @@ -1,222 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_add.cdp b/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_add.cdp deleted file mode 100644 index af8f50026e8..00000000000 --- a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_add.cdp +++ /dev/null @@ -1,267 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd-UPDATE-XXXXXXXX"> - <name>Hello-Receiver-idd-UPDATE-XXXXXXXXX</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver_2.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <connection> - <name>hello_event_connection_new</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd-UPDATE-XXXXXXXX</instance> - </internalEndpoint> - </connection> - - <connection> - <name>hello_facet_connection_new</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd-UPDATE-XXXXXXXX</instance> - </internalEndpoint> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_remove.cdp b/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_remove.cdp deleted file mode 100644 index 79cc923d154..00000000000 --- a/CIAO/examples/Hello/descriptors_ReDaC/deploymentplan_remove.cdp +++ /dev/null @@ -1,223 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - - <instance id="Hello-Receiver-idd-UPDATE-XXXXXXXX"> - <name>Hello-Receiver-idd-UPDATE-XXXXXXXXX</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver_2.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_connection_new</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd-UPDATE-XXXXXXXX</instance> - </internalEndpoint> - </connection> - - <connection> - <name>hello_facet_connection_new</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd-UPDATE-XXXXXXXX</instance> - </internalEndpoint> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/NodeManagerMap.dat b/CIAO/examples/Hello/descriptors_events/NodeManagerMap.dat deleted file mode 100644 index 9880f37997e..00000000000 --- a/CIAO/examples/Hello/descriptors_events/NodeManagerMap.dat +++ /dev/null @@ -1,2 +0,0 @@ -SenderNode corbaloc:iiop:localhost:60001/NodeManager -ReceiverNode corbaloc:iiop:localhost:60002/NodeManager
\ No newline at end of file diff --git a/CIAO/examples/Hello/descriptors_events/NodeManagerMapTwoHosts.dat b/CIAO/examples/Hello/descriptors_events/NodeManagerMapTwoHosts.dat deleted file mode 100644 index 54066c67ce0..00000000000 --- a/CIAO/examples/Hello/descriptors_events/NodeManagerMapTwoHosts.dat +++ /dev/null @@ -1,2 +0,0 @@ -SenderNode corbaloc:iiop:localhost:60001/NodeManager -ReceiverNode corbaloc:iiop:129.59.129.181:60002/NodeManager
\ No newline at end of file diff --git a/CIAO/examples/Hello/descriptors_events/NodeManagerMap_collocated.dat b/CIAO/examples/Hello/descriptors_events/NodeManagerMap_collocated.dat deleted file mode 100644 index 3aa4d0922e0..00000000000 --- a/CIAO/examples/Hello/descriptors_events/NodeManagerMap_collocated.dat +++ /dev/null @@ -1 +0,0 @@ -SenderNode corbaloc:iiop:localhost:60001/NodeManager diff --git a/CIAO/examples/Hello/descriptors_events/README b/CIAO/examples/Hello/descriptors_events/README deleted file mode 100644 index 924893bbf2c..00000000000 --- a/CIAO/examples/Hello/descriptors_events/README +++ /dev/null @@ -1,145 +0,0 @@ -Event Descriptors for Hello Example -=================================== - -This folder contains several deployemnts to demonstrate and test the -functionality of rt event channel integration into CIAO/DAnCE. -Please see $CIAO_ROOT/docs/schema/CIAOEvents.txt for a detailed description -how to configure descriptor files accordingly. - -The rest of this file describes the rule of the files in this directory. - -single files and their role: ----------------------------- - -./run_test.pl : script that executes all available tests - -./run_NodeDaemons.pl : script to launch two empty NodeApplications -./run_NodeDaemons_svc_conf.pl : starts two node NodeApplications on the - localhost interface and loads rtec.conf on - startup -./run_NodeDaemons_with_ip.pl : starts two node NodeApplications under the - IP address and not on the localhost interface - -./NodeManagerMap.dat : contains ip addresses for SenderNode and - ReceiverNode (both on localhost) -./NodeManagerMap_collocated.dat : contains an ip address for a single - SenderNode (on localhost) -./NodeManagerMapTwoHosts.dat : contains ip addresses for SenderNode - (on localhost) and ReceiverNode - (on real ip address) - -./rtec.conf : example for a service configurator file - for the event service - - -existing test cases: --------------------- - -./ciao-events-example.ced -./deploymentplan_events.cdp -./run_test_simple.pl - - Uses the standard event service and connects one sender to one - receiver. In the standard configuration, used here, the EventChannel - is running collocated within the NodeApplication "SenderNode", where - the sender component is located: - SenderNode[Sender --> ES] --> ReceiverNode[Receiver] - -./ciao-events-example-collocated.ced -./deploymentplan_events_collocated.cdp -./run_test_collocated.pl: - - This example modifies the standard example by deploying all components - within one node: - SenderNode[Sender --> ES --> Receiver] - -./ciao-events-example-with-federation.ced -./deploymentplan_federation.cdp -./run_test_federated.pl: - - In this example, two Event Services ES_01 and ES_02 are federated. - The Sender Event Port is then connected to the first service, while - the Receiver gets its events from the second service. - All entities are collocated in one node process: - SenderNode[Sender --> ES_01 --> ES_02 --> Receiver] - - (problem: - Receiver - Informed by the Sender with message [ACE/TAO/CIAO] - CORBA EXCEPTION caught - (27698|3072210624) EXCEPTION, RTEventServiceConsumer_impl::push() - - system exception, ID 'IDL:omg.org/CORBA/BAD_INV_ORDER:1.0' - Unknown vendor minor code id (0), minor code = 0, completed = NO - ) - -./ciao-events-example-with-filters.ced -./deploymentplan_with_filters.cdp -./run_test_filtered.pl: - - This example applies a filter to the EventService connection on the - receiver side. In this case the filter contains a disjunction group - of two sender component sources. - SenderNode[Sender --> ES -{Filter}-> Receiver] - -./ciao-events-federation-mcast.ced -./deploymentplan_federation_mcast.cdp -./run_test_multicast.pl: - - To test collocated use of multicast federation of event channels - use this example. It deploys sender and receiver in the same - node and connects them through two eventchannels, using udp - multicast to communicate: - SenderNode[Sender --> ES_01 --> udp_sender -UDP{224.9.9.2:1234}-> - udp_mcast_receiver --> ES_02 --> Receiver] - - - (unresolved failure: - Create a receiver object with addr_serv_id: addr_serv_1 - (20850|3072210624) EXCEPTION, NodeApplication_Impl::finishLaunch - - system exception, ID 'IDL:omg.org/CORBA/UNKNOWN:1.0' - OMG minor code (1), described as 'Unlisted user exception received by c - lient.', completed = MAYBE - ) - -./ciao-events-federation-udp.ced -./deploymentplan_federation_udp.cdp -./run_test_udp.pl: - - In this example, udp communication is used to send the event - from one sender node to a receiver node: - SenderNode[Sender --> ES --> udp_sender] -UDP{localhost:1234}-> - ReceiverNode[udp_receiver --> ES_02 --> Receiver] - -./ciao-events-federation-udp-collocated.ced -./deploymentplan_federation_udp_collocated.cdp -./run_test_udp_collocated.pl: - - Same example, as the above udp example, but deployed on a - single node application and therefore collocated: - SenderNode[Sender --> ES_01 --> udp_sender -UDP{localhost:1234}-> - udp_receiver --> ES_02 --> Receiver] - -./ciao-events-federation-udp-two-hosts.ced -./deploymentplan_federation_udp_two_hosts.cdp - - this test is not yet automated, because the nodes are - supposed to be deployed on two different host machines: - SenderNode[Sender --> ES_01 --> udp_sender] - -UDP{129.59.129.181:1234}-> - ReceiverNode[udp_receiver --> ES_02 --> ReceiverNode] - -./ciao-events-example.ced -./deploymentplan_multiple_senders.cdp -./run_test_multiple_senders.pl: - - This example extends the standard example by adding two more sender - components to the SenderNode: - [Sender01 --> ] - SenderNode[Sender02 --> ES ] --> ReceiverNode[Receiver] - [Sender03 --> ] - - ------- - -author: Friedhelm Wolf (fwolf@dre.vanderbilt.edu) diff --git a/CIAO/examples/Hello/descriptors_events/RunEventTest.pm b/CIAO/examples/Hello/descriptors_events/RunEventTest.pm deleted file mode 100755 index 615cc0ee317..00000000000 --- a/CIAO/examples/Hello/descriptors_events/RunEventTest.pm +++ /dev/null @@ -1,212 +0,0 @@ -# $Id$ -# -*- perl -*- - -package RunEventTest; - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; -$TAO_ROOT = "$ENV{'TAO_ROOT'}"; -$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; -$daemons_running = 0; -$em_running = 0; -$ns_running = 0; -$status = 0; -$dat_file = "NodeManagerMap.dat"; -$cdp_file = "flattened_deploymentplan_events.cdp"; -$controller_exec = "$CIAO_ROOT/examples/Hello/Sender/starter"; -$sender_ior = "Sender.ior"; -$receiver_ior = "Receiver.ior"; -$nodes; -$E = 0; -$EM = 0; - -$nsior = PerlACE::LocalFile ("ns.ior"); -unlink $nsior; - -sub parse_dat_file { - my $node_list; # array of hashes, containing node info - my $lines = 0; - - # read .dat file and parse it for node name, ip and port - open (my $fh, @_[0]) or die "could not open @_[0]"; - while(<$fh>) { - if (m{(\w+)\s+corbaloc:iiop:(\w*):([0-9]*)/NodeManager}) { - # store the three values in the according row - # of the array of hashest - $node_list->[$lines]->{"node"} = $1; - $node_list->[$lines]->{"ip"} = $2; - $node_list->[$lines++]->{"port"} = $3; - } - } - close ($fh) or die "could not close @_[0]"; - - return $node_list; -} - -# Delete if there are any .ior files. -sub delete_ior_files { - for ($i = 0; $i < scalar(@$nodes); ++$i) { - unlink $nodes->[$i]->{"node"} . ".ior"; - } - unlink PerlACE::LocalFile ("EM.ior"); - unlink PerlACE::LocalFile ($receiver_ior); - unlink PerlACE::LocalFile ($sender_ior); - unlink PerlACE::LocalFile ("DAM.ior"); - unlink PerlACE::LocalFile ("ns.ior"); -} - -sub kill_node_daemons { - for ($i = 0; $i < scalar(@$nodes); ++$i) { - $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); - } -} - -sub kill_open_processes { - if ($daemons_running == 1) { - kill_node_daemons (); - } - - if ($em_running == 1) { - $EM->Kill (); - $EM->TimedWait (1); - } - - if ($ns_running == 1) { - $NS->Kill (); - $NS->TimedWait (1); - } - -} - -sub run_node_daemons { - for ($i = 0; $i < scalar(@$nodes); ++$i) - { - $iorfile = $nodes->[$i]->{"node"} . ".ior"; - $iiop = "iiop://" . $nodes->[$i]->{"ip"} . ":" . $nodes->[$i]->{"port"}; - $node_app = "$CIAO_ROOT/bin/NodeApplication"; - - $d_cmd = "$CIAO_ROOT/bin/NodeManager"; - $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; - - print $d_cmd . " " . $d_param . "\n"; - $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); - $result = $Daemons[$i]->Spawn (); - push(@processes, $Daemons[$i]); - - if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of node daemon $i could not be found\n"; - for (; $i >= 0; --$i) { - $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); - } - return -1; - } - } - return 0; -} - - -sub run_test { - # first argument will be interpreted as .cdp file - $cdp_file = shift; - # second argument will be interpreted as .dat file - $dat_file = shift; - - $nodes = parse_dat_file ($dat_file); - - delete_ior_files (); - - # Invoke naming service - $NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); - $NS->Spawn (); - - print STDERR "Starting Naming Service\n"; - - if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1){ - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); - return 1; - } - - $ns_running = 1; - - # Invoke node daemons. - print "Invoking node daemons\n"; - $status = run_node_daemons (); - - if ($status != 0) { - print STDERR "ERROR: Unable to execute the node daemons\n"; - kill_open_processes (); - return 1; - } - - $daemons_running = 1; - - # Invoke execution manager. - print "Invoking execution manager\n"; - $EM = new PerlACE::Process ("$CIAO_ROOT/bin/Execution_Manager", - "-o EM.ior -i $dat_file"); - $EM->Spawn (); - - if (PerlACE::waitforfile_timed ("EM.ior", - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of execution manager could not be found\n"; - kill_open_processes (); - return 1; - } - - $em_running = 1; - - # Invoke executor - start the application -. - print "Invoking executor - start the application -\n"; - $E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-p $cdp_file -k file://EM.ior -o DAM.ior"); - - $E->SpawnWaitKill (5000); - - if (PerlACE::waitforfile_timed ( - $receiver_ior, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: The ior file of receiver could not be found\n"; - kill_open_processes (); - return 1; - } - - if (PerlACE::waitforfile_timed ($sender_ior, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: The ior file of sender could not be found\n"; - kill_open_processes (); - return 1; - } - - print "Invoking the controller\n"; - $controller = new PerlACE::Process ("$controller_exec", "-k file://$sender_ior"); - $result = $controller->SpawnWaitKill (3000); - - if ($result != 0) { - print STDERR "ERROR: The controller returned $result\n"; - $status = 1; - } - - # Invoke executor - stop the application -. - print "Invoking executor - stop the application -\n"; - $E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-k file://EM.ior -i file://DAM.ior"); - $E->SpawnWaitKill (3000); - - print "Executor returned.\n"; - print "Shutting down rest of the processes.\n"; - - delete_ior_files (); - kill_open_processes (); - - return $status; -} - -1; diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-example-collocated.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-example-collocated.ced deleted file mode 100644 index 1166a034caf..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-example-collocated.ced +++ /dev/null @@ -1,14 +0,0 @@ -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>svc.conf</svc_cfg_file> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-federation.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-federation.ced deleted file mode 100644 index 930439f44d5..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-federation.ced +++ /dev/null @@ -1,48 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>false</is_multicast> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-filters.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-filters.ced deleted file mode 100644 index affc0e49dc7..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-example-with-filters.ced +++ /dev/null @@ -1,51 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>svc.conf</svc_cfg_file> - - <filter> - <name>my_filter_01</name> - <type>DISJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - <source>Hello-Sender-idd-02_click_out</source> - </filter> - - <filter> - <name>my_filter_02</name> - <type>DISJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - </filter> - - <filter> - <name>my_filter_03</name> - <type>CONJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - <source>Hello-Sender-idd-02_click_out</source> - </filter> - - <filter> - <name>my_filter_04</name> - <type>CONJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - </filter> - - - </eventServiceConfiguration> - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>svc.conf</svc_cfg_file> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-example.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-example.ced deleted file mode 100644 index 1166a034caf..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-example.ced +++ /dev/null @@ -1,14 +0,0 @@ -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>svc.conf</svc_cfg_file> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-mcast.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-federation-mcast.ced deleted file mode 100644 index 9fa450602ba..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-mcast.ced +++ /dev/null @@ -1,58 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <filter> - <name>my_filter</name> - <type>DISJUNCTION</type> - <source>Hello-Sender-idd_click_out</source> - </filter> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>224.9.9.2</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - - - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>224.9.9.2</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>true</is_multicast> - - <!-- Listen port for this EC's event handler --> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-collocated.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-collocated.ced deleted file mode 100644 index 89e85b5b21d..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-collocated.ced +++ /dev/null @@ -1,47 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>false</is_multicast> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-two-hosts.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-two-hosts.ced deleted file mode 100644 index 5f65ab8375f..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp-two-hosts.ced +++ /dev/null @@ -1,50 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <!-- Assume the ES_01 will be deployed on node tango.dre.vanderbilt.edu --> - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>129.59.129.181</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - - - <!-- Assume the ES_02 will be deployed on node pacific.dre.vanderbilt.edu --> - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>ReceiverNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>129.59.129.181</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>false</is_multicast> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - -</CIAO:CIAOEvents>
\ No newline at end of file diff --git a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp.ced b/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp.ced deleted file mode 100644 index 3d2a9d3fbb4..00000000000 --- a/CIAO/examples/Hello/descriptors_events/ciao-events-federation-udp.ced +++ /dev/null @@ -1,49 +0,0 @@ -<!-- $ID$ --> - -<CIAO:CIAOEvents - xmlns:CIAO="http://www.dre.vanderbilt.edu/CIAOEvents" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.dre.vanderbilt.edu/CIAOEvents CIAOEvents.xsd"> - - <eventServiceConfiguration id="es_configuration-01"> - <name>ES_01</name> - <node>SenderNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <!-- The remote EC's host name and port # --> - <addr_serv> - <name>addr_serv_0</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - - <udp_sender> - <name>upd_sender_1</name> - <addr_serv_id>addr_serv_0</addr_serv_id> - </udp_sender> - </eventServiceConfiguration> - - - - <eventServiceConfiguration id="es_configuration-02"> - <name>ES_02</name> - <node>ReceiverNode</node> - <type>RTEC</type> - <svc_cfg_file>dummy.conf</svc_cfg_file> - - <addr_serv> - <name>addr_serv_1</name> - <port>1234</port> - <address>localhost</address> - </addr_serv> - <udp_receiver> - <name>upd_receiver_1</name> - <addr_serv_id>addr_serv_1</addr_serv_id> - <is_multicast>false</is_multicast> - <listen_port>1234</listen_port> - </udp_receiver> - </eventServiceConfiguration> - -</CIAO:CIAOEvents> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_events.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_events.cdp deleted file mode 100644 index a64e501402f..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_events.cdp +++ /dev/null @@ -1,260 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -<!-- - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> ---> - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Hello_Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Hello_Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_events_collocated.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_events_collocated.cdp deleted file mode 100644 index 79796d9177b..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_events_collocated.cdp +++ /dev/null @@ -1,260 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -<!-- - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> ---> - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example-collocated.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_federation.cdp deleted file mode 100644 index 423f9f65a2f..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation.cdp +++ /dev/null @@ -1,233 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example-with-federation.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_mcast.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_mcast.cdp deleted file mode 100644 index 4bfddce8258..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_mcast.cdp +++ /dev/null @@ -1,231 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-federation-mcast.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp.cdp deleted file mode 100644 index 7ee891285a8..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp.cdp +++ /dev/null @@ -1,246 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <!-- The Sender Component connects to "ES_01" --> - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- The Receiver Component connects to "ES_02" --> - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Hello_Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Hello_Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Hello_Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-federation-udp.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_collocated.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_collocated.cdp deleted file mode 100644 index 0d254e2214e..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_collocated.cdp +++ /dev/null @@ -1,246 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <!-- The Sender Component connects to "ES_01" --> - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- The Receiver Component connects to "ES_02" --> - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Hello_Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-federation-udp-collocated.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_two_hosts.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_two_hosts.cdp deleted file mode 100644 index d7a0c7fcf00..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_federation_udp_two_hosts.cdp +++ /dev/null @@ -1,246 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - <!-- The Sender Component connects to "ES_01" --> - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- The Receiver Component connects to "ES_02" --> - <connection> - <name>hello_event_ec_consumer_connection</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_02</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-federation-udp-two-hosts.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_multiple_senders.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_multiple_senders.cdp deleted file mode 100644 index ff2ac89bf8f..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_multiple_senders.cdp +++ /dev/null @@ -1,395 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd-01"> - <name>Hello-Sender-idd-01</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender01.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Sender-idd-02"> - <name>Hello-Sender-idd-02</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender02.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message from Sender 02 passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>red</enum> - </value> - </value> - </configProperty> - </instance> - - - <instance id="Hello-Sender-idd-03"> - <name>Hello-Sender-idd-03</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender03.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message from Sender 03 passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>white</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd-01</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -<!-- - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd-01</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> ---> - - <connection> - <name>hello_event_ec_publisher_connection_01</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd-01</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_publisher_connection_02</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd-02</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_publisher_connection_03</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd-03</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection_01</name> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Hello_Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Hello_Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Hello_Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/deploymentplan_with_filters.cdp b/CIAO/examples/Hello/descriptors_events/deploymentplan_with_filters.cdp deleted file mode 100644 index 7f776924945..00000000000 --- a/CIAO/examples/Hello/descriptors_events/deploymentplan_with_filters.cdp +++ /dev/null @@ -1,278 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -<!-- - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> ---> - - <connection> - <name>hello_event_ec_publisher_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <connection> - <name>hello_event_ec_consumer_connection</name> - - <!-- The position of the below "deployRequirement" element matters --> - <deployRequirement> - <resourceType>EventFilter</resourceType> - <name>my_filter_01</name> - <property> - <name>EventFilter</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>my_filter_01</string> - </value> - </value> - </property> - </deployRequirement> - - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - <externalReference> - <location>ES_01</location> - </externalReference> - </connection> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Hello_Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <infoProperty> - <name>CIAOEvents</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>ciao-events-example-with-filters.ced</string> - </value> - </value> - </infoProperty> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_events/rtec.conf b/CIAO/examples/Hello/descriptors_events/rtec.conf deleted file mode 100644 index fbbadf78b0c..00000000000 --- a/CIAO/examples/Hello/descriptors_events/rtec.conf +++ /dev/null @@ -1 +0,0 @@ -static EC_Factory "-ECobserver basic" diff --git a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons.pl b/CIAO/examples/Hello/descriptors_events/run_NodeDaemons.pl deleted file mode 100755 index 8d76c400579..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons.pl +++ /dev/null @@ -1,40 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile1 = PerlACE::LocalFile ("NodeApp1.ior"); -$iorfile2 = PerlACE::LocalFile ("NodeApp2.ior"); - -#for ($iter = 0; $iter <= $#ARGV; $iter++) { -# if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { -# print "Run_Test Perl script for NodeApplicationTest \n\n"; -# print "run_test \n"; -# print "\n"; -# print "-h -- prints this information\n"; -# exit 0; -# } -#} - - -unlink $iorfile1; -unlink $iorfile2; - -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV1 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:60001 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -d 500"); - -$SV2 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:60002 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -d 500"); - -$SV1->Spawn (); -$SV2->Spawn (); - -sleep (99999999999); diff --git a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_svc_conf.pl b/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_svc_conf.pl deleted file mode 100755 index 8cdc79b11bd..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_svc_conf.pl +++ /dev/null @@ -1,42 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -$ACE_ROOT=$ENV{'ACE_ROOT'}; - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile1 = PerlACE::LocalFile ("NodeApp1.ior"); -$iorfile2 = PerlACE::LocalFile ("NodeApp2.ior"); - -#for ($iter = 0; $iter <= $#ARGV; $iter++) { -# if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { -# print "Run_Test Perl script for NodeApplicationTest \n\n"; -# print "run_test \n"; -# print "\n"; -# print "-h -- prints this information\n"; -# exit 0; -# } -#} - - -unlink $iorfile1; -unlink $iorfile2; - -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV1 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:60001 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -c rtec.conf"); - -$SV2 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://localhost:60002 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -c rtec.conf"); - -$SV1->Spawn (); -$SV2->Spawn (); - -sleep (99999999999); diff --git a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_with_ip.pl b/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_with_ip.pl deleted file mode 100644 index 24d630d66f6..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_NodeDaemons_with_ip.pl +++ /dev/null @@ -1,40 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile1 = PerlACE::LocalFile ("NodeApp1.ior"); -$iorfile2 = PerlACE::LocalFile ("NodeApp2.ior"); - -#for ($iter = 0; $iter <= $#ARGV; $iter++) { -# if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { -# print "Run_Test Perl script for NodeApplicationTest \n\n"; -# print "run_test \n"; -# print "\n"; -# print "-h -- prints this information\n"; -# exit 0; -# } -#} - - -unlink $iorfile1; -unlink $iorfile2; - -$CIAO_ROOT=$ENV{'CIAO_ROOT'}; - -$SV1 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://129.59.129.181:60001 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -d 500"); - -$SV2 = new PerlACE::Process ("$CIAO_ROOT/bin/NodeManager", - "-ORBEndpoint iiop://129.59.129.181:60002 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication -d 500"); - -$SV1->Spawn (); -$SV2->Spawn (); - -sleep (99999999999); diff --git a/CIAO/examples/Hello/descriptors_events/run_test.pl b/CIAO/examples/Hello/descriptors_events/run_test.pl deleted file mode 100755 index f01bafa0505..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test.pl +++ /dev/null @@ -1,49 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -# run_test_simple -$result = RunEventTest::run_test ( - "deploymentplan_events.cdp", - "NodeManagerMap.dat"); - -# run_test_collocated -$result += RunEventTest::run_test ( - "deploymentplan_events_collocated.cdp", - "NodeManagerMap_collocated.dat"); - -# run_test_federated -$result += RunEventTest::run_test ( - "deploymentplan_federation.cdp", - "NodeManagerMap_collocated.dat"); - -# run_test_filtered -$result += RunEventTest::run_test ( - "deploymentplan_with_filters.cdp", - "NodeManagerMap_collocated.dat"); - -# run_test_multicast -# this test is not running successfully and is therefore skipped here -#$result += RunEventTest::run_test ( -# "deploymentplan_federation_mcast.cdp", -# "NodeManagerMap_collocated.dat"); - -# run_test_udp -$result += RunEventTest::run_test ( - "deploymentplan_federation_udp.cdp", - "NodeManagerMap.dat"); - -# run_test_udp_collocated -$result += RunEventTest::run_test ( - "deploymentplan_federation_udp_collocated.cdp", - "NodeManagerMap_collocated.dat"); - -# run_test_multiple_senders is not yet integrated - -exit $result - diff --git a/CIAO/examples/Hello/descriptors_events/run_test_collocated.pl b/CIAO/examples/Hello/descriptors_events/run_test_collocated.pl deleted file mode 100755 index c7d3e7c3dc4..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_collocated.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_events_collocated.cdp", - "NodeManagerMap_collocated.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_federated.pl b/CIAO/examples/Hello/descriptors_events/run_test_federated.pl deleted file mode 100755 index 9d08455ce2e..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_federated.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_federation.cdp", - "NodeManagerMap_collocated.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_filtered.pl b/CIAO/examples/Hello/descriptors_events/run_test_filtered.pl deleted file mode 100755 index d1371af7219..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_filtered.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_with_filters.cdp", - "NodeManagerMap_collocated.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_multicast.pl b/CIAO/examples/Hello/descriptors_events/run_test_multicast.pl deleted file mode 100755 index 6d06589e3d2..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_multicast.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_federation_mcast.cdp", - "NodeManagerMap_collocated.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_multiple_senders.pl b/CIAO/examples/Hello/descriptors_events/run_test_multiple_senders.pl deleted file mode 100755 index adac10d680c..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_multiple_senders.pl +++ /dev/null @@ -1,199 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{'ACE_ROOT'}/bin"; -use PerlACE::Run_Test; - -$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; -$TAO_ROOT = "$ENV{'TAO_ROOT'}"; -$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; -$daemons_running = 0; -$em_running = 0; -$ns_running = 0; -$daemons = 2; -@ports = ( 60001, 60002 ); -@iorfiles = ( "NodeApp1.ior", "NodeApp2.ior" ); -@senderiors = ( "Sender01.ior", "Sender02.ior", "Sender03.ior"); -$status = 0; -$dat_file = "NodeManagerMap.dat"; -$cdp_file = "deploymentplan_multiple_senders.cdp"; -$controller_exec = "$CIAO_ROOT/examples/Hello/Sender/starter"; - -$nsior = PerlACE::LocalFile ("ns.ior"); - -unlink $nsior; - -$E = 0; -$EM = 0; - -# Delete if there are any .ior files. -sub delete_ior_files { - for ($i = 0; $i < $daemons; ++$i) { - unlink $iorfiles[$i]; - } - unlink PerlACE::LocalFile ("EM.ior"); - unlink PerlACE::LocalFile ("Receiver.ior"); - - for ($r = 0; $r < @senderiors; ++$r) { - unlink PerlACE::LocalFile ($senderiors[$r]); - } - - unlink PerlACE::LocalFile ("DAM.ior"); - unlink PerlACE::LocalFile ("ns.ior"); -} - -sub kill_node_daemons { - for ($i = 0; $i < $daemons; ++$i) { - $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); - } -} - -sub kill_open_processes { - if ($daemons_running == 1) { - kill_node_daemons (); - } - - if ($em_running == 1) { - $EM->Kill (); - $EM->TimedWait (1); - } - - if ($ns_running == 1) { - $NS->Kill (); - $NS->TimedWait (1); - } -} - -sub run_node_daemons { - for ($i = 0; $i < $daemons; ++$i) - { - $iorfile = $iorfiles[$i]; - $port = $ports[$i]; - - $iiop = "iiop://localhost:$port"; - $node_app = "$CIAO_ROOT/bin/NodeApplication"; - - $d_cmd = "$CIAO_ROOT/bin/NodeManager"; - $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; - - $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); - $result = $Daemons[$i]->Spawn (); - push(@processes, $Daemons[$i]); - - if (PerlACE::waitforfile_timed ($iorfile, - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of node daemon $i could not be found\n"; - for (; $i >= 0; --$i) { - $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); - } - return -1; - } - } - return 0; -} - -delete_ior_files (); - -# Invoke naming service - -$NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); - -$NS->Spawn (); - -print STDERR "Starting Naming Service\n"; - -if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1) -{ - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); - exit 1; -} - -$ns_running = 1; - -# Set up NamingService environment -$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; - -# Invoke node daemons. -print "Invoking node daemons\n"; -$status = run_node_daemons (); - -if ($status != 0) { - print STDERR "ERROR: Unable to execute the node daemons\n"; - kill_open_processes (); - exit 1; -} - -$daemons_running = 1; - -# Invoke execution manager. -print "Invoking execution manager\n"; -$EM = new PerlACE::Process ("$CIAO_ROOT/bin/Execution_Manager", - "-o EM.ior -i $dat_file"); -$EM->Spawn (); - -if (PerlACE::waitforfile_timed ("EM.ior", - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR - "ERROR: The ior file of execution manager could not be found\n"; - kill_open_processes (); - exit 1; -} - -$em_running = 1; - -# Invoke executor - start the application -. -print "Invoking executor - start the application -\n"; -$E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-p $cdp_file -k file://EM.ior -o DAM.ior"); - -$E->SpawnWaitKill (5000); - -if (PerlACE::waitforfile_timed ( - "Receiver.ior", - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: The ior file of receiver could not be found\n"; - kill_open_processes (); - exit 1; -} - -for ($si = 0; $si < @senderiors; ++$si) { - if (PerlACE::waitforfile_timed ($senderiors[$si], - $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: The file " . $senderiors[$si] . " could not be found\n"; - kill_open_processes (); - exit 1; - } -} - -for ($si = 0; $si < @senderiors; ++$si) { - print "Invoking the controller for sender $si\n"; - $controller = new PerlACE::Process ("$controller_exec", "-k file://" . $senderiors[$si]); - $result = $controller->SpawnWaitKill (3000); - - if ($result != 0) { - print STDERR "ERROR: The controller returned $result\n"; - $status = 1; - } -} - -# Invoke executor - stop the application -. -print "Invoking executor - stop the application -\n"; -$E = - new PerlACE::Process ("$CIAO_ROOT/bin/plan_launcher", - "-k file://EM.ior -i file://DAM.ior"); -$E->SpawnWaitKill (3000); - -print "Executor returned.\n"; -print "Shutting down rest of the processes.\n"; - -delete_ior_files (); -kill_open_processes (); - -exit $status; diff --git a/CIAO/examples/Hello/descriptors_events/run_test_simple.pl b/CIAO/examples/Hello/descriptors_events/run_test_simple.pl deleted file mode 100755 index c678aa29545..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_simple.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_events.cdp", - "NodeManagerMap.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_udp.pl b/CIAO/examples/Hello/descriptors_events/run_test_udp.pl deleted file mode 100755 index c84f30dcd30..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_udp.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_federation_udp.cdp", - "NodeManagerMap.dat"); diff --git a/CIAO/examples/Hello/descriptors_events/run_test_udp_collocated.pl b/CIAO/examples/Hello/descriptors_events/run_test_udp_collocated.pl deleted file mode 100755 index d45d68c238e..00000000000 --- a/CIAO/examples/Hello/descriptors_events/run_test_udp_collocated.pl +++ /dev/null @@ -1,12 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use RunEventTest; - -exit RunEventTest::run_test ( - "deploymentplan_federation_udp_collocated.cdp", - "NodeManagerMap_collocated.dat"); diff --git a/CIAO/examples/Hello/descriptors_shared_components/deploymentplan.cdp b/CIAO/examples/Hello/descriptors_shared_components/deploymentplan.cdp deleted file mode 100644 index f2e55b93539..00000000000 --- a/CIAO/examples/Hello/descriptors_shared_components/deploymentplan.cdp +++ /dev/null @@ -1,224 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0001</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd"> - <name>Hello-Sender-idd</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Receiver.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - -<!-- - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> ---> - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Hello/descriptors_shared_components/deploymentplan_shared_components.cdp b/CIAO/examples/Hello/descriptors_shared_components/deploymentplan_shared_components.cdp deleted file mode 100644 index 912bab194c5..00000000000 --- a/CIAO/examples/Hello/descriptors_shared_components/deploymentplan_shared_components.cdp +++ /dev/null @@ -1,229 +0,0 @@ -<Deployment:deploymentPlan - xmlns:Deployment="http://www.omg.org/Deployment" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <label>Hello-DeploymentPlan</label> - <UUID>Hello_Plan_UUID_0002</UUID> - <!-- Could be ZERO --> - <realizes> - <label>BasicSP-realizes-cid</label> - <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> - <specificType><!-- @@ What does here? --></specificType> - <supportedType>IDL:BasicSP/EC:1.0</supportedType> - <port> - <name>read_message</name> - <specificType>IDL:Hello/ReadMessage:1.0</specificType> - <supportedType>IDL:Hello/ReadMessage:1.0</supportedType> - <provider>false</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>true</exclusiveUser> - <optional>false</optional> - <kind>SimplexReceptacle</kind> - </port> - </realizes> - - <implementation id="Hello-Sender-mdd"> - <name>Hello-Sender-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Sender_exec</artifact> - <artifact>Hello-Sender_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <implementation id="Hello-Receiver-mdd"> - <name>Hello-Receiver-mdd</name> - <source><!-- @@ Don't know what goes here --></source> - <artifact>Hello-Receiver_exec</artifact> - <artifact>Hello-Receiver_svnt</artifact> - <!-- - <execParameter></execParameter> - <deployRequirement></deployRequirement> - --> - </implementation> - - <instance id="Hello-Sender-idd-new-component"> - <name>Hello-Sender-idd-new-component</name> - <node>SenderNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Sender-mdd</implementation> - - <!-- Add this property if you want to write component reference to IOR --> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Sender_new_component.ior</string> - </value> - </value> - </configProperty> - - <!-- Add this property if you want to initialize component attribute --> - <configProperty> - <name>local_message</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>This is a test message passed in through XML.</string> - </value> - </value> - </configProperty> - - <!-- This attribute initializes an enumerated value --> - <configProperty> - <name>color</name> - <value> - <type> - <kind>tk_enum</kind> - <enum> - <name>COLOR_SELECTION</name> - <typeId>IDL:Hello/COLOR_SELECTION:1.0</typeId> - <member>empty</member> - <member>white</member> - <member>red</member> - <member>yellow</member> - </enum> - </type> - <value> - <enum>yellow</enum> - </value> - </value> - </configProperty> - </instance> - - <instance id="Hello-Receiver-idd"> - <name>Hello-Receiver-idd</name> - <node>ReceiverNode</node> - <source><!-- @@ What goes here --></source> - <implementation>Hello-Receiver-mdd</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <!-- **************************************** - This IOR file should NOT be generated. - DAnCE should NOT create this component instance - because it is a "shared" component - **************************************** --> - <string>Receiver_new_component.ior</string> - </value> - </value> - </configProperty> - </instance> - - - <connection> - <name>hello_event_connection</name> - <internalEndpoint> - <portName>click_out</portName> - <kind>EventPublisher</kind> - <instance>Hello-Sender-idd-new-component</instance> - </internalEndpoint> - <internalEndpoint> - <portName>click_in</portName> - <kind>EventConsumer</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - - <connection> - <name>hello_facet_connection</name> - <internalEndpoint> - <portName>push_message</portName> - <kind>Facet</kind> - <instance>Hello-Sender-idd-new-component</instance> - </internalEndpoint> - <internalEndpoint> - <portName>read_message</portName> - <kind>SimplexReceptacle</kind> - <instance>Hello-Receiver-idd</instance> - </internalEndpoint> - </connection> - - - <!-- @@ Runtime library name must match exactly in "location" tag --> - <artifact id="Hello-Sender_exec"> - <name>Sender_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Sender_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Sender_svnt"> - <name>Sender_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Sender_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_SenderHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_exec"> - <name>Receiver_exec</name> - <source><!-- @@ Not sure about this--></source> - <node><!-- blank --></node> - <location>Hello_Receiver_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="Hello-Receiver_svnt"> - <name>Receiver_svnt</name> - <source><!-- @@ Not sure --></source> - <node><!-- blank --></node> - <location>Hello_Receiver_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Hello_ReceiverHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Null_Component/Null_Component.mpc b/CIAO/examples/Null_Component/Null_Component.mpc index 83c3ca50f24..5ec05ffecc0 100644 --- a/CIAO/examples/Null_Component/Null_Component.mpc +++ b/CIAO/examples/Null_Component/Null_Component.mpc @@ -32,7 +32,7 @@ project(Null_Component_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Null_Component_stub) : ciao_client_dnc { +project(Null_Component_stub) : ccm_stub { avoids += ace_for_tao after += Null_Component_idl_gen Null_Interface_stub libs += Null_Interface_stub @@ -57,7 +57,7 @@ project(Null_Component_stub) : ciao_client_dnc { } } -project(Null_Component_exec) : ciao_component_dnc { +project(Null_Component_exec) : ciao_executor { avoids += ace_for_tao after += Null_Component_cidl_gen Null_Component_stub sharedname = Null_Component_exec @@ -85,7 +85,7 @@ project(Null_Component_exec) : ciao_component_dnc { } -project(Null_Component_svnt) : ciao_servant_dnc { +project(Null_Component_svnt) : ciao_servant { avoids += ace_for_tao after += Null_Interface_skel Null_Component_exec sharedname = Null_Component_svnt diff --git a/CIAO/examples/Null_Component/Null_Component_exec.cpp b/CIAO/examples/Null_Component/Null_Component_exec.cpp index 42194215bf2..3aedbc6ce93 100644 --- a/CIAO/examples/Null_Component/Null_Component_exec.cpp +++ b/CIAO/examples/Null_Component/Null_Component_exec.cpp @@ -84,13 +84,7 @@ namespace CIDL_Null_Component_Impl } void - Null_Component_exec_i::ciao_preactivate () - { - // Your code here. - } - - void - Null_Component_exec_i::ciao_postactivate () + Null_Component_exec_i::configuration_complete () { // Your code here. } @@ -113,6 +107,20 @@ namespace CIDL_Null_Component_Impl // Your code here. } + extern "C" NULL_COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Null_Component_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_RETURN ( + retval, + Null_Component_exec_i, + ::Components::EnterpriseComponent::_nil ()); + + return retval; + } + //================================================================== // Home Executor Implementation Class: Null_ComponentHome_exec_i //================================================================== diff --git a/CIAO/examples/Null_Component/Null_Component_exec.h b/CIAO/examples/Null_Component/Null_Component_exec.h index 6a74d2e073d..fb0bc6c6edf 100644 --- a/CIAO/examples/Null_Component/Null_Component_exec.h +++ b/CIAO/examples/Null_Component/Null_Component_exec.h @@ -71,9 +71,7 @@ namespace CIDL_Null_Component_Impl set_session_context ( ::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); @@ -85,6 +83,9 @@ namespace CIDL_Null_Component_Impl ::CCM_Null_Component_Context_var context_; }; + extern "C" NULL_COMPONENT_EXEC_Export ::Components::EnterpriseComponent_ptr + create_Null_Component_Impl (void); + class NULL_COMPONENT_EXEC_Export Null_ComponentHome_exec_i : public virtual Null_ComponentHome_Exec, public virtual ::CORBA::LocalObject diff --git a/CIAO/examples/Null_Component/Null_Interface.mpc b/CIAO/examples/Null_Component/Null_Interface.mpc index 589f301ae95..93ec5a5fda4 100644 --- a/CIAO/examples/Null_Component/Null_Interface.mpc +++ b/CIAO/examples/Null_Component/Null_Interface.mpc @@ -14,7 +14,7 @@ project(Null_Interface_idl_gen) : taoidldefaults, anytypecode { } } -project(Null_Interface_stub) : ciao_client_dnc { +project(Null_Interface_stub) : ccm_stub { avoids += ace_for_tao after += Null_Interface_idl_gen libs += @@ -40,7 +40,7 @@ project(Null_Interface_stub) : ciao_client_dnc { } -project(Null_Interface_skel) : ciao_component_dnc { +project(Null_Interface_skel) : ciao_executor { avoids += ace_for_tao after += Null_Interface_stub sharedname = Null_Interface_skel diff --git a/CIAO/examples/Null_Component/StaticDAnCEApp.mpc b/CIAO/examples/Null_Component/StaticDAnCEApp.mpc index 57ff71c40e1..f3137347e05 100644 --- a/CIAO/examples/Null_Component/StaticDAnCEApp.mpc +++ b/CIAO/examples/Null_Component/StaticDAnCEApp.mpc @@ -1,10 +1,10 @@ // -*- MPC -*- // $Id$ -project(Null_Component_StaticDAnCEApp): ciao_static_dnc_app, iortable { +project(Null_Component_StaticDAnCEApp): iortable, taoidldefaults { after += Null_Component_svnt exename = StaticDAnCEApp - + requires += dummy_label libs += Null_Interface_stub libs += Null_Interface_skel libs += Null_Component_stub diff --git a/CIAO/examples/Null_Component/descriptors/Deployment.xsd b/CIAO/examples/Null_Component/descriptors/Deployment.xsd deleted file mode 100644 index fd4ffe5bc7d..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Deployment.xsd +++ /dev/null @@ -1,29 +0,0 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" - xmlns:Deployment="http://www.omg.org/Deployment" - targetNamespace="http://www.omg.org/Deployment"> - - <xsd:include schemaLocation="Basic_Deployment_Data.xsd"/> - <xsd:include schemaLocation="cpd.xsd"/> - <xsd:include schemaLocation="ccd.xsd"/> - <xsd:include schemaLocation="cdd.xsd"/> - <xsd:include schemaLocation="cdp.xsd"/> - <xsd:include schemaLocation="cid.xsd"/> - <xsd:include schemaLocation="iad.xsd"/> - <xsd:include schemaLocation="pcd.xsd"/> - <xsd:include schemaLocation="toplevel.xsd"/> - - -<!-- Top-level elements. --> - - <xsd:element name="domain" type="Deployment:Domain"/> - <xsd:element name="deploymentPlan" type="Deployment:DeploymentPlan"/> - <xsd:element name="implementationArtifactDescription" type="Deployment:ImplementationArtifactDescription" /> - <xsd:element name="componentInterfaceDescription" type="Deployment:ComponentInterfaceDescription"/> - <xsd:element name="componentImplementationDescription" type="Deployment:ComponentImplementationDescription"/> - <xsd:element name="componentPackageDescription" type="Deployment:ComponentPackageDescription"/> - <xsd:element name="packageConfiguration" type="Deployment:PackageConfiguration"/> - <xsd:element name="topLevelPackageDescription" type="Deployment:TopLevelPackageDescription"/> - -</xsd:schema> diff --git a/CIAO/examples/Null_Component/descriptors/Domain.cdd b/CIAO/examples/Null_Component/descriptors/Domain.cdd deleted file mode 100644 index b54b660bb7a..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Domain.cdd +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:domain xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>E6198ADF-7421-46D8-9C4F-F70273837DAF</UUID> - - <node> - <name>NodeA</name> - </node> - -</Deployment:domain> diff --git a/CIAO/examples/Null_Component/descriptors/NodeMap.dat b/CIAO/examples/Null_Component/descriptors/NodeMap.dat index 1e920ef3e77..51d8967c561 100644 --- a/CIAO/examples/Null_Component/descriptors/NodeMap.dat +++ b/CIAO/examples/Null_Component/descriptors/NodeMap.dat @@ -1 +1 @@ -NodeA corbaloc:iiop:localhost:10000/NodeManager
\ No newline at end of file +NodeOne corbaloc:iiop:localhost:10000/NodeManager
\ No newline at end of file diff --git a/CIAO/examples/Null_Component/descriptors/Null_Assembly.cid b/CIAO/examples/Null_Component/descriptors/Null_Assembly.cid deleted file mode 100644 index 0b0d999c161..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Assembly.cid +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:componentImplementationDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>AB4E18C0-187E-4FEF-95FE-462E199411E5</UUID> - - <assemblyImpl> - <instance id="_6B477FA1-2C04-423B-9580-A2997DEA6ADD"> - <name>Null_Component.ComponentImplementations.Null_Assembly_Container.Null_Assembly.Null_Component</name> - <basePackage href="Null_Component_Package.cpd"/> - </instance> - </assemblyImpl> - -</Deployment:componentImplementationDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Assembly_Package.cpd b/CIAO/examples/Null_Component/descriptors/Null_Assembly_Package.cpd deleted file mode 100644 index 8650f99341a..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Assembly_Package.cpd +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:componentPackageDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>051F0532-FC77-4867-8B97-58A8B1AC2692</UUID> - - <implementation> - <name>Null_Component.ComponentImplementations.Null_Assembly_Container.Null_Assembly</name> - <referencedImplementation href="Null_Assembly.cid"/> - </implementation> - -</Deployment:componentPackageDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Component.ccd b/CIAO/examples/Null_Component/descriptors/Null_Component.ccd deleted file mode 100644 index c728a17f876..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Component.ccd +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:componentInterfaceDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>1E762719-4310-41B5-ADC0-084D15E4DA91</UUID> - - <specificType>IDL:Null_Component:1.0</specificType> - - <supportedType>IDL:Null_Component:1.0</supportedType> - - <supportedType>IDL:omg.org/Components/Navigation:1.0</supportedType> - - <supportedType>IDL:omg.org/Components/Receptacles:1.0</supportedType> - - <supportedType>IDL:omg.org/Components/Events:1.0</supportedType> - - <supportedType>IDL:omg.org/Components/CCMObject:1.0</supportedType> - - <supportedType>IDL:omg.org/CORBA/Object:1.0</supportedType> - - <idlFile>Null_Component.idl</idlFile> - - <port> - <name>null_facet</name> - <specificType>IDL:Null_Interface:1.0</specificType> - <supportedType>IDL:Null_Interface:1.0</supportedType> - <supportedType>IDL:omg.org/CORBA/Object:1.0</supportedType> - <provider>true</provider> - <exclusiveProvider>false</exclusiveProvider> - <exclusiveUser>false</exclusiveUser> - <optional>false</optional> - <kind>Facet</kind> - </port> - -</Deployment:componentInterfaceDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_ComponentMonolithicImpl.cid b/CIAO/examples/Null_Component/descriptors/Null_ComponentMonolithicImpl.cid deleted file mode 100644 index 4e37e838af9..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_ComponentMonolithicImpl.cid +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:componentImplementationDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>DB0165FE-599E-485B-844E-E8D4C1FA3951</UUID> - - <implements href="Null_Component.ccd"/> - - <monolithicImpl> - <primaryArtifact> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_stub</name> - <referencedArtifact href="Null_Component_stub.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_svnt</name> - <referencedArtifact href="Null_Component_svnt.iad"/> - </primaryArtifact> - <primaryArtifact> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_exec</name> - <referencedArtifact href="Null_Component_exec.iad"/> - </primaryArtifact> - </monolithicImpl> - - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Null_Component.ior</string> - </value> - </value> - </configProperty> - -</Deployment:componentImplementationDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Component_Package.cpd b/CIAO/examples/Null_Component/descriptors/Null_Component_Package.cpd deleted file mode 100644 index 4f450e87398..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Component_Package.cpd +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:componentPackageDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>FDCE9BA7-20C4-44B0-B1FB-10CC18EC1DB2</UUID> - - <realizes href="Null_Component.ccd"/> - - <implementation> - <name>Null_Component.ComponentImplementations.Null_ComponentImplementation.Null_ComponentMonolithicImpl</name> - <referencedImplementation href="Null_ComponentMonolithicImpl.cid"/> - </implementation> - -</Deployment:componentPackageDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Component_exec.iad b/CIAO/examples/Null_Component/descriptors/Null_Component_exec.iad deleted file mode 100644 index 1c8c34d20c2..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Component_exec.iad +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:implementationArtifactDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>7D050E10-E0DC-4A7A-810D-E847ED9ACC04</UUID> - - <location>Null_Component_exec</location> - - <dependsOn> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_svnt</name> - <referencedArtifact href="Null_Component_svnt.iad"/> - </dependsOn> - - <dependsOn> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_stub</name> - <referencedArtifact href="Null_Component_stub.iad"/> - </dependsOn> - - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Null_ComponentHome_Impl</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>architecture</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>x86</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>artifactVersion</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>0.0.0.0</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>configuration</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Release</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>operatingSystem</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Linux</string> - </value> - </value> - </execParameter> - -</Deployment:implementationArtifactDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Component_stub.iad b/CIAO/examples/Null_Component/descriptors/Null_Component_stub.iad deleted file mode 100644 index 034c4953e8b..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Component_stub.iad +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:implementationArtifactDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>F8CECE24-F3D4-4162-9A28-1CC7FA48C01B</UUID> - - <location>Null_Component_stub</location> - - <execParameter> - <name>architecture</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>x86</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>artifactVersion</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>0.0.0.0</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>configuration</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Release</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>operatingSystem</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Linux</string> - </value> - </value> - </execParameter> - -</Deployment:implementationArtifactDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Component_svnt.iad b/CIAO/examples/Null_Component/descriptors/Null_Component_svnt.iad deleted file mode 100644 index 8484f7a9a13..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Null_Component_svnt.iad +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:implementationArtifactDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>6DCFFB72-08DB-4546-B206-13B6AC2DB251</UUID> - - <location>Null_Component_svnt</location> - - <dependsOn> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_stub</name> - <referencedArtifact href="Null_Component_stub.iad"/> - </dependsOn> - - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Null_ComponentHome_Servant</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>architecture</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>x86</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>artifactVersion</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>0.0.0.0</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>configuration</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Release</string> - </value> - </value> - </execParameter> - - <execParameter> - <name>operatingSystem</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Linux</string> - </value> - </value> - </execParameter> - -</Deployment:implementationArtifactDescription> diff --git a/CIAO/examples/Null_Component/descriptors/Null_Homed.cdp b/CIAO/examples/Null_Component/descriptors/Null_Homed.cdp new file mode 100644 index 00000000000..2332e2d346e --- /dev/null +++ b/CIAO/examples/Null_Component/descriptors/Null_Homed.cdp @@ -0,0 +1,109 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Null_Homed</label> + <UUID>Null_Homed</UUID> +<implementation xmi:id="Null_ComponentHomeImplementation"> + <name>Null_ComponentHomeImplementation</name> + <source/> + <artifact xmi:idref="Null_Component_ExecArtifact" /> + <artifact xmi:idref="Null_Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>home factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Null_ComponentHome_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Null_ComponentHome_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Null_Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Null_Component_exec</string> + </value> + </value> + </execParameter> +</implementation> +<implementation xmi:id="Null_ComponentComponentImplementation"> + <name>Null_ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Null_Component_ExecArtifact" /> + <artifact xmi:idref="Null_Component_SvntArtifact" /> + <artifact xmi:idref="Null_Component_StubArtifact" /> +</implementation> + <instance xmi:id="Null_ComponentHomeInstance"> + <name>Null_ComponentHome</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Null_ComponentHomeImplementation" /> +</instance> + <instance xmi:id="Null_ComponentComponentInstance"> + <name>Null_ComponentComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Null_ComponentComponentImplementation" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.ExplicitHome</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Null_ComponentHome</string> + </value> + </value> + </configProperty> +</instance> + <artifact xmi:id="Null_Component_ExecArtifact"> + <name>Null_Component_exec</name> + <source/> + <node/> + <location>Null_Component_exec</location> +</artifact> +<artifact xmi:id="Null_Component_SvntArtifact"> + <name>Null_Component_svnt</name> + <source/> + <node/> + <location>Null_Component_svnt</location> +</artifact> +<artifact xmi:id="Null_Component_StubArtifact"> + <name>Null_Component_stub</name> + <source/> + <node/> + <location>Null_Component_stub</location> +</artifact> +</Deployment:DeploymentPlan>
\ No newline at end of file diff --git a/CIAO/examples/Null_Component/descriptors/Null_Unhomed.cdp b/CIAO/examples/Null_Component/descriptors/Null_Unhomed.cdp new file mode 100644 index 00000000000..c259d000b9e --- /dev/null +++ b/CIAO/examples/Null_Component/descriptors/Null_Unhomed.cdp @@ -0,0 +1,85 @@ +<Deployment:DeploymentPlan + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Null_Homed</label> + <UUID>Null_Homed</UUID> + +<implementation xmi:id="Null_ComponentComponentImplementation"> + <name>Null_ComponentComponentImplementation</name> + <source/> + <artifact xmi:idref="Null_Component_ExecArtifact" /> + <artifact xmi:idref="Null_Component_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Null_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Null_Component_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Null_Component_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Null_Component_exec</string> + </value> + </value> + </execParameter> +</implementation> +<instance xmi:id="Null_ComponentComponentInstance"> + <name>Null_ComponentComponent</name> + <node>NodeOne</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="Null_ComponentComponentImplementation" /> +</instance> + <artifact xmi:id="Null_Component_ExecArtifact"> + <name>Null_Component_exec</name> + <source/> + <node/> + <location>Null_Component_exec</location> +</artifact> +<artifact xmi:id="Null_Component_SvntArtifact"> + <name>Null_Component_svnt</name> + <source/> + <node/> + <location>Null_Component_svnt</location> +</artifact> +<artifact xmi:id="Null_Component_StubArtifact"> + <name>Null_Component_stub</name> + <source/> + <node/> + <location>Null_Component_stub</location> +</artifact> +</Deployment:DeploymentPlan>
\ No newline at end of file diff --git a/CIAO/examples/Null_Component/descriptors/PackageConfiguration.pcd b/CIAO/examples/Null_Component/descriptors/PackageConfiguration.pcd deleted file mode 100644 index 0ed852e5164..00000000000 --- a/CIAO/examples/Null_Component/descriptors/PackageConfiguration.pcd +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:packageConfiguration xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>168FF6BD-40CF-4A06-A380-66266A32F168</UUID> - - <basePackage href="Null_Assembly_Package.cpd"/> - -</Deployment:packageConfiguration> diff --git a/CIAO/examples/Null_Component/descriptors/Plan.cdp b/CIAO/examples/Null_Component/descriptors/Plan.cdp deleted file mode 100644 index 4389f295e1d..00000000000 --- a/CIAO/examples/Null_Component/descriptors/Plan.cdp +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:deploymentPlan xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <UUID>FD6E278D-20AC-4FFD-B359-382963C5D9A1</UUID> - - <implementation id="_DB0165FE-599E-485B-844E-E8D4C1FA3951"> - <name>Null_Component.ComponentImplementations.Null_ComponentImplementation.Null_ComponentMonolithicImpl</name> - <source/> - <artifact>_F8CECE24-F3D4-4162-9A28-1CC7FA48C01B</artifact> - <artifact>_6DCFFB72-08DB-4546-B206-13B6AC2DB251</artifact> - <artifact>_7D050E10-E0DC-4A7A-810D-E847ED9ACC04</artifact> - </implementation> - - <instance id="Null_Component.ComponentImplementations.Null_Assembly_Container.Null_Assembly.Null_Component"> - <name>Null_Component.ComponentImplementations.Null_Assembly_Container.Null_Assembly.Null_Component</name> - <node>NodeA</node> - <source/> - <implementation>_DB0165FE-599E-485B-844E-E8D4C1FA3951</implementation> - <configProperty> - <name>ComponentIOR</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>Null_Component.ior</string> - </value> - </value> - </configProperty> - </instance> - - <artifact id="_F8CECE24-F3D4-4162-9A28-1CC7FA48C01B"> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_stub</name> - <source/> - <node/> - <location>Null_Component_stub</location> - </artifact> - - <artifact id="_6DCFFB72-08DB-4546-B206-13B6AC2DB251"> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_svnt</name> - <source/> - <node/> - <location>Null_Component_svnt</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Null_ComponentHome_Servant</string> - </value> - </value> - </execParameter> - </artifact> - - <artifact id="_7D050E10-E0DC-4A7A-810D-E847ED9ACC04"> - <name>Null_Component.ImplementationArtifacts.Null_ComponentArtifacts.Null_Component_exec</name> - <source/> - <node/> - <location>Null_Component_exec</location> - <execParameter> - <name>entryPoint</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>create_Null_ComponentHome_Impl</string> - </value> - </value> - </execParameter> - </artifact> - -</Deployment:deploymentPlan> diff --git a/CIAO/examples/Null_Component/descriptors/TopLevelPackage.tpd b/CIAO/examples/Null_Component/descriptors/TopLevelPackage.tpd deleted file mode 100644 index 8c4a5d46dba..00000000000 --- a/CIAO/examples/Null_Component/descriptors/TopLevelPackage.tpd +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no" ?> -<Deployment:topLevelPackageDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> - - <basePackage href="PackageConfiguration.pcd"/> - -</Deployment:topLevelPackageDescription> diff --git a/CIAO/examples/Null_Component/descriptors/XMI.xsd b/CIAO/examples/Null_Component/descriptors/XMI.xsd deleted file mode 100644 index f4adac91934..00000000000 --- a/CIAO/examples/Null_Component/descriptors/XMI.xsd +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" ?> -<xsd:schema targetNamespace="http://www.omg.org/XMI" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'> - <xsd:attribute name="id" type="xsd:ID" /> - <xsd:attributeGroup name="IdentityAttribs"> - <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" /> - </xsd:attributeGroup> - <xsd:attributeGroup name="LinkAttribs"> - <xsd:attribute name="href" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" /> - </xsd:attributeGroup> - <xsd:attributeGroup name="ObjectAttribs"> - <xsd:attributeGroup ref="xmi:IdentityAttribs" /> - <xsd:attributeGroup ref="xmi:LinkAttribs" /> - <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" /> - <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" /> - </xsd:attributeGroup> - <xsd:complexType name="Extension"> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:any processContents="lax" /> - </xsd:choice> - <xsd:attribute ref="xmi:id" /> - <xsd:attributeGroup ref="xmi:ObjectAttribs" /> - <xsd:attribute name="extender" type="xsd:string" use="optional" /> - <xsd:attribute name="extenderID" type="xsd:string" use="optional" /> - </xsd:complexType> - <xsd:element name="Extension" type="xmi:Extension" /> - <xsd:complexType name="Any"> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:any processContents="skip" /> - </xsd:choice> - <xsd:anyAttribute processContents="skip" /> - </xsd:complexType> -</xsd:schema> diff --git a/CIAO/examples/Null_Component/descriptors/run_test.pl b/CIAO/examples/Null_Component/descriptors/run_test.pl new file mode 100755 index 00000000000..76b37e5a3bf --- /dev/null +++ b/CIAO/examples/Null_Component/descriptors/run_test.pl @@ -0,0 +1,180 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; +$daemons = 1; +@ports = ( 60001 ); +@iorfiles = ( "NodeApp1.ior" ); +@nodenames = ( "NodeOne" ); +$status = 0; +$dat_file = "NodeMap.dat"; + +$nsior = PerlACE::LocalFile ("ns.ior"); + +$E = 0; +$EM = 0; +$retval = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } + unlink PerlACE::LocalFile ("EM.ior"); + unlink PerlACE::LocalFile ("DAM.ior"); + unlink PerlACE::LocalFile ("ns.ior"); +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } + + if ($em_running == 1) { + $EM->Kill (); + $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); + $NS->TimedWait (1); + } + +} + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = "$CIAO_ROOT/bin/ciao_componentserver"; + + $d_cmd = "$DAnCE/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService --instance-nc corbaloc:rir:/NameService"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + 30) == -1) { + print STDERR + "ERROR: The ior $iorfile file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +if ($#ARGV == -1) +{ + opendir(DIR, "."); + @files = grep(/\.cdp$/,readdir(DIR)); + closedir(DIR); +} else { + @files = @ARGV; +} + +foreach $file (@files) { + print "Starting test for deployment $file\n"; + delete_ior_files (); + + print STDERR "Starting Naming Service\n"; + + $NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); + $NS->Spawn (); + + if (PerlACE::waitforfile_timed ($nsior, $PerlACE::wait_interval_for_process_creation) == -1) + { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; + } + $ns_running = 1; + +# Set up NamingService environment + $ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + + +# Invoke node daemons. + print "Invoking node daemons\n"; + $status = run_node_daemons (); + + if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemons\n"; + kill_open_processes (); + exit 1; + } + + $daemons_running = 1; + + # Invoke execution manager. + print "Invoking execution manager\n"; + $EM = new PerlACE::Process ("$DAnCE/bin/dance_execution_manager", + "-eEM.ior --domain-nc corbaloc:rir:/NameService"); + $EM->Spawn (); + + if (PerlACE::waitforfile_timed ("EM.ior", + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; + } + + $em_running = 1; + +# Invoke executor - start the application -. + print "Invoking executor - start the application -\n"; + $E = + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-x $file -k file://EM.ior"); + + $E->SpawnWaitKill (5000); + + if ($status != 0) + { + print "ERROR: dance_plan_launcher returned an error code while deploying $file\n"; + $retval = -1; + } + + # Invoke executor - stop the application -. + print "Invoking executor - stop the application -\n"; + $E = + new PerlACE::Process ("$DAnCE/bin/dance_plan_launcher", + "-k file://EM.ior -x $file -q"); + $E->SpawnWaitKill (3000); + + print "Executor returned.\n"; + + delete_ior_files (); + kill_open_processes (); +} + +delete_ior_files (); +kill_open_processes (); + +exit $status; diff --git a/CIAO/examples/Swapping/Hello_Base/Hello_Base.mpc b/CIAO/examples/Swapping/Hello_Base/Hello_Base.mpc index c0db4fdfbeb..f6a4ac5328b 100644 --- a/CIAO/examples/Swapping/Hello_Base/Hello_Base.mpc +++ b/CIAO/examples/Swapping/Hello_Base/Hello_Base.mpc @@ -15,7 +15,7 @@ project(Swapping_Hello_Base_idl_gen) : taoidldefaults, anytypecode { } } -project(Swapping_Hello_Base_stub) : ciao_client_dnc { +project(Swapping_Hello_Base_stub) : ccm_stub { avoids += ace_for_tao after += Swapping_Hello_Base_idl_gen libs += @@ -41,7 +41,7 @@ project(Swapping_Hello_Base_stub) : ciao_client_dnc { } -project(Swapping_Hello_Base_skel) : ciao_component_dnc { +project(Swapping_Hello_Base_skel) : ciao_executor { avoids += ace_for_tao after += Swapping_Hello_Base_stub sharedname = Swapping_Hello_Base_skel diff --git a/CIAO/examples/Swapping/Receiver/Receiver.mpc b/CIAO/examples/Swapping/Receiver/Receiver.mpc index 981bceb700f..3940a663112 100644 --- a/CIAO/examples/Swapping/Receiver/Receiver.mpc +++ b/CIAO/examples/Swapping/Receiver/Receiver.mpc @@ -23,31 +23,30 @@ project(Swapping_Hello_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { idlflags += -Wb,export_macro=RECEIVER_SVNT_Export \ -Wb,export_include=Receiver_svnt_export.h \ -SS - CIDL_Files { Receiver.cidl } - + IDL_Files { ReceiverE.idl } } -project(Swapping_Hello_Receiver_stub): ciao_client_dnc { +project(Swapping_Hello_Receiver_stub): ccm_stub { avoids += ace_for_tao after += Swapping_Hello_Receiver_idl_gen \ Swapping_Hello_Base_stub sharedname = Swapping_Receiver_stub dynamicflags = RECEIVER_STUB_BUILD_DLL libs += Swapping_Hello_Base_stub - + requires += dummy_label IDL_Files { } Source_Files { ReceiverC.cpp } - + Header_Files { ReceiverC.h Receiver_stub_export.h @@ -58,7 +57,7 @@ project(Swapping_Hello_Receiver_stub): ciao_client_dnc { } } -project(Swapping_Hello_Receiver_svnt) : ciao_servant_dnc { +project(Swapping_Hello_Receiver_svnt) : ciao_servant { avoids += ace_for_tao after += Swapping_Hello_Base_skel \ Swapping_Hello_Receiver_stub \ @@ -68,7 +67,8 @@ project(Swapping_Hello_Receiver_svnt) : ciao_servant_dnc { Swapping_Hello_Base_skel \ Swapping_Hello_Base_stub dynamicflags = RECEIVER_SVNT_BUILD_DLL - + requires += dummy_label + CIDL_Files { } @@ -80,14 +80,14 @@ project(Swapping_Hello_Receiver_svnt) : ciao_servant_dnc { ReceiverS.cpp Receiver_svnt.cpp } - + Header_Files { ReceiverEC.h SenderS.h Sender_svnt.h Sender_svnt_export.h } - + Inline_Files { ReceiverEC.inl ReceiverS.inl @@ -95,7 +95,7 @@ project(Swapping_Hello_Receiver_svnt) : ciao_servant_dnc { } -project(Swapping_Hello_Receiver_exec) : ciao_component_dnc { +project(Swapping_Hello_Receiver_exec) : ciao_executor { avoids += ace_for_tao after += Swapping_Hello_Receiver_svnt sharedname = Swapping_Receiver_exec @@ -103,7 +103,8 @@ project(Swapping_Hello_Receiver_exec) : ciao_component_dnc { Swapping_Receiver_svnt \ Swapping_Hello_Base_skel \ Swapping_Hello_Base_stub - + + requires += dummy_label dynamicflags = RECEIVER_EXEC_BUILD_DLL IDL_Files { @@ -112,12 +113,12 @@ project(Swapping_Hello_Receiver_exec) : ciao_component_dnc { Source_Files { Receiver_exec.cpp } - + Header_Files { Receiver_exec.h Receiver_exec_export.h } - + Inline_Files { } } diff --git a/CIAO/examples/Swapping/Receiver/Receiver_exec.cpp b/CIAO/examples/Swapping/Receiver/Receiver_exec.cpp index ba90f31b2d5..89de7e57c11 100644 --- a/CIAO/examples/Swapping/Receiver/Receiver_exec.cpp +++ b/CIAO/examples/Swapping/Receiver/Receiver_exec.cpp @@ -78,10 +78,10 @@ namespace CIDL_Receiver_Impl } void - Receiver_exec_i::ciao_preactivate () + Receiver_exec_i::configuration_complete () { ACE_DEBUG ((LM_DEBUG, - "Receiver_exec_i::ciao_preactivate\n")); + "Receiver_exec_i::configuration_complete\n")); } void @@ -91,13 +91,6 @@ namespace CIDL_Receiver_Impl } void - Receiver_exec_i::ciao_postactivate () - { - ACE_DEBUG ((LM_DEBUG, - "Receiver_exec_i::ciao_postactivate\n")); - } - - void Receiver_exec_i::ccm_passivate () { ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::ccm_passivate\n")); diff --git a/CIAO/examples/Swapping/Receiver/Receiver_exec.h b/CIAO/examples/Swapping/Receiver/Receiver_exec.h index 7ca299a6bb7..42399771078 100644 --- a/CIAO/examples/Swapping/Receiver/Receiver_exec.h +++ b/CIAO/examples/Swapping/Receiver/Receiver_exec.h @@ -10,7 +10,7 @@ #ifndef RECEIVER_EXEC_H #define RECEIVER_EXEC_H -#include "ciao/CIAO_SwapExecC.h" +#include "ciao/Servants/Swapping/CIAO_SwapExecC.h" #include "ReceiverEC.h" #include "Receiver_exec_export.h" #include "tao/LocalObject.h" @@ -59,13 +59,10 @@ namespace CIDL_Receiver_Impl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/examples/Swapping/Sender/Sender.mpc b/CIAO/examples/Swapping/Sender/Sender.mpc index 3f63607f1e3..70fefa3bb62 100644 --- a/CIAO/examples/Swapping/Sender/Sender.mpc +++ b/CIAO/examples/Swapping/Sender/Sender.mpc @@ -2,6 +2,7 @@ // This file is generated with "generate_component_mpc_extra.pl -p Hello_Base Sender" project(Swapping_Hello_Sender_idl_gen) : taoidldefaults, anytypecode { + requires += dummy_label avoids += ace_for_tao custom_only = 1 idlflags += -Wb,stub_export_macro=SENDER_STUB_Export \ @@ -15,6 +16,7 @@ project(Swapping_Hello_Sender_idl_gen) : taoidldefaults, anytypecode { } project(Swapping_Hello_Sender_cidl_gen) : ciaocidldefaults, taoidldefaults { + requires += dummy_label avoids += ace_for_tao custom_only = 1 cidlflags += --svnt-export-macro SENDER_SVNT_Export \ @@ -33,14 +35,15 @@ project(Swapping_Hello_Sender_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Swapping_Hello_Sender_stub): ciao_client_dnc { +project(Swapping_Hello_Sender_stub): ccm_stub { + requires += dummy_label avoids += ace_for_tao after += Swapping_Hello_Base_stub \ Swapping_Hello_Sender_idl_gen sharedname = Swapping_Sender_stub dynamicflags = SENDER_STUB_BUILD_DLL libs += Swapping_Hello_Base_stub - + requires += dummy_label IDL_Files { } @@ -58,7 +61,8 @@ project(Swapping_Hello_Sender_stub): ciao_client_dnc { } } -project(Swapping_Hello_Sender_svnt) : ciao_servant_dnc { +project(Swapping_Hello_Sender_svnt) : ciao_servant { + requires += dummy_label avoids += ace_for_tao after += Swapping_Hello_Base_skel \ Swapping_Hello_Sender_stub \ @@ -95,7 +99,8 @@ project(Swapping_Hello_Sender_svnt) : ciao_servant_dnc { } } -project(Swapping_Hello_Sender_exec) : ciao_component_dnc { +project(Swapping_Hello_Sender_exec) : ciao_executor { + requires += dummy_label avoids += ace_for_tao after += Swapping_Hello_Sender_svnt sharedname = Swapping_Sender_exec @@ -119,7 +124,8 @@ project(Swapping_Hello_Sender_exec) : ciao_component_dnc { } } -project(Swapping_Hello_Sender_exec_1) : ciao_component_dnc { +project(Swapping_Hello_Sender_exec_1) : ciao_executor { + requires += dummy_label avoids += ace_for_tao after += Swapping_Hello_Sender_exec sharedname = Swapping_Sender_exec_1 @@ -144,7 +150,8 @@ project(Swapping_Hello_Sender_exec_1) : ciao_component_dnc { } } -project(Swapping_Hello_Sender_exec_2) : ciao_component_dnc { +project(Swapping_Hello_Sender_exec_2) : ciao_executor { + requires += dummy_label avoids += ace_for_tao after += Swapping_Hello_Sender_exec sharedname = Swapping_Sender_exec_2 @@ -172,7 +179,8 @@ project(Swapping_Hello_Sender_exec_2) : ciao_component_dnc { } } -project (Swapping_Hello_Starter) : ciao_client_dnc, valuetype { +project (Swapping_Hello_Starter) : ccm_stub, valuetype { + requires += dummy_label avoids += ace_for_tao exename = Upgradeable_starter after += Swapping_Hello_Sender_stub diff --git a/CIAO/examples/Swapping/Sender/Sender_exec.cpp b/CIAO/examples/Swapping/Sender/Sender_exec.cpp index eeacef71fd2..4bf8fb4a0d7 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec.cpp +++ b/CIAO/examples/Swapping/Sender/Sender_exec.cpp @@ -63,10 +63,10 @@ namespace CIDL_Sender_Impl } void - Sender_exec_i::ciao_preactivate () + Sender_exec_i::configuration_complete () { ACE_DEBUG ((LM_DEBUG, - "Sender_exec_i::ciao_preactivate\n")); + "Sender_exec_i::configuration_complete\n")); } void @@ -77,13 +77,6 @@ namespace CIDL_Sender_Impl } void - Sender_exec_i::ciao_postactivate () - { - ACE_DEBUG ((LM_DEBUG, - "Sender_exec_i::ciao_postactivate\n")); - } - - void Sender_exec_i::ccm_passivate () { ACE_DEBUG ((LM_DEBUG, "Sender_exec_i::ccm_passivate\n")); diff --git a/CIAO/examples/Swapping/Sender/Sender_exec.h b/CIAO/examples/Swapping/Sender/Sender_exec.h index 6f73580bda3..773777640ec 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec.h +++ b/CIAO/examples/Swapping/Sender/Sender_exec.h @@ -10,7 +10,7 @@ #ifndef SENDER_EXEC_H #define SENDER_EXEC_H -#include "ciao/CIAO_SwapExecC.h" +#include "ciao/Servants/Swapping/CIAO_SwapExecC.h" #include "SenderEC.h" #include "Sender_exec_export.h" #include "tao/LocalObject.h" @@ -62,12 +62,10 @@ namespace CIDL_Sender_Impl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/examples/Swapping/Sender/Sender_exec_1.cpp b/CIAO/examples/Swapping/Sender/Sender_exec_1.cpp index c6534ba1125..22ea7888685 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec_1.cpp +++ b/CIAO/examples/Swapping/Sender/Sender_exec_1.cpp @@ -60,10 +60,10 @@ namespace CIDL_Sender_Impl } void - Sender_exec_1_i::ciao_preactivate () + Sender_exec_1_i::configuration_complete () { ACE_DEBUG ((LM_DEBUG, - "Sender_exec_1_i::ciao_preactivate\n")); + "Sender_exec_1_i::configuration_complete\n")); } void @@ -77,13 +77,6 @@ namespace CIDL_Sender_Impl } void - Sender_exec_1_i::ciao_postactivate () - { - ACE_DEBUG ((LM_DEBUG, - "Sender_exec_1_i::ciao_postactivate\n")); - } - - void Sender_exec_1_i::ccm_passivate () { ACE_DEBUG ((LM_DEBUG, "Sender_exec_1_i::ccm_passivate\n")); diff --git a/CIAO/examples/Swapping/Sender/Sender_exec_1.h b/CIAO/examples/Swapping/Sender/Sender_exec_1.h index 31447d5b556..186862097ae 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec_1.h +++ b/CIAO/examples/Swapping/Sender/Sender_exec_1.h @@ -10,7 +10,7 @@ #ifndef SENDER_EXEC_1_H #define SENDER_EXEC_1_H -#include "ciao/CIAO_SwapExecC.h" +#include "ciao/Servants/Swapping/CIAO_SwapExecC.h" #include "SenderEC.h" #include "Sender_exec_1_export.h" #include "tao/LocalObject.h" @@ -62,12 +62,10 @@ namespace CIDL_Sender_Impl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/examples/Swapping/Sender/Sender_exec_2.cpp b/CIAO/examples/Swapping/Sender/Sender_exec_2.cpp index 7063a79eb4f..75c237d2925 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec_2.cpp +++ b/CIAO/examples/Swapping/Sender/Sender_exec_2.cpp @@ -59,10 +59,10 @@ namespace CIDL_Sender_Impl } void - Sender_exec_2_i::ciao_preactivate () + Sender_exec_2_i::configuration_complete () { ACE_DEBUG ((LM_DEBUG, - "Sender_exec_2_i::ciao_preactivate\n")); + "Sender_exec_2_i::configuration_complete\n")); } void diff --git a/CIAO/examples/Swapping/Sender/Sender_exec_2.h b/CIAO/examples/Swapping/Sender/Sender_exec_2.h index 9886f4fd141..8f590001cad 100644 --- a/CIAO/examples/Swapping/Sender/Sender_exec_2.h +++ b/CIAO/examples/Swapping/Sender/Sender_exec_2.h @@ -10,7 +10,7 @@ #ifndef SENDER_EXEC_2_H #define SENDER_EXEC_2_H -#include "ciao/CIAO_SwapExecC.h" +#include "ciao/Servants/Swapping/CIAO_SwapExecC.h" #include "SenderEC.h" #include "Sender_exec_2_export.h" #include "tao/LocalObject.h" @@ -64,12 +64,10 @@ namespace CIDL_Sender_Impl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/performance-tests/Benchmark/Benchmark.mpc b/CIAO/performance-tests/Benchmark/Benchmark.mpc index c22432eb05a..46be1394348 100644 --- a/CIAO/performance-tests/Benchmark/Benchmark.mpc +++ b/CIAO/performance-tests/Benchmark/Benchmark.mpc @@ -14,7 +14,7 @@ project(Benchmark_idl_gen) : taoidldefaults, anytypecode { } } -project(Benchmark_stub) : ciao_client_dnc { +project(Benchmark_stub) : ccm_stub { avoids += ace_for_tao after += Benchmark_idl_gen libs += @@ -40,7 +40,7 @@ project(Benchmark_stub) : ciao_client_dnc { } -project(Benchmark_skel) : ciao_component_dnc { +project(Benchmark_skel) : ciao_executor { avoids += ace_for_tao after += Benchmark_stub sharedname = Benchmark_skel @@ -66,7 +66,7 @@ project(Benchmark_skel) : ciao_component_dnc { } } -project (Benchmark_server) : taoserver, strategies, ciao_component_dnc { +project (Benchmark_server) : taoserver, strategies, ciao_executor { exename = server after += Benchmark_skel libs += Benchmark_skel Benchmark_stub diff --git a/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc b/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc index 8f71c62d78e..49b5f25a02f 100644 --- a/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc +++ b/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded.mpc @@ -1,6 +1,6 @@ // $Id$ -project (Multi_Threaded_client) : ciao_client_dnc, strategies { +project (Multi_Threaded_client) : ccm_stub, strategies { exename = client after += Benchmark_RoundTripClient_stub libs += RoundTripClient_stub Benchmark_stub diff --git a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip.mpc b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip.mpc index 024620645e2..ec286db7615 100644 --- a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip.mpc +++ b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip.mpc @@ -33,7 +33,7 @@ project(Benchmark_RoundTrip_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Benchmark_RoundTrip_stub) : ciao_client_dnc { +project(Benchmark_RoundTrip_stub) : ccm_stub { avoids += ace_for_tao after += Benchmark_RoundTrip_idl_gen Benchmark_stub libs += Benchmark_stub @@ -58,7 +58,7 @@ project(Benchmark_RoundTrip_stub) : ciao_client_dnc { } } -project(Benchmark_RoundTrip_exec) : ciao_component_dnc { +project(Benchmark_RoundTrip_exec) : ciao_executor { avoids += ace_for_tao after += Benchmark_RoundTrip_cidl_gen Benchmark_RoundTrip_stub sharedname = RoundTrip_exec @@ -89,7 +89,7 @@ project(Benchmark_RoundTrip_exec) : ciao_component_dnc { } -project(Benchmark_RoundTrip_svnt) : ciao_servant_dnc { +project(Benchmark_RoundTrip_svnt) : ciao_servant { avoids += ace_for_tao after += Benchmark_skel Benchmark_RoundTrip_exec sharedname = RoundTrip_svnt @@ -122,7 +122,7 @@ project(Benchmark_RoundTrip_svnt) : ciao_servant_dnc { } } -project (RoundTrip_client) : ciao_client_dnc, valuetype, strategies { +project (RoundTrip_client) : ccm_stub, valuetype, strategies { avoids += ace_for_tao exename = client after += Benchmark_RoundTrip_stub diff --git a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTripEI.idl b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTripEI.idl index 46216c76377..1f105b46051 100644 --- a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTripEI.idl +++ b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTripEI.idl @@ -24,7 +24,7 @@ module Benchmark * define the component executor interface explicitly here. */ local interface RoundTrip_Exec : CCM_RoundTrip, CCM_LatencyTest, - Components::SessionComponent + Components::SessionComponent { }; diff --git a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp index 23bc35c438d..a0b330ab454 100644 --- a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp +++ b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.cpp @@ -1,13 +1,12 @@ // $Id$ #include "RoundTrip_exec.h" -#include "CIAO_common.h" //-- ACE Scheduling Params #include "ace/Sched_Params.h" - #include "ace/OS_NS_errno.h" +#include "ciao/Logger/Log_Macros.h" //================================================================= void @@ -24,7 +23,7 @@ set_priority () { if (ACE_OS::last_error () == EPERM) { - ACE_DEBUG ((LM_DEBUG, + CIAO_DEBUG ((LM_WARNING, CLINFO "client (%P|%t): user is not superuser, " "test runs in time-shared class\n")); } @@ -63,8 +62,7 @@ void MyImpl::RoundTrip_exec_i::set_session_context ( Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTrip_exec_i::set_session_context\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTrip_exec_i::set_session_context\n")); //cout << "MyImpl::RoundTrip_exec_i::set_session_context\n" << endl; this->context_ = @@ -76,15 +74,14 @@ MyImpl::RoundTrip_exec_i::set_session_context ( } void -MyImpl::RoundTrip_exec_i::ciao_preactivate () +MyImpl::RoundTrip_exec_i::configuration_complete () { } void MyImpl::RoundTrip_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTrip_exec_i::ccm_activate\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTrip_exec_i::ccm_activate\n")); //cout << "MyImpl::RoundTrip_exec_i::ccm_activate\n"; // Starting method! @@ -92,23 +89,15 @@ MyImpl::RoundTrip_exec_i::ccm_activate () } void -MyImpl::RoundTrip_exec_i::ciao_postactivate () -{ - -} - -void MyImpl::RoundTrip_exec_i::ccm_passivate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTrip_exec_i::ccm_passivate\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTrip_exec_i::ccm_passivate\n")); } void MyImpl::RoundTrip_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTrip_exec_i::ccm_remove\n")); + CIAO_DEBUG ((LM_INFO, CLINFO "MyImpl::RoundTrip_exec_i::ccm_remove\n")); } diff --git a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h index 158499f3163..99bac519c1e 100644 --- a/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h +++ b/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_exec.h @@ -48,12 +48,10 @@ namespace MyImpl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc index 96f22b28e38..67282d01325 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc +++ b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient.mpc @@ -33,7 +33,7 @@ project(Benchmark_RoundTripClient_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Benchmark_RoundTripClient_stub) : ciao_client_dnc { +project(Benchmark_RoundTripClient_stub) : ccm_stub { avoids += ace_for_tao after += Benchmark_RoundTripClient_idl_gen Benchmark_stub libs += Benchmark_stub @@ -58,7 +58,7 @@ project(Benchmark_RoundTripClient_stub) : ciao_client_dnc { } } -project(Benchmark_RoundTripClient_exec) : ciao_component_dnc { +project(Benchmark_RoundTripClient_exec) : ciao_executor { avoids += ace_for_tao after += Benchmark_RoundTripClient_cidl_gen Benchmark_RoundTripClient_stub sharedname = RoundTripClient_exec @@ -89,7 +89,7 @@ project(Benchmark_RoundTripClient_exec) : ciao_component_dnc { } -project(Benchmark_RoundTripClient_svnt) : ciao_servant_dnc { +project(Benchmark_RoundTripClient_svnt) : ciao_servant { avoids += ace_for_tao after += Benchmark_skel Benchmark_RoundTripClient_exec sharedname = RoundTripClient_svnt @@ -122,7 +122,7 @@ project(Benchmark_RoundTripClient_svnt) : ciao_servant_dnc { } } -project (RoundTripClient_client) : ciao_client_dnc, valuetype { +project (RoundTripClient_client) : ccm_stub, valuetype { avoids += ace_for_tao exename = client after += Benchmark_RoundTripClient_stub diff --git a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl index 12602b66b3b..784abd168d4 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl +++ b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClientEI.idl @@ -24,8 +24,8 @@ module Benchmark * define the component executor interface explicitly here. */ local interface RoundTripClient_Exec : CCM_RoundTripClient, - Components::SessionComponent, - CCM_Controller //Monolithic + Components::SessionComponent, + CCM_Controller //Monolithic { }; diff --git a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp index 4ff377dfa30..df5339685a6 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp +++ b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.cpp @@ -4,8 +4,8 @@ #include "ace/Throughput_Stats.h" #include "ace/Sample_History.h" #include "ace/High_Res_Timer.h" -#include "CIAO_common.h" #include "ace/Env_Value_T.h" +#include "ciao/Logger/Log_Macros.h" #include "RoundTripClient_exec.h" @@ -26,8 +26,7 @@ void MyImpl::RoundTripClient_exec_i::set_session_context ( Components::SessionContext_ptr ctx) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTripClient_exec_i::set_session_context\n")); //Since this is in collocated mode; The server-component will change the @@ -44,20 +43,14 @@ MyImpl::RoundTripClient_exec_i::set_session_context ( //Start the collocated test here void -MyImpl::RoundTripClient_exec_i::ciao_preactivate () +MyImpl::RoundTripClient_exec_i::configuration_complete () { } void MyImpl::RoundTripClient_exec_i::ccm_activate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_activate\n")); -} - -void -MyImpl::RoundTripClient_exec_i::ciao_postactivate () -{ + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTripClient_exec_i::ccm_activate\n")); } void @@ -69,9 +62,8 @@ MyImpl::RoundTripClient_exec_i::start () Benchmark::LatencyTest_var lt = context_->get_connection_latency (); - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, - "MyImpl::RoundTripClient_exec::start obtain obj ref\n")); + CIAO_DEBUG ((LM_INFO, CLINFO + "MyImpl::RoundTripClient_exec::start obtain obj ref\n")); CORBA::Long test_data = 0L; @@ -100,11 +92,11 @@ MyImpl::RoundTripClient_exec_i::start () ACE_hrtime_t test_end = ACE_OS::gethrtime (); - ACE_DEBUG ((LM_DEBUG, "test finished\n")); + CIAO_DEBUG ((LM_DEBUG, CLINFO"test finished\n")); - ACE_DEBUG ((LM_DEBUG, "High resolution timer calibration....")); + CIAO_DEBUG ((LM_DEBUG, CLINFO"High resolution timer calibration....")); ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); - ACE_DEBUG ((LM_DEBUG, "done\n")); + CIAO_DEBUG ((LM_DEBUG, CLINFO"done\n")); ACE_Env_Value<int> envar ("CIAO_DUMP_SAMPLE_HISTORY", 0); if (envar != 0) @@ -133,15 +125,13 @@ MyImpl::RoundTripClient_exec_i::get_controller () void MyImpl::RoundTripClient_exec_i::ccm_passivate () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_passivate\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTripClient_exec_i::ccm_passivate\n")); } void MyImpl::RoundTripClient_exec_i::ccm_remove () { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "MyImpl::RoundTripClient_exec_i::ccm_remove\n")); + CIAO_DEBUG ((LM_TRACE, CLINFO "MyImpl::RoundTripClient_exec_i::ccm_remove\n")); } @@ -163,7 +153,6 @@ MyImpl::RoundTripClientHome_exec_i::create () extern "C" ROUNDTRIPCLIENT_EXEC_Export ::Components::HomeExecutorBase_ptr createRoundTripClientHome_Impl (void) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "Creating RoundTrip_client impl \n")); + CIAO_DEBUG ((LM_INFO, CLINFO "Creating RoundTrip_client impl \n")); return new MyImpl::RoundTripClientHome_exec_i (); } diff --git a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h index 0b768832dda..117ad723c01 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h +++ b/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_exec.h @@ -42,12 +42,10 @@ namespace MyImpl // Operations from Components::SessionComponent virtual void set_session_context (Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); - virtual void ciao_postactivate (); - virtual void ccm_passivate (); virtual void ccm_remove (); diff --git a/CIAO/performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp b/CIAO/performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp index a3aed5e135f..000d83a92ae 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp +++ b/CIAO/performance-tests/Benchmark/RoundTripServer/LatencyTest.cpp @@ -2,7 +2,7 @@ // $Id$ // #include "LatencyTest.h" -#include "CIAO_common.h" +#include "ciao/Logger/Log_Macros.h" LatencyTest_Impl::LatencyTest_Impl (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb)) @@ -13,8 +13,7 @@ LatencyTest_Impl::LatencyTest_Impl (CORBA::ORB_ptr orb) CORBA::Long LatencyTest_Impl::makeCall (CORBA::Long send_time) { - if (CIAO::debug_level () > 0) - ACE_DEBUG ((LM_DEBUG, "Sending Time back \n")); + CIAO_DEBUG ((LM_DEBUG, CLINFO"Sending Time back \n")); return send_time; } diff --git a/CIAO/performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc b/CIAO/performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc index 00eab99d176..a3b803a522f 100644 --- a/CIAO/performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc +++ b/CIAO/performance-tests/Benchmark/RoundTripServer/RoundTripServer.mpc @@ -1,5 +1,5 @@ // $Id$ -project (RoundTrip_server) : strategies, ciao_component_dnc { +project (RoundTrip_server) : strategies, ciao_executor { exename = server after += Benchmark_skel libs += Benchmark_stub Benchmark_skel diff --git a/CIAO/performance-tests/Protocols/Controller/Controller.mpc b/CIAO/performance-tests/Protocols/Controller/Controller.mpc index a451efd4390..2848f5995a9 100644 --- a/CIAO/performance-tests/Protocols/Controller/Controller.mpc +++ b/CIAO/performance-tests/Protocols/Controller/Controller.mpc @@ -1,6 +1,6 @@ // $Id$ -project (Protocols_Controller) : ciao_client_dnc, rtcorba { +project (Protocols_Controller) : ccm_stub, rtcorba { avoids += ace_for_tao after += Protocols_Sender_stub \ Protocols_Receiver_stub diff --git a/CIAO/performance-tests/Protocols/Receiver/Receiver.mpc b/CIAO/performance-tests/Protocols/Receiver/Receiver.mpc index 5a3b37fd76c..8345f7a1c5a 100644 --- a/CIAO/performance-tests/Protocols/Receiver/Receiver.mpc +++ b/CIAO/performance-tests/Protocols/Receiver/Receiver.mpc @@ -32,7 +32,7 @@ project(Protocols_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Protocols_Receiver_stub) : ciao_client_dnc { +project(Protocols_Receiver_stub) : ccm_stub { avoids += ace_for_tao after += Protocols_Receiver_idl_gen Protocols_stub libs += Protocols_stub @@ -57,7 +57,7 @@ project(Protocols_Receiver_stub) : ciao_client_dnc { } } -project(Protocols_Receiver_exec) : ciao_component_dnc { +project(Protocols_Receiver_exec) : ciao_executor { avoids += ace_for_tao after += Protocols_Receiver_cidl_gen Protocols_Receiver_stub sharedname = Protocols_Receiver_exec @@ -86,7 +86,7 @@ project(Protocols_Receiver_exec) : ciao_component_dnc { } -project(Protocols_Receiver_svnt) : ciao_servant_dnc { +project(Protocols_Receiver_svnt) : ciao_servant { avoids += ace_for_tao after += Protocols_skel Protocols_Receiver_exec sharedname = Protocols_Receiver_svnt diff --git a/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.cpp b/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.cpp index a685d9db91c..9e806b77f9c 100644 --- a/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.cpp +++ b/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.cpp @@ -219,7 +219,6 @@ namespace CIDL_ReceiverImpl this->orb_ = CORBA::ORB_init (argc, argv); - } ::Protocols::CCM_test_ptr @@ -267,15 +266,9 @@ namespace CIDL_ReceiverImpl } void - ReceiverExec_i::ciao_preactivate (void) - { - ACE_DEBUG ((LM_DEBUG, "ReceiverExec_i::ccm_preactivate\n")); - } - - void - ReceiverExec_i::ciao_postactivate (void) + ReceiverExec_i::configuration_complete (void) { - ACE_DEBUG ((LM_DEBUG, "ReceiverExec_i::ccm_postactivate\n")); + ACE_DEBUG ((LM_DEBUG, "ReceiverExec_i::configuration_complete\n")); } ::Components::EnterpriseComponent_ptr diff --git a/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.h b/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.h index 1a05fc758de..6a4b281e9e9 100644 --- a/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.h +++ b/CIAO/performance-tests/Protocols/Receiver/Receiver_exec.h @@ -29,9 +29,7 @@ namespace CIDL_ReceiverImpl void ccm_remove (void); - void ciao_preactivate (void); - - void ciao_postactivate (void); + void configuration_complete (void); protected: diff --git a/CIAO/performance-tests/Protocols/Sender/Sender.mpc b/CIAO/performance-tests/Protocols/Sender/Sender.mpc index 87ff36851fa..852b43aaa1a 100644 --- a/CIAO/performance-tests/Protocols/Sender/Sender.mpc +++ b/CIAO/performance-tests/Protocols/Sender/Sender.mpc @@ -32,7 +32,7 @@ project(Protocols_Sender_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Protocols_Sender_stub) : ciao_client_dnc { +project(Protocols_Sender_stub) : ccm_stub { avoids += ace_for_tao after += Protocols_Sender_idl_gen Protocols_stub libs += Protocols_stub @@ -57,7 +57,7 @@ project(Protocols_Sender_stub) : ciao_client_dnc { } } -project(Protocols_Sender_exec) : ciao_component_dnc, rtcorba { +project(Protocols_Sender_exec) : ciao_executor, rtcorba { avoids += ace_for_tao after += Protocols_Sender_cidl_gen Protocols_Sender_stub sharedname = Protocols_Sender_exec @@ -88,7 +88,7 @@ project(Protocols_Sender_exec) : ciao_component_dnc, rtcorba { } -project(Protocols_Sender_svnt) : ciao_servant_dnc { +project(Protocols_Sender_svnt) : ciao_servant { avoids += ace_for_tao after += Protocols_skel Protocols_Sender_exec sharedname = Protocols_Sender_svnt diff --git a/CIAO/performance-tests/Protocols/Sender/Sender_exec.cpp b/CIAO/performance-tests/Protocols/Sender/Sender_exec.cpp index 87eaa8b938e..da68ddafb7b 100644 --- a/CIAO/performance-tests/Protocols/Sender/Sender_exec.cpp +++ b/CIAO/performance-tests/Protocols/Sender/Sender_exec.cpp @@ -677,15 +677,9 @@ CIDL_SenderImpl::SenderExec_i::ccm_remove (void) void -CIDL_SenderImpl::SenderExec_i::ciao_preactivate (void) +CIDL_SenderImpl::SenderExec_i::configuration_complete (void) { - ACE_DEBUG ((LM_DEBUG, "CIDL_SenderImpl::SenderExec_i::ccm_preactivate\n")); -} - -void -CIDL_SenderImpl::SenderExec_i::ciao_postactivate (void) -{ - ACE_DEBUG ((LM_DEBUG, "CIDL_SenderImpl::SenderExec_i::ccm_postactivate\n")); + ACE_DEBUG ((LM_DEBUG, "CIDL_SenderImpl::SenderExec_i::configuration_complete\n")); } ::Components::EnterpriseComponent_ptr diff --git a/CIAO/performance-tests/Protocols/Sender/Sender_exec.h b/CIAO/performance-tests/Protocols/Sender/Sender_exec.h index fa32784a34c..184422716b2 100644 --- a/CIAO/performance-tests/Protocols/Sender/Sender_exec.h +++ b/CIAO/performance-tests/Protocols/Sender/Sender_exec.h @@ -39,9 +39,7 @@ namespace CIDL_SenderImpl void ccm_remove (void); - void ciao_preactivate (void); - - void ciao_postactivate (void); + void configuration_complete (void); protected: diff --git a/CIAO/performance-tests/Protocols/common/Protocols.mpc b/CIAO/performance-tests/Protocols/common/Protocols.mpc index 4055f276e2e..b11a46b7a06 100644 --- a/CIAO/performance-tests/Protocols/common/Protocols.mpc +++ b/CIAO/performance-tests/Protocols/common/Protocols.mpc @@ -14,7 +14,7 @@ project(Protocols_idl_gen) : taoidldefaults, anytypecode { } } -project(Protocols_stub) : ciao_client_dnc { +project(Protocols_stub) : ccm_stub { avoids += ace_for_tao after += Protocols_idl_gen libs += @@ -40,7 +40,7 @@ project(Protocols_stub) : ciao_client_dnc { } -project(Protocols_skel) : ciao_component_dnc { +project(Protocols_skel) : ciao_executor { avoids += ace_for_tao after += Protocols_stub sharedname = Protocols_skel diff --git a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc index 8de487816bb..6dc4ea4c468 100644 --- a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc +++ b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc @@ -1,6 +1,7 @@ //$Id$ -project(TSEC_CheckPoint_stub): ciao_client_dnc, event { +project(TSEC_CheckPoint_stub): ccm_stub, event { + requires += dummy_label avoids += ace_for_tao after += ENW_stub libpaths += ../interfaces @@ -23,7 +24,8 @@ project(TSEC_CheckPoint_stub): ciao_client_dnc, event { } } -project(TSEC_CheckPoint_svnt) : ciao_servant_dnc, event { +project(TSEC_CheckPoint_svnt) : ciao_servant, event { + requires += dummy_label avoids += ace_for_tao after += TSEC_CheckPoint_stub after += ENW_skel ENW_stub @@ -54,7 +56,8 @@ project(TSEC_CheckPoint_svnt) : ciao_servant_dnc, event { } -project(TSEC_CheckPoint_exec) : ciao_component_dnc, event, ciao_server_dnc { +project(TSEC_CheckPoint_exec) : ciao_executor, event, ccm_svnt { + requires += dummy_label avoids += ace_for_tao after += TSEC_CheckPoint_svnt after += ENW_skel ENW_stub @@ -83,7 +86,8 @@ project(TSEC_CheckPoint_exec) : ciao_component_dnc, event, ciao_server_dnc { } -project(TSEC_CheckPoint_controller) : ciao_client_dnc, valuetype, event { +project(TSEC_CheckPoint_controller) : ccm_stub, valuetype, event { + requires += dummy_label avoids += ace_for_tao exename = controller after += TSEC_CheckPoint_stub diff --git a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp index ec734347be8..c8de0ed4534 100644 --- a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp +++ b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp @@ -13,7 +13,7 @@ #include "ciao/CIAO_common.h" #include "ciao/Version.h" - +#include "ciao/Containers/Session/Session_Container.h" #include "TSEC_CheckPoint_exec.h" #include "TSEC_CheckPoint_svnt.h" @@ -470,11 +470,11 @@ Impl::TSEC_CheckPoint_exec_i::push_lifeTokenIn //------------------------------------------------------------------- void -Impl::TSEC_CheckPoint_exec_i::ciao_preactivate +Impl::TSEC_CheckPoint_exec_i::configuration_complete ( ) { - ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::ciao_preactivate\n" ) ); + ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::configuration_complete\n" ) ); } @@ -506,18 +506,6 @@ Impl::TSEC_CheckPoint_exec_i::ccm_activate } -//------------------------------------------------------------------- -// Operation -//------------------------------------------------------------------- - -void -Impl::TSEC_CheckPoint_exec_i::ciao_postactivate -( -) -{ - ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::ciao_postactivate\n" ) ); -} - //------------------------------------------------------------------- // Operation diff --git a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h index abe95b78756..7f09543ea32 100644 --- a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h +++ b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h @@ -20,8 +20,6 @@ #include "tao/LocalObject.h" -#include "ciao/Session_Container.h" - #include "ENWS.h" #include "TSEC_CheckPointEIC.h" #include "TSEC_CheckPoint_exec_export.h" @@ -162,7 +160,7 @@ namespace Impl Components::SessionContext_ptr ctx ); - virtual void ciao_preactivate + virtual void configuration_complete ( ); @@ -170,11 +168,6 @@ namespace Impl ( ); - virtual void ciao_postactivate - ( - ); - - virtual void ccm_passivate ( ); diff --git a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp index 0393c9153cb..44ceea6235f 100644 --- a/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp +++ b/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp @@ -13,8 +13,8 @@ // Includes //------------------------------------------------------------------- -#include <ace/streams.h> -#include <ace/Get_Opt.h> +#include "ace/streams.h" +#include "ace/Get_Opt.h" #include "TSEC_CheckPointC.h" @@ -35,10 +35,10 @@ // Statics //------------------------------------------------------------------- -static int _testcase = TESTCASE_NOT_DEFINED; -static int _loop = 0; -static int _ident = 1; -static const ACE_TCHAR* _sessionService_ior = 0; +static int _testcase = TESTCASE_NOT_DEFINED; +static int _loop = 0; +static int _ident = 1; +static const char* _sessionService_ior = 0; //------------------------------------------------------------------- @@ -49,10 +49,10 @@ int parse_args ( int argc, - ACE_TCHAR* argv[] + char* argv[] ) { - ACE_Get_Opt get_opts( argc, argv, ACE_TEXT("i:k:l:t:") ); + ACE_Get_Opt get_opts( argc, argv, "i:k:l:t:" ); int c; while( ( c = get_opts() ) != -1 ) @@ -91,7 +91,7 @@ parse_args if ( _sessionService_ior == 0 ) { - _sessionService_ior = ACE_TEXT ("file://TSEC_CheckPoint.ior"); + _sessionService_ior = "file://TSEC_CheckPoint.ior"; } if( _testcase == 0 ) @@ -118,14 +118,15 @@ ACE_TMAIN { // Initialize orb CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); + CORBA::ORB_init( argc, argv); - if( parse_args (argc, argv) != 0 ) + if( parse_args( argc, argv ) != 0 ) { return -1; } - CORBA::Object_var obj = orb->string_to_object (ACE_TEXT_ALWAYS_CHAR (_sessionService_ior)); + CORBA::Object_var obj = orb->string_to_object( _sessionService_ior + ); ENW::ISessionService_var sessionService = ENW::ISessionService::_narrow (obj.in () ); diff --git a/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc b/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc index 22227109f39..67ac67fa756 100644 --- a/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc +++ b/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc @@ -1,6 +1,6 @@ //$Id$ -project(ENW_stub): ciao_client_dnc, event { +project(ENW_stub): ccm_stub, event { sharedname = ENW_stub idlflags -= -GT @@ -19,7 +19,7 @@ project(ENW_stub): ciao_client_dnc, event { } } -project(ENW_skel) : ciao_servant_dnc, event { +project(ENW_skel) : ciao_servant, event { after += ENW_stub sharedname = ENW_skel libs += ENW_stub diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc b/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc new file mode 100644 index 00000000000..f23f8f07eb5 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Activator/Activator.mpc @@ -0,0 +1,5 @@ +project (Activator_CIAOComponentServer_Test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client { + Source_Files { + client.cpp + } +}
\ No newline at end of file diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp b/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp new file mode 100644 index 00000000000..8b99e6fff09 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Activator/client.cpp @@ -0,0 +1,183 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ciao/ComponentServer/CIAO_CS_ClientS.h" +#include "ciao/ComponentServer/CIAO_ComponentServerC.h" +#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" +#include "ciao/Valuetype_Factories/ConfigValue.h" + +const char *cs_path = "ciao_componentserver"; +CORBA::ULong spawn_delay = 30; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "s:d:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 's': + cs_path = get_opts.opt_arg (); + break; + + case 'd': + spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-s <path> " + "-d <uint> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN (int argc, ACE_TCHAR **argv) +{ + using namespace CIAO::Deployment; + + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var object = + orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (object.in ()); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + poa_manager->activate (); + + CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, + cs_path, + 0, + false, + orb.in (), + root_poa.in ()); + + PortableServer::ServantBase_var safe = sa_tmp; + + ServerActivator_var sa = sa_tmp->_this (); + + + // Make our configvalues + // ::Components::ConfigValues_var configs = new + ::Components::ConfigValues configs(2); + //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); + // Make a componentserver with no configvalues + ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (configs))); + //ACE_DEBUG ((LM_DEBUG, "Componentserver with no configvalues created!\n")); + + //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with UUID configvalues\n")); + CORBA::Any val; + val <<= "MyNameIsEarl"; + configs.length (1); + ::Components::ConfigValue_var cv_tmp = new CIAO::ConfigValue_impl ("edu.vanderbilt.dre.ServerUUID", val); + configs[0] = cv_tmp._retn (); + + ComponentServer_var server2 (ComponentServer::_narrow (sa->create_component_server (configs))); + + + // Initialize servant + + if (CORBA::is_nil (server1.in ()) || + CORBA::is_nil (server1.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Nil componentserver references"), -1); + } + + Components::Deployment::Container_var tmp = server1->create_container (0); + Container_var cont1a = Container::_narrow (tmp.in ()); + if (CORBA::is_nil (cont1a.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", + tmp.in (), cont1a.in ())); + return -1; + } + //ACE_DEBUG ((LM_DEBUG, "Got container from server 1a\n")); + + Container_var cont1b = Container::_narrow (server1->create_container (0)); + if (CORBA::is_nil (cont1b.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from second create op on server 1\n")); + return -1; + } + //ACE_DEBUG ((LM_DEBUG, "Got container from server 1b\n")); + + Container_var cont2a = Container::_narrow (server2->create_container (0)); + if (CORBA::is_nil (cont2a.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 2\n")); + return -1; + } + //ACE_DEBUG ((LM_DEBUG, "Got container from server 2a\n")); + + try + { + server2->remove_container (cont1a); + ACE_ERROR ((LM_ERROR, "Error: remove_container removed a container not belonging to the component server\n")); + } + catch (::Components::RemoveFailure &) + { + //ACE_DEBUG ((LM_DEBUG, "Server 2 Refused to remove container it didn't own\n")); + // expected + } + + ::Components::Deployment::Containers_var cses = server1->get_containers (); + + if (cses->length () != 2) + ACE_ERROR ((LM_ERROR, "Error: get_containers returned the wrong number of containers, %u should be 2\n", + cses->length ())); + else //ACE_DEBUG ((LM_DEBUG, "Got %u containers\n", cses->length ())); + + server1->remove_container (cont1a); + //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1a\n")); + + cses = server1->get_containers (); + + if (cses->length () != 1) + ACE_ERROR ((LM_ERROR, "Error: get_containers returned %u containers after removal, should be 1\n", + cses->length ())); + + server2->remove_container (cont2a); + //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 2a\n")); + server1->remove_container (cont1b); + //ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1b\n")); + + //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); + sa->remove_component_server (server1.in ()); + sa->remove_component_server (server2.in ()); + //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); + + orb->destroy (); + } + catch (::Components::CreateFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); + } + catch (::Components::RemoveFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); + } + return 0; +} diff --git a/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl b/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl new file mode 100755 index 00000000000..243a395079c --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Activator/run_test.pl @@ -0,0 +1,42 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; +$ciao_root = "$ENV{CIAO_ROOT}"; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $target = PerlACE::TestTarget::create_target ($PerlACE::TestConfig); +my $host = new PerlACE::TestTarget; + +if (PerlACE::is_vxworks_test()) { + $SV1 = new PerlACE::ProcessVX ("./client", "-s $ciao_root/bin/ciao_componentserver") +} +else { + $SV1 = $target->CreateProcess ("./client", "-s $ciao_root/bin/ciao_componentserver"); +} + +$server1 = $SV1->SpawnWaitKill (300); + +if ($server1 != 0) { + $target->GetStderrLog(); + print STDERR "ERROR: server1 returned $server\n"; + exit 1; +} + +$target->GetStderrLog(); + +exit $status; diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc b/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc new file mode 100644 index 00000000000..1047a941f6d --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Basic/Basic.mpc @@ -0,0 +1,5 @@ +project (Basic_CIAOComponentServer_Test) : ciao_componentserver_stub { + Source_Files { + client.cpp + } +}
\ No newline at end of file diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp b/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp new file mode 100644 index 00000000000..b66e7676f03 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Basic/client.cpp @@ -0,0 +1,143 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ciao/ComponentServer/CIAO_ComponentServerC.h" + +const ACE_TCHAR *server_1 = ACE_TEXT("file://test1.ior"); +const ACE_TCHAR *server_2 = ACE_TEXT("file://test2.ior"); + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:j:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + server_1 = get_opts.opt_arg (); + break; + + case 'j': + server_2 = get_opts.opt_arg (); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + "-j <ior> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN (int argc, ACE_TCHAR **argv) +{ + using namespace CIAO::Deployment; + + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var tmp1 = orb->string_to_object(server_1); + CORBA::Object_var tmp2 = orb->string_to_object(server_2); + + ComponentServer_var server1 (ComponentServer::_narrow (tmp1)), + server2 (ComponentServer::_narrow (tmp2)); + + if (CORBA::is_nil (server1.in ()) || + CORBA::is_nil (server1.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Nil componentserver references"), -1); + } + + Components::Deployment::Container_var tmp = server1->create_container (0); + Container_var cont1a = Container::_narrow (tmp.in ()); + if (CORBA::is_nil (cont1a.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", + tmp.in (), cont1a.in ())); + return -1; + } + ACE_ERROR ((LM_DEBUG, "Got container from server 1a\n")); + + Container_var cont1b = Container::_narrow (server1->create_container (0)); + if (CORBA::is_nil (cont1b.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from second create op on server 1\n")); + return -1; + } + ACE_ERROR ((LM_DEBUG, "Got container from server 1b\n")); + + Container_var cont2a = Container::_narrow (server2->create_container (0)); + if (CORBA::is_nil (cont2a.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 2\n")); + return -1; + } + ACE_ERROR ((LM_DEBUG, "Got container from server 2a\n")); + + try + { + server2->remove_container (cont1a); + ACE_ERROR ((LM_ERROR, "Error: remove_container removed a container not belonging to the component server\n")); + } + catch (const ::Components::RemoveFailure &) + { + ACE_DEBUG ((LM_DEBUG, "Server 2 Refused to remove container it didn't own\n")); + // expected + } + + ::Components::Deployment::Containers_var cses = server1->get_containers (); + + if (cses->length () != 2) + ACE_ERROR ((LM_ERROR, "Error: get_containers returned the wrong number of containers, %u should be 2\n", + cses->length ())); + else ACE_DEBUG ((LM_DEBUG, "Got %u containers\n", cses->length ())); + + server1->remove_container (cont1a); + ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1a\n")); + + cses = server1->get_containers (); + + if (cses->length () != 1) + ACE_ERROR ((LM_ERROR, "Error: get_containers returned %u containers after removal, should be 1\n", + cses->length ())); + + server2->remove_container (cont2a); + ACE_DEBUG ((LM_DEBUG, "Successfully removed container 2a\n")); + server1->remove_container (cont1b); + ACE_DEBUG ((LM_DEBUG, "Successfully removed container 1b\n")); + + server1->remove (); + server1->shutdown (); + server2->remove (); + server2->shutdown (); + + orb->destroy (); + } + catch (const ::Components::CreateFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); + } + catch (const ::Components::RemoveFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); + } + return 0; +} diff --git a/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl b/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl new file mode 100755 index 00000000000..5bfd678b9dd --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/Basic/run_test.pl @@ -0,0 +1,99 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; +$ciao_root = "$ENV{CIAO_ROOT}"; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $target = PerlACE::TestTarget::create_target ($PerlACE::TestConfig); +my $host = new PerlACE::TestTarget; + +$iorbase1 = "server1.ior"; +$iorbase2 = "server2.ior"; +$ior1 = $target->LocalFile ("$iorbase"); +$ior2 = $target->LocalFile ("$iorbase"); +$target->DeleteFile($iorfile1); +$target->DeleteFile($iorfile2); +$host->DeleteFile($iorbase1); +$host->DeleteFile($iorbase2); + +if (PerlACE::is_vxworks_test()) { + $SV1 = new PerlACE::ProcessVX ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $iorbase1 -o $iorbase1"); + $SV2 = new PerlACE::ProcessVX ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $iorbase2 -o $iorbase2"); +} +else { + $SV1 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $iorbase1 -o $iorbase1"); + $SV2 = $target->CreateProcess ("$ciao_root/bin/ciao_componentserver", "-ORBDebuglevel $debug_level -u $iorbase2 -o $iorbase2"); +} +$CL = $host->CreateProcess ("client", "-k file://$iorbase1 -j file://$iorbase2"); + +$server1 = $SV1->Spawn (); +$server2 = $SV2->Spawn (); + +if ($server1 != 0) { + print STDERR "ERROR: server1 returned $server\n"; + exit 1; +} +if ($server2 != 0) { + print STDERR "ERROR: server2 returned $server\n"; + exit 1; +} + +if ($target->WaitForFileTimed ($iorbase1, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile1>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} +if ($target->WaitForFileTimed ($iorbase2, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR "ERROR: cannot find file <$iorfile2>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +if ($target->GetFile ($iorfile1, $iorbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$iorfile1>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +}if ($target->GetFile ($iorfile2, $iorbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$iorfile2>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV1->WaitKill (10); +$server = $SV2->WaitKill (10); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +$target->GetStderrLog(); + +$target->DeleteFile($iorfile); +$host->DeleteFile ($iorbase); + +exit $status; diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.cidl b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.cidl new file mode 100644 index 00000000000..fdb4793712b --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.cidl @@ -0,0 +1,11 @@ +// $Id$ +#include "SimpleComponent.idl" + +composition session SimpleComponent_Impl +{ + home executor SimpleComponent_Exec + { + implements Foo::SimpleHome; + manages Simple_Exec; + }; +}; diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl new file mode 100644 index 00000000000..dcf676fb276 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.idl @@ -0,0 +1,21 @@ +//$Id$ + +#include <Components.idl> + +module Foo +{ + interface Simple + { + void trigger (); + }; + + component SimpleComponent supports Simple + { + readonly attribute string creationtype_; + }; + + home SimpleHome manages SimpleComponent + { + }; +}; + diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc new file mode 100644 index 00000000000..efe6391f01c --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent.mpc @@ -0,0 +1,124 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl SimpleComponent" + +project(SimpleComponent_idl_gen) : taoidldefaults, anytypecode { + avoids += ace_for_tao + custom_only = 1 + idlflags += -Wb,stub_export_macro=SIMPLECOMPONENT_STUB_Export \ + -Wb,stub_export_include=SimpleComponent_stub_export.h \ + -Wb,skel_export_macro=SIMPLECOMPONENT_SVNT_Export \ + -Wb,skel_export_include=SimpleComponent_svnt_export.h + + IDL_Files { + SimpleComponent.idl + } +} + +project(SimpleComponent_cidl_gen) : ciaocidldefaults, taoidldefaults { + avoids += ace_for_tao + custom_only = 1 + cidlflags += --svnt-export-macro SIMPLECOMPONENT_SVNT_Export \ + --svnt-export-include SimpleComponent_svnt_export.h +// idlflags += -Wb,export_macro=SIMPLECOMPONENT_EXEC_Export \ +// -Wb,export_include=SimpleComponent_exec_export.h \ +// -SS + + CIDL_Files { + SimpleComponent.cidl + } + + IDL_Files { + SimpleComponentE.idl + } +} + +project(SimpleComponent_stub) : ccm_stub { + avoids += ace_for_tao + after += SimpleComponent_idl_gen + libs += + + sharedname = SimpleComponent_stub + dynamicflags = SIMPLECOMPONENT_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleComponentC.cpp + } + + Header_Files { + SimpleComponentC.h + SimpleComponent_stub_export.h + } + + Inline_Files { + SimpleComponentC.inl + } +} + +project(SimpleComponent_exec) : ciao_executor { + avoids += ace_for_tao + after += SimpleComponent_cidl_gen + sharedname = SimpleComponent_exec + libs += SimpleComponent_stub + + dynamicflags = SIMPLECOMPONENT_EXEC_BUILD_DLL + + IDL_Files { + } + + Source_Files { + SimpleComponentEC.cpp + SimpleComponent_exec.cpp + } + + Header_Files { + SimpleComponentEC.h + SimpleComponent_exec.h + SimpleComponent_exec_export.h + } + + Inline_Files { + SimpleComponentEC.inl + } +} + + +project(SimpleComponent_svnt) : ciao_servant { + avoids += ace_for_tao + sharedname = SimpleComponent_svnt + libs += SimpleComponent_stub + after += SimpleComponent_stub SimpleComponent_cidl_gen + dynamicflags = SIMPLECOMPONENT_SVNT_BUILD_DLL + + CIDL_Files { + } + IDL_Files { + } + Source_Files { + SimpleComponentS.cpp + SimpleComponentEC.cpp + SimpleComponent_svnt.cpp + } + + Header_Files { + SimpleComponentS.h + SimpleComponent_svnt.h + SimpleComponent_svnt_export.h + } + + Inline_Files { + SimpleComponentS.inl + } +} + +project (SimpleComponent_CIAOComponentServer_Test) : ciao_componentserver_stub, ccm_configvalue, ciao_cs_client { + after += SimpleComponent_stub SimpleComponent_svnt + libs += SimpleComponent_stub CIAO_Logger + IDL_Files { + } + Source_Files { + client.cpp + } +} diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp new file mode 100644 index 00000000000..844c72243f0 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.cpp @@ -0,0 +1,149 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "SimpleComponent_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIDL_SimpleComponent_Impl +{ + //================================================================== + // Component Executor Implementation Class: SimpleComponent_exec_i + //================================================================== + + SimpleComponent_exec_i::SimpleComponent_exec_i (const char *type) + : type_ (CORBA::string_dup (type)) + { + } + + SimpleComponent_exec_i::~SimpleComponent_exec_i (void) + { + } + + // Supported or inherited operations. + + void + SimpleComponent_exec_i::trigger () + { + ACE_DEBUG ((LM_EMERGENCY, "Hello, world!!!!!!!!\n")); + } + + // Attribute operations. + + char * + SimpleComponent_exec_i::creationtype_ () + { + return CORBA::string_dup (this->type_.in ()); + } + + // Port operations. + + // Operations from Components::SessionComponent + + void + SimpleComponent_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::Foo::CCM_SimpleComponent_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + SimpleComponent_exec_i::configuration_complete () + { + // Your code here. + } + + void + SimpleComponent_exec_i::ccm_activate () + { + // Your code here. + } + + void + SimpleComponent_exec_i::ccm_passivate () + { + // Your code here. + } + + void + SimpleComponent_exec_i::ccm_remove () + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: SimpleHome_exec_i + //================================================================== + + SimpleHome_exec_i::SimpleHome_exec_i (void) + { + CIAO_TRACE ("SimpleHome_exec_i::SimpleHome_exec_i"); + CIAO_DEBUG ((LM_NOTICE, CLINFO "SimpleHome_exec_i::SimpleHome_exec_i - " + "Home constructed\n")); + } + + SimpleHome_exec_i::~SimpleHome_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + SimpleHome_exec_i::create () + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + SimpleComponent_exec_i ("HomeCreated"), + ::CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Foo_SimpleHome_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + SimpleHome_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } +} + diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h new file mode 100644 index 00000000000..d16b157356b --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec.h @@ -0,0 +1,108 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_SIMPLECOMPONENT_EXEC_H +#define CIAO_SIMPLECOMPONENT_EXEC_H + +#include /**/ "ace/pre.h" + +#include "SimpleComponentEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "SimpleComponent_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIDL_SimpleComponent_Impl +{ + class SIMPLECOMPONENT_EXEC_Export SimpleComponent_exec_i + : public virtual Simple_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleComponent_exec_i (const char *CreateType); + virtual ~SimpleComponent_exec_i (void); + + // Supported or inherited operations. + + virtual void + trigger (); + + // Attribute operations. + + virtual char * + creationtype_ () + ; + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (); + + virtual void ccm_activate (); + + virtual void ccm_passivate (); + + virtual void ccm_remove (); + + private: + ::Foo::CCM_SimpleComponent_Context_var context_; + + CORBA::String_var type_; + + }; + + class SIMPLECOMPONENT_EXEC_Export SimpleHome_exec_i + : public virtual SimpleComponent_Exec, + public virtual ::CORBA::LocalObject + { + public: + SimpleHome_exec_i (void); + virtual ~SimpleHome_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create (); + }; + + extern "C" SIMPLECOMPONENT_EXEC_Export ::Components::HomeExecutorBase_ptr + create_Foo_SimpleHome_Impl (void); +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_SIMPLECOMPONENT_EXEC_H */ + diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec_export.h b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec_export.h new file mode 100644 index 00000000000..add746da8f5 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECOMPONENT_EXEC +// ------------------------------ +#ifndef SIMPLECOMPONENT_EXEC_EXPORT_H +#define SIMPLECOMPONENT_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECOMPONENT_EXEC_HAS_DLL) +# define SIMPLECOMPONENT_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECOMPONENT_EXEC_HAS_DLL */ + +#if !defined (SIMPLECOMPONENT_EXEC_HAS_DLL) +# define SIMPLECOMPONENT_EXEC_HAS_DLL 1 +#endif /* ! SIMPLECOMPONENT_EXEC_HAS_DLL */ + +#if defined (SIMPLECOMPONENT_EXEC_HAS_DLL) && (SIMPLECOMPONENT_EXEC_HAS_DLL == 1) +# if defined (SIMPLECOMPONENT_EXEC_BUILD_DLL) +# define SIMPLECOMPONENT_EXEC_Export ACE_Proper_Export_Flag +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECOMPONENT_EXEC_BUILD_DLL */ +# define SIMPLECOMPONENT_EXEC_Export ACE_Proper_Import_Flag +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECOMPONENT_EXEC_BUILD_DLL */ +#else /* SIMPLECOMPONENT_EXEC_HAS_DLL == 1 */ +# define SIMPLECOMPONENT_EXEC_Export +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARATION(T) +# define SIMPLECOMPONENT_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECOMPONENT_EXEC_HAS_DLL == 1 */ + +// Set SIMPLECOMPONENT_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECOMPONENT_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECOMPONENT_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECOMPONENT_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECOMPONENT_EXEC_NTRACE */ + +#if (SIMPLECOMPONENT_EXEC_NTRACE == 1) +# define SIMPLECOMPONENT_EXEC_TRACE(X) +#else /* (SIMPLECOMPONENT_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECOMPONENT_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECOMPONENT_EXEC_NTRACE == 1) */ + +#endif /* SIMPLECOMPONENT_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_stub_export.h b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_stub_export.h new file mode 100644 index 00000000000..eb8cb7a6c97 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECOMPONENT_STUB +// ------------------------------ +#ifndef SIMPLECOMPONENT_STUB_EXPORT_H +#define SIMPLECOMPONENT_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECOMPONENT_STUB_HAS_DLL) +# define SIMPLECOMPONENT_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECOMPONENT_STUB_HAS_DLL */ + +#if !defined (SIMPLECOMPONENT_STUB_HAS_DLL) +# define SIMPLECOMPONENT_STUB_HAS_DLL 1 +#endif /* ! SIMPLECOMPONENT_STUB_HAS_DLL */ + +#if defined (SIMPLECOMPONENT_STUB_HAS_DLL) && (SIMPLECOMPONENT_STUB_HAS_DLL == 1) +# if defined (SIMPLECOMPONENT_STUB_BUILD_DLL) +# define SIMPLECOMPONENT_STUB_Export ACE_Proper_Export_Flag +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECOMPONENT_STUB_BUILD_DLL */ +# define SIMPLECOMPONENT_STUB_Export ACE_Proper_Import_Flag +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECOMPONENT_STUB_BUILD_DLL */ +#else /* SIMPLECOMPONENT_STUB_HAS_DLL == 1 */ +# define SIMPLECOMPONENT_STUB_Export +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARATION(T) +# define SIMPLECOMPONENT_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECOMPONENT_STUB_HAS_DLL == 1 */ + +// Set SIMPLECOMPONENT_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECOMPONENT_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECOMPONENT_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECOMPONENT_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECOMPONENT_STUB_NTRACE */ + +#if (SIMPLECOMPONENT_STUB_NTRACE == 1) +# define SIMPLECOMPONENT_STUB_TRACE(X) +#else /* (SIMPLECOMPONENT_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECOMPONENT_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECOMPONENT_STUB_NTRACE == 1) */ + +#endif /* SIMPLECOMPONENT_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_svnt_export.h b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_svnt_export.h new file mode 100644 index 00000000000..694af85e994 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/SimpleComponent_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl SIMPLECOMPONENT_SVNT +// ------------------------------ +#ifndef SIMPLECOMPONENT_SVNT_EXPORT_H +#define SIMPLECOMPONENT_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (SIMPLECOMPONENT_SVNT_HAS_DLL) +# define SIMPLECOMPONENT_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && SIMPLECOMPONENT_SVNT_HAS_DLL */ + +#if !defined (SIMPLECOMPONENT_SVNT_HAS_DLL) +# define SIMPLECOMPONENT_SVNT_HAS_DLL 1 +#endif /* ! SIMPLECOMPONENT_SVNT_HAS_DLL */ + +#if defined (SIMPLECOMPONENT_SVNT_HAS_DLL) && (SIMPLECOMPONENT_SVNT_HAS_DLL == 1) +# if defined (SIMPLECOMPONENT_SVNT_BUILD_DLL) +# define SIMPLECOMPONENT_SVNT_Export ACE_Proper_Export_Flag +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* SIMPLECOMPONENT_SVNT_BUILD_DLL */ +# define SIMPLECOMPONENT_SVNT_Export ACE_Proper_Import_Flag +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* SIMPLECOMPONENT_SVNT_BUILD_DLL */ +#else /* SIMPLECOMPONENT_SVNT_HAS_DLL == 1 */ +# define SIMPLECOMPONENT_SVNT_Export +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARATION(T) +# define SIMPLECOMPONENT_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* SIMPLECOMPONENT_SVNT_HAS_DLL == 1 */ + +// Set SIMPLECOMPONENT_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (SIMPLECOMPONENT_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define SIMPLECOMPONENT_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define SIMPLECOMPONENT_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !SIMPLECOMPONENT_SVNT_NTRACE */ + +#if (SIMPLECOMPONENT_SVNT_NTRACE == 1) +# define SIMPLECOMPONENT_SVNT_TRACE(X) +#else /* (SIMPLECOMPONENT_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define SIMPLECOMPONENT_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (SIMPLECOMPONENT_SVNT_NTRACE == 1) */ + +#endif /* SIMPLECOMPONENT_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp new file mode 100644 index 00000000000..ec2244fd48e --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/client.cpp @@ -0,0 +1,174 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ciao/ComponentServer/CIAO_CS_ClientS.h" +#include "ciao/ComponentServer/CIAO_ComponentServerC.h" +#include "ciao/ComponentServer/CIAO_ServerActivator_Impl.h" +#include "ciao/ComponentServer/CIAO_PropertiesC.h" +#include "ciao/Valuetype_Factories/ConfigValue.h" +#include "ciao/Logger/Logger_Service.h" + +#include "SimpleComponentC.h" + +const char *cs_path = "ciao_componentserver"; +CORBA::ULong spawn_delay = 30; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "s:d:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 's': + cs_path = get_opts.opt_arg (); + break; + + case 'd': + spawn_delay = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-s <path> " + "-d <uint> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +ACE_TMAIN (int argc, ACE_TCHAR **argv) +{ + using namespace CIAO::Deployment; + + CIAO::Logger_Service logger; + + logger.init (argc, argv); + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var object = + orb->resolve_initial_references ("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (object.in ()); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + poa_manager->activate (); + ACE_DEBUG ((LM_DEBUG, "foo\n")); + + CIAO_ServerActivator_i *sa_tmp = new CIAO_ServerActivator_i (spawn_delay, + cs_path, + 0, + false, + orb.in (), + root_poa.in ()); + ACE_DEBUG ((LM_DEBUG, "bar\n")); + + PortableServer::ServantBase_var safe = sa_tmp; + + ServerActivator_var sa = sa_tmp->_this (); + + //ACE_DEBUG ((LM_DEBUG, "Attempting to create componentserver with no configvalues\n")); + // Make a componentserver with no configvalues + ComponentServer_var server1 (ComponentServer::_narrow (sa->create_component_server (0))); + + if (CORBA::is_nil (server1.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Nil componentserver references"), -1); + } + + Components::Deployment::Container_var tmp = server1->create_container (0); + Container_var cont1a = Container::_narrow (tmp.in ()); + + if (CORBA::is_nil (cont1a.in ())) + { + ACE_ERROR ((LM_ERROR, "Error: Got nil object reference from first create op on server 1 %u %u\n", + tmp.in (), cont1a.in ())); + return -1; + } + + // Make our configvalues + // ::Components::ConfigValues_var configs = new + CORBA::Any val; + ::Components::ConfigValues configs(3); + configs.length (3); + + val <<= "create_Foo_SimpleHome_Servant"; + configs[0] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ENTRYPT, + val); + val <<= "SimpleComponent_svnt"; + configs[1] = new CIAO::ConfigValue_impl (CIAO::Deployment::SVNT_ARTIFACT, + val); + val <<= "SimpleComponent_exec"; + configs[2] = new CIAO::ConfigValue_impl (CIAO::Deployment::EXEC_ARTIFACT, + val); + + // Install Home + Components::CCMHome_var home = cont1a->install_home ("MyNameIsEarl", + "create_Foo_SimpleHome_Impl", + configs); + + if (CORBA::is_nil (home)) + { + ACE_ERROR ((LM_ERROR, "Got back a nil home ref from install_home\n")); + return -1; + } + + Foo::SimpleHome_var shome = Foo::SimpleHome::_narrow (home.in ()); + + if (CORBA::is_nil (shome)) + { + ACE_ERROR ((LM_ERROR, "Narrow failed from CCM_Home to SimpleHome\n")); + return -1; + } + + + Foo::SimpleComponent_var sc = shome->create (); + + if (CORBA::is_nil (sc)) + { + ACE_ERROR ((LM_ERROR, "Home failed to make a component\n ")); + return -1; + } + + sc->trigger (); + + cont1a->remove_home (home.in ()); + + server1->remove_container (cont1a.in ()); + + //ACE_DEBUG ((LM_DEBUG, "Removing component server\n")); + sa->remove_component_server (server1.in ()); + //ACE_DEBUG ((LM_DEBUG, "Componentserver removed\n")); + + orb->destroy (); + } + catch (::Components::CreateFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught CreateFailure exception.\n")); + } + catch (::Components::RemoveFailure &) + { + ACE_ERROR ((LM_ERROR, "Error: Caught RemoveFailure exception.\n")); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Error: Caught unknown exception\n")); + } + return 0; +} diff --git a/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl new file mode 100755 index 00000000000..847e8ba1032 --- /dev/null +++ b/CIAO/tests/CIAO_ComponentServer/SimpleComponent/run_test.pl @@ -0,0 +1,44 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use PerlACE::TestTarget; + +$status = 0; +$debug_level = '0'; +$ciao_root = "$ENV{CIAO_ROOT}"; + +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} + +my $target = PerlACE::TestTarget::create_target ($PerlACE::TestConfig); +my $host = new PerlACE::TestTarget; + +if (PerlACE::is_vxworks_test()) { + $SV1 = new PerlACE::ProcessVX ("client", "-ORBDebuglevel $debug_level -s $ciao_root/bin/ciao_componentserver -d 120"); +} +else { + $SV1 = $target->CreateProcess ("client", "-ORBDebuglevel $debug_level -s $ciao_root/bin/ciao_componentserver -d 120"); +} + +$server1 = $SV1->SpawnWaitKill (300); + +if ($server1 != 0) { + print STDERR "ERROR: server1 returned $server\n"; + exit 1; +} + +$target->GetStderrLog(); + +$target->DeleteFile($iorfile); +$host->DeleteFile ($iorbase); + +exit $status; diff --git a/CIAO/tests/CIDL/CodeGen/Basic.mpc b/CIAO/tests/CIDL/CodeGen/Basic.mpc index 6af5b4e0a64..5200dfe1a72 100644 --- a/CIAO/tests/CIDL/CodeGen/Basic.mpc +++ b/CIAO/tests/CIDL/CodeGen/Basic.mpc @@ -14,7 +14,7 @@ project(Basic_idl_gen) : taoidldefaults, anytypecode { } } -project(Basic_stub) : ciao_client_dnc { +project(Basic_stub) : ccm_stub { avoids += ace_for_tao after += Basic_idl_gen libs += @@ -40,7 +40,7 @@ project(Basic_stub) : ciao_client_dnc { } -project(Basic_skel) : ciao_component_dnc { +project(Basic_skel) : ciao_executor { avoids += ace_for_tao after += Basic_stub sharedname = Basic_skel diff --git a/CIAO/tests/CIDL/CodeGen/CodeGen.mpc b/CIAO/tests/CIDL/CodeGen/CodeGen.mpc index f4b48e3ec75..52cc3eb15b0 100644 --- a/CIAO/tests/CIDL/CodeGen/CodeGen.mpc +++ b/CIAO/tests/CIDL/CodeGen/CodeGen.mpc @@ -38,7 +38,7 @@ project(Basic_CodeGen_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Basic_CodeGen_stub) : ciao_client_dnc { +project(Basic_CodeGen_stub) : ccm_stub { avoids += ace_for_tao after += Basic_CodeGen_idl_gen Basic_stub libs += Basic_stub @@ -63,7 +63,7 @@ project(Basic_CodeGen_stub) : ciao_client_dnc { } } -project(Basic_CodeGen_exec) : ciao_component_dnc { +project(Basic_CodeGen_exec) : ciao_executor { avoids += ace_for_tao after += Basic_CodeGen_cidl_gen Basic_CodeGen_stub sharedname = CodeGen_exec @@ -91,7 +91,7 @@ project(Basic_CodeGen_exec) : ciao_component_dnc { } -project(Basic_CodeGen_svnt) : ciao_servant_dnc { +project(Basic_CodeGen_svnt) : ciao_servant { avoids += ace_for_tao after += Basic_skel Basic_CodeGen_exec sharedname = CodeGen_svnt diff --git a/CIAO/tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc b/CIAO/tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc index 9776b118333..eea659666a3 100644 --- a/CIAO/tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc +++ b/CIAO/tests/IDL3/Components/ComplexComponent/Attributes/Attributes.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Attributes" -project(Attributes_stub): ciao_client_dnc { +project(Attributes_stub): ccm_stub { sharedname = Attributes_stub idlflags += -Wb,stub_export_macro=ATTRIBUTES_STUB_Export -Wb,stub_export_include=Attributes_stub_export.h -Wb,skel_export_macro=ATTRIBUTES_SVNT_Export -Wb,skel_export_include=Attributes_svnt_export.h diff --git a/CIAO/tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc b/CIAO/tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc index 918c9d56747..79ca1898fd6 100644 --- a/CIAO/tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc +++ b/CIAO/tests/IDL3/Components/ComplexComponent/EventSink/EventSink.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n EventSink" -project(EventSink_stub): ciao_client_dnc { +project(EventSink_stub): ccm_stub { sharedname = EventSink_stub idlflags += -Wb,stub_export_macro=EVENTSINK_STUB_Export -Wb,stub_export_include=EventSink_stub_export.h -Wb,skel_export_macro=EVENTSINK_SVNT_Export -Wb,skel_export_include=EventSink_svnt_export.h diff --git a/CIAO/tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc b/CIAO/tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc index 71995df3a31..5f81314a9cf 100644 --- a/CIAO/tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc +++ b/CIAO/tests/IDL3/Components/ComplexComponent/EventSource/EventSource.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n EventSource" -project(EventSource_stub): ciao_client_dnc { +project(EventSource_stub): ccm_stub { sharedname = EventSource_stub idlflags += -Wb,stub_export_macro=EVENTSOURCE_STUB_Export -Wb,stub_export_include=EventSource_stub_export.h -Wb,skel_export_macro=EVENTSOURCE_SVNT_Export -Wb,skel_export_include=EventSource_svnt_export.h diff --git a/CIAO/tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc b/CIAO/tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc index 0e60e3be139..ab3da28df3d 100644 --- a/CIAO/tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc +++ b/CIAO/tests/IDL3/Components/ComplexComponent/Facets/Facets.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Facets" -project(Facets_stub): ciao_client_dnc { +project(Facets_stub): ccm_stub { sharedname = Facets_stub idlflags += -Wb,stub_export_macro=FACETS_STUB_Export -Wb,stub_export_include=Facets_stub_export.h -Wb,skel_export_macro=FACETS_SVNT_Export -Wb,skel_export_include=Facets_svnt_export.h diff --git a/CIAO/tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc b/CIAO/tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc index 78dd6b6978b..e79c107eb67 100644 --- a/CIAO/tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc +++ b/CIAO/tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Receptacles" -project(Receptacles_stub): ciao_client_dnc { +project(Receptacles_stub): ccm_stub { sharedname = Receptacles_stub idlflags += -Wb,stub_export_macro=RECEPTACLES_STUB_Export -Wb,stub_export_include=Receptacles_stub_export.h -Wb,skel_export_macro=RECEPTACLES_SVNT_Export -Wb,skel_export_include=Receptacles_svnt_export.h diff --git a/CIAO/tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc b/CIAO/tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc index df62e90c6da..1605b93deaa 100644 --- a/CIAO/tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc +++ b/CIAO/tests/IDL3/Components/SimpleComponent/SimpleComponent.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl SimpleComponent" -project(SimpleComponent_stub): ciao_client_dnc { +project(SimpleComponent_stub_idl3): ccm_stub { sharedname = SimpleComponent_stub idlflags += -Wb,stub_export_macro=SIMPLECOMPONENT_STUB_Export -Wb,stub_export_include=SimpleComponent_stub_export.h -Wb,skel_export_macro=SIMPLECOMPONENT_SVNT_Export -Wb,skel_export_include=SimpleComponent_svnt_export.h diff --git a/CIAO/tests/IDL3/Events/Abstract/Abstract.mpc b/CIAO/tests/IDL3/Events/Abstract/Abstract.mpc index e1a4a36cc54..83d67de5f39 100644 --- a/CIAO/tests/IDL3/Events/Abstract/Abstract.mpc +++ b/CIAO/tests/IDL3/Events/Abstract/Abstract.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Abstract" -project(Abstract_stub): ciao_client_dnc { +project(Abstract_stub): ccm_stub { sharedname = Abstract_stub idlflags += -Wb,stub_export_macro=ABSTRACT_STUB_Export -Wb,stub_export_include=Abstract_stub_export.h -Wb,skel_export_macro=ABSTRACT_SVNT_Export -Wb,skel_export_include=Abstract_svnt_export.h diff --git a/CIAO/tests/IDL3/Events/Any/Any.mpc b/CIAO/tests/IDL3/Events/Any/Any.mpc index d0b72182ca1..1d95ba0b319 100644 --- a/CIAO/tests/IDL3/Events/Any/Any.mpc +++ b/CIAO/tests/IDL3/Events/Any/Any.mpc @@ -1,6 +1,6 @@ // $Id$ -project(EventAny_local): ciao_client_dnc { +project(EventAny_local): ccm_stub { exename = EventAny idlflags += -SS diff --git a/CIAO/tests/IDL3/Events/Regular/Regular.mpc b/CIAO/tests/IDL3/Events/Regular/Regular.mpc index 1ff6519f0ca..6186490384c 100644 --- a/CIAO/tests/IDL3/Events/Regular/Regular.mpc +++ b/CIAO/tests/IDL3/Events/Regular/Regular.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Regular" -project(Regular_stub): ciao_client_dnc { +project(Regular_stub): ccm_stub { sharedname = Regular_stub idlflags += -Wb,stub_export_macro=REGULAR_STUB_Export \ diff --git a/CIAO/tests/IDL3/Homes/Attributes/HomeAttributes.mpc b/CIAO/tests/IDL3/Homes/Attributes/HomeAttributes.mpc index 4105b180342..063c212b83a 100644 --- a/CIAO/tests/IDL3/Homes/Attributes/HomeAttributes.mpc +++ b/CIAO/tests/IDL3/Homes/Attributes/HomeAttributes.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n HomeAttributes" -project(HomeAttributes_stub): ciao_client_dnc { +project(HomeAttributes_stub): ccm_stub { sharedname = HomeAttributes_stub idlflags += -Wb,stub_export_macro=HOMEATTRIBUTES_STUB_Export -Wb,stub_export_include=HomeAttributes_stub_export.h -Wb,skel_export_macro=HOMEATTRIBUTES_SVNT_Export -Wb,skel_export_include=HomeAttributes_svnt_export.h diff --git a/CIAO/tests/IDL3/Homes/Basic/Basic.mpc b/CIAO/tests/IDL3/Homes/Basic/Basic.mpc index c79cf8c919b..f676e9d9b70 100644 --- a/CIAO/tests/IDL3/Homes/Basic/Basic.mpc +++ b/CIAO/tests/IDL3/Homes/Basic/Basic.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Basic" -project(IDL3_Basic_stub): ciao_client_dnc { +project(IDL3_Basic_stub): ccm_stub { sharedname = Homes_Basic_stub idlflags += -Wb,stub_export_macro=BASIC_STUB_Export -Wb,stub_export_include=Basic_stub_export.h -Wb,skel_export_macro=BASIC_SVNT_Export -Wb,skel_export_include=Basic_svnt_export.h diff --git a/CIAO/tests/IDL3/Homes/Factory/Factory.mpc b/CIAO/tests/IDL3/Homes/Factory/Factory.mpc index c861d0df611..90aed185da2 100644 --- a/CIAO/tests/IDL3/Homes/Factory/Factory.mpc +++ b/CIAO/tests/IDL3/Homes/Factory/Factory.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Factory" -project(Factory_stub): ciao_client_dnc { +project(Factory_stub): ccm_stub { sharedname = Factory_stub idlflags += -Wb,stub_export_macro=FACTORY_STUB_Export -Wb,stub_export_include=Factory_stub_export.h -Wb,skel_export_macro=FACTORY_SVNT_Export -Wb,skel_export_include=Factory_svnt_export.h diff --git a/CIAO/tests/IDL3/Homes/Finder/Finder.mpc b/CIAO/tests/IDL3/Homes/Finder/Finder.mpc index 9881aad88f1..ce99a021e6f 100644 --- a/CIAO/tests/IDL3/Homes/Finder/Finder.mpc +++ b/CIAO/tests/IDL3/Homes/Finder/Finder.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Finder" -project(Finder_stub): ciao_client_dnc { +project(Finder_stub): ccm_stub { sharedname = Finder_stub idlflags += -Wb,stub_export_macro=FINDER_STUB_Export -Wb,stub_export_include=Finder_stub_export.h -Wb,skel_export_macro=FINDER_SVNT_Export -Wb,skel_export_include=Finder_svnt_export.h diff --git a/CIAO/tests/IDL3/Homes/Inheritance/Inheritance.mpc b/CIAO/tests/IDL3/Homes/Inheritance/Inheritance.mpc index 6faf9f0b6cc..cd467329b2c 100644 --- a/CIAO/tests/IDL3/Homes/Inheritance/Inheritance.mpc +++ b/CIAO/tests/IDL3/Homes/Inheritance/Inheritance.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Inheritance" -project(Inheritance_stub): ciao_client_dnc { +project(Inheritance_stub): ccm_stub { sharedname = Inheritance_stub idlflags += -Wb,stub_export_macro=INHERITANCE_STUB_Export -Wb,stub_export_include=Inheritance_stub_export.h -Wb,skel_export_macro=INHERITANCE_SVNT_Export -Wb,skel_export_include=Inheritance_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/All/all.mpc b/CIAO/tests/IDL3/ImpliedIDL/All/all.mpc index 11ff84fe44a..26f558c7f04 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/All/all.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/All/all.mpc @@ -1,7 +1,7 @@ // -*- MPC -*- // $Id$ -project(ConvertIDL3) : taoidl3toidl2defaults, ciao_component_dnc { +project(ConvertIDL3) : taoidl3toidl2defaults, ciao_executor { idlflags += -Sm IDL3TOIDL2_Files { diff --git a/CIAO/tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc b/CIAO/tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc index c1767d3310f..854538563d0 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Components/Basic/ICBasic.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n ICBasic" -project(ICBasic_stub): ciao_client_dnc { +project(ICBasic_stub): ccm_stub { sharedname = ICBasic_stub idlflags += -Wb,stub_export_macro=ICBASIC_STUB_Export -Wb,stub_export_include=ICBasic_stub_export.h -Wb,skel_export_macro=ICBASIC_SVNT_Export -Wb,skel_export_include=ICBasic_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc b/CIAO/tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc index ac7b02caf97..e9381d014b2 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n ICEventSink" -project(ICEventSink_stub): ciao_client_dnc { +project(ICEventSink_stub): ccm_stub { sharedname = ICEventSink_stub idlflags += -Wb,stub_export_macro=ICEVENTSINK_STUB_Export -Wb,stub_export_include=ICEventSink_stub_export.h -Wb,skel_export_macro=ICEVENTSINK_SVNT_Export -Wb,skel_export_include=ICEventSink_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc b/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc index b8eaded62c5..123083e4d3f 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n ICEventSource" -project(ICEventSource_stub): ciao_client_dnc { +project(ICEventSource_stub): ccm_stub { sharedname = ICEventSource_stub idlflags += -Wb,stub_export_macro=ICEVENTSOURCE_STUB_Export -Wb,stub_export_include=ICEventSource_stub_export.h -Wb,skel_export_macro=ICEVENTSOURCE_SVNT_Export -Wb,skel_export_include=ICEventSource_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc b/CIAO/tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc index 9ab64c3df92..cc1f610892c 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n ICReceptacles" -project(ICReceptacles_stub): ciao_client_dnc { +project(ICReceptacles_stub): ccm_stub { sharedname = ICReceptacles_stub idlflags += -Wb,stub_export_macro=ICRECEPTACLES_STUB_Export -Wb,stub_export_include=ICReceptacles_stub_export.h -Wb,skel_export_macro=ICRECEPTACLES_SVNT_Export -Wb,skel_export_include=ICReceptacles_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/Events/Events.mpc b/CIAO/tests/IDL3/ImpliedIDL/Events/Events.mpc index c5b51e417c4..4200e384e0a 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Events/Events.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Events/Events.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Events" -project(Events_stub): ciao_client_dnc { +project(Events_stub): ccm_stub { sharedname = Events_stub idlflags += -Wb,stub_export_macro=EVENTS_STUB_Export -Wb,stub_export_include=Events_stub_export.h -Wb,skel_export_macro=EVENTS_SVNT_Export -Wb,skel_export_include=Events_svnt_export.h diff --git a/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.mpc b/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.mpc index 6865c71b120..bb6b96ca281 100644 --- a/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.mpc +++ b/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Homes" -project(Homes_stub): ciao_client_dnc { +project(Homes_stub): ccm_stub { sharedname = Homes_stub idlflags += -Wb,stub_export_macro=HOMES_STUB_Export -Wb,stub_export_include=Homes_stub_export.h -Wb,skel_export_macro=HOMES_SVNT_Export -Wb,skel_export_include=Homes_svnt_export.h diff --git a/CIAO/tests/IDL3/Lookup/lookup_test.mpc b/CIAO/tests/IDL3/Lookup/lookup_test.mpc index 1449c788ea1..d257f0ccd9b 100644 --- a/CIAO/tests/IDL3/Lookup/lookup_test.mpc +++ b/CIAO/tests/IDL3/Lookup/lookup_test.mpc @@ -1,6 +1,6 @@ // $Id$ -project(LookupTest_stub): ciao_client_dnc { +project(LookupTest_stub): ccm_stub { sharedname = LookupTest_stub diff --git a/CIAO/tests/Minimum/Minimum_Base/Minimum_Base.mpc b/CIAO/tests/Minimum/Minimum_Base/Minimum_Base.mpc index 75e2d3d3229..2b1f254e7e9 100644 --- a/CIAO/tests/Minimum/Minimum_Base/Minimum_Base.mpc +++ b/CIAO/tests/Minimum/Minimum_Base/Minimum_Base.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Minimum_Base" -project(Minimum_Base_idl_gen) : taoidldefaults, anytypecode { +project(Minimum_Base_idl_gen) : taoidldefaults, anytypecode, ccm { avoids += ace_for_tao custom_only = 1 idlflags += -Wb,stub_export_macro=MINIMUM_BASE_STUB_Export \ @@ -14,7 +14,7 @@ project(Minimum_Base_idl_gen) : taoidldefaults, anytypecode { } } -project(Minimum_Base_stub) : ciao_client_dnc { +project(Minimum_Base_stub) : ccm_stub { avoids += ace_for_tao after += Minimum_Base_idl_gen libs += @@ -40,7 +40,7 @@ project(Minimum_Base_stub) : ciao_client_dnc { } -project(Minimum_Base_skel) : ciao_component_dnc { +project(Minimum_Base_skel) : ccm_stub, portableserver { avoids += ace_for_tao after += Minimum_Base_stub sharedname = Minimum_Base_skel diff --git a/CIAO/tests/Minimum/Receiver/Receiver.mpc b/CIAO/tests/Minimum/Receiver/Receiver.mpc index fe8a6d90184..bd9b16a76c1 100644 --- a/CIAO/tests/Minimum/Receiver/Receiver.mpc +++ b/CIAO/tests/Minimum/Receiver/Receiver.mpc @@ -19,9 +19,12 @@ project(Minimum_Base_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { custom_only = 1 cidlflags += --svnt-export-macro RECEIVER_SVNT_Export \ --svnt-export-include Receiver_svnt_export.h - idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ - -Wb,export_include=Receiver_exec_export.h \ - -SS +// idlflags += -Wb,export_macro=RECEIVER_EXEC_Export \ +// -Wb,export_include=Receiver_exec_export.h \ +// -SS + + cidlflags += -I$(CIAO_ROOT)/ccm + CIDL_Files { Receiver.cidl @@ -32,12 +35,12 @@ project(Minimum_Base_Receiver_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Minimum_Base_Receiver_stub) : ciao_client_dnc { +project(Minimum_Base_Receiver_stub) : ccm_stub { avoids += ace_for_tao after += Minimum_Base_Receiver_idl_gen Minimum_Base_stub libs += Minimum_Base_stub - sharedname = Minimum_Receiver_stub + sharedname = Receiver_stub dynamicflags = RECEIVER_STUB_BUILD_DLL IDL_Files { @@ -57,11 +60,11 @@ project(Minimum_Base_Receiver_stub) : ciao_client_dnc { } } -project(Minimum_Base_Receiver_exec) : ciao_component_dnc { +project(Minimum_Base_Receiver_exec) : ciao_executor { avoids += ace_for_tao after += Minimum_Base_Receiver_cidl_gen Minimum_Base_Receiver_stub - sharedname = Minimum_Receiver_exec - libs += Minimum_Receiver_stub Minimum_Base_stub + sharedname = Receiver_exec + libs += Receiver_stub Minimum_Base_stub dynamicflags = RECEIVER_EXEC_BUILD_DLL @@ -85,12 +88,12 @@ project(Minimum_Base_Receiver_exec) : ciao_component_dnc { } -project(Minimum_Base_Receiver_svnt) : ciao_servant_dnc { +project(Minimum_Base_Receiver_svnt) : ciao_servant { avoids += ace_for_tao after += Minimum_Base_skel Minimum_Base_Receiver_exec - sharedname = Minimum_Receiver_svnt - libs += Minimum_Receiver_exec \ - Minimum_Receiver_stub \ + sharedname = Receiver_svnt + libs += Receiver_exec \ + Receiver_stub \ Minimum_Base_skel \ Minimum_Base_stub @@ -103,6 +106,7 @@ project(Minimum_Base_Receiver_svnt) : ciao_servant_dnc { } Source_Files { + ReceiverEC.cpp ReceiverS.cpp Receiver_svnt.cpp } diff --git a/CIAO/tests/Minimum/Receiver/Receiver_exec.cpp b/CIAO/tests/Minimum/Receiver/Receiver_exec.cpp index 042927969a6..2a3f5522ea0 100644 --- a/CIAO/tests/Minimum/Receiver/Receiver_exec.cpp +++ b/CIAO/tests/Minimum/Receiver/Receiver_exec.cpp @@ -57,13 +57,7 @@ namespace CIDL_Receiver_Impl } void - Receiver_exec_i::ciao_preactivate () - { - // Your code here. - } - - void - Receiver_exec_i::ciao_postactivate () + Receiver_exec_i::configuration_complete () { // Your code here. } diff --git a/CIAO/tests/Minimum/Receiver/Receiver_exec.h b/CIAO/tests/Minimum/Receiver/Receiver_exec.h index c32e9dd6028..458321260bd 100644 --- a/CIAO/tests/Minimum/Receiver/Receiver_exec.h +++ b/CIAO/tests/Minimum/Receiver/Receiver_exec.h @@ -54,9 +54,7 @@ namespace CIDL_Receiver_Impl set_session_context ( ::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); diff --git a/CIAO/tests/Minimum/Sender/Sender.mpc b/CIAO/tests/Minimum/Sender/Sender.mpc index 71de3f260cf..3a03dab2705 100644 --- a/CIAO/tests/Minimum/Sender/Sender.mpc +++ b/CIAO/tests/Minimum/Sender/Sender.mpc @@ -32,12 +32,12 @@ project(Minimum_Base_Sender_cidl_gen) : ciaocidldefaults, taoidldefaults { } } -project(Minimum_Base_Sender_stub) : ciao_client_dnc { +project(Minimum_Base_Sender_stub) : ccm_stub { avoids += ace_for_tao after += Minimum_Base_Sender_idl_gen Minimum_Base_stub libs += Minimum_Base_stub - sharedname = Minimum_Sender_stub + sharedname = Sender_stub dynamicflags = SENDER_STUB_BUILD_DLL IDL_Files { @@ -57,11 +57,11 @@ project(Minimum_Base_Sender_stub) : ciao_client_dnc { } } -project(Minimum_Base_Sender_exec) : ciao_component_dnc { +project(Minimum_Base_Sender_exec) : ciao_executor { avoids += ace_for_tao after += Minimum_Base_Sender_cidl_gen Minimum_Base_Sender_stub - sharedname = Minimum_Sender_exec - libs += Minimum_Sender_stub Minimum_Base_stub + sharedname = Sender_exec + libs += Sender_stub Minimum_Base_stub dynamicflags = SENDER_EXEC_BUILD_DLL @@ -85,12 +85,12 @@ project(Minimum_Base_Sender_exec) : ciao_component_dnc { } -project(Minimum_Base_Sender_svnt) : ciao_servant_dnc { +project(Minimum_Base_Sender_svnt) : ciao_servant { avoids += ace_for_tao after += Minimum_Base_skel Minimum_Base_Sender_exec - sharedname = Minimum_Sender_svnt - libs += Minimum_Sender_exec \ - Minimum_Sender_stub \ + sharedname = Sender_svnt + libs += Sender_exec \ + Sender_stub \ Minimum_Base_skel \ Minimum_Base_stub diff --git a/CIAO/tests/Minimum/Sender/Sender_exec.cpp b/CIAO/tests/Minimum/Sender/Sender_exec.cpp index f44adfcd8b5..d5505699245 100644 --- a/CIAO/tests/Minimum/Sender/Sender_exec.cpp +++ b/CIAO/tests/Minimum/Sender/Sender_exec.cpp @@ -63,13 +63,7 @@ namespace CIDL_Sender_Impl } void - Sender_exec_i::ciao_preactivate () - { - // Your code here. - } - - void - Sender_exec_i::ciao_postactivate () + Sender_exec_i::configuration_complete () { // Your code here. } diff --git a/CIAO/tests/Minimum/Sender/Sender_exec.h b/CIAO/tests/Minimum/Sender/Sender_exec.h index 833352ec0d0..be3081ecc42 100644 --- a/CIAO/tests/Minimum/Sender/Sender_exec.h +++ b/CIAO/tests/Minimum/Sender/Sender_exec.h @@ -57,9 +57,7 @@ namespace CIDL_Sender_Impl set_session_context ( ::Components::SessionContext_ptr ctx); - virtual void ciao_preactivate (); - - virtual void ciao_postactivate (); + virtual void configuration_complete (); virtual void ccm_activate (); diff --git a/CIAO/tools/Config_Handlers/ADD_Handler.cpp b/CIAO/tools/Config_Handlers/ADD_Handler.cpp index 05db95d8780..1b898b603d2 100644 --- a/CIAO/tools/Config_Handlers/ADD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/ADD_Handler.cpp @@ -16,16 +16,15 @@ namespace CIAO IDREF_Base<CORBA::ULong> ADD_Handler::IDREF; void - ADD_Handler::artifact_deployment_descrs ( - const DeploymentPlan &src, + ADD_Handler::artifact_deployment_descrs (const deploymentPlan &src, ::Deployment::ArtifactDeploymentDescriptions &dest) { CIAO_TRACE("ADD_Handler::atrifact_deployment_descrs"); - DeploymentPlan::artifact_const_iterator aci_e = + deploymentPlan::artifact_const_iterator aci_e = src.end_artifact (); dest.length (src.count_artifact ()); CORBA::ULong pos = 0; - for (DeploymentPlan::artifact_const_iterator aci_b = + for (deploymentPlan::artifact_const_iterator aci_b = src.begin_artifact (); aci_e != aci_b; ++aci_b) @@ -44,10 +43,10 @@ namespace CIAO CORBA::ULong pos) { CIAO_TRACE("ADD_Handler::atrifact_deployment_descr"); - dest.name = ACE_TEXT_ALWAYS_CHAR (src.name ().c_str ()); + dest.name = src.name ().c_str (); - dest.node = ACE_TEXT_ALWAYS_CHAR (src.node ().c_str ()); + dest.node = src.node ().c_str (); ArtifactDeploymentDescription::location_const_iterator end = src.end_location (); @@ -59,7 +58,7 @@ namespace CIAO start != end; ++start) { - dest.location[len++] = ACE_TEXT_ALWAYS_CHAR (start->c_str ()); + dest.location[len++] = start->c_str (); } ArtifactDeploymentDescription::source_const_iterator sce = @@ -71,7 +70,7 @@ namespace CIAO scb != sce; ++scb) { - dest.source[len++] = ACE_TEXT_ALWAYS_CHAR (scb->c_str ()); + dest.source[len++] = scb->c_str (); } // @@TODO: See this loop is repeated @@ -85,12 +84,12 @@ namespace CIAO ++adcb) { Property_Handler::handle_property ((*adcb), - dest.execParameter[len++]); + dest.execParameter[len++]); } - if (src.id_p ()) + if (src.xmi_id_p ()) { - ACE_CString cstr (ACE_TEXT_ALWAYS_CHAR (src.id ().c_str ())); + ACE_CString cstr (src.xmi_id ().c_str ()); ADD_Handler::IDREF.bind_ref (cstr,pos); } @@ -131,8 +130,8 @@ namespace CIAO { CIAO_TRACE("ADD_Handler::atrifact_deployment_descr - reverse"); //Get the name and node and store them in the add - XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); - XMLSchema::string< ACE_TCHAR > node (ACE_TEXT_CHAR_TO_TCHAR (src.node.in ())); + XMLSchema::string< char > name ((src.name)); + XMLSchema::string< char > node ((src.node)); ArtifactDeploymentDescription add (name,node); @@ -140,7 +139,7 @@ namespace CIAO size_t total = src.location.length (); for (size_t i = 0; i < total; ++i) { - XMLSchema::string< ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (src.location[i].in ())); + XMLSchema::string< char > curr ((src.location[i])); add.add_location (curr); } @@ -148,7 +147,7 @@ namespace CIAO total = src.source.length (); for (size_t j = 0; j < total; ++j) { - XMLSchema::string< ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (src.source[j].in ())); + XMLSchema::string< char > curr ((src.source[j])); add.add_source (curr); } @@ -165,12 +164,12 @@ namespace CIAO ACE_CString add_id ("_"); add_id += *uuid.to_string (); - XMLSchema::ID< ACE_TCHAR > xml_id (ACE_TEXT_CHAR_TO_TCHAR (add_id.c_str ())); + XMLSchema::ID< ACE_TCHAR > xml_id (add_id.c_str ()); // Bind the ref and set it in the IDD ADD_Handler::IDREF.bind_next_available (add_id); - add.id (xml_id); + add.xmi_id (xml_id); return add; } diff --git a/CIAO/tools/Config_Handlers/ADD_Handler.h b/CIAO/tools/Config_Handlers/ADD_Handler.h index 0db82b30fb2..063093a7038 100644 --- a/CIAO/tools/Config_Handlers/ADD_Handler.h +++ b/CIAO/tools/Config_Handlers/ADD_Handler.h @@ -1,11 +1,11 @@ //============================================================== /** -* @file ADD_Handler.h -* -* $Id$ -* -* @author Jules White <jules@dre.vanderbilt.edu> -*/ + * @file ADD_Handler.h + * + * $Id$ + * + * @author Jules White <jules@dre.vanderbilt.edu> + */ //================================================================ #ifndef CIAO_CONFIG_HANDLERS_ADD_Handler_H @@ -23,50 +23,48 @@ namespace Deployment { -struct ArtifactDeploymentDescription; -class ArtifactDeploymentDescriptions; + struct ArtifactDeploymentDescription; + class ArtifactDeploymentDescriptions; } namespace CIAO { -namespace Config_Handlers -{ -class DeploymentPlan; -class ArtifactDeploymentDescription; + namespace Config_Handlers + { + class deploymentPlan; + class ArtifactDeploymentDescription; -/* -* @class ADD_Handler -* -* @brief Handler class for <ArtifactDeploymentDescription> types. -* -* This class defines handler methods to map values from XSC -* ArtifactDeploymentDescription objects, parsed from the -* // @@ Jules, why Any type? -* descriptor files, to the corresponding CORBA IDL Any type. -*/ -class Config_Handlers_Export ADD_Handler -{ -public: -static void artifact_deployment_descrs ( -const DeploymentPlan &src, -::Deployment::ArtifactDeploymentDescriptions &dest); + /* + * @class ADD_Handler + * + * @brief Handler class for <ArtifactDeploymentDescription> types. + * + * This class defines handler methods to map values from XSC + * ArtifactDeploymentDescription objects, parsed from the + * // @@ Jules, why Any type? + * descriptor files, to the corresponding CORBA IDL Any type. + */ + class Config_Handlers_Export ADD_Handler + { + public: + static void artifact_deployment_descrs (const deploymentPlan &src, + ::Deployment::ArtifactDeploymentDescriptions &dest); -static ArtifactDeploymentDescription -artifact_deployment_descr ( -const Deployment::ArtifactDeploymentDescription &src); + static ArtifactDeploymentDescription + artifact_deployment_descr (const Deployment::ArtifactDeploymentDescription &src); -/// The IDREF Table associated with this class -static IDREF_Base<CORBA::ULong> IDREF; + /// The IDREF Table associated with this class + static IDREF_Base<CORBA::ULong> IDREF; -private: -static void artifact_deployment_descr ( -const ArtifactDeploymentDescription& desc, -::Deployment::ArtifactDeploymentDescription &dest, -CORBA::ULong l = 0); -}; -} + private: + static void artifact_deployment_descr ( + const ArtifactDeploymentDescription& desc, + ::Deployment::ArtifactDeploymentDescription &dest, + CORBA::ULong l = 0); + }; + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/Any_Handler.cpp b/CIAO/tools/Config_Handlers/Any_Handler.cpp index 987b3de0b49..314e5abde22 100644 --- a/CIAO/tools/Config_Handlers/Any_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Any_Handler.cpp @@ -9,6 +9,8 @@ #include "ciao/CIAO_common.h" #include "DynAny_Handler/DynAny_Handler.h" +#include "ace/Null_Mutex.h" + namespace CIAO { namespace Config_Handlers @@ -25,16 +27,25 @@ namespace CIAO void Any_Handler::extract_into_any (const Any& desc, CORBA::Any& toconfig) - { CIAO_TRACE("Any_Handler::extract_into_any"); - DynamicAny::DynAny_var dyn = DYNANY_HANDLER->extract_into_dynany (desc.type (), - desc.value ()); - - CORBA::Any_var owner = dyn->to_any (); - toconfig = owner.in (); - - dyn->destroy (); + try + { + DynamicAny::DynAny_var dyn = DYNANY_HANDLER->extract_into_dynany (desc.type (), + desc.value ()); + + toconfig = *dyn->to_any (); + + dyn->destroy (); + } + catch (Config_Error &ex) + { + throw ex; + } + catch (...) + { + throw Config_Error ("", "Caught error whilst parsing XML into Any\n"); + } } Any Any_Handler::get_any (const ::CORBA::Any& src) diff --git a/CIAO/tools/Config_Handlers/Any_Handler.h b/CIAO/tools/Config_Handlers/Any_Handler.h index 8e176a7ed35..03f99722034 100644 --- a/CIAO/tools/Config_Handlers/Any_Handler.h +++ b/CIAO/tools/Config_Handlers/Any_Handler.h @@ -18,6 +18,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "Config_Handlers/Common.h" #include "tao/Versioned_Namespace.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -30,20 +31,20 @@ TAO_END_VERSIONED_NAMESPACE_DECL namespace CIAO { namespace Config_Handlers - { - class Any; - - /* - * @class Any_Handler - * - * @brief Handler class for <ComponentInterfaceDescription> types. - * - * This class defines handler methods to map values from - * XSC Any objects, parsed from the descriptor files, to the - * corresponding CORBA IDL Any type. - * - */ - class Config_Handlers_Common_Export Any_Handler + { + class Any; + + /* + * @class Any_Handler + * + * @brief Handler class for <ComponentInterfaceDescription> types. + * + * This class defines handler methods to map values from + * XSC Any objects, parsed from the descriptor files, to the + * corresponding CORBA IDL Any type. + * + */ + class Config_Handlers_Common_Export Any_Handler { public: Any_Handler (void); @@ -54,7 +55,7 @@ namespace CIAO static Any get_any (const CORBA::Any &src); }; - } + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/Basic_Deployment_Data.cpp b/CIAO/tools/Config_Handlers/Basic_Deployment_Data.cpp index 77bcce3365d..a000d175f0f 100644 --- a/CIAO/tools/Config_Handlers/Basic_Deployment_Data.cpp +++ b/CIAO/tools/Config_Handlers/Basic_Deployment_Data.cpp @@ -21,6 +21,111 @@ namespace CIAO { namespace Config_Handlers { + // IdRef + // + + IdRef:: + IdRef () + : + regulator__ () + { + } + + IdRef:: + IdRef (::CIAO::Config_Handlers::IdRef const& s) + : XSCRT::Type (), + href_ (s.href_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.href_) : 0), + idref_ (s.idref_.get () ? new ::XMLSchema::IDREF< ACE_TCHAR > (*s.idref_) : 0), + regulator__ () + { + if (href_.get ()) href_->container (this); + if (idref_.get ()) idref_->container (this); + } + + ::CIAO::Config_Handlers::IdRef& IdRef:: + operator= (::CIAO::Config_Handlers::IdRef const& s) + { + if (s.href_.get ()) href (*(s.href_)); + else href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.idref_.get ()) idref (*(s.idref_)); + else idref_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (0); + + return *this; + } + + + // IdRef + // + bool IdRef:: + href_p () const + { + return href_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& IdRef:: + href () const + { + return *href_; + } + + ::XMLSchema::string< ACE_TCHAR >& IdRef:: + href () + { + return *href_; + } + + void IdRef:: + href (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (href_.get ()) + { + *href_ = e; + } + + else + { + href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + href_->container (this); + } + } + + // IdRef + // + bool IdRef:: + idref_p () const + { + return idref_.get () != 0; + } + + ::XMLSchema::IDREF< ACE_TCHAR > const& IdRef:: + idref () const + { + return *idref_; + } + + ::XMLSchema::IDREF< ACE_TCHAR >& IdRef:: + idref () + { + return *idref_; + } + + void IdRef:: + idref (::XMLSchema::IDREF< ACE_TCHAR > const& e) + { + if (idref_.get ()) + { + *idref_ = e; + } + + else + { + idref_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + idref_->container (this); + } + } + + // TCKind // @@ -70,7 +175,8 @@ namespace CIAO struct__ (s.struct__.get () ? new ::CIAO::Config_Handlers::StructType (*s.struct__) : 0), value_ (s.value_.get () ? new ::CIAO::Config_Handlers::ValueType (*s.value_) : 0), sequence_ (s.sequence_.get () ? new ::CIAO::Config_Handlers::SequenceType (*s.sequence_) : 0), - id_ (s.id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.id_) : 0), + alias_ (s.alias_.get () ? new ::CIAO::Config_Handlers::AliasType (*s.alias_) : 0), + xmi_id_ (s.xmi_id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.xmi_id_) : 0), regulator__ () { kind_->container (this); @@ -78,7 +184,8 @@ namespace CIAO if (struct__.get ()) struct__->container (this); if (value_.get ()) value_->container (this); if (sequence_.get ()) sequence_->container (this); - if (id_.get ()) id_->container (this); + if (alias_.get ()) alias_->container (this); + if (xmi_id_.get ()) xmi_id_->container (this); } ::CIAO::Config_Handlers::DataType& DataType:: @@ -98,8 +205,11 @@ namespace CIAO if (s.sequence_.get ()) sequence (*(s.sequence_)); else sequence_ = ::std::auto_ptr< ::CIAO::Config_Handlers::SequenceType > (0); - if (s.id_.get ()) id (*(s.id_)); - else id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); + if (s.alias_.get ()) alias (*(s.alias_)); + else alias_ = ::std::auto_ptr< ::CIAO::Config_Handlers::AliasType > (0); + + if (s.xmi_id_.get ()) xmi_id (*(s.xmi_id_)); + else xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); return *this; } @@ -238,35 +348,64 @@ namespace CIAO // DataType // bool DataType:: - id_p () const + alias_p () const + { + return alias_.get () != 0; + } + + ::CIAO::Config_Handlers::AliasType const& DataType:: + alias () const + { + return *alias_; + } + + void DataType:: + alias (::CIAO::Config_Handlers::AliasType const& e) + { + if (alias_.get ()) + { + *alias_ = e; + } + + else + { + alias_ = ::std::auto_ptr< ::CIAO::Config_Handlers::AliasType > (new ::CIAO::Config_Handlers::AliasType (e)); + alias_->container (this); + } + } + + // DataType + // + bool DataType:: + xmi_id_p () const { - return id_.get () != 0; + return xmi_id_.get () != 0; } ::XMLSchema::ID< ACE_TCHAR > const& DataType:: - id () const + xmi_id () const { - return *id_; + return *xmi_id_; } ::XMLSchema::ID< ACE_TCHAR >& DataType:: - id () + xmi_id () { - return *id_; + return *xmi_id_; } void DataType:: - id (::XMLSchema::ID< ACE_TCHAR > const& e) + xmi_id (::XMLSchema::ID< ACE_TCHAR > const& e) { - if (id_.get ()) + if (xmi_id_.get ()) { - *id_ = e; + *xmi_id_ = e; } else { - id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); - id_->container (this); + xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); + xmi_id_->container (this); } } @@ -341,6 +480,10 @@ namespace CIAO } { + for (element_const_iterator i (s.element_.begin ());i != s.element_.end ();++i) add_element (*i); + } + + { for (member_const_iterator i (s.member_.begin ());i != s.member_.end ();++i) add_member (*i); } } @@ -413,6 +556,11 @@ namespace CIAO for (longdouble_const_iterator i (s.longdouble_.begin ());i != s.longdouble_.end ();++i) add_longdouble (*i); } + element_.clear (); + { + for (element_const_iterator i (s.element_.begin ());i != s.element_.end ();++i) add_element (*i); + } + member_.clear (); { for (member_const_iterator i (s.member_.begin ());i != s.member_.end ();++i) add_member (*i); @@ -918,6 +1066,44 @@ namespace CIAO // DataValue // + DataValue::element_iterator DataValue:: + begin_element () + { + return element_.begin (); + } + + DataValue::element_iterator DataValue:: + end_element () + { + return element_.end (); + } + + DataValue::element_const_iterator DataValue:: + begin_element () const + { + return element_.begin (); + } + + DataValue::element_const_iterator DataValue:: + end_element () const + { + return element_.end (); + } + + void DataValue:: + add_element (::CIAO::Config_Handlers::DataValue const& e) + { + element_.push_back (e); + } + + size_t DataValue:: + count_element(void) const + { + return element_.size (); + } + + // DataValue + // DataValue::member_iterator DataValue:: begin_member () { @@ -955,6 +1141,95 @@ namespace CIAO } + // AliasType + // + + AliasType:: + AliasType (::XMLSchema::string< ACE_TCHAR > const& name__, + ::XMLSchema::string< ACE_TCHAR > const& typeId__, + ::CIAO::Config_Handlers::DataType const& elementType__) + : + ::XSCRT::Type (), + name_ (new ::XMLSchema::string< ACE_TCHAR > (name__)), + typeId_ (new ::XMLSchema::string< ACE_TCHAR > (typeId__)), + elementType_ (new ::CIAO::Config_Handlers::DataType (elementType__)), + regulator__ () + { + name_->container (this); + typeId_->container (this); + elementType_->container (this); + } + + AliasType:: + AliasType (::CIAO::Config_Handlers::AliasType const& s) + : + ::XSCRT::Type (), + name_ (new ::XMLSchema::string< ACE_TCHAR > (*s.name_)), + typeId_ (new ::XMLSchema::string< ACE_TCHAR > (*s.typeId_)), + elementType_ (new ::CIAO::Config_Handlers::DataType (*s.elementType_)), + regulator__ () + { + name_->container (this); + typeId_->container (this); + elementType_->container (this); + } + + ::CIAO::Config_Handlers::AliasType& AliasType:: + operator= (::CIAO::Config_Handlers::AliasType const& s) + { + name (s.name ()); + + typeId (s.typeId ()); + + elementType (s.elementType ()); + + return *this; + } + + + // AliasType + // + ::XMLSchema::string< ACE_TCHAR > const& AliasType:: + name () const + { + return *name_; + } + + void AliasType:: + name (::XMLSchema::string< ACE_TCHAR > const& e) + { + *name_ = e; + } + + // AliasType + // + ::XMLSchema::string< ACE_TCHAR > const& AliasType:: + typeId () const + { + return *typeId_; + } + + void AliasType:: + typeId (::XMLSchema::string< ACE_TCHAR > const& e) + { + *typeId_ = e; + } + + // AliasType + // + ::CIAO::Config_Handlers::DataType const& AliasType:: + elementType () const + { + return *elementType_; + } + + void AliasType:: + elementType (::CIAO::Config_Handlers::DataType const& e) + { + *elementType_ = e; + } + + // EnumType // @@ -1581,7 +1856,7 @@ namespace CIAO SequenceType (::CIAO::Config_Handlers::SequenceType const& s) : ::XSCRT::Type (), - bound_ (s.bound_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.bound_) : 0), + bound_ (s.bound_.get () ? new ::XMLSchema::unsignedInt (*s.bound_) : 0), elementType_ (new ::CIAO::Config_Handlers::DataType (*s.elementType_)), regulator__ () { @@ -1593,7 +1868,7 @@ namespace CIAO operator= (::CIAO::Config_Handlers::SequenceType const& s) { if (s.bound_.get ()) bound (*(s.bound_)); - else bound_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + else bound_ = ::std::auto_ptr< ::XMLSchema::unsignedInt > (0); elementType (s.elementType ()); @@ -1609,14 +1884,14 @@ namespace CIAO return bound_.get () != 0; } - ::XMLSchema::string< ACE_TCHAR > const& SequenceType:: + ::XMLSchema::unsignedInt const& SequenceType:: bound () const { return *bound_; } void SequenceType:: - bound (::XMLSchema::string< ACE_TCHAR > const& e) + bound (::XMLSchema::unsignedInt const& e) { if (bound_.get ()) { @@ -1625,7 +1900,7 @@ namespace CIAO else { - bound_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + bound_ = ::std::auto_ptr< ::XMLSchema::unsignedInt > (new ::XMLSchema::unsignedInt (e)); bound_->container (this); } } @@ -2308,7 +2583,7 @@ namespace CIAO ::XSCRT::Type (), name_ (new ::XMLSchema::string< ACE_TCHAR > (*s.name_)), node_ (new ::XMLSchema::string< ACE_TCHAR > (*s.node_)), - id_ (s.id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.id_) : 0), + xmi_id_ (s.xmi_id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.xmi_id_) : 0), regulator__ () { name_->container (this); @@ -2333,7 +2608,7 @@ namespace CIAO for (deployedResource_const_iterator i (s.deployedResource_.begin ());i != s.deployedResource_.end ();++i) add_deployedResource (*i); } - if (id_.get ()) id_->container (this); + if (xmi_id_.get ()) xmi_id_->container (this); } ::CIAO::Config_Handlers::ArtifactDeploymentDescription& ArtifactDeploymentDescription:: @@ -2368,8 +2643,8 @@ namespace CIAO for (deployedResource_const_iterator i (s.deployedResource_.begin ());i != s.deployedResource_.end ();++i) add_deployedResource (*i); } - if (s.id_.get ()) id (*(s.id_)); - else id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); + if (s.xmi_id_.get ()) xmi_id (*(s.xmi_id_)); + else xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); return *this; } @@ -2596,35 +2871,35 @@ namespace CIAO // ArtifactDeploymentDescription // bool ArtifactDeploymentDescription:: - id_p () const + xmi_id_p () const { - return id_.get () != 0; + return xmi_id_.get () != 0; } ::XMLSchema::ID< ACE_TCHAR > const& ArtifactDeploymentDescription:: - id () const + xmi_id () const { - return *id_; + return *xmi_id_; } ::XMLSchema::ID< ACE_TCHAR >& ArtifactDeploymentDescription:: - id () + xmi_id () { - return *id_; + return *xmi_id_; } void ArtifactDeploymentDescription:: - id (::XMLSchema::ID< ACE_TCHAR > const& e) + xmi_id (::XMLSchema::ID< ACE_TCHAR > const& e) { - if (id_.get ()) + if (xmi_id_.get ()) { - *id_ = e; + *xmi_id_ = e; } else { - id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); - id_->container (this); + xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); + xmi_id_->container (this); } } @@ -2647,7 +2922,7 @@ namespace CIAO : ::XSCRT::Type (), name_ (new ::XMLSchema::string< ACE_TCHAR > (*s.name_)), - id_ (s.id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.id_) : 0), + xmi_id_ (s.xmi_id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.xmi_id_) : 0), regulator__ () { name_->container (this); @@ -2667,7 +2942,7 @@ namespace CIAO for (deployRequirement_const_iterator i (s.deployRequirement_.begin ());i != s.deployRequirement_.end ();++i) add_deployRequirement (*i); } - if (id_.get ()) id_->container (this); + if (xmi_id_.get ()) xmi_id_->container (this); } ::CIAO::Config_Handlers::MonolithicDeploymentDescription& MonolithicDeploymentDescription:: @@ -2695,8 +2970,8 @@ namespace CIAO for (deployRequirement_const_iterator i (s.deployRequirement_.begin ());i != s.deployRequirement_.end ();++i) add_deployRequirement (*i); } - if (s.id_.get ()) id (*(s.id_)); - else id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); + if (s.xmi_id_.get ()) xmi_id (*(s.xmi_id_)); + else xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); return *this; } @@ -2781,7 +3056,7 @@ namespace CIAO } void MonolithicDeploymentDescription:: - add_artifact (::XMLSchema::IDREF< ACE_TCHAR > const& e) + add_artifact (::CIAO::Config_Handlers::IdRef const& e) { artifact_.push_back (e); } @@ -2871,35 +3146,35 @@ namespace CIAO // MonolithicDeploymentDescription // bool MonolithicDeploymentDescription:: - id_p () const + xmi_id_p () const { - return id_.get () != 0; + return xmi_id_.get () != 0; } ::XMLSchema::ID< ACE_TCHAR > const& MonolithicDeploymentDescription:: - id () const + xmi_id () const { - return *id_; + return *xmi_id_; } ::XMLSchema::ID< ACE_TCHAR >& MonolithicDeploymentDescription:: - id () + xmi_id () { - return *id_; + return *xmi_id_; } void MonolithicDeploymentDescription:: - id (::XMLSchema::ID< ACE_TCHAR > const& e) + xmi_id (::XMLSchema::ID< ACE_TCHAR > const& e) { - if (id_.get ()) + if (xmi_id_.get ()) { - *id_ = e; + *xmi_id_ = e; } else { - id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); - id_->container (this); + xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); + xmi_id_->container (this); } } @@ -3073,13 +3348,13 @@ namespace CIAO InstanceDeploymentDescription (::XMLSchema::string< ACE_TCHAR > const& name__, ::XMLSchema::string< ACE_TCHAR > const& node__, ::XMLSchema::string< ACE_TCHAR > const& source__, - ::XMLSchema::IDREF< ACE_TCHAR > const& implementation__) + ::CIAO::Config_Handlers::IdRef const& implementation__) : ::XSCRT::Type (), name_ (new ::XMLSchema::string< ACE_TCHAR > (name__)), node_ (new ::XMLSchema::string< ACE_TCHAR > (node__)), source_ (new ::XMLSchema::string< ACE_TCHAR > (source__)), - implementation_ (new ::XMLSchema::IDREF< ACE_TCHAR > (implementation__)), + implementation_ (new ::CIAO::Config_Handlers::IdRef (implementation__)), regulator__ () { name_->container (this); @@ -3095,9 +3370,9 @@ namespace CIAO name_ (new ::XMLSchema::string< ACE_TCHAR > (*s.name_)), node_ (new ::XMLSchema::string< ACE_TCHAR > (*s.node_)), source_ (new ::XMLSchema::string< ACE_TCHAR > (*s.source_)), - implementation_ (new ::XMLSchema::IDREF< ACE_TCHAR > (*s.implementation_)), + implementation_ (new ::CIAO::Config_Handlers::IdRef (*s.implementation_)), deployedSharedResource_ (s.deployedSharedResource_.get () ? new ::CIAO::Config_Handlers::InstanceResourceDeploymentDescription (*s.deployedSharedResource_) : 0), - id_ (s.id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.id_) : 0), + xmi_id_ (s.xmi_id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.xmi_id_) : 0), regulator__ () { name_->container (this); @@ -3113,7 +3388,7 @@ namespace CIAO } if (deployedSharedResource_.get ()) deployedSharedResource_->container (this); - if (id_.get ()) id_->container (this); + if (xmi_id_.get ()) xmi_id_->container (this); } ::CIAO::Config_Handlers::InstanceDeploymentDescription& InstanceDeploymentDescription:: @@ -3140,8 +3415,8 @@ namespace CIAO if (s.deployedSharedResource_.get ()) deployedSharedResource (*(s.deployedSharedResource_)); else deployedSharedResource_ = ::std::auto_ptr< ::CIAO::Config_Handlers::InstanceResourceDeploymentDescription > (0); - if (s.id_.get ()) id (*(s.id_)); - else id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); + if (s.xmi_id_.get ()) xmi_id (*(s.xmi_id_)); + else xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); return *this; } @@ -3191,14 +3466,14 @@ namespace CIAO // InstanceDeploymentDescription // - ::XMLSchema::IDREF< ACE_TCHAR > const& InstanceDeploymentDescription:: + ::CIAO::Config_Handlers::IdRef const& InstanceDeploymentDescription:: implementation () const { return *implementation_; } void InstanceDeploymentDescription:: - implementation (::XMLSchema::IDREF< ACE_TCHAR > const& e) + implementation (::CIAO::Config_Handlers::IdRef const& e) { *implementation_ = e; } @@ -3311,35 +3586,35 @@ namespace CIAO // InstanceDeploymentDescription // bool InstanceDeploymentDescription:: - id_p () const + xmi_id_p () const { - return id_.get () != 0; + return xmi_id_.get () != 0; } ::XMLSchema::ID< ACE_TCHAR > const& InstanceDeploymentDescription:: - id () const + xmi_id () const { - return *id_; + return *xmi_id_; } ::XMLSchema::ID< ACE_TCHAR >& InstanceDeploymentDescription:: - id () + xmi_id () { - return *id_; + return *xmi_id_; } void InstanceDeploymentDescription:: - id (::XMLSchema::ID< ACE_TCHAR > const& e) + xmi_id (::XMLSchema::ID< ACE_TCHAR > const& e) { - if (id_.get ()) + if (xmi_id_.get ()) { - *id_ = e; + *xmi_id_ = e; } else { - id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); - id_->container (this); + xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); + xmi_id_->container (this); } } @@ -3725,12 +4000,12 @@ namespace CIAO PlanSubcomponentPortEndpoint:: PlanSubcomponentPortEndpoint (::XMLSchema::string< ACE_TCHAR > const& portName__, ::CIAO::Config_Handlers::CCMComponentPortKind const& kind__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__) + ::CIAO::Config_Handlers::IdRef const& instance__) : ::XSCRT::Type (), portName_ (new ::XMLSchema::string< ACE_TCHAR > (portName__)), kind_ (new ::CIAO::Config_Handlers::CCMComponentPortKind (kind__)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (instance__)), + instance_ (new ::CIAO::Config_Handlers::IdRef (instance__)), regulator__ () { portName_->container (this); @@ -3745,7 +4020,7 @@ namespace CIAO portName_ (new ::XMLSchema::string< ACE_TCHAR > (*s.portName_)), provider_ (s.provider_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.provider_) : 0), kind_ (new ::CIAO::Config_Handlers::CCMComponentPortKind (*s.kind_)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (*s.instance_)), + instance_ (new ::CIAO::Config_Handlers::IdRef (*s.instance_)), regulator__ () { portName_->container (this); @@ -3829,14 +4104,14 @@ namespace CIAO // PlanSubcomponentPortEndpoint // - ::XMLSchema::IDREF< ACE_TCHAR > const& PlanSubcomponentPortEndpoint:: + ::CIAO::Config_Handlers::IdRef const& PlanSubcomponentPortEndpoint:: instance () const { return *instance_; } void PlanSubcomponentPortEndpoint:: - instance (::XMLSchema::IDREF< ACE_TCHAR > const& e) + instance (::CIAO::Config_Handlers::IdRef const& e) { *instance_ = e; } @@ -3846,13 +4121,16 @@ namespace CIAO // ExternalReferenceEndpoint:: - ExternalReferenceEndpoint (::XMLSchema::string< ACE_TCHAR > const& location__) + ExternalReferenceEndpoint (::XMLSchema::string< ACE_TCHAR > const& location__, + ::XMLSchema::boolean const& provider__) : ::XSCRT::Type (), location_ (new ::XMLSchema::string< ACE_TCHAR > (location__)), + provider_ (new ::XMLSchema::boolean (provider__)), regulator__ () { location_->container (this); + provider_->container (this); } ExternalReferenceEndpoint:: @@ -3860,9 +4138,16 @@ namespace CIAO : ::XSCRT::Type (), location_ (new ::XMLSchema::string< ACE_TCHAR > (*s.location_)), + provider_ (new ::XMLSchema::boolean (*s.provider_)), + portName_ (s.portName_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.portName_) : 0), regulator__ () { location_->container (this); + provider_->container (this); + if (portName_.get ()) portName_->container (this); + { + for (supportedType_const_iterator i (s.supportedType_.begin ());i != s.supportedType_.end ();++i) add_supportedType (*i); + } } ::CIAO::Config_Handlers::ExternalReferenceEndpoint& ExternalReferenceEndpoint:: @@ -3870,6 +4155,16 @@ namespace CIAO { location (s.location ()); + provider (s.provider ()); + + if (s.portName_.get ()) portName (*(s.portName_)); + else portName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + supportedType_.clear (); + { + for (supportedType_const_iterator i (s.supportedType_.begin ());i != s.supportedType_.end ();++i) add_supportedType (*i); + } + return *this; } @@ -3888,6 +4183,87 @@ namespace CIAO *location_ = e; } + // ExternalReferenceEndpoint + // + ::XMLSchema::boolean const& ExternalReferenceEndpoint:: + provider () const + { + return *provider_; + } + + void ExternalReferenceEndpoint:: + provider (::XMLSchema::boolean const& e) + { + *provider_ = e; + } + + // ExternalReferenceEndpoint + // + bool ExternalReferenceEndpoint:: + portName_p () const + { + return portName_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& ExternalReferenceEndpoint:: + portName () const + { + return *portName_; + } + + void ExternalReferenceEndpoint:: + portName (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (portName_.get ()) + { + *portName_ = e; + } + + else + { + portName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + portName_->container (this); + } + } + + // ExternalReferenceEndpoint + // + ExternalReferenceEndpoint::supportedType_iterator ExternalReferenceEndpoint:: + begin_supportedType () + { + return supportedType_.begin (); + } + + ExternalReferenceEndpoint::supportedType_iterator ExternalReferenceEndpoint:: + end_supportedType () + { + return supportedType_.end (); + } + + ExternalReferenceEndpoint::supportedType_const_iterator ExternalReferenceEndpoint:: + begin_supportedType () const + { + return supportedType_.begin (); + } + + ExternalReferenceEndpoint::supportedType_const_iterator ExternalReferenceEndpoint:: + end_supportedType () const + { + return supportedType_.end (); + } + + void ExternalReferenceEndpoint:: + add_supportedType (::XMLSchema::string< ACE_TCHAR > const& e) + { + supportedType_.push_back (e); + } + + size_t ExternalReferenceEndpoint:: + count_supportedType(void) const + { + return supportedType_.size (); + } + // ConnectionResourceDeploymentDescription // @@ -4742,131 +5118,16 @@ namespace CIAO } - // ComponentPackageReference - // - - ComponentPackageReference:: - ComponentPackageReference (::XMLSchema::string< ACE_TCHAR > const& requiredType__) - : - ::XSCRT::Type (), - requiredType_ (new ::XMLSchema::string< ACE_TCHAR > (requiredType__)), - regulator__ () - { - requiredType_->container (this); - } - - ComponentPackageReference:: - ComponentPackageReference (::CIAO::Config_Handlers::ComponentPackageReference const& s) - : - ::XSCRT::Type (), - requiredUUID_ (s.requiredUUID_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.requiredUUID_) : 0), - requiredName_ (s.requiredName_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.requiredName_) : 0), - requiredType_ (new ::XMLSchema::string< ACE_TCHAR > (*s.requiredType_)), - regulator__ () - { - if (requiredUUID_.get ()) requiredUUID_->container (this); - if (requiredName_.get ()) requiredName_->container (this); - requiredType_->container (this); - } - - ::CIAO::Config_Handlers::ComponentPackageReference& ComponentPackageReference:: - operator= (::CIAO::Config_Handlers::ComponentPackageReference const& s) - { - if (s.requiredUUID_.get ()) requiredUUID (*(s.requiredUUID_)); - else requiredUUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); - - if (s.requiredName_.get ()) requiredName (*(s.requiredName_)); - else requiredName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); - - requiredType (s.requiredType ()); - - return *this; - } - - - // ComponentPackageReference - // - bool ComponentPackageReference:: - requiredUUID_p () const - { - return requiredUUID_.get () != 0; - } - - ::XMLSchema::string< ACE_TCHAR > const& ComponentPackageReference:: - requiredUUID () const - { - return *requiredUUID_; - } - - void ComponentPackageReference:: - requiredUUID (::XMLSchema::string< ACE_TCHAR > const& e) - { - if (requiredUUID_.get ()) - { - *requiredUUID_ = e; - } - - else - { - requiredUUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - requiredUUID_->container (this); - } - } - - // ComponentPackageReference - // - bool ComponentPackageReference:: - requiredName_p () const - { - return requiredName_.get () != 0; - } - - ::XMLSchema::string< ACE_TCHAR > const& ComponentPackageReference:: - requiredName () const - { - return *requiredName_; - } - - void ComponentPackageReference:: - requiredName (::XMLSchema::string< ACE_TCHAR > const& e) - { - if (requiredName_.get ()) - { - *requiredName_ = e; - } - - else - { - requiredName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - requiredName_->container (this); - } - } - - // ComponentPackageReference - // - ::XMLSchema::string< ACE_TCHAR > const& ComponentPackageReference:: - requiredType () const - { - return *requiredType_; - } - - void ComponentPackageReference:: - requiredType (::XMLSchema::string< ACE_TCHAR > const& e) - { - *requiredType_ = e; - } - - // SubcomponentPortEndpoint // SubcomponentPortEndpoint:: SubcomponentPortEndpoint (::XMLSchema::string< ACE_TCHAR > const& portName__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__) + ::CIAO::Config_Handlers::IdRef const& instance__) : ::XSCRT::Type (), portName_ (new ::XMLSchema::string< ACE_TCHAR > (portName__)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (instance__)), + instance_ (new ::CIAO::Config_Handlers::IdRef (instance__)), regulator__ () { portName_->container (this); @@ -4878,7 +5139,7 @@ namespace CIAO : ::XSCRT::Type (), portName_ (new ::XMLSchema::string< ACE_TCHAR > (*s.portName_)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (*s.instance_)), + instance_ (new ::CIAO::Config_Handlers::IdRef (*s.instance_)), regulator__ () { portName_->container (this); @@ -4912,14 +5173,14 @@ namespace CIAO // SubcomponentPortEndpoint // - ::XMLSchema::IDREF< ACE_TCHAR > const& SubcomponentPortEndpoint:: + ::CIAO::Config_Handlers::IdRef const& SubcomponentPortEndpoint:: instance () const { return *instance_; } void SubcomponentPortEndpoint:: - instance (::XMLSchema::IDREF< ACE_TCHAR > const& e) + instance (::CIAO::Config_Handlers::IdRef const& e) { *instance_ = e; } @@ -5157,6 +5418,101 @@ namespace CIAO { return externalReference_.size (); } + + + // PlanLocalityKind + // + + PlanLocalityKind::Value PlanLocalityKind:: + integral () const + { + return v_; + } + + bool + operator== (::CIAO::Config_Handlers::PlanLocalityKind const& a, ::CIAO::Config_Handlers::PlanLocalityKind const& b) + { + return a.v_ == b.v_; + } + + bool + operator!= (::CIAO::Config_Handlers::PlanLocalityKind const& a, ::CIAO::Config_Handlers::PlanLocalityKind const& b) + { + return a.v_ != b.v_; + } + + PlanLocalityKind:: + PlanLocalityKind (PlanLocalityKind::Value v) + : v_ (v) + { + } + + // PlanLocality + // + + PlanLocality:: + PlanLocality (::CIAO::Config_Handlers::PlanLocalityKind const& constraint__, + ::CIAO::Config_Handlers::IdRef const& constrainedInstance__) + : + ::XSCRT::Type (), + constraint_ (new ::CIAO::Config_Handlers::PlanLocalityKind (constraint__)), + constrainedInstance_ (new ::CIAO::Config_Handlers::IdRef (constrainedInstance__)), + regulator__ () + { + constraint_->container (this); + constrainedInstance_->container (this); + } + + PlanLocality:: + PlanLocality (::CIAO::Config_Handlers::PlanLocality const& s) + : + ::XSCRT::Type (), + constraint_ (new ::CIAO::Config_Handlers::PlanLocalityKind (*s.constraint_)), + constrainedInstance_ (new ::CIAO::Config_Handlers::IdRef (*s.constrainedInstance_)), + regulator__ () + { + constraint_->container (this); + constrainedInstance_->container (this); + } + + ::CIAO::Config_Handlers::PlanLocality& PlanLocality:: + operator= (::CIAO::Config_Handlers::PlanLocality const& s) + { + constraint (s.constraint ()); + + constrainedInstance (s.constrainedInstance ()); + + return *this; + } + + + // PlanLocality + // + ::CIAO::Config_Handlers::PlanLocalityKind const& PlanLocality:: + constraint () const + { + return *constraint_; + } + + void PlanLocality:: + constraint (::CIAO::Config_Handlers::PlanLocalityKind const& e) + { + *constraint_ = e; + } + + // PlanLocality + // + ::CIAO::Config_Handlers::IdRef const& PlanLocality:: + constrainedInstance () const + { + return *constrainedInstance_; + } + + void PlanLocality:: + constrainedInstance (::CIAO::Config_Handlers::IdRef const& e) + { + *constrainedInstance_ = e; + } } } @@ -5164,6 +5520,38 @@ namespace CIAO { namespace Config_Handlers { + // IdRef + // + + IdRef:: + IdRef (::XSCRT::XML::Element< ACE_TCHAR > const& e) + :Base (e), regulator__ () + { + + ::XSCRT::Parser< ACE_TCHAR > p (e); + + while (p.more_attributes ()) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); + if (n == "href") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + href (t); + } + + else if (n == "idref") + { + ::XMLSchema::IDREF< ACE_TCHAR > t (a); + idref (t); + } + + else + { + } + } + } + // TCKind // @@ -5173,43 +5561,43 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("tk_null")) v_ = tk_null_l; - else if (v == ACE_TEXT ("tk_void")) v_ = tk_void_l; - else if (v == ACE_TEXT ("tk_short")) v_ = tk_short_l; - else if (v == ACE_TEXT ("tk_long")) v_ = tk_long_l; - else if (v == ACE_TEXT ("tk_ushort")) v_ = tk_ushort_l; - else if (v == ACE_TEXT ("tk_ulong")) v_ = tk_ulong_l; - else if (v == ACE_TEXT ("tk_float")) v_ = tk_float_l; - else if (v == ACE_TEXT ("tk_double")) v_ = tk_double_l; - else if (v == ACE_TEXT ("tk_boolean")) v_ = tk_boolean_l; - else if (v == ACE_TEXT ("tk_char")) v_ = tk_char_l; - else if (v == ACE_TEXT ("tk_octet")) v_ = tk_octet_l; - else if (v == ACE_TEXT ("tk_any")) v_ = tk_any_l; - else if (v == ACE_TEXT ("tk_TypeCode")) v_ = tk_TypeCode_l; - else if (v == ACE_TEXT ("tk_Principal")) v_ = tk_Principal_l; - else if (v == ACE_TEXT ("tk_objref")) v_ = tk_objref_l; - else if (v == ACE_TEXT ("tk_struct")) v_ = tk_struct_l; - else if (v == ACE_TEXT ("tk_union")) v_ = tk_union_l; - else if (v == ACE_TEXT ("tk_enum")) v_ = tk_enum_l; - else if (v == ACE_TEXT ("tk_string")) v_ = tk_string_l; - else if (v == ACE_TEXT ("tk_sequence")) v_ = tk_sequence_l; - else if (v == ACE_TEXT ("tk_array")) v_ = tk_array_l; - else if (v == ACE_TEXT ("tk_alias")) v_ = tk_alias_l; - else if (v == ACE_TEXT ("tk_except")) v_ = tk_except_l; - else if (v == ACE_TEXT ("tk_longlong")) v_ = tk_longlong_l; - else if (v == ACE_TEXT ("tk_ulonglong")) v_ = tk_ulonglong_l; - else if (v == ACE_TEXT ("tk_longdouble")) v_ = tk_longdouble_l; - else if (v == ACE_TEXT ("tk_wchar")) v_ = tk_wchar_l; - else if (v == ACE_TEXT ("tk_wstring")) v_ = tk_wstring_l; - else if (v == ACE_TEXT ("tk_wfixed")) v_ = tk_wfixed_l; - else if (v == ACE_TEXT ("tk_value")) v_ = tk_value_l; - else if (v == ACE_TEXT ("tk_value_box")) v_ = tk_value_box_l; - else if (v == ACE_TEXT ("tk_native")) v_ = tk_native_l; - else if (v == ACE_TEXT ("tk_abstract_interface")) v_ = tk_abstract_interface_l; - else if (v == ACE_TEXT ("tk_local_interface")) v_ = tk_local_interface_l; - else if (v == ACE_TEXT ("tk_component")) v_ = tk_component_l; - else if (v == ACE_TEXT ("tk_home")) v_ = tk_home_l; - else if (v == ACE_TEXT ("tk_event")) v_ = tk_event_l; + if (v == "tk_null") v_ = tk_null_l; + else if (v == "tk_void") v_ = tk_void_l; + else if (v == "tk_short") v_ = tk_short_l; + else if (v == "tk_long") v_ = tk_long_l; + else if (v == "tk_ushort") v_ = tk_ushort_l; + else if (v == "tk_ulong") v_ = tk_ulong_l; + else if (v == "tk_float") v_ = tk_float_l; + else if (v == "tk_double") v_ = tk_double_l; + else if (v == "tk_boolean") v_ = tk_boolean_l; + else if (v == "tk_char") v_ = tk_char_l; + else if (v == "tk_octet") v_ = tk_octet_l; + else if (v == "tk_any") v_ = tk_any_l; + else if (v == "tk_TypeCode") v_ = tk_TypeCode_l; + else if (v == "tk_Principal") v_ = tk_Principal_l; + else if (v == "tk_objref") v_ = tk_objref_l; + else if (v == "tk_struct") v_ = tk_struct_l; + else if (v == "tk_union") v_ = tk_union_l; + else if (v == "tk_enum") v_ = tk_enum_l; + else if (v == "tk_string") v_ = tk_string_l; + else if (v == "tk_sequence") v_ = tk_sequence_l; + else if (v == "tk_array") v_ = tk_array_l; + else if (v == "tk_alias") v_ = tk_alias_l; + else if (v == "tk_except") v_ = tk_except_l; + else if (v == "tk_longlong") v_ = tk_longlong_l; + else if (v == "tk_ulonglong") v_ = tk_ulonglong_l; + else if (v == "tk_longdouble") v_ = tk_longdouble_l; + else if (v == "tk_wchar") v_ = tk_wchar_l; + else if (v == "tk_wstring") v_ = tk_wstring_l; + else if (v == "tk_wfixed") v_ = tk_wfixed_l; + else if (v == "tk_value") v_ = tk_value_l; + else if (v == "tk_value_box") v_ = tk_value_box_l; + else if (v == "tk_native") v_ = tk_native_l; + else if (v == "tk_abstract_interface") v_ = tk_abstract_interface_l; + else if (v == "tk_local_interface") v_ = tk_local_interface_l; + else if (v == "tk_component") v_ = tk_component_l; + else if (v == "tk_home") v_ = tk_home_l; + else if (v == "tk_event") v_ = tk_event_l; else { } @@ -5221,43 +5609,43 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("tk_null")) v_ = tk_null_l; - else if (v == ACE_TEXT ("tk_void")) v_ = tk_void_l; - else if (v == ACE_TEXT ("tk_short")) v_ = tk_short_l; - else if (v == ACE_TEXT ("tk_long")) v_ = tk_long_l; - else if (v == ACE_TEXT ("tk_ushort")) v_ = tk_ushort_l; - else if (v == ACE_TEXT ("tk_ulong")) v_ = tk_ulong_l; - else if (v == ACE_TEXT ("tk_float")) v_ = tk_float_l; - else if (v == ACE_TEXT ("tk_double")) v_ = tk_double_l; - else if (v == ACE_TEXT ("tk_boolean")) v_ = tk_boolean_l; - else if (v == ACE_TEXT ("tk_char")) v_ = tk_char_l; - else if (v == ACE_TEXT ("tk_octet")) v_ = tk_octet_l; - else if (v == ACE_TEXT ("tk_any")) v_ = tk_any_l; - else if (v == ACE_TEXT ("tk_TypeCode")) v_ = tk_TypeCode_l; - else if (v == ACE_TEXT ("tk_Principal")) v_ = tk_Principal_l; - else if (v == ACE_TEXT ("tk_objref")) v_ = tk_objref_l; - else if (v == ACE_TEXT ("tk_struct")) v_ = tk_struct_l; - else if (v == ACE_TEXT ("tk_union")) v_ = tk_union_l; - else if (v == ACE_TEXT ("tk_enum")) v_ = tk_enum_l; - else if (v == ACE_TEXT ("tk_string")) v_ = tk_string_l; - else if (v == ACE_TEXT ("tk_sequence")) v_ = tk_sequence_l; - else if (v == ACE_TEXT ("tk_array")) v_ = tk_array_l; - else if (v == ACE_TEXT ("tk_alias")) v_ = tk_alias_l; - else if (v == ACE_TEXT ("tk_except")) v_ = tk_except_l; - else if (v == ACE_TEXT ("tk_longlong")) v_ = tk_longlong_l; - else if (v == ACE_TEXT ("tk_ulonglong")) v_ = tk_ulonglong_l; - else if (v == ACE_TEXT ("tk_longdouble")) v_ = tk_longdouble_l; - else if (v == ACE_TEXT ("tk_wchar")) v_ = tk_wchar_l; - else if (v == ACE_TEXT ("tk_wstring")) v_ = tk_wstring_l; - else if (v == ACE_TEXT ("tk_wfixed")) v_ = tk_wfixed_l; - else if (v == ACE_TEXT ("tk_value")) v_ = tk_value_l; - else if (v == ACE_TEXT ("tk_value_box")) v_ = tk_value_box_l; - else if (v == ACE_TEXT ("tk_native")) v_ = tk_native_l; - else if (v == ACE_TEXT ("tk_abstract_interface")) v_ = tk_abstract_interface_l; - else if (v == ACE_TEXT ("tk_local_interface")) v_ = tk_local_interface_l; - else if (v == ACE_TEXT ("tk_component")) v_ = tk_component_l; - else if (v == ACE_TEXT ("tk_home")) v_ = tk_home_l; - else if (v == ACE_TEXT ("tk_event")) v_ = tk_event_l; + if (v == "tk_null") v_ = tk_null_l; + else if (v == "tk_void") v_ = tk_void_l; + else if (v == "tk_short") v_ = tk_short_l; + else if (v == "tk_long") v_ = tk_long_l; + else if (v == "tk_ushort") v_ = tk_ushort_l; + else if (v == "tk_ulong") v_ = tk_ulong_l; + else if (v == "tk_float") v_ = tk_float_l; + else if (v == "tk_double") v_ = tk_double_l; + else if (v == "tk_boolean") v_ = tk_boolean_l; + else if (v == "tk_char") v_ = tk_char_l; + else if (v == "tk_octet") v_ = tk_octet_l; + else if (v == "tk_any") v_ = tk_any_l; + else if (v == "tk_TypeCode") v_ = tk_TypeCode_l; + else if (v == "tk_Principal") v_ = tk_Principal_l; + else if (v == "tk_objref") v_ = tk_objref_l; + else if (v == "tk_struct") v_ = tk_struct_l; + else if (v == "tk_union") v_ = tk_union_l; + else if (v == "tk_enum") v_ = tk_enum_l; + else if (v == "tk_string") v_ = tk_string_l; + else if (v == "tk_sequence") v_ = tk_sequence_l; + else if (v == "tk_array") v_ = tk_array_l; + else if (v == "tk_alias") v_ = tk_alias_l; + else if (v == "tk_except") v_ = tk_except_l; + else if (v == "tk_longlong") v_ = tk_longlong_l; + else if (v == "tk_ulonglong") v_ = tk_ulonglong_l; + else if (v == "tk_longdouble") v_ = tk_longdouble_l; + else if (v == "tk_wchar") v_ = tk_wchar_l; + else if (v == "tk_wstring") v_ = tk_wstring_l; + else if (v == "tk_wfixed") v_ = tk_wfixed_l; + else if (v == "tk_value") v_ = tk_value_l; + else if (v == "tk_value_box") v_ = tk_value_box_l; + else if (v == "tk_native") v_ = tk_native_l; + else if (v == "tk_abstract_interface") v_ = tk_abstract_interface_l; + else if (v == "tk_local_interface") v_ = tk_local_interface_l; + else if (v == "tk_component") v_ = tk_component_l; + else if (v == "tk_home") v_ = tk_home_l; + else if (v == "tk_event") v_ = tk_event_l; else { } @@ -5316,36 +5704,42 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("kind")) + if (n == "kind") { kind_ = ::std::auto_ptr< ::CIAO::Config_Handlers::TCKind > (new ::CIAO::Config_Handlers::TCKind (e)); kind_->container (this); } - else if (n == ACE_TEXT ("enum")) + else if (n == "enum") { ::CIAO::Config_Handlers::EnumType t (e); enum_ (t); } - else if (n == ACE_TEXT ("struct")) + else if (n == "struct") { ::CIAO::Config_Handlers::StructType t (e); struct_ (t); } - else if (n == ACE_TEXT ("value")) + else if (n == "value") { ::CIAO::Config_Handlers::ValueType t (e); value (t); } - else if (n == ACE_TEXT ("sequence")) + else if (n == "sequence") { ::CIAO::Config_Handlers::SequenceType t (e); sequence (t); } + else if (n == "alias") + { + ::CIAO::Config_Handlers::AliasType t (e); + alias (t); + } + else { } @@ -5355,10 +5749,10 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); - id (t); + xmi_id (t); } else @@ -5382,85 +5776,91 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("short")) + if (n == "short") { ::XMLSchema::short_ t (e); add_short (t); } - else if (n == ACE_TEXT ("long")) + else if (n == "long") { ::XMLSchema::int_ t (e); add_long (t); } - else if (n == ACE_TEXT ("ushort")) + else if (n == "ushort") { ::XMLSchema::unsignedShort t (e); add_ushort (t); } - else if (n == ACE_TEXT ("ulong")) + else if (n == "ulong") { ::XMLSchema::unsignedInt t (e); add_ulong (t); } - else if (n == ACE_TEXT ("float")) + else if (n == "float") { ::XMLSchema::float_ t (e); add_float (t); } - else if (n == ACE_TEXT ("double")) + else if (n == "double") { ::XMLSchema::double_ t (e); add_double (t); } - else if (n == ACE_TEXT ("boolean")) + else if (n == "boolean") { ::XMLSchema::boolean t (e); add_boolean (t); } - else if (n == ACE_TEXT ("octet")) + else if (n == "octet") { ::XMLSchema::unsignedByte t (e); add_octet (t); } - else if (n == ACE_TEXT ("enum")) + else if (n == "enum") { ::XMLSchema::string< ACE_TCHAR > t (e); add_enum (t); } - else if (n == ACE_TEXT ("string")) + else if (n == "string") { ::XMLSchema::string< ACE_TCHAR > t (e); add_string (t); } - else if (n == ACE_TEXT ("longlong")) + else if (n == "longlong") { ::XMLSchema::long_ t (e); add_longlong (t); } - else if (n == ACE_TEXT ("ulonglong")) + else if (n == "ulonglong") { ::XMLSchema::unsignedLong t (e); add_ulonglong (t); } - else if (n == ACE_TEXT ("longdouble")) + else if (n == "longdouble") { ::XMLSchema::double_ t (e); add_longdouble (t); } - else if (n == ACE_TEXT ("member")) + else if (n == "element") + { + ::CIAO::Config_Handlers::DataValue t (e); + add_element (t); + } + + else if (n == "member") { ::CIAO::Config_Handlers::NamedValue t (e); add_member (t); @@ -5472,6 +5872,45 @@ namespace CIAO } } + // AliasType + // + + AliasType:: + AliasType (::XSCRT::XML::Element< ACE_TCHAR > const& e) + :Base (e), regulator__ () + { + + ::XSCRT::Parser< ACE_TCHAR > p (e); + + while (p.more_elements ()) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); + + if (n == "name") + { + name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + name_->container (this); + } + + else if (n == "typeId") + { + typeId_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + typeId_->container (this); + } + + else if (n == "elementType") + { + elementType_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); + elementType_->container (this); + } + + else + { + } + } + } + // EnumType // @@ -5487,19 +5926,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("typeId")) + else if (n == "typeId") { typeId_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); typeId_->container (this); } - else if (n == ACE_TEXT ("member")) + else if (n == "member") { ::XMLSchema::string< ACE_TCHAR > t (e); add_member (t); @@ -5526,19 +5965,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("typeId")) + else if (n == "typeId") { typeId_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); typeId_->container (this); } - else if (n == ACE_TEXT ("member")) + else if (n == "member") { ::CIAO::Config_Handlers::StructMemberType t (e); add_member (t); @@ -5565,13 +6004,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("type")) + else if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); type_->container (this); @@ -5598,31 +6037,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("typeId")) + else if (n == "typeId") { typeId_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); typeId_->container (this); } - else if (n == ACE_TEXT ("modifier")) + else if (n == "modifier") { modifier_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); modifier_->container (this); } - else if (n == ACE_TEXT ("baseType")) + else if (n == "baseType") { baseType_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); baseType_->container (this); } - else if (n == ACE_TEXT ("member")) + else if (n == "member") { ::CIAO::Config_Handlers::ValueMemberType t (e); add_member (t); @@ -5649,19 +6088,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("visibility")) + else if (n == "visibility") { visibility_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); visibility_->container (this); } - else if (n == ACE_TEXT ("type")) + else if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); type_->container (this); @@ -5688,13 +6127,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("value")) + else if (n == "value") { value_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataValue > (new ::CIAO::Config_Handlers::DataValue (e)); value_->container (this); @@ -5721,13 +6160,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("bound")) + if (n == "bound") { - ::XMLSchema::string< ACE_TCHAR > t (e); + ::XMLSchema::unsignedInt t (e); bound (t); } - else if (n == ACE_TEXT ("elementType")) + else if (n == "elementType") { elementType_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); elementType_->container (this); @@ -5754,13 +6193,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("type")) + if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); type_->container (this); } - else if (n == ACE_TEXT ("value")) + else if (n == "value") { value_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataValue > (new ::CIAO::Config_Handlers::DataValue (e)); value_->container (this); @@ -5787,13 +6226,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("value")) + else if (n == "value") { value_ = ::std::auto_ptr< ::CIAO::Config_Handlers::Any > (new ::CIAO::Config_Handlers::Any (e)); value_->container (this); @@ -5814,12 +6253,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("Quantity")) v_ = Quantity_l; - else if (v == ACE_TEXT ("Capacity")) v_ = Capacity_l; - else if (v == ACE_TEXT ("Minimum")) v_ = Minimum_l; - else if (v == ACE_TEXT ("Maximum")) v_ = Maximum_l; - else if (v == ACE_TEXT ("Attribute")) v_ = Attribute_l; - else if (v == ACE_TEXT ("Selection")) v_ = Selection_l; + if (v == "Quantity") v_ = Quantity_l; + else if (v == "Capacity") v_ = Capacity_l; + else if (v == "Minimum") v_ = Minimum_l; + else if (v == "Maximum") v_ = Maximum_l; + else if (v == "Attribute") v_ = Attribute_l; + else if (v == "Selection") v_ = Selection_l; else { } @@ -5831,12 +6270,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("Quantity")) v_ = Quantity_l; - else if (v == ACE_TEXT ("Capacity")) v_ = Capacity_l; - else if (v == ACE_TEXT ("Minimum")) v_ = Minimum_l; - else if (v == ACE_TEXT ("Maximum")) v_ = Maximum_l; - else if (v == ACE_TEXT ("Attribute")) v_ = Attribute_l; - else if (v == ACE_TEXT ("Selection")) v_ = Selection_l; + if (v == "Quantity") v_ = Quantity_l; + else if (v == "Capacity") v_ = Capacity_l; + else if (v == "Minimum") v_ = Minimum_l; + else if (v == "Maximum") v_ = Maximum_l; + else if (v == "Attribute") v_ = Attribute_l; + else if (v == "Selection") v_ = Selection_l; else { } @@ -5864,25 +6303,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("kind")) + else if (n == "kind") { kind_ = ::std::auto_ptr< ::CIAO::Config_Handlers::SatisfierPropertyKind > (new ::CIAO::Config_Handlers::SatisfierPropertyKind (e)); kind_->container (this); } - else if (n == ACE_TEXT ("dynamic")) + else if (n == "dynamic") { dynamic_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); dynamic_->container (this); } - else if (n == ACE_TEXT ("value")) + else if (n == "value") { value_ = ::std::auto_ptr< ::CIAO::Config_Handlers::Any > (new ::CIAO::Config_Handlers::Any (e)); value_->container (this); @@ -5909,19 +6348,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("resourceType")) + else if (n == "resourceType") { ::XMLSchema::string< ACE_TCHAR > t (e); add_resourceType (t); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::SatisfierProperty t (e); add_property (t); @@ -5948,19 +6387,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("resourceType")) + if (n == "resourceType") { resourceType_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceType_->container (this); } - else if (n == ACE_TEXT ("name")) + else if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::Property t (e); add_property (t); @@ -5987,19 +6426,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("requirementName")) + if (n == "requirementName") { requirementName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); requirementName_->container (this); } - else if (n == ACE_TEXT ("resourceName")) + else if (n == "resourceName") { resourceName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceName_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::Property t (e); add_property (t); @@ -6026,43 +6465,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("source")) + else if (n == "source") { ::XMLSchema::string< ACE_TCHAR > t (e); add_source (t); } - else if (n == ACE_TEXT ("node")) + else if (n == "node") { node_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); node_->container (this); } - else if (n == ACE_TEXT ("location")) + else if (n == "location") { ::XMLSchema::string< ACE_TCHAR > t (e); add_location (t); } - else if (n == ACE_TEXT ("execParameter")) + else if (n == "execParameter") { ::CIAO::Config_Handlers::Property t (e); add_execParameter (t); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_deployRequirement (t); } - else if (n == ACE_TEXT ("deployedResource")) + else if (n == "deployedResource") { ::CIAO::Config_Handlers::ResourceDeploymentDescription t (e); add_deployedResource (t); @@ -6077,10 +6516,10 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); - id (t); + xmi_id (t); } else @@ -6104,31 +6543,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("source")) + else if (n == "source") { ::XMLSchema::string< ACE_TCHAR > t (e); add_source (t); } - else if (n == ACE_TEXT ("artifact")) + else if (n == "artifact") { - ::XMLSchema::IDREF< ACE_TCHAR > t (e); + ::CIAO::Config_Handlers::IdRef t (e); add_artifact (t); } - else if (n == ACE_TEXT ("execParameter")) + else if (n == "execParameter") { ::CIAO::Config_Handlers::Property t (e); add_execParameter (t); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_deployRequirement (t); @@ -6143,10 +6582,10 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); - id (t); + xmi_id (t); } else @@ -6164,11 +6603,11 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("None")) v_ = None_l; - else if (v == ACE_TEXT ("InstanceUsesResource")) v_ = InstanceUsesResource_l; - else if (v == ACE_TEXT ("ResourceUsesInstance")) v_ = ResourceUsesInstance_l; - else if (v == ACE_TEXT ("PortUsesResource")) v_ = PortUsesResource_l; - else if (v == ACE_TEXT ("ResourceUsesPort")) v_ = ResourceUsesPort_l; + if (v == "None") v_ = None_l; + else if (v == "InstanceUsesResource") v_ = InstanceUsesResource_l; + else if (v == "ResourceUsesInstance") v_ = ResourceUsesInstance_l; + else if (v == "PortUsesResource") v_ = PortUsesResource_l; + else if (v == "ResourceUsesPort") v_ = ResourceUsesPort_l; else { } @@ -6180,11 +6619,11 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("None")) v_ = None_l; - else if (v == ACE_TEXT ("InstanceUsesResource")) v_ = InstanceUsesResource_l; - else if (v == ACE_TEXT ("ResourceUsesInstance")) v_ = ResourceUsesInstance_l; - else if (v == ACE_TEXT ("PortUsesResource")) v_ = PortUsesResource_l; - else if (v == ACE_TEXT ("ResourceUsesPort")) v_ = ResourceUsesPort_l; + if (v == "None") v_ = None_l; + else if (v == "InstanceUsesResource") v_ = InstanceUsesResource_l; + else if (v == "ResourceUsesInstance") v_ = ResourceUsesInstance_l; + else if (v == "PortUsesResource") v_ = PortUsesResource_l; + else if (v == "ResourceUsesPort") v_ = ResourceUsesPort_l; else { } @@ -6211,25 +6650,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("resourceUsage")) + if (n == "resourceUsage") { resourceUsage_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ResourceUsageKind > (new ::CIAO::Config_Handlers::ResourceUsageKind (e)); resourceUsage_->container (this); } - else if (n == ACE_TEXT ("requirementName")) + else if (n == "requirementName") { requirementName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); requirementName_->container (this); } - else if (n == ACE_TEXT ("resourceName")) + else if (n == "resourceName") { resourceName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceName_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::Property t (e); add_property (t); @@ -6256,43 +6695,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("node")) + else if (n == "node") { node_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); node_->container (this); } - else if (n == ACE_TEXT ("source")) + else if (n == "source") { source_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); source_->container (this); } - else if (n == ACE_TEXT ("implementation")) + else if (n == "implementation") { - implementation_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + implementation_ = ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > (new ::CIAO::Config_Handlers::IdRef (e)); implementation_->container (this); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("deployedResource")) + else if (n == "deployedResource") { ::CIAO::Config_Handlers::InstanceResourceDeploymentDescription t (e); add_deployedResource (t); } - else if (n == ACE_TEXT ("deployedSharedResource")) + else if (n == "deployedSharedResource") { ::CIAO::Config_Handlers::InstanceResourceDeploymentDescription t (e); deployedSharedResource (t); @@ -6307,10 +6746,10 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); - id (t); + xmi_id (t); } else @@ -6328,12 +6767,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("Facet")) v_ = Facet_l; - else if (v == ACE_TEXT ("SimplexReceptacle")) v_ = SimplexReceptacle_l; - else if (v == ACE_TEXT ("MultiplexReceptacle")) v_ = MultiplexReceptacle_l; - else if (v == ACE_TEXT ("EventEmitter")) v_ = EventEmitter_l; - else if (v == ACE_TEXT ("EventPublisher")) v_ = EventPublisher_l; - else if (v == ACE_TEXT ("EventConsumer")) v_ = EventConsumer_l; + if (v == "Facet") v_ = Facet_l; + else if (v == "SimplexReceptacle") v_ = SimplexReceptacle_l; + else if (v == "MultiplexReceptacle") v_ = MultiplexReceptacle_l; + else if (v == "EventEmitter") v_ = EventEmitter_l; + else if (v == "EventPublisher") v_ = EventPublisher_l; + else if (v == "EventConsumer") v_ = EventConsumer_l; else { } @@ -6345,12 +6784,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("Facet")) v_ = Facet_l; - else if (v == ACE_TEXT ("SimplexReceptacle")) v_ = SimplexReceptacle_l; - else if (v == ACE_TEXT ("MultiplexReceptacle")) v_ = MultiplexReceptacle_l; - else if (v == ACE_TEXT ("EventEmitter")) v_ = EventEmitter_l; - else if (v == ACE_TEXT ("EventPublisher")) v_ = EventPublisher_l; - else if (v == ACE_TEXT ("EventConsumer")) v_ = EventConsumer_l; + if (v == "Facet") v_ = Facet_l; + else if (v == "SimplexReceptacle") v_ = SimplexReceptacle_l; + else if (v == "MultiplexReceptacle") v_ = MultiplexReceptacle_l; + else if (v == "EventEmitter") v_ = EventEmitter_l; + else if (v == "EventPublisher") v_ = EventPublisher_l; + else if (v == "EventConsumer") v_ = EventConsumer_l; else { } @@ -6378,49 +6817,49 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("specificType")) + else if (n == "specificType") { ::XMLSchema::string< ACE_TCHAR > t (e); specificType (t); } - else if (n == ACE_TEXT ("supportedType")) + else if (n == "supportedType") { ::XMLSchema::string< ACE_TCHAR > t (e); add_supportedType (t); } - else if (n == ACE_TEXT ("provider")) + else if (n == "provider") { provider_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); provider_->container (this); } - else if (n == ACE_TEXT ("exclusiveProvider")) + else if (n == "exclusiveProvider") { exclusiveProvider_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); exclusiveProvider_->container (this); } - else if (n == ACE_TEXT ("exclusiveUser")) + else if (n == "exclusiveUser") { exclusiveUser_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); exclusiveUser_->container (this); } - else if (n == ACE_TEXT ("optional")) + else if (n == "optional") { optional_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); optional_->container (this); } - else if (n == ACE_TEXT ("kind")) + else if (n == "kind") { kind_ = ::std::auto_ptr< ::CIAO::Config_Handlers::CCMComponentPortKind > (new ::CIAO::Config_Handlers::CCMComponentPortKind (e)); kind_->container (this); @@ -6447,13 +6886,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("type")) + else if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > (new ::CIAO::Config_Handlers::DataType (e)); type_->container (this); @@ -6480,7 +6919,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("portName")) + if (n == "portName") { portName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); portName_->container (this); @@ -6507,27 +6946,27 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("portName")) + if (n == "portName") { portName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); portName_->container (this); } - else if (n == ACE_TEXT ("provider")) + else if (n == "provider") { ::XMLSchema::string< ACE_TCHAR > t (e); provider (t); } - else if (n == ACE_TEXT ("kind")) + else if (n == "kind") { kind_ = ::std::auto_ptr< ::CIAO::Config_Handlers::CCMComponentPortKind > (new ::CIAO::Config_Handlers::CCMComponentPortKind (e)); kind_->container (this); } - else if (n == ACE_TEXT ("instance")) + else if (n == "instance") { - instance_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + instance_ = ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > (new ::CIAO::Config_Handlers::IdRef (e)); instance_->container (this); } @@ -6552,12 +6991,30 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("location")) + if (n == "location") { location_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); location_->container (this); } + else if (n == "provider") + { + provider_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); + provider_->container (this); + } + + else if (n == "portName") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + portName (t); + } + + else if (n == "supportedType") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + add_supportedType (t); + } + else { } @@ -6579,25 +7036,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("targetName")) + if (n == "targetName") { targetName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); targetName_->container (this); } - else if (n == ACE_TEXT ("requirementName")) + else if (n == "requirementName") { requirementName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); requirementName_->container (this); } - else if (n == ACE_TEXT ("resourceName")) + else if (n == "resourceName") { resourceName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceName_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::Property t (e); add_property (t); @@ -6624,43 +7081,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("source")) + else if (n == "source") { ::XMLSchema::string< ACE_TCHAR > t (e); source (t); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_deployRequirement (t); } - else if (n == ACE_TEXT ("externalEndpoint")) + else if (n == "externalEndpoint") { ::CIAO::Config_Handlers::ComponentExternalPortEndpoint t (e); add_externalEndpoint (t); } - else if (n == ACE_TEXT ("internalEndpoint")) + else if (n == "internalEndpoint") { ::CIAO::Config_Handlers::PlanSubcomponentPortEndpoint t (e); add_internalEndpoint (t); } - else if (n == ACE_TEXT ("externalReference")) + else if (n == "externalReference") { ::CIAO::Config_Handlers::ExternalReferenceEndpoint t (e); add_externalReference (t); } - else if (n == ACE_TEXT ("deployedResource")) + else if (n == "deployedResource") { ::CIAO::Config_Handlers::ConnectionResourceDeploymentDescription t (e); add_deployedResource (t); @@ -6687,7 +7144,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("requiredType")) + if (n == "requiredType") { requiredType_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); requiredType_->container (this); @@ -6714,19 +7171,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("resourceType")) + else if (n == "resourceType") { ::XMLSchema::string< ACE_TCHAR > t (e); add_resourceType (t); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::SatisfierProperty t (e); add_property (t); @@ -6753,37 +7210,37 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("resourceUsage")) + if (n == "resourceUsage") { ::CIAO::Config_Handlers::ResourceUsageKind t (e); resourceUsage (t); } - else if (n == ACE_TEXT ("resourcePort")) + else if (n == "resourcePort") { ::XMLSchema::string< ACE_TCHAR > t (e); resourcePort (t); } - else if (n == ACE_TEXT ("componentPort")) + else if (n == "componentPort") { ::XMLSchema::string< ACE_TCHAR > t (e); componentPort (t); } - else if (n == ACE_TEXT ("resourceType")) + else if (n == "resourceType") { resourceType_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceType_->container (this); } - else if (n == ACE_TEXT ("name")) + else if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::Property t (e); add_property (t); @@ -6795,45 +7252,6 @@ namespace CIAO } } - // ComponentPackageReference - // - - ComponentPackageReference:: - ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR > const& e) - :Base (e), regulator__ () - { - - ::XSCRT::Parser< ACE_TCHAR > p (e); - - while (p.more_elements ()) - { - ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); - ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - - if (n == ACE_TEXT ("requiredUUID")) - { - ::XMLSchema::string< ACE_TCHAR > t (e); - requiredUUID (t); - } - - else if (n == ACE_TEXT ("requiredName")) - { - ::XMLSchema::string< ACE_TCHAR > t (e); - requiredName (t); - } - - else if (n == ACE_TEXT ("requiredType")) - { - requiredType_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); - requiredType_->container (this); - } - - else - { - } - } - } - // SubcomponentPortEndpoint // @@ -6849,15 +7267,15 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("portName")) + if (n == "portName") { portName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); portName_->container (this); } - else if (n == ACE_TEXT ("instance")) + else if (n == "instance") { - instance_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + instance_ = ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > (new ::CIAO::Config_Handlers::IdRef (e)); instance_->container (this); } @@ -6882,31 +7300,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_deployRequirement (t); } - else if (n == ACE_TEXT ("internalEndpoint")) + else if (n == "internalEndpoint") { ::CIAO::Config_Handlers::SubcomponentPortEndpoint t (e); add_internalEndpoint (t); } - else if (n == ACE_TEXT ("externalEndpoint")) + else if (n == "externalEndpoint") { ::CIAO::Config_Handlers::ComponentExternalPortEndpoint t (e); add_externalEndpoint (t); } - else if (n == ACE_TEXT ("externalReference")) + else if (n == "externalReference") { ::CIAO::Config_Handlers::ExternalReferenceEndpoint t (e); add_externalReference (t); @@ -6917,6 +7335,74 @@ namespace CIAO } } } + + // PlanLocalityKind + // + + PlanLocalityKind:: + PlanLocalityKind (::XSCRT::XML::Element< ACE_TCHAR > const& e) + : ::XSCRT::Type (e) + { + ::std::basic_string< ACE_TCHAR > v (e.value ()); + + if (v == "SameProcess") v_ = SameProcess_l; + else if (v == "DifferentProcess") v_ = DifferentProcess_l; + else if (v == "NoConstraint") v_ = NoConstraint_l; + else + { + } + } + + PlanLocalityKind:: + PlanLocalityKind (::XSCRT::XML::Attribute< ACE_TCHAR > const& a) + : ::XSCRT::Type (a) + { + ::std::basic_string< ACE_TCHAR > v (a.value ()); + + if (v == "SameProcess") v_ = SameProcess_l; + else if (v == "DifferentProcess") v_ = DifferentProcess_l; + else if (v == "NoConstraint") v_ = NoConstraint_l; + else + { + } + } + + PlanLocalityKind const PlanLocalityKind::SameProcess (PlanLocalityKind::SameProcess_l); + PlanLocalityKind const PlanLocalityKind::DifferentProcess (PlanLocalityKind::DifferentProcess_l); + PlanLocalityKind const PlanLocalityKind::NoConstraint (PlanLocalityKind::NoConstraint_l); + + // PlanLocality + // + + PlanLocality:: + PlanLocality (::XSCRT::XML::Element< ACE_TCHAR > const& e) + :Base (e), regulator__ () + { + + ::XSCRT::Parser< ACE_TCHAR > p (e); + + while (p.more_elements ()) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); + + if (n == "constraint") + { + constraint_ = ::std::auto_ptr< ::CIAO::Config_Handlers::PlanLocalityKind > (new ::CIAO::Config_Handlers::PlanLocalityKind (e)); + constraint_->container (this); + } + + else if (n == "constrainedInstance") + { + constrainedInstance_ = ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > (new ::CIAO::Config_Handlers::IdRef (e)); + constrainedInstance_->container (this); + } + + else + { + } + } + } } } @@ -6937,6 +7423,20 @@ namespace CIAO { ::XMLSchema::TypeInfoInitializer < ACE_TCHAR > XMLSchemaTypeInfoInitializer_ (::XSCRT::extended_type_info_map ()); + struct IdRefTypeInfoInitializer + { + IdRefTypeInfoInitializer () + { + ::XSCRT::TypeId id (typeid (IdRef)); + ::XSCRT::ExtendedTypeInfo nf (id); + + nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); + } + }; + + IdRefTypeInfoInitializer IdRefTypeInfoInitializer_; + struct TCKindTypeInfoInitializer { TCKindTypeInfoInitializer () @@ -6980,6 +7480,20 @@ namespace CIAO DataValueTypeInfoInitializer DataValueTypeInfoInitializer_; + struct AliasTypeTypeInfoInitializer + { + AliasTypeTypeInfoInitializer () + { + ::XSCRT::TypeId id (typeid (AliasType)); + ::XSCRT::ExtendedTypeInfo nf (id); + + nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); + } + }; + + AliasTypeTypeInfoInitializer AliasTypeTypeInfoInitializer_; + struct EnumTypeTypeInfoInitializer { EnumTypeTypeInfoInitializer () @@ -7403,11 +7917,11 @@ namespace CIAO ImplementationRequirementTypeInfoInitializer ImplementationRequirementTypeInfoInitializer_; - struct ComponentPackageReferenceTypeInfoInitializer + struct SubcomponentPortEndpointTypeInfoInitializer { - ComponentPackageReferenceTypeInfoInitializer () + SubcomponentPortEndpointTypeInfoInitializer () { - ::XSCRT::TypeId id (typeid (ComponentPackageReference)); + ::XSCRT::TypeId id (typeid (SubcomponentPortEndpoint)); ::XSCRT::ExtendedTypeInfo nf (id); nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); @@ -7415,13 +7929,13 @@ namespace CIAO } }; - ComponentPackageReferenceTypeInfoInitializer ComponentPackageReferenceTypeInfoInitializer_; + SubcomponentPortEndpointTypeInfoInitializer SubcomponentPortEndpointTypeInfoInitializer_; - struct SubcomponentPortEndpointTypeInfoInitializer + struct AssemblyConnectionDescriptionTypeInfoInitializer { - SubcomponentPortEndpointTypeInfoInitializer () + AssemblyConnectionDescriptionTypeInfoInitializer () { - ::XSCRT::TypeId id (typeid (SubcomponentPortEndpoint)); + ::XSCRT::TypeId id (typeid (AssemblyConnectionDescription)); ::XSCRT::ExtendedTypeInfo nf (id); nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); @@ -7429,21 +7943,36 @@ namespace CIAO } }; - SubcomponentPortEndpointTypeInfoInitializer SubcomponentPortEndpointTypeInfoInitializer_; + AssemblyConnectionDescriptionTypeInfoInitializer AssemblyConnectionDescriptionTypeInfoInitializer_; - struct AssemblyConnectionDescriptionTypeInfoInitializer + struct PlanLocalityKindTypeInfoInitializer { - AssemblyConnectionDescriptionTypeInfoInitializer () + PlanLocalityKindTypeInfoInitializer () { - ::XSCRT::TypeId id (typeid (AssemblyConnectionDescription)); + ::XSCRT::TypeId id (typeid (PlanLocalityKind)); ::XSCRT::ExtendedTypeInfo nf (id); nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); } }; - AssemblyConnectionDescriptionTypeInfoInitializer AssemblyConnectionDescriptionTypeInfoInitializer_; + PlanLocalityKindTypeInfoInitializer PlanLocalityKindTypeInfoInitializer_; + + struct PlanLocalityTypeInfoInitializer + { + PlanLocalityTypeInfoInitializer () + { + ::XSCRT::TypeId id (typeid (PlanLocality)); + ::XSCRT::ExtendedTypeInfo nf (id); + + nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); + } + }; + + PlanLocalityTypeInfoInitializer PlanLocalityTypeInfoInitializer_; } } } @@ -7454,6 +7983,96 @@ namespace CIAO { namespace Traversal { + // IdRef + // + // + + void IdRef:: + traverse (Type& o) + { + pre (o); + if (o.href_p ()) href (o); + else href_none (o); + if (o.idref_p ()) idref (o); + else idref_none (o); + post (o); + } + + void IdRef:: + traverse (Type const& o) + { + pre (o); + if (o.href_p ()) href (o); + else href_none (o); + if (o.idref_p ()) idref (o); + else idref_none (o); + post (o); + } + + void IdRef:: + pre (Type&) + { + } + + void IdRef:: + pre (Type const&) + { + } + + void IdRef:: + href (Type& o) + { + dispatch (o.href ()); + } + + void IdRef:: + href (Type const& o) + { + dispatch (o.href ()); + } + + void IdRef:: + href_none (Type&) + { + } + + void IdRef:: + href_none (Type const&) + { + } + + void IdRef:: + idref (Type& o) + { + dispatch (o.idref ()); + } + + void IdRef:: + idref (Type const& o) + { + dispatch (o.idref ()); + } + + void IdRef:: + idref_none (Type&) + { + } + + void IdRef:: + idref_none (Type const&) + { + } + + void IdRef:: + post (Type&) + { + } + + void IdRef:: + post (Type const&) + { + } + // DataType // // @@ -7471,8 +8090,10 @@ namespace CIAO else value_none (o); if (o.sequence_p ()) sequence (o); else sequence_none (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.alias_p ()) alias (o); + else alias_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -7489,8 +8110,10 @@ namespace CIAO else value_none (o); if (o.sequence_p ()) sequence (o); else sequence_none (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.alias_p ()) alias (o); + else alias_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -7605,24 +8228,46 @@ namespace CIAO } void DataType:: - id (Type& o) + alias (Type& o) + { + dispatch (o.alias ()); + } + + void DataType:: + alias (Type const& o) { - dispatch (o.id ()); + dispatch (o.alias ()); } void DataType:: - id (Type const& o) + alias_none (Type&) { - dispatch (o.id ()); } void DataType:: - id_none (Type&) + alias_none (Type const&) { } void DataType:: - id_none (Type const&) + xmi_id (Type& o) + { + dispatch (o.xmi_id ()); + } + + void DataType:: + xmi_id (Type const& o) + { + dispatch (o.xmi_id ()); + } + + void DataType:: + xmi_id_none (Type&) + { + } + + void DataType:: + xmi_id_none (Type const&) { } @@ -7657,6 +8302,7 @@ namespace CIAO longlong (o); ulonglong (o); longdouble (o); + element (o); member (o); post (o); } @@ -7678,6 +8324,7 @@ namespace CIAO longlong (o); ulonglong (o); longdouble (o); + element (o); member (o); post (o); } @@ -8785,6 +9432,90 @@ namespace CIAO } void DataValue:: + element (Type& o) + { + // VC6 anathema strikes again + // + DataValue::Type::element_iterator b (o.begin_element()), e (o.end_element()); + + if (b != e) + { + element_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) element_next (o); + } + + element_post (o); + } + + else element_none (o); + } + + void DataValue:: + element (Type const& o) + { + // VC6 anathema strikes again + // + DataValue::Type::element_const_iterator b (o.begin_element()), e (o.end_element()); + + if (b != e) + { + element_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) element_next (o); + } + + element_post (o); + } + + else element_none (o); + } + + void DataValue:: + element_pre (Type&) + { + } + + void DataValue:: + element_pre (Type const&) + { + } + + void DataValue:: + element_next (Type&) + { + } + + void DataValue:: + element_next (Type const&) + { + } + + void DataValue:: + element_post (Type&) + { + } + + void DataValue:: + element_post (Type const&) + { + } + + void DataValue:: + element_none (Type&) + { + } + + void DataValue:: + element_none (Type const&) + { + } + + void DataValue:: member (Type& o) { // VC6 anathema strikes again @@ -8878,6 +9609,86 @@ namespace CIAO { } + // AliasType + // + // + + void AliasType:: + traverse (Type& o) + { + pre (o); + name (o); + typeId (o); + elementType (o); + post (o); + } + + void AliasType:: + traverse (Type const& o) + { + pre (o); + name (o); + typeId (o); + elementType (o); + post (o); + } + + void AliasType:: + pre (Type&) + { + } + + void AliasType:: + pre (Type const&) + { + } + + void AliasType:: + name (Type& o) + { + dispatch (o.name ()); + } + + void AliasType:: + name (Type const& o) + { + dispatch (o.name ()); + } + + void AliasType:: + typeId (Type& o) + { + dispatch (o.typeId ()); + } + + void AliasType:: + typeId (Type const& o) + { + dispatch (o.typeId ()); + } + + void AliasType:: + elementType (Type& o) + { + dispatch (o.elementType ()); + } + + void AliasType:: + elementType (Type const& o) + { + dispatch (o.elementType ()); + } + + void AliasType:: + post (Type&) + { + } + + void AliasType:: + post (Type const&) + { + } + // EnumType // // @@ -10393,8 +11204,8 @@ namespace CIAO execParameter (o); deployRequirement (o); deployedResource (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -10409,8 +11220,8 @@ namespace CIAO execParameter (o); deployRequirement (o); deployedResource (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -10841,24 +11652,24 @@ namespace CIAO } void ArtifactDeploymentDescription:: - id (Type& o) + xmi_id (Type& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void ArtifactDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void ArtifactDeploymentDescription:: - id_none (Type&) + xmi_id_none (Type&) { } void ArtifactDeploymentDescription:: - id_none (Type const&) + xmi_id_none (Type const&) { } @@ -10885,8 +11696,8 @@ namespace CIAO artifact (o); execParameter (o); deployRequirement (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -10899,8 +11710,8 @@ namespace CIAO artifact (o); execParameter (o); deployRequirement (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -11235,24 +12046,24 @@ namespace CIAO } void MonolithicDeploymentDescription:: - id (Type& o) + xmi_id (Type& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void MonolithicDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void MonolithicDeploymentDescription:: - id_none (Type&) + xmi_id_none (Type&) { } void MonolithicDeploymentDescription:: - id_none (Type const&) + xmi_id_none (Type const&) { } @@ -11448,8 +12259,8 @@ namespace CIAO deployedResource (o); if (o.deployedSharedResource_p ()) deployedSharedResource (o); else deployedSharedResource_none (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -11465,8 +12276,8 @@ namespace CIAO deployedResource (o); if (o.deployedSharedResource_p ()) deployedSharedResource (o); else deployedSharedResource_none (o); - if (o.id_p ()) id (o); - else id_none (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); post (o); } @@ -11719,24 +12530,24 @@ namespace CIAO } void InstanceDeploymentDescription:: - id (Type& o) + xmi_id (Type& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void InstanceDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - dispatch (o.id ()); + dispatch (o.xmi_id ()); } void InstanceDeploymentDescription:: - id_none (Type&) + xmi_id_none (Type&) { } void InstanceDeploymentDescription:: - id_none (Type const&) + xmi_id_none (Type const&) { } @@ -12217,6 +13028,10 @@ namespace CIAO { pre (o); location (o); + provider (o); + if (o.portName_p ()) portName (o); + else portName_none (o); + supportedType (o); post (o); } @@ -12225,6 +13040,10 @@ namespace CIAO { pre (o); location (o); + provider (o); + if (o.portName_p ()) portName (o); + else portName_none (o); + supportedType (o); post (o); } @@ -12251,6 +13070,110 @@ namespace CIAO } void ExternalReferenceEndpoint:: + provider (Type& o) + { + dispatch (o.provider ()); + } + + void ExternalReferenceEndpoint:: + provider (Type const& o) + { + dispatch (o.provider ()); + } + + void ExternalReferenceEndpoint:: + portName (Type& o) + { + dispatch (o.portName ()); + } + + void ExternalReferenceEndpoint:: + portName (Type const& o) + { + dispatch (o.portName ()); + } + + void ExternalReferenceEndpoint:: + portName_none (Type&) + { + } + + void ExternalReferenceEndpoint:: + portName_none (Type const&) + { + } + + void ExternalReferenceEndpoint:: + supportedType (Type& o) + { + // VC6 anathema strikes again + // + ExternalReferenceEndpoint::Type::supportedType_iterator b (o.begin_supportedType()), e (o.end_supportedType()); + + if (b != e) + { + supportedType_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) supportedType_next (o); + } + + supportedType_post (o); + } + } + + void ExternalReferenceEndpoint:: + supportedType (Type const& o) + { + // VC6 anathema strikes again + // + ExternalReferenceEndpoint::Type::supportedType_const_iterator b (o.begin_supportedType()), e (o.end_supportedType()); + + if (b != e) + { + supportedType_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) supportedType_next (o); + } + + supportedType_post (o); + } + } + + void ExternalReferenceEndpoint:: + supportedType_pre (Type&) + { + } + + void ExternalReferenceEndpoint:: + supportedType_pre (Type const&) + { + } + + void ExternalReferenceEndpoint:: + supportedType_next (Type&) + { + } + + void ExternalReferenceEndpoint:: + supportedType_next (Type const&) + { + } + + void ExternalReferenceEndpoint:: + supportedType_post (Type&) + { + } + + void ExternalReferenceEndpoint:: + supportedType_post (Type const&) + { + } + + void ExternalReferenceEndpoint:: post (Type&) { } @@ -13426,110 +14349,6 @@ namespace CIAO { } - // ComponentPackageReference - // - // - - void ComponentPackageReference:: - traverse (Type& o) - { - pre (o); - if (o.requiredUUID_p ()) requiredUUID (o); - else requiredUUID_none (o); - if (o.requiredName_p ()) requiredName (o); - else requiredName_none (o); - requiredType (o); - post (o); - } - - void ComponentPackageReference:: - traverse (Type const& o) - { - pre (o); - if (o.requiredUUID_p ()) requiredUUID (o); - else requiredUUID_none (o); - if (o.requiredName_p ()) requiredName (o); - else requiredName_none (o); - requiredType (o); - post (o); - } - - void ComponentPackageReference:: - pre (Type&) - { - } - - void ComponentPackageReference:: - pre (Type const&) - { - } - - void ComponentPackageReference:: - requiredUUID (Type& o) - { - dispatch (o.requiredUUID ()); - } - - void ComponentPackageReference:: - requiredUUID (Type const& o) - { - dispatch (o.requiredUUID ()); - } - - void ComponentPackageReference:: - requiredUUID_none (Type&) - { - } - - void ComponentPackageReference:: - requiredUUID_none (Type const&) - { - } - - void ComponentPackageReference:: - requiredName (Type& o) - { - dispatch (o.requiredName ()); - } - - void ComponentPackageReference:: - requiredName (Type const& o) - { - dispatch (o.requiredName ()); - } - - void ComponentPackageReference:: - requiredName_none (Type&) - { - } - - void ComponentPackageReference:: - requiredName_none (Type const&) - { - } - - void ComponentPackageReference:: - requiredType (Type& o) - { - dispatch (o.requiredType ()); - } - - void ComponentPackageReference:: - requiredType (Type const& o) - { - dispatch (o.requiredType ()); - } - - void ComponentPackageReference:: - post (Type&) - { - } - - void ComponentPackageReference:: - post (Type const&) - { - } - // SubcomponentPortEndpoint // // @@ -13991,6 +14810,72 @@ namespace CIAO post (Type const&) { } + + // PlanLocality + // + // + + void PlanLocality:: + traverse (Type& o) + { + pre (o); + constraint (o); + constrainedInstance (o); + post (o); + } + + void PlanLocality:: + traverse (Type const& o) + { + pre (o); + constraint (o); + constrainedInstance (o); + post (o); + } + + void PlanLocality:: + pre (Type&) + { + } + + void PlanLocality:: + pre (Type const&) + { + } + + void PlanLocality:: + constraint (Type& o) + { + dispatch (o.constraint ()); + } + + void PlanLocality:: + constraint (Type const& o) + { + dispatch (o.constraint ()); + } + + void PlanLocality:: + constrainedInstance (Type& o) + { + dispatch (o.constrainedInstance ()); + } + + void PlanLocality:: + constrainedInstance (Type const& o) + { + dispatch (o.constrainedInstance ()); + } + + void PlanLocality:: + post (Type&) + { + } + + void PlanLocality:: + post (Type const&) + { + } } } } @@ -14001,6 +14886,45 @@ namespace CIAO { namespace Writer { + // IdRef + // + // + + IdRef:: + IdRef (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + IdRef:: + IdRef () + { + } + + void IdRef:: + traverse (Type const& o) + { + Traversal::IdRef::traverse (o); + } + + void IdRef:: + href (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); + attr_ (&a); + Traversal::IdRef::href (o); + attr_ (0); + } + + void IdRef:: + idref (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("idref", "http://www.omg.org/Deployment", "", top_ ()); + attr_ (&a); + Traversal::IdRef::idref (o); + attr_ (0); + } + // TCKind // // @@ -14021,43 +14945,43 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::TCKind::tk_null) s = ACE_TEXT ("tk_null"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_void) s = ACE_TEXT ("tk_void"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_short) s = ACE_TEXT ("tk_short"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_long) s = ACE_TEXT ("tk_long"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_ushort) s = ACE_TEXT ("tk_ushort"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_ulong) s = ACE_TEXT ("tk_ulong"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_float) s = ACE_TEXT ("tk_float"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_double) s = ACE_TEXT ("tk_double"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_boolean) s = ACE_TEXT ("tk_boolean"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_char) s = ACE_TEXT ("tk_char"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_octet) s = ACE_TEXT ("tk_octet"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_any) s = ACE_TEXT ("tk_any"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_TypeCode) s = ACE_TEXT ("tk_TypeCode"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_Principal) s = ACE_TEXT ("tk_Principal"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_objref) s = ACE_TEXT ("tk_objref"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_struct) s = ACE_TEXT ("tk_struct"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_union) s = ACE_TEXT ("tk_union"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_enum) s = ACE_TEXT ("tk_enum"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_string) s = ACE_TEXT ("tk_string"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_sequence) s = ACE_TEXT ("tk_sequence"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_array) s = ACE_TEXT ("tk_array"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_alias) s = ACE_TEXT ("tk_alias"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_except) s = ACE_TEXT ("tk_except"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_longlong) s = ACE_TEXT ("tk_longlong"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_ulonglong) s = ACE_TEXT ("tk_ulonglong"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_longdouble) s = ACE_TEXT ("tk_longdouble"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_wchar) s = ACE_TEXT ("tk_wchar"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_wstring) s = ACE_TEXT ("tk_wstring"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_wfixed) s = ACE_TEXT ("tk_wfixed"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_value) s = ACE_TEXT ("tk_value"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_value_box) s = ACE_TEXT ("tk_value_box"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_native) s = ACE_TEXT ("tk_native"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_abstract_interface) s = ACE_TEXT ("tk_abstract_interface"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_local_interface) s = ACE_TEXT ("tk_local_interface"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_component) s = ACE_TEXT ("tk_component"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_home) s = ACE_TEXT ("tk_home"); - else if (o == ::CIAO::Config_Handlers::TCKind::tk_event) s = ACE_TEXT ("tk_event"); + if (o == ::CIAO::Config_Handlers::TCKind::tk_null) s = "tk_null"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_void) s = "tk_void"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_short) s = "tk_short"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_long) s = "tk_long"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_ushort) s = "tk_ushort"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_ulong) s = "tk_ulong"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_float) s = "tk_float"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_double) s = "tk_double"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_boolean) s = "tk_boolean"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_char) s = "tk_char"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_octet) s = "tk_octet"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_any) s = "tk_any"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_TypeCode) s = "tk_TypeCode"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_Principal) s = "tk_Principal"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_objref) s = "tk_objref"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_struct) s = "tk_struct"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_union) s = "tk_union"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_enum) s = "tk_enum"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_string) s = "tk_string"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_sequence) s = "tk_sequence"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_array) s = "tk_array"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_alias) s = "tk_alias"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_except) s = "tk_except"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_longlong) s = "tk_longlong"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_ulonglong) s = "tk_ulonglong"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_longdouble) s = "tk_longdouble"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_wchar) s = "tk_wchar"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_wstring) s = "tk_wstring"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_wfixed) s = "tk_wfixed"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_value) s = "tk_value"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_value_box) s = "tk_value_box"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_native) s = "tk_native"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_abstract_interface) s = "tk_abstract_interface"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_local_interface) s = "tk_local_interface"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_component) s = "tk_component"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_home) s = "tk_home"; + else if (o == ::CIAO::Config_Handlers::TCKind::tk_event) s = "tk_event"; else { } @@ -14097,7 +15021,7 @@ namespace CIAO void DataType:: kind (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("kind"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("kind", top_ ())); Traversal::DataType::kind (o); pop_ (); } @@ -14105,7 +15029,7 @@ namespace CIAO void DataType:: enum_ (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("enum"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("enum", top_ ())); Traversal::DataType::enum_ (o); pop_ (); } @@ -14113,7 +15037,7 @@ namespace CIAO void DataType:: struct_ (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("struct"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("struct", top_ ())); Traversal::DataType::struct_ (o); pop_ (); } @@ -14121,7 +15045,7 @@ namespace CIAO void DataType:: value (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("value"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("value", top_ ())); Traversal::DataType::value (o); pop_ (); } @@ -14129,17 +15053,25 @@ namespace CIAO void DataType:: sequence (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("sequence"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("sequence", top_ ())); Traversal::DataType::sequence (o); pop_ (); } void DataType:: - id (Type const& o) + alias (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("alias", top_ ())); + Traversal::DataType::alias (o); + pop_ (); + } + + void DataType:: + xmi_id (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "http://www.omg.org/Deployment", "", top_ ()); attr_ (&a); - Traversal::DataType::id (o); + Traversal::DataType::xmi_id (o); attr_ (0); } @@ -14167,7 +15099,7 @@ namespace CIAO void DataValue:: short_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("short"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("short", top_ ())); } void DataValue:: @@ -14186,7 +15118,7 @@ namespace CIAO void DataValue:: long_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("long"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("long", top_ ())); } void DataValue:: @@ -14205,7 +15137,7 @@ namespace CIAO void DataValue:: ushort_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("ushort"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("ushort", top_ ())); } void DataValue:: @@ -14224,7 +15156,7 @@ namespace CIAO void DataValue:: ulong_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("ulong"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("ulong", top_ ())); } void DataValue:: @@ -14243,7 +15175,7 @@ namespace CIAO void DataValue:: float_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("float"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("float", top_ ())); } void DataValue:: @@ -14262,7 +15194,7 @@ namespace CIAO void DataValue:: double_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("double"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("double", top_ ())); } void DataValue:: @@ -14281,7 +15213,7 @@ namespace CIAO void DataValue:: boolean_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("boolean"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("boolean", top_ ())); } void DataValue:: @@ -14300,7 +15232,7 @@ namespace CIAO void DataValue:: octet_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("octet"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("octet", top_ ())); } void DataValue:: @@ -14319,7 +15251,7 @@ namespace CIAO void DataValue:: enum_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("enum"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("enum", top_ ())); } void DataValue:: @@ -14338,7 +15270,7 @@ namespace CIAO void DataValue:: string_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("string"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("string", top_ ())); } void DataValue:: @@ -14357,7 +15289,7 @@ namespace CIAO void DataValue:: longlong_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("longlong"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("longlong", top_ ())); } void DataValue:: @@ -14376,7 +15308,7 @@ namespace CIAO void DataValue:: ulonglong_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("ulonglong"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("ulonglong", top_ ())); } void DataValue:: @@ -14395,7 +15327,7 @@ namespace CIAO void DataValue:: longdouble_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("longdouble"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("longdouble", top_ ())); } void DataValue:: @@ -14412,9 +15344,28 @@ namespace CIAO } void DataValue:: + element_pre (Type const&) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("element", top_ ())); + } + + void DataValue:: + element_next (Type const& o) + { + element_post (o); + element_pre (o); + } + + void DataValue:: + element_post (Type const&) + { + pop_ (); + } + + void DataValue:: member_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("member"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("member", top_ ())); } void DataValue:: @@ -14430,6 +15381,51 @@ namespace CIAO pop_ (); } + // AliasType + // + // + + AliasType:: + AliasType (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + AliasType:: + AliasType () + { + } + + void AliasType:: + traverse (Type const& o) + { + Traversal::AliasType::traverse (o); + } + + void AliasType:: + name (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); + Traversal::AliasType::name (o); + pop_ (); + } + + void AliasType:: + typeId (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("typeId", top_ ())); + Traversal::AliasType::typeId (o); + pop_ (); + } + + void AliasType:: + elementType (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("elementType", top_ ())); + Traversal::AliasType::elementType (o); + pop_ (); + } + // EnumType // // @@ -14454,7 +15450,7 @@ namespace CIAO void EnumType:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::EnumType::name (o); pop_ (); } @@ -14462,7 +15458,7 @@ namespace CIAO void EnumType:: typeId (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("typeId"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("typeId", top_ ())); Traversal::EnumType::typeId (o); pop_ (); } @@ -14470,7 +15466,7 @@ namespace CIAO void EnumType:: member_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("member"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("member", top_ ())); } void EnumType:: @@ -14510,7 +15506,7 @@ namespace CIAO void StructType:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::StructType::name (o); pop_ (); } @@ -14518,7 +15514,7 @@ namespace CIAO void StructType:: typeId (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("typeId"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("typeId", top_ ())); Traversal::StructType::typeId (o); pop_ (); } @@ -14526,7 +15522,7 @@ namespace CIAO void StructType:: member_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("member"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("member", top_ ())); } void StructType:: @@ -14566,7 +15562,7 @@ namespace CIAO void StructMemberType:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::StructMemberType::name (o); pop_ (); } @@ -14574,7 +15570,7 @@ namespace CIAO void StructMemberType:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::StructMemberType::type (o); pop_ (); } @@ -14603,7 +15599,7 @@ namespace CIAO void ValueType:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ValueType::name (o); pop_ (); } @@ -14611,7 +15607,7 @@ namespace CIAO void ValueType:: typeId (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("typeId"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("typeId", top_ ())); Traversal::ValueType::typeId (o); pop_ (); } @@ -14619,7 +15615,7 @@ namespace CIAO void ValueType:: modifier (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("modifier"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("modifier", top_ ())); Traversal::ValueType::modifier (o); pop_ (); } @@ -14627,7 +15623,7 @@ namespace CIAO void ValueType:: baseType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("baseType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("baseType", top_ ())); Traversal::ValueType::baseType (o); pop_ (); } @@ -14635,7 +15631,7 @@ namespace CIAO void ValueType:: member_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("member"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("member", top_ ())); } void ValueType:: @@ -14675,7 +15671,7 @@ namespace CIAO void ValueMemberType:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ValueMemberType::name (o); pop_ (); } @@ -14683,7 +15679,7 @@ namespace CIAO void ValueMemberType:: visibility (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("visibility"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("visibility", top_ ())); Traversal::ValueMemberType::visibility (o); pop_ (); } @@ -14691,7 +15687,7 @@ namespace CIAO void ValueMemberType:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::ValueMemberType::type (o); pop_ (); } @@ -14720,7 +15716,7 @@ namespace CIAO void NamedValue:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::NamedValue::name (o); pop_ (); } @@ -14728,7 +15724,7 @@ namespace CIAO void NamedValue:: value (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("value"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("value", top_ ())); Traversal::NamedValue::value (o); pop_ (); } @@ -14757,7 +15753,7 @@ namespace CIAO void SequenceType:: bound (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("bound"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("bound", top_ ())); Traversal::SequenceType::bound (o); pop_ (); } @@ -14765,7 +15761,7 @@ namespace CIAO void SequenceType:: elementType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("elementType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("elementType", top_ ())); Traversal::SequenceType::elementType (o); pop_ (); } @@ -14794,7 +15790,7 @@ namespace CIAO void Any:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::Any::type (o); pop_ (); } @@ -14802,7 +15798,7 @@ namespace CIAO void Any:: value (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("value"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("value", top_ ())); Traversal::Any::value (o); pop_ (); } @@ -14831,7 +15827,7 @@ namespace CIAO void Property:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Property::name (o); pop_ (); } @@ -14839,7 +15835,7 @@ namespace CIAO void Property:: value (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("value"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("value", top_ ())); Traversal::Property::value (o); pop_ (); } @@ -14864,12 +15860,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Quantity) s = ACE_TEXT ("Quantity"); - else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Capacity) s = ACE_TEXT ("Capacity"); - else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Minimum) s = ACE_TEXT ("Minimum"); - else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Maximum) s = ACE_TEXT ("Maximum"); - else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Attribute) s = ACE_TEXT ("Attribute"); - else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Selection) s = ACE_TEXT ("Selection"); + if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Quantity) s = "Quantity"; + else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Capacity) s = "Capacity"; + else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Minimum) s = "Minimum"; + else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Maximum) s = "Maximum"; + else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Attribute) s = "Attribute"; + else if (o == ::CIAO::Config_Handlers::SatisfierPropertyKind::Selection) s = "Selection"; else { } @@ -14909,7 +15905,7 @@ namespace CIAO void SatisfierProperty:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::SatisfierProperty::name (o); pop_ (); } @@ -14917,7 +15913,7 @@ namespace CIAO void SatisfierProperty:: kind (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("kind"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("kind", top_ ())); Traversal::SatisfierProperty::kind (o); pop_ (); } @@ -14925,7 +15921,7 @@ namespace CIAO void SatisfierProperty:: dynamic (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dynamic"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dynamic", top_ ())); Traversal::SatisfierProperty::dynamic (o); pop_ (); } @@ -14933,7 +15929,7 @@ namespace CIAO void SatisfierProperty:: value (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("value"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("value", top_ ())); Traversal::SatisfierProperty::value (o); pop_ (); } @@ -14962,7 +15958,7 @@ namespace CIAO void Resource:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Resource::name (o); pop_ (); } @@ -14970,7 +15966,7 @@ namespace CIAO void Resource:: resourceType_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceType", top_ ())); } void Resource:: @@ -14989,7 +15985,7 @@ namespace CIAO void Resource:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void Resource:: @@ -15029,7 +16025,7 @@ namespace CIAO void Requirement:: resourceType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceType", top_ ())); Traversal::Requirement::resourceType (o); pop_ (); } @@ -15037,7 +16033,7 @@ namespace CIAO void Requirement:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Requirement::name (o); pop_ (); } @@ -15045,7 +16041,7 @@ namespace CIAO void Requirement:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void Requirement:: @@ -15085,7 +16081,7 @@ namespace CIAO void ResourceDeploymentDescription:: requirementName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requirementName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requirementName", top_ ())); Traversal::ResourceDeploymentDescription::requirementName (o); pop_ (); } @@ -15093,7 +16089,7 @@ namespace CIAO void ResourceDeploymentDescription:: resourceName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceName", top_ ())); Traversal::ResourceDeploymentDescription::resourceName (o); pop_ (); } @@ -15101,7 +16097,7 @@ namespace CIAO void ResourceDeploymentDescription:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void ResourceDeploymentDescription:: @@ -15141,7 +16137,7 @@ namespace CIAO void ArtifactDeploymentDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ArtifactDeploymentDescription::name (o); pop_ (); } @@ -15149,7 +16145,7 @@ namespace CIAO void ArtifactDeploymentDescription:: source_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("source"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("source", top_ ())); } void ArtifactDeploymentDescription:: @@ -15168,7 +16164,7 @@ namespace CIAO void ArtifactDeploymentDescription:: node (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("node"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("node", top_ ())); Traversal::ArtifactDeploymentDescription::node (o); pop_ (); } @@ -15176,7 +16172,7 @@ namespace CIAO void ArtifactDeploymentDescription:: location_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("location"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("location", top_ ())); } void ArtifactDeploymentDescription:: @@ -15195,7 +16191,7 @@ namespace CIAO void ArtifactDeploymentDescription:: execParameter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("execParameter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("execParameter", top_ ())); } void ArtifactDeploymentDescription:: @@ -15214,7 +16210,7 @@ namespace CIAO void ArtifactDeploymentDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void ArtifactDeploymentDescription:: @@ -15233,7 +16229,7 @@ namespace CIAO void ArtifactDeploymentDescription:: deployedResource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployedResource", top_ ())); } void ArtifactDeploymentDescription:: @@ -15250,11 +16246,11 @@ namespace CIAO } void ArtifactDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "http://www.omg.org/Deployment", "", top_ ()); attr_ (&a); - Traversal::ArtifactDeploymentDescription::id (o); + Traversal::ArtifactDeploymentDescription::xmi_id (o); attr_ (0); } @@ -15282,7 +16278,7 @@ namespace CIAO void MonolithicDeploymentDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::MonolithicDeploymentDescription::name (o); pop_ (); } @@ -15290,7 +16286,7 @@ namespace CIAO void MonolithicDeploymentDescription:: source_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("source"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("source", top_ ())); } void MonolithicDeploymentDescription:: @@ -15309,7 +16305,7 @@ namespace CIAO void MonolithicDeploymentDescription:: artifact_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("artifact"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("artifact", top_ ())); } void MonolithicDeploymentDescription:: @@ -15328,7 +16324,7 @@ namespace CIAO void MonolithicDeploymentDescription:: execParameter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("execParameter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("execParameter", top_ ())); } void MonolithicDeploymentDescription:: @@ -15347,7 +16343,7 @@ namespace CIAO void MonolithicDeploymentDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void MonolithicDeploymentDescription:: @@ -15364,11 +16360,11 @@ namespace CIAO } void MonolithicDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "http://www.omg.org/Deployment", "", top_ ()); attr_ (&a); - Traversal::MonolithicDeploymentDescription::id (o); + Traversal::MonolithicDeploymentDescription::xmi_id (o); attr_ (0); } @@ -15392,11 +16388,11 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::ResourceUsageKind::None) s = ACE_TEXT ("None"); - else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::InstanceUsesResource) s = ACE_TEXT ("InstanceUsesResource"); - else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::ResourceUsesInstance) s = ACE_TEXT ("ResourceUsesInstance"); - else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::PortUsesResource) s = ACE_TEXT ("PortUsesResource"); - else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::ResourceUsesPort) s = ACE_TEXT ("ResourceUsesPort"); + if (o == ::CIAO::Config_Handlers::ResourceUsageKind::None) s = "None"; + else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::InstanceUsesResource) s = "InstanceUsesResource"; + else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::ResourceUsesInstance) s = "ResourceUsesInstance"; + else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::PortUsesResource) s = "PortUsesResource"; + else if (o == ::CIAO::Config_Handlers::ResourceUsageKind::ResourceUsesPort) s = "ResourceUsesPort"; else { } @@ -15436,7 +16432,7 @@ namespace CIAO void InstanceResourceDeploymentDescription:: resourceUsage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceUsage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceUsage", top_ ())); Traversal::InstanceResourceDeploymentDescription::resourceUsage (o); pop_ (); } @@ -15444,7 +16440,7 @@ namespace CIAO void InstanceResourceDeploymentDescription:: requirementName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requirementName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requirementName", top_ ())); Traversal::InstanceResourceDeploymentDescription::requirementName (o); pop_ (); } @@ -15452,7 +16448,7 @@ namespace CIAO void InstanceResourceDeploymentDescription:: resourceName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceName", top_ ())); Traversal::InstanceResourceDeploymentDescription::resourceName (o); pop_ (); } @@ -15460,7 +16456,7 @@ namespace CIAO void InstanceResourceDeploymentDescription:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void InstanceResourceDeploymentDescription:: @@ -15500,7 +16496,7 @@ namespace CIAO void InstanceDeploymentDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::InstanceDeploymentDescription::name (o); pop_ (); } @@ -15508,7 +16504,7 @@ namespace CIAO void InstanceDeploymentDescription:: node (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("node"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("node", top_ ())); Traversal::InstanceDeploymentDescription::node (o); pop_ (); } @@ -15516,7 +16512,7 @@ namespace CIAO void InstanceDeploymentDescription:: source (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("source"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("source", top_ ())); Traversal::InstanceDeploymentDescription::source (o); pop_ (); } @@ -15524,7 +16520,7 @@ namespace CIAO void InstanceDeploymentDescription:: implementation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("implementation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("implementation", top_ ())); Traversal::InstanceDeploymentDescription::implementation (o); pop_ (); } @@ -15532,7 +16528,7 @@ namespace CIAO void InstanceDeploymentDescription:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void InstanceDeploymentDescription:: @@ -15551,7 +16547,7 @@ namespace CIAO void InstanceDeploymentDescription:: deployedResource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployedResource", top_ ())); } void InstanceDeploymentDescription:: @@ -15570,17 +16566,17 @@ namespace CIAO void InstanceDeploymentDescription:: deployedSharedResource (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployedSharedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployedSharedResource", top_ ())); Traversal::InstanceDeploymentDescription::deployedSharedResource (o); pop_ (); } void InstanceDeploymentDescription:: - id (Type const& o) + xmi_id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "http://www.omg.org/Deployment", "", top_ ()); attr_ (&a); - Traversal::InstanceDeploymentDescription::id (o); + Traversal::InstanceDeploymentDescription::xmi_id (o); attr_ (0); } @@ -15604,12 +16600,12 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::Facet) s = ACE_TEXT ("Facet"); - else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::SimplexReceptacle) s = ACE_TEXT ("SimplexReceptacle"); - else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::MultiplexReceptacle) s = ACE_TEXT ("MultiplexReceptacle"); - else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventEmitter) s = ACE_TEXT ("EventEmitter"); - else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventPublisher) s = ACE_TEXT ("EventPublisher"); - else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventConsumer) s = ACE_TEXT ("EventConsumer"); + if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::Facet) s = "Facet"; + else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::SimplexReceptacle) s = "SimplexReceptacle"; + else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::MultiplexReceptacle) s = "MultiplexReceptacle"; + else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventEmitter) s = "EventEmitter"; + else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventPublisher) s = "EventPublisher"; + else if (o == ::CIAO::Config_Handlers::CCMComponentPortKind::EventConsumer) s = "EventConsumer"; else { } @@ -15649,7 +16645,7 @@ namespace CIAO void ComponentPortDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ComponentPortDescription::name (o); pop_ (); } @@ -15657,7 +16653,7 @@ namespace CIAO void ComponentPortDescription:: specificType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("specificType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("specificType", top_ ())); Traversal::ComponentPortDescription::specificType (o); pop_ (); } @@ -15665,7 +16661,7 @@ namespace CIAO void ComponentPortDescription:: supportedType_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("supportedType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("supportedType", top_ ())); } void ComponentPortDescription:: @@ -15684,7 +16680,7 @@ namespace CIAO void ComponentPortDescription:: provider (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("provider"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("provider", top_ ())); Traversal::ComponentPortDescription::provider (o); pop_ (); } @@ -15692,7 +16688,7 @@ namespace CIAO void ComponentPortDescription:: exclusiveProvider (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("exclusiveProvider"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("exclusiveProvider", top_ ())); Traversal::ComponentPortDescription::exclusiveProvider (o); pop_ (); } @@ -15700,7 +16696,7 @@ namespace CIAO void ComponentPortDescription:: exclusiveUser (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("exclusiveUser"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("exclusiveUser", top_ ())); Traversal::ComponentPortDescription::exclusiveUser (o); pop_ (); } @@ -15708,7 +16704,7 @@ namespace CIAO void ComponentPortDescription:: optional (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("optional"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("optional", top_ ())); Traversal::ComponentPortDescription::optional (o); pop_ (); } @@ -15716,7 +16712,7 @@ namespace CIAO void ComponentPortDescription:: kind (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("kind"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("kind", top_ ())); Traversal::ComponentPortDescription::kind (o); pop_ (); } @@ -15745,7 +16741,7 @@ namespace CIAO void ComponentPropertyDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ComponentPropertyDescription::name (o); pop_ (); } @@ -15753,7 +16749,7 @@ namespace CIAO void ComponentPropertyDescription:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::ComponentPropertyDescription::type (o); pop_ (); } @@ -15782,7 +16778,7 @@ namespace CIAO void ComponentExternalPortEndpoint:: portName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("portName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("portName", top_ ())); Traversal::ComponentExternalPortEndpoint::portName (o); pop_ (); } @@ -15811,7 +16807,7 @@ namespace CIAO void PlanSubcomponentPortEndpoint:: portName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("portName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("portName", top_ ())); Traversal::PlanSubcomponentPortEndpoint::portName (o); pop_ (); } @@ -15819,7 +16815,7 @@ namespace CIAO void PlanSubcomponentPortEndpoint:: provider (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("provider"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("provider", top_ ())); Traversal::PlanSubcomponentPortEndpoint::provider (o); pop_ (); } @@ -15827,7 +16823,7 @@ namespace CIAO void PlanSubcomponentPortEndpoint:: kind (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("kind"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("kind", top_ ())); Traversal::PlanSubcomponentPortEndpoint::kind (o); pop_ (); } @@ -15835,7 +16831,7 @@ namespace CIAO void PlanSubcomponentPortEndpoint:: instance (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("instance"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("instance", top_ ())); Traversal::PlanSubcomponentPortEndpoint::instance (o); pop_ (); } @@ -15864,11 +16860,46 @@ namespace CIAO void ExternalReferenceEndpoint:: location (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("location"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("location", top_ ())); Traversal::ExternalReferenceEndpoint::location (o); pop_ (); } + void ExternalReferenceEndpoint:: + provider (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("provider", top_ ())); + Traversal::ExternalReferenceEndpoint::provider (o); + pop_ (); + } + + void ExternalReferenceEndpoint:: + portName (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("portName", top_ ())); + Traversal::ExternalReferenceEndpoint::portName (o); + pop_ (); + } + + void ExternalReferenceEndpoint:: + supportedType_pre (Type const&) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("supportedType", top_ ())); + } + + void ExternalReferenceEndpoint:: + supportedType_next (Type const& o) + { + supportedType_post (o); + supportedType_pre (o); + } + + void ExternalReferenceEndpoint:: + supportedType_post (Type const&) + { + pop_ (); + } + // ConnectionResourceDeploymentDescription // // @@ -15893,7 +16924,7 @@ namespace CIAO void ConnectionResourceDeploymentDescription:: targetName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("targetName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("targetName", top_ ())); Traversal::ConnectionResourceDeploymentDescription::targetName (o); pop_ (); } @@ -15901,7 +16932,7 @@ namespace CIAO void ConnectionResourceDeploymentDescription:: requirementName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requirementName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requirementName", top_ ())); Traversal::ConnectionResourceDeploymentDescription::requirementName (o); pop_ (); } @@ -15909,7 +16940,7 @@ namespace CIAO void ConnectionResourceDeploymentDescription:: resourceName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceName", top_ ())); Traversal::ConnectionResourceDeploymentDescription::resourceName (o); pop_ (); } @@ -15917,7 +16948,7 @@ namespace CIAO void ConnectionResourceDeploymentDescription:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void ConnectionResourceDeploymentDescription:: @@ -15957,7 +16988,7 @@ namespace CIAO void PlanConnectionDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::PlanConnectionDescription::name (o); pop_ (); } @@ -15965,7 +16996,7 @@ namespace CIAO void PlanConnectionDescription:: source (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("source"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("source", top_ ())); Traversal::PlanConnectionDescription::source (o); pop_ (); } @@ -15973,7 +17004,7 @@ namespace CIAO void PlanConnectionDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void PlanConnectionDescription:: @@ -15992,7 +17023,7 @@ namespace CIAO void PlanConnectionDescription:: externalEndpoint_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalEndpoint"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalEndpoint", top_ ())); } void PlanConnectionDescription:: @@ -16011,7 +17042,7 @@ namespace CIAO void PlanConnectionDescription:: internalEndpoint_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("internalEndpoint"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("internalEndpoint", top_ ())); } void PlanConnectionDescription:: @@ -16030,7 +17061,7 @@ namespace CIAO void PlanConnectionDescription:: externalReference_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalReference"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalReference", top_ ())); } void PlanConnectionDescription:: @@ -16049,7 +17080,7 @@ namespace CIAO void PlanConnectionDescription:: deployedResource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployedResource", top_ ())); } void PlanConnectionDescription:: @@ -16089,7 +17120,7 @@ namespace CIAO void ImplementationDependency:: requiredType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requiredType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requiredType", top_ ())); Traversal::ImplementationDependency::requiredType (o); pop_ (); } @@ -16118,7 +17149,7 @@ namespace CIAO void Capability:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Capability::name (o); pop_ (); } @@ -16126,7 +17157,7 @@ namespace CIAO void Capability:: resourceType_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceType", top_ ())); } void Capability:: @@ -16145,7 +17176,7 @@ namespace CIAO void Capability:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void Capability:: @@ -16185,7 +17216,7 @@ namespace CIAO void ImplementationRequirement:: resourceUsage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceUsage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceUsage", top_ ())); Traversal::ImplementationRequirement::resourceUsage (o); pop_ (); } @@ -16193,7 +17224,7 @@ namespace CIAO void ImplementationRequirement:: resourcePort (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourcePort"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourcePort", top_ ())); Traversal::ImplementationRequirement::resourcePort (o); pop_ (); } @@ -16201,7 +17232,7 @@ namespace CIAO void ImplementationRequirement:: componentPort (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("componentPort"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("componentPort", top_ ())); Traversal::ImplementationRequirement::componentPort (o); pop_ (); } @@ -16209,7 +17240,7 @@ namespace CIAO void ImplementationRequirement:: resourceType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceType", top_ ())); Traversal::ImplementationRequirement::resourceType (o); pop_ (); } @@ -16217,7 +17248,7 @@ namespace CIAO void ImplementationRequirement:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::ImplementationRequirement::name (o); pop_ (); } @@ -16225,7 +17256,7 @@ namespace CIAO void ImplementationRequirement:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void ImplementationRequirement:: @@ -16241,51 +17272,6 @@ namespace CIAO pop_ (); } - // ComponentPackageReference - // - // - - ComponentPackageReference:: - ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR >& e) - : ::XSCRT::Writer< ACE_TCHAR > (e) - { - } - - ComponentPackageReference:: - ComponentPackageReference () - { - } - - void ComponentPackageReference:: - traverse (Type const& o) - { - Traversal::ComponentPackageReference::traverse (o); - } - - void ComponentPackageReference:: - requiredUUID (Type const& o) - { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requiredUUID"), top_ ())); - Traversal::ComponentPackageReference::requiredUUID (o); - pop_ (); - } - - void ComponentPackageReference:: - requiredName (Type const& o) - { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requiredName"), top_ ())); - Traversal::ComponentPackageReference::requiredName (o); - pop_ (); - } - - void ComponentPackageReference:: - requiredType (Type const& o) - { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("requiredType"), top_ ())); - Traversal::ComponentPackageReference::requiredType (o); - pop_ (); - } - // SubcomponentPortEndpoint // // @@ -16310,7 +17296,7 @@ namespace CIAO void SubcomponentPortEndpoint:: portName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("portName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("portName", top_ ())); Traversal::SubcomponentPortEndpoint::portName (o); pop_ (); } @@ -16318,7 +17304,7 @@ namespace CIAO void SubcomponentPortEndpoint:: instance (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("instance"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("instance", top_ ())); Traversal::SubcomponentPortEndpoint::instance (o); pop_ (); } @@ -16347,7 +17333,7 @@ namespace CIAO void AssemblyConnectionDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::AssemblyConnectionDescription::name (o); pop_ (); } @@ -16355,7 +17341,7 @@ namespace CIAO void AssemblyConnectionDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void AssemblyConnectionDescription:: @@ -16374,7 +17360,7 @@ namespace CIAO void AssemblyConnectionDescription:: internalEndpoint_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("internalEndpoint"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("internalEndpoint", top_ ())); } void AssemblyConnectionDescription:: @@ -16393,7 +17379,7 @@ namespace CIAO void AssemblyConnectionDescription:: externalEndpoint_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalEndpoint"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalEndpoint", top_ ())); } void AssemblyConnectionDescription:: @@ -16412,7 +17398,7 @@ namespace CIAO void AssemblyConnectionDescription:: externalReference_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalReference"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalReference", top_ ())); } void AssemblyConnectionDescription:: @@ -16427,6 +17413,81 @@ namespace CIAO { pop_ (); } + + // PlanLocalityKind + // + // + + PlanLocalityKind:: + PlanLocalityKind (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + PlanLocalityKind:: + PlanLocalityKind () + { + } + + void PlanLocalityKind:: + traverse (Type const& o) + { + ::std::basic_string< ACE_TCHAR > s; + + if (o == ::CIAO::Config_Handlers::PlanLocalityKind::SameProcess) s = "SameProcess"; + else if (o == ::CIAO::Config_Handlers::PlanLocalityKind::DifferentProcess) s = "DifferentProcess"; + else if (o == ::CIAO::Config_Handlers::PlanLocalityKind::NoConstraint) s = "NoConstraint"; + else + { + } + + if (::XSCRT::XML::Attribute< ACE_TCHAR >* a = attr_ ()) + { + a->value (s); + } + + else + { + top_().value (s); + } + } + + // PlanLocality + // + // + + PlanLocality:: + PlanLocality (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + PlanLocality:: + PlanLocality () + { + } + + void PlanLocality:: + traverse (Type const& o) + { + Traversal::PlanLocality::traverse (o); + } + + void PlanLocality:: + constraint (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("constraint", top_ ())); + Traversal::PlanLocality::constraint (o); + pop_ (); + } + + void PlanLocality:: + constrainedInstance (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("constrainedInstance", top_ ())); + Traversal::PlanLocality::constrainedInstance (o); + pop_ (); + } } } } diff --git a/CIAO/tools/Config_Handlers/Basic_Deployment_Data.hpp b/CIAO/tools/Config_Handlers/Basic_Deployment_Data.hpp index f67d45baeaa..e6c52c74a25 100644 --- a/CIAO/tools/Config_Handlers/Basic_Deployment_Data.hpp +++ b/CIAO/tools/Config_Handlers/Basic_Deployment_Data.hpp @@ -25,9 +25,11 @@ namespace CIAO { namespace Config_Handlers { + class IdRef; class TCKind; class DataType; class DataValue; + class AliasType; class EnumType; class StructType; class StructMemberType; @@ -58,9 +60,10 @@ namespace CIAO class ImplementationDependency; class Capability; class ImplementationRequirement; - class ComponentPackageReference; class SubcomponentPortEndpoint; class AssemblyConnectionDescription; + class PlanLocalityKind; + class PlanLocality; } } @@ -68,10 +71,52 @@ namespace CIAO #include <list> #include "XMLSchema/Types.hpp" +#include "XMI.hpp" + namespace CIAO { namespace Config_Handlers { + class XSC_XML_Handlers_Export IdRef : public ::XSCRT::Type + { + typedef ::XSCRT::Type Base; + + // href + // + public: + bool href_p () const; + ::XMLSchema::string< ACE_TCHAR > const& href () const; + ::XMLSchema::string< ACE_TCHAR >& href (); + void href (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > href_; + + // idref + // + public: + bool idref_p () const; + ::XMLSchema::IDREF< ACE_TCHAR > const& idref () const; + ::XMLSchema::IDREF< ACE_TCHAR >& idref (); + void idref (::XMLSchema::IDREF< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > idref_; + + public: + IdRef (); + + IdRef (::XSCRT::XML::Element< ACE_TCHAR > const&); + IdRef (IdRef const& s); + + IdRef& + operator= (IdRef const& s); + + private: + char regulator__; + }; + + class XSC_XML_Handlers_Export TCKind : public ::XSCRT::Type { public: @@ -195,16 +240,26 @@ namespace CIAO protected: ::std::auto_ptr< ::CIAO::Config_Handlers::SequenceType > sequence_; - // id + // alias // public: - bool id_p () const; - ::XMLSchema::ID< ACE_TCHAR > const& id () const; - ::XMLSchema::ID< ACE_TCHAR >& id (); - void id (::XMLSchema::ID< ACE_TCHAR > const& ); + bool alias_p () const; + ::CIAO::Config_Handlers::AliasType const& alias () const; + void alias (::CIAO::Config_Handlers::AliasType const& ); protected: - ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > id_; + ::std::auto_ptr< ::CIAO::Config_Handlers::AliasType > alias_; + + // xmi_id + // + public: + bool xmi_id_p () const; + ::XMLSchema::ID< ACE_TCHAR > const& xmi_id () const; + ::XMLSchema::ID< ACE_TCHAR >& xmi_id (); + void xmi_id (::XMLSchema::ID< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > xmi_id_; public: DataType (::CIAO::Config_Handlers::TCKind const& kind__); @@ -419,6 +474,21 @@ namespace CIAO protected: ::std::list< ::XMLSchema::double_ > longdouble_; + // element + // + public: + typedef ::std::list< ::CIAO::Config_Handlers::DataValue >::iterator element_iterator; + typedef ::std::list< ::CIAO::Config_Handlers::DataValue >::const_iterator element_const_iterator; + element_iterator begin_element (); + element_iterator end_element (); + element_const_iterator begin_element () const; + element_const_iterator end_element () const; + void add_element (::CIAO::Config_Handlers::DataValue const& ); + size_t count_element (void) const; + + protected: + ::std::list< ::CIAO::Config_Handlers::DataValue > element_; + // member // public: @@ -448,6 +518,53 @@ namespace CIAO }; + class XSC_XML_Handlers_Export AliasType : public ::XSCRT::Type + { + typedef ::XSCRT::Type Base; + + // name + // + public: + ::XMLSchema::string< ACE_TCHAR > const& name () const; + void name (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > name_; + + // typeId + // + public: + ::XMLSchema::string< ACE_TCHAR > const& typeId () const; + void typeId (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > typeId_; + + // elementType + // + public: + ::CIAO::Config_Handlers::DataType const& elementType () const; + void elementType (::CIAO::Config_Handlers::DataType const& ); + + protected: + ::std::auto_ptr< ::CIAO::Config_Handlers::DataType > elementType_; + + public: + AliasType (::XMLSchema::string< ACE_TCHAR > const& name__, + ::XMLSchema::string< ACE_TCHAR > const& typeId__, + ::CIAO::Config_Handlers::DataType const& elementType__); + + AliasType (::XSCRT::XML::Element< ACE_TCHAR > const&); + AliasType (AliasType const& s); + + AliasType& + operator= (AliasType const& s); + + private: + char regulator__; + }; + + class XSC_XML_Handlers_Export EnumType : public ::XSCRT::Type { typedef ::XSCRT::Type Base; @@ -753,11 +870,11 @@ namespace CIAO // public: bool bound_p () const; - ::XMLSchema::string< ACE_TCHAR > const& bound () const; - void bound (::XMLSchema::string< ACE_TCHAR > const& ); + ::XMLSchema::unsignedInt const& bound () const; + void bound (::XMLSchema::unsignedInt const& ); protected: - ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > bound_; + ::std::auto_ptr< ::XMLSchema::unsignedInt > bound_; // elementType // @@ -1210,16 +1327,16 @@ namespace CIAO protected: ::std::list< ::CIAO::Config_Handlers::ResourceDeploymentDescription > deployedResource_; - // id + // xmi_id // public: - bool id_p () const; - ::XMLSchema::ID< ACE_TCHAR > const& id () const; - ::XMLSchema::ID< ACE_TCHAR >& id (); - void id (::XMLSchema::ID< ACE_TCHAR > const& ); + bool xmi_id_p () const; + ::XMLSchema::ID< ACE_TCHAR > const& xmi_id () const; + ::XMLSchema::ID< ACE_TCHAR >& xmi_id (); + void xmi_id (::XMLSchema::ID< ACE_TCHAR > const& ); protected: - ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > id_; + ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > xmi_id_; public: ArtifactDeploymentDescription (::XMLSchema::string< ACE_TCHAR > const& name__, @@ -1267,17 +1384,17 @@ namespace CIAO // artifact // public: - typedef ::std::list< ::XMLSchema::IDREF< ACE_TCHAR > >::iterator artifact_iterator; - typedef ::std::list< ::XMLSchema::IDREF< ACE_TCHAR > >::const_iterator artifact_const_iterator; + typedef ::std::list< ::CIAO::Config_Handlers::IdRef >::iterator artifact_iterator; + typedef ::std::list< ::CIAO::Config_Handlers::IdRef >::const_iterator artifact_const_iterator; artifact_iterator begin_artifact (); artifact_iterator end_artifact (); artifact_const_iterator begin_artifact () const; artifact_const_iterator end_artifact () const; - void add_artifact (::XMLSchema::IDREF< ACE_TCHAR > const& ); + void add_artifact (::CIAO::Config_Handlers::IdRef const& ); size_t count_artifact (void) const; protected: - ::std::list< ::XMLSchema::IDREF< ACE_TCHAR > > artifact_; + ::std::list< ::CIAO::Config_Handlers::IdRef > artifact_; // execParameter // @@ -1309,16 +1426,16 @@ namespace CIAO protected: ::std::list< ::CIAO::Config_Handlers::Requirement > deployRequirement_; - // id + // xmi_id // public: - bool id_p () const; - ::XMLSchema::ID< ACE_TCHAR > const& id () const; - ::XMLSchema::ID< ACE_TCHAR >& id (); - void id (::XMLSchema::ID< ACE_TCHAR > const& ); + bool xmi_id_p () const; + ::XMLSchema::ID< ACE_TCHAR > const& xmi_id () const; + ::XMLSchema::ID< ACE_TCHAR >& xmi_id (); + void xmi_id (::XMLSchema::ID< ACE_TCHAR > const& ); protected: - ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > id_; + ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > xmi_id_; public: MonolithicDeploymentDescription (::XMLSchema::string< ACE_TCHAR > const& name__); @@ -1468,11 +1585,11 @@ namespace CIAO // implementation // public: - ::XMLSchema::IDREF< ACE_TCHAR > const& implementation () const; - void implementation (::XMLSchema::IDREF< ACE_TCHAR > const& ); + ::CIAO::Config_Handlers::IdRef const& implementation () const; + void implementation (::CIAO::Config_Handlers::IdRef const& ); protected: - ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > implementation_; + ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > implementation_; // configProperty // @@ -1514,22 +1631,22 @@ namespace CIAO protected: ::std::auto_ptr< ::CIAO::Config_Handlers::InstanceResourceDeploymentDescription > deployedSharedResource_; - // id + // xmi_id // public: - bool id_p () const; - ::XMLSchema::ID< ACE_TCHAR > const& id () const; - ::XMLSchema::ID< ACE_TCHAR >& id (); - void id (::XMLSchema::ID< ACE_TCHAR > const& ); + bool xmi_id_p () const; + ::XMLSchema::ID< ACE_TCHAR > const& xmi_id () const; + ::XMLSchema::ID< ACE_TCHAR >& xmi_id (); + void xmi_id (::XMLSchema::ID< ACE_TCHAR > const& ); protected: - ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > id_; + ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > xmi_id_; public: InstanceDeploymentDescription (::XMLSchema::string< ACE_TCHAR > const& name__, ::XMLSchema::string< ACE_TCHAR > const& node__, ::XMLSchema::string< ACE_TCHAR > const& source__, - ::XMLSchema::IDREF< ACE_TCHAR > const& implementation__); + ::CIAO::Config_Handlers::IdRef const& implementation__); InstanceDeploymentDescription (::XSCRT::XML::Element< ACE_TCHAR > const&); InstanceDeploymentDescription (InstanceDeploymentDescription const& s); @@ -1782,16 +1899,16 @@ namespace CIAO // instance // public: - ::XMLSchema::IDREF< ACE_TCHAR > const& instance () const; - void instance (::XMLSchema::IDREF< ACE_TCHAR > const& ); + ::CIAO::Config_Handlers::IdRef const& instance () const; + void instance (::CIAO::Config_Handlers::IdRef const& ); protected: - ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > instance_; + ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > instance_; public: PlanSubcomponentPortEndpoint (::XMLSchema::string< ACE_TCHAR > const& portName__, ::CIAO::Config_Handlers::CCMComponentPortKind const& kind__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__); + ::CIAO::Config_Handlers::IdRef const& instance__); PlanSubcomponentPortEndpoint (::XSCRT::XML::Element< ACE_TCHAR > const&); PlanSubcomponentPortEndpoint (PlanSubcomponentPortEndpoint const& s); @@ -1817,8 +1934,43 @@ namespace CIAO protected: ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > location_; + // provider + // public: - ExternalReferenceEndpoint (::XMLSchema::string< ACE_TCHAR > const& location__); + ::XMLSchema::boolean const& provider () const; + void provider (::XMLSchema::boolean const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::boolean > provider_; + + // portName + // + public: + bool portName_p () const; + ::XMLSchema::string< ACE_TCHAR > const& portName () const; + void portName (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > portName_; + + // supportedType + // + public: + typedef ::std::list< ::XMLSchema::string< ACE_TCHAR > >::iterator supportedType_iterator; + typedef ::std::list< ::XMLSchema::string< ACE_TCHAR > >::const_iterator supportedType_const_iterator; + supportedType_iterator begin_supportedType (); + supportedType_iterator end_supportedType (); + supportedType_const_iterator begin_supportedType () const; + supportedType_const_iterator end_supportedType () const; + void add_supportedType (::XMLSchema::string< ACE_TCHAR > const& ); + size_t count_supportedType (void) const; + + protected: + ::std::list< ::XMLSchema::string< ACE_TCHAR > > supportedType_; + + public: + ExternalReferenceEndpoint (::XMLSchema::string< ACE_TCHAR > const& location__, + ::XMLSchema::boolean const& provider__); ExternalReferenceEndpoint (::XSCRT::XML::Element< ACE_TCHAR > const&); ExternalReferenceEndpoint (ExternalReferenceEndpoint const& s); @@ -2171,53 +2323,6 @@ namespace CIAO }; - class XSC_XML_Handlers_Export ComponentPackageReference : public ::XSCRT::Type - { - typedef ::XSCRT::Type Base; - - // requiredUUID - // - public: - bool requiredUUID_p () const; - ::XMLSchema::string< ACE_TCHAR > const& requiredUUID () const; - void requiredUUID (::XMLSchema::string< ACE_TCHAR > const& ); - - protected: - ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > requiredUUID_; - - // requiredName - // - public: - bool requiredName_p () const; - ::XMLSchema::string< ACE_TCHAR > const& requiredName () const; - void requiredName (::XMLSchema::string< ACE_TCHAR > const& ); - - protected: - ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > requiredName_; - - // requiredType - // - public: - ::XMLSchema::string< ACE_TCHAR > const& requiredType () const; - void requiredType (::XMLSchema::string< ACE_TCHAR > const& ); - - protected: - ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > requiredType_; - - public: - ComponentPackageReference (::XMLSchema::string< ACE_TCHAR > const& requiredType__); - - ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR > const&); - ComponentPackageReference (ComponentPackageReference const& s); - - ComponentPackageReference& - operator= (ComponentPackageReference const& s); - - private: - char regulator__; - }; - - class XSC_XML_Handlers_Export SubcomponentPortEndpoint : public ::XSCRT::Type { typedef ::XSCRT::Type Base; @@ -2234,15 +2339,15 @@ namespace CIAO // instance // public: - ::XMLSchema::IDREF< ACE_TCHAR > const& instance () const; - void instance (::XMLSchema::IDREF< ACE_TCHAR > const& ); + ::CIAO::Config_Handlers::IdRef const& instance () const; + void instance (::CIAO::Config_Handlers::IdRef const& ); protected: - ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > instance_; + ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > instance_; public: SubcomponentPortEndpoint (::XMLSchema::string< ACE_TCHAR > const& portName__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__); + ::CIAO::Config_Handlers::IdRef const& instance__); SubcomponentPortEndpoint (::XSCRT::XML::Element< ACE_TCHAR > const&); SubcomponentPortEndpoint (SubcomponentPortEndpoint const& s); @@ -2340,6 +2445,79 @@ namespace CIAO private: char regulator__; }; + + + class XSC_XML_Handlers_Export PlanLocalityKind : public ::XSCRT::Type + { + public: + PlanLocalityKind (::XSCRT::XML::Element< ACE_TCHAR > const&); + PlanLocalityKind (::XSCRT::XML::Attribute< ACE_TCHAR > const&); + + static PlanLocalityKind const SameProcess; + static PlanLocalityKind const DifferentProcess; + static PlanLocalityKind const NoConstraint; + + enum Value + { + SameProcess_l, DifferentProcess_l, NoConstraint_l + }; + + + Value + integral () const; + + friend bool XSC_XML_Handlers_Export + operator== (PlanLocalityKind const& a, PlanLocalityKind const& b); + + friend bool XSC_XML_Handlers_Export + operator!= (PlanLocalityKind const& a, PlanLocalityKind const& b); + + private: + PlanLocalityKind (Value v); + + Value v_; + }; + + bool XSC_XML_Handlers_Export operator== (PlanLocalityKind const &a, PlanLocalityKind const &b); + + bool XSC_XML_Handlers_Export operator!= (PlanLocalityKind const &a, PlanLocalityKind const &b); + + + class XSC_XML_Handlers_Export PlanLocality : public ::XSCRT::Type + { + typedef ::XSCRT::Type Base; + + // constraint + // + public: + ::CIAO::Config_Handlers::PlanLocalityKind const& constraint () const; + void constraint (::CIAO::Config_Handlers::PlanLocalityKind const& ); + + protected: + ::std::auto_ptr< ::CIAO::Config_Handlers::PlanLocalityKind > constraint_; + + // constrainedInstance + // + public: + ::CIAO::Config_Handlers::IdRef const& constrainedInstance () const; + void constrainedInstance (::CIAO::Config_Handlers::IdRef const& ); + + protected: + ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > constrainedInstance_; + + public: + PlanLocality (::CIAO::Config_Handlers::PlanLocalityKind const& constraint__, + ::CIAO::Config_Handlers::IdRef const& constrainedInstance__); + + PlanLocality (::XSCRT::XML::Element< ACE_TCHAR > const&); + PlanLocality (PlanLocality const& s); + + PlanLocality& + operator= (PlanLocality const& s); + + private: + char regulator__; + }; } } @@ -2358,6 +2536,51 @@ namespace CIAO { namespace Traversal { + struct XSC_XML_Handlers_Export IdRef : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::IdRef > + { + virtual void + traverse (Type&); + + virtual void + traverse (Type const&); + + virtual void + pre (Type&); + + virtual void + pre (Type const&); + + virtual void + href (Type&); + + virtual void + href (Type const&); + + virtual void + href_none (Type&); + + virtual void + href_none (Type const&); + + virtual void + idref (Type&); + + virtual void + idref (Type const&); + + virtual void + idref_none (Type&); + + virtual void + idref_none (Type const&); + + virtual void + post (Type&); + + virtual void + post (Type const&); + }; + typedef ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::TCKind > TCKind; @@ -2431,16 +2654,28 @@ namespace CIAO sequence_none (Type const&); virtual void - id (Type&); + alias (Type&); + + virtual void + alias (Type const&); + + virtual void + alias_none (Type&); virtual void - id (Type const&); + alias_none (Type const&); virtual void - id_none (Type&); + xmi_id (Type&); virtual void - id_none (Type const&); + xmi_id (Type const&); + + virtual void + xmi_id_none (Type&); + + virtual void + xmi_id_none (Type const&); virtual void post (Type&); @@ -2854,6 +3089,36 @@ namespace CIAO longdouble_none (Type const&); virtual void + element (Type&); + + virtual void + element (Type const&); + + virtual void + element_pre (Type&); + + virtual void + element_pre (Type const&); + + virtual void + element_next (Type&); + + virtual void + element_next (Type const&); + + virtual void + element_post (Type&); + + virtual void + element_post (Type const&); + + virtual void + element_none (Type&); + + virtual void + element_none (Type const&); + + virtual void member (Type&); virtual void @@ -2890,6 +3155,45 @@ namespace CIAO post (Type const&); }; + struct XSC_XML_Handlers_Export AliasType : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::AliasType > + { + virtual void + traverse (Type&); + + virtual void + traverse (Type const&); + + virtual void + pre (Type&); + + virtual void + pre (Type const&); + + virtual void + name (Type&); + + virtual void + name (Type const&); + + virtual void + typeId (Type&); + + virtual void + typeId (Type const&); + + virtual void + elementType (Type&); + + virtual void + elementType (Type const&); + + virtual void + post (Type&); + + virtual void + post (Type const&); + }; + struct XSC_XML_Handlers_Export EnumType : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::EnumType > { virtual void @@ -3716,16 +4020,16 @@ namespace CIAO deployedResource_none (Type const&); virtual void - id (Type&); + xmi_id (Type&); virtual void - id (Type const&); + xmi_id (Type const&); virtual void - id_none (Type&); + xmi_id_none (Type&); virtual void - id_none (Type const&); + xmi_id_none (Type const&); virtual void post (Type&); @@ -3863,16 +4167,16 @@ namespace CIAO deployRequirement_none (Type const&); virtual void - id (Type&); + xmi_id (Type&); virtual void - id (Type const&); + xmi_id (Type const&); virtual void - id_none (Type&); + xmi_id_none (Type&); virtual void - id_none (Type const&); + xmi_id_none (Type const&); virtual void post (Type&); @@ -4065,16 +4369,16 @@ namespace CIAO deployedSharedResource_none (Type const&); virtual void - id (Type&); + xmi_id (Type&); virtual void - id (Type const&); + xmi_id (Type const&); virtual void - id_none (Type&); + xmi_id_none (Type&); virtual void - id_none (Type const&); + xmi_id_none (Type const&); virtual void post (Type&); @@ -4318,6 +4622,48 @@ namespace CIAO location (Type const&); virtual void + provider (Type&); + + virtual void + provider (Type const&); + + virtual void + portName (Type&); + + virtual void + portName (Type const&); + + virtual void + portName_none (Type&); + + virtual void + portName_none (Type const&); + + virtual void + supportedType (Type&); + + virtual void + supportedType (Type const&); + + virtual void + supportedType_pre (Type&); + + virtual void + supportedType_pre (Type const&); + + virtual void + supportedType_next (Type&); + + virtual void + supportedType_next (Type const&); + + virtual void + supportedType_post (Type&); + + virtual void + supportedType_post (Type const&); + + virtual void post (Type&); virtual void @@ -4789,57 +5135,6 @@ namespace CIAO post (Type const&); }; - struct XSC_XML_Handlers_Export ComponentPackageReference : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::ComponentPackageReference > - { - virtual void - traverse (Type&); - - virtual void - traverse (Type const&); - - virtual void - pre (Type&); - - virtual void - pre (Type const&); - - virtual void - requiredUUID (Type&); - - virtual void - requiredUUID (Type const&); - - virtual void - requiredUUID_none (Type&); - - virtual void - requiredUUID_none (Type const&); - - virtual void - requiredName (Type&); - - virtual void - requiredName (Type const&); - - virtual void - requiredName_none (Type&); - - virtual void - requiredName_none (Type const&); - - virtual void - requiredType (Type&); - - virtual void - requiredType (Type const&); - - virtual void - post (Type&); - - virtual void - post (Type const&); - }; - struct XSC_XML_Handlers_Export SubcomponentPortEndpoint : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::SubcomponentPortEndpoint > { virtual void @@ -5019,6 +5314,43 @@ namespace CIAO virtual void post (Type const&); }; + + typedef + ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::PlanLocalityKind > + PlanLocalityKind; + + struct XSC_XML_Handlers_Export PlanLocality : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::PlanLocality > + { + virtual void + traverse (Type&); + + virtual void + traverse (Type const&); + + virtual void + pre (Type&); + + virtual void + pre (Type const&); + + virtual void + constraint (Type&); + + virtual void + constraint (Type const&); + + virtual void + constrainedInstance (Type&); + + virtual void + constrainedInstance (Type const&); + + virtual void + post (Type&); + + virtual void + post (Type const&); + }; } } } @@ -5031,6 +5363,49 @@ namespace CIAO { namespace Writer { + struct IdRef : Traversal::IdRef, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + typedef ::CIAO::Config_Handlers::IdRef Type; + IdRef (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + + this->traverse (const_cast <Type const &> (o)); + } + + + virtual void + traverse (Type const&); + + virtual void + href (Type &o) + { + + this->href (const_cast <Type const &> (o)); + } + + + virtual void + href (Type const&); + + virtual void + idref (Type &o) + { + + this->idref (const_cast <Type const &> (o)); + } + + + virtual void + idref (Type const&); + + protected: + IdRef (); + }; + struct TCKind : Traversal::TCKind, virtual ::XSCRT::Writer< ACE_TCHAR > { @@ -5122,15 +5497,26 @@ namespace CIAO sequence (Type const&); virtual void - id (Type &o) + alias (Type &o) { - this->id (const_cast <Type const &> (o)); + this->alias (const_cast <Type const &> (o)); } virtual void - id (Type const&); + alias (Type const&); + + virtual void + xmi_id (Type &o) + { + + this->xmi_id (const_cast <Type const &> (o)); + } + + + virtual void + xmi_id (Type const&); protected: DataType (); @@ -5583,6 +5969,39 @@ namespace CIAO longdouble_post (Type const&); virtual void + element_pre (Type &o) + { + + this->element_pre (const_cast <Type const &> (o)); + } + + + virtual void + element_pre (Type const&); + + virtual void + element_next (Type &o) + { + + this->element_next (const_cast <Type const &> (o)); + } + + + virtual void + element_next (Type const&); + + virtual void + element_post (Type &o) + { + + this->element_post (const_cast <Type const &> (o)); + } + + + virtual void + element_post (Type const&); + + virtual void member_pre (Type &o) { @@ -5619,6 +6038,60 @@ namespace CIAO DataValue (); }; + struct AliasType : Traversal::AliasType, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + typedef ::CIAO::Config_Handlers::AliasType Type; + AliasType (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + + this->traverse (const_cast <Type const &> (o)); + } + + + virtual void + traverse (Type const&); + + virtual void + name (Type &o) + { + + this->name (const_cast <Type const &> (o)); + } + + + virtual void + name (Type const&); + + virtual void + typeId (Type &o) + { + + this->typeId (const_cast <Type const &> (o)); + } + + + virtual void + typeId (Type const&); + + virtual void + elementType (Type &o) + { + + this->elementType (const_cast <Type const &> (o)); + } + + + virtual void + elementType (Type const&); + + protected: + AliasType (); + }; + struct EnumType : Traversal::EnumType, virtual ::XSCRT::Writer< ACE_TCHAR > { @@ -6676,15 +7149,15 @@ namespace CIAO deployedResource_post (Type const&); virtual void - id (Type &o) + xmi_id (Type &o) { - this->id (const_cast <Type const &> (o)); + this->xmi_id (const_cast <Type const &> (o)); } virtual void - id (Type const&); + xmi_id (Type const&); protected: ArtifactDeploymentDescription (); @@ -6851,15 +7324,15 @@ namespace CIAO deployRequirement_post (Type const&); virtual void - id (Type &o) + xmi_id (Type &o) { - this->id (const_cast <Type const &> (o)); + this->xmi_id (const_cast <Type const &> (o)); } virtual void - id (Type const&); + xmi_id (Type const&); protected: MonolithicDeploymentDescription (); @@ -7109,15 +7582,15 @@ namespace CIAO deployedSharedResource (Type const&); virtual void - id (Type &o) + xmi_id (Type &o) { - this->id (const_cast <Type const &> (o)); + this->xmi_id (const_cast <Type const &> (o)); } virtual void - id (Type const&); + xmi_id (Type const&); protected: InstanceDeploymentDescription (); @@ -7440,6 +7913,61 @@ namespace CIAO virtual void location (Type const&); + virtual void + provider (Type &o) + { + + this->provider (const_cast <Type const &> (o)); + } + + + virtual void + provider (Type const&); + + virtual void + portName (Type &o) + { + + this->portName (const_cast <Type const &> (o)); + } + + + virtual void + portName (Type const&); + + virtual void + supportedType_pre (Type &o) + { + + this->supportedType_pre (const_cast <Type const &> (o)); + } + + + virtual void + supportedType_pre (Type const&); + + virtual void + supportedType_next (Type &o) + { + + this->supportedType_next (const_cast <Type const &> (o)); + } + + + virtual void + supportedType_next (Type const&); + + virtual void + supportedType_post (Type &o) + { + + this->supportedType_post (const_cast <Type const &> (o)); + } + + + virtual void + supportedType_post (Type const&); + protected: ExternalReferenceEndpoint (); }; @@ -7978,60 +8506,6 @@ namespace CIAO ImplementationRequirement (); }; - struct ComponentPackageReference : Traversal::ComponentPackageReference, - virtual ::XSCRT::Writer< ACE_TCHAR > - { - typedef ::CIAO::Config_Handlers::ComponentPackageReference Type; - ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR >&); - - virtual void - traverse (Type &o) - { - - this->traverse (const_cast <Type const &> (o)); - } - - - virtual void - traverse (Type const&); - - virtual void - requiredUUID (Type &o) - { - - this->requiredUUID (const_cast <Type const &> (o)); - } - - - virtual void - requiredUUID (Type const&); - - virtual void - requiredName (Type &o) - { - - this->requiredName (const_cast <Type const &> (o)); - } - - - virtual void - requiredName (Type const&); - - virtual void - requiredType (Type &o) - { - - this->requiredType (const_cast <Type const &> (o)); - } - - - virtual void - requiredType (Type const&); - - protected: - ComponentPackageReference (); - }; - struct SubcomponentPortEndpoint : Traversal::SubcomponentPortEndpoint, virtual ::XSCRT::Writer< ACE_TCHAR > { @@ -8238,6 +8712,67 @@ namespace CIAO protected: AssemblyConnectionDescription (); }; + + struct PlanLocalityKind : Traversal::PlanLocalityKind, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + PlanLocalityKind (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + this->traverse (const_cast <Type const &> (o)); + } + + virtual void + traverse (Type const&); + + protected: + PlanLocalityKind (); + }; + + struct PlanLocality : Traversal::PlanLocality, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + typedef ::CIAO::Config_Handlers::PlanLocality Type; + PlanLocality (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + + this->traverse (const_cast <Type const &> (o)); + } + + + virtual void + traverse (Type const&); + + virtual void + constraint (Type &o) + { + + this->constraint (const_cast <Type const &> (o)); + } + + + virtual void + constraint (Type const&); + + virtual void + constrainedInstance (Type &o) + { + + this->constrainedInstance (const_cast <Type const &> (o)); + } + + + virtual void + constrainedInstance (Type const&); + + protected: + PlanLocality (); + }; } } } diff --git a/CIAO/tools/Config_Handlers/CCD_Handler.cpp b/CIAO/tools/Config_Handlers/CCD_Handler.cpp index 3dc3af1a414..871cb5c44f1 100644 --- a/CIAO/tools/Config_Handlers/CCD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/CCD_Handler.cpp @@ -22,18 +22,18 @@ namespace CIAO CIAO_TRACE("CCD_Handler::component_interface_descr"); if (desc.UUID_p ()) toconfig.UUID = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.UUID ().c_str ())); + CORBA::string_dup (desc.UUID ().c_str ()); if (desc.label_p ()) { toconfig.label = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.label ().c_str ())); + CORBA::string_dup (desc.label ().c_str ()); } if (desc.specificType_p ()) { toconfig.specificType = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.specificType ().c_str ())); + CORBA::string_dup (desc.specificType ().c_str ()); } ComponentInterfaceDescription::supportedType_const_iterator @@ -46,7 +46,7 @@ namespace CIAO s != end; ++s) { - toconfig.supportedType[pos++] = ACE_TEXT_ALWAYS_CHAR (s->c_str ()); + toconfig.supportedType[pos++] = s->c_str (); } ComponentInterfaceDescription::idlFile_const_iterator @@ -58,7 +58,7 @@ namespace CIAO sidl != eidl; ++sidl) { - toconfig.idlFile [pos++] = ACE_TEXT_ALWAYS_CHAR (sidl->c_str ()); + toconfig.idlFile [pos++] = sidl->c_str (); } ComponentInterfaceDescription::configProperty_const_iterator pend = @@ -71,7 +71,7 @@ namespace CIAO ++pstart) { Property_Handler::handle_property (*pstart, - toconfig.configProperty [pos++]); + toconfig.configProperty [pos++]); } pos = 0; @@ -105,7 +105,7 @@ namespace CIAO infoProp++) { Property_Handler::handle_property (*infoProp, - toconfig.infoProperty[pos]); + toconfig.infoProperty[pos]); } } @@ -117,9 +117,9 @@ namespace CIAO ComponentInterfaceDescription cid; //Load up the basic string members - XMLSchema::string< ACE_TCHAR > uuid (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); - XMLSchema::string< ACE_TCHAR > label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); - XMLSchema::string< ACE_TCHAR > specifict (ACE_TEXT_CHAR_TO_TCHAR (src.specificType.in ())); + XMLSchema::string< char > uuid ((src.UUID)); + XMLSchema::string< char > label ((src.label)); + XMLSchema::string< char > specifict ((src.specificType)); //Then put them in the CID cid.UUID (uuid); @@ -130,7 +130,7 @@ namespace CIAO ::CORBA::ULong total = src.supportedType.length (); for (size_t i = 0; i < total; ++i) { - XMLSchema::string< ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (src.supportedType[i].in ())); + XMLSchema::string< char > curr ((src.supportedType[i])); cid.add_supportedType (curr); } @@ -138,7 +138,7 @@ namespace CIAO total = src.idlFile.length (); for (size_t j = 0; j < total; ++j) { - XMLSchema::string< ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (src.idlFile[j].in ())); + XMLSchema::string< char > curr ((src.idlFile[j])); cid.add_idlFile (curr); } diff --git a/CIAO/tools/Config_Handlers/CEPE_Handler.cpp b/CIAO/tools/Config_Handlers/CEPE_Handler.cpp index 1f74c43e040..4c93545f2c6 100644 --- a/CIAO/tools/Config_Handlers/CEPE_Handler.cpp +++ b/CIAO/tools/Config_Handlers/CEPE_Handler.cpp @@ -35,7 +35,7 @@ namespace CIAO ::Deployment::ComponentExternalPortEndpoint &dest) { CIAO_TRACE("CEOE_Handler::external_port_endpoint"); - dest.portName = ACE_TEXT_ALWAYS_CHAR (src.portName ().c_str ()); + dest.portName = src.portName ().c_str (); } ComponentExternalPortEndpoint @@ -44,8 +44,8 @@ namespace CIAO { CIAO_TRACE("CEOE_Handler::external_port_endpoint - reverse"); //MAJO Unfinished - XMLSchema::string< ACE_TCHAR > portname (ACE_TEXT_CHAR_TO_TCHAR (src.portName.in ())); - return ComponentExternalPortEndpoint (portname); + XMLSchema::string< char > portname ((src.portName)); + return ComponentExternalPortEndpoint (portname); } } } diff --git a/CIAO/tools/Config_Handlers/CEPE_Handler.h b/CIAO/tools/Config_Handlers/CEPE_Handler.h index faa02a58737..b3b0938b8c2 100644 --- a/CIAO/tools/Config_Handlers/CEPE_Handler.h +++ b/CIAO/tools/Config_Handlers/CEPE_Handler.h @@ -28,43 +28,39 @@ namespace Deployment namespace CIAO { namespace Config_Handlers - { - class PlanConnectionDescription; - class ComponentExternalPortEndpoint; + { + class PlanConnectionDescription; + class ComponentExternalPortEndpoint; - /* - * @class CEPE_Handler - * - * @brief Handler class for <ComponentExternalPortEndpoint> types. - * - * This class defines handler methods to map values from - * XSC ComponentExternalPortEndpoint objects, parsed from - * the descriptor files, to the corresponding CORBA IDL type. - * - */ + /* + * @class CEPE_Handler + * + * @brief Handler class for <ComponentExternalPortEndpoint> types. + * + * This class defines handler methods to map values from + * XSC ComponentExternalPortEndpoint objects, parsed from + * the descriptor files, to the corresponding CORBA IDL type. + * + */ - class Config_Handlers_Common_Export CEPE_Handler + class Config_Handlers_Common_Export CEPE_Handler { public: - static void external_port_endpoints ( - const PlanConnectionDescription &src, - ::Deployment::ComponentExternalPortEndpoints &dest); + static void external_port_endpoints (const PlanConnectionDescription &src, + ::Deployment::ComponentExternalPortEndpoints &dest); static ComponentExternalPortEndpoint - external_port_endpoint ( - const ::Deployment::ComponentExternalPortEndpoint &src); + external_port_endpoint (const ::Deployment::ComponentExternalPortEndpoint &src); - static void handle_external_port_endpoint ( - const ComponentExternalPortEndpoint &src, - ::Deployment::ComponentExternalPortEndpoint &dest); + static void handle_external_port_endpoint (const ComponentExternalPortEndpoint &src, + ::Deployment::ComponentExternalPortEndpoint &dest); }; - typedef Sequence_Handler < ComponentExternalPortEndpoint, - ::Deployment::ComponentExternalPortEndpoints, - ::Deployment::ComponentExternalPortEndpoint, - CEPE_Handler::handle_external_port_endpoint > - CEPE_Functor; - } + typedef Sequence_Handler < ComponentExternalPortEndpoint, + ::Deployment::ComponentExternalPortEndpoints, + ::Deployment::ComponentExternalPortEndpoint, + CEPE_Handler::handle_external_port_endpoint > CEPE_Functor; + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents.cpp b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents.cpp index 628d8d11622..a31c183415d 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents.cpp +++ b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents.cpp @@ -976,10 +976,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("EC")) v_ = EC_l; - else if (v == ACE_TEXT ("RTEC")) v_ = RTEC_l; - else if (v == ACE_TEXT ("NOTIFY")) v_ = NOTIFY_l; - else if (v == ACE_TEXT ("RTNOTIFY")) v_ = RTNOTIFY_l; + if (v == "EC") v_ = EC_l; + else if (v == "RTEC") v_ = RTEC_l; + else if (v == "NOTIFY") v_ = NOTIFY_l; + else if (v == "RTNOTIFY") v_ = RTNOTIFY_l; else { } @@ -991,10 +991,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("EC")) v_ = EC_l; - else if (v == ACE_TEXT ("RTEC")) v_ = RTEC_l; - else if (v == ACE_TEXT ("NOTIFY")) v_ = NOTIFY_l; - else if (v == ACE_TEXT ("RTNOTIFY")) v_ = RTNOTIFY_l; + if (v == "EC") v_ = EC_l; + else if (v == "RTEC") v_ = RTEC_l; + else if (v == "NOTIFY") v_ = NOTIFY_l; + else if (v == "RTNOTIFY") v_ = RTNOTIFY_l; else { } @@ -1020,7 +1020,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("eventServiceConfiguration")) + if (n == "eventServiceConfiguration") { ::CIAO::Config_Handlers::EventServiceDescription t (e); add_eventServiceConfiguration (t); @@ -1035,7 +1035,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -1062,49 +1062,49 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("node")) + else if (n == "node") { node_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); node_->container (this); } - else if (n == ACE_TEXT ("type")) + else if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::EventServiceType > (new ::CIAO::Config_Handlers::EventServiceType (e)); type_->container (this); } - else if (n == ACE_TEXT ("svc_cfg_file")) + else if (n == "svc_cfg_file") { svc_cfg_file_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); svc_cfg_file_->container (this); } - else if (n == ACE_TEXT ("filter")) + else if (n == "filter") { ::CIAO::Config_Handlers::Filter t (e); add_filter (t); } - else if (n == ACE_TEXT ("addr_serv")) + else if (n == "addr_serv") { ::CIAO::Config_Handlers::AddressServerDescription t (e); add_addr_serv (t); } - else if (n == ACE_TEXT ("udp_sender")) + else if (n == "udp_sender") { ::CIAO::Config_Handlers::UDPSenderDescription t (e); add_udp_sender (t); } - else if (n == ACE_TEXT ("udp_receiver")) + else if (n == "udp_receiver") { ::CIAO::Config_Handlers::UDPReceiverDescription t (e); add_udp_receiver (t); @@ -1119,7 +1119,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -1140,10 +1140,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("CONJUNCTION")) v_ = CONJUNCTION_l; - else if (v == ACE_TEXT ("DISJUNCTION")) v_ = DISJUNCTION_l; - else if (v == ACE_TEXT ("LOGICAL_AND")) v_ = LOGICAL_AND_l; - else if (v == ACE_TEXT ("NEGATE")) v_ = NEGATE_l; + if (v == "CONJUNCTION") v_ = CONJUNCTION_l; + else if (v == "DISJUNCTION") v_ = DISJUNCTION_l; + else if (v == "LOGICAL_AND") v_ = LOGICAL_AND_l; + else if (v == "NEGATE") v_ = NEGATE_l; else { } @@ -1155,10 +1155,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("CONJUNCTION")) v_ = CONJUNCTION_l; - else if (v == ACE_TEXT ("DISJUNCTION")) v_ = DISJUNCTION_l; - else if (v == ACE_TEXT ("LOGICAL_AND")) v_ = LOGICAL_AND_l; - else if (v == ACE_TEXT ("NEGATE")) v_ = NEGATE_l; + if (v == "CONJUNCTION") v_ = CONJUNCTION_l; + else if (v == "DISJUNCTION") v_ = DISJUNCTION_l; + else if (v == "LOGICAL_AND") v_ = LOGICAL_AND_l; + else if (v == "NEGATE") v_ = NEGATE_l; else { } @@ -1184,19 +1184,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("type")) + else if (n == "type") { type_ = ::std::auto_ptr< ::CIAO::Config_Handlers::FilterType > (new ::CIAO::Config_Handlers::FilterType (e)); type_->container (this); } - else if (n == ACE_TEXT ("source")) + else if (n == "source") { ::XMLSchema::string< ACE_TCHAR > t (e); add_source (t); @@ -1211,7 +1211,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -1238,19 +1238,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("port")) + else if (n == "port") { port_ = ::std::auto_ptr< ::XMLSchema::unsignedShort > (new ::XMLSchema::unsignedShort (e)); port_->container (this); } - else if (n == ACE_TEXT ("address")) + else if (n == "address") { address_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); address_->container (this); @@ -1277,13 +1277,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("addr_serv_id")) + else if (n == "addr_serv_id") { addr_serv_id_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); addr_serv_id_->container (this); @@ -1310,25 +1310,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("addr_serv_id")) + else if (n == "addr_serv_id") { ::XMLSchema::string< ACE_TCHAR > t (e); addr_serv_id (t); } - else if (n == ACE_TEXT ("is_multicast")) + else if (n == "is_multicast") { is_multicast_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); is_multicast_->container (this); } - else if (n == ACE_TEXT ("listen_port")) + else if (n == "listen_port") { listen_port_ = ::std::auto_ptr< ::XMLSchema::unsignedShort > (new ::XMLSchema::unsignedShort (e)); listen_port_->container (this); @@ -1350,7 +1350,7 @@ namespace CIAO CIAOEvents (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("CIAOEvents")) + if (e.name () == "CIAOEvents") { ::CIAO::Config_Handlers::CIAOEventsDef r (e); return r; @@ -2542,10 +2542,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::EventServiceType::EC) s = ACE_TEXT ("EC"); - else if (o == ::CIAO::Config_Handlers::EventServiceType::RTEC) s = ACE_TEXT ("RTEC"); - else if (o == ::CIAO::Config_Handlers::EventServiceType::NOTIFY) s = ACE_TEXT ("NOTIFY"); - else if (o == ::CIAO::Config_Handlers::EventServiceType::RTNOTIFY) s = ACE_TEXT ("RTNOTIFY"); + if (o == ::CIAO::Config_Handlers::EventServiceType::EC) s = "EC"; + else if (o == ::CIAO::Config_Handlers::EventServiceType::RTEC) s = "RTEC"; + else if (o == ::CIAO::Config_Handlers::EventServiceType::NOTIFY) s = "NOTIFY"; + else if (o == ::CIAO::Config_Handlers::EventServiceType::RTNOTIFY) s = "RTNOTIFY"; else { } @@ -2585,7 +2585,7 @@ namespace CIAO void CIAOEventsDef:: eventServiceConfiguration_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("eventServiceConfiguration"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("eventServiceConfiguration", top_ ())); } void CIAOEventsDef:: @@ -2604,7 +2604,7 @@ namespace CIAO void CIAOEventsDef:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::CIAOEventsDef::id (o); attr_ (0); @@ -2634,7 +2634,7 @@ namespace CIAO void EventServiceDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::EventServiceDescription::name (o); pop_ (); } @@ -2642,7 +2642,7 @@ namespace CIAO void EventServiceDescription:: node (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("node"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("node", top_ ())); Traversal::EventServiceDescription::node (o); pop_ (); } @@ -2650,7 +2650,7 @@ namespace CIAO void EventServiceDescription:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::EventServiceDescription::type (o); pop_ (); } @@ -2658,7 +2658,7 @@ namespace CIAO void EventServiceDescription:: svc_cfg_file (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("svc_cfg_file"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("svc_cfg_file", top_ ())); Traversal::EventServiceDescription::svc_cfg_file (o); pop_ (); } @@ -2666,7 +2666,7 @@ namespace CIAO void EventServiceDescription:: filter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("filter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("filter", top_ ())); } void EventServiceDescription:: @@ -2685,7 +2685,7 @@ namespace CIAO void EventServiceDescription:: addr_serv_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("addr_serv"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("addr_serv", top_ ())); } void EventServiceDescription:: @@ -2704,7 +2704,7 @@ namespace CIAO void EventServiceDescription:: udp_sender_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("udp_sender"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("udp_sender", top_ ())); } void EventServiceDescription:: @@ -2723,7 +2723,7 @@ namespace CIAO void EventServiceDescription:: udp_receiver_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("udp_receiver"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("udp_receiver", top_ ())); } void EventServiceDescription:: @@ -2742,7 +2742,7 @@ namespace CIAO void EventServiceDescription:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::EventServiceDescription::id (o); attr_ (0); @@ -2768,10 +2768,10 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::FilterType::CONJUNCTION) s = ACE_TEXT ("CONJUNCTION"); - else if (o == ::CIAO::Config_Handlers::FilterType::DISJUNCTION) s = ACE_TEXT ("DISJUNCTION"); - else if (o == ::CIAO::Config_Handlers::FilterType::LOGICAL_AND) s = ACE_TEXT ("LOGICAL_AND"); - else if (o == ::CIAO::Config_Handlers::FilterType::NEGATE) s = ACE_TEXT ("NEGATE"); + if (o == ::CIAO::Config_Handlers::FilterType::CONJUNCTION) s = "CONJUNCTION"; + else if (o == ::CIAO::Config_Handlers::FilterType::DISJUNCTION) s = "DISJUNCTION"; + else if (o == ::CIAO::Config_Handlers::FilterType::LOGICAL_AND) s = "LOGICAL_AND"; + else if (o == ::CIAO::Config_Handlers::FilterType::NEGATE) s = "NEGATE"; else { } @@ -2811,7 +2811,7 @@ namespace CIAO void Filter:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Filter::name (o); pop_ (); } @@ -2819,7 +2819,7 @@ namespace CIAO void Filter:: type (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("type"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("type", top_ ())); Traversal::Filter::type (o); pop_ (); } @@ -2827,7 +2827,7 @@ namespace CIAO void Filter:: source_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("source"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("source", top_ ())); } void Filter:: @@ -2846,7 +2846,7 @@ namespace CIAO void Filter:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::Filter::id (o); attr_ (0); @@ -2876,7 +2876,7 @@ namespace CIAO void AddressServerDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::AddressServerDescription::name (o); pop_ (); } @@ -2884,7 +2884,7 @@ namespace CIAO void AddressServerDescription:: port (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("port"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("port", top_ ())); Traversal::AddressServerDescription::port (o); pop_ (); } @@ -2892,7 +2892,7 @@ namespace CIAO void AddressServerDescription:: address (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("address"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("address", top_ ())); Traversal::AddressServerDescription::address (o); pop_ (); } @@ -2921,7 +2921,7 @@ namespace CIAO void UDPSenderDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::UDPSenderDescription::name (o); pop_ (); } @@ -2929,7 +2929,7 @@ namespace CIAO void UDPSenderDescription:: addr_serv_id (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("addr_serv_id"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("addr_serv_id", top_ ())); Traversal::UDPSenderDescription::addr_serv_id (o); pop_ (); } @@ -2958,7 +2958,7 @@ namespace CIAO void UDPReceiverDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::UDPReceiverDescription::name (o); pop_ (); } @@ -2966,7 +2966,7 @@ namespace CIAO void UDPReceiverDescription:: addr_serv_id (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("addr_serv_id"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("addr_serv_id", top_ ())); Traversal::UDPReceiverDescription::addr_serv_id (o); pop_ (); } @@ -2974,7 +2974,7 @@ namespace CIAO void UDPReceiverDescription:: is_multicast (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("is_multicast"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("is_multicast", top_ ())); Traversal::UDPReceiverDescription::is_multicast (o); pop_ (); } @@ -2982,7 +2982,7 @@ namespace CIAO void UDPReceiverDescription:: listen_port (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("listen_port"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("listen_port", top_ ())); Traversal::UDPReceiverDescription::listen_port (o); pop_ (); } @@ -2998,7 +2998,7 @@ namespace CIAO CIAOEvents (::CIAO::Config_Handlers::CIAOEventsDef const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("CIAOEvents")) + if (e.name () != "CIAOEvents") { throw 1; } diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp index d264b0c7ceb..75fad29366e 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp +++ b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.cpp @@ -56,8 +56,8 @@ namespace CIAO { CIAO::DAnCE::EventServiceDeploymentDescription a_esd; - a_esd.name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->name ().c_str ())); - a_esd.node = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->node ().c_str ())); + a_esd.name = CORBA::string_dup (i->name ().c_str ()); + a_esd.node = CORBA::string_dup (i->node ().c_str ()); switch (i->type ().integral ()) { @@ -79,7 +79,7 @@ namespace CIAO return false; } - a_esd.svc_cfg_file = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->svc_cfg_file ().c_str ())); + a_esd.svc_cfg_file = CORBA::string_dup (i->svc_cfg_file ().c_str ()); // Populate filtering information for this event channel @@ -89,7 +89,7 @@ namespace CIAO j != i->end_filter (); j++) { - a_esd.filters[pos_j].name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->name ().c_str ())); + a_esd.filters[pos_j].name = CORBA::string_dup (j->name ().c_str ()); switch (j->type ().integral ()) { case ::CIAO::Config_Handlers::FilterType::CONJUNCTION_l: @@ -116,7 +116,7 @@ namespace CIAO k != j->end_source (); k++) { - a_esd.filters[pos_j].sources[pos_k] = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (k->c_str ())); + a_esd.filters[pos_j].sources[pos_k] = CORBA::string_dup (k->c_str ()); pos_k++; } @@ -130,9 +130,9 @@ namespace CIAO j != i->end_addr_serv (); j++) { - a_esd.addr_servs[pos_j].name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->name ().c_str ())); + a_esd.addr_servs[pos_j].name = CORBA::string_dup (j->name ().c_str ()); a_esd.addr_servs[pos_j].port = j->port (); - a_esd.addr_servs[pos_j].address = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->address ().c_str ())); + a_esd.addr_servs[pos_j].address = CORBA::string_dup (j->address ().c_str ()); pos_j++; } @@ -143,9 +143,9 @@ namespace CIAO j != i->end_udp_sender (); j++) { - a_esd.senders[pos_j].name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->name ().c_str ())); + a_esd.senders[pos_j].name = CORBA::string_dup (j->name ().c_str ()); a_esd.senders[pos_j].addr_serv_id = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->addr_serv_id ().c_str ())); + CORBA::string_dup (j->addr_serv_id ().c_str ()); pos_j++; } @@ -156,9 +156,9 @@ namespace CIAO j != i->end_udp_receiver (); j++) { - a_esd.receivers[pos_j].name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->name ().c_str ())); + a_esd.receivers[pos_j].name = CORBA::string_dup (j->name ().c_str ()); a_esd.receivers[pos_j].addr_serv_id = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (j->addr_serv_id ().c_str ())); + CORBA::string_dup (j->addr_serv_id ().c_str ()); a_esd.receivers[pos_j].is_multicast = j->is_multicast (); a_esd.receivers[pos_j].listen_port = j->listen_port (); pos_j++; @@ -170,25 +170,26 @@ namespace CIAO return true; } + ::CIAO::DAnCE::EventServiceDeploymentDescriptions const * - CIAOEvents_Handler::esd_idl () const - { - if(!this->idl_esd_.get()) - throw NoESD (); + CIAOEvents_Handler::esd_idl () const + { + if(!this->idl_esd_.get()) + throw NoESD (); - //else - return this->idl_esd_.get(); - } + //else + return this->idl_esd_.get(); + } ::CIAO::DAnCE::EventServiceDeploymentDescriptions * - CIAOEvents_Handler::esd_idl () - { - if(!this->idl_esd_.get()) - throw NoESD(); + CIAOEvents_Handler::esd_idl () + { + if(!this->idl_esd_.get()) + throw NoESD(); - //else - return this->idl_esd_.release(); - } - } + //else + return this->idl_esd_.release(); + } + } } diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h index 98e71009a8e..f977808bc5a 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h +++ b/CIAO/tools/Config_Handlers/CIAO_Events/CIAOEvents_Handler.h @@ -52,7 +52,7 @@ namespace CIAO ~CIAOEvents_Handler (void); CIAO::DAnCE::EventServiceDeploymentDescriptions const *esd_idl (void) const; - + CIAO::DAnCE::EventServiceDeploymentDescriptions *esd_idl (void); private: diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc b/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc index f481a556670..691d5b9a222 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc +++ b/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers.mpc @@ -1,7 +1,7 @@ //$Id$ project (CIAO_Events_XML_Generation) : xscdefaults { - requires += xsc + requires += xsc dummy_label xscflags += --cxx-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.cpp xscflags += --cxx-header-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.h @@ -9,7 +9,7 @@ project (CIAO_Events_XML_Generation) : xscdefaults { xscflags += --cxx-namespace-regex <%quote%>%.*vanderbilt.*%CIAO/Config_Handlers%<%quote%> xscflags += --cxx-export-header CIAO_Events_Handlers_Export.h xscflags += --search-path "$(CIAO_ROOT)/docs/schema" - + custom_only = 1 XSC_Files { @@ -18,13 +18,13 @@ project (CIAO_Events_XML_Generation) : xscdefaults { } } -project (CIAO_Events_Handlers) : acelib, ace_output, ciao_config_handlers_base, ciao_events_dnc, ciao_deployment_stub { +project (CIAO_Events_Handlers) : acelib, ciao_config_handlers_base, ciao_events_dnc, dance_deployment_stub { sharedname = CIAO_Events_Handlers dynamicflags = CIAO_EVENTS_HANDLERS_BUILD_DLL macros += XML_USE_PTHREADS includes += $(CIAO_ROOT)/tools/Config_Handlers - - after += CIAO_Events_XML_Generation + requires += dummy_label + after += CIAO_Events_XML_Generation Source_Files { CIAOEvents.cpp CIAOEvents_Handler.cpp @@ -34,13 +34,13 @@ project (CIAO_Events_Handlers) : acelib, ace_output, ciao_config_handlers_base, } } -project (CIAO_Events_Handlers_Tests) : ciao_config_handlers_base, ciao_server_dnc { +project (CIAO_Events_Handlers_Tests) : ciao_config_handlers_base, ccm_stub { exename = test after += CIAO_Events_Handlers macros += XML_USE_PTHREADS includes += $(CIAO_ROOT)/tools/Config_Handlers libs += CIAO_Events_Handlers - + requires += dummy_label Source_Files { test.cpp } diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h b/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h index 9054890bfa7..efe95849905 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h +++ b/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Export.h @@ -2,17 +2,13 @@ // -*- C++ -*- // $Id$ // Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_Events_Handlers +// This file is generated automatically by generate_export_file.pl -n CIAO_Events_Handlers // ------------------------------ #ifndef CIAO_EVENTS_HANDLERS_EXPORT_H #define CIAO_EVENTS_HANDLERS_EXPORT_H #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_EVENTS_HANDLERS_HAS_DLL) -# define CIAO_EVENTS_HANDLERS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_EVENTS_HANDLERS_HAS_DLL */ - #if !defined (CIAO_EVENTS_HANDLERS_HAS_DLL) # define CIAO_EVENTS_HANDLERS_HAS_DLL 1 #endif /* ! CIAO_EVENTS_HANDLERS_HAS_DLL */ diff --git a/CIAO/tools/Config_Handlers/CIAO_Events/test.cpp b/CIAO/tools/Config_Handlers/CIAO_Events/test.cpp index 1e47ce1c4df..362a47c3b22 100644 --- a/CIAO/tools/Config_Handlers/CIAO_Events/test.cpp +++ b/CIAO/tools/Config_Handlers/CIAO_Events/test.cpp @@ -9,12 +9,13 @@ #include "ace/Get_Opt.h" #include "tao/ORB.h" -static const ACE_TCHAR *input_file = ACE_TEXT ("test.ced"); +static const char *input_file = "test.ced"; + static int -parse_args (int argc, ACE_TCHAR *argv[]) +parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("i:")); + ACE_Get_Opt get_opts (argc, argv, "i:"); int c; @@ -45,7 +46,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (parse_args (argc, argv) != 0) return 1; - CIAOEvents_Handler event_handler (ACE_TEXT_ALWAYS_CHAR (input_file)); + CIAOEvents_Handler event_handler (input_file); // Convert XSC to idl datatype std::cout << "Instance document import succeeded. Dumping contents to file\n"; diff --git a/CIAO/tools/Config_Handlers/CPD_Handler.cpp b/CIAO/tools/Config_Handlers/CPD_Handler.cpp index dbbf4b7f58a..97a9e50ae23 100644 --- a/CIAO/tools/Config_Handlers/CPD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/CPD_Handler.cpp @@ -16,11 +16,11 @@ namespace CIAO { CIAO_TRACE("CPD_Handler::component_port_description"); toconfig.name = - ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + desc.name ().c_str (); if (desc.specificType_p ()) toconfig.specificType = - ACE_TEXT_ALWAYS_CHAR (desc.specificType ().c_str ()); + desc.specificType ().c_str (); toconfig.supportedType.length (desc.count_supportedType ()); std::for_each (desc.begin_supportedType (), @@ -72,13 +72,13 @@ namespace CIAO const Deployment::ComponentPortDescription& src) { CIAO_TRACE("CPD_Handler::component_port_description - reverse"); - ::XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); - ::XMLSchema::string< char > stype (src.specificType); + ::XMLSchema::string< char > name ((src.name)); + ::XMLSchema::string< char > stype ((src.specificType)); ::XMLSchema::string< char > tval ("true"); ::XMLSchema::string< char > fval ("false"); XMLSchema::boolean provider; - XMLSchema::boolean exclusiveProvider; + XMLSchema::boolean exclusiveProvider; XMLSchema::boolean exclusiveUser; XMLSchema::boolean optional; @@ -141,8 +141,7 @@ namespace CIAO } for (CORBA::ULong i = 0; i < src.supportedType.length (); ++i) - cpd.add_supportedType ( - XMLSchema::string< ACE_TCHAR > (ACE_TEXT_CHAR_TO_TCHAR (src.supportedType[i].in ()))); + cpd.add_supportedType (XMLSchema::string< char > ((src.supportedType[i]))); return cpd; } diff --git a/CIAO/tools/Config_Handlers/CPD_Handler.h b/CIAO/tools/Config_Handlers/CPD_Handler.h index 0bd645eb07d..445d2c5f329 100644 --- a/CIAO/tools/Config_Handlers/CPD_Handler.h +++ b/CIAO/tools/Config_Handlers/CPD_Handler.h @@ -29,39 +29,39 @@ namespace Deployment namespace CIAO { namespace Config_Handlers - { - class ComponentPortDescription; - /* - * @class CPD_Handler - * - * @brief Handler class for <CCMComponentPortDescription> types. - * - * This class defines handler methods to map values from - * XSC objects, parsed from the descriptor files, to the - * corresponding CORBA IDL type for the schema element. - */ + { + class ComponentPortDescription; + /* + * @class CPD_Handler + * + * @brief Handler class for <CCMComponentPortDescription> types. + * + * This class defines handler methods to map values from + * XSC objects, parsed from the descriptor files, to the + * corresponding CORBA IDL type for the schema element. + * + */ - class Config_Handlers_Common_Export CPD_Handler + class Config_Handlers_Common_Export CPD_Handler { + public: /// Maps the values from the XSC object /// <ComponentInterfaceDescription> to the CORBA IDL type /// <Deployment::ComponentInterfaceDescription>. - static void handle_component_port_description ( - const ComponentPortDescription &desc, - ::Deployment::ComponentPortDescription &toconfig); + static void handle_component_port_description (const ComponentPortDescription &desc, + ::Deployment::ComponentPortDescription &toconfig); static ComponentPortDescription - component_port_description ( - const Deployment::ComponentPortDescription& src); + component_port_description (const Deployment::ComponentPortDescription& src); }; - typedef Sequence_Handler < ComponentPortDescription, - ::Deployment::ComponentPortDescriptions, - ::Deployment::ComponentPortDescription, - CPD_Handler::handle_component_port_description > - CPD_Functor; - } + typedef Sequence_Handler < ComponentPortDescription, + ::Deployment::ComponentPortDescriptions, + ::Deployment::ComponentPortDescription, + CPD_Handler::handle_component_port_description > CPD_Functor; + + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/CRDD_Handler.cpp b/CIAO/tools/Config_Handlers/CRDD_Handler.cpp index 608e9cb1b31..87d1b6511e5 100644 --- a/CIAO/tools/Config_Handlers/CRDD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/CRDD_Handler.cpp @@ -29,9 +29,9 @@ namespace CIAO { CIAO_TRACE("CRDD_Handler::get_ConnectionResourceDD"); - toconfig.targetName = ACE_TEXT_ALWAYS_CHAR (desc.targetName ().c_str ()); - toconfig.requirementName = ACE_TEXT_ALWAYS_CHAR (desc.requirementName ().c_str ()); - toconfig.resourceName = ACE_TEXT_ALWAYS_CHAR (desc.resourceName ().c_str ()); + toconfig.targetName = desc.targetName ().c_str (); + toconfig.requirementName = desc.requirementName ().c_str (); + toconfig.resourceName = desc.resourceName ().c_str (); std::for_each (desc.begin_property (), desc.end_property (), @@ -43,9 +43,9 @@ namespace CIAO const ::Deployment::ConnectionResourceDeploymentDescription& src) { CIAO_TRACE("CRDD_Handler::get_ConnectionResourceDeploymentDescription- reverse"); - XMLSchema::string< ACE_TCHAR > tname (ACE_TEXT_CHAR_TO_TCHAR (src.targetName.in ())); - XMLSchema::string< ACE_TCHAR > reqname (ACE_TEXT_CHAR_TO_TCHAR (src.requirementName.in ())); - XMLSchema::string <ACE_TCHAR> resname (ACE_TEXT_CHAR_TO_TCHAR (src.resourceName.in ())); + XMLSchema::string< ACE_TCHAR > tname ((src.targetName)); + XMLSchema::string< ACE_TCHAR > reqname ((src.requirementName)); + XMLSchema::string <ACE_TCHAR> resname ((src.resourceName)); ConnectionResourceDeploymentDescription crdd (tname, reqname, diff --git a/CIAO/tools/Config_Handlers/Common.h b/CIAO/tools/Config_Handlers/Common.h index 6057cbb74be..0bf07d58ba2 100644 --- a/CIAO/tools/Config_Handlers/Common.h +++ b/CIAO/tools/Config_Handlers/Common.h @@ -1,40 +1,45 @@ // $Id$ /** -* @file Common.h -* @author Will Otte <wotte@dre.vanderbilt.edu> -* -* Some common definitions for all config_handlers. -*/ + * @file Common.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + * + * Some common definitions for all config_handlers. + */ #ifndef CONFIG_HANDLERS_COMMON_H #define CONFIG_HANDLERS_COMMON_H #include <string> namespace CIAO { -namespace Config_Handlers -{ -/** -* @class Config_Error -* @brief Exception to communicate a config_handlers error -*/ -class Config_Error -{ -public: -Config_Error (const std::string &name, -const std::string &error) : -name_ (name), -error_ (error) -{}; + namespace Config_Handlers + { + /** + * @class Config_Error + * @brief Exception to communicate a config_handlers error + */ + class Config_Error + { + public: + Config_Error (const std::string &name, + const std::string &error) : + name_ (name), + error_ (error) + {}; + + void add_name (const std::string &name) + { + name_ = name + ':' + name_; + } -/// Some identifying information about the element that -/// caused the error -std::string name_; + /// Some identifying information about the element that + /// caused the error + std::string name_; -/// A human readable error message -std::string error_; + /// A human readable error message + std::string error_; -}; -} + }; + } } #endif /* CONFIG_HANDLERS_COMMON_H */ diff --git a/CIAO/tools/Config_Handlers/ComponentPropertyDescription_Handler.cpp b/CIAO/tools/Config_Handlers/ComponentPropertyDescription_Handler.cpp index 40548fae71c..d916bf8076f 100644 --- a/CIAO/tools/Config_Handlers/ComponentPropertyDescription_Handler.cpp +++ b/CIAO/tools/Config_Handlers/ComponentPropertyDescription_Handler.cpp @@ -14,7 +14,7 @@ namespace CIAO ::Deployment::ComponentPropertyDescription& toconfig) { CIAO_TRACE("ComponentPropertyDescription_Handler::component_property_description"); - toconfig.name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ())); + toconfig.name = CORBA::string_dup (desc.name ().c_str ()); // Delegate the DataType to the // DataType_Handler. @@ -31,7 +31,7 @@ namespace CIAO const ::Deployment::ComponentPropertyDescription &src) { CIAO_TRACE("ComponentPropertyDescription_Handler::component_property_description - reverse"); - XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + XMLSchema::string< char > name ((src.name)); DataType dt (DataType_Handler::data_type (src.type)); ComponentPropertyDescription cpd (name,dt); return cpd; diff --git a/CIAO/tools/Config_Handlers/Config_Handlers.mpc b/CIAO/tools/Config_Handlers/Config_Handlers.mpc index d068b1665f1..c5a30b682ff 100644 --- a/CIAO/tools/Config_Handlers/Config_Handlers.mpc +++ b/CIAO/tools/Config_Handlers/Config_Handlers.mpc @@ -1,43 +1,45 @@ //$Id$ project (XSC_XML_Generation) : xscdefaults { - requires += xsc - - xscflags += --cxx-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.cpp - xscflags += --cxx-header-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.h - xscflags += --cxx-export-symbol XSC_XML_Handlers_Export - xscflags += --cxx-namespace-regex <%quote%>%.*Deployment.*%CIAO/Config_Handlers%<%quote%> - xscflags += --cxx-export-header XSC_XML_Handlers_Export.h - xscflags += --search-path "$(CIAO_ROOT)/docs/schema" - - custom_only = 1 - - XSC_Files { - gendir = . - $(CIAO_ROOT)/docs/schema/Basic_Deployment_Data.xsd - $(CIAO_ROOT)/docs/schema/Deployment.xsd - $(CIAO_ROOT)/docs/schema/ccd.xsd - $(CIAO_ROOT)/docs/schema/cdd.xsd - $(CIAO_ROOT)/docs/schema/cdp.xsd - $(CIAO_ROOT)/docs/schema/cid.xsd - $(CIAO_ROOT)/docs/schema/cpd.xsd - $(CIAO_ROOT)/docs/schema/iad.xsd - $(CIAO_ROOT)/docs/schema/pcd.xsd - $(CIAO_ROOT)/docs/schema/toplevel.xsd - } - - Source_Files { - } + requires += xsc + + xscflags += --cxx-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.cpp + xscflags += --cxx-header-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.h + xscflags += --cxx-export-symbol XSC_XML_Handlers_Export + xscflags += --cxx-namespace-regex "%.*Deployment.*%CIAO/Config_Handlers%" //<%quote%> + xscflags += --cxx-export-header XSC_XML_Handlers_Export.h + xscflags += --search-path "$(CIAO_ROOT)/docs/schema" + + custom_only = 1 + + XSC_Files { + gendir = . + $(CIAO_ROOT)/docs/schema/Basic_Deployment_Data.xsd + $(CIAO_ROOT)/docs/schema/Deployment.xsd + $(CIAO_ROOT)/docs/schema/XMI.xsd + $(CIAO_ROOT)/docs/schema/ccd.xsd + $(CIAO_ROOT)/docs/schema/cdd.xsd + $(CIAO_ROOT)/docs/schema/cdp.xsd + $(CIAO_ROOT)/docs/schema/cid.xsd + $(CIAO_ROOT)/docs/schema/cpd.xsd + $(CIAO_ROOT)/docs/schema/iad.xsd + $(CIAO_ROOT)/docs/schema/pcd.xsd + $(CIAO_ROOT)/docs/schema/toplevel.xsd + } + + Source_Files { + } } -project (XSC_XML_Handlers) : acelib, ace_output, xerces { +project (XSC_XML_Handlers) : acelib, xerces, ciao_lib, ciao_xml_utils { sharedname += XSC_XML_Handlers dynamicflags = XSC_XML_HANDLERS_BUILD_DLL macros += XML_USE_PTHREADS - includes += $(CIAO_ROOT)/tools/Config_Handlers + includes += $(CIAO_ROOT)/tools/Config_Handlers $(CIAO_ROOT)/tools after += XSC_XML_Generation Source_Files { + XMI.cpp Deployment.cpp ccd.cpp cdd.cpp @@ -48,32 +50,33 @@ project (XSC_XML_Handlers) : acelib, ace_output, xerces { pcd.cpp toplevel.cpp Basic_Deployment_Data.cpp + XML_Typedefs.cpp } Header_Files { XSC_XML_Handlers_Export.h + XML_Typedefs.h } verbatim(gnuace, macros) { - override no_hidden_visibility = 1 + override no_hidden_visibility = 1 } } -project (XSC_Config_Handlers) : ciao_deployment_stub, ciao_events_dnc, ciao_config_handlers_base, ace_output { - after += CIAO_Events_Handlers \ - RT_CCM_Config_Handlers \ - XSC_DynAny_Handler \ +project (XSC_Config_Handlers) : dance_deployment_stub, ciao_config_handlers_base, ciao_lib, dance { + after += XSC_DynAny_Handler \ XSC_Config_Handlers_Common + sharedname = XSC_Config_Handlers dynamicflags = CONFIG_HANDLERS_BUILD_DLL libs += CIAO_XML_Utils \ - CIAO_Events_Handlers \ - RT_CCM_Config_Handlers \ XSC_XML_Handlers \ XSC_DynAny_Handler \ XSC_Config_Handlers_Common - + + includes += $(CIAO_ROOT)/ciao + Source_Files { DP_Handler.cpp CCD_Handler.cpp @@ -90,12 +93,11 @@ project (XSC_Config_Handlers) : ciao_deployment_stub, ciao_events_dnc, ciao_conf ID_Handler.cpp XML_File_Intf.cpp IDREF_Base.cpp - DnC_Dump.cpp Dump_Obj.cpp PCD_Handler.cpp IRDD_Handler.cpp DD_Handler.cpp - + DnC_Dump.cpp } Header_Files { @@ -104,14 +106,14 @@ project (XSC_Config_Handlers) : ciao_deployment_stub, ciao_events_dnc, ciao_conf } -project (XSC_Config_Handlers_Common) : ciao_deployment_stub, ciao_config_handlers_base, ace_output { - after += XSC_DynAny_Handler - sharedname = XSC_Config_Handlers_Common - dynamicflags = CONFIG_HANDLERS_COMMON_BUILD_DLL +project (XSC_Config_Handlers_Common) : dance_deployment_stub, ciao_config_handlers_base, ciao_lib, dance { + after += XSC_DynAny_Handler + sharedname = XSC_Config_Handlers_Common + dynamicflags = CONFIG_HANDLERS_COMMON_BUILD_DLL - libs += XSC_DynAny_Handler + libs += XSC_DynAny_Handler - Source_Files { + Source_Files { ERE_Handler.cpp Req_Handler.cpp DataType_Handler.cpp @@ -120,18 +122,18 @@ project (XSC_Config_Handlers_Common) : ciao_deployment_stub, ciao_config_handler CPD_Handler.cpp CEPE_Handler.cpp Any_Handler.cpp - } -} -project (XSC_Config_Handlers_Tests) : ciao_component_dnc, ciao_config_handlers, ifr_client { -// requires += dummy_label -includes += $(CIAO_ROOT)/tools/Config_Handlers -exename = test -dynamicflags = CONFIG_HANDLERS_BUILD_DLL -macros += XML_USE_PTHREADS - -Source_Files { -test.cpp + } } +project (XSC_Config_Handlers_Tests) : dance_deployment_stub, ciao_config_handlers, ifr_client { + requires += dummy_label + includes += $(CIAO_ROOT)/tools/Config_Handlers + exename = test + dynamicflags = CONFIG_HANDLERS_BUILD_DLL + macros += XML_USE_PTHREADS + + Source_Files { + test.cpp + } } diff --git a/CIAO/tools/Config_Handlers/DD_Handler.cpp b/CIAO/tools/Config_Handlers/DD_Handler.cpp index bb8981096de..ee9fbd79012 100644 --- a/CIAO/tools/Config_Handlers/DD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DD_Handler.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "SatisfierProperty_Handler.h" #include "DD_Handler.h" #include "Any_Handler.h" @@ -20,21 +20,9 @@ namespace CIAO retval_ (false) { CIAO_TRACE("DP_PCD_Handler::constructor"); - XML_Helper helper; - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "inside DD_Handler")); - } - - + XERCES_CPP_NAMESPACE::DOMDocument *dom = - helper.create_dom (file); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "after create dom")); - } + XML_Helper::XML_HELPER.create_dom (file); if (!dom) throw DD_Handler::NoDomain (); @@ -44,19 +32,8 @@ namespace CIAO // Domain d = domain (dom); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "dom")); - } - - this->domain_.reset (dm); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "after reset")); - } - if (!this->build_domain ()) throw NoDomain (); } @@ -94,20 +71,15 @@ namespace CIAO // Check if the label is there or not if (domain_->label_p ()) this->idl_domain_->label = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (domain_->label ().c_str ())); + CORBA::string_dup (domain_->label ().c_str ()); if (domain_->UUID_p ()) this->idl_domain_->UUID = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (domain_->UUID ().c_str ())); + CORBA::string_dup (domain_->UUID ().c_str ()); CORBA::ULong len = domain_->count_node (); this->idl_domain_->node.length (len); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "The node length is [%d]\n",len)); - } - //Resource _resource; int i =0; for (Domain::node_const_iterator iter = domain_->begin_node (); @@ -117,11 +89,11 @@ namespace CIAO { // Node* thisNode = (Node*)iter; this->idl_domain_->node[i].name = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (iter->name ().c_str ())); + CORBA::string_dup (iter->name ().c_str ()); if (iter->label_p ()) this->idl_domain_->node[i].label = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (iter->label ().c_str ())); + CORBA::string_dup (iter->label ().c_str ()); // length is hard-coded for now ... // here iterate over the resources ... @@ -136,7 +108,7 @@ namespace CIAO { this->idl_domain_->node[i].resource[res_id].name = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (res_iter->name ().c_str ())); + CORBA::string_dup (res_iter->name ().c_str ()); CORBA::ULong resource_type_len = res_iter->count_resourceType (); this->idl_domain_->node[i].resource[res_id].resourceType.length (resource_type_len); @@ -150,7 +122,7 @@ namespace CIAO res_type_iter++, res_type_id++) { this->idl_domain_->node[i].resource[res_id].resourceType[res_type_id] = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (res_type_iter->c_str ())); + CORBA::string_dup (res_type_iter->c_str ()); } CORBA::ULong property_len = res_iter->count_property (); diff --git a/CIAO/tools/Config_Handlers/DD_Handler.h b/CIAO/tools/Config_Handlers/DD_Handler.h index eb05269d360..f3a9e0c60c9 100644 --- a/CIAO/tools/Config_Handlers/DD_Handler.h +++ b/CIAO/tools/Config_Handlers/DD_Handler.h @@ -17,7 +17,6 @@ #include "Config_Handlers_Export.h" #include "ace/Auto_Ptr.h" -// #include "Utils/XML_Helper.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -68,25 +67,25 @@ DD_Handler(::Deployment::Domain *dmn); * @brief Returns the const IDL domain * @return Domain* the IDL domain pointer */ -::Deployment::Domain const *domain_idl (void) const; + ::Deployment::Domain const *domain_idl (void) const; /** * @brief Returns the IDL domain * @return Domain* the IDL domain pointer */ -::Deployment::Domain *domain_idl (void); + ::Deployment::Domain *domain_idl (void); /** * @brief Returns the const XSC domain * @return Domain* the XSC domain pointer */ -Domain const *domain_xsc (void) const; + Domain const *domain_xsc (void) const; /** * @brief Returns the XSC domain * @return Domain* the XSC domain pointer */ -Domain *domain_xsc (void); + Domain *domain_xsc (void); private: /** diff --git a/CIAO/tools/Config_Handlers/DP_Handler.cpp b/CIAO/tools/Config_Handlers/DP_Handler.cpp index 2ed9a8e709f..3ee8e394bf5 100644 --- a/CIAO/tools/Config_Handlers/DP_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DP_Handler.cpp @@ -11,10 +11,6 @@ #include "ID_Handler.h" #include "Property_Handler.h" #include "cdp.hpp" -#include "RT-CCM/SRD_Handler.h" -#include "RT-CCM/CIAOServerResources.hpp" -#include "CIAO_Events/CIAOEvents_Handler.h" -#include "CIAO_Events/CIAOEvents.hpp" #include "PCD_Handler.h" @@ -26,7 +22,7 @@ ACE_RCSID (Config_Handlers, { namespace Config_Handlers { - DP_Handler::DP_Handler (DeploymentPlan &dp) + DP_Handler::DP_Handler (deploymentPlan &dp) : xsc_dp_ (0) , idl_dp_ (0) , retval_ (true) @@ -36,7 +32,7 @@ ACE_RCSID (Config_Handlers, } DP_Handler::DP_Handler (const ::Deployment::DeploymentPlan &plan) - : xsc_dp_ (new DeploymentPlan), + : xsc_dp_ (new deploymentPlan), idl_dp_ (0), retval_ (0) { @@ -49,7 +45,7 @@ ACE_RCSID (Config_Handlers, { } - DeploymentPlan const * + deploymentPlan const * DP_Handler::xsc (void) const { if (this->retval_ && this->xsc_dp_.get () != 0) @@ -58,7 +54,7 @@ ACE_RCSID (Config_Handlers, throw NoPlan (); } - DeploymentPlan * + deploymentPlan * DP_Handler::xsc (void) { if (this->retval_ && this->xsc_dp_.get () != 0) @@ -86,7 +82,7 @@ ACE_RCSID (Config_Handlers, } bool - DP_Handler::resolve_plan (DeploymentPlan &xsc_dp) + DP_Handler::resolve_plan (deploymentPlan &xsc_dp) { CIAO_TRACE ("DP_Handler::resolve_plan"); @@ -99,18 +95,18 @@ ACE_RCSID (Config_Handlers, if (xsc_dp.label_p ()) { this->idl_dp_->label = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (xsc_dp.label ().c_str ())); + CORBA::string_dup (xsc_dp.label ().c_str ()); } // Read in the UUID, if present if (xsc_dp.UUID_p ()) { this->idl_dp_->UUID = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (xsc_dp.UUID ().c_str ())); + CORBA::string_dup (xsc_dp.UUID ().c_str ()); } // Similar thing for dependsOn - for (DeploymentPlan::dependsOn_const_iterator dstart = xsc_dp.begin_dependsOn (); + for (deploymentPlan::dependsOn_const_iterator dstart = xsc_dp.begin_dependsOn (); dstart != xsc_dp.end_dependsOn (); ++dstart) { @@ -122,7 +118,7 @@ ACE_RCSID (Config_Handlers, } // ... An the property stuff - for (DeploymentPlan::infoProperty_const_iterator pstart = xsc_dp.begin_infoProperty (); + for (deploymentPlan::infoProperty_const_iterator pstart = xsc_dp.begin_infoProperty (); pstart != xsc_dp.end_infoProperty (); ++pstart) { @@ -131,44 +127,8 @@ ACE_RCSID (Config_Handlers, this->idl_dp_->infoProperty.length (len + 1); - if (pstart->name () == ACE_TEXT ("CIAOServerResources")) - { - /* - * Hook for RT-CCM - */ - - - ACE_DEBUG ((LM_DEBUG, - "Importing ServerResources...\n")); - - // Parse the SR document - SRD_Handler srd_handler (pstart->value ().value ().begin_string ()->c_str ()); - - // Populate the property - this->idl_dp_->infoProperty [len].name = ACE_TEXT_ALWAYS_CHAR (pstart->name ().c_str ()); - this->idl_dp_->infoProperty [len].value <<= *(srd_handler.srd_idl ()); - } - else if (pstart->name () == ACE_TEXT ("CIAOEvents")) - { - /* - * Hook for EVENTS - */ - - ACE_DEBUG ((LM_DEBUG, - "Importing CIAOEvents...\n")); - - // Parse the SR document - CIAOEvents_Handler event_handler (pstart->value ().value ().begin_string ()->c_str ()); - - // Populate the property - this->idl_dp_->infoProperty [len].name = ACE_TEXT_ALWAYS_CHAR (pstart->name ().c_str ()); - this->idl_dp_->infoProperty [len].value <<= *(event_handler.esd_idl ()); - } - else - { - Property_Handler::handle_property (*pstart, - this->idl_dp_->infoProperty [len]); - } + Property_Handler::handle_property (*pstart, + this->idl_dp_->infoProperty [len]); } // Read in the realizes, if present @@ -217,14 +177,14 @@ ACE_RCSID (Config_Handlers, // Read in the label, if present, since minoccurs = 0 if (plan.label != 0) { - XMLSchema::string< ACE_TCHAR > i(ACE_TEXT_CHAR_TO_TCHAR (plan.label.in ())); + XMLSchema::string< char > i((plan.label)); this->xsc_dp_->label(i); } // Read in the UUID, if present if (plan.UUID != 0) { - XMLSchema::string< ACE_TCHAR > j(ACE_TEXT_CHAR_TO_TCHAR (plan.UUID.in ())); + XMLSchema::string< char > j((plan.UUID)); this->xsc_dp_->UUID(j); } diff --git a/CIAO/tools/Config_Handlers/DP_Handler.h b/CIAO/tools/Config_Handlers/DP_Handler.h index cbee2d1f568..82d93aaa62f 100644 --- a/CIAO/tools/Config_Handlers/DP_Handler.h +++ b/CIAO/tools/Config_Handlers/DP_Handler.h @@ -1,11 +1,11 @@ //============================================================== /** -* @file DP_Handler.h -* -* $Id$ -* -* @author Bala Natarajan <bala@dre.vanderbilt.edu> -*/ + * @file DP_Handler.h + * + * $Id$ + * + * @author Bala Natarajan <bala@dre.vanderbilt.edu> + */ //================================================================ #ifndef CIAO_CONFIG_HANDLERS_DP_HANDLER_H @@ -24,63 +24,63 @@ using std::auto_ptr; namespace Deployment { -struct DeploymentPlan ; + struct DeploymentPlan ; } namespace CIAO { -namespace Config_Handlers -{ -class DeploymentPlan; - -/* -* @class DP_Handler -* -* @brief Handler for Deployment::DeploymentPlan -*/ -class Config_Handlers_Export DP_Handler -{ -public: -class NoPlan {}; + namespace Config_Handlers + { + class deploymentPlan; -/// Use this constructor if you want to use -/// the XSC->IDL mapping -DP_Handler (DeploymentPlan &dp); + /* + * @class DP_Handler + * + * @brief Handler for Deployment::DeploymentPlan + */ + class Config_Handlers_Export DP_Handler + { + public: + class NoPlan {}; -/// Use this constructor if you want to use -/// the IDL->XSC mapping -DP_Handler (const ::Deployment::DeploymentPlan &plan); + /// Use this constructor if you want to use + /// the XSC->IDL mapping + DP_Handler (deploymentPlan &dp); -~DP_Handler (void) -throw (); + /// Use this constructor if you want to use + /// the IDL->XSC mapping + DP_Handler (const ::Deployment::DeploymentPlan &plan); -/// Generates the IDL->XSC mapping. returns -/// null if the method fails or if the class was -/// constructed with the wrong source. -DeploymentPlan const *xsc (void) const; + ~DP_Handler (void) + throw (); -DeploymentPlan *xsc (void); + /// Generates the IDL->XSC mapping. returns + /// null if the method fails or if the class was + /// constructed with the wrong source. + deploymentPlan const *xsc (void) const; -/// Generates the XSC->IDL mapping. returns null -/// if the method fails or the class was constructed -::Deployment::DeploymentPlan const *plan (void) const; + deploymentPlan *xsc (void); -::Deployment::DeploymentPlan *plan (void); + /// Generates the XSC->IDL mapping. returns null + /// if the method fails or the class was constructed + ::Deployment::DeploymentPlan const *plan (void) const; -private: + ::Deployment::DeploymentPlan *plan (void); -bool resolve_plan (DeploymentPlan &dp); + private: -bool build_xsc (const ::Deployment::DeploymentPlan &plan); + bool resolve_plan (deploymentPlan &dp); -private: -auto_ptr< DeploymentPlan > xsc_dp_; + bool build_xsc (const ::Deployment::DeploymentPlan &plan); -auto_ptr< ::Deployment::DeploymentPlan> idl_dp_; + private: + auto_ptr< deploymentPlan > xsc_dp_; -bool retval_; -}; -} + auto_ptr< ::Deployment::DeploymentPlan> idl_dp_; + + bool retval_; + }; + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/DP_PCD_Handler.cpp b/CIAO/tools/Config_Handlers/DP_PCD_Handler.cpp index ea36b5037f5..882a87393c0 100644 --- a/CIAO/tools/Config_Handlers/DP_PCD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DP_PCD_Handler.cpp @@ -22,7 +22,7 @@ namespace CIAO CIAO_TRACE("DP_PCD_Handler::plan_connection_descrs"); DeploymentPlan::connection_const_iterator cci_e = src.end_connection (); - + CORBA::ULong pos = 0; dest.length (src.count_connection ()); for (DeploymentPlan::connection_const_iterator cci_b = @@ -34,10 +34,10 @@ namespace CIAO dest[pos++]); } } - + PlanConnectionDescription DP_PCD_Handler::plan_connection_descr ( - const Deployment::PlanConnectionDescription &src) + const Deployment::PlanConnectionDescription &src) { CIAO_TRACE("DP_PCD_Handler::plan_connection_descr"); PlanConnectionDescription pcd = PCD_Handler::get_PlanConnectionDescription(src); diff --git a/CIAO/tools/Config_Handlers/DP_PCD_Handler.h b/CIAO/tools/Config_Handlers/DP_PCD_Handler.h index 25c1cb336dc..eceb6f03bb6 100644 --- a/CIAO/tools/Config_Handlers/DP_PCD_Handler.h +++ b/CIAO/tools/Config_Handlers/DP_PCD_Handler.h @@ -53,7 +53,7 @@ namespace CIAO Deployment::PlanConnectionDescriptions& toconfig); static PlanConnectionDescription plan_connection_descr( - const Deployment::PlanConnectionDescription &src); + const Deployment::PlanConnectionDescription &src); private: static void plan_connection_descr ( diff --git a/CIAO/tools/Config_Handlers/Deployment.cpp b/CIAO/tools/Config_Handlers/Deployment.cpp index 88016096004..8884b13c108 100644 --- a/CIAO/tools/Config_Handlers/Deployment.cpp +++ b/CIAO/tools/Config_Handlers/Deployment.cpp @@ -39,7 +39,7 @@ namespace CIAO domain (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("domain")) + if (e.name () == "domain") { ::CIAO::Config_Handlers::Domain r (e); return r; @@ -51,13 +51,13 @@ namespace CIAO } } - ::CIAO::Config_Handlers::DeploymentPlan - deploymentPlan (xercesc::DOMDocument const* d) + ::CIAO::Config_Handlers::deploymentPlan + DeploymentPlan (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("deploymentPlan")) + if (e.name () == "DeploymentPlan") { - ::CIAO::Config_Handlers::DeploymentPlan r (e); + ::CIAO::Config_Handlers::deploymentPlan r (e); return r; } @@ -71,7 +71,7 @@ namespace CIAO implementationArtifactDescription (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("implementationArtifactDescription")) + if (e.name () == "implementationArtifactDescription") { ::CIAO::Config_Handlers::ImplementationArtifactDescription r (e); return r; @@ -87,7 +87,7 @@ namespace CIAO componentInterfaceDescription (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("componentInterfaceDescription")) + if (e.name () == "componentInterfaceDescription") { ::CIAO::Config_Handlers::ComponentInterfaceDescription r (e); return r; @@ -103,7 +103,7 @@ namespace CIAO componentImplementationDescription (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("componentImplementationDescription")) + if (e.name () == "componentImplementationDescription") { ::CIAO::Config_Handlers::ComponentImplementationDescription r (e); return r; @@ -119,7 +119,7 @@ namespace CIAO componentPackageDescription (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("componentPackageDescription")) + if (e.name () == "componentPackageDescription") { ::CIAO::Config_Handlers::ComponentPackageDescription r (e); return r; @@ -135,7 +135,7 @@ namespace CIAO packageConfiguration (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("packageConfiguration")) + if (e.name () == "packageConfiguration") { ::CIAO::Config_Handlers::PackageConfiguration r (e); return r; @@ -151,7 +151,7 @@ namespace CIAO topLevelPackageDescription (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("topLevelPackageDescription")) + if (e.name () == "topLevelPackageDescription") { ::CIAO::Config_Handlers::TopLevelPackageDescription r (e); return r; @@ -206,7 +206,7 @@ namespace CIAO domain (::CIAO::Config_Handlers::Domain const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("domain")) + if (e.name () != "domain") { throw 1; } @@ -229,12 +229,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedByte, ACE_TCHAR >, @@ -256,15 +257,15 @@ namespace CIAO } void - deploymentPlan (::CIAO::Config_Handlers::DeploymentPlan const& s, xercesc::DOMDocument* d) + DeploymentPlan (::CIAO::Config_Handlers::deploymentPlan const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("deploymentPlan")) + if (e.name () != "DeploymentPlan") { throw 1; } - struct W : virtual ::CIAO::Config_Handlers::Writer::DeploymentPlan, + struct W : virtual ::CIAO::Config_Handlers::Writer::deploymentPlan, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::string< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::ComponentInterfaceDescription, virtual ::CIAO::Config_Handlers::Writer::Property, @@ -277,12 +278,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -294,6 +296,7 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::CCMComponentPortKind, virtual ::CIAO::Config_Handlers::Writer::ComponentPropertyDescription, virtual ::CIAO::Config_Handlers::Writer::MonolithicDeploymentDescription, + virtual ::CIAO::Config_Handlers::Writer::IdRef, virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::Requirement, virtual ::CIAO::Config_Handlers::Writer::InstanceDeploymentDescription, @@ -307,6 +310,8 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ImplementationDependency, virtual ::CIAO::Config_Handlers::Writer::ArtifactDeploymentDescription, virtual ::CIAO::Config_Handlers::Writer::ResourceDeploymentDescription, + virtual ::CIAO::Config_Handlers::Writer::PlanLocality, + virtual ::CIAO::Config_Handlers::Writer::PlanLocalityKind, virtual ::XSCRT::Writer< ACE_TCHAR > { W (::XSCRT::XML::Element< ACE_TCHAR >& e) @@ -323,7 +328,7 @@ namespace CIAO implementationArtifactDescription (::CIAO::Config_Handlers::ImplementationArtifactDescription const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("implementationArtifactDescription")) + if (e.name () != "implementationArtifactDescription") { throw 1; } @@ -341,12 +346,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -371,7 +377,7 @@ namespace CIAO componentInterfaceDescription (::CIAO::Config_Handlers::ComponentInterfaceDescription const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("componentInterfaceDescription")) + if (e.name () != "componentInterfaceDescription") { throw 1; } @@ -388,12 +394,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -420,7 +427,7 @@ namespace CIAO componentImplementationDescription (::CIAO::Config_Handlers::ComponentImplementationDescription const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("componentImplementationDescription")) + if (e.name () != "componentImplementationDescription") { throw 1; } @@ -438,12 +445,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -464,6 +472,7 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::Requirement, virtual ::CIAO::Config_Handlers::Writer::AssemblyConnectionDescription, virtual ::CIAO::Config_Handlers::Writer::SubcomponentPortEndpoint, + virtual ::CIAO::Config_Handlers::Writer::IdRef, virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::ComponentExternalPortEndpoint, virtual ::CIAO::Config_Handlers::Writer::ExternalReferenceEndpoint, @@ -494,7 +503,7 @@ namespace CIAO componentPackageDescription (::CIAO::Config_Handlers::ComponentPackageDescription const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("componentPackageDescription")) + if (e.name () != "componentPackageDescription") { throw 1; } @@ -512,12 +521,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -538,6 +548,7 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::Requirement, virtual ::CIAO::Config_Handlers::Writer::AssemblyConnectionDescription, virtual ::CIAO::Config_Handlers::Writer::SubcomponentPortEndpoint, + virtual ::CIAO::Config_Handlers::Writer::IdRef, virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::ComponentExternalPortEndpoint, virtual ::CIAO::Config_Handlers::Writer::ExternalReferenceEndpoint, @@ -568,7 +579,7 @@ namespace CIAO packageConfiguration (::CIAO::Config_Handlers::PackageConfiguration const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("packageConfiguration")) + if (e.name () != "packageConfiguration") { throw 1; } @@ -587,12 +598,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -612,6 +624,7 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ComponentPackageImport, virtual ::CIAO::Config_Handlers::Writer::AssemblyConnectionDescription, virtual ::CIAO::Config_Handlers::Writer::SubcomponentPortEndpoint, + virtual ::CIAO::Config_Handlers::Writer::IdRef, virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::ComponentExternalPortEndpoint, virtual ::CIAO::Config_Handlers::Writer::ExternalReferenceEndpoint, @@ -642,7 +655,7 @@ namespace CIAO topLevelPackageDescription (::CIAO::Config_Handlers::TopLevelPackageDescription const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("topLevelPackageDescription")) + if (e.name () != "topLevelPackageDescription") { throw 1; } @@ -662,12 +675,13 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ValueType, virtual ::CIAO::Config_Handlers::Writer::ValueMemberType, virtual ::CIAO::Config_Handlers::Writer::SequenceType, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, + virtual ::CIAO::Config_Handlers::Writer::AliasType, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::DataValue, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::short_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::int_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedShort, ACE_TCHAR >, - virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::unsignedInt, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::float_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::double_, ACE_TCHAR >, virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::boolean, ACE_TCHAR >, @@ -687,6 +701,7 @@ namespace CIAO virtual ::CIAO::Config_Handlers::Writer::ComponentPackageImport, virtual ::CIAO::Config_Handlers::Writer::AssemblyConnectionDescription, virtual ::CIAO::Config_Handlers::Writer::SubcomponentPortEndpoint, + virtual ::CIAO::Config_Handlers::Writer::IdRef, virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, virtual ::CIAO::Config_Handlers::Writer::ComponentExternalPortEndpoint, virtual ::CIAO::Config_Handlers::Writer::ExternalReferenceEndpoint, diff --git a/CIAO/tools/Config_Handlers/Deployment.hpp b/CIAO/tools/Config_Handlers/Deployment.hpp index d0477b78113..d502c9b534a 100644 --- a/CIAO/tools/Config_Handlers/Deployment.hpp +++ b/CIAO/tools/Config_Handlers/Deployment.hpp @@ -58,8 +58,8 @@ namespace CIAO domain (xercesc::DOMDocument const*); XSC_XML_Handlers_Export - ::CIAO::Config_Handlers::DeploymentPlan - deploymentPlan (xercesc::DOMDocument const*); + ::CIAO::Config_Handlers::deploymentPlan + DeploymentPlan (xercesc::DOMDocument const*); XSC_XML_Handlers_Export ::CIAO::Config_Handlers::ImplementationArtifactDescription @@ -121,7 +121,7 @@ namespace CIAO XSC_XML_Handlers_Export void - deploymentPlan (::CIAO::Config_Handlers::DeploymentPlan const&, xercesc::DOMDocument*); + DeploymentPlan (::CIAO::Config_Handlers::deploymentPlan const&, xercesc::DOMDocument*); XSC_XML_Handlers_Export void diff --git a/CIAO/tools/Config_Handlers/DnC_Dump.cpp b/CIAO/tools/Config_Handlers/DnC_Dump.cpp index 475b8894dab..f9efb5a95a8 100644 --- a/CIAO/tools/Config_Handlers/DnC_Dump.cpp +++ b/CIAO/tools/Config_Handlers/DnC_Dump.cpp @@ -525,7 +525,7 @@ namespace Deployment dump ("requiredUUID", cpr.requiredUUID); dump ("requiredName", cpr.requiredName); - dump ("requiredType", cpr.requiredType); + dump ("requiredType", cpr.requiredType.specificType); } // SubcomponentInstantiationDescription @@ -736,7 +736,7 @@ namespace Deployment dump ("UUID", pc.UUID); dump_sequence ("specializedConfig", pc.specializedConfig); dump_sequence ("basePackage", pc.basePackage); - dump_sequence ("reference", pc.reference); + dump_sequence ("reference", pc.referencedPackage); dump_sequence ("selectRequirement", pc.selectRequirement); dump_sequence ("configProperty", pc.configProperty); } @@ -960,7 +960,20 @@ encoded with different type")); temp)); } break; - + + case CORBA::tk_enum: + { +/* CORBA::Enum temp; + if (! (any >>= temp)) + { + ACE_DEBUG ((LM_DEBUG, "DnC::dump (CORBA::Any) expected enum \ +encoded with different type")); + throw CORBA::INTERNAL (); + } +*/ ACE_DEBUG ((LM_DEBUG, "%sAny value: some enum \n", Dump_Obj::indent ())); + } + break; + default: ACE_DEBUG ((LM_DEBUG, "Unknown type encoded in Any\n")); throw CORBA::INTERNAL (); diff --git a/CIAO/tools/Config_Handlers/DnC_Dump.h b/CIAO/tools/Config_Handlers/DnC_Dump.h index 17fb49377de..cacc9b338ad 100644 --- a/CIAO/tools/Config_Handlers/DnC_Dump.h +++ b/CIAO/tools/Config_Handlers/DnC_Dump.h @@ -23,6 +23,7 @@ namespace Deployment { + /** * @class DnC_Dump * @@ -36,7 +37,7 @@ public: static void dump (const char* caption, const ::CORBA::StringSeq &str_seq); -static void dump (const char* caption, const TAO::String_Manager& str); + static void dump (const char* caption, const TAO::String_Manager& str); static void dump (const char* caption, const CORBA::Boolean& val); diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler.mpc b/CIAO/tools/Config_Handlers/DynAny_Handler.mpc index 170d67aa9ad..c5cc64b7a34 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler.mpc +++ b/CIAO/tools/Config_Handlers/DynAny_Handler.mpc @@ -1,6 +1,7 @@ // $Id$ -project (XSC_DynAny_Handler) : xerces, dynamicany, typecodefactory, ciao_client_dnc, ciao_config_handlers_base { +project (XSC_DynAny_Handler) : xerces, dynamicany, typecodefactory, dance_deployment_stub, \ + ciao_config_handlers_base, ciao_lib, dance, ifr_client { after += XSC_XML_Handlers libs += XSC_XML_Handlers dynamicflags += DYNANY_HANDLER_BUILD_DLL @@ -10,6 +11,9 @@ project (XSC_DynAny_Handler) : xerces, dynamicany, typecodefactory, ciao_client_ Source_Files { DynAny_Handler/DynAny_Handler.cpp DynAny_Handler/DynEnum_Handler.cpp + DynAny_Handler/DynSequence_Handler.cpp + DynAny_Handler/DynStruct_Handler.cpp + DynAny_Handler/DynAlias_Handler.cpp } Header_Files { diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp index 77567e3739c..333e9fd7b92 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp @@ -98,7 +98,7 @@ namespace CIAO{ default: ACE_ERROR ((LM_ERROR, "Invalid typecode in any\n")); - throw 1; + throw Config_Error ("", "Invalid typecode"); } // This case used to be supported...is it not in the schema? @@ -170,7 +170,7 @@ namespace CIAO{ type.kind (TCKind::tk_TypeCode); default: ACE_ERROR ((LM_ERROR, "Invalid typecode\n")); - throw 1; + throw Config_Error ("", "Invalid typecode"); } return type; diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.cpp new file mode 100644 index 00000000000..5a25b192c00 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.cpp @@ -0,0 +1,195 @@ +// $Id$ + +#include "DynAlias_Handler.h" +#include "DynAny_Handler.h" + +#include "Basic_Deployment_Data.hpp" +#include "Common.h" + +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/TypeCodeFactory/TypeCodeFactory_Adapter_Impl.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" +#include "tao/AnyTypeCode/Enum_TypeCode.h" +#include "tao/IFR_Client/IFR_BasicC.h" + +namespace CIAO +{ + namespace Config_Handlers + { + DynamicAny::DynAny_ptr + DynAlias_Handler::extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr req_tc) + { + try + { + CORBA::TypeCode_ptr tc; + + if (req_tc) + tc = req_tc; + else + tc = DynAlias_Handler::create_typecode (type); + + // Make the actual DynAlias + // DynamicAny::DynAny_var retval = + //DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc); + // DynamicAny::DynAlias_var retval = DynamicAny::DynAlias::_narrow (temp.in ()); + + DynamicAny::DynAny_var alias = DYNANY_HANDLER->extract_into_dynany (type.alias ().elementType (), value, tc); + return alias._retn (); + /* + switch (type.kind ().integral ()) + { + // ========== BASIC TYPES + case TCKind::tk_null_l: + case TCKind::tk_void_l: + ACE_ERROR ((LM_WARNING, "I don't know how to handle null or void types\n")); + + case TCKind::tk_short_l: + retval->insert_short (CORBA::Short (static_cast < ::XMLSchema::short_ const & > (*value.begin_short ()))); + break; + + case TCKind::tk_long_l: + retval->insert_long (CORBA::Long (static_cast < ::XMLSchema::int_ const& > (*value.begin_long ()))); + break; + + case TCKind::tk_ushort_l: + retval->insert_ushort (CORBA::UShort (static_cast< ::XMLSchema::unsignedShort const & > (*value.begin_ushort ()))); + break; + + case TCKind::tk_ulong_l: + retval->insert_ulong (CORBA::ULong (static_cast < ::XMLSchema::unsignedInt const& > (*value.begin_ulong ()))); + break; + + case TCKind::tk_float_l: + retval->insert_float (CORBA::Float (*value.begin_float ())); + break; + + case TCKind::tk_double_l: + retval->insert_double (CORBA::Double (*value.begin_double ())); + break; + + case TCKind::tk_boolean_l: + retval->insert_boolean (static_cast < ::XMLSchema::boolean const& > (*value.begin_boolean ())); + break; + + case TCKind::tk_char_l: + retval->insert_char (CORBA::Char (*value.begin_string ()->c_str ())); + break; + + case TCKind::tk_octet_l: + retval->insert_octet (static_cast <const unsigned char &> (*value.begin_octet ())); + break; + + case TCKind::tk_string_l: + retval->insert_string (value.begin_string ()->c_str ()); + break; + + case TCKind::tk_longlong_l: + retval->insert_longlong (CORBA::LongLong (static_cast < ::XMLSchema::long_ const& > (*value.begin_longlong ()))); + break; + + case TCKind::tk_ulonglong_l: + retval->insert_ulonglong (CORBA::ULongLong (static_cast < ::XMLSchema::unsignedLong const& > (*value.begin_ulonglong ()))); + break; + + case TCKind::tk_wchar_l: + retval->insert_wchar (CORBA::WChar (*value.begin_string ()->c_str ())); + break; + + case TCKind::tk_enum_l: + return DynEnum_Handler::extract_into_dynany (type, value); + + case TCKind::tk_sequence_l: + return DynSequence_Handler::extract_into_dynany (type, value); + + case TCKind::tk_struct_l: + return DynStruct_Handler::extract_into_dynany (type, value); + + case TCKind::tk_alias_l: + return DynAlias_Handler::extract_into_dynany (type, value); + + case TCKind::tk_longdouble_l: + case TCKind::tk_wstring_l: + case TCKind::tk_wfixed_l: + case TCKind::tk_any_l: + case TCKind::tk_TypeCode_l: + case TCKind::tk_Principal_l: + case TCKind::tk_objref_l: + case TCKind::tk_union_l: + case TCKind::tk_array_l: + case TCKind::tk_except_l: + case TCKind::tk_value_l: + case TCKind::tk_value_box_l: + case TCKind::tk_native_l: + case TCKind::tk_abstract_interface_l: + case TCKind::tk_local_interface_l: + case TCKind::tk_component_l: + case TCKind::tk_home_l: + case TCKind::tk_event_l: + ACE_ERROR ((LM_ERROR, "Type not supported\n")); + throw Config_Error ("", "Type not supported"); + } + */ + // retval->assign (alias); + + // return retval._retn (); + } + catch (DynamicAny::DynAny::InvalidValue) + { + ACE_ERROR ((LM_ERROR, "Invalid value provided in XML when trying to " + "initialize an instance of enumerated type %s\n", + type.alias ().typeId ().c_str ())); + throw Config_Error (type.alias ().typeId (), + "Invalid value provided in XML"); + } + catch (Config_Error &ex) + { + ACE_ERROR ((LM_ERROR, "DynAlias_Handler caught Config_Error\n")); + if (type.alias_p ()) + ex.add_name (type.alias ().typeId ()); + + throw ex; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "DynAlias_Handler caught unknown exception\n")); + throw Config_Error (type.alias ().typeId (), + "Unknown exception"); + } + } + + void + DynAlias_Handler::extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn) + { + ACE_UNUSED_ARG (dyn); + ACE_ERROR ((LM_ERROR, "Extracting Enums not yet supported\n")); + } + + CORBA::TypeCode_ptr + DynAlias_Handler::create_typecode (const DataType &type) + { + if (!type.alias_p ()) + { + ACE_ERROR ((LM_ERROR, "ERROR: Alias type descriptioin required")); + throw Config_Error ("", "Did not find expected alias type description, tk_kind may be wrong."); + } + + + // @@ Leak this guy onto the heap to avoid a compile problem. + CORBA::TypeCode_ptr tc = + DYNANY_HANDLER->orb ()->create_alias_tc + (type.alias ().typeId ().c_str (), + type.alias ().name ().c_str (), + DYNANY_HANDLER->create_typecode (type.alias ().elementType ())); + + DYNANY_HANDLER->register_typecode (type.alias ().typeId (), + tc); + + return tc; + } + + } +} + + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.h new file mode 100644 index 00000000000..b5bca3c7377 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAlias_Handler.h @@ -0,0 +1,52 @@ +/** + * $Id$ + * + * @file DynAlias_Handler.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + */ + +#ifndef CIAO_CONFIG_HANDLERS_DYNALIAS_HANDLER_H +#define CIAO_CONFIG_HANDLERS_DYNALIAS_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DynAny_Handler_Export.h" + +#include "tao/ORB.h" +#include "tao/DynamicAny/DynamicAny.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + class Any; + class DataType; + class DataValue; + + /** + * @class DynAlias_Handler + * @brief Translates enums specified in deployment plans into Dynamic Anys + * + */ + class DynAlias_Handler + { + public: + static DynamicAny::DynAny_ptr extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr = 0); + + static void extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn); + + static CORBA::TypeCode_ptr create_typecode (const DataType &type); + }; + + } +} + + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_DYNENUM_HANDLER_H*/ + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.cpp index c3d0d62eb26..a4f8d2292f8 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.cpp @@ -4,7 +4,11 @@ #include "DynAny_Handler.h" #include "DynEnum_Handler.h" +#include "DynSequence_Handler.h" +#include "DynStruct_Handler.h" +#include "DynAlias_Handler.h" #include "Basic_Deployment_Data.hpp" +#include "Common.h" namespace CIAO { @@ -25,7 +29,7 @@ namespace CIAO if (CORBA::is_nil (daf_.in ())) { ACE_ERROR ((LM_ERROR, "Unable to narrow Dynamic Any factory\n")); - throw 1; + throw Config_Error ("", "Unable to narrow DynAny factory"); } } @@ -46,10 +50,14 @@ namespace CIAO } DynamicAny::DynAny_ptr - DynAny_Handler::extract_into_dynany (const DataType& type, - const DataValue& value) + DynAny_Handler::extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr req_tc) { DynamicAny::DynAny_var retval; + + if (req_tc) + retval = this->daf_->create_dyn_any_from_type_code (req_tc); switch (type.kind ().integral ()) { @@ -57,92 +65,93 @@ namespace CIAO case TCKind::tk_null_l: case TCKind::tk_void_l: ACE_ERROR ((LM_WARNING, "I don't know how to handle null or void types\n")); - + case TCKind::tk_short_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_short); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_short); retval->insert_short (CORBA::Short (static_cast < ::XMLSchema::short_ const & > (*value.begin_short ()))); break; - + case TCKind::tk_long_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_long); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_long); retval->insert_long (CORBA::Long (static_cast < ::XMLSchema::int_ const& > (*value.begin_long ()))); break; case TCKind::tk_ushort_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ushort); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ushort); retval->insert_ushort (CORBA::UShort (static_cast< ::XMLSchema::unsignedShort const & > (*value.begin_ushort ()))); break; case TCKind::tk_ulong_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ulong); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ulong); retval->insert_ulong (CORBA::ULong (static_cast < ::XMLSchema::unsignedInt const& > (*value.begin_ulong ()))); break; case TCKind::tk_float_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_float); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_float); retval->insert_float (CORBA::Float (*value.begin_float ())); break; case TCKind::tk_double_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_double); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_double); retval->insert_double (CORBA::Double (*value.begin_double ())); break; case TCKind::tk_boolean_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_boolean); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_boolean); retval->insert_boolean (static_cast < ::XMLSchema::boolean const& > (*value.begin_boolean ())); break; case TCKind::tk_char_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_char); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_char); retval->insert_char (CORBA::Char (*value.begin_string ()->c_str ())); break; case TCKind::tk_octet_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_octet); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_octet); retval->insert_octet (static_cast <const unsigned char &> (*value.begin_octet ())); break; case TCKind::tk_string_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_string); - retval->insert_string (ACE_TEXT_ALWAYS_CHAR (value.begin_string ()->c_str ())); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_string); + retval->insert_string (value.begin_string ()->c_str ()); break; case TCKind::tk_longlong_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_longlong); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_longlong); retval->insert_longlong (CORBA::LongLong (static_cast < ::XMLSchema::long_ const& > (*value.begin_longlong ()))); break; case TCKind::tk_ulonglong_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ulonglong); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_ulonglong); retval->insert_ulonglong (CORBA::ULongLong (static_cast < ::XMLSchema::unsignedLong const& > (*value.begin_ulonglong ()))); break; - case TCKind::tk_longdouble_l: - break; - case TCKind::tk_wchar_l: - retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_wchar); + if (!req_tc) retval = this->daf_->create_dyn_any_from_type_code (CORBA::_tc_wchar); retval->insert_wchar (CORBA::WChar (*value.begin_string ()->c_str ())); break; - case TCKind::tk_wstring_l: - break; - case TCKind::tk_enum_l: - ACE_ERROR ((LM_ERROR, "Preparing to extract into enum\n")); - return DynEnum_Handler::extract_into_dynany (type, value); + return DynEnum_Handler::extract_into_dynany (type, value, req_tc); + + case TCKind::tk_sequence_l: + return DynSequence_Handler::extract_into_dynany (type, value, req_tc); + + case TCKind::tk_struct_l: + return DynStruct_Handler::extract_into_dynany (type, value, req_tc); + + case TCKind::tk_alias_l: + return DynAlias_Handler::extract_into_dynany (type, value, req_tc); + case TCKind::tk_longdouble_l: + case TCKind::tk_wstring_l: case TCKind::tk_wfixed_l: case TCKind::tk_any_l: case TCKind::tk_TypeCode_l: case TCKind::tk_Principal_l: case TCKind::tk_objref_l: - case TCKind::tk_struct_l: case TCKind::tk_union_l: - case TCKind::tk_sequence_l: case TCKind::tk_array_l: - case TCKind::tk_alias_l: case TCKind::tk_except_l: case TCKind::tk_value_l: case TCKind::tk_value_box_l: @@ -153,7 +162,7 @@ namespace CIAO case TCKind::tk_home_l: case TCKind::tk_event_l: ACE_ERROR ((LM_ERROR, "Type not supported\n")); - throw 1; + throw Config_Error ("", "Type not supported"); } return retval._retn (); @@ -201,11 +210,8 @@ namespace CIAO return Any (TCKind::tk_octet, val); case CORBA::tk_string: - { - CORBA::String_var owner = dyn->get_string (); - val.add_string (ACE_TEXT_CHAR_TO_TCHAR (owner.in ())); - return Any (TCKind::tk_string, val); - } + val.add_string (dyn->get_string ()); + return Any (TCKind::tk_string, val); case CORBA::tk_longlong: val.add_longlong (dyn->get_longlong ()); @@ -235,9 +241,135 @@ namespace CIAO case ::CORBA::tk_null: default: ACE_ERROR ((LM_ERROR, "DynAny_Handler: I have no idea how to perform a referse mapping.\n")); - throw 1; + throw Config_Error ("", "reverse mapping for this type not supported"); } + } + + CORBA::TypeCode_ptr + DynAny_Handler::create_typecode (const DataType &type) + { + + switch (type.kind ().integral ()) + { + // ========== BASIC TYPES + case TCKind::tk_null_l: + case TCKind::tk_void_l: + ACE_ERROR ((LM_WARNING, "I don't know how to handle null or void types\n")); + throw Config_Error ("", "Null or void types not supported"); + break; + + case TCKind::tk_short_l: + return CORBA::_tc_short; + break; + + case TCKind::tk_long_l: + return CORBA::_tc_long; + break; + + case TCKind::tk_ushort_l: + return CORBA::_tc_ushort; + break; + + case TCKind::tk_ulong_l: + return CORBA::_tc_ulong; + break; + + case TCKind::tk_float_l: + return CORBA::_tc_float; + break; + + case TCKind::tk_double_l: + return CORBA::_tc_double; + break; + + case TCKind::tk_boolean_l: + return CORBA::_tc_boolean; + break; + + case TCKind::tk_char_l: + return CORBA::_tc_char; + break; + + case TCKind::tk_octet_l: + return CORBA::_tc_octet; + break; + case TCKind::tk_string_l: + return CORBA::_tc_string; + break; + + case TCKind::tk_longlong_l: + return CORBA::_tc_longlong; + break; + + case TCKind::tk_ulonglong_l: + return CORBA::_tc_ulonglong; + break; + + case TCKind::tk_longdouble_l: + break; + + case TCKind::tk_wchar_l: + return CORBA::_tc_wchar; + break; + + case TCKind::tk_wstring_l: + break; + + case TCKind::tk_enum_l: + return DynEnum_Handler::create_typecode (type); + + case TCKind::tk_struct_l: + return DynStruct_Handler::create_typecode (type); + + case TCKind::tk_sequence_l: + return DynSequence_Handler::create_typecode (type); + + case TCKind::tk_alias_l: + return DynAlias_Handler::create_typecode (type); + + case TCKind::tk_wfixed_l: + case TCKind::tk_any_l: + case TCKind::tk_TypeCode_l: + case TCKind::tk_Principal_l: + case TCKind::tk_objref_l: + case TCKind::tk_union_l: + case TCKind::tk_array_l: + case TCKind::tk_except_l: + case TCKind::tk_value_l: + case TCKind::tk_value_box_l: + case TCKind::tk_native_l: + case TCKind::tk_abstract_interface_l: + case TCKind::tk_local_interface_l: + case TCKind::tk_component_l: + case TCKind::tk_home_l: + case TCKind::tk_event_l: + ACE_ERROR ((LM_ERROR, "Type not supported\n")); + throw Config_Error ("", "Type not supported"); + } + + return 0; + } + + void + DynAny_Handler::register_typecode (const std::string typeID, + CORBA::TypeCode_ptr tc) + { + this->typecode_map_[typeID] = tc; + } + + + CORBA::TypeCode_ptr + DynAny_Handler::get_typecode (const std::string typeID) + { + try + { + return this->typecode_map_ [typeID]; + } + catch (...) + { + return 0; + } } } } diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.h index a209b3eae2c..cb4f3448b5a 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.h +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler.h @@ -14,10 +14,13 @@ #include "DynAny_Handler_Export.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" #include "tao/ORB.h" #include "tao/DynamicAny/DynamicAny.h" #include "ace/Singleton.h" +#include <map> + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -47,20 +50,30 @@ namespace CIAO ~DynAny_Handler (void); - DynamicAny::DynAny_ptr extract_into_dynany (const DataType& type, - const DataValue& value); - + DynamicAny::DynAny_ptr extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr = 0); + Any extract_from_dynany (const CORBA::Any &any); CORBA::ORB_ptr orb (); DynamicAny::DynAnyFactory_ptr daf (); + + CORBA::TypeCode_ptr create_typecode (const DataType &type); + + void register_typecode (const std::string typeID, + CORBA::TypeCode_ptr tc); + + CORBA::TypeCode_ptr get_typecode (const std::string typeID); private: CORBA::ORB_var orb_; DynamicAny::DynAnyFactory_var daf_; + + std::map <std::string, CORBA::TypeCode_ptr> typecode_map_; }; typedef ACE_Singleton<DynAny_Handler, ACE_Null_Mutex> DynAny_Singleton; diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h index 970869a830d..78a3ee57b77 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynAny_Handler_Export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (DYNANY_HANDLER_HAS_DLL) -# define DYNANY_HANDLER_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && DYNANY_HANDLER_HAS_DLL */ - #if !defined (DYNANY_HANDLER_HAS_DLL) # define DYNANY_HANDLER_HAS_DLL 1 #endif /* ! DYNANY_HANDLER_HAS_DLL */ diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.cpp index 03b0e5c25da..0a525bf22d1 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.cpp +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.cpp @@ -1,10 +1,12 @@ // $Id$ -#include "tao/AnyTypeCode/TypeCode.h" #include "DynEnum_Handler.h" #include "DynAny_Handler.h" #include "Basic_Deployment_Data.hpp" +#include "Common.h" + +#include "tao/AnyTypeCode/TypeCode.h" #include "tao/TypeCodeFactory/TypeCodeFactory_Adapter_Impl.h" #include "tao/AnyTypeCode/AnyTypeCode_methods.h" #include "tao/AnyTypeCode/Enum_TypeCode.h" @@ -16,12 +18,65 @@ namespace CIAO { DynamicAny::DynAny_ptr DynEnum_Handler::extract_into_dynany (const DataType &type, - const DataValue &value) + const DataValue &value, + CORBA::TypeCode_ptr req_tc) + { + try + { + CORBA::TypeCode_ptr tc; + + if (req_tc) + tc = req_tc; + else + tc = DynEnum_Handler::create_typecode (type); + + // Make the actual DynEnum + DynamicAny::DynAny_var temp = + DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc); + DynamicAny::DynEnum_var retval = DynamicAny::DynEnum::_narrow (temp.in ()); + + retval->set_as_string (value.begin_enum ()->c_str ()); + + return retval._retn (); + } + catch (DynamicAny::DynAny::InvalidValue) + { + ACE_ERROR ((LM_ERROR, "Invalid value provided in XML when trying to " + "initialize an instance of enumerated type %s\n", + type.enum_ ().typeId ().c_str ())); + throw Config_Error (type.enum_ ().typeId (), + "Invalid value provided in XML"); + } + catch (Config_Error &ex) + { + ACE_ERROR ((LM_ERROR, "DynEnum_Handler caught Config_Error\n")); + if (type.enum_p ()) + ex.add_name (type.enum_ ().typeId ()); + + throw ex; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "DynEnum_Handler caught unknown exception\n")); + throw Config_Error (type.enum_ ().typeId (), + "Unknown exception"); + } + } + + void + DynEnum_Handler::extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn) + { + ACE_UNUSED_ARG (dyn); + ACE_ERROR ((LM_ERROR, "Extracting Enums not yet supported\n")); + } + + CORBA::TypeCode_ptr + DynEnum_Handler::create_typecode (const DataType &type) { if (!type.enum_p ()) { ACE_ERROR ((LM_ERROR, "ERROR: Enum type descriptioin required")); - throw 1; + throw Config_Error ("", "Did not find expected enum type description, tk_kind may be wrong."); } // Construct TypeCode for the enum @@ -33,39 +88,21 @@ namespace CIAO i != type.enum_ ().end_member (); ++i) { - members[index++] = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->c_str ())); + members[index++] = CORBA::string_dup (i->c_str ()); } - // Grab pointer to the DynAny_Handler to use the orb and any factory. - // DynAny_Handler *dah = DynAny_Handler::instance (); - - CORBA::TypeCode_var tc = - DYNANY_HANDLER->orb ()->create_enum_tc ( - ACE_TEXT_ALWAYS_CHAR (type.enum_ ().typeId ().c_str ()), - ACE_TEXT_ALWAYS_CHAR (type.enum_ ().name ().c_str ()), - members); - - ACE_ERROR ((LM_ERROR, "Type: %s \nName: %s\nvalue: %s\n", - type.enum_ ().typeId ().c_str (), - type.enum_ ().name ().c_str (), - value.begin_enum ()->c_str ())); - - // Make the actual DynEnum - DynamicAny::DynAny_var temp = - DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc.in ()); - DynamicAny::DynEnum_var retval = DynamicAny::DynEnum::_narrow (temp.in ()); - - retval->set_as_string (ACE_TEXT_ALWAYS_CHAR (value.begin_enum ()->c_str ())); - - return retval._retn (); - } - - void - DynEnum_Handler::extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn) - { - ACE_UNUSED_ARG (dyn); - ACE_ERROR ((LM_ERROR, "Extracting Enums not yet supported\n")); + // @@ Leak this guy onto the heap to avoid a compile problem. + CORBA::TypeCode_ptr tc = + DYNANY_HANDLER->orb ()->create_enum_tc (type.enum_ ().typeId ().c_str (), + type.enum_ ().name ().c_str (), + members); + + DYNANY_HANDLER->register_typecode (type.enum_ ().typeId (), + tc); + + return tc; } + } } diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.h index 009b8b37659..8eaa1f11897 100644 --- a/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.h +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynEnum_Handler.h @@ -35,9 +35,12 @@ namespace CIAO { public: static DynamicAny::DynAny_ptr extract_into_dynany (const DataType &type, - const DataValue &value); + const DataValue &value, + CORBA::TypeCode_ptr = 0); static void extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn); + + static CORBA::TypeCode_ptr create_typecode (const DataType &type); }; } diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.cpp new file mode 100644 index 00000000000..fa86fefef76 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.cpp @@ -0,0 +1,163 @@ +// $Id$ + +#include "DynSequence_Handler.h" +#include "DynAny_Handler.h" + +#include "Basic_Deployment_Data.hpp" +#include "Common.h" + +#include "ace/Null_Mutex.h" + +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/TypeCodeFactory/TypeCodeFactory_Adapter_Impl.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" +#include "tao/AnyTypeCode/Sequence_TypeCode.h" +#include "tao/IFR_Client/IFR_BasicC.h" + +namespace CIAO +{ + namespace Config_Handlers + { + DynamicAny::DynAny_ptr + DynSequence_Handler::extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr req_tc) + { + CORBA::TypeCode_ptr tc; + if (req_tc) + tc = req_tc; + else + tc = DynSequence_Handler::create_typecode (type); + + // Make the actual DynSequence + DynamicAny::DynAny_var temp = + DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc); + DynamicAny::DynSequence_var retval = DynamicAny::DynSequence::_narrow (temp.in ()); + + DynamicAny::DynAnySeq dynseq; + CORBA::ULong pos = 0; + + switch (type.sequence ().elementType ().kind ().integral ()) + { + // ========== BASIC TYPES + case TCKind::tk_null_l: + case TCKind::tk_void_l: + case TCKind::tk_objref_l: + case TCKind::tk_wfixed_l: + case TCKind::tk_component_l: + case TCKind::tk_home_l: + + ACE_ERROR ((LM_WARNING, "I don't know how to handle null or void types\n")); + throw 1; + + case TCKind::tk_short_l: + case TCKind::tk_long_l: + case TCKind::tk_ushort_l: + case TCKind::tk_ulong_l: + case TCKind::tk_float_l: + case TCKind::tk_double_l: + case TCKind::tk_boolean_l: + case TCKind::tk_octet_l: + case TCKind::tk_string_l: + case TCKind::tk_longlong_l: + case TCKind::tk_ulonglong_l: + case TCKind::tk_longdouble_l: + case TCKind::tk_wstring_l: + case TCKind::tk_enum_l: + case TCKind::tk_struct_l: + try + { + dynseq.length (value.count_element ()); + retval->set_length (value.count_element ()); + + for (DataValue::element_const_iterator i = value.begin_element (); + i != value.end_element (); + ++i) + { + DynamicAny::DynAny_var dynany + (DYNANY_HANDLER->extract_into_dynany (type.sequence ().elementType (), + *i)); + dynseq[pos++] = dynany->copy (); + } + + retval->set_elements_as_dyn_any (dynseq); + return retval._retn (); + } + catch (DynamicAny::DynAny::InvalidValue) + { + ACE_ERROR ((LM_ERROR, "Invalid value provided in XML when trying to " + "populate %ith element of a sequence\n", + pos)); + throw Config_Error ("", "Invalid value whilst populating the sequence."); + } + + case TCKind::tk_char_l: + case TCKind::tk_wchar_l: + // special case where value iterataor multiplicity should be one, and should + // represent a string, each character of which becomes a element of the sequence. + + case TCKind::tk_sequence_l: + case TCKind::tk_array_l: + // Several special cases here. + + case TCKind::tk_any_l: + case TCKind::tk_TypeCode_l: + case TCKind::tk_Principal_l: + case TCKind::tk_union_l: + case TCKind::tk_alias_l: + case TCKind::tk_except_l: + case TCKind::tk_value_l: + case TCKind::tk_value_box_l: + case TCKind::tk_native_l: + case TCKind::tk_abstract_interface_l: + case TCKind::tk_local_interface_l: + case TCKind::tk_event_l: + // Special case where element association in datavalue contains another datavalue. + + ACE_ERROR ((LM_ERROR, "Type not supported\n")); + throw Config_Error ("", "Type not supported"); + } + + return retval._retn (); + } + + void + DynSequence_Handler::extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn) + { + ACE_UNUSED_ARG (dyn); + ACE_ERROR ((LM_ERROR, "Extracting Sequences not yet supported\n")); + } + + CORBA::TypeCode_ptr + DynSequence_Handler::create_typecode (const DataType &type) + { + if (!type.sequence_p ()) + { + ACE_ERROR ((LM_ERROR, "ERROR: Sequence type descriptioin required")); + throw Config_Error ("", "Expected <sequence> element, incorrect tc_kind."); + } + + CORBA::TypeCode_ptr etc = + DYNANY_HANDLER->create_typecode (type.sequence ().elementType ()); + + CORBA::ULong bound (0); + if (type.sequence ().bound_p ()) + bound = type.sequence ().bound (); + + // @@ Leak this guy onto the heap to avoid a compile problem. + CORBA::TypeCode_ptr tc = + DYNANY_HANDLER->orb ()->create_sequence_tc (bound, + etc); + + // Sequences don't have names. + // DYNANY_HANDLER->register_typecode (type.sequence_ ().typeId (), + // tc); + + return tc; + } + + } +} + + + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.h new file mode 100644 index 00000000000..7d6a5b6ba6c --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynSequence_Handler.h @@ -0,0 +1,52 @@ +/** + * $Id$ + * + * @file DynSequence_Handler.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + */ + +#ifndef CIAO_CONFIG_HANDLERS_DYNSEQUENCE_HANDLER_H +#define CIAO_CONFIG_HANDLERS_DYNSEQUENCE_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DynAny_Handler_Export.h" + +#include "tao/ORB.h" +#include "tao/DynamicAny/DynamicAny.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + class Any; + class DataType; + class DataValue; + + /** + * @class DynSequence_Handler + * @brief Translates sequences specified in deployment plans into Dynamic Anys + * + */ + class DynSequence_Handler + { + public: + static DynamicAny::DynAny_ptr extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr = 0); + + static void extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn); + + static CORBA::TypeCode_ptr create_typecode (const DataType &type); + }; + + } +} + + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_DYNSEQUENCE_HANDLER_H*/ + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.cpp new file mode 100644 index 00000000000..807cd72b53e --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.cpp @@ -0,0 +1,130 @@ +// $Id$ + +#include "DynStruct_Handler.h" +#include "DynAny_Handler.h" + +#include "Basic_Deployment_Data.hpp" +#include "Common.h" + +#include "ace/Null_Mutex.h" + +//#include "tao/ORB.h" +#include "tao/IFR_Client/IFR_BasicC.h" +//#include "tao/TypeCodeFactory/TypeCodeFactory_Adapter_Impl.h" + +#include "tao/AnyTypeCode/Struct_TypeCode.h" + +namespace CIAO +{ + namespace Config_Handlers + { + void create_type_map (const DataType &type, + std::map <std::string, DataType const *> &dt_map) + { + for (StructType::member_const_iterator i = type.struct_ ().begin_member (); + i != type.struct_ ().end_member (); ++i) + { + dt_map[i->name ()] = &(i->type ()); + } + } + + DynamicAny::DynAny_ptr + DynStruct_Handler::extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr req_tc) + { + try + { + CORBA::TypeCode_ptr tc; + + if (req_tc) + tc = req_tc; + else + tc = DynStruct_Handler::create_typecode (type); + + std::map <std::string, DataType const*> dt_map; + create_type_map (type, dt_map); + + // Make the actual DynStruct + DynamicAny::DynAny_var temp = + DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc); + DynamicAny::DynStruct_var retval = DynamicAny::DynStruct::_narrow (temp.in ()); + + CORBA::ULong pos (0); + DynamicAny::NameDynAnyPairSeq values; + values.length (value.count_member ()); + + for (DataValue::member_const_iterator i = value.begin_member (); + i != value.end_member (); ++i) + { + values[pos].id = i->name ().c_str (); + values[pos].value = DYNANY_HANDLER->extract_into_dynany (*dt_map[i->name ()], + i->value ()); + pos++; + } + + retval->set_members_as_dyn_any (values); + + return retval._retn (); + } + catch (Config_Error &ex) + { + if (type.struct_p ()) + ex.add_name (type.struct_ ().typeId ()); + throw ex; + } + catch (...) + { + throw Config_Error (type.struct_ ().typeId (), + "Unknown exception"); + } + } + + + void + DynStruct_Handler::extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn) + { + ACE_UNUSED_ARG (dyn); + ACE_ERROR ((LM_ERROR, "Extracting Structs not yet supported\n")); + } + + CORBA::TypeCode_ptr + DynStruct_Handler::create_typecode (const DataType &type) + { + if (!type.struct_p ()) + { + ACE_ERROR ((LM_ERROR, "ERROR: Struct type descriptioin required")); + throw Config_Error ("", "Expected struct type information, tc_kind may be incorrect\n"); + } + + std::string rid (type.struct_ ().typeId ()); + std::string name (type.struct_ ().name ()); + + CORBA::StructMemberSeq members; + members.length (type.struct_ ().count_member ()); + CORBA::ULong pos (0); + + for (StructType::member_const_iterator i = type.struct_ ().begin_member (); + i != type.struct_ ().end_member (); ++i) + { + members[pos].name = i->name ().c_str (); + members[pos].type = DYNANY_HANDLER->create_typecode (i->type ()); + ++pos; + } + + // @@ Leak this guy onto the heap to avoid a compile problem. + CORBA::TypeCode_ptr tc = + DYNANY_HANDLER->orb ()->create_struct_tc (rid.c_str (), + name.c_str (), + members); + + DYNANY_HANDLER->register_typecode (type.struct_ ().typeId (), + tc); + + return tc; + } + } +} + + + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.h b/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.h new file mode 100644 index 00000000000..554912378c6 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/DynStruct_Handler.h @@ -0,0 +1,52 @@ +/** + * $Id$ + * + * @file DynStruct_Handler.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + */ + +#ifndef CIAO_CONFIG_HANDLERS_DYNSTRUCT_HANDLER_H +#define CIAO_CONFIG_HANDLERS_DYNSTRUCT_HANDLER_H +#include /**/ "ace/pre.h" + +#include "DynAny_Handler_Export.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" +#include "tao/ORB.h" +#include "tao/DynamicAny/DynamicAny.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + class Any; + class DataType; + class DataValue; + + /** + * @class DynStruct_Handler + * @brief Translates structs specified in deployment plans into Dynamic Anys + * + */ + class DynStruct_Handler + { + public: + static DynamicAny::DynAny_ptr extract_into_dynany (const DataType &type, + const DataValue &value, + CORBA::TypeCode_ptr = 0); + + static void extract_out_of_dynany (const DynamicAny::DynAny_ptr dyn); + + static CORBA::TypeCode_ptr create_typecode (const DataType &type); + }; + + } +} + + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_DYNSTRUCT_HANDLER_H*/ + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/dynany_test.idl b/CIAO/tools/Config_Handlers/DynAny_Handler/dynany_test.idl new file mode 100644 index 00000000000..0ffecc5c757 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/dynany_test.idl @@ -0,0 +1,28 @@ +//$Id$ +module dynany_test +{ + typedef sequence<double> DoubleSequence; + typedef sequence<long> LongSequence; + typedef sequence<string, 3> StringSequence; + + enum COLOR + { + yellow, + blue, + black, + grey, + red + }; + + typedef sequence<COLOR> ColorSequence; + + struct Foo + { + double db; + LongSequence long_sequence; + StringSequence string_sequence; + ColorSequence color_sequence; + }; + + typedef sequence<Foo> FooSequence; +}; diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/test.cpp b/CIAO/tools/Config_Handlers/DynAny_Handler/test.cpp new file mode 100644 index 00000000000..e03f21236b1 --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/test.cpp @@ -0,0 +1,291 @@ +// $Id$ + +#include <iostream> + +#include "Deployment.hpp" +#include "DP_Handler.h" +#include "DAnCE/Deployment/Deployment_DataC.h" +#include "ace/Get_Opt.h" +#include "XML_Typedefs.h" +#include "tao/ORB.h" +#include "Common.h" +#include "dynany_testC.h" +#include "XML_File_Intf.h" + +static const char *input_file = "BasicSP.cdp"; + + +static int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "i:"); + + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'i': + input_file = get_opts.opt_arg (); + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-i <input file> " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command-line + return 0; +} + +using namespace CIAO::Config_Handlers; + +bool check_doubleseq (CORBA::Any &any) +{ + ACE_DEBUG ((LM_DEBUG, "Checking a double sequence\n")); + + dynany_test::DoubleSequence *seq; + + if (!(any >>= seq)) + { + ACE_ERROR ((LM_ERROR, "failed to extract double sequence\n")); + return false; + } + + static const CORBA::Double ref_seq[3] = {1.0, 2.0, 2.5}; + + if (seq->length () != 3) + { + ACE_ERROR ((LM_ERROR, "Unexpected length of double sequence\n")); + return false; + } + + for (CORBA::ULong i = 0; i < seq->length (); ++i) + { + if ((*seq)[i] != ref_seq[i]) + { + ACE_ERROR ((LM_ERROR, "Expected %ith element of double sequence " + " to be %d, got %d instead.\n", i, (*seq)[i], ref_seq[i])); + return false; + } + } + + return true; +} + +bool check_longseq (dynany_test::LongSequence *seq); + +bool check_longseq (CORBA::Any &any) +{ + dynany_test::LongSequence *seq; + + if (!(any >>= seq)) + { + ACE_ERROR ((LM_ERROR, "failed to extract long sequence\n")); + return false; + } + + return check_longseq (seq); +} + +bool check_longseq (dynany_test::LongSequence *seq) +{ + ACE_DEBUG ((LM_DEBUG, "Checking a long sequence\n")); + + static const CORBA::Long ref_seq[3] = {1, 5, 6}; + + if (seq->length () != 3) + { + ACE_ERROR ((LM_ERROR, "Unexpected length of long sequence\n")); + return false; + } + + for (CORBA::ULong i = 0; i < seq->length (); ++i) + { + if ((*seq)[i] != ref_seq[i]) + { + ACE_ERROR ((LM_ERROR, "Expected %ith element of long sequence " + " to be %i, got %i instead.\n", i, (*seq)[i], ref_seq[i])); + return false; + } + } + + return true; +} + + +bool check_stringseq (dynany_test::StringSequence *seq); + +bool check_stringseq (CORBA::Any &any) +{ + dynany_test::StringSequence *seq; + + if (!(any >>= seq)) + { + ACE_ERROR ((LM_ERROR, "failed to extract string sequence\n")); + return false; + } + + return check_stringseq (seq); +} + +bool check_stringseq (dynany_test::StringSequence *seq) +{ + ACE_DEBUG ((LM_DEBUG, "Checking a string sequence\n")); + + static const std::string ref_seq[3] = {"StringOne", + "StringTwo", + "StringThree"}; + + if (seq->length () != 3) + { + ACE_ERROR ((LM_ERROR, "Unexpected length of string sequence\n")); + return false; + } + + for (CORBA::ULong i = 0; i < seq->length (); ++i) + { + std::string val ((*seq)[i].in ()); + + if (val != ref_seq[i]) + { + ACE_ERROR ((LM_ERROR, "Expected %ith element of string sequence " + " to be %i, got %i instead.\n", i, val.c_str (), ref_seq[i].c_str ())); + return false; + } + } + + return true; +} + +bool check_colorseq (dynany_test::ColorSequence *seq); + +bool check_colorseq (CORBA::Any &any) +{ + dynany_test::ColorSequence *seq; + + if (!(any >>= seq)) + { + ACE_ERROR ((LM_ERROR, "failed to extract color sequence\n")); + return false; + } + + return check_colorseq (seq); +} + +bool check_colorseq (dynany_test::ColorSequence *seq) +{ + ACE_DEBUG ((LM_DEBUG, "Checking a color sequence\n")); + + static const dynany_test::COLOR ref_seq[5] = {dynany_test::yellow, dynany_test::grey, dynany_test::red, + dynany_test::blue, dynany_test::black}; + + if (seq->length () != 5) + { + ACE_ERROR ((LM_ERROR, "Unexpected length of color sequence\n")); + return false; + } + + for (CORBA::ULong i = 0; i < seq->length (); ++i) + { + if ((*seq)[i] != ref_seq[i]) + { + ACE_ERROR ((LM_ERROR, "Expected %ith element of color sequence " + " to be %i, got %i instead.\n", i, (*seq)[i], ref_seq[i])); + return false; + } + } + + return true; +} + +bool check_foo_struct (CORBA::Any &any) +{ + ACE_DEBUG ((LM_DEBUG, "Checking a foo struct\n")); + + dynany_test::Foo *foo; + + if (!(any >>= foo)) + { + ACE_ERROR ((LM_ERROR, "failed to extract foo struct\n")); + return false; + } + + // Check contents of foo struct + if (foo->db != 5.5) + { + ACE_ERROR ((LM_ERROR, "expected value of db field to be 5.5, for %d\n", + foo->db)); + return false; + } + + return check_colorseq (&foo->color_sequence) && + check_longseq (&foo->long_sequence) && + check_stringseq (&foo->string_sequence); +} + +int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + try + { + if (parse_args (argc, argv) != 0) + return 1; + + // Initialize an ORB so Any will work + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); + ACE_UNUSED_ARG (orb); + + //Create an XML_Helper for all the file work + + bool success (true); + + XML_File_Intf intf (input_file); + intf.add_search_path ("CIAO_ROOT", "/docs/schema/"); + + if (intf.get_plan () != 0) + { + std::cout << "Instance document import succeeded. Checking contents.\n"; + + //Retrieve the newly created IDL structure + Deployment::DeploymentPlan *idl = intf.release_plan(); + + for (CORBA::ULong i = 0; i < idl->infoProperty.length (); ++i) + { + std::string name (idl->infoProperty[i].name.in ()); + + if (name == "double_sequence") + success = success && check_doubleseq (idl->infoProperty[i].value); + if (name == "long_sequence") + success = success && check_longseq (idl->infoProperty[i].value); + if (name == "string_sequence") + success = success && check_stringseq (idl->infoProperty[i].value); + if (name == "color_sequence") + success = success && check_colorseq (idl->infoProperty[i].value); + if (name == "foo_struct") + success = success && check_foo_struct (idl->infoProperty[i].value); + } + delete idl; + + + } + + if (success) + return 0; + else + { + ACE_ERROR((LM_ERROR, "Some test failures occurred, bailing out.")); + return -1; + } + } + catch (CIAO::Config_Handlers::Config_Error &ex) + { + ACE_ERROR ((LM_ERROR, "Caught config_error: %s:%s\n", + ex.name_.c_str (), ex.error_.c_str ())); + return -1; + } +} + + diff --git a/CIAO/tools/Config_Handlers/DynAny_Handler/test.mpc b/CIAO/tools/Config_Handlers/DynAny_Handler/test.mpc new file mode 100644 index 00000000000..b4124683c7a --- /dev/null +++ b/CIAO/tools/Config_Handlers/DynAny_Handler/test.mpc @@ -0,0 +1,16 @@ +// $Id$ +project (XSC_DynAny_Test) : ciao_config_handlers, ifr_client, taoidldefaults { + requires += dummy_label + exename = test + macros += XML_USE_PTHREADS + + IDL_Files { + dynany_test.idl + } + + Source_Files { + test.cpp + } +} + + diff --git a/CIAO/tools/Config_Handlers/ERE_Handler.cpp b/CIAO/tools/Config_Handlers/ERE_Handler.cpp index 5cd3dc2ccb1..8a8a8f31666 100644 --- a/CIAO/tools/Config_Handlers/ERE_Handler.cpp +++ b/CIAO/tools/Config_Handlers/ERE_Handler.cpp @@ -25,7 +25,7 @@ namespace CIAO ++erep_b) { ERE_Handler::handle_external_ref_endpoint ((*erep_b), - dest[pos++]); + dest[pos++]); } } @@ -35,8 +35,14 @@ namespace CIAO Deployment::ExternalReferenceEndpoint &dest) { CIAO_TRACE("ERE_Handler::external_ref_endpoint"); - dest.location = - ACE_TEXT_ALWAYS_CHAR (src.location ().c_str ()); + dest.location = src.location ().c_str (); + dest.provider = src.provider (); + if (src.portName_p ()) + dest.portName = src.portName ().c_str (); + dest.supportedType.length (src.count_supportedType ()); + std::for_each (src.begin_supportedType (), + src.end_supportedType (), + String_Seq_Functor (dest.supportedType)); } ExternalReferenceEndpoint @@ -44,8 +50,11 @@ namespace CIAO const Deployment::ExternalReferenceEndpoint& src) { CIAO_TRACE("ERE_Handler::external_ref_endpoint - reverse"); - XMLSchema::string< ACE_TCHAR > loc (ACE_TEXT_CHAR_TO_TCHAR (src.location.in ())); - ExternalReferenceEndpoint erp (loc); + XMLSchema::string< char > loc ((src.location)); + // XMLSchema::string< char > provider ((src.provider)); + XMLSchema::string< char > pn ((src.portName)); + // XMLSchema::string< char > st ((src.supportedType)); + ExternalReferenceEndpoint erp (loc, src.provider); return erp; } } diff --git a/CIAO/tools/Config_Handlers/ERE_Handler.h b/CIAO/tools/Config_Handlers/ERE_Handler.h index 77e0a125b96..9d1fc412bce 100644 --- a/CIAO/tools/Config_Handlers/ERE_Handler.h +++ b/CIAO/tools/Config_Handlers/ERE_Handler.h @@ -28,42 +28,42 @@ namespace Deployment namespace CIAO { + namespace Config_Handlers - { - class PlanConnectionDescription; - class ExternalReferenceEndpoint; + { + class PlanConnectionDescription; + class ExternalReferenceEndpoint; - /* - * @class ERE_Handler - * - * @brief Handler class for <ExternalReferenceEndpoint> types. - * - * This class defines handler methods to map values from - * XSC ExternalReferenceEndpoint objects, parsed from - * the descriptor files, to the corresponding CORBA IDL type. - */ + /* + * @class ERE_Handler + * + * @brief Handler class for <ExternalReferenceEndpoint> types. + * + * This class defines handler methods to map values from + * XSC ExternalReferenceEndpoint objects, parsed from + * the descriptor files, to the corresponding CORBA IDL type. + * + */ - class Config_Handlers_Common_Export ERE_Handler - { - public: - static void external_ref_endpoints ( - const PlanConnectionDescription &src, - ::Deployment::ExternalReferenceEndpoints &dest); + class Config_Handlers_Common_Export ERE_Handler + { + public: + static void external_ref_endpoints (const PlanConnectionDescription &src, + ::Deployment::ExternalReferenceEndpoints &dest); - static ExternalReferenceEndpoint external_ref_endpoint ( - const Deployment::ExternalReferenceEndpoint& src); + static ExternalReferenceEndpoint external_ref_endpoint ( + const Deployment::ExternalReferenceEndpoint& src); - static void handle_external_ref_endpoint ( - const ExternalReferenceEndpoint &src, - Deployment::ExternalReferenceEndpoint &dest); + static void handle_external_ref_endpoint (const ExternalReferenceEndpoint &src, + Deployment::ExternalReferenceEndpoint &dest); }; - typedef Sequence_Handler < ExternalReferenceEndpoint, - ::Deployment::ExternalReferenceEndpoints, - ::Deployment::ExternalReferenceEndpoint, - ERE_Handler::handle_external_ref_endpoint > - ERE_Functor; - } + typedef Sequence_Handler < ExternalReferenceEndpoint, + ::Deployment::ExternalReferenceEndpoints, + ::Deployment::ExternalReferenceEndpoint, + ERE_Handler::handle_external_ref_endpoint > ERE_Functor; + + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/ESD_Handler.h b/CIAO/tools/Config_Handlers/ESD_Handler.h index 9d3e968e05e..b20828a9713 100644 --- a/CIAO/tools/Config_Handlers/ESD_Handler.h +++ b/CIAO/tools/Config_Handlers/ESD_Handler.h @@ -52,8 +52,7 @@ namespace CIAO const DeploymentPlan &src, ::Deployment::EventServiceDeploymentDescriptions& dest); - static EventServiceDeploymentDescription es_deployment_descr ( - const Deployment::EventServiceDeploymentDescription &src); + static EventServiceDeploymentDescription es_deployment_descr (const Deployment::EventServiceDeploymentDescription &src); static IDREF_Base<CORBA::ULong> IDREF; diff --git a/CIAO/tools/Config_Handlers/IDD_Handler.cpp b/CIAO/tools/Config_Handlers/IDD_Handler.cpp index 2a1f017be3c..6beded8c2a7 100644 --- a/CIAO/tools/Config_Handlers/IDD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/IDD_Handler.cpp @@ -17,16 +17,16 @@ namespace CIAO IDREF_Base<CORBA::ULong> IDD_Handler::IDREF; void - IDD_Handler::instance_deployment_descrs (const DeploymentPlan &src, + IDD_Handler::instance_deployment_descrs (const deploymentPlan &src, Deployment::InstanceDeploymentDescriptions& dest) { CIAO_TRACE("IDD_Handler::instance_deployment_descrs"); - DeploymentPlan::instance_const_iterator idd_e = + deploymentPlan::instance_const_iterator idd_e = src.end_instance (); CORBA::ULong pos = 0; dest.length (src.count_instance ()); - for (DeploymentPlan::instance_const_iterator idd_b = + for (deploymentPlan::instance_const_iterator idd_b = src.begin_instance (); idd_b != idd_e; ++idd_b) @@ -38,19 +38,20 @@ namespace CIAO } void - IDD_Handler::instance_deployment_descr (const InstanceDeploymentDescription& src, + IDD_Handler::instance_deployment_descr ( + const InstanceDeploymentDescription& src, Deployment::InstanceDeploymentDescription& dest, CORBA::ULong pos) { CIAO_TRACE("IDD_Handler::instance_deployment_descr"); try { - dest.name = ACE_TEXT_ALWAYS_CHAR (src.name ().c_str ()); - dest.node = ACE_TEXT_ALWAYS_CHAR (src.node ().c_str ()); + dest.name = src.name ().c_str (); + dest.node = src.node ().c_str (); - if (src.id_p ()) + if (src.xmi_id_p ()) { - ACE_CString cstr (ACE_TEXT_ALWAYS_CHAR (src.id ().c_str ())); + ACE_CString cstr (src.xmi_id ().c_str ()); IDD_Handler::IDREF.bind_ref (cstr, pos); } else @@ -63,20 +64,19 @@ namespace CIAO // We know there should be only one element dest.source.length (1); dest.source [0] = - ACE_TEXT_ALWAYS_CHAR (src.source ().c_str ()); + src.source ().c_str (); CORBA::ULong tmp = 0; - MDD_Handler::IDREF.find_ref ( - ACE_CString (ACE_TEXT_ALWAYS_CHAR (src.implementation ().id ().c_str ())), - tmp); + MDD_Handler::IDREF.find_ref + (ACE_CString (src.implementation ().idref ().id ().c_str ()), tmp); dest.implementationRef = tmp; - + dest.configProperty.length (src.count_configProperty ()); std::for_each (src.begin_configProperty (), src.end_configProperty (), Property_Functor (dest.configProperty)); - + dest.deployedResource.length (src.count_deployedResource ()); std::for_each (src.begin_deployedResource (), src.end_deployedResource (), @@ -92,37 +92,49 @@ namespace CIAO } catch (Config_Error &ex) { - ex.name_ = ACE_TEXT_ALWAYS_CHAR (src.name ().c_str ()) + std::string (":") + ex.name_; + ex.name_ = src.name () + ":" + ex.name_; throw ex; } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Unknown exception at IDD:%s", + src.name ().c_str ())); + throw Config_Error (src.name (), "Unknown exception"); + } + // Done! } InstanceDeploymentDescription - IDD_Handler::instance_deployment_descr (const Deployment::InstanceDeploymentDescription& src) + IDD_Handler::instance_deployment_descr ( + const Deployment::InstanceDeploymentDescription& src) { CIAO_TRACE("IDD_Handler::instance_deployment_descr - reverse"); //Get all the string/IDREFs - XMLSchema::string < ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); - XMLSchema::string < ACE_TCHAR > node (ACE_TEXT_CHAR_TO_TCHAR (src.node.in ())); - XMLSchema::string < ACE_TCHAR > source (ACE_TEXT ("")); + XMLSchema::string < ACE_TCHAR > name ((src.name)); + XMLSchema::string < ACE_TCHAR > node ((src.node)); + XMLSchema::string < ACE_TCHAR > source (""); if (src.source.length () > 0) { - XMLSchema::string < ACE_TCHAR > source_detail (ACE_TEXT_CHAR_TO_TCHAR (src.source[0].in ())); + XMLSchema::string < ACE_TCHAR > source_detail (src.source[0]); source = source_detail; } ACE_CString temp; MDD_Handler::IDREF.find_ref(src.implementationRef, temp); - XMLSchema::IDREF< ACE_TCHAR > implementation (ACE_TEXT_CHAR_TO_TCHAR (temp.c_str())); + XMLSchema::IDREF< ACE_TCHAR > implementation ((temp.c_str())); // Instantiate the IDD - InstanceDeploymentDescription idd (name, node, source, implementation); + IdRef xid; + xid.idref (implementation); + InstanceDeploymentDescription idd (name, node, source, xid); //Get and store the configProperty(s) size_t total = src.configProperty.length(); for(size_t j = 0; j < total; j++) { - idd.add_configProperty(Property_Handler::get_property (src.configProperty[j])); + idd.add_configProperty( + Property_Handler::get_property ( + src.configProperty[j])); } // Get and store the deployedResource(s) @@ -142,14 +154,15 @@ namespace CIAO ACE_CString idd_id ("_"); idd_id += *uuid.to_string (); - XMLSchema::ID< ACE_TCHAR > xml_id (ACE_TEXT_CHAR_TO_TCHAR (idd_id.c_str ())); + XMLSchema::ID< ACE_TCHAR > xml_id (idd_id.c_str ()); // Bind the ref and set it in the IDD IDD_Handler::IDREF.bind_next_available (idd_id); - idd.id (xml_id); + idd.xmi_id (xml_id); return idd; } + } } diff --git a/CIAO/tools/Config_Handlers/IDD_Handler.h b/CIAO/tools/Config_Handlers/IDD_Handler.h index d23b9643cc8..313b7d9e6b2 100644 --- a/CIAO/tools/Config_Handlers/IDD_Handler.h +++ b/CIAO/tools/Config_Handlers/IDD_Handler.h @@ -1,11 +1,11 @@ //============================================================== /** -* @file IDD_Handler.h -* -* $Id$ -* -* @author Jules White <jules@dre.vanderbilt.edu> -*/ + * @file IDD_Handler.h + * + * $Id$ + * + * @author Jules White <jules@dre.vanderbilt.edu> + */ //================================================================ #ifndef CIAO_CONFIG_HANDLERS_IDD_HANDLER_H @@ -23,50 +23,47 @@ namespace Deployment { -struct InstanceDeploymentDescription; -class InstanceDeploymentDescriptions; -struct InstanceResourceDeploymentDescription; + struct InstanceDeploymentDescription; + class InstanceDeploymentDescriptions; + struct InstanceResourceDeploymentDescription; } namespace CIAO { -namespace Config_Handlers -{ -class DeploymentPlan; -class InstanceDeploymentDescription; -class InstanceResourceDeploymentDescription; + namespace Config_Handlers + { + class deploymentPlan; + class InstanceDeploymentDescription; + class InstanceResourceDeploymentDescription; -/* -* @class IDD_Handler -* -* @brief Handler class for <InstanceDeploymentDescription> types. -* -* This class defines handler methods to map values from -* XSC InstanceDeploymentDescriptionn objects, parsed from -* the descriptor files, to the corresponding CORBA IDL type. -* -*/ + /* + * @class IDD_Handler + * + * @brief Handler class for <InstanceDeploymentDescription> types. + * + * This class defines handler methods to map values from + * XSC InstanceDeploymentDescriptionn objects, parsed from + * the descriptor files, to the corresponding CORBA IDL type. + * + */ -class Config_Handlers_Export IDD_Handler -{ -public: -static void instance_deployment_descrs ( -const DeploymentPlan &src, -::Deployment::InstanceDeploymentDescriptions& dest); + class Config_Handlers_Export IDD_Handler + { + public: + static void instance_deployment_descrs (const deploymentPlan &src, + ::Deployment::InstanceDeploymentDescriptions& dest); -static InstanceDeploymentDescription instance_deployment_descr ( -const Deployment::InstanceDeploymentDescription &src); + static InstanceDeploymentDescription instance_deployment_descr (const Deployment::InstanceDeploymentDescription &src); -static IDREF_Base<CORBA::ULong> IDREF; + static IDREF_Base<CORBA::ULong> IDREF; -private: -static void instance_deployment_descr ( -const InstanceDeploymentDescription &src, -::Deployment::InstanceDeploymentDescription &dest, -CORBA::ULong pos); + private: + static void instance_deployment_descr (const InstanceDeploymentDescription &src, + ::Deployment::InstanceDeploymentDescription &dest, + CORBA::ULong pos); -}; -} + }; + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/IDREF_Base.h b/CIAO/tools/Config_Handlers/IDREF_Base.h index 99e325be875..643b4a3fb3d 100644 --- a/CIAO/tools/Config_Handlers/IDREF_Base.h +++ b/CIAO/tools/Config_Handlers/IDREF_Base.h @@ -46,15 +46,15 @@ IDREF_Base (T start_point) } /// Bind an IDREF to an index -void bind_ref (ACE_CString& id, T value); + void bind_ref (ACE_CString& id, T value); void bind_next_available (ACE_CString &id); /// Get the index associated with an IDREF -void find_ref (const ACE_CString& id, T& value); + void find_ref (const ACE_CString& id, T& value); /// get the IDREF associated with an index -void find_ref (const T &value, ACE_CString& id); + void find_ref (const T &value, ACE_CString& id); /// Unbind all IDREFS bool diff --git a/CIAO/tools/Config_Handlers/ID_Handler.cpp b/CIAO/tools/Config_Handlers/ID_Handler.cpp index 572827582c8..b2e888338e0 100644 --- a/CIAO/tools/Config_Handlers/ID_Handler.cpp +++ b/CIAO/tools/Config_Handlers/ID_Handler.cpp @@ -25,7 +25,7 @@ namespace CIAO CIAO_TRACE("ID_Handler::get_ImplementationDependency"); toconfig.requiredType= - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.requiredType ().c_str ())); + CORBA::string_dup (desc.requiredType ().c_str ()); } ImplementationDependency @@ -33,7 +33,7 @@ namespace CIAO const ::Deployment::ImplementationDependency& src) { CIAO_TRACE("ID_Handler::get_ImplementationDependency - reverse"); - XMLSchema::string< ACE_TCHAR > reqtype (ACE_TEXT_CHAR_TO_TCHAR (src.requiredType.in ())); + XMLSchema::string< char > reqtype ((src.requiredType)); ImplementationDependency id (reqtype); diff --git a/CIAO/tools/Config_Handlers/IRDD_Handler.cpp b/CIAO/tools/Config_Handlers/IRDD_Handler.cpp index 5c060d08792..f834fcbd192 100644 --- a/CIAO/tools/Config_Handlers/IRDD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/IRDD_Handler.cpp @@ -50,14 +50,14 @@ namespace CIAO break; default: - throw Config_Error (ACE_TEXT_ALWAYS_CHAR (desc.requirementName ().c_str ()), + throw Config_Error (desc.requirementName (), "Unknown ResourceUsageKind."); break; } - toconfig.requirementName = ACE_TEXT_ALWAYS_CHAR (desc.requirementName ().c_str ()); + toconfig.requirementName = desc.requirementName ().c_str (); - toconfig.resourceName= ACE_TEXT_ALWAYS_CHAR (desc.resourceName ().c_str ()); + toconfig.resourceName= desc.resourceName ().c_str (); toconfig.property.length (desc.count_property ()); std::for_each (desc.begin_property (), @@ -70,8 +70,8 @@ namespace CIAO { CIAO_TRACE("IRDD_Handler::instance_resource_deployment_descr - reverse"); - XMLSchema::string< ACE_TCHAR > reqname (ACE_TEXT_CHAR_TO_TCHAR (src.requirementName.in ())); - XMLSchema::string< ACE_TCHAR > resname (ACE_TEXT_CHAR_TO_TCHAR (src.resourceName.in ())); + XMLSchema::string< char > reqname ((src.requirementName)); + XMLSchema::string< char > resname ((src.resourceName)); InstanceResourceDeploymentDescription irdd (ResourceUsageKind::None, reqname, @@ -114,4 +114,5 @@ namespace CIAO return irdd; } } + } diff --git a/CIAO/tools/Config_Handlers/IRDD_Handler.h b/CIAO/tools/Config_Handlers/IRDD_Handler.h index baeccef9b48..af641813e26 100644 --- a/CIAO/tools/Config_Handlers/IRDD_Handler.h +++ b/CIAO/tools/Config_Handlers/IRDD_Handler.h @@ -48,23 +48,24 @@ namespace CIAO * corresponding CORBA IDL Any type. * */ - class Config_Handlers_Export IRDD_Handler - { + class Config_Handlers_Export IRDD_Handler { public: - IRDD_Handler (void); - virtual ~IRDD_Handler (void); + IRDD_Handler (void); + virtual ~IRDD_Handler (void); - static void handle_irdd (const InstanceResourceDeploymentDescription& desc, - Deployment::InstanceResourceDeploymentDescription& toconfig); + static void handle_irdd (const InstanceResourceDeploymentDescription& desc, + Deployment::InstanceResourceDeploymentDescription& toconfig) + /*throw (Config_Error)*/; - static InstanceResourceDeploymentDescription - instance_resource_deployment_descr (const Deployment::InstanceResourceDeploymentDescription& src); + static InstanceResourceDeploymentDescription + instance_resource_deployment_descr (const Deployment::InstanceResourceDeploymentDescription& src) + /*throw (Config_Error)*/; }; typedef Sequence_Handler < InstanceResourceDeploymentDescription, - ::Deployment::InstanceResourceDeploymentDescriptions, - ::Deployment::InstanceResourceDeploymentDescription, - IRDD_Handler::handle_irdd > IRDD_Functor; + ::Deployment::InstanceResourceDeploymentDescriptions, + ::Deployment::InstanceResourceDeploymentDescription, + IRDD_Handler::handle_irdd > IRDD_Functor; } } diff --git a/CIAO/tools/Config_Handlers/MDD_Handler.cpp b/CIAO/tools/Config_Handlers/MDD_Handler.cpp index 6bd0ec04c0a..7e44a95b62c 100644 --- a/CIAO/tools/Config_Handlers/MDD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/MDD_Handler.cpp @@ -16,17 +16,16 @@ namespace CIAO IDREF_Base<CORBA::ULong> MDD_Handler::IDREF; void - MDD_Handler::mono_deployment_descriptions ( - const DeploymentPlan& src, + MDD_Handler::mono_deployment_descriptions (const deploymentPlan& src, Deployment::MonolithicDeploymentDescriptions& dest) { CIAO_TRACE("MDD_Handler::mono_deployment_descriptions"); - DeploymentPlan::implementation_const_iterator imp_e = + deploymentPlan::implementation_const_iterator imp_e = src.end_implementation (); CORBA::ULong pos = 0; dest.length (src.count_implementation ()); - for (DeploymentPlan::implementation_const_iterator imp_b = + for (deploymentPlan::implementation_const_iterator imp_b = src.begin_implementation (); imp_b != imp_e; ++imp_b) @@ -39,13 +38,12 @@ namespace CIAO } void - MDD_Handler::mono_deployment_description ( - const MonolithicDeploymentDescription& desc, + MDD_Handler::mono_deployment_description (const MonolithicDeploymentDescription& desc, Deployment::MonolithicDeploymentDescription& toconfig, CORBA::ULong pos) { toconfig.name = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ())); + CORBA::string_dup (desc.name ().c_str ()); MonolithicDeploymentDescription::source_const_iterator me = desc.end_source (); @@ -58,7 +56,7 @@ namespace CIAO ++se) { toconfig.source[len++] = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR ((*se).c_str ())); + CORBA::string_dup ((*se).c_str ()); } MonolithicDeploymentDescription::artifact_const_iterator ae = @@ -72,9 +70,8 @@ namespace CIAO { CORBA::ULong tmp = 0; - ADD_Handler::IDREF.find_ref ( - ACE_CString (ACE_TEXT_ALWAYS_CHAR (ab->id ().c_str ())), - tmp); + ADD_Handler::IDREF.find_ref (ACE_CString (ab->idref ().id ().c_str ()), + tmp); toconfig.artifactRef[len++] = tmp; } @@ -98,9 +95,9 @@ namespace CIAO Requirement_Functor (toconfig.deployRequirement)); // Handle the idref - if (desc.id_p ()) + if (desc.xmi_id_p ()) { - ACE_CString cstr (ACE_TEXT_ALWAYS_CHAR (desc.id ().c_str ())); + ACE_CString cstr (desc.xmi_id ().c_str ()); MDD_Handler::IDREF.bind_ref (cstr, pos); } @@ -120,14 +117,14 @@ namespace CIAO CIAO_TRACE("mono_deployment_description - reverse"); //Get the name and instantiate the mdd - XMLSchema::string < ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + XMLSchema::string < char > name ((src.name)); MonolithicDeploymentDescription mdd (name); //Get the source(s) from the IDL and store them size_t total = src.source.length(); for(size_t i = 0; i < total; i++) { - XMLSchema::string< ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (src.source[i].in ())); + XMLSchema::string< char > curr ((src.source[i])); mdd.add_source(curr); } @@ -137,8 +134,9 @@ namespace CIAO { ACE_CString tmp; ADD_Handler::IDREF.find_ref(src.artifactRef[j], tmp); - XMLSchema::IDREF< ACE_TCHAR > curr(ACE_TEXT_CHAR_TO_TCHAR (tmp.c_str())); - mdd.add_artifact (curr); + IdRef idref; + idref.idref (tmp.c_str ()); + mdd.add_artifact (idref); } //Get the execParameter(s) from the IDL and store them @@ -163,12 +161,12 @@ namespace CIAO ACE_CString mdd_id ("_"); mdd_id += *uuid.to_string (); - XMLSchema::ID< ACE_TCHAR > xml_id (ACE_TEXT_CHAR_TO_TCHAR (mdd_id.c_str ())); + XMLSchema::ID< ACE_TCHAR > xml_id (mdd_id.c_str ()); // Bind the ref and set it in the IDD MDD_Handler::IDREF.bind_next_available (mdd_id); - mdd.id (xml_id); + mdd.xmi_id (xml_id); return mdd; } diff --git a/CIAO/tools/Config_Handlers/MDD_Handler.h b/CIAO/tools/Config_Handlers/MDD_Handler.h index 2d95ff71e2d..c36efe6885b 100644 --- a/CIAO/tools/Config_Handlers/MDD_Handler.h +++ b/CIAO/tools/Config_Handlers/MDD_Handler.h @@ -1,11 +1,11 @@ //============================================================== /** -* @file MDD_Handler.h -* -* $Id$ -* -* @author Jules White <jules@dre.vanderbilt.edu> -*/ + * @file MDD_Handler.h + * + * $Id$ + * + * @author Jules White <jules@dre.vanderbilt.edu> + */ //================================================================ #ifndef CIAO_CONFIG_HANDLERS_MDD_Handler_H @@ -22,49 +22,46 @@ namespace Deployment { -struct MonolithicDeploymentDescription; -class MonolithicDeploymentDescriptions; + struct MonolithicDeploymentDescription; + class MonolithicDeploymentDescriptions; } namespace CIAO { -namespace Config_Handlers -{ -class MonolithicDeploymentDescription; -class DeploymentPlan; + namespace Config_Handlers + { + class MonolithicDeploymentDescription; + class deploymentPlan; -/* -* @class MDD_Handler -* -* @brief Handler class for <MonolithicDeploymentDescription> types. -* -* This class defines handler methods to map values from XSC -* MonolithicDeploymentDescription objects, parsed from the -* descriptor files, to the corresponding CORBA IDL types. -* -*/ + /* + * @class MDD_Handler + * + * @brief Handler class for <MonolithicDeploymentDescription> types. + * + * This class defines handler methods to map values from XSC + * MonolithicDeploymentDescription objects, parsed from the + * descriptor files, to the corresponding CORBA IDL types. + * + */ -class Config_Handlers_Export MDD_Handler -{ -public: -static void mono_deployment_descriptions ( -const DeploymentPlan &src, -Deployment::MonolithicDeploymentDescriptions &dest); + class Config_Handlers_Export MDD_Handler + { + public: + static void mono_deployment_descriptions (const deploymentPlan &src, + Deployment::MonolithicDeploymentDescriptions &dest); -static MonolithicDeploymentDescription mono_deployment_description( -const Deployment::MonolithicDeploymentDescription &src); + static MonolithicDeploymentDescription mono_deployment_description(const Deployment::MonolithicDeploymentDescription &src); -static IDREF_Base<CORBA::ULong> IDREF; + static IDREF_Base<CORBA::ULong> IDREF; -private: -static void mono_deployment_description ( -const MonolithicDeploymentDescription& desc, -Deployment::MonolithicDeploymentDescription& toconfig, -CORBA::ULong pos); -}; -} + private: + static void mono_deployment_description (const MonolithicDeploymentDescription& desc, + Deployment::MonolithicDeploymentDescription& toconfig, + CORBA::ULong pos); + }; + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/PCD_Handler.cpp b/CIAO/tools/Config_Handlers/PCD_Handler.cpp index 9647554bbb1..071194d778a 100644 --- a/CIAO/tools/Config_Handlers/PCD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/PCD_Handler.cpp @@ -31,7 +31,7 @@ namespace CIAO { CIAO_TRACE("PCD_Handler::get_PlanConnectionDescription"); - toconfig.name = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ())); + toconfig.name = CORBA::string_dup (desc.name ().c_str ()); //Source is mapped to a string in the schema and a sequence //in the IDL. We just assign the source string from the xml @@ -42,7 +42,7 @@ namespace CIAO { // Only one..... toconfig.source.length (1); - toconfig.source[0] = ACE_TEXT_ALWAYS_CHAR (desc.source ().c_str ()); + toconfig.source[0] = desc.source ().c_str (); } toconfig.deployRequirement.length (desc.count_deployRequirement ()); @@ -83,14 +83,14 @@ namespace CIAO { CIAO_TRACE("PCD_Handler::get_PlanConnectionDescription"); - XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + XMLSchema::string< char > name ((src.name)); PlanConnectionDescription pcd(name); //Get the source if it exists if(src.source.length() != 0) { - XMLSchema::string< ACE_TCHAR > source(ACE_TEXT_CHAR_TO_TCHAR (src.source[0].in ())); + XMLSchema::string< char > source((src.source[0])); pcd.source(source); } diff --git a/CIAO/tools/Config_Handlers/PSPE_Handler.cpp b/CIAO/tools/Config_Handlers/PSPE_Handler.cpp index 55b66e86e6b..221ec4fa7d9 100644 --- a/CIAO/tools/Config_Handlers/PSPE_Handler.cpp +++ b/CIAO/tools/Config_Handlers/PSPE_Handler.cpp @@ -38,11 +38,11 @@ namespace CIAO { CIAO_TRACE("PSPE_Handler::sub_component_port_endpoint"); dest.portName = - ACE_TEXT_ALWAYS_CHAR (src.portName ().c_str ()); + src.portName ().c_str (); if (src.provider_p ()) { - dest.provider = src.provider () == ACE_TEXT ("true"); + dest.provider = src.provider () == "true"; } else { @@ -51,9 +51,8 @@ namespace CIAO CORBA::ULong tmp = 0; - IDD_Handler::IDREF.find_ref ( - ACE_CString (ACE_TEXT_ALWAYS_CHAR (src.instance ().id ().c_str ())), - tmp); + IDD_Handler::IDREF.find_ref (ACE_CString (src.instance ().idref ().id ().c_str ()), + tmp); dest.instanceRef = tmp; @@ -94,19 +93,22 @@ namespace CIAO const Deployment::PlanSubcomponentPortEndpoint &src) { // @@MAJO CIAO_TRACE("PSPE_Handler::sub_component_port_endpoint - reverse"); - XMLSchema::string< ACE_TCHAR > pname (ACE_TEXT_CHAR_TO_TCHAR (src.portName.in ())); - XMLSchema::string< ACE_TCHAR > tval (ACE_TEXT ("true")); - XMLSchema::string< ACE_TCHAR > prov (ACE_TEXT ("")); + XMLSchema::string< char > pname ((src.portName)); + XMLSchema::string< char > tval ("true"); + XMLSchema::string< char > prov (""); ACE_CString id; IDD_Handler::IDREF.find_ref(src.instanceRef, id); - XMLSchema::IDREF < ACE_TCHAR > idref(ACE_TEXT_CHAR_TO_TCHAR (id.c_str())); + XMLSchema::IDREF < ACE_TCHAR > idref(id.c_str()); if (src.provider) prov = tval; + + IdRef idr; + idr.idref (idref); PlanSubcomponentPortEndpoint pspe (pname, CCMComponentPortKind::Facet, - idref); + idr); pspe.provider (prov); switch (src.kind) diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp index cf21caf31f9..0654822b79f 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.cpp @@ -19,180 +19,182 @@ namespace CIAO { struct Packaging_Handlers_Export SPE_Handler { - static void handle_spe ( - const SubcomponentPortEndpoint &desc, - ::Deployment::SubcomponentPortEndpoint &toconfig) - { - CIAO_TRACE("SPE_Handler::get_spe"); - - toconfig.portName = ACE_TEXT_ALWAYS_CHAR (desc.portName ().c_str ()); - - ACE_CString str (ACE_TEXT_ALWAYS_CHAR (desc.instance ().id ().c_str ())); - CORBA::ULong pos (0); - - SID_Handler::IDREF.find_ref (str, pos); - toconfig.instanceRef = pos; - } - - static SubcomponentPortEndpoint get_spe - (const ::Deployment::SubcomponentPortEndpoint &src) - { - CIAO_TRACE("SPE_Handler::get_spe - reverse"); - ACE_CString str; - SID_Handler::IDREF.find_ref (src.instanceRef, str); - - return SubcomponentPortEndpoint (ACE_TEXT_CHAR_TO_TCHAR (src.portName.in ()), - ACE_TEXT_CHAR_TO_TCHAR (str.c_str ())); - } + static void handle_spe (const SubcomponentPortEndpoint &desc, + ::Deployment::SubcomponentPortEndpoint &toconfig) + { + CIAO_TRACE("SPE_Handler::get_spe"); + + toconfig.portName = desc.portName ().c_str (); + + ACE_CString str (desc.instance ().idref ().id ().c_str ()); + CORBA::ULong pos (0); + + SID_Handler::IDREF.find_ref (str, pos); + toconfig.instanceRef = pos; + } + + static SubcomponentPortEndpoint + get_spe (const ::Deployment::SubcomponentPortEndpoint &src) + { + CIAO_TRACE("SPE_Handler::get_spe - reverse"); + ACE_CString str; + SID_Handler::IDREF.find_ref (src.instanceRef, str); + + IdRef xid; + xid.idref (str.c_str ()); + + return SubcomponentPortEndpoint (src.portName.in (), + xid); + } }; typedef Sequence_Handler < SubcomponentPortEndpoint, - ::Deployment::SubcomponentPortEndpoints, - ::Deployment::SubcomponentPortEndpoint, - SPE_Handler::handle_spe > SPE_Functor; + ::Deployment::SubcomponentPortEndpoints, + ::Deployment::SubcomponentPortEndpoint, + SPE_Handler::handle_spe > SPE_Functor; struct Packaging_Handlers_Export ACD_Handler { - static void handle_acd (const AssemblyConnectionDescription &desc, - ::Deployment::AssemblyConnectionDescription &toconfig) - { - CIAO_TRACE("ACD_Handler::get_acd"); - - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); - - toconfig.deployRequirement.length (desc.count_deployRequirement ()); - std::for_each (desc.begin_deployRequirement (), - desc.end_deployRequirement (), - Requirement_Functor (toconfig.deployRequirement)); - - toconfig.internalEndpoint.length (desc.count_internalEndpoint ()); - SEQ_HAND_GCC_BUG_WORKAROUND (SPE_Handler::handle_spe, - desc.begin_internalEndpoint (), - toconfig.internalEndpoint); - std::for_each (desc.begin_internalEndpoint (), - desc.end_internalEndpoint (), - SPE_Functor (toconfig.internalEndpoint)); - - toconfig.externalEndpoint.length (desc.count_externalEndpoint ()); - std::for_each (desc.begin_externalEndpoint (), - desc.end_externalEndpoint (), - CEPE_Functor (toconfig.externalEndpoint)); - - toconfig.externalReference.length (desc.count_externalReference ()); - std::for_each (desc.begin_externalReference (), - desc.end_externalReference (), - ERE_Functor (toconfig.externalReference)); - } - - static AssemblyConnectionDescription - get_acd (const ::Deployment::AssemblyConnectionDescription &src) - { - CIAO_TRACE("ACD_Handler::get_acd - reverse"); - - AssemblyConnectionDescription retval (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); - - for (CORBA::ULong i = 0; i < src.deployRequirement.length (); ++i) - retval.add_deployRequirement - (Req_Handler::get_requirement (src.deployRequirement[i])); - - for (CORBA::ULong i = 0; i < src.internalEndpoint.length (); ++i) - retval.add_internalEndpoint - (SPE_Handler::get_spe (src.internalEndpoint[i])); - - for (CORBA::ULong i = 0; i < src.externalEndpoint.length (); ++i) - retval.add_externalEndpoint - (CEPE_Handler::external_port_endpoint (src.externalEndpoint[i])); - - for (CORBA::ULong i = 0; i < src.externalReference.length (); ++i) - retval.add_externalReference - (ERE_Handler::external_ref_endpoint (src.externalReference[i])); - - return retval; - } + static void handle_acd (const AssemblyConnectionDescription &desc, + ::Deployment::AssemblyConnectionDescription &toconfig) + { + CIAO_TRACE("ACD_Handler::get_acd"); + + toconfig.name = desc.name ().c_str (); + + toconfig.deployRequirement.length (desc.count_deployRequirement ()); + std::for_each (desc.begin_deployRequirement (), + desc.end_deployRequirement (), + Requirement_Functor (toconfig.deployRequirement)); + + toconfig.internalEndpoint.length (desc.count_internalEndpoint ()); + SEQ_HAND_GCC_BUG_WORKAROUND (SPE_Handler::handle_spe, + desc.begin_internalEndpoint (), + toconfig.internalEndpoint); + std::for_each (desc.begin_internalEndpoint (), + desc.end_internalEndpoint (), + SPE_Functor (toconfig.internalEndpoint)); + + toconfig.externalEndpoint.length (desc.count_externalEndpoint ()); + std::for_each (desc.begin_externalEndpoint (), + desc.end_externalEndpoint (), + CEPE_Functor (toconfig.externalEndpoint)); + + toconfig.externalReference.length (desc.count_externalReference ()); + std::for_each (desc.begin_externalReference (), + desc.end_externalReference (), + ERE_Functor (toconfig.externalReference)); + + } + + static AssemblyConnectionDescription + get_acd (const ::Deployment::AssemblyConnectionDescription &src) + { + CIAO_TRACE("ACD_Handler::get_acd - reverse"); + + AssemblyConnectionDescription retval (src.name.in ()); + + for (CORBA::ULong i = 0; i < src.deployRequirement.length (); ++i) + retval.add_deployRequirement + (Req_Handler::get_requirement (src.deployRequirement[i])); + + for (CORBA::ULong i = 0; i < src.internalEndpoint.length (); ++i) + retval.add_internalEndpoint + (SPE_Handler::get_spe (src.internalEndpoint[i])); + + for (CORBA::ULong i = 0; i < src.externalEndpoint.length (); ++i) + retval.add_externalEndpoint + (CEPE_Handler::external_port_endpoint (src.externalEndpoint[i])); + + for (CORBA::ULong i = 0; i < src.externalReference.length (); ++i) + retval.add_externalReference + (ERE_Handler::external_ref_endpoint (src.externalReference[i])); + + return retval; + } }; - typedef Sequence_Handler < - AssemblyConnectionDescription, - ::Deployment::AssemblyConnectionDescriptions, - ::Deployment::AssemblyConnectionDescription, - ACD_Handler::handle_acd > ACD_Functor; + typedef Sequence_Handler < AssemblyConnectionDescription, + ::Deployment::AssemblyConnectionDescriptions, + ::Deployment::AssemblyConnectionDescription, + ACD_Handler::handle_acd > ACD_Functor; struct Packaging_Handlers_Export SPR_Handler { - static void handle_spr ( - const SubcomponentPropertyReference &desc, - ::Deployment::SubcomponentPropertyReference &toconfig) - { - CIAO_TRACE("SPR_Handler::get_spr"); - - toconfig.propertyName = ACE_TEXT_ALWAYS_CHAR (desc.propertyName ().c_str ()); - - ACE_CString str (ACE_TEXT_ALWAYS_CHAR (desc.instance ().id ().c_str ())); - CORBA::ULong pos (0); - - SID_Handler::IDREF.find_ref (str, pos); - toconfig.instanceRef = pos; - } - - static SubcomponentPropertyReference - get_spr (const ::Deployment::SubcomponentPropertyReference &src) - { - CIAO_TRACE("SPR_HAndler::get_spr - reverse"); - ACE_CString str; - SID_Handler::IDREF.find_ref (src.instanceRef, str); - - return SubcomponentPropertyReference (ACE_TEXT_CHAR_TO_TCHAR (src.propertyName.in ()), - ACE_TEXT_CHAR_TO_TCHAR (str.c_str ())); - } + static void handle_spr (const SubcomponentPropertyReference &desc, + ::Deployment::SubcomponentPropertyReference &toconfig) + { + CIAO_TRACE("SPR_Handler::get_spr"); + + toconfig.propertyName = desc.propertyName ().c_str (); + + ACE_CString str (desc.instance ().idref ().id ().c_str ()); + CORBA::ULong pos (0); + + SID_Handler::IDREF.find_ref (str, pos); + toconfig.instanceRef = pos; + + } + + static SubcomponentPropertyReference + get_spr (const ::Deployment::SubcomponentPropertyReference &src) + { + CIAO_TRACE("SPR_HAndler::get_spr - reverse"); + ACE_CString str; + SID_Handler::IDREF.find_ref (src.instanceRef, str); + + IdRef xid; + xid.idref (str.c_str ()); + return SubcomponentPropertyReference (src.propertyName.in (), + xid); + } + }; - typedef Sequence_Handler < - SubcomponentPropertyReference, - ::Deployment::SubcomponentPropertyReferences, - ::Deployment::SubcomponentPropertyReference, - SPR_Handler::handle_spr > SPR_Functor; + typedef Sequence_Handler < SubcomponentPropertyReference, + ::Deployment::SubcomponentPropertyReferences, + ::Deployment::SubcomponentPropertyReference, + SPR_Handler::handle_spr > SPR_Functor; struct Packaging_Handlers_Export APM_Handler { - static void handle_apm ( - const AssemblyPropertyMapping &desc, - ::Deployment::AssemblyPropertyMapping &toconfig) - { - CIAO_TRACE("APM_Handler::get_apm"); - - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); - toconfig.externalName = ACE_TEXT_ALWAYS_CHAR (desc.externalName ().c_str ()); - - toconfig.delegatesTo.length (desc.count_delegatesTo ()); - SEQ_HAND_GCC_BUG_WORKAROUND (SPR_Handler::handle_spr, - desc.begin_delegatesTo (), - toconfig.delegatesTo); - std::for_each (desc.begin_delegatesTo (), - desc.end_delegatesTo (), - SPR_Functor (toconfig.delegatesTo)); - } - - static AssemblyPropertyMapping - get_apm (const ::Deployment::AssemblyPropertyMapping &src) - { - CIAO_TRACE("APM_Handler::get_apm - reverse"); - - AssemblyPropertyMapping retval (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ()), - ACE_TEXT_CHAR_TO_TCHAR (src.externalName.in ())); - - for (CORBA::ULong i = 0; i < src.delegatesTo.length (); ++i) - retval.add_delegatesTo (SPR_Handler::get_spr (src.delegatesTo[i])); - - return retval; - } + static void handle_apm (const AssemblyPropertyMapping &desc, + ::Deployment::AssemblyPropertyMapping &toconfig) + { + CIAO_TRACE("APM_Handler::get_apm"); + + toconfig.name = desc.name ().c_str (); + toconfig.externalName = desc.externalName ().c_str (); + + toconfig.delegatesTo.length (desc.count_delegatesTo ()); + SEQ_HAND_GCC_BUG_WORKAROUND (SPR_Handler::handle_spr, + desc.begin_delegatesTo (), + toconfig.delegatesTo); + std::for_each (desc.begin_delegatesTo (), + desc.end_delegatesTo (), + SPR_Functor (toconfig.delegatesTo)); + } + + static AssemblyPropertyMapping + get_apm (const ::Deployment::AssemblyPropertyMapping &src) + { + CIAO_TRACE("APM_Handler::get_apm - reverse"); + + AssemblyPropertyMapping retval (src.name.in (), + src.externalName.in ()); + + for (CORBA::ULong i = 0; i < src.delegatesTo.length (); ++i) + retval.add_delegatesTo (SPR_Handler::get_spr (src.delegatesTo[i])); + + return retval; + } }; - typedef Sequence_Handler < - AssemblyPropertyMapping, - ::Deployment::AssemblyPropertyMappings, - ::Deployment::AssemblyPropertyMapping, - APM_Handler::handle_apm > APM_Functor; + typedef Sequence_Handler < AssemblyPropertyMapping, + ::Deployment::AssemblyPropertyMappings, + ::Deployment::AssemblyPropertyMapping, + APM_Handler::handle_apm > APM_Functor; void CAD_Handler::component_assem_descr (const ComponentAssemblyDescription &desc, @@ -208,17 +210,17 @@ namespace CIAO /* @@ MAJO: Implement Locality */ toconfig.connection.length (desc.count_connection ()); - SEQ_HAND_GCC_BUG_WORKAROUND (ACD_Handler::handle_acd, - desc.begin_connection (), - toconfig.connection); + SEQ_HAND_GCC_BUG_WORKAROUND (ACD_Handler::handle_acd, + desc.begin_connection (), + toconfig.connection); std::for_each (desc.begin_connection (), desc.end_connection (), ACD_Functor (toconfig.connection)); toconfig.externalProperty.length (desc.count_externalProperty ()); - SEQ_HAND_GCC_BUG_WORKAROUND (APM_Handler::handle_apm, - desc.begin_externalProperty (), - toconfig.externalProperty); + SEQ_HAND_GCC_BUG_WORKAROUND (APM_Handler::handle_apm, + desc.begin_externalProperty (), + toconfig.externalProperty); std::for_each (desc.begin_externalProperty (), desc.end_externalProperty (), APM_Functor (toconfig.externalProperty)); @@ -242,6 +244,7 @@ namespace CIAO retval.add_externalProperty (APM_Handler::get_apm (src.externalProperty[i])); return retval; + } ComponentAssemblyDescription * diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.h b/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.h index 139c24936ce..b42f13dcdc3 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.h +++ b/CIAO/tools/Config_Handlers/Package_Handlers/CAD_Handler.h @@ -10,7 +10,7 @@ #include /**/ "ace/pre.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "DAnCE/Deployment/DeploymentC.h" #include "Package_Handlers/Packaging_Handlers_Export.h" diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.cpp index 6cdc8b8c8cf..f4bca5f8248 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/CID_Handler.cpp @@ -11,7 +11,7 @@ #include "Basic_Deployment_Data.hpp" #include "DAnCE/Deployment/Deployment_DataC.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Utils/Exceptions.h" #include "Deployment.hpp" @@ -29,226 +29,224 @@ namespace CIAO struct Capability_Handler { - static void handle_capability (const Capability &desc, - ::Deployment::Capability &toconfig) - { - CIAO_TRACE ("Capability_Handler::get_capability"); + static void handle_capability (const Capability &desc, + ::Deployment::Capability &toconfig) + { + CIAO_TRACE ("Capability_Handler::get_capability"); - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + toconfig.name = desc.name ().c_str (); - toconfig.resourceType.length (desc.count_resourceType ()); - std::for_each (desc.begin_resourceType (), - desc.end_resourceType (), - String_Seq_Functor (toconfig.resourceType)); + toconfig.resourceType.length (desc.count_resourceType ()); + std::for_each (desc.begin_resourceType (), + desc.end_resourceType (), + String_Seq_Functor (toconfig.resourceType)); - toconfig.property.length (desc.count_property ()); - std::for_each (desc.begin_property (), - desc.end_property (), - SatisfierProperty_Functor (toconfig.property)); - } + toconfig.property.length (desc.count_property ()); + std::for_each (desc.begin_property (), + desc.end_property (), + SatisfierProperty_Functor (toconfig.property)); + } - static Capability get_capability (const ::Deployment::Capability &src) - { - CIAO_TRACE ("Capability_Handler::get_capability - reverse"); + static Capability get_capability (const ::Deployment::Capability &src) + { + CIAO_TRACE ("Capability_Handler::get_capability - reverse"); - Capability retval (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + Capability retval (src.name.in ()); - for (CORBA::ULong i = 0; i < src.resourceType.length (); ++i) - retval.add_resourceType (ACE_TEXT_CHAR_TO_TCHAR (src.resourceType[i].in ())); + for (CORBA::ULong i = 0; i < src.resourceType.length (); ++i) + retval.add_resourceType (src.resourceType[i].in ()); - for (CORBA::ULong i = 0; i < src.property.length (); ++i) - retval.add_property ( - SatisfierProperty_Handler::get_sat_property (src.property[i])); + for (CORBA::ULong i = 0; i < src.property.length (); ++i) + retval.add_property (SatisfierProperty_Handler::get_sat_property (src.property[i])); - return retval; - } + return retval; + } }; - typedef Sequence_Handler < - Capability, - ::Deployment::Capabilities, - ::Deployment::Capability, - Capability_Handler::handle_capability > Capability_Functor; + typedef Sequence_Handler < Capability, + ::Deployment::Capabilities, + ::Deployment::Capability, + Capability_Handler::handle_capability > Capability_Functor; struct IR_Handler { - static void handle_ir (const ImplementationRequirement &desc, - ::Deployment::ImplementationRequirement &toconfig) - { - CIAO_TRACE ("IR_Handler::get_ir"); - - if (desc.resourceUsage_p ()) - { - switch (desc.resourceUsage ().integral ()) - { - case ResourceUsageKind::None_l: - toconfig.resourceUsage = Deployment::None; - break; - - case ResourceUsageKind::InstanceUsesResource_l: - toconfig.resourceUsage = Deployment::InstanceUsesResource; - break; - - case ResourceUsageKind::ResourceUsesInstance_l: - toconfig.resourceUsage = Deployment::ResourceUsesInstance; - break; - - case ResourceUsageKind::PortUsesResource_l: - toconfig.resourceUsage = Deployment::PortUsesResource; - break; - - case ResourceUsageKind::ResourceUsesPort_l: - toconfig.resourceUsage = Deployment::ResourceUsesPort; - break; - - default: - throw Config_Error (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()), - "Unknown ResourceUsageKind."); - break; - } - } - - if (desc.resourcePort_p ()) - toconfig.resourcePort = ACE_TEXT_ALWAYS_CHAR (desc.resourcePort ().c_str ()); - - if (desc.componentPort_p ()) - toconfig.componentPort = ACE_TEXT_ALWAYS_CHAR (desc.componentPort ().c_str ()); - - toconfig.resourceType = ACE_TEXT_ALWAYS_CHAR (desc.resourceType ().c_str ()); - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); - - std::for_each (desc.begin_property (), - desc.end_property (), - Property_Functor (toconfig.property )); - } + static void handle_ir (const ImplementationRequirement &desc, + ::Deployment::ImplementationRequirement &toconfig) + { + CIAO_TRACE ("IR_Handler::get_ir"); - static ImplementationRequirement - get_ir (const ::Deployment::ImplementationRequirement &src) + if (desc.resourceUsage_p ()) + { + switch (desc.resourceUsage ().integral ()) { - CIAO_TRACE ("IR_Handler::get_ir - reverse"); + case ResourceUsageKind::None_l: + toconfig.resourceUsage = Deployment::None; + break; + + case ResourceUsageKind::InstanceUsesResource_l: + toconfig.resourceUsage = Deployment::InstanceUsesResource; + break; + + case ResourceUsageKind::ResourceUsesInstance_l: + toconfig.resourceUsage = Deployment::ResourceUsesInstance; + break; + + case ResourceUsageKind::PortUsesResource_l: + toconfig.resourceUsage = Deployment::PortUsesResource; + break; + + case ResourceUsageKind::ResourceUsesPort_l: + toconfig.resourceUsage = Deployment::ResourceUsesPort; + break; + + default: + throw Config_Error (desc.name (), + "Unknown ResourceUsageKind."); + break; + } + } - ImplementationRequirement retval (ACE_TEXT_CHAR_TO_TCHAR (src.resourceType.in ()), - ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + if (desc.resourcePort_p ()) + toconfig.resourcePort = desc.resourcePort ().c_str (); - if (src.resourceUsage.length () == 1) - switch (src.resourceUsage[0]) - { - case Deployment::None: - retval.resourceUsage (ResourceUsageKind::None); - break; + if (desc.componentPort_p ()) + toconfig.componentPort = desc.componentPort ().c_str (); - case Deployment::InstanceUsesResource: - retval.resourceUsage (ResourceUsageKind::InstanceUsesResource); - break; + toconfig.resourceType = desc.resourceType ().c_str (); + toconfig.name = desc.name ().c_str (); - case Deployment::ResourceUsesInstance: - retval.resourceUsage (ResourceUsageKind::ResourceUsesInstance); - break; + std::for_each (desc.begin_property (), + desc.end_property (), + Property_Functor (toconfig.property )); + } - case Deployment::PortUsesResource: - retval.resourceUsage (ResourceUsageKind::PortUsesResource); - break; + static ImplementationRequirement + get_ir (const ::Deployment::ImplementationRequirement &src) + { + CIAO_TRACE ("IR_Handler::get_ir - reverse"); - case Deployment::ResourceUsesPort: - retval.resourceUsage (ResourceUsageKind::ResourceUsesPort); - break; + ImplementationRequirement retval (src.resourceType.in (), + src.name.in ()); - default: - throw Config_Error (src.name.in (), - "Unknown ResourceUsageKind."); - break; - } + if (src.resourceUsage.length () == 1) + switch (src.resourceUsage[0]) + { + case Deployment::None: + retval.resourceUsage (ResourceUsageKind::None); + break; + + case Deployment::InstanceUsesResource: + retval.resourceUsage (ResourceUsageKind::InstanceUsesResource); + break; + + case Deployment::ResourceUsesInstance: + retval.resourceUsage (ResourceUsageKind::ResourceUsesInstance); + break; + + case Deployment::PortUsesResource: + retval.resourceUsage (ResourceUsageKind::PortUsesResource); + break; + + case Deployment::ResourceUsesPort: + retval.resourceUsage (ResourceUsageKind::ResourceUsesPort); + break; + + default: + throw Config_Error (src.name.in (), + "Unknown ResourceUsageKind."); + break; + } - retval.resourcePort (ACE_TEXT_CHAR_TO_TCHAR (src.resourcePort.in ())); + retval.resourcePort (src.resourcePort.in ()); - retval.componentPort (ACE_TEXT_CHAR_TO_TCHAR (src.componentPort.in ())); + retval.componentPort (src.componentPort.in ()); - for (CORBA::ULong i = 0; i < src.property.length (); ++i) - retval.add_property (Property_Handler::get_property (src.property[i])); + for (CORBA::ULong i = 0; i < src.property.length (); ++i) + retval.add_property (Property_Handler::get_property (src.property[i])); - return retval; - } + return retval; + } }; - typedef Sequence_Handler < - ImplementationRequirement, - ::Deployment::ImplementationRequirements, - ::Deployment::ImplementationRequirement, - IR_Handler::handle_ir > IR_Functor; + typedef Sequence_Handler < ImplementationRequirement, + ::Deployment::ImplementationRequirements, + ::Deployment::ImplementationRequirement, + IR_Handler::handle_ir > IR_Functor; struct MID_Handler { - static void handle_mid ( - const MonolithicImplementationDescription &desc, - ::Deployment::MonolithicImplementationDescription &toconfig) + static void handle_mid (const MonolithicImplementationDescription &desc, + ::Deployment::MonolithicImplementationDescription &toconfig) + { + CIAO_TRACE ("MID_Handler::get_mid"); + + toconfig.nodeExecParameter.length (desc.count_nodeExecParameter ()); + std::for_each (desc.begin_nodeExecParameter (), + desc.end_nodeExecParameter (), + Property_Functor (toconfig.nodeExecParameter)); + + toconfig.componentExecParameter.length (desc.count_componentExecParameter ()); + std::for_each (desc.begin_componentExecParameter (), + desc.end_componentExecParameter (), + Property_Functor (toconfig.componentExecParameter)); + + toconfig.deployRequirement.length (desc.count_deployRequirement ()); + while (0) { - CIAO_TRACE ("MID_Handler::get_mid"); - - toconfig.nodeExecParameter.length (desc.count_nodeExecParameter ()); - std::for_each (desc.begin_nodeExecParameter (), - desc.end_nodeExecParameter (), - Property_Functor (toconfig.nodeExecParameter)); - - toconfig.componentExecParameter.length ( - desc.count_componentExecParameter ()); - std::for_each (desc.begin_componentExecParameter (), - desc.end_componentExecParameter (), - Property_Functor (toconfig.componentExecParameter)); - - toconfig.deployRequirement.length (desc.count_deployRequirement ()); - while (0) - { - IR_Handler::handle_ir (*desc.begin_deployRequirement (), - toconfig.deployRequirement[0]); - } - std::for_each (desc.begin_deployRequirement (), - desc.end_deployRequirement (), - IR_Functor (toconfig.deployRequirement)); - - toconfig.primaryArtifact.length (desc.count_primaryArtifact ()); - SEQ_HAND_GCC_BUG_WORKAROUND (NIA_Handler::handle_nia, - desc.begin_primaryArtifact (), - toconfig.primaryArtifact); - std::for_each (desc.begin_primaryArtifact (), - desc.end_primaryArtifact (), - NIA_Functor (toconfig.primaryArtifact)); + IR_Handler::handle_ir (*desc.begin_deployRequirement (), + toconfig.deployRequirement[0]); } + std::for_each (desc.begin_deployRequirement (), + desc.end_deployRequirement (), + IR_Functor (toconfig.deployRequirement)); + + toconfig.primaryArtifact.length (desc.count_primaryArtifact ()); + SEQ_HAND_GCC_BUG_WORKAROUND (NIA_Handler::handle_nia, + desc.begin_primaryArtifact (), + toconfig.primaryArtifact); + std::for_each (desc.begin_primaryArtifact (), + desc.end_primaryArtifact (), + NIA_Functor (toconfig.primaryArtifact)); + } - static MonolithicImplementationDescription - get_mid (const ::Deployment::MonolithicImplementationDescription &src) - { - CIAO_TRACE ("MID_Handler::get_mid - reverse"); + static MonolithicImplementationDescription + get_mid (const ::Deployment::MonolithicImplementationDescription &src) + { + CIAO_TRACE ("MID_Handler::get_mid - reverse"); - MonolithicImplementationDescription retval; + MonolithicImplementationDescription retval; - for (CORBA::ULong i = 0; i < src.nodeExecParameter.length (); ++i) - retval.add_nodeExecParameter - (Property_Handler::get_property (src.nodeExecParameter[i])); + for (CORBA::ULong i = 0; i < src.nodeExecParameter.length (); ++i) + retval.add_nodeExecParameter + (Property_Handler::get_property (src.nodeExecParameter[i])); - for (CORBA::ULong i = 0; i < src.componentExecParameter.length (); ++i) - retval.add_componentExecParameter - (Property_Handler::get_property (src.componentExecParameter[i])); + for (CORBA::ULong i = 0; i < src.componentExecParameter.length (); ++i) + retval.add_componentExecParameter + (Property_Handler::get_property (src.componentExecParameter[i])); - for (CORBA::ULong i = 0; i < src.deployRequirement.length (); ++i) - retval.add_deployRequirement - (IR_Handler::get_ir (src.deployRequirement[i])); + for (CORBA::ULong i = 0; i < src.deployRequirement.length (); ++i) + retval.add_deployRequirement + (IR_Handler::get_ir (src.deployRequirement[i])); - for (CORBA::ULong i = 0; i < src.primaryArtifact.length (); ++i) - retval.add_primaryArtifact - (NIA_Handler::get_nia (src.primaryArtifact[i])); + for (CORBA::ULong i = 0; i < src.primaryArtifact.length (); ++i) + retval.add_primaryArtifact + (NIA_Handler::get_nia (src.primaryArtifact[i])); + + return retval; + } - return retval; - } }; - typedef Sequence_Handler < - MonolithicImplementationDescription, - ::Deployment::MonolithicImplementationDescriptions, - ::Deployment::MonolithicImplementationDescription, - MID_Handler::handle_mid > MID_Functor; + typedef Sequence_Handler < MonolithicImplementationDescription, + ::Deployment::MonolithicImplementationDescriptions, + ::Deployment::MonolithicImplementationDescription, + MID_Handler::handle_mid > MID_Functor; + + void - CID_Handler::component_impl_descr (const ComponentImplementationDescription &desc, + CID_Handler::component_impl_descr ( + const ComponentImplementationDescription &desc, ::Deployment::ComponentImplementationDescription &toconfig) { CIAO_TRACE ("CID_Handler::component_impl_descr"); @@ -258,17 +256,17 @@ namespace CIAO if (desc.href_p ()) { - xsc_cid.reset (CID_Handler::resolve_cid (ACE_TEXT_ALWAYS_CHAR (desc.href ().c_str ()))); + xsc_cid.reset (CID_Handler::resolve_cid (desc.href ().c_str ())); cid = xsc_cid.get (); } else cid = &desc; if (cid->label_p ()) - toconfig.label = ACE_TEXT_ALWAYS_CHAR (cid->label ().c_str ()); + toconfig.label = cid->label ().c_str (); if (cid->UUID_p ()) - toconfig.UUID = ACE_TEXT_ALWAYS_CHAR (cid->UUID ().c_str ()); + toconfig.UUID = cid->UUID ().c_str (); if (cid->implements_p ()) { // MAJO: We should be able to assume this exists, fix broken interpeters.. @@ -286,7 +284,7 @@ namespace CIAO { toconfig.monolithicImpl.length (1); MID_Handler::handle_mid (cid->monolithicImpl (), - toconfig.monolithicImpl[0]); + toconfig.monolithicImpl[0]); } else throw Plan_Error ("ComponentImplementationDescription must have either assemblyImpl or monolithicImpl"); @@ -299,9 +297,9 @@ namespace CIAO // capability toconfig.capability.length (cid->count_capability ()); - SEQ_HAND_GCC_BUG_WORKAROUND (Capability_Handler::handle_capability, - cid->begin_capability (), - toconfig.capability); + SEQ_HAND_GCC_BUG_WORKAROUND (Capability_Handler::handle_capability, + cid->begin_capability (), + toconfig.capability); std::for_each (cid->begin_capability (), cid->end_capability (), Capability_Functor (toconfig.capability)); @@ -312,14 +310,14 @@ namespace CIAO for (ComponentImplementationDescription::dependsOn_const_iterator i = cid->begin_dependsOn (); i != cid->end_dependsOn (); ++i) - toconfig.dependsOn[pos++].requiredType = - ACE_TEXT_ALWAYS_CHAR (i->requiredType ().c_str ()); + toconfig.dependsOn[pos++].requiredType = i->requiredType ().c_str (); // infoProperty toconfig.infoProperty.length (cid->count_infoProperty ()); std::for_each (cid->begin_infoProperty (), cid->end_infoProperty (), Property_Functor (toconfig.infoProperty)); + } ComponentImplementationDescription @@ -329,8 +327,8 @@ namespace CIAO ComponentImplementationDescription retval; - retval.label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); - retval.UUID (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); + retval.label (src.label.in ()); + retval.UUID (src.UUID.in ()); { retval.implements (Comp_Intf_Descr_Handler::comp_intf_descr (src.implements)); @@ -350,18 +348,19 @@ namespace CIAO for (CORBA::ULong i = 0; i < src.configProperty.length (); ++i) { - retval.add_configProperty (Property_Handler::get_property (src.configProperty[i])); + retval.add_configProperty ( + Property_Handler::get_property (src.configProperty[i])); } for (CORBA::ULong i = 0; i < src.dependsOn.length (); ++i) { - retval.add_dependsOn (ImplementationDependency ( - ACE_TEXT_CHAR_TO_TCHAR (src.dependsOn[i].requiredType.in ()))); + retval.add_dependsOn (ImplementationDependency (src.dependsOn[i].requiredType.in ())); } for (CORBA::ULong i = 0; i < src.infoProperty.length (); ++i) { - retval.add_infoProperty (Property_Handler::get_property (src.infoProperty[i])); + retval.add_infoProperty ( + Property_Handler::get_property (src.infoProperty[i])); } return retval; @@ -372,18 +371,16 @@ namespace CIAO { CIAO_TRACE ("CID_Handler::resolve_cid"); - xercesc::DOMDocument *dom = XML_HELPER->create_dom (ACE_TEXT_CHAR_TO_TCHAR (uri)); + xercesc::DOMDocument *dom = XML_Helper::XML_HELPER.create_dom (uri); if (!dom) throw Parse_Error ("Unable to create DOM for CID"); - try - { + try { return new ComponentImplementationDescription (componentImplementationDescription (dom)); } - catch (...) - { + catch (...) { throw Parse_Error ("Unable to create XSC structure for CID"); } } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp index e02bac407d1..e39d5ced065 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.cpp @@ -17,37 +17,34 @@ namespace CIAO { struct Packaging_Handlers_Export PCI_Handler { - static void handle_pci ( - const PackagedComponentImplementation &desc, - ::Deployment::PackagedComponentImplementation &toconfig) - { - CIAO_TRACE ("PCI_Handler::get_pci"); - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + static void handle_pci (const PackagedComponentImplementation &desc, + ::Deployment::PackagedComponentImplementation &toconfig) + { + CIAO_TRACE ("PCI_Handler::get_pci"); + toconfig.name = desc.name ().c_str (); - CID_Handler::component_impl_descr (desc.referencedImplementation (), - toconfig.referencedImplementation); - } + CID_Handler::component_impl_descr (desc.referencedImplementation (), + toconfig.referencedImplementation); + } - static PackagedComponentImplementation - get_pci (const ::Deployment::PackagedComponentImplementation &src) - { - CIAO_TRACE ("PCI_Handler::get_pci - reverse"); - return PackagedComponentImplementation ( - ACE_TEXT_CHAR_TO_TCHAR (src.name.in ()), - CID_Handler::component_impl_descr (src.referencedImplementation)); - } + static PackagedComponentImplementation + get_pci (const ::Deployment::PackagedComponentImplementation &src) + { + CIAO_TRACE ("PCI_Handler::get_pci - reverse"); + return PackagedComponentImplementation (src.name.in (), + CID_Handler::component_impl_descr (src.referencedImplementation)); + } }; - typedef Sequence_Handler < - PackagedComponentImplementation, - ::Deployment::PackagedComponentImplementations, - ::Deployment::PackagedComponentImplementation, - PCI_Handler::handle_pci > PCI_Functor; + typedef Sequence_Handler < PackagedComponentImplementation, + ::Deployment::PackagedComponentImplementations, + ::Deployment::PackagedComponentImplementation, + PCI_Handler::handle_pci > PCI_Functor; + void - CPD_Handler::handle_component_package_descr ( - const ComponentPackageDescription &desc, - ::Deployment::ComponentPackageDescription &toconfig) + CPD_Handler::handle_component_package_descr (const ComponentPackageDescription &desc, + ::Deployment::ComponentPackageDescription &toconfig) { CIAO_TRACE ("CPD_Handler::component_package_descr"); @@ -56,17 +53,17 @@ namespace CIAO if (desc.href_p ()) { - xsc_cpd.reset (CPD_Handler::resolve_cpd (ACE_TEXT_ALWAYS_CHAR (desc.href ().c_str ()))); + xsc_cpd.reset (CPD_Handler::resolve_cpd (desc.href ().c_str ())); cpd = xsc_cpd.get (); } else cpd = &desc; if (cpd->label_p ()) - toconfig.label = ACE_TEXT_ALWAYS_CHAR (cpd->label ().c_str ()); + toconfig.label = cpd->label ().c_str (); if (cpd->UUID_p ()) - toconfig.UUID = ACE_TEXT_ALWAYS_CHAR (cpd->UUID ().c_str ()); + toconfig.UUID = cpd->UUID ().c_str (); // CID if (cpd->realizes_p ()) @@ -84,9 +81,9 @@ namespace CIAO // Packaged Component Implementations toconfig.implementation.length ( cpd->count_implementation ()); - SEQ_HAND_GCC_BUG_WORKAROUND (PCI_Handler::handle_pci, - cpd->begin_implementation (), - toconfig.implementation); + SEQ_HAND_GCC_BUG_WORKAROUND (PCI_Handler::handle_pci, + cpd->begin_implementation (), + toconfig.implementation); std::for_each (cpd->begin_implementation (), cpd->end_implementation (), PCI_Functor (toconfig.implementation)); @@ -105,10 +102,10 @@ namespace CIAO ComponentPackageDescription toconfig; if (src.label.in () != 0) - toconfig.label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); + toconfig.label (src.label.in ()); if (src.UUID.in () != 0) - toconfig.UUID (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); + toconfig.UUID (src.UUID.in ()); { toconfig.realizes @@ -118,19 +115,19 @@ namespace CIAO for (size_t i = 0; i < src.configProperty.length (); ++i) { toconfig.add_configProperty ( - Property_Handler::get_property (src.configProperty[i])); + Property_Handler::get_property (src.configProperty[i])); } { // Packaged Component Implementations for (size_t i = 0; i < src.implementation.length (); ++i) toconfig.add_implementation ( - PCI_Handler::get_pci (src.implementation[i])); + PCI_Handler::get_pci (src.implementation[i])); } for (size_t i = 0; i < src.infoProperty.length (); ++i) { toconfig.add_infoProperty ( - Property_Handler::get_property (src.infoProperty[i])); + Property_Handler::get_property (src.infoProperty[i])); } return toconfig; @@ -139,25 +136,25 @@ namespace CIAO ComponentPackageDescription * CPD_Handler::resolve_cpd (const char *uri) { CIAO_TRACE ("CPD_Handler::resolve_cpd"); - if (!XML_HELPER->is_initialized ()) + if (!XML_Helper::XML_HELPER.is_initialized ()) return 0; xercesc::DOMDocument* dom = - XML_HELPER->create_dom (ACE_TEXT_CHAR_TO_TCHAR (uri)); + XML_Helper::XML_HELPER.create_dom (uri); if (!dom) throw Parse_Error ("Unable to create DOM for component package description"); - try - { + try { //ACE_ERROR ((LM_ERROR, "Creating new CPD XSC Object\n")); return new ComponentPackageDescription (componentPackageDescription (dom)); } - catch (...) - { + catch (...) { throw Parse_Error ("Unable to create XSC structure for CID"); } } } + + } } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.h b/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.h index 4b25591a75c..2279054faee 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.h +++ b/CIAO/tools/Config_Handlers/Package_Handlers/CPD_Handler.h @@ -14,7 +14,7 @@ #include /**/ "ace/pre.h" #include <memory> -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Utils/Functors.h" #include "Package_Handlers/Packaging_Handlers_Export.h" @@ -54,17 +54,19 @@ namespace CIAO ::Deployment::ComponentPackageDescription &toconfig); static ComponentPackageDescription - component_package_descr (const Deployment::ComponentPackageDescription& src); + component_package_descr (const Deployment::ComponentPackageDescription& src); private: static ComponentPackageDescription * resolve_cpd (const char *uri); + }; typedef Sequence_Handler < ComponentPackageDescription, ::Deployment::ComponentPackageDescriptions, ::Deployment::ComponentPackageDescription, - CPD_Handler::handle_component_package_descr > - CPD_Functor; + CPD_Handler::handle_component_package_descr > CPD_Functor; + } + } } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp index feb396c0c0e..d743106a2d0 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.cpp @@ -1,7 +1,7 @@ // $Id$ #include "Comp_Intf_Descr_Handler.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Utils/Exceptions.h" #include "Utils/Functors.h" #include "DataType_Handler.h" @@ -23,7 +23,7 @@ namespace CIAO { CIAO_TRACE ("Comp_Prop_Handler::get_cpd"); - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + toconfig.name = desc.name ().c_str (); DataType_Handler::data_type (desc.type (), toconfig.type); } @@ -33,7 +33,7 @@ namespace CIAO { CIAO_TRACE ("Comp_Prop_Handler::get_cpd - reverse"); - return ComponentPropertyDescription (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ()), + return ComponentPropertyDescription (src.name.in (), DataType_Handler::data_type (src.type)); } @@ -57,22 +57,21 @@ namespace CIAO if (desc.href_p ()) { - safe_cid.reset (Comp_Intf_Descr_Handler::resolve_cid ( - ACE_TEXT_ALWAYS_CHAR (desc.href ().c_str ()))); + safe_cid.reset (Comp_Intf_Descr_Handler::resolve_cid (desc.href ().c_str ())); cid = safe_cid.get (); } else cid = &desc; if (cid->label_p ()) - toconfig.label = ACE_TEXT_ALWAYS_CHAR (cid->label ().c_str ()); + toconfig.label = cid->label ().c_str (); if (cid->UUID_p ()) - toconfig.UUID = ACE_TEXT_ALWAYS_CHAR (cid->UUID ().c_str ()); + toconfig.UUID = cid->UUID ().c_str (); // MAJO: SpecificType should be required. if (cid->specificType_p ()) - toconfig.specificType = ACE_TEXT_ALWAYS_CHAR (cid->specificType ().c_str ()); + toconfig.specificType = cid->specificType ().c_str (); toconfig.supportedType.length (cid->count_supportedType ()); std::for_each (cid->begin_supportedType (), @@ -95,9 +94,9 @@ namespace CIAO CIAO::Config_Handlers::CPD_Functor (toconfig.port)); toconfig.property.length (cid->count_property ()); - SEQ_HAND_GCC_BUG_WORKAROUND (Comp_Prop_Handler::handle_cpd, - cid->begin_property (), - toconfig.property); + SEQ_HAND_GCC_BUG_WORKAROUND (Comp_Prop_Handler::handle_cpd, + cid->begin_property (), + toconfig.property); std::for_each (cid->begin_property (), cid->end_property (), Comp_Prop_Functor (toconfig.property)); @@ -116,15 +115,15 @@ namespace CIAO CIAO_TRACE ("Comp_Intf_Descr_Handler::comp_intf_descr - reverse"); ComponentInterfaceDescription retval; - retval.label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); - retval.UUID (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); - retval.specificType (ACE_TEXT_CHAR_TO_TCHAR (src.specificType.in ())); + retval.label (src.label.in ()); + retval.UUID (src.UUID.in ()); + retval.specificType (src.specificType.in ()); for (CORBA::ULong i = 0; i < src.supportedType.length (); ++i) - retval.add_supportedType (ACE_TEXT_CHAR_TO_TCHAR (src.supportedType[i].in ())); + retval.add_supportedType (src.supportedType[i].in ()); for (CORBA::ULong i = 0; i < src.idlFile.length (); ++i) - retval.add_idlFile (ACE_TEXT_CHAR_TO_TCHAR (src.idlFile[i].in ())); + retval.add_idlFile (src.idlFile[i].in ()); for (CORBA::ULong i = 0; i < src.configProperty.length (); ++i) retval.add_configProperty ( @@ -149,7 +148,7 @@ namespace CIAO { CIAO_TRACE ("Comp_Intf_Descr_Handler::resolve_cid"); - xercesc::DOMDocument *dom = XML_HELPER->create_dom (ACE_TEXT_CHAR_TO_TCHAR (uri)); + xercesc::DOMDocument *dom = XML_Helper::XML_HELPER.create_dom (uri); if (!dom) throw Parse_Error ("Unable to create DOM for Component Interface Description."); diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h b/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h index 02f07fbb438..08a877d0472 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h +++ b/CIAO/tools/Config_Handlers/Package_Handlers/Comp_Intf_Descr_Handler.h @@ -10,7 +10,7 @@ #include /**/ "ace/pre.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "DAnCE/Deployment/DeploymentC.h" #include "Package_Handlers/Packaging_Handlers_Export.h" diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp index 2291a30527b..e16a5c63ae8 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/IAD_Handler.cpp @@ -6,7 +6,7 @@ #include "Req_Handler.h" #include "Utils/Functors.h" #include "Utils/Exceptions.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Deployment.hpp" #include "ciao/CIAO_common.h" @@ -29,7 +29,7 @@ namespace CIAO if (desc.href_p ()) { - safe_iad.reset (IAD_Handler::resolve_iad (ACE_TEXT_ALWAYS_CHAR (desc.href ().c_str ()))); + safe_iad.reset (IAD_Handler::resolve_iad (desc.href ().c_str ())); iad = safe_iad.get (); } else @@ -37,10 +37,10 @@ namespace CIAO if (iad->label_p ()) - toconfig.label = ACE_TEXT_ALWAYS_CHAR (iad->label ().c_str ()); + toconfig.label = iad->label ().c_str (); if (iad->UUID_p ()) - toconfig.UUID = ACE_TEXT_ALWAYS_CHAR (iad->UUID ().c_str ()); + toconfig.UUID = iad->UUID ().c_str (); toconfig.location.length (iad->count_location ()); std::for_each (iad->begin_location (), @@ -48,9 +48,9 @@ namespace CIAO String_Seq_Functor (toconfig.location)); toconfig.dependsOn.length (iad->count_dependsOn ()); - SEQ_HAND_GCC_BUG_WORKAROUND (NIA_Handler::handle_nia, - desc.begin_dependsOn (), - toconfig.dependsOn); + SEQ_HAND_GCC_BUG_WORKAROUND (NIA_Handler::handle_nia, + desc.begin_dependsOn (), + toconfig.dependsOn); std::for_each (iad->begin_dependsOn (), iad->end_dependsOn (), NIA_Functor (toconfig.dependsOn)); @@ -77,11 +77,11 @@ namespace CIAO CIAO_TRACE ("IAD_Handler::impl_artifact_descr - reverse"); ImplementationArtifactDescription retval; - retval.label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); - retval.UUID (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); + retval.label (src.label.in ()); + retval.UUID (src.UUID.in ()); for (CORBA::ULong i = 0; i < src.location.length (); ++i) - retval.add_location (ACE_TEXT_CHAR_TO_TCHAR (src.location[i].in ())); + retval.add_location (src.location[i].in ()); for (CORBA::ULong i = 0; i < src.dependsOn.length (); ++i) retval.add_dependsOn (NIA_Handler::get_nia (src.dependsOn[i])); @@ -105,7 +105,7 @@ namespace CIAO { CIAO_TRACE ("IAD_Handler::resolve_iad"); - xercesc::DOMDocument *dom = XML_HELPER->create_dom (ACE_TEXT_CHAR_TO_TCHAR (uri)); + xercesc::DOMDocument *dom = XML_Helper::XML_HELPER.create_dom (uri); if (!dom) throw Parse_Error ("Unable to create DOM for IAD"); diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/NIA_Handler.h b/CIAO/tools/Config_Handlers/Package_Handlers/NIA_Handler.h index 923104dc27b..2f3f2845343 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/NIA_Handler.h +++ b/CIAO/tools/Config_Handlers/Package_Handlers/NIA_Handler.h @@ -37,7 +37,7 @@ namespace CIAO static void handle_nia (const NamedImplementationArtifact &desc, ::Deployment::NamedImplementationArtifact &toconfig) { - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + toconfig.name = desc.name ().c_str (); IAD_Handler::impl_artifact_descr (desc.referencedArtifact (), toconfig.referencedArtifact); } @@ -46,7 +46,7 @@ namespace CIAO static NamedImplementationArtifact get_nia (const ::Deployment::NamedImplementationArtifact &src) { - return NamedImplementationArtifact (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ()), + return NamedImplementationArtifact (src.name.in (), IAD_Handler::impl_artifact_descr (src.referencedArtifact)); } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp index 3f11ee374ff..c7e82624f3d 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/PCD_Handler.cpp @@ -2,8 +2,8 @@ #include "tao/AnyTypeCode/AnyTypeCode_methods.h" #include "ciao/CIAO_common.h" #include "DAnCE/Deployment/Deployment_Packaging_DataC.h" -#include "Utils/XML_Helper.h" -#include "Utils/XercesString.h" +#include "XML_Typedefs.h" +#include "XML/XercesString.h" #include "Utils/Exceptions.h" #include "Package_Handlers/PCD_Handler.h" #include "Package_Handlers/CPD_Handler.h" @@ -14,6 +14,8 @@ #include <memory> +using CIAO::XML::XStr; + namespace CIAO { namespace Config_Handlers @@ -24,27 +26,27 @@ namespace CIAO PCD_Handler::package_config (const ACE_TCHAR *uri, ::Deployment::PackageConfiguration &toconfig) { - XERCES_CPP_NAMESPACE::DOMDocument *dom = XML_HELPER->create_dom (uri); + XERCES_CPP_NAMESPACE::DOMDocument *dom = XML_Helper::XML_HELPER.create_dom (uri); if (dom == 0) { std::string error ("Unable to open file: "); - error += ACE_TEXT_ALWAYS_CHAR (uri); + error += uri; throw Parse_Error (error); } XStr root = dom->getDocumentElement ()->getTagName (); - if (root == XStr (ACE_TEXT ("Deployment:topLevelPackageDescription"))) + if (root == XStr ("Deployment:topLevelPackageDescription")) { TopLevelPackageDescription tpd; - - tpd = topLevelPackageDescription (dom); + + tpd = topLevelPackageDescription (dom); PCD_Handler::package_config (*tpd.begin_basePackage (), toconfig); } - else if (root == XStr (ACE_TEXT ("Deployment:packageConfiguration"))) + else if (root == XStr ("Deployment:packageConfiguration")) { PackageConfiguration pcd; pcd = packageConfiguration (dom); @@ -76,8 +78,7 @@ namespace CIAO if (desc.contentLocation_p ()) { // Take ownership of the resolved pcd - xsc_pcd.reset (PCD_Handler:: resolve_package_config ( - ACE_TEXT_ALWAYS_CHAR (desc.contentLocation ().c_str ()))); + xsc_pcd.reset (PCD_Handler:: resolve_package_config (desc.contentLocation ().c_str ())); pcd = xsc_pcd.get (); } else @@ -85,11 +86,11 @@ namespace CIAO if (pcd->label_p ()) toconfig.label = - ACE_TEXT_ALWAYS_CHAR (pcd->label ().c_str ()); + pcd->label ().c_str (); if (pcd->UUID_p ()) toconfig.UUID = - ACE_TEXT_ALWAYS_CHAR (pcd->UUID ().c_str ()); + pcd->UUID ().c_str (); if (pcd->basePackage_p ()) { @@ -119,10 +120,10 @@ namespace CIAO PackageConfiguration pcd = PackageConfiguration (); if (src.label.in () != 0) - pcd.label (ACE_TEXT_CHAR_TO_TCHAR (src.label.in ())); + pcd.label (src.label.in ()); if (src.UUID.in () != 0) - pcd.UUID (ACE_TEXT_CHAR_TO_TCHAR (src.UUID.in ())); + pcd.UUID (src.UUID.in ()); if (src.basePackage.length () > 0) { @@ -144,7 +145,7 @@ namespace CIAO PackageConfiguration * PCD_Handler::resolve_package_config (const char *uri) { xercesc::DOMDocument* dom = - XML_HELPER->create_dom (ACE_TEXT_CHAR_TO_TCHAR (uri)); + XML_Helper::XML_HELPER.create_dom (uri); if (!dom) throw Parse_Error ("Unable to create DOM for PackageConfiguration"); diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc b/CIAO/tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc index f844313584c..a5253f05d05 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc +++ b/CIAO/tools/Config_Handlers/Package_Handlers/Package_Handlers.mpc @@ -1,25 +1,24 @@ // $Id$ -project (Package_Config_Handlers) : acelib, ace_output, ciao_deployment_stub, ciao_config_handlers_base { +project (Package_Config_Handlers) : acelib, dance_deployment_stub, ciao_config_handlers_base, dance { sharedname = Package_Config_Handlers dynamicflags = PACKAGING_HANDLERS_BUILD_DLL avoids += ace_for_tao - - includes += $(CIAO_ROOT)/ciao - + + includes += $(CIAO_ROOT)/ciao + libpaths += $(CIAO_ROOT)/bin + after += XSC_Config_Handlers_Common \ XSC_Config_Handlers \ XSC_DynAny_Handler \ XSC_XML_Handlers \ CIAO_XML_Utils \ - CIAO_Events_Handlers libs += XSC_Config_Handlers_Common \ XSC_Config_Handlers \ XSC_DynAny_Handler \ XSC_XML_Handlers \ CIAO_XML_Utils \ - CIAO_Events_Handlers RT_CCM_Config_Handlers Source_files { CAD_Handler.cpp @@ -43,10 +42,11 @@ project (Package_Config_Handlers) : acelib, ace_output, ciao_deployment_stub, ci } -project (Package_Config_Handlers_Tests) : ciao_component_dnc, ciao_config_handlers, ifr_client { +project (Package_Config_Handlers_Tests) : dance_deployment_stub, ciao_config_handlers, ifr_client { exename = test macros += XML_USE_PTHREADS avoids += ace_for_tao + requires += dummy_label Source_Files { test.cpp diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.cpp index 7039fec9493..b6d9673bef0 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.cpp @@ -5,6 +5,7 @@ #include "DAnCE/Deployment/DeploymentC.h" #include "Package_Handlers/CPD_Handler.h" #include "Package_Handlers/PCD_Handler.h" +#include "Package_Handlers/Comp_Intf_Descr_Handler.h" #include "Req_Handler.h" #include "Property_Handler.h" @@ -23,7 +24,7 @@ namespace CIAO ::Deployment::SubcomponentInstantiationDescription &toconfig) { CIAO_TRACE ("SID_Handler::sub_comp_inst_descr"); - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + toconfig.name = desc.name ().c_str (); if (desc.basePackage_p ()) { @@ -52,14 +53,15 @@ namespace CIAO if (desc.referencedPackage ().requiredUUID_p ()) toconfig.referencedPackage[0].requiredUUID = - ACE_TEXT_ALWAYS_CHAR (desc.referencedPackage ().requiredUUID ().c_str ()); + desc.referencedPackage ().requiredUUID ().c_str (); if (desc.referencedPackage ().requiredName_p ()) toconfig.referencedPackage[0].requiredName = - ACE_TEXT_ALWAYS_CHAR (desc.referencedPackage ().requiredName ().c_str ()); - - toconfig.referencedPackage[0].requiredType = - ACE_TEXT_ALWAYS_CHAR (desc.referencedPackage ().requiredType ().c_str ()); + desc.referencedPackage ().requiredName ().c_str (); + + Comp_Intf_Descr_Handler::comp_intf_descr (desc.referencedPackage ().requiredType (), + toconfig.referencedPackage[0].requiredType); + } toconfig.selectRequirement.length (desc.count_selectRequirement ()); @@ -74,7 +76,7 @@ namespace CIAO if (desc.id_p ()) { - ACE_CString str (ACE_TEXT_ALWAYS_CHAR (desc.id ().c_str ())); + ACE_CString str (desc.id ().c_str ()); SID_Handler::IDREF.bind_next_available (str); } else @@ -87,7 +89,7 @@ namespace CIAO SID_Handler::sub_comp_inst_descr (const Deployment::SubcomponentInstantiationDescription &src) { CIAO_TRACE ("SID_Handler::sub_comp_inst_descr - reverse"); - SubcomponentInstantiationDescription retval (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + SubcomponentInstantiationDescription retval (src.name.in ()); if (src.basePackage.length () == 1) retval.basePackage @@ -100,15 +102,15 @@ namespace CIAO ComponentPackageImport ci; for (CORBA::ULong i = 0; i < src.importedPackage[0].location.length (); ++i) - ci.add_location (ACE_TEXT_CHAR_TO_TCHAR (src.importedPackage[0].location[i].in ())); + ci.add_location (src.importedPackage[0].location[i].in ()); retval.importedPackage (ci); } else if (src.referencedPackage.length () == 1) { - ComponentPackageReference cpr (ACE_TEXT_CHAR_TO_TCHAR (src.referencedPackage[0].requiredType.in ())); - cpr.requiredUUID (ACE_TEXT_CHAR_TO_TCHAR (src.referencedPackage[0].requiredUUID.in ())); - cpr.requiredName (ACE_TEXT_CHAR_TO_TCHAR (src.referencedPackage[0].requiredName.in ())); + ComponentPackageReference cpr (Comp_Intf_Descr_Handler::comp_intf_descr (src.referencedPackage[0].requiredType)); + cpr.requiredUUID (src.referencedPackage[0].requiredUUID.in ()); + cpr.requiredName (src.referencedPackage[0].requiredName.in ()); retval.referencedPackage (cpr); } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.h b/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.h index 7bc69b9ab95..2083b91b9b6 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.h +++ b/CIAO/tools/Config_Handlers/Package_Handlers/SID_Handler.h @@ -11,7 +11,7 @@ #include /**/ "ace/pre.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Utils/Functors.h" #include "IDREF_Base.h" #include "Package_Handlers/Packaging_Handlers_Export.h" @@ -61,8 +61,8 @@ namespace CIAO typedef Sequence_Handler < SubcomponentInstantiationDescription, ::Deployment::SubcomponentInstantiationDescriptions, ::Deployment::SubcomponentInstantiationDescription, - SID_Handler::handle_sub_comp_inst_descr > - SID_Functor; + SID_Handler::handle_sub_comp_inst_descr > SID_Functor; + } } } diff --git a/CIAO/tools/Config_Handlers/Package_Handlers/test.cpp b/CIAO/tools/Config_Handlers/Package_Handlers/test.cpp index dff1510e707..c107fed4a77 100644 --- a/CIAO/tools/Config_Handlers/Package_Handlers/test.cpp +++ b/CIAO/tools/Config_Handlers/Package_Handlers/test.cpp @@ -11,12 +11,13 @@ #include "tao/ORB.h" #include "Utils/Exceptions.h" -static const ACE_TCHAR *input_file = ACE_TEXT ("BasicSP.cdp"); +static const char *input_file = "BasicSP.cdp"; + static int -parse_args (int argc, ACE_TCHAR *argv[]) +parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("i:")); + ACE_Get_Opt get_opts (argc, argv, "i:"); int c; @@ -44,10 +45,12 @@ void check_srd (const Deployment::DeploymentPlan &); using namespace CIAO::Config_Handlers; + int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { try { + if (parse_args (argc, argv) != 0) return 1; @@ -56,7 +59,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_UNUSED_ARG (orb); - if (xercesc::DOMDocument *doc = XML_HELPER->create_dom (ACE_TEXT_ALWAYS_CHAR (input_file))) + if (xercesc::DOMDocument *doc = XML_HELPER->create_dom (input_file)) { ::Deployment::PackageConfiguration idl_pc; @@ -66,7 +69,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) //std::cerr << "XML to XSC conversion succeeded. Converting to IDL...\n"; //Convert the XSC to an IDL datatype - Packaging::PCD_Handler::package_config (ACE_TEXT_ALWAYS_CHAR (input_file), idl_pc); + Packaging::PCD_Handler::package_config (input_file, idl_pc); std::cout << "Instance document import succeeded. Dumping contents to file\n"; } @@ -86,7 +89,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) //Write it to test.xml - XML_HELPER->write_DOM(the_xsc, ACE_TEXT ("test.xml")); + XML_HELPER->write_DOM(the_xsc, "test.xml"); //Cleanliness is next to Godliness delete doc; diff --git a/CIAO/tools/Config_Handlers/Property_Handler.cpp b/CIAO/tools/Config_Handlers/Property_Handler.cpp index 6cd927dd218..5aece211c5c 100644 --- a/CIAO/tools/Config_Handlers/Property_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Property_Handler.cpp @@ -19,27 +19,32 @@ namespace CIAO } void - Property_Handler::handle_property ( - const Property& desc, - Deployment::Property& toconfig) + Property_Handler::handle_property (const Property& desc, + Deployment::Property& toconfig) { CIAO_TRACE("Property_Handler::get_property"); - toconfig.name = - CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ())); - - Any_Handler::extract_into_any (desc.value (), - toconfig.value); - + try + { + toconfig.name = + CORBA::string_dup (desc.name ().c_str ()); + + Any_Handler::extract_into_any (desc.value (), + toconfig.value); + } + catch (Config_Error &ex) + { + ex.name_ = desc.name (); + throw ex; + } } Property - Property_Handler::get_property ( - const Deployment::Property& src) + Property_Handler::get_property (const Deployment::Property& src) { CIAO_TRACE("Property_Handler::get_property - reverse"); - ::XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + ::XMLSchema::string< char > name ((src.name)); Any value (Any_Handler::get_any (src.value)); Property prop (name,value); diff --git a/CIAO/tools/Config_Handlers/Property_Handler.h b/CIAO/tools/Config_Handlers/Property_Handler.h index 096a2aae432..422aa1d4a44 100644 --- a/CIAO/tools/Config_Handlers/Property_Handler.h +++ b/CIAO/tools/Config_Handlers/Property_Handler.h @@ -29,20 +29,21 @@ namespace Deployment namespace CIAO { namespace Config_Handlers - { - class Property; + { + class Property; - /* - * @class Property_Handler - * - * @brief Handler class for <CCMComponentPortDescription> types. - * - * This class defines handler methods to map values from - * XSC objects, parsed from the descriptor files, to the - * corresponding CORBA IDL type for the schema element. - */ + /* + * @class Property_Handler + * + * @brief Handler class for <CCMComponentPortDescription> types. + * + * This class defines handler methods to map values from + * XSC objects, parsed from the descriptor files, to the + * corresponding CORBA IDL type for the schema element. + * + */ - class Config_Handlers_Common_Export Property_Handler + class Config_Handlers_Common_Export Property_Handler { public: Property_Handler (void); @@ -52,16 +53,17 @@ namespace CIAO /// <CIAO::Config_Handlers::Property> to the CORBA IDL type /// <Deployment::Property>. static void handle_property (const Property& desc, - ::Deployment::Property& toconfig); + ::Deployment::Property& toconfig); static Property get_property (const ::Deployment::Property& src); }; - typedef Sequence_Handler < Property, - ::Deployment::Properties, - ::Deployment::Property, - Property_Handler::handle_property > - Property_Functor; - } + + typedef Sequence_Handler < Property, + ::Deployment::Properties, + ::Deployment::Property, + Property_Handler::handle_property > Property_Functor; + + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/RDD_Handler.cpp b/CIAO/tools/Config_Handlers/RDD_Handler.cpp index 963e7a027ce..28ddc5ec7cf 100644 --- a/CIAO/tools/Config_Handlers/RDD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RDD_Handler.cpp @@ -19,10 +19,10 @@ namespace CIAO CIAO_TRACE("RDD_Handler::resource_deployment_descr"); dest.requirementName = - ACE_TEXT_ALWAYS_CHAR (src.requirementName ().c_str ()); + src.requirementName ().c_str (); dest.resourceName= - ACE_TEXT_ALWAYS_CHAR (src.resourceName ().c_str ()); + src.resourceName ().c_str (); std::for_each (src.begin_property (), src.end_property (), @@ -36,8 +36,8 @@ namespace CIAO { CIAO_TRACE("RDD_Handler::resource_deployment_descr - reverse"); - XMLSchema::string< ACE_TCHAR > reqname (ACE_TEXT_CHAR_TO_TCHAR (src.requirementName.in ())); - XMLSchema::string< ACE_TCHAR > resname (ACE_TEXT_CHAR_TO_TCHAR (src.resourceName.in ())); + XMLSchema::string< char > reqname ((src.requirementName)); + XMLSchema::string< char > resname ((src.resourceName.in ())); ResourceDeploymentDescription rdd (reqname,resname); diff --git a/CIAO/tools/Config_Handlers/RT-CCM/CB_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/CB_Handler.cpp index c0ab8d5daa9..85a06851d78 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/CB_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/CB_Handler.cpp @@ -34,7 +34,7 @@ namespace CIAO if (!IDD_Handler::IDREF.bind_ref (cstr, dest)) return false; */ - dest.Id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (src.id ().c_str ())); + dest.Id = CORBA::string_dup (src.id ().c_str ()); } return true; @@ -61,7 +61,7 @@ namespace CIAO */ if (src.Id.in () != 0) - cb.id (ACE_TEXT_CHAR_TO_TCHAR (src.Id.in ())); + cb.id (src.Id.in ()); return cb; } diff --git a/CIAO/tools/Config_Handlers/RT-CCM/CIAOServerResources.cpp b/CIAO/tools/Config_Handlers/RT-CCM/CIAOServerResources.cpp index a653c2fa311..01f192d5201 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/CIAOServerResources.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/CIAOServerResources.cpp @@ -1906,19 +1906,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("cmdline")) + if (n == "cmdline") { ::CIAO::Config_Handlers::ServerCmdlineOptions t (e); cmdline (t); } - else if (n == ACE_TEXT ("svcconf")) + else if (n == "svcconf") { ::CIAO::Config_Handlers::ACESvcConf t (e); svcconf (t); } - else if (n == ACE_TEXT ("orbConfigs")) + else if (n == "orbConfigs") { orbConfigs_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ORBConfigs > (new ::CIAO::Config_Handlers::ORBConfigs (e)); orbConfigs_->container (this); @@ -1933,7 +1933,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -1960,7 +1960,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("arg")) + if (n == "arg") { ::XMLSchema::string< ACE_TCHAR > t (e); add_arg (t); @@ -1987,7 +1987,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("uri")) + if (n == "uri") { ::XMLSchema::string< ACE_TCHAR > t (e); uri (t); @@ -2014,13 +2014,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("resources")) + if (n == "resources") { ::CIAO::Config_Handlers::ORBResources t (e); resources (t); } - else if (n == ACE_TEXT ("policySet")) + else if (n == "policySet") { ::CIAO::Config_Handlers::PolicySet t (e); add_policySet (t); @@ -2047,19 +2047,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("threadpool")) + if (n == "threadpool") { ::CIAO::Config_Handlers::ThreadpoolDef t (e); add_threadpool (t); } - else if (n == ACE_TEXT ("threadpoolWithLanes")) + else if (n == "threadpoolWithLanes") { ::CIAO::Config_Handlers::ThreadpoolWithLanesDef t (e); add_threadpoolWithLanes (t); } - else if (n == ACE_TEXT ("connectionBands")) + else if (n == "connectionBands") { ::CIAO::Config_Handlers::ConnectionBandsDef t (e); add_connectionBands (t); @@ -2086,43 +2086,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("stacksize")) + if (n == "stacksize") { stacksize_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); stacksize_->container (this); } - else if (n == ACE_TEXT ("static_threads")) + else if (n == "static_threads") { static_threads_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); static_threads_->container (this); } - else if (n == ACE_TEXT ("dynamic_threads")) + else if (n == "dynamic_threads") { dynamic_threads_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); dynamic_threads_->container (this); } - else if (n == ACE_TEXT ("default_priority")) + else if (n == "default_priority") { default_priority_ = ::std::auto_ptr< ::XMLSchema::int_ > (new ::XMLSchema::int_ (e)); default_priority_->container (this); } - else if (n == ACE_TEXT ("allow_request_buffering")) + else if (n == "allow_request_buffering") { allow_request_buffering_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); allow_request_buffering_->container (this); } - else if (n == ACE_TEXT ("max_buffered_requests")) + else if (n == "max_buffered_requests") { max_buffered_requests_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); max_buffered_requests_->container (this); } - else if (n == ACE_TEXT ("max_request_buffered_size")) + else if (n == "max_request_buffered_size") { max_request_buffered_size_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); max_request_buffered_size_->container (this); @@ -2137,7 +2137,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -2164,37 +2164,37 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("threadpoolLane")) + if (n == "threadpoolLane") { ::CIAO::Config_Handlers::ThreadpoolLaneDef t (e); add_threadpoolLane (t); } - else if (n == ACE_TEXT ("stacksize")) + else if (n == "stacksize") { stacksize_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); stacksize_->container (this); } - else if (n == ACE_TEXT ("allow_borrowing")) + else if (n == "allow_borrowing") { allow_borrowing_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); allow_borrowing_->container (this); } - else if (n == ACE_TEXT ("allow_request_buffering")) + else if (n == "allow_request_buffering") { allow_request_buffering_ = ::std::auto_ptr< ::XMLSchema::boolean > (new ::XMLSchema::boolean (e)); allow_request_buffering_->container (this); } - else if (n == ACE_TEXT ("max_buffered_requests")) + else if (n == "max_buffered_requests") { max_buffered_requests_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); max_buffered_requests_->container (this); } - else if (n == ACE_TEXT ("max_request_buffered_size")) + else if (n == "max_request_buffered_size") { max_request_buffered_size_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); max_request_buffered_size_->container (this); @@ -2209,7 +2209,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -2236,19 +2236,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("static_threads")) + if (n == "static_threads") { static_threads_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); static_threads_->container (this); } - else if (n == ACE_TEXT ("dynamic_threads")) + else if (n == "dynamic_threads") { dynamic_threads_ = ::std::auto_ptr< ::XMLSchema::unsignedLong > (new ::XMLSchema::unsignedLong (e)); dynamic_threads_->container (this); } - else if (n == ACE_TEXT ("priority")) + else if (n == "priority") { priority_ = ::std::auto_ptr< ::XMLSchema::int_ > (new ::XMLSchema::int_ (e)); priority_->container (this); @@ -2275,7 +2275,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("band")) + if (n == "band") { ::CIAO::Config_Handlers::PriorityBandDef t (e); add_band (t); @@ -2290,7 +2290,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -2317,13 +2317,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("low")) + if (n == "low") { low_ = ::std::auto_ptr< ::XMLSchema::int_ > (new ::XMLSchema::int_ (e)); low_->container (this); } - else if (n == ACE_TEXT ("high")) + else if (n == "high") { high_ = ::std::auto_ptr< ::XMLSchema::int_ > (new ::XMLSchema::int_ (e)); high_->container (this); @@ -2350,31 +2350,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("priorityModel")) + if (n == "priorityModel") { ::CIAO::Config_Handlers::PriorityModelPolicyDef t (e); add_priorityModel (t); } - else if (n == ACE_TEXT ("nwpriorityModel")) + else if (n == "nwpriorityModel") { ::CIAO::Config_Handlers::NWPriorityModelPolicyDef t (e); add_nwpriorityModel (t); } - else if (n == ACE_TEXT ("cnwpriorityModel")) + else if (n == "cnwpriorityModel") { ::CIAO::Config_Handlers::CNWPriorityModelPolicyDef t (e); add_cnwpriorityModel (t); } - else if (n == ACE_TEXT ("threadpool")) + else if (n == "threadpool") { ::XMLSchema::IDREF< ACE_TCHAR > t (e); add_threadpool (t); } - else if (n == ACE_TEXT ("priorityBandedConnection")) + else if (n == "priorityBandedConnection") { ::XMLSchema::IDREF< ACE_TCHAR > t (e); add_priorityBandedConnection (t); @@ -2389,7 +2389,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -2410,8 +2410,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("SERVER_DECLARED")) v_ = SERVER_DECLARED_l; - else if (v == ACE_TEXT ("CLIENT_PROPAGATED")) v_ = CLIENT_PROPAGATED_l; + if (v == "SERVER_DECLARED") v_ = SERVER_DECLARED_l; + else if (v == "CLIENT_PROPAGATED") v_ = CLIENT_PROPAGATED_l; else { } @@ -2423,8 +2423,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("SERVER_DECLARED")) v_ = SERVER_DECLARED_l; - else if (v == ACE_TEXT ("CLIENT_PROPAGATED")) v_ = CLIENT_PROPAGATED_l; + if (v == "SERVER_DECLARED") v_ = SERVER_DECLARED_l; + else if (v == "CLIENT_PROPAGATED") v_ = CLIENT_PROPAGATED_l; else { } @@ -2442,8 +2442,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (e.value ()); - if (v == ACE_TEXT ("SERVER_DECLARED_NWPRIORITY")) v_ = SERVER_DECLARED_NWPRIORITY_l; - else if (v == ACE_TEXT ("CLIENT_PROPAGATED_NWPRIORITY")) v_ = CLIENT_PROPAGATED_NWPRIORITY_l; + if (v == "SERVER_DECLARED_NWPRIORITY") v_ = SERVER_DECLARED_NWPRIORITY_l; + else if (v == "CLIENT_PROPAGATED_NWPRIORITY") v_ = CLIENT_PROPAGATED_NWPRIORITY_l; else { } @@ -2455,8 +2455,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > v (a.value ()); - if (v == ACE_TEXT ("SERVER_DECLARED_NWPRIORITY")) v_ = SERVER_DECLARED_NWPRIORITY_l; - else if (v == ACE_TEXT ("CLIENT_PROPAGATED_NWPRIORITY")) v_ = CLIENT_PROPAGATED_NWPRIORITY_l; + if (v == "SERVER_DECLARED_NWPRIORITY") v_ = SERVER_DECLARED_NWPRIORITY_l; + else if (v == "CLIENT_PROPAGATED_NWPRIORITY") v_ = CLIENT_PROPAGATED_NWPRIORITY_l; else { } @@ -2480,7 +2480,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("priority_model")) + if (n == "priority_model") { priority_model_ = ::std::auto_ptr< ::CIAO::Config_Handlers::PriorityModel > (new ::CIAO::Config_Handlers::PriorityModel (e)); priority_model_->container (this); @@ -2495,7 +2495,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("server_priority")) + if (n == "server_priority") { ::XMLSchema::int_ t (a); server_priority (t); @@ -2522,19 +2522,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("nw_priority_model")) + if (n == "nw_priority_model") { nw_priority_model_ = ::std::auto_ptr< ::CIAO::Config_Handlers::NWPriorityModel > (new ::CIAO::Config_Handlers::NWPriorityModel (e)); nw_priority_model_->container (this); } - else if (n == ACE_TEXT ("request_dscp")) + else if (n == "request_dscp") { request_dscp_ = ::std::auto_ptr< ::XMLSchema::long_ > (new ::XMLSchema::long_ (e)); request_dscp_->container (this); } - else if (n == ACE_TEXT ("reply_dscp")) + else if (n == "reply_dscp") { reply_dscp_ = ::std::auto_ptr< ::XMLSchema::long_ > (new ::XMLSchema::long_ (e)); reply_dscp_->container (this); @@ -2561,13 +2561,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("request_dscp")) + if (n == "request_dscp") { request_dscp_ = ::std::auto_ptr< ::XMLSchema::long_ > (new ::XMLSchema::long_ (e)); request_dscp_->container (this); } - else if (n == ACE_TEXT ("reply_dscp")) + else if (n == "reply_dscp") { reply_dscp_ = ::std::auto_ptr< ::XMLSchema::long_ > (new ::XMLSchema::long_ (e)); reply_dscp_->container (this); @@ -2589,7 +2589,7 @@ namespace CIAO ServerResources (xercesc::DOMDocument const* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () == ACE_TEXT ("ServerResources")) + if (e.name () == "ServerResources") { ::CIAO::Config_Handlers::ServerResourcesDef r (e); return r; @@ -4985,7 +4985,7 @@ namespace CIAO void ServerResourcesDef:: cmdline (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("cmdline"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("cmdline", top_ ())); Traversal::ServerResourcesDef::cmdline (o); pop_ (); } @@ -4993,7 +4993,7 @@ namespace CIAO void ServerResourcesDef:: svcconf (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("svcconf"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("svcconf", top_ ())); Traversal::ServerResourcesDef::svcconf (o); pop_ (); } @@ -5001,7 +5001,7 @@ namespace CIAO void ServerResourcesDef:: orbConfigs (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("orbConfigs"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("orbConfigs", top_ ())); Traversal::ServerResourcesDef::orbConfigs (o); pop_ (); } @@ -5009,7 +5009,7 @@ namespace CIAO void ServerResourcesDef:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::ServerResourcesDef::id (o); attr_ (0); @@ -5039,7 +5039,7 @@ namespace CIAO void ServerCmdlineOptions:: arg_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("arg"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("arg", top_ ())); } void ServerCmdlineOptions:: @@ -5079,7 +5079,7 @@ namespace CIAO void ACESvcConf:: uri (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("uri"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("uri", top_ ())); Traversal::ACESvcConf::uri (o); pop_ (); } @@ -5108,7 +5108,7 @@ namespace CIAO void ORBConfigs:: resources (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resources"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resources", top_ ())); Traversal::ORBConfigs::resources (o); pop_ (); } @@ -5116,7 +5116,7 @@ namespace CIAO void ORBConfigs:: policySet_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("policySet"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("policySet", top_ ())); } void ORBConfigs:: @@ -5156,7 +5156,7 @@ namespace CIAO void ORBResources:: threadpool_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("threadpool"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("threadpool", top_ ())); } void ORBResources:: @@ -5175,7 +5175,7 @@ namespace CIAO void ORBResources:: threadpoolWithLanes_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("threadpoolWithLanes"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("threadpoolWithLanes", top_ ())); } void ORBResources:: @@ -5194,7 +5194,7 @@ namespace CIAO void ORBResources:: connectionBands_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connectionBands"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connectionBands", top_ ())); } void ORBResources:: @@ -5234,7 +5234,7 @@ namespace CIAO void ThreadpoolDef:: stacksize (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("stacksize"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("stacksize", top_ ())); Traversal::ThreadpoolDef::stacksize (o); pop_ (); } @@ -5242,7 +5242,7 @@ namespace CIAO void ThreadpoolDef:: static_threads (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("static_threads"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("static_threads", top_ ())); Traversal::ThreadpoolDef::static_threads (o); pop_ (); } @@ -5250,7 +5250,7 @@ namespace CIAO void ThreadpoolDef:: dynamic_threads (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dynamic_threads"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dynamic_threads", top_ ())); Traversal::ThreadpoolDef::dynamic_threads (o); pop_ (); } @@ -5258,7 +5258,7 @@ namespace CIAO void ThreadpoolDef:: default_priority (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("default_priority"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("default_priority", top_ ())); Traversal::ThreadpoolDef::default_priority (o); pop_ (); } @@ -5266,7 +5266,7 @@ namespace CIAO void ThreadpoolDef:: allow_request_buffering (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("allow_request_buffering"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("allow_request_buffering", top_ ())); Traversal::ThreadpoolDef::allow_request_buffering (o); pop_ (); } @@ -5274,7 +5274,7 @@ namespace CIAO void ThreadpoolDef:: max_buffered_requests (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("max_buffered_requests"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("max_buffered_requests", top_ ())); Traversal::ThreadpoolDef::max_buffered_requests (o); pop_ (); } @@ -5282,7 +5282,7 @@ namespace CIAO void ThreadpoolDef:: max_request_buffered_size (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("max_request_buffered_size"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("max_request_buffered_size", top_ ())); Traversal::ThreadpoolDef::max_request_buffered_size (o); pop_ (); } @@ -5290,7 +5290,7 @@ namespace CIAO void ThreadpoolDef:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::ThreadpoolDef::id (o); attr_ (0); @@ -5320,7 +5320,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: threadpoolLane_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("threadpoolLane"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("threadpoolLane", top_ ())); } void ThreadpoolWithLanesDef:: @@ -5339,7 +5339,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: stacksize (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("stacksize"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("stacksize", top_ ())); Traversal::ThreadpoolWithLanesDef::stacksize (o); pop_ (); } @@ -5347,7 +5347,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: allow_borrowing (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("allow_borrowing"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("allow_borrowing", top_ ())); Traversal::ThreadpoolWithLanesDef::allow_borrowing (o); pop_ (); } @@ -5355,7 +5355,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: allow_request_buffering (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("allow_request_buffering"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("allow_request_buffering", top_ ())); Traversal::ThreadpoolWithLanesDef::allow_request_buffering (o); pop_ (); } @@ -5363,7 +5363,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: max_buffered_requests (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("max_buffered_requests"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("max_buffered_requests", top_ ())); Traversal::ThreadpoolWithLanesDef::max_buffered_requests (o); pop_ (); } @@ -5371,7 +5371,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: max_request_buffered_size (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("max_request_buffered_size"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("max_request_buffered_size", top_ ())); Traversal::ThreadpoolWithLanesDef::max_request_buffered_size (o); pop_ (); } @@ -5379,7 +5379,7 @@ namespace CIAO void ThreadpoolWithLanesDef:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::ThreadpoolWithLanesDef::id (o); attr_ (0); @@ -5409,7 +5409,7 @@ namespace CIAO void ThreadpoolLaneDef:: static_threads (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("static_threads"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("static_threads", top_ ())); Traversal::ThreadpoolLaneDef::static_threads (o); pop_ (); } @@ -5417,7 +5417,7 @@ namespace CIAO void ThreadpoolLaneDef:: dynamic_threads (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dynamic_threads"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dynamic_threads", top_ ())); Traversal::ThreadpoolLaneDef::dynamic_threads (o); pop_ (); } @@ -5425,7 +5425,7 @@ namespace CIAO void ThreadpoolLaneDef:: priority (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("priority"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("priority", top_ ())); Traversal::ThreadpoolLaneDef::priority (o); pop_ (); } @@ -5454,7 +5454,7 @@ namespace CIAO void ConnectionBandsDef:: band_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("band"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("band", top_ ())); } void ConnectionBandsDef:: @@ -5473,7 +5473,7 @@ namespace CIAO void ConnectionBandsDef:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::ConnectionBandsDef::id (o); attr_ (0); @@ -5503,7 +5503,7 @@ namespace CIAO void PriorityBandDef:: low (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("low"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("low", top_ ())); Traversal::PriorityBandDef::low (o); pop_ (); } @@ -5511,7 +5511,7 @@ namespace CIAO void PriorityBandDef:: high (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("high"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("high", top_ ())); Traversal::PriorityBandDef::high (o); pop_ (); } @@ -5540,7 +5540,7 @@ namespace CIAO void PolicySet:: priorityModel_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("priorityModel"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("priorityModel", top_ ())); } void PolicySet:: @@ -5559,7 +5559,7 @@ namespace CIAO void PolicySet:: nwpriorityModel_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("nwpriorityModel"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("nwpriorityModel", top_ ())); } void PolicySet:: @@ -5578,7 +5578,7 @@ namespace CIAO void PolicySet:: cnwpriorityModel_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("cnwpriorityModel"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("cnwpriorityModel", top_ ())); } void PolicySet:: @@ -5597,7 +5597,7 @@ namespace CIAO void PolicySet:: threadpool_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("threadpool"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("threadpool", top_ ())); } void PolicySet:: @@ -5616,7 +5616,7 @@ namespace CIAO void PolicySet:: priorityBandedConnection_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("priorityBandedConnection"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("priorityBandedConnection", top_ ())); } void PolicySet:: @@ -5635,7 +5635,7 @@ namespace CIAO void PolicySet:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::PolicySet::id (o); attr_ (0); @@ -5661,8 +5661,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::PriorityModel::SERVER_DECLARED) s = ACE_TEXT ("SERVER_DECLARED"); - else if (o == ::CIAO::Config_Handlers::PriorityModel::CLIENT_PROPAGATED) s = ACE_TEXT ("CLIENT_PROPAGATED"); + if (o == ::CIAO::Config_Handlers::PriorityModel::SERVER_DECLARED) s = "SERVER_DECLARED"; + else if (o == ::CIAO::Config_Handlers::PriorityModel::CLIENT_PROPAGATED) s = "CLIENT_PROPAGATED"; else { } @@ -5698,8 +5698,8 @@ namespace CIAO { ::std::basic_string< ACE_TCHAR > s; - if (o == ::CIAO::Config_Handlers::NWPriorityModel::SERVER_DECLARED_NWPRIORITY) s = ACE_TEXT ("SERVER_DECLARED_NWPRIORITY"); - else if (o == ::CIAO::Config_Handlers::NWPriorityModel::CLIENT_PROPAGATED_NWPRIORITY) s = ACE_TEXT ("CLIENT_PROPAGATED_NWPRIORITY"); + if (o == ::CIAO::Config_Handlers::NWPriorityModel::SERVER_DECLARED_NWPRIORITY) s = "SERVER_DECLARED_NWPRIORITY"; + else if (o == ::CIAO::Config_Handlers::NWPriorityModel::CLIENT_PROPAGATED_NWPRIORITY) s = "CLIENT_PROPAGATED_NWPRIORITY"; else { } @@ -5739,7 +5739,7 @@ namespace CIAO void PriorityModelPolicyDef:: priority_model (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("priority_model"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("priority_model", top_ ())); Traversal::PriorityModelPolicyDef::priority_model (o); pop_ (); } @@ -5747,7 +5747,7 @@ namespace CIAO void PriorityModelPolicyDef:: server_priority (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("server_priority"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("server_priority", "", top_ ()); attr_ (&a); Traversal::PriorityModelPolicyDef::server_priority (o); attr_ (0); @@ -5777,7 +5777,7 @@ namespace CIAO void NWPriorityModelPolicyDef:: nw_priority_model (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("nw_priority_model"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("nw_priority_model", top_ ())); Traversal::NWPriorityModelPolicyDef::nw_priority_model (o); pop_ (); } @@ -5785,7 +5785,7 @@ namespace CIAO void NWPriorityModelPolicyDef:: request_dscp (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("request_dscp"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("request_dscp", top_ ())); Traversal::NWPriorityModelPolicyDef::request_dscp (o); pop_ (); } @@ -5793,7 +5793,7 @@ namespace CIAO void NWPriorityModelPolicyDef:: reply_dscp (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("reply_dscp"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("reply_dscp", top_ ())); Traversal::NWPriorityModelPolicyDef::reply_dscp (o); pop_ (); } @@ -5822,7 +5822,7 @@ namespace CIAO void CNWPriorityModelPolicyDef:: request_dscp (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("request_dscp"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("request_dscp", top_ ())); Traversal::CNWPriorityModelPolicyDef::request_dscp (o); pop_ (); } @@ -5830,7 +5830,7 @@ namespace CIAO void CNWPriorityModelPolicyDef:: reply_dscp (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("reply_dscp"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("reply_dscp", top_ ())); Traversal::CNWPriorityModelPolicyDef::reply_dscp (o); pop_ (); } @@ -5846,7 +5846,7 @@ namespace CIAO ServerResources (::CIAO::Config_Handlers::ServerResourcesDef const& s, xercesc::DOMDocument* d) { ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); - if (e.name () != ACE_TEXT ("ServerResources")) + if (e.name () != "ServerResources") { throw 1; } diff --git a/CIAO/tools/Config_Handlers/RT-CCM/CLA_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/CLA_Handler.cpp index 510b3f5c755..39e2d72bbbf 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/CLA_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/CLA_Handler.cpp @@ -20,7 +20,7 @@ namespace CIAO dest.length(len+1); - dest[len] = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (loc->c_str ())); + dest[len] = CORBA::string_dup (loc->c_str ()); } return true; @@ -35,7 +35,7 @@ namespace CIAO i < src.length (); ++i) { - co.add_arg (ACE_TEXT_CHAR_TO_TCHAR (src[i].in ())); + co.add_arg (src[i].in ()); } return co; diff --git a/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp index 2d13dc42d1c..16a2f71f40a 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp @@ -15,7 +15,7 @@ namespace CIAO ::CIAO::DAnCE::PolicySet &dest) { if (src.id_p ()) - dest.Id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (src.id ().c_str ())); + dest.Id = CORBA::string_dup (src.id ().c_str ()); // Make room for all of the policies CORBA::ULong len (dest.policies.length ()); @@ -67,7 +67,7 @@ namespace CIAO { ::CIAO::DAnCE::ThreadpoolPolicyDef tpd; - tpd.Id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->id ().c_str ())); + tpd.Id = CORBA::string_dup (i->id ().c_str ()); dest.policies[len++].ThreadpoolDef (tpd); } @@ -79,7 +79,7 @@ namespace CIAO { ::CIAO::DAnCE::PriorityBandedConnectionPolicyDef pbc; - pbc.Id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (i->id ().c_str ())); + pbc.Id = CORBA::string_dup (i->id ().c_str ()); dest.policies[len++].PriorityBandedConnectionDef (pbc); } @@ -92,7 +92,7 @@ namespace CIAO PolicySet ps; if (src.Id.in ()) - ps.id (ACE_TEXT_CHAR_TO_TCHAR (src.Id.in ())); + ps.id (src.Id.in ()); for (CORBA::ULong i = 0; i < src.policies.length (); @@ -123,12 +123,12 @@ namespace CIAO break; case ::CIAO::DAnCE::THREADPOOL_POLICY_TYPE: - ps.add_threadpool (ACE_TEXT_CHAR_TO_TCHAR (src.policies[i].ThreadpoolDef ().Id.in ())); + ps.add_threadpool (src.policies[i].ThreadpoolDef ().Id.in ()); break; case ::CIAO::DAnCE::PRIORITY_BANDED_CONNECTION_POLICY_TYPE: ps.add_priorityBandedConnection ( - ACE_TEXT_CHAR_TO_TCHAR (src.policies[i].PriorityBandedConnectionDef ().Id.in ())); + src.policies[i].PriorityBandedConnectionDef ().Id.in ()); break; case 0: diff --git a/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc b/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc index e39be8550a8..eb95e0788d5 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc +++ b/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc @@ -1,7 +1,7 @@ //$Id$ project (RT_CCM_XML_Generation) : xscdefaults { - requires += xsc + requires += xsc dummy_label xscflags += --cxx-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.cpp xscflags += --cxx-header-banner-file $(CIAO_ROOT)/docs/schema/xsc-banner.h @@ -9,7 +9,7 @@ project (RT_CCM_XML_Generation) : xscdefaults { xscflags += --cxx-namespace-regex <%quote%>%.*vanderbilt.*%CIAO/Config_Handlers%<%quote%> xscflags += --cxx-export-header RT_CCM_Handlers_Export.h xscflags += --search-path "$(CIAO_ROOT)/docs/schema" - + custom_only = 1 XSC_Files { @@ -18,7 +18,7 @@ project (RT_CCM_XML_Generation) : xscdefaults { } } -project (RT_CCM_Config_Handlers) : acelib, ace_output, ciao_deployment_stub, ciao_config_handlers_base { +project (RT_CCM_Config_Handlers) : acelib, dance_deployment_stub, ciao_config_handlers_base { sharedname = RT_CCM_Config_Handlers dynamicflags = RT_CCM_HANDLERS_BUILD_DLL macros += XML_USE_PTHREADS @@ -26,6 +26,8 @@ project (RT_CCM_Config_Handlers) : acelib, ace_output, ciao_deployment_stub, cia includes += $(CIAO_ROOT)/ciao after += RT_CCM_XML_Generation + + requires += dummy_label Source_Files { CIAOServerResources.cpp @@ -46,7 +48,7 @@ project (RT_CCM_Config_Handlers) : acelib, ace_output, ciao_deployment_stub, cia } } -//project (RT-CCM_Config_Handlers_Tests) : ciao_component_dnc, xerces { +//project (RT-CCM_Config_Handlers_Tests) : ciao_executor, xerces { // requires += dummy_label // exename = rt-ccm-test // after += RT-CCM-Handlers diff --git a/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h b/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h index 8a969d10f7d..fdba117ae61 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h +++ b/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_Handlers_Export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (RT_CCM_HANDLERS_HAS_DLL) -# define RT_CCM_HANDLERS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && RT_CCM_HANDLERS_HAS_DLL */ - #if !defined (RT_CCM_HANDLERS_HAS_DLL) # define RT_CCM_HANDLERS_HAS_DLL 1 #endif /* ! RT_CCM_HANDLERS_HAS_DLL */ diff --git a/CIAO/tools/Config_Handlers/RT-CCM/SRD_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/SRD_Handler.cpp index 89f3d7d5ee7..17ce790182e 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/SRD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/SRD_Handler.cpp @@ -1,5 +1,5 @@ // $Id$ -#include "Utils/XML_Helper.h" +#include "Utils/XML_Typedefs.h" #include "SRD_Handler.h" #include "CIAOServerResources.hpp" #include "CLA_Handler.h" @@ -14,10 +14,8 @@ namespace CIAO srd_ (0), retval_ (false) { - XML_Helper helper; - XERCES_CPP_NAMESPACE::DOMDocument *dom = - helper.create_dom (file); + XML_HELPER.create_dom (file); if (!dom) throw SRD_Handler::NoSRD (); @@ -64,7 +62,7 @@ namespace CIAO if(this->srd_->svcconf_p()) { - this->idl_srd_->svcconf = ACE_TEXT_ALWAYS_CHAR (srd_->svcconf().uri().c_str()); + this->idl_srd_->svcconf = (srd_->svcconf().uri().c_str()); } this->retval_ = OC_Handler::orb_config (this->srd_->orbConfigs (), @@ -72,7 +70,7 @@ namespace CIAO if (this->srd_->id_p ()) { - this->idl_srd_->Id = ACE_TEXT_ALWAYS_CHAR (srd_->id ().c_str ()); + this->idl_srd_->Id = srd_->id ().c_str (); } return this->retval_; @@ -96,18 +94,18 @@ namespace CIAO len = idl_srd_->args.length(); for(size_t i = 0; i < len; i++) { - XMLSchema::string < ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (this->idl_srd_->args[i])); + XMLSchema::string < ACE_TCHAR > curr ((this->idl_srd_->args[i])); sco.add_arg(curr); } this->srd_->cmdline (sco); //Then a similar thing for the svcconf - XMLSchema::string < ACE_TCHAR > curr (ACE_TEXT_CHAR_TO_TCHAR (this->idl_srd_->svcconf.in ())); + XMLSchema::string < ACE_TCHAR > curr (this->idl_srd_->svcconf); ACESvcConf asc; asc.uri(curr); this->srd_->svcconf (asc); - XMLSchema::string < ACE_TCHAR > id (ACE_TEXT_CHAR_TO_TCHAR (this->idl_srd_->Id.in ())); + XMLSchema::string < ACE_TCHAR > id (this->idl_srd_->Id.in ()); this->srd_->id (id); return true; @@ -154,3 +152,5 @@ namespace CIAO } } } + + diff --git a/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.cpp index 5f78fc91e00..4d65478d19c 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.cpp @@ -14,7 +14,7 @@ namespace CIAO { if (src.id_p ()) { - dest.Id = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (src.id().c_str ())); + dest.Id = CORBA::string_dup (src.id().c_str ()); } for (ThreadpoolWithLanesDef::threadpoolLane_const_iterator loc = @@ -62,7 +62,7 @@ namespace CIAO ); //XMLSchema::ID <ACE_TCHAR> id = ((src.Id)); - tpl.id (ACE_TEXT_CHAR_TO_TCHAR (src.Id.in ())); + tpl.id (src.Id.in ()); size_t len = src.threadpool_lanes.length (); for (size_t i = 0; i < len; i++) diff --git a/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.h b/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.h index 9b8a4508213..6d1b3b72e98 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.h +++ b/CIAO/tools/Config_Handlers/RT-CCM/TPL_Handler.h @@ -20,8 +20,8 @@ namespace CIAO { - namespace Config_Handlers - { + namespace Config_Handlers + { class ThreadpoolWithLanesDef; /* @@ -33,14 +33,14 @@ namespace CIAO { public: - static bool threadpool_with_lanes ( + static bool threadpool_with_lanes ( const ThreadpoolWithLanesDef &src, ::CIAO::DAnCE::ORS_ThreadpoolWithLanes &dest); - static ThreadpoolWithLanesDef threadpool_with_lanes ( + static ThreadpoolWithLanesDef threadpool_with_lanes ( const ::CIAO::DAnCE::ORS_ThreadpoolWithLanes &src); }; - } + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/RT-CCM/TP_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/TP_Handler.cpp index fd2316a17d0..3def524a0bb 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/TP_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/TP_Handler.cpp @@ -10,7 +10,7 @@ namespace CIAO bool TP_Handler::thread_pool (const ThreadpoolDef &src, ::CIAO::DAnCE::ORS_Threadpool &dest) { - dest.Id = CORBA::String_var (ACE_TEXT_ALWAYS_CHAR (src.id ().c_str ())); + dest.Id = CORBA::String_var (src.id ().c_str ()); dest.stacksize = static_cast <ACE_UINT32> (src.stacksize ()); @@ -48,7 +48,7 @@ namespace CIAO if (src.Id.in () == 0) { - tp.id (ACE_TEXT_CHAR_TO_TCHAR (src.Id.in ())); + tp.id (src.Id.in ()); } return tp; diff --git a/CIAO/tools/Config_Handlers/RT-CCM/test.cpp b/CIAO/tools/Config_Handlers/RT-CCM/test.cpp index 3ec97cab2ab..0476fddd6cc 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/test.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/test.cpp @@ -7,16 +7,16 @@ #include "ciao/ServerResourcesC.h" #include "ace/Get_Opt.h" -#include "XML_Helper.h" +#include "Utils/XML_Typedefs.h" #include "tao/ORB.h" -static const ACE_TCHAR *input_file = ACE_TEXT ("BasicSP.cdp"); +static const char *input_file = "BasicSP.cdp"; static int -parse_args (int argc, ACE_TCHAR *argv[]) +parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("i:")); + ACE_Get_Opt get_opts (argc, argv, "i:"); int c; @@ -53,7 +53,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) //Create an XML_Helper for all the file work XML_Helper the_helper; - if (xercesc::DOMDocument *doc = the_helper.create_dom (ACE_TEXT_ALWAYS_CHAR (input_file))) + if (xercesc::DOMDocument *doc = the_helper.create_dom (input_file)) { //Read in the XSC type structure from the DOMDocument ServerResourcesDef srd = ServerResources (doc); @@ -79,7 +79,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ServerResources (*reverse_handler.srd_xsc (), the_xsc); // write out the result - the_helper.write_DOM (the_xsc, ACE_TEXT ("output.srd")); + the_helper.write_DOM (the_xsc, "output.srd"); } std::cout << "Test completed!"; diff --git a/CIAO/tools/Config_Handlers/Req_Handler.cpp b/CIAO/tools/Config_Handlers/Req_Handler.cpp index 5d9092a2903..f8bb5b90fec 100644 --- a/CIAO/tools/Config_Handlers/Req_Handler.cpp +++ b/CIAO/tools/Config_Handlers/Req_Handler.cpp @@ -19,15 +19,14 @@ namespace CIAO void Req_Handler::handle_requirement (const Requirement& desc, - Deployment::Requirement& toconfig) + Deployment::Requirement& toconfig) { CIAO_TRACE("Req_Handler::get_Requirement"); //Map the basic string types to their Deployment::Req //counterparts. - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); - toconfig.resourceType = - ACE_TEXT_ALWAYS_CHAR (desc.resourceType ().c_str ()); + toconfig.name = desc.name ().c_str (); + toconfig.resourceType = desc.resourceType ().c_str (); toconfig.property.length (desc.count_property ()); std::for_each (desc.begin_property (), @@ -45,9 +44,7 @@ namespace CIAO XMLSchema::string< char > res ((src.resourceType)); //Instantiate the Requirement - Requirement req ( - ACE_TEXT_CHAR_TO_TCHAR (name.c_str ()), - ACE_TEXT_CHAR_TO_TCHAR (res.c_str ())); + Requirement req (name,res); for (CORBA::ULong i = 0; i < src.property.length (); ++i) { diff --git a/CIAO/tools/Config_Handlers/Req_Handler.h b/CIAO/tools/Config_Handlers/Req_Handler.h index 3119df4b798..3955b85a55f 100644 --- a/CIAO/tools/Config_Handlers/Req_Handler.h +++ b/CIAO/tools/Config_Handlers/Req_Handler.h @@ -28,21 +28,24 @@ namespace Deployment namespace CIAO { + namespace Config_Handlers - { - /* - * @class REQ_Handler - * - * @brief Handler class for <Requirement> types. - * - * This class defines handler methods to map values from - * XSC Requirement objects, parsed from - * the descriptor files, to the corresponding CORBA IDL type. - */ + { + /* + * @class REQ_Handler + * + * @brief Handler class for <Requirement> types. + * + * This class defines handler methods to map values from + * XSC Requirement objects, parsed from + * the descriptor files, to the corresponding CORBA IDL type. + * + */ - class Config_Handlers_Common_Export Req_Handler + class Config_Handlers_Common_Export Req_Handler { public: + Req_Handler (void); virtual ~Req_Handler (void); @@ -50,16 +53,18 @@ namespace CIAO ///and maps the values from the passed in XSC ///Requirement to its members. static void handle_requirement (const Requirement& desc, - Deployment::Requirement& toconfig); - static Requirement get_requirement (const Deployment::Requirement& src); + Deployment::Requirement& toconfig); + static Requirement + get_requirement (const Deployment::Requirement& src); }; - typedef Sequence_Handler < Requirement, - ::Deployment::Requirements, - ::Deployment::Requirement, - Req_Handler::handle_requirement > - Requirement_Functor; - } + typedef Sequence_Handler < Requirement, + ::Deployment::Requirements, + ::Deployment::Requirement, + Req_Handler::handle_requirement > Requirement_Functor; + + + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/STD_CID_Handler.cpp b/CIAO/tools/Config_Handlers/STD_CID_Handler.cpp index d9c9a01e119..d0bd4e92904 100644 --- a/CIAO/tools/Config_Handlers/STD_CID_Handler.cpp +++ b/CIAO/tools/Config_Handlers/STD_CID_Handler.cpp @@ -48,9 +48,9 @@ namespace CIAO if ((*iter).id_p ()) { ACE_CString cstr ((*iter).id ().c_str ()); - - STD_CID_Handler::IDREF.bind_ref (cstr,len); - } + + STD_CID_Handler::IDREF.bind_ref (cstr,len); + } if (!this->xml_helper_->is_initialized ()) return false; @@ -103,8 +103,8 @@ namespace CIAO (*ep_iter).portName ().c_str (); CORBA::ULong tmp = 0; - STD_CID_Handler::IDREF.find_ref ( - ACE_CString ((((*ep_iter).instance ()).id ()).c_str ()), tmp); + STD_CID_Handler::IDREF.find_ref (ACE_CString ((((*ep_iter).instance ()).id ()).c_str ()), + tmp); CORBA::ULong ref = tmp; idl_cad.connection[conn_len].internalEndpoint [endp_len].instanceRef = ref; } diff --git a/CIAO/tools/Config_Handlers/STD_CID_Handler.h b/CIAO/tools/Config_Handlers/STD_CID_Handler.h index 475c1c1b471..c875d05edba 100644 --- a/CIAO/tools/Config_Handlers/STD_CID_Handler.h +++ b/CIAO/tools/Config_Handlers/STD_CID_Handler.h @@ -13,7 +13,6 @@ #include /**/ "ace/pre.h" -#include "Utils/XML_Helper.h" #include "IDREF_Base.h" #include "Config_Handlers_Export.h" #include "DAnCE/Deployment/DeploymentC.h" @@ -44,8 +43,7 @@ namespace CIAO public: - STD_CID_Handler (XML_Helper *xml_helper) - :xml_helper_ (xml_helper) + STD_CID_Handler (void) { } @@ -69,8 +67,6 @@ namespace CIAO :xml_helper_ (0) { } - - XML_Helper *xml_helper_; }; } } diff --git a/CIAO/tools/Config_Handlers/STD_CPD_Handler.cpp b/CIAO/tools/Config_Handlers/STD_CPD_Handler.cpp index 1ad0d109fa5..c9fa40f0258 100644 --- a/CIAO/tools/Config_Handlers/STD_CPD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/STD_CPD_Handler.cpp @@ -4,6 +4,7 @@ #include "Basic_Deployment_Data.hpp" #include "DAnCE/Deployment/Deployment_DataC.h" #include "Deployment.hpp" +#include "Utils/XML_Typedefs.h" namespace CIAO { @@ -25,13 +26,14 @@ namespace CIAO idl_pci.name = pci.name ().c_str (); - if (!this->xml_helper_->is_initialized ()) + if (XML_Helper::XML_HELPER.is_initialized ()) return false; // parse the .cid (ComponentImplementationDescription) file // that <referencedImplementation> links to xercesc::DOMDocument* dom = - this->xml_helper_->create_dom ((pci.referencedImplementation ()).href ().c_str ()); // here location indicates .pcd file + XML_Helper::XML_HELPER.create_dom + ((pci.referencedImplementation ()).href ().c_str ()); // here location indicates .pcd file if (!dom) return false; @@ -41,7 +43,7 @@ namespace CIAO Deployment::ComponentImplementationDescription idl_cid; - STD_CID_Handler cid_handler (this->xml_helper_); + STD_CID_Handler cid_handler; cid_handler.component_impl_descr (cid, idl_cid); diff --git a/CIAO/tools/Config_Handlers/STD_PCD_Handler.cpp b/CIAO/tools/Config_Handlers/STD_PCD_Handler.cpp index 6bef6636238..5a65826f340 100644 --- a/CIAO/tools/Config_Handlers/STD_PCD_Handler.cpp +++ b/CIAO/tools/Config_Handlers/STD_PCD_Handler.cpp @@ -22,13 +22,13 @@ namespace CIAO toconfig.UUID = desc.UUID ().c_str (); - if (!this->xml_helper_->is_initialized ()) + if (!XML_Helper::XML_HELPER.is_initialized ()) return false; // parse the .cpd (ComponentPackageDescription) file // that <basePackage> links to xercesc::DOMDocument* dom = - this->xml_helper_->create_dom ((desc.basePackage()).href ().c_str ()); + XML_Helper::XML_HELPER.create_dom ((desc.basePackage()).href ().c_str ()); if (!dom) return false; @@ -38,7 +38,7 @@ namespace CIAO Deployment::ComponentPackageDescription idl_cpc; - STD_CPD_Handler cpd_handler (this->xml_helper_); + STD_CPD_Handler cpd_handler; cpd_handler.component_package_descr (cpc, idl_cpc); diff --git a/CIAO/tools/Config_Handlers/STD_PCD_Handler.h b/CIAO/tools/Config_Handlers/STD_PCD_Handler.h index ba53f6736da..8c65f6eb6f3 100644 --- a/CIAO/tools/Config_Handlers/STD_PCD_Handler.h +++ b/CIAO/tools/Config_Handlers/STD_PCD_Handler.h @@ -12,7 +12,6 @@ #define CIAO_CONFIG_HANDLERS_STD_PCD_HANDLER_H #include /**/ "ace/pre.h" -#include "Utils/XML_Helper.h" #include "Config_Handlers_Export.h" @@ -45,8 +44,7 @@ namespace CIAO { public: - STD_PCD_Handler (XML_Helper *xml_helper) - :xml_helper_ (xml_helper) + STD_PCD_Handler () { } @@ -65,11 +63,9 @@ namespace CIAO private: // Disable the default constructor STD_PCD_Handler () - :xml_helper_ (0) { } - XML_Helper *xml_helper_; }; } } diff --git a/CIAO/tools/Config_Handlers/STD_PC_Intf.cpp b/CIAO/tools/Config_Handlers/STD_PC_Intf.cpp index e265295d040..2dfb6a63366 100644 --- a/CIAO/tools/Config_Handlers/STD_PC_Intf.cpp +++ b/CIAO/tools/Config_Handlers/STD_PC_Intf.cpp @@ -1,7 +1,7 @@ // $Id$ #include "STD_PC_Intf.h" -#include "Utils/XML_Helper.h" +#include "Utils/XML_Typedefs.h" #include "Deployment.hpp" #include "STD_PCD_Handler.h" #include "ciao/Packaging_DataC.h" @@ -22,14 +22,10 @@ namespace CIAO { CIAO_TRACE("STD_PC_Intf::prepare_PC"); - ACE_Auto_Ptr<XML_Helper> helper (new XML_Helper); - - if (!helper->is_initialized ()) - return false; // parse the .pcd (PackageConfigurationDescription) file xercesc::DOMDocument *dom = - helper->create_dom (file); + XML_Helper::XML_HELPER.create_dom (file); if (!dom) return false; @@ -42,7 +38,7 @@ namespace CIAO Deployment::PackageConfiguration idl_pc; - STD_PCD_Handler pcd_handler (helper.get ()); + STD_PCD_Handler pcd_handler; pcd_handler.package_config (pc, idl_pc); diff --git a/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.cpp b/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.cpp index e42ae7a6a49..ded23404689 100644 --- a/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.cpp +++ b/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.cpp @@ -25,8 +25,8 @@ namespace CIAO Deployment::SatisfierProperty& toconfig) { CIAO_TRACE("SatisfierProperty_Handler::get_sat_property"); - - toconfig.name = ACE_TEXT_ALWAYS_CHAR (desc.name ().c_str ()); + + toconfig.name = desc.name ().c_str (); switch (desc.kind ().integral ()) { @@ -56,14 +56,22 @@ namespace CIAO default: ACE_ERROR ((LM_ERROR, "Unknown SatisfierPropertyKind\n")); - throw 1; + throw Config_Error (desc.name (), "Unknown SatisfierPropertyKind"); } toconfig.dynamic = desc.dynamic (); - - Any_Handler::extract_into_any (desc.value (), - toconfig.value); + + try + { + Any_Handler::extract_into_any (desc.value (), + toconfig.value); + } + catch (Config_Error &ex) + { + ex.name_ = desc.name (); + throw ex; + } } SatisfierProperty @@ -72,7 +80,7 @@ namespace CIAO { CIAO_TRACE("SatisfierProperty_Handler::get_sat_property - reverse"); - ::XMLSchema::string< ACE_TCHAR > name (ACE_TEXT_CHAR_TO_TCHAR (src.name.in ())); + ::XMLSchema::string< ACE_TCHAR > name ((src.name)); SatisfierPropertyKind::Value kind; const SatisfierPropertyKind *spk = 0; diff --git a/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.h b/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.h index 2ffe9a412c2..e166b341d9f 100644 --- a/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.h +++ b/CIAO/tools/Config_Handlers/SatisfierProperty_Handler.h @@ -29,20 +29,21 @@ namespace Deployment namespace CIAO { namespace Config_Handlers - { - class SatisfierProperty; + { + class SatisfierProperty; - /* - * @class SatisfierProperty_Handler - * - * @brief Handler class for <CCMComponentPortDescription> types. - * - * This class defines handler methods to map values from - * XSC objects, parsed from the descriptor files, to the - * corresponding CORBA IDL type for the schema element. - */ + /* + * @class SatisfierProperty_Handler + * + * @brief Handler class for <CCMComponentPortDescription> types. + * + * This class defines handler methods to map values from + * XSC objects, parsed from the descriptor files, to the + * corresponding CORBA IDL type for the schema element. + * + */ - class Config_Handlers_Common_Export SatisfierProperty_Handler + class Config_Handlers_Common_Export SatisfierProperty_Handler { public: SatisfierProperty_Handler (void); @@ -52,17 +53,16 @@ namespace CIAO /// <CIAO::Config_Handlers::SatisfierProperty> to the CORBA IDL type /// <Deployment::SatisfierProperty>. static void handle_sat_property (const SatisfierProperty& desc, - ::Deployment::SatisfierProperty& toconfig); - static SatisfierProperty get_sat_property ( - const ::Deployment::SatisfierProperty& src); + ::Deployment::SatisfierProperty& toconfig); + static SatisfierProperty get_sat_property (const ::Deployment::SatisfierProperty& src); }; - typedef Sequence_Handler < SatisfierProperty, - ::Deployment::SatisfierProperties, - ::Deployment::SatisfierProperty, - SatisfierProperty_Handler::handle_sat_property> - SatisfierProperty_Functor; - } + typedef Sequence_Handler < SatisfierProperty, + ::Deployment::SatisfierProperties, + ::Deployment::SatisfierProperty, + SatisfierProperty_Handler::handle_sat_property> SatisfierProperty_Functor; + + } } #include /**/ "ace/post.h" diff --git a/CIAO/tools/Config_Handlers/Utils/CIAO_XML_Utils_Export.h b/CIAO/tools/Config_Handlers/Utils/CIAO_XML_Utils_Export.h deleted file mode 100644 index b322da0a591..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/CIAO_XML_Utils_Export.h +++ /dev/null @@ -1,58 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl CIAO_XML_Utils -// ------------------------------ -#ifndef CIAO_XML_UTILS_EXPORT_H -#define CIAO_XML_UTILS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (CIAO_XML_UTILS_HAS_DLL) -# define CIAO_XML_UTILS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && CIAO_XML_UTILS_HAS_DLL */ - -#if !defined (CIAO_XML_UTILS_HAS_DLL) -# define CIAO_XML_UTILS_HAS_DLL 1 -#endif /* ! CIAO_XML_UTILS_HAS_DLL */ - -#if defined (CIAO_XML_UTILS_HAS_DLL) && (CIAO_XML_UTILS_HAS_DLL == 1) -# if defined (CIAO_XML_UTILS_BUILD_DLL) -# define CIAO_XML_Utils_Export ACE_Proper_Export_Flag -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CIAO_XML_UTILS_BUILD_DLL */ -# define CIAO_XML_Utils_Export ACE_Proper_Import_Flag -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CIAO_XML_UTILS_BUILD_DLL */ -#else /* CIAO_XML_UTILS_HAS_DLL == 1 */ -# define CIAO_XML_Utils_Export -# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) -# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CIAO_XML_UTILS_HAS_DLL == 1 */ - -// Set CIAO_XML_UTILS_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (CIAO_XML_UTILS_NTRACE) -# if (ACE_NTRACE == 1) -# define CIAO_XML_UTILS_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define CIAO_XML_UTILS_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !CIAO_XML_UTILS_NTRACE */ - -#if (CIAO_XML_UTILS_NTRACE == 1) -# define CIAO_XML_UTILS_TRACE(X) -#else /* (CIAO_XML_UTILS_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define CIAO_XML_UTILS_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (CIAO_XML_UTILS_NTRACE == 1) */ - -#endif /* CIAO_XML_UTILS_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/tools/Config_Handlers/Utils/Functors.h b/CIAO/tools/Config_Handlers/Utils/Functors.h index f07c0573783..c72478311a9 100644 --- a/CIAO/tools/Config_Handlers/Utils/Functors.h +++ b/CIAO/tools/Config_Handlers/Utils/Functors.h @@ -53,7 +53,7 @@ namespace CIAO * X: First argument to the function * Y: Second argument to the function */ -#define SEQ_HAND_GCC_BUG_WORKAROUND(W, X, Y) \ +#define SEQ_HAND_GCC_BUG_WORKAROUND(W, X, Y) \ while(0) { \ W (*X, Y[0]); \ } @@ -70,7 +70,7 @@ namespace CIAO void operator() (const ::XMLSchema::string<ACE_TCHAR> &src) { - dest_[pos_++] = ACE_TEXT_ALWAYS_CHAR (src.c_str ()); + dest_[pos_++] = src.c_str (); } private: diff --git a/CIAO/tools/Config_Handlers/Utils/Utils.mpc b/CIAO/tools/Config_Handlers/Utils/Utils.mpc deleted file mode 100644 index e22cf138130..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/Utils.mpc +++ /dev/null @@ -1,15 +0,0 @@ -// $Id$ - -project (CIAO_XML_Utils) : acelib, ace_output, xerces { - includes += $(CIAO_ROOT)/tools/Config_Handlers - sharedname += CIAO_XML_Utils - dynamicflags = CIAO_XML_UTILS_BUILD_DLL - macros += XML_USE_PTHREADS - - Source_Files { - XML_Schema_Resolver.cpp - XML_Error_Handler.cpp - XML_Helper.cpp - XercesString.cpp - } -} diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.cpp b/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.cpp deleted file mode 100644 index beae7bce56c..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#include "XML_Error_Handler.h" -#include "ace/Log_Msg.h" -#include "ace/Auto_Ptr.h" -#include <xercesc/util/XMLString.hpp> -#include <xercesc/dom/DOMLocator.hpp> -#include "XercesString.h" - -using xercesc::XMLString; - -namespace CIAO -{ - namespace Config_Handlers - { - XML_Error_Handler::XML_Error_Handler (void) - : errors_ (false) - { - } - - XML_Error_Handler::~XML_Error_Handler() - { - } - - - bool - XML_Error_Handler::handleError (const DOMError& domError) - { - this->errors_ = true; - - if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Warning ")); - else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Error ")); - else - ACE_DEBUG ((LM_DEBUG, - "(%P|%t), Fatal Error ")); - char *msg = - XMLString::transcode (domError.getMessage ()); - - ACE_Auto_Basic_Array_Ptr<char> cleanup_msg (msg); - - char *file = - XMLString::transcode (domError.getLocation ()->getURI ()); - - ACE_Auto_Basic_Array_Ptr<char> cleanup_file (file); - - ACE_DEBUG ((LM_DEBUG, - "%s at line %d and column %d in file %s\n", - msg, - domError.getLocation ()->getLineNumber (), - domError.getLocation ()->getColumnNumber (), - file)); - - return true; - } - - void - XML_Error_Handler::resetErrors (void) - { - this->errors_ = false; - } - - bool - XML_Error_Handler::getErrors (void) const - { - return this->errors_; - } - } -} diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.h b/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.h deleted file mode 100644 index 155a6e22629..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Error_Handler.h +++ /dev/null @@ -1,65 +0,0 @@ -//============================================================== -/** - * @file XML_Error_Handler.h - * - * $Id$ - * - * @brief Error handler for Xerces - * - * @author Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//================================================================ -#ifndef CIAO_CONFIG_HANLDERS_ERROR_HANDLER_H -#define CIAO_CONFIG_HANLDERS_ERROR_HANDLER_H - -#include /**/ "ace/pre.h" - -#include "CIAO_XML_Utils_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include <xercesc/dom/DOMErrorHandler.hpp> - -using xercesc::DOMErrorHandler; -using xercesc::DOMError; - -namespace CIAO -{ - namespace Config_Handlers - { - /** - * @class XML_Error_Hander - * - * @brief Error handler for XERCES - * - */ - class CIAO_XML_Utils_Export XML_Error_Handler - : public DOMErrorHandler - { - public: - - XML_Error_Handler (void); - - ~XML_Error_Handler (void); - - bool handleError (const DOMError& domError); - - void resetErrors (void); - - bool getErrors(void) const; - - private : - // Disallow copying - XML_Error_Handler (const XML_Error_Handler&); - XML_Error_Handler& operator= (const XML_Error_Handler&); - - bool errors_; - }; - } -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONFIG_HANLDERS_ERROR_HANDLER_H*/ diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Helper.cpp b/CIAO/tools/Config_Handlers/Utils/XML_Helper.cpp deleted file mode 100644 index 3359cef0869..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Helper.cpp +++ /dev/null @@ -1,10 +0,0 @@ -//$Id$ -#include "XML_Helper.h" - -// This file is needed only for proper instantiation of -// XML_Helper_Singleton in a dll. - -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton<CIAO::Config_Handlers::XML_Helper, ACE_Null_Mutex> * -ACE_Singleton<CIAO::Config_Handlers::XML_Helper, ACE_Null_Mutex>::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Helper.h b/CIAO/tools/Config_Handlers/Utils/XML_Helper.h deleted file mode 100644 index 036c6eb713a..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Helper.h +++ /dev/null @@ -1,118 +0,0 @@ -// $Id$ -//============================================================ -/** - * @file XML_Helper.h - * - * @brief Some helper functions for XML - * - * @author Bala Natarajan <bala@dre.vanderbilt.edu> - */ -//============================================================ -#ifndef CIAO_CONFIG_HANDLERS_XML_HELPER_H -#define CIAO_CONFIG_HANDLERS_XML_HELPER_H -#include /**/ "ace/pre.h" - -#include "CIAO_XML_Utils_Export.h" -#include "XML_Error_Handler.h" -#include "XML_Schema_Resolver.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Singleton.h" -#include "ace/Null_Mutex.h" -#include "ace/Auto_Ptr.h" - -#include "xercesc/util/XercesDefs.hpp" - -namespace XERCES_CPP_NAMESPACE -{ - class DOMDocument; - class DOMWriter; - class DOMImplementation; - class DOMDocumentType; -} - - -namespace CIAO -{ - namespace Config_Handlers - { - /** - * @class XML_Helper - * - * @brief Helper class for some routine XML stuff. - */ - template <typename Resolver = CIAO_Schema_Resolver <>, - typename Error_Handler = XML_Error_Handler> - class XML_Helper_T - { - public: - XML_Helper_T (void); - - ~XML_Helper_T (void); - - /// Create a DOM tree - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *uri); - - XERCES_CPP_NAMESPACE::DOMDocument * - create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns, - XERCES_CPP_NAMESPACE::DOMDocumentType * doctype = 0); - - XERCES_CPP_NAMESPACE::DOMDocumentType * - create_doctype (const ACE_TCHAR *qn, - const ACE_TCHAR *pid, - const ACE_TCHAR *sid); - - //Writes out a DOMDocument to an XML file - bool write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file) const; - - bool is_initialized (void) const; - - protected: - /// Intialize the parser - void init_parser (void); - - /// Terminate the parser - void terminate_parser (void); - - private: - bool initialized_; - XERCES_CPP_NAMESPACE::DOMImplementation *impl_; - Resolver resolver_; - Error_Handler e_handler_; - }; - - typedef XML_Helper_T<> XML_Helper; - } -} - - - -CIAO_XML_UTILS_SINGLETON_DECLARE (ACE_Singleton, - CIAO::Config_Handlers::XML_Helper, - ACE_Null_Mutex) -namespace CIAO -{ - namespace Config_Handlers - { - typedef ACE_Singleton < XML_Helper, ACE_Null_Mutex > XML_Helper_Singleton; - } -} - - -#define XML_HELPER CIAO::Config_Handlers::XML_Helper_Singleton::instance () - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "XML_Helper.tpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("XML_Helper.tpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif/*CIAO_CONFIG_HANDLERS_XML_HELPER_H*/ diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Helper.tpp b/CIAO/tools/Config_Handlers/Utils/XML_Helper.tpp deleted file mode 100644 index 3d9d250d5c3..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Helper.tpp +++ /dev/null @@ -1,273 +0,0 @@ -//$Id$ -#include "ace/Log_Msg.h" -#include "xercesc/util/XMLUniDefs.hpp" -#include "xercesc/dom/DOM.hpp" -#include "xercesc/framework/LocalFileFormatTarget.hpp" -#include "XercesString.h" - -namespace CIAO -{ - namespace Config_Handlers - { - using xercesc::XMLException; - using xercesc::XMLString; - using xercesc::DOMImplementation; - using xercesc::DOMImplementationRegistry; - using xercesc::DOMBuilder; - using xercesc::DOMImplementationLS; - using xercesc::XMLUni; - using xercesc::DOMDocument; - using xercesc::DOMException; - using xercesc::DOMDocumentType; - - template <typename Resolver, typename Error> - XML_Helper_T<Resolver, Error>::XML_Helper_T (void) - : initialized_ (false), - impl_ (0) - { - this->init_parser (); - } - - template <typename Resolver, typename Error> - XML_Helper_T<Resolver, Error>::~XML_Helper_T (void) - { - try - { - this->terminate_parser (); - } - catch (...) - { - // We don't care about exceptions here. - } - } - - template <typename Resolver, typename Error> - bool - XML_Helper_T<Resolver, Error>::is_initialized (void) const - { - return this->initialized_ == true; - } - - template <typename Resolver, typename Error> - void - XML_Helper_T<Resolver, Error>::init_parser (void) - { - if (this->initialized_) - return; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Initializing the Xerces runtime \n")); - // Initialize the Xerces run-time - try - { - xercesc::XMLPlatformUtils::Initialize(); - } - catch (const XMLException&) - { - throw; - } - catch (...) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Some other exception," - " returning\n")); - - return; - } - - // Instantiate the DOM parser. - static const XMLCh gLS[] = { xercesc::chLatin_L, - xercesc::chLatin_S, - xercesc::chNull }; - - // Get an implementation of the Load-Store (LS) interface - // and cache it for later use - impl_ = - DOMImplementationRegistry::getDOMImplementation(gLS); - - this->initialized_ = true; - return; - } - - template <typename Resolver, typename Error> - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper_T<Resolver, Error>::create_dom (const ACE_TCHAR *root, - const ACE_TCHAR *ns, - DOMDocumentType *doctype) - { - if (!this->initialized_) - return 0; - - if (root == 0 || ns == 0) - return 0; - - return this->impl_->createDocument (XStr (ns), - XStr (root), - doctype); - } - - template <typename Resolver, typename Error> - XERCES_CPP_NAMESPACE::DOMDocumentType * - XML_Helper_T<Resolver, Error>::create_doctype (const ACE_TCHAR *qn, - const ACE_TCHAR *pid, - const ACE_TCHAR *sid) - { - if (!this->initialized_) - return 0; - - return this->impl_->createDocumentType (XStr (qn), - XStr (pid), - XStr (sid)); - } - - template <typename Resolver, typename Error> - XERCES_CPP_NAMESPACE::DOMDocument * - XML_Helper_T<Resolver, Error>::create_dom (const ACE_TCHAR *url) - { - if (!this->initialized_) - return 0; - - if (url == 0) - return impl_->createDocument( - XStr (ACE_TEXT ("http://www.omg.org/DeploymentPlan")), - XStr (ACE_TEXT ("deploymentPlan")), - 0); - - try - { - // Create a DOMBuilder - DOMBuilder* parser = - impl_->createDOMBuilder (DOMImplementationLS::MODE_SYNCHRONOUS, - 0); - - // Discard comment nodes in the document - parser->setFeature (XMLUni::fgDOMComments, false); - - // Disable datatype normalization. The XML 1.0 attribute value - // normalization always occurs though. - parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true); - - // Do not create EntityReference nodes in the DOM tree. No - // EntityReference nodes will be created, only the nodes - // corresponding to their fully expanded sustitution text will be - // created. - parser->setFeature (XMLUni::fgDOMEntities, false); - - // Perform Namespace processing. - parser->setFeature (XMLUni::fgDOMNamespaces, true); - - // Perform Validation - parser->setFeature (XMLUni::fgDOMValidation, true); - - // Do not include ignorable whitespace in the DOM tree. - parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false); - - // Enable the parser's schema support. - parser->setFeature (XMLUni::fgXercesSchema, true); - - // Enable full schema constraint checking, including checking which - // may be time-consuming or memory intensive. Currently, particle - // unique attribution constraint checking and particle derivation - // restriction checking are controlled by this option. - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); - - // The parser will treat validation error as fatal and will exit. - parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); - - parser->setErrorHandler (&this->e_handler_); - - parser->setEntityResolver (&this->resolver_); - - std::auto_ptr<DOMDocument> doc ( - parser->parseURI (ACE_TEXT_ALWAYS_CHAR (url))); - - if (this->e_handler_.getErrors ()) - throw 0; - - return doc.release (); - } - catch (const DOMException&) - { - return 0; - } - catch (const XMLException&) - { - throw 0; - } - catch (...) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Caught an unknown exception \n")); - throw 0; - } - - return 0; - } - - template <typename Resolver, typename Error> - void - XML_Helper_T<Resolver, Error>::terminate_parser (void) - { - try - { - xercesc::XMLPlatformUtils::Terminate(); - } - catch (const XMLException&) - { - throw; - } - - this->initialized_ = false; - return; - } - - template <typename Resolver, typename Error> - bool - XML_Helper_T<Resolver, Error>::write_DOM ( - XERCES_CPP_NAMESPACE::DOMDocument *doc, - const ACE_TCHAR *file) const - { - if (!this->initialized_) - return false; - - try - { - bool retn; - std::auto_ptr<XERCES_CPP_NAMESPACE::DOMWriter> writer (impl_->createDOMWriter()); - - if (writer->canSetFeature (XMLUni::fgDOMWRTFormatPrettyPrint, - true)) - { - writer->setFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true); - } - - std::auto_ptr <xercesc::XMLFormatTarget> ft ( - new xercesc::LocalFileFormatTarget(ACE_TEXT_ALWAYS_CHAR (file))); - retn = writer->writeNode(ft.get (), *doc); - return retn; - } - catch (const xercesc::XMLException &e) - { - char* message = - XMLString::transcode (e.getMessage()); - ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); - - char* name = - XMLString::transcode (e.getType()); - ACE_Auto_Basic_Array_Ptr<char> cleanup_name (name); - - ACE_ERROR ((LM_ERROR, - "Caught exception while serializing DOM to file.\n" - "Name: %C\n" - "Message: %C\n" - "SrcFile: %C\n" - "SrcLine: %d\n", - name, - message, - e.getSrcFile (), - e.getSrcLine ())); - return false; - } - } - } -} diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.cpp b/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.cpp deleted file mode 100644 index 966c46a02e0..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// $Id$ -#include <xercesc/util/PlatformUtils.hpp> -#include <xercesc/util/XercesDefs.hpp> - -#include "XML_Schema_Resolver.h" -#include "XercesString.h" - -#include "ace/Env_Value_T.h" - -#include <iostream> - -namespace CIAO -{ - namespace Config_Handlers - { - Basic_Resolver::Basic_Resolver (const ACE_TCHAR *path) - : path_ (path) - { - } - - XMLCh * - Basic_Resolver::operator() (const XMLCh *const, - const XMLCh *const systemId, - const XMLCh *const) const - { - XStr path (path_); - path.append (systemId); - return path.release (); - } - - void - Basic_Resolver::set_path (const ACE_TCHAR *path) - { - this->path_ = path; - } - - Environment_Resolver::Environment_Resolver (const ACE_TCHAR *variable, - const ACE_TCHAR *relpath) - { - xercesc::XMLPlatformUtils::Initialize(); - this->add_path (variable, relpath); - } - - Environment_Resolver::~Environment_Resolver () - { - xercesc::XMLPlatformUtils::Terminate(); - } - - using xercesc::XMLPlatformUtils; - - void - Environment_Resolver::add_path (const ACE_TCHAR *variable, - const ACE_TCHAR *relpath) - { - ACE_Env_Value <const ACE_TCHAR *> path_env (variable, - ACE_TEXT("")); - - XStr xpath (path_env); - XStr xrelpath (relpath); - - xpath.append (xrelpath); - - paths_.push_back (xpath); - } - - XMLCh * - Environment_Resolver::operator() (const XMLCh *const, - const XMLCh *const systemId, - const XMLCh *const) const - { - for (std::vector<XStr>::const_iterator i = this->paths_.begin (); - i != this->paths_.end (); - ++i) - { - XStr path (*i); - path.append(systemId); - - FileHandle file (XMLPlatformUtils::openFile (path)); - - // Check for the file presence. - if (file != 0) - { - XMLPlatformUtils::closeFile (file); - return path.release (); - } - } - return 0; - } - } -} diff --git a/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.h b/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.h deleted file mode 100644 index 5a978ec591f..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XML_Schema_Resolver.h +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file XML_Schema_Resolver.h - * @author Will Otte <wotte@dre.vanderbilt.edu> - * - * $Id$ - * - * Resolves schema locations. - */ - -#ifndef CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H -#define CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H -#include /**/ "ace/pre.h" - -#include "CIAO_XML_Utils_Export.h" -#include "XercesString.h" -#include "ace/Auto_Ptr.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include <xercesc/dom/DOMEntityResolver.hpp> -#include <xercesc/dom/DOMInputSource.hpp> -#include <xercesc/framework/LocalFileInputSource.hpp> -#include <xercesc/framework/Wrapper4InputSource.hpp> - -#include <vector> -#include <string> - -using xercesc::DOMEntityResolver; -using xercesc::DOMInputSource; -using xercesc::Wrapper4InputSource; -using xercesc::LocalFileInputSource; - -namespace CIAO -{ - namespace Config_Handlers - { - // forward decl. - class Environment_Resolver; - - /** - * @class CIAO_Schema_Resolver - * @brief Resolves schema locations for CIAO. - * - * Template argument Resolver_Functor should be a functor with an operation - * const ACE_TCHAR * operator () (...arguments from resolveEntity...) - */ - template <typename Resolver_Functor = Environment_Resolver> - class CIAO_Schema_Resolver - : public virtual DOMEntityResolver - { - public: - /// This function is called by the Xerces infrastructure to - /// actually resolve the location of a schema. - virtual DOMInputSource * resolveEntity (const XMLCh *const publicId, - const XMLCh *const systemId, - const XMLCh *const baseURI) - { - XStr path = this->resolver_ (publicId, systemId, baseURI); - if (path.begin () == 0) - return 0; - - // Ownership of these objects is given to other people. - return new Wrapper4InputSource (new LocalFileInputSource (path)); - } - - Resolver_Functor &resolver () - { - return this->resolver_; - } - - private: - Resolver_Functor resolver_; - }; - - /** - * @class NoOp_Resolver - * @brief Resolver that does nothing. - */ - struct CIAO_XML_Utils_Export NoOp_Resolver - { - const XMLCh* operator() (const XMLCh *const, - const XMLCh *const systemId, - const XMLCh *const) - { - return systemId; - } - }; - - /** - * @class Basic_Resolver - * @brief Resolves a schema location from a fixed path. - * By default @param path is the current folder. - */ - class CIAO_XML_Utils_Export Basic_Resolver - { - public: - Basic_Resolver (const ACE_TCHAR *path = ACE_TEXT ("./")); - - XMLCh* operator() (const XMLCh *const publicId, - const XMLCh *const systemId, - const XMLCh *const baseURI) const; - - void set_path (const ACE_TCHAR *path); - - private: - XStr path_; - }; - - /** - * @class Environment_Resolver - * @brief Resolves a schema location from a path from an - * environment variable. By default @param variable is $CIAO_ROOT - * and @param path is /docs/schema. - */ - class CIAO_XML_Utils_Export Environment_Resolver - { - public: - Environment_Resolver (const ACE_TCHAR *variable = ACE_TEXT ("CIAO_ROOT"), - const ACE_TCHAR *path = ACE_TEXT ("/docs/schema/")); - - ~Environment_Resolver (); - - void add_path (const ACE_TCHAR *variable, - const ACE_TCHAR *path); - - XMLCh* operator() (const XMLCh *const publicId, - const XMLCh *const systemId, - const XMLCh *const baseURI) const; - - private: - std::vector<XStr> paths_; - }; - } -} - -#include /**/ "ace/post.h" - -#endif /* CIAO_CONFIG_HANDLERS_XML_SCHEAM_RESOLVER_H */ diff --git a/CIAO/tools/Config_Handlers/Utils/XercesString.cpp b/CIAO/tools/Config_Handlers/Utils/XercesString.cpp deleted file mode 100644 index b64ede20c6e..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XercesString.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// $Id$ - -#include <ostream> -#include <algorithm> - -#include "XercesString.h" -using xercesc::XMLString; - -namespace CIAO -{ -namespace Config_Handlers -{ - - XStr::XStr (const ACE_TCHAR *str) - : _wstr(0) - { - _wstr = XMLString::transcode(ACE_TEXT_ALWAYS_CHAR (str)); - } - - XStr::XStr (XMLCh *wstr) - : _wstr(wstr) - { - - } - - XStr::XStr (const XMLCh* wstr) - : _wstr(0) - { - _wstr = XMLString::replicate(wstr); - } - - XStr::XStr (const XStr &right) - : _wstr(0) - { - _wstr = XMLString::replicate(right._wstr); - } - - XStr& XStr::operator= (const XStr& rhs) - { - if (&rhs == this) - return *this; - XStr temp (rhs); - std::swap (this->_wstr, temp._wstr); - return *this; - } - - XStr::~XStr () - { - if (_wstr) - XMLString::release(&_wstr); - } - - const XMLCh* XStr::begin () const - { - return _wstr; - } - - const XMLCh* XStr::end () const - { - return _wstr + size(); - } - - bool XStr::append(const XMLCh *tail) - { - int iTailLen = XMLString::stringLen(tail); - int iWorkLen = XMLString::stringLen(_wstr); - XMLCh *result = new XMLCh[ iWorkLen + iTailLen + 1 ]; - bool bOK = result != 0; - if (bOK) - { - XMLCh *target = result; - XMLString::moveChars(target, _wstr, iWorkLen); - target += iWorkLen; - XMLString::moveChars(target, tail, iTailLen); - target += iTailLen; - *target++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - return bOK; - } - - bool XStr::erase(const XMLCh *head, const XMLCh *tail) - { - bool bOK = head <= tail && head >= begin() && tail <= end(); - if (bOK) - { - XMLCh *result = new XMLCh[ size() - (tail - head) + 1 ]; - XMLCh *target = result; - bOK = target != 0; - if (bOK) - { - const XMLCh *cursor = begin(); - - while (cursor != head) *target++ = *cursor++; - cursor = tail; - while ( cursor != end() ) *target++ = *cursor++; - *target ++ = 0; - XMLString::release(&_wstr); - _wstr = result; - } - } - return bOK; - } - - int XStr::size () const - { - return XMLString::stringLen(_wstr); - } - - XMLCh XStr::operator [] (const int i) - { - return _wstr[i]; - } - - XMLCh XStr::operator [] (const int i) const - { - return _wstr[i]; - } - - XMLCh* XStr::release (void) - { - XMLCh* tmp = _wstr; - this->_wstr = 0; - return tmp; - } - - bool operator== (const XStr& lhs, const XStr& rhs) - { - return XMLString::compareIString (lhs,rhs) == 0; - } - - bool operator!= (const XStr& lhs, const XStr& rhs) - { - return !operator==(lhs, rhs); - } - - - std::ostream& - operator<< (std::ostream& o, XStr const& str) - { - char* s = XMLString::transcode (str); - - o << s; - - XMLString::release (&s); // idiots? - return o; - } - -} -} diff --git a/CIAO/tools/Config_Handlers/Utils/XercesString.h b/CIAO/tools/Config_Handlers/Utils/XercesString.h deleted file mode 100644 index 9c5cf3c7e86..00000000000 --- a/CIAO/tools/Config_Handlers/Utils/XercesString.h +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -#ifndef _XERCESSTRING_H -#define _XERCESSTRING_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include <iosfwd> - -#include <xercesc/util/XMLString.hpp> - -// Utility class that provides a std::string like facade to XMLString. -// Doesn't implement all of the methods of std::string. -#include "CIAO_XML_Utils_Export.h" -namespace CIAO -{ -namespace Config_Handlers -{ - - class CIAO_XML_Utils_Export XStr - { - public: - XStr() : _wstr(0L) { } - - XStr (const ACE_TCHAR* wstr); - - XStr (XMLCh* wstr); - - XStr (const XMLCh* wstr); - - XStr (const XStr& copy); - - XStr& operator= (const XStr& rhs); - - ~XStr(); - - const XMLCh* begin() const; - - const XMLCh* end() const; - - bool append(const XMLCh* tail); - - bool erase (const XMLCh* head, const XMLCh* tail); - - int size() const; - - XMLCh operator [] (const int i); - - XMLCh operator [] (const int i) const; - - operator const XMLCh* () const { return _wstr; } - - XMLCh * release (void); - - private: - - XMLCh* _wstr; // Internal representation - - }; - - CIAO_XML_Utils_Export bool operator== (const XStr& lhs, const XStr& rhs); - CIAO_XML_Utils_Export bool operator!= (const XStr& lhs, const XStr& rhs); - - CIAO_XML_Utils_Export std::ostream& - operator<< (std::ostream& o, XStr const& str); - -} -} -#include /**/ "ace/post.h" - -#endif /* _XERCESSTRING_H */ diff --git a/CIAO/tools/Config_Handlers/XMI.cpp b/CIAO/tools/Config_Handlers/XMI.cpp new file mode 100644 index 00000000000..ce54bf47d87 --- /dev/null +++ b/CIAO/tools/Config_Handlers/XMI.cpp @@ -0,0 +1,860 @@ +/* $Id$ + * This code was generated by the XML Schema Compiler. + * + * Changes made to this code will most likely be overwritten + * when the handlers are recompiled. + * + * If you find errors or feel that there are bugfixes to be made, + * please contact the current XSC maintainer: + * Will Otte <wotte@dre.vanderbilt.edu> + */ + +// Fix for Borland compilers, which seem to have a broken +// <string> include. +#ifdef __BORLANDC__ +# include <string.h> +#endif + +#include "XMI.hpp" + +namespace XMI +{ + // Extension + // + + Extension:: + Extension () + : + regulator__ () + { + } + + Extension:: + Extension (::XMI::Extension const& s) + : + XSCRT::Type (), + xmi_id_ (s.xmi_id_.get () ? new ::XMLSchema::ID< ACE_TCHAR > (*s.xmi_id_) : 0), + label_ (s.label_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.label_) : 0), + uuid_ (s.uuid_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.uuid_) : 0), + href_ (s.href_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.href_) : 0), + idref_ (s.idref_.get () ? new ::XMLSchema::IDREF< ACE_TCHAR > (*s.idref_) : 0), + version_ (s.version_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.version_) : 0), + extender_ (s.extender_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.extender_) : 0), + extenderID_ (s.extenderID_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.extenderID_) : 0), + regulator__ () + { + if (xmi_id_.get ()) xmi_id_->container (this); + if (label_.get ()) label_->container (this); + if (uuid_.get ()) uuid_->container (this); + if (href_.get ()) href_->container (this); + if (idref_.get ()) idref_->container (this); + if (version_.get ()) version_->container (this); + if (extender_.get ()) extender_->container (this); + if (extenderID_.get ()) extenderID_->container (this); + } + + ::XMI::Extension& Extension:: + operator= (::XMI::Extension const& s) + { + if (s.xmi_id_.get ()) xmi_id (*(s.xmi_id_)); + else xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (0); + + if (s.label_.get ()) label (*(s.label_)); + else label_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.uuid_.get ()) uuid (*(s.uuid_)); + else uuid_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.href_.get ()) href (*(s.href_)); + else href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.idref_.get ()) idref (*(s.idref_)); + else idref_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (0); + + if (s.version_.get ()) version (*(s.version_)); + else version_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.extender_.get ()) extender (*(s.extender_)); + else extender_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.extenderID_.get ()) extenderID (*(s.extenderID_)); + else extenderID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + return *this; + } + + + // Extension + // + bool Extension:: + xmi_id_p () const + { + return xmi_id_.get () != 0; + } + + ::XMLSchema::ID< ACE_TCHAR > const& Extension:: + xmi_id () const + { + return *xmi_id_; + } + + ::XMLSchema::ID< ACE_TCHAR >& Extension:: + xmi_id () + { + return *xmi_id_; + } + + void Extension:: + xmi_id (::XMLSchema::ID< ACE_TCHAR > const& e) + { + if (xmi_id_.get ()) + { + *xmi_id_ = e; + } + + else + { + xmi_id_ = ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > (new ::XMLSchema::ID< ACE_TCHAR > (e)); + xmi_id_->container (this); + } + } + + // Extension + // + bool Extension:: + label_p () const + { + return label_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + label () const + { + return *label_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + label () + { + return *label_; + } + + void Extension:: + label (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (label_.get ()) + { + *label_ = e; + } + + else + { + label_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + label_->container (this); + } + } + + // Extension + // + bool Extension:: + uuid_p () const + { + return uuid_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + uuid () const + { + return *uuid_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + uuid () + { + return *uuid_; + } + + void Extension:: + uuid (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (uuid_.get ()) + { + *uuid_ = e; + } + + else + { + uuid_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + uuid_->container (this); + } + } + + // Extension + // + bool Extension:: + href_p () const + { + return href_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + href () const + { + return *href_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + href () + { + return *href_; + } + + void Extension:: + href (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (href_.get ()) + { + *href_ = e; + } + + else + { + href_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + href_->container (this); + } + } + + // Extension + // + bool Extension:: + idref_p () const + { + return idref_.get () != 0; + } + + ::XMLSchema::IDREF< ACE_TCHAR > const& Extension:: + idref () const + { + return *idref_; + } + + ::XMLSchema::IDREF< ACE_TCHAR >& Extension:: + idref () + { + return *idref_; + } + + void Extension:: + idref (::XMLSchema::IDREF< ACE_TCHAR > const& e) + { + if (idref_.get ()) + { + *idref_ = e; + } + + else + { + idref_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + idref_->container (this); + } + } + + // Extension + // + bool Extension:: + version_p () const + { + return version_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + version () const + { + return *version_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + version () + { + return *version_; + } + + void Extension:: + version (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (version_.get ()) + { + *version_ = e; + } + + else + { + version_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + version_->container (this); + } + } + + // Extension + // + bool Extension:: + extender_p () const + { + return extender_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + extender () const + { + return *extender_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + extender () + { + return *extender_; + } + + void Extension:: + extender (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (extender_.get ()) + { + *extender_ = e; + } + + else + { + extender_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + extender_->container (this); + } + } + + // Extension + // + bool Extension:: + extenderID_p () const + { + return extenderID_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& Extension:: + extenderID () const + { + return *extenderID_; + } + + ::XMLSchema::string< ACE_TCHAR >& Extension:: + extenderID () + { + return *extenderID_; + } + + void Extension:: + extenderID (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (extenderID_.get ()) + { + *extenderID_ = e; + } + + else + { + extenderID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + extenderID_->container (this); + } + } +} + +namespace XMI +{ + // Extension + // + + Extension:: + Extension (::XSCRT::XML::Element< ACE_TCHAR > const& e) + :Base (e), regulator__ () + { + + ::XSCRT::Parser< ACE_TCHAR > p (e); + + while (p.more_attributes ()) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); + if (n == "xmi_id") + { + ::XMLSchema::ID< ACE_TCHAR > t (a); + xmi_id (t); + } + + else if (n == "label") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + label (t); + } + + else if (n == "uuid") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + uuid (t); + } + + else if (n == "href") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + href (t); + } + + else if (n == "idref") + { + ::XMLSchema::IDREF< ACE_TCHAR > t (a); + idref (t); + } + + else if (n == "version") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + version (t); + } + + else if (n == "extender") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + extender (t); + } + + else if (n == "extenderID") + { + ::XMLSchema::string< ACE_TCHAR > t (a); + extenderID (t); + } + + else + { + } + } + } +} + +namespace XMI +{ + ::XMI::Extension + extension (xercesc::DOMDocument const* d) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); + if (e.name () == "extension") + { + ::XMI::Extension r (e); + return r; + } + + else + { + throw 1; + } + } +} + +#include "XMLSchema/TypeInfo.hpp" + +namespace XMI +{ + namespace + { + ::XMLSchema::TypeInfoInitializer < ACE_TCHAR > XMLSchemaTypeInfoInitializer_ (::XSCRT::extended_type_info_map ()); + + struct ExtensionTypeInfoInitializer + { + ExtensionTypeInfoInitializer () + { + ::XSCRT::TypeId id (typeid (Extension)); + ::XSCRT::ExtendedTypeInfo nf (id); + + nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); + } + }; + + ExtensionTypeInfoInitializer ExtensionTypeInfoInitializer_; + } +} + +namespace XMI +{ + namespace Traversal + { + // Extension + // + // + + void Extension:: + traverse (Type& o) + { + pre (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); + if (o.label_p ()) label (o); + else label_none (o); + if (o.uuid_p ()) uuid (o); + else uuid_none (o); + if (o.href_p ()) href (o); + else href_none (o); + if (o.idref_p ()) idref (o); + else idref_none (o); + if (o.version_p ()) version (o); + else version_none (o); + if (o.extender_p ()) extender (o); + else extender_none (o); + if (o.extenderID_p ()) extenderID (o); + else extenderID_none (o); + post (o); + } + + void Extension:: + traverse (Type const& o) + { + pre (o); + if (o.xmi_id_p ()) xmi_id (o); + else xmi_id_none (o); + if (o.label_p ()) label (o); + else label_none (o); + if (o.uuid_p ()) uuid (o); + else uuid_none (o); + if (o.href_p ()) href (o); + else href_none (o); + if (o.idref_p ()) idref (o); + else idref_none (o); + if (o.version_p ()) version (o); + else version_none (o); + if (o.extender_p ()) extender (o); + else extender_none (o); + if (o.extenderID_p ()) extenderID (o); + else extenderID_none (o); + post (o); + } + + void Extension:: + pre (Type&) + { + } + + void Extension:: + pre (Type const&) + { + } + + void Extension:: + xmi_id (Type& o) + { + dispatch (o.xmi_id ()); + } + + void Extension:: + xmi_id (Type const& o) + { + dispatch (o.xmi_id ()); + } + + void Extension:: + xmi_id_none (Type&) + { + } + + void Extension:: + xmi_id_none (Type const&) + { + } + + void Extension:: + label (Type& o) + { + dispatch (o.label ()); + } + + void Extension:: + label (Type const& o) + { + dispatch (o.label ()); + } + + void Extension:: + label_none (Type&) + { + } + + void Extension:: + label_none (Type const&) + { + } + + void Extension:: + uuid (Type& o) + { + dispatch (o.uuid ()); + } + + void Extension:: + uuid (Type const& o) + { + dispatch (o.uuid ()); + } + + void Extension:: + uuid_none (Type&) + { + } + + void Extension:: + uuid_none (Type const&) + { + } + + void Extension:: + href (Type& o) + { + dispatch (o.href ()); + } + + void Extension:: + href (Type const& o) + { + dispatch (o.href ()); + } + + void Extension:: + href_none (Type&) + { + } + + void Extension:: + href_none (Type const&) + { + } + + void Extension:: + idref (Type& o) + { + dispatch (o.idref ()); + } + + void Extension:: + idref (Type const& o) + { + dispatch (o.idref ()); + } + + void Extension:: + idref_none (Type&) + { + } + + void Extension:: + idref_none (Type const&) + { + } + + void Extension:: + version (Type& o) + { + dispatch (o.version ()); + } + + void Extension:: + version (Type const& o) + { + dispatch (o.version ()); + } + + void Extension:: + version_none (Type&) + { + } + + void Extension:: + version_none (Type const&) + { + } + + void Extension:: + extender (Type& o) + { + dispatch (o.extender ()); + } + + void Extension:: + extender (Type const& o) + { + dispatch (o.extender ()); + } + + void Extension:: + extender_none (Type&) + { + } + + void Extension:: + extender_none (Type const&) + { + } + + void Extension:: + extenderID (Type& o) + { + dispatch (o.extenderID ()); + } + + void Extension:: + extenderID (Type const& o) + { + dispatch (o.extenderID ()); + } + + void Extension:: + extenderID_none (Type&) + { + } + + void Extension:: + extenderID_none (Type const&) + { + } + + void Extension:: + post (Type&) + { + } + + void Extension:: + post (Type const&) + { + } + } +} + +namespace XMI +{ + namespace Writer + { + // Extension + // + // + + Extension:: + Extension (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + Extension:: + Extension () + { + } + + void Extension:: + traverse (Type const& o) + { + Traversal::Extension::traverse (o); + } + + void Extension:: + xmi_id (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("xmi_id", "http://www.omg.org/XMI", "", top_ ()); + attr_ (&a); + Traversal::Extension::xmi_id (o); + attr_ (0); + } + + void Extension:: + label (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("label", "http://www.omg.org/XMI", "", top_ ()); + attr_ (&a); + Traversal::Extension::label (o); + attr_ (0); + } + + void Extension:: + uuid (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("uuid", "http://www.omg.org/XMI", "", top_ ()); + attr_ (&a); + Traversal::Extension::uuid (o); + attr_ (0); + } + + void Extension:: + href (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); + attr_ (&a); + Traversal::Extension::href (o); + attr_ (0); + } + + void Extension:: + idref (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("idref", "http://www.omg.org/XMI", "", top_ ()); + attr_ (&a); + Traversal::Extension::idref (o); + attr_ (0); + } + + void Extension:: + version (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("version", "http://www.omg.org/XMI", "", top_ ()); + attr_ (&a); + Traversal::Extension::version (o); + attr_ (0); + } + + void Extension:: + extender (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("extender", "", top_ ()); + attr_ (&a); + Traversal::Extension::extender (o); + attr_ (0); + } + + void Extension:: + extenderID (Type const& o) + { + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("extenderID", "", top_ ()); + attr_ (&a); + Traversal::Extension::extenderID (o); + attr_ (0); + } + } +} + +namespace XMI +{ + void + extension (::XMI::Extension const& s, xercesc::DOMDocument* d) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (d->getDocumentElement ()); + if (e.name () != "extension") + { + throw 1; + } + + struct W : virtual ::XMI::Writer::Extension, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::ID< ACE_TCHAR >, ACE_TCHAR >, + virtual ::XMLSchema::Writer::FundamentalType< ::XMLSchema::string< ACE_TCHAR >, ACE_TCHAR >, + virtual ::XMLSchema::Writer::IDREF< ACE_TCHAR >, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + W (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + }; + + W w (e); + w.dispatch (s); + } +} + diff --git a/CIAO/tools/Config_Handlers/XMI.hpp b/CIAO/tools/Config_Handlers/XMI.hpp new file mode 100644 index 00000000000..e1ac06ab52c --- /dev/null +++ b/CIAO/tools/Config_Handlers/XMI.hpp @@ -0,0 +1,397 @@ +/* $Id$ + * This code was generated by the XML Schema Compiler. + * + * Changes made to this code will most likely be overwritten + * when the handlers are recompiled. + * + * If you find errors or feel that there are bugfixes to be made, + * please contact the current XSC maintainer: + * Will Otte <wotte@dre.vanderbilt.edu> + */ + +// Fix for Borland compilers, which seem to have a broken +// <string> include. +#ifdef __BORLANDC__ +# include <string.h> +#endif + +#ifndef XMI_HPP +#define XMI_HPP + +#include "XSC_XML_Handlers_Export.h" +// Forward declarations. +// +namespace XMI +{ + class Extension; +} + +#include <memory> +#include <list> +#include "XMLSchema/Types.hpp" + +namespace XMI +{ + class XSC_XML_Handlers_Export Extension : public ::XSCRT::Type + { + typedef ::XSCRT::Type Base; + + // xmi_id + // + public: + bool xmi_id_p () const; + ::XMLSchema::ID< ACE_TCHAR > const& xmi_id () const; + ::XMLSchema::ID< ACE_TCHAR >& xmi_id (); + void xmi_id (::XMLSchema::ID< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::ID< ACE_TCHAR > > xmi_id_; + + // label + // + public: + bool label_p () const; + ::XMLSchema::string< ACE_TCHAR > const& label () const; + ::XMLSchema::string< ACE_TCHAR >& label (); + void label (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > label_; + + // uuid + // + public: + bool uuid_p () const; + ::XMLSchema::string< ACE_TCHAR > const& uuid () const; + ::XMLSchema::string< ACE_TCHAR >& uuid (); + void uuid (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > uuid_; + + // href + // + public: + bool href_p () const; + ::XMLSchema::string< ACE_TCHAR > const& href () const; + ::XMLSchema::string< ACE_TCHAR >& href (); + void href (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > href_; + + // idref + // + public: + bool idref_p () const; + ::XMLSchema::IDREF< ACE_TCHAR > const& idref () const; + ::XMLSchema::IDREF< ACE_TCHAR >& idref (); + void idref (::XMLSchema::IDREF< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > idref_; + + // version + // + public: + bool version_p () const; + ::XMLSchema::string< ACE_TCHAR > const& version () const; + ::XMLSchema::string< ACE_TCHAR >& version (); + void version (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > version_; + + // extender + // + public: + bool extender_p () const; + ::XMLSchema::string< ACE_TCHAR > const& extender () const; + ::XMLSchema::string< ACE_TCHAR >& extender (); + void extender (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > extender_; + + // extenderID + // + public: + bool extenderID_p () const; + ::XMLSchema::string< ACE_TCHAR > const& extenderID () const; + ::XMLSchema::string< ACE_TCHAR >& extenderID (); + void extenderID (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > extenderID_; + + public: + Extension (); + + Extension (::XSCRT::XML::Element< ACE_TCHAR > const&); + Extension (Extension const& s); + + Extension& + operator= (Extension const& s); + + private: + char regulator__; + }; +} + +namespace XMI +{ + XSC_XML_Handlers_Export + ::XMI::Extension + extension (xercesc::DOMDocument const*); +} + +#include "XMLSchema/Traversal.hpp" + +namespace XMI +{ + namespace Traversal + { + struct XSC_XML_Handlers_Export Extension : ::XMLSchema::Traversal::Traverser< ::XMI::Extension > + { + virtual void + traverse (Type&); + + virtual void + traverse (Type const&); + + virtual void + pre (Type&); + + virtual void + pre (Type const&); + + virtual void + xmi_id (Type&); + + virtual void + xmi_id (Type const&); + + virtual void + xmi_id_none (Type&); + + virtual void + xmi_id_none (Type const&); + + virtual void + label (Type&); + + virtual void + label (Type const&); + + virtual void + label_none (Type&); + + virtual void + label_none (Type const&); + + virtual void + uuid (Type&); + + virtual void + uuid (Type const&); + + virtual void + uuid_none (Type&); + + virtual void + uuid_none (Type const&); + + virtual void + href (Type&); + + virtual void + href (Type const&); + + virtual void + href_none (Type&); + + virtual void + href_none (Type const&); + + virtual void + idref (Type&); + + virtual void + idref (Type const&); + + virtual void + idref_none (Type&); + + virtual void + idref_none (Type const&); + + virtual void + version (Type&); + + virtual void + version (Type const&); + + virtual void + version_none (Type&); + + virtual void + version_none (Type const&); + + virtual void + extender (Type&); + + virtual void + extender (Type const&); + + virtual void + extender_none (Type&); + + virtual void + extender_none (Type const&); + + virtual void + extenderID (Type&); + + virtual void + extenderID (Type const&); + + virtual void + extenderID_none (Type&); + + virtual void + extenderID_none (Type const&); + + virtual void + post (Type&); + + virtual void + post (Type const&); + }; + } +} + +#include "XMLSchema/Writer.hpp" + +namespace XMI +{ + namespace Writer + { + struct Extension : Traversal::Extension, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + typedef ::XMI::Extension Type; + Extension (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + + this->traverse (const_cast <Type const &> (o)); + } + + + virtual void + traverse (Type const&); + + virtual void + xmi_id (Type &o) + { + + this->xmi_id (const_cast <Type const &> (o)); + } + + + virtual void + xmi_id (Type const&); + + virtual void + label (Type &o) + { + + this->label (const_cast <Type const &> (o)); + } + + + virtual void + label (Type const&); + + virtual void + uuid (Type &o) + { + + this->uuid (const_cast <Type const &> (o)); + } + + + virtual void + uuid (Type const&); + + virtual void + href (Type &o) + { + + this->href (const_cast <Type const &> (o)); + } + + + virtual void + href (Type const&); + + virtual void + idref (Type &o) + { + + this->idref (const_cast <Type const &> (o)); + } + + + virtual void + idref (Type const&); + + virtual void + version (Type &o) + { + + this->version (const_cast <Type const &> (o)); + } + + + virtual void + version (Type const&); + + virtual void + extender (Type &o) + { + + this->extender (const_cast <Type const &> (o)); + } + + + virtual void + extender (Type const&); + + virtual void + extenderID (Type &o) + { + + this->extenderID (const_cast <Type const &> (o)); + } + + + virtual void + extenderID (Type const&); + + protected: + Extension (); + }; + } +} + +namespace XMI +{ + XSC_XML_Handlers_Export + void + extension (::XMI::Extension const&, xercesc::DOMDocument*); +} + +#endif // XMI_HPP diff --git a/CIAO/tools/Config_Handlers/XMLSchema/TypeInfo.tpp b/CIAO/tools/Config_Handlers/XMLSchema/TypeInfo.tpp index 6ead5b8f7b2..918197937b7 100644 --- a/CIAO/tools/Config_Handlers/XMLSchema/TypeInfo.tpp +++ b/CIAO/tools/Config_Handlers/XMLSchema/TypeInfo.tpp @@ -65,7 +65,8 @@ namespace XMLSchema add_info<NMTOKEN<C> > (map, 0); add_info<Name<C> > (map, 0); add_info<NCName<C> > (map, 0); - + add_info<QName<C> > (map, 0); + add_info<ID<C> > (map, 0); // IDREF_Base diff --git a/CIAO/tools/Config_Handlers/XMLSchema/Types.hpp b/CIAO/tools/Config_Handlers/XMLSchema/Types.hpp index a23d7f2cdd9..16cd2c9d766 100644 --- a/CIAO/tools/Config_Handlers/XMLSchema/Types.hpp +++ b/CIAO/tools/Config_Handlers/XMLSchema/Types.hpp @@ -296,6 +296,45 @@ namespace XMLSchema }; template <typename C> + class QName: public Name<C> + { + protected: + typedef typename Name<C>::Base__ Base__; + + public: + QName() + { + } + + QName(XSCRT::XML::Element<C> const& e) + : Name<C> (e) + { + } + + QName(XSCRT::XML::Attribute<C> const& a) + : Name<C> (a) + { + } + + QName(Base__ const& x) + : Name<C> (x) + { + } + + QName (C const* x) + : Name<C> (x) + { + } + + QName& + operator= (Base__ const& x) + { + static_cast<Base__&> (*this) = x; + return *this; + } + }; + + template <typename C> struct IdentityProvider : XSCRT::IdentityProvider { IdentityProvider (NCName<C> const& id) diff --git a/CIAO/tools/Config_Handlers/XML_File_Intf.cpp b/CIAO/tools/Config_Handlers/XML_File_Intf.cpp index 4a6894b4a1a..f591abc89f0 100644 --- a/CIAO/tools/Config_Handlers/XML_File_Intf.cpp +++ b/CIAO/tools/Config_Handlers/XML_File_Intf.cpp @@ -1,21 +1,22 @@ // $Id$ #include "XML_File_Intf.h" -#include "Utils/XML_Helper.h" +#include "XML_Typedefs.h" #include "Deployment.hpp" #include "DP_Handler.h" +#include "Common.h" + #include "DAnCE/Deployment/Deployment_DataC.h" #include "ciao/CIAO_common.h" - namespace CIAO { namespace Config_Handlers { XML_File_Intf::XML_File_Intf (const char *file) + : file_ (file), + idl_dp_ (0) { - if (!this->read_process_file (file)) - throw; } bool @@ -23,43 +24,80 @@ namespace CIAO { CIAO_TRACE("XML_File_Intf::read_process_file"); - XML_Helper helper; - - if (!helper.is_initialized ()) - return false; - - XERCES_CPP_NAMESPACE::DOMDocument *dom = - helper.create_dom (ACE_TEXT_CHAR_TO_TCHAR (file)); - - if (!dom) - return false; - - DeploymentPlan dp = - deploymentPlan (dom); - - - DP_Handler dp_handler (dp); - - this->idl_dp_.reset (dp_handler.plan ()); - - if (this->idl_dp_.get ()) - return true; + try + { + if (!XML_Helper::XML_HELPER.is_initialized ()) + return false; + + CIAO_DEBUG ((LM_TRACE, CLINFO "XML_File_Intf::read_process_file - " + "Constructing DOM\n")); + XERCES_CPP_NAMESPACE::DOMDocument *dom = 0; + dom = + XML_Helper::XML_HELPER.create_dom (file); + + if (dom == 0) + { + CIAO_DEBUG ((LM_TRACE, CLINFO "XML_File_Intf::read_process_file - " + "Failed to open file $s\n", file)); + return false; + } + + XERCES_CPP_NAMESPACE::DOMElement *foo = dom->getDocumentElement (); + CIAO_DEBUG ((LM_TRACE, CLINFO "XML_File_Intf::read_process_file - " + "DOMElement pointer: %u\n", foo)); + + CIAO_DEBUG ((LM_TRACE, CLINFO "XML_File_Intf::read_process_file - " + "Parsing XML file with XSC\n")); + deploymentPlan dp = + DeploymentPlan (dom); + + CIAO_DEBUG ((LM_TRACE, CLINFO "XML_File_Intf::read_process_file - " + "Processing using config handlers\n")); + DP_Handler dp_handler (dp); + + this->idl_dp_.reset (dp_handler.plan ()); + + if (this->idl_dp_.get ()) + return true; + } + catch (Config_Error &ex) + { + ACE_ERROR ((LM_ERROR, "error at %s: %s\n", + ex.name_.c_str (), ex.error_.c_str ())); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "caught unexpected exception whilst parsing XML into IDL.")); + } return false; } ::Deployment::DeploymentPlan const * - XML_File_Intf::get_plan (void) const + XML_File_Intf::get_plan (void) { CIAO_TRACE("get_plan"); + if (this->idl_dp_.get () == 0 && !this->read_process_file (this->file_.c_str ())) + return 0; + return this->idl_dp_.get (); } ::Deployment::DeploymentPlan * - XML_File_Intf::get_plan (void) + XML_File_Intf::release_plan (void) { CIAO_TRACE("XML_File_Intf::get_plan"); + if (this->idl_dp_.get () == 0 && !this->read_process_file (this->file_.c_str ())) + return 0; return this->idl_dp_.release (); } + + void + XML_File_Intf::add_search_path (const ACE_TCHAR *environment, + const ACE_TCHAR *relpath) + { + XML_Helper::_path_resolver.add_path (environment, relpath); + } + } } diff --git a/CIAO/tools/Config_Handlers/XML_File_Intf.h b/CIAO/tools/Config_Handlers/XML_File_Intf.h index 9f5869b20fb..94c31490143 100644 --- a/CIAO/tools/Config_Handlers/XML_File_Intf.h +++ b/CIAO/tools/Config_Handlers/XML_File_Intf.h @@ -1,11 +1,11 @@ //============================================================== /** -* @file XML_File_Intf.h -* -* $Id$ -* -* @author Bala Natarajan <bala@dre.vanderbilt.edu> -*/ + * @file XML_File_Intf.h + * + * $Id$ + * + * @author Bala Natarajan <bala@dre.vanderbilt.edu> + */ //================================================================ #ifndef CIAO_CONFIG_XML_FILE_INTF_H @@ -20,32 +20,37 @@ #include "ace/Auto_Ptr.h" +#include <string> namespace Deployment { -struct DeploymentPlan ; + struct DeploymentPlan ; } namespace CIAO { -namespace Config_Handlers -{ -class Config_Handlers_Export XML_File_Intf -{ -public: -XML_File_Intf (const char *file); - -::Deployment::DeploymentPlan const *get_plan (void) const; -::Deployment::DeploymentPlan *get_plan (void); - -protected: - -bool read_process_file (const char *file); - -private: -ACE_Auto_Ptr< ::Deployment::DeploymentPlan> idl_dp_; -}; -} + namespace Config_Handlers + { + class Config_Handlers_Export XML_File_Intf + { + public: + XML_File_Intf (const char *file); + + ::Deployment::DeploymentPlan const *get_plan (void); + ::Deployment::DeploymentPlan *release_plan (void); + + void add_search_path (const ACE_TCHAR *environment, + const ACE_TCHAR *relpath); + + protected: + + bool read_process_file (const char *file); + + private: + std::string file_; + ACE_Auto_Ptr< ::Deployment::DeploymentPlan> idl_dp_; + }; + } } #include /**/ "ace/post.h" #endif /*CIAO_CONFIG_XML_FILE_INTF_H*/ diff --git a/CIAO/tools/Config_Handlers/XML_Typedefs.cpp b/CIAO/tools/Config_Handlers/XML_Typedefs.cpp new file mode 100644 index 00000000000..9d57ac17e92 --- /dev/null +++ b/CIAO/tools/Config_Handlers/XML_Typedefs.cpp @@ -0,0 +1,14 @@ +// $Id$ + +#include "XML_Typedefs.h" + +namespace CIAO +{ + namespace Config_Handlers + { + XML_Helper::PATH_RESOLVER XML_Helper::_path_resolver; + XML_Helper::XML_RESOLVER XML_Helper::_xml_resolver (XML_Helper::_path_resolver); + XML_Helper::ERROR_HANDLER XML_Helper::_xml_error_handler; + XML_Helper::HELPER XML_Helper::XML_HELPER (XML_Helper::_xml_resolver, XML_Helper::_xml_error_handler); + } +} diff --git a/CIAO/tools/Config_Handlers/XML_Typedefs.h b/CIAO/tools/Config_Handlers/XML_Typedefs.h new file mode 100644 index 00000000000..f0054df2e57 --- /dev/null +++ b/CIAO/tools/Config_Handlers/XML_Typedefs.h @@ -0,0 +1,38 @@ +/** + * @file XML_Typedefs.h + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * $Id$ + * Typedefs from the XML Utilities. + */ +#ifndef XML_TYPEDEFS_H +#define XML_TYPEDEFS_H + +#include "XSC_XML_Handlers_Export.h" +#include "XML/XML_Helper.h" +#include "XML/XML_Schema_Resolver.h" +#include "XML/XML_Error_Handler.h" + +namespace CIAO +{ + namespace Config_Handlers + { + class XSC_XML_Handlers_Export XML_Helper + { + public: + typedef ::CIAO::XML::Environment_Resolver PATH_RESOLVER; + typedef ::CIAO::XML::XML_Schema_Resolver< ::CIAO::XML::Environment_Resolver > XML_RESOLVER; + typedef ::CIAO::XML::XML_Error_Handler ERROR_HANDLER; + typedef ::CIAO::XML::XML_Helper< XML_RESOLVER, ERROR_HANDLER > HELPER; + + static PATH_RESOLVER _path_resolver; + static XML_RESOLVER _xml_resolver; + static ERROR_HANDLER _xml_error_handler; + + public: + static HELPER XML_HELPER; + }; + } +} + + +#endif /* XML_TYPEDEFS_H */ diff --git a/CIAO/tools/Config_Handlers/XSCRT/Elements.hpp b/CIAO/tools/Config_Handlers/XSCRT/Elements.hpp index 751111bf866..d5d64056a50 100644 --- a/CIAO/tools/Config_Handlers/XSCRT/Elements.hpp +++ b/CIAO/tools/Config_Handlers/XSCRT/Elements.hpp @@ -5,11 +5,11 @@ #ifndef XSCRT_ELEMENTS_HPP #define XSCRT_ELEMENTS_HPP -#include <memory> #include <map> #include <string> #include <sstream> #include <memory> +// #include <iostream> //@@ tmp #include "XSCRT/Parser.hpp" diff --git a/CIAO/tools/Config_Handlers/XSCRT/Traversal.hpp b/CIAO/tools/Config_Handlers/XSCRT/Traversal.hpp index 2dc957a9e79..9c532e7693e 100644 --- a/CIAO/tools/Config_Handlers/XSCRT/Traversal.hpp +++ b/CIAO/tools/Config_Handlers/XSCRT/Traversal.hpp @@ -64,7 +64,7 @@ namespace XSCRT map (TypeId id, TraverserBase<B>& t) { //wcerr << "map for " << id.name () << " to " << &t - // << " in " << &traversal_map_ << endl; + // << " in " << &traversal_map_ << endl; //@@ VC6 Traversers& traversers = traversal_map_[id]; diff --git a/CIAO/tools/Config_Handlers/XSCRT/Traversal.tpp b/CIAO/tools/Config_Handlers/XSCRT/Traversal.tpp index b798178621b..51889c0fb9b 100644 --- a/CIAO/tools/Config_Handlers/XSCRT/Traversal.tpp +++ b/CIAO/tools/Config_Handlers/XSCRT/Traversal.tpp @@ -80,7 +80,7 @@ namespace XSCRT // Remove traversed types from the level map. // - //@@ VC6 + //@@ VC6 { for (typename TypeInfoSet::const_iterator i = dispatched.begin (); i != dispatched.end (); @@ -88,7 +88,7 @@ namespace XSCRT { levels.erase (*i); } - } + } } } @@ -145,7 +145,7 @@ namespace XSCRT // Remove traversed types from the level map. // - //@@ VC6 + //@@ VC6 { for (typename TypeInfoSet::const_iterator i = dispatched.begin (); i != dispatched.end (); @@ -153,7 +153,7 @@ namespace XSCRT { levels.erase (*i); } - } + } } } diff --git a/CIAO/tools/Config_Handlers/XSCRT/XML.hpp b/CIAO/tools/Config_Handlers/XSCRT/XML.hpp index 1f11533e2bb..8f21ea8263d 100644 --- a/CIAO/tools/Config_Handlers/XSCRT/XML.hpp +++ b/CIAO/tools/Config_Handlers/XSCRT/XML.hpp @@ -462,8 +462,11 @@ namespace XSCRT { string xns (ns); - XMLCh const* p ( - e.dom_element ()->lookupNamespacePrefix (xns.c_str (), false)); +#if defined(XERCES_VERSION_MAJOR) && XERCES_VERSION_MAJOR > 2 + XMLCh const* p (e.dom_element ()->lookupPrefix (xns.c_str ())); +#else + XMLCh const* p (e.dom_element ()->lookupNamespacePrefix (xns.c_str (), false)); +#endif if (p == 0) { diff --git a/CIAO/tools/Config_Handlers/XSCRT/XMLSchema.hpp b/CIAO/tools/Config_Handlers/XSCRT/XMLSchema.hpp index 6f810782953..95575267eee 100644 --- a/CIAO/tools/Config_Handlers/XSCRT/XMLSchema.hpp +++ b/CIAO/tools/Config_Handlers/XSCRT/XMLSchema.hpp @@ -258,6 +258,40 @@ namespace XMLSchema }; template <typename C> + class QName: public Name<C> + { + protected: + typedef typename Name<C>::Base__ Base__; + + public: + QName() + { + } + + QName(XSCRT::XML::Element<C> const& e) + : Name<C> (e) + { + } + + QName(XSCRT::XML::Attribute<C> const& a) + : Name<C> (a) + { + } + + QName(Base__ const& x) + : Name<C> (x) + { + } + + QName& + operator= (Base__ const& x) + { + static_cast<Base__&> (*this) = x; + return *this; + } + }; + + template <typename C> struct IdentityProvider : XSCRT::IdentityProvider { IdentityProvider (NCName<C> const& id) diff --git a/CIAO/tools/Config_Handlers/XSC_XML_Handlers_Export.h b/CIAO/tools/Config_Handlers/XSC_XML_Handlers_Export.h index 7d18280aa34..82272eb6c05 100644 --- a/CIAO/tools/Config_Handlers/XSC_XML_Handlers_Export.h +++ b/CIAO/tools/Config_Handlers/XSC_XML_Handlers_Export.h @@ -9,10 +9,6 @@ #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) && !defined (XSC_XML_HANDLERS_HAS_DLL) -# define XSC_XML_HANDLERS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && XSC_XML_HANDLERS_HAS_DLL */ - #if !defined (XSC_XML_HANDLERS_HAS_DLL) # define XSC_XML_HANDLERS_HAS_DLL 1 #endif /* ! XSC_XML_HANDLERS_HAS_DLL */ diff --git a/CIAO/tools/Config_Handlers/ccd.cpp b/CIAO/tools/Config_Handlers/ccd.cpp index f519aa54a36..64e40b82567 100644 --- a/CIAO/tools/Config_Handlers/ccd.cpp +++ b/CIAO/tools/Config_Handlers/ccd.cpp @@ -526,61 +526,61 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("specificType")) + else if (n == "specificType") { ::XMLSchema::string< ACE_TCHAR > t (e); specificType (t); } - else if (n == ACE_TEXT ("supportedType")) + else if (n == "supportedType") { ::XMLSchema::string< ACE_TCHAR > t (e); add_supportedType (t); } - else if (n == ACE_TEXT ("idlFile")) + else if (n == "idlFile") { ::XMLSchema::string< ACE_TCHAR > t (e); add_idlFile (t); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("port")) + else if (n == "port") { ::CIAO::Config_Handlers::ComponentPortDescription t (e); add_port (t); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { ::CIAO::Config_Handlers::ComponentPropertyDescription t (e); add_property (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); } - else if (n == ACE_TEXT ("contentLocation")) + else if (n == "contentLocation") { ::XMLSchema::string< ACE_TCHAR > t (e); contentLocation (t); @@ -595,7 +595,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("href")) + if (n == "href") { ::XMLSchema::string< ACE_TCHAR > t (a); href (t); @@ -1366,7 +1366,7 @@ namespace CIAO void ComponentInterfaceDescription:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::ComponentInterfaceDescription::label (o); pop_ (); } @@ -1374,7 +1374,7 @@ namespace CIAO void ComponentInterfaceDescription:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::ComponentInterfaceDescription::UUID (o); pop_ (); } @@ -1382,7 +1382,7 @@ namespace CIAO void ComponentInterfaceDescription:: specificType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("specificType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("specificType", top_ ())); Traversal::ComponentInterfaceDescription::specificType (o); pop_ (); } @@ -1390,7 +1390,7 @@ namespace CIAO void ComponentInterfaceDescription:: supportedType_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("supportedType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("supportedType", top_ ())); } void ComponentInterfaceDescription:: @@ -1409,7 +1409,7 @@ namespace CIAO void ComponentInterfaceDescription:: idlFile_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("idlFile"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("idlFile", top_ ())); } void ComponentInterfaceDescription:: @@ -1428,7 +1428,7 @@ namespace CIAO void ComponentInterfaceDescription:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void ComponentInterfaceDescription:: @@ -1447,7 +1447,7 @@ namespace CIAO void ComponentInterfaceDescription:: port_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("port"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("port", top_ ())); } void ComponentInterfaceDescription:: @@ -1466,7 +1466,7 @@ namespace CIAO void ComponentInterfaceDescription:: property_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); } void ComponentInterfaceDescription:: @@ -1485,7 +1485,7 @@ namespace CIAO void ComponentInterfaceDescription:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } void ComponentInterfaceDescription:: @@ -1504,7 +1504,7 @@ namespace CIAO void ComponentInterfaceDescription:: contentLocation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("contentLocation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("contentLocation", top_ ())); Traversal::ComponentInterfaceDescription::contentLocation (o); pop_ (); } @@ -1512,7 +1512,7 @@ namespace CIAO void ComponentInterfaceDescription:: href (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("href"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); attr_ (&a); Traversal::ComponentInterfaceDescription::href (o); attr_ (0); diff --git a/CIAO/tools/Config_Handlers/cdd.cpp b/CIAO/tools/Config_Handlers/cdd.cpp index 1b7373812c8..799ad5ebec7 100644 --- a/CIAO/tools/Config_Handlers/cdd.cpp +++ b/CIAO/tools/Config_Handlers/cdd.cpp @@ -17,10 +17,6 @@ #include "cdd.hpp" -// This file has no dependency on ACE, thus we turn -// all ACE_OS checks off -// FUZZ: disable check_for_lack_ACE_OS - namespace CIAO { namespace Config_Handlers @@ -1100,43 +1096,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("UUID")) + if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("label")) + else if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("node")) + else if (n == "node") { ::CIAO::Config_Handlers::Node t (e); add_node (t); } - else if (n == ACE_TEXT ("interconnect")) + else if (n == "interconnect") { ::CIAO::Config_Handlers::Interconnect t (e); add_interconnect (t); } - else if (n == ACE_TEXT ("bridge")) + else if (n == "bridge") { ::CIAO::Config_Handlers::Bridge t (e); add_bridge (t); } - else if (n == ACE_TEXT ("sharedResource")) + else if (n == "sharedResource") { ::CIAO::Config_Handlers::SharedResource t (e); add_sharedResource (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); @@ -1163,25 +1159,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("label")) + else if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("connect")) + else if (n == "connect") { ::CIAO::Config_Handlers::Interconnect t (e); add_connect (t); } - else if (n == ACE_TEXT ("resource")) + else if (n == "resource") { ::CIAO::Config_Handlers::Resource t (e); add_resource (t); @@ -1208,31 +1204,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("label")) + else if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("connection")) + else if (n == "connection") { ::CIAO::Config_Handlers::Bridge t (e); add_connection (t); } - else if (n == ACE_TEXT ("connect")) + else if (n == "connect") { ::CIAO::Config_Handlers::Node t (e); add_connect (t); } - else if (n == ACE_TEXT ("resource")) + else if (n == "resource") { ::CIAO::Config_Handlers::Resource t (e); add_resource (t); @@ -1259,31 +1255,31 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("label")) + else if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("connection")) + else if (n == "connection") { ::CIAO::Config_Handlers::Interconnect t (e); add_connection (t); } - else if (n == ACE_TEXT ("sharedResource")) + else if (n == "sharedResource") { ::CIAO::Config_Handlers::SharedResource t (e); add_sharedResource (t); } - else if (n == ACE_TEXT ("resource")) + else if (n == "resource") { ::CIAO::Config_Handlers::Resource t (e); add_resource (t); @@ -1310,25 +1306,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("resourceType")) + else if (n == "resourceType") { resourceType_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); resourceType_->container (this); } - else if (n == ACE_TEXT ("node")) + else if (n == "node") { node_ = ::std::auto_ptr< ::CIAO::Config_Handlers::Node > (new ::CIAO::Config_Handlers::Node (e)); node_->container (this); } - else if (n == ACE_TEXT ("property")) + else if (n == "property") { property_ = ::std::auto_ptr< ::CIAO::Config_Handlers::SatisfierProperty > (new ::CIAO::Config_Handlers::SatisfierProperty (e)); property_->container (this); @@ -2965,7 +2961,7 @@ namespace CIAO void Domain:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::Domain::UUID (o); pop_ (); } @@ -2973,7 +2969,7 @@ namespace CIAO void Domain:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::Domain::label (o); pop_ (); } @@ -2981,7 +2977,7 @@ namespace CIAO void Domain:: node_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("node"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("node", top_ ())); } void Domain:: @@ -3000,7 +2996,7 @@ namespace CIAO void Domain:: interconnect_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("interconnect"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("interconnect", top_ ())); } void Domain:: @@ -3019,7 +3015,7 @@ namespace CIAO void Domain:: bridge_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("bridge"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("bridge", top_ ())); } void Domain:: @@ -3038,7 +3034,7 @@ namespace CIAO void Domain:: sharedResource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("sharedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("sharedResource", top_ ())); } void Domain:: @@ -3057,7 +3053,7 @@ namespace CIAO void Domain:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } void Domain:: @@ -3097,7 +3093,7 @@ namespace CIAO void Bridge:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Bridge::name (o); pop_ (); } @@ -3105,7 +3101,7 @@ namespace CIAO void Bridge:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::Bridge::label (o); pop_ (); } @@ -3113,7 +3109,7 @@ namespace CIAO void Bridge:: connect_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connect"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connect", top_ ())); } void Bridge:: @@ -3132,7 +3128,7 @@ namespace CIAO void Bridge:: resource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resource", top_ ())); } void Bridge:: @@ -3172,7 +3168,7 @@ namespace CIAO void Interconnect:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Interconnect::name (o); pop_ (); } @@ -3180,7 +3176,7 @@ namespace CIAO void Interconnect:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::Interconnect::label (o); pop_ (); } @@ -3188,7 +3184,7 @@ namespace CIAO void Interconnect:: connection_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connection"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connection", top_ ())); } void Interconnect:: @@ -3207,7 +3203,7 @@ namespace CIAO void Interconnect:: connect_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connect"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connect", top_ ())); } void Interconnect:: @@ -3226,7 +3222,7 @@ namespace CIAO void Interconnect:: resource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resource", top_ ())); } void Interconnect:: @@ -3266,7 +3262,7 @@ namespace CIAO void Node:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::Node::name (o); pop_ (); } @@ -3274,7 +3270,7 @@ namespace CIAO void Node:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::Node::label (o); pop_ (); } @@ -3282,7 +3278,7 @@ namespace CIAO void Node:: connection_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connection"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connection", top_ ())); } void Node:: @@ -3301,7 +3297,7 @@ namespace CIAO void Node:: sharedResource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("sharedResource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("sharedResource", top_ ())); } void Node:: @@ -3320,7 +3316,7 @@ namespace CIAO void Node:: resource_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resource"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resource", top_ ())); } void Node:: @@ -3360,7 +3356,7 @@ namespace CIAO void SharedResource:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::SharedResource::name (o); pop_ (); } @@ -3368,7 +3364,7 @@ namespace CIAO void SharedResource:: resourceType (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("resourceType"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("resourceType", top_ ())); Traversal::SharedResource::resourceType (o); pop_ (); } @@ -3376,7 +3372,7 @@ namespace CIAO void SharedResource:: node (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("node"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("node", top_ ())); Traversal::SharedResource::node (o); pop_ (); } @@ -3384,7 +3380,7 @@ namespace CIAO void SharedResource:: property (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("property"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("property", top_ ())); Traversal::SharedResource::property (o); pop_ (); } diff --git a/CIAO/tools/Config_Handlers/cdp.cpp b/CIAO/tools/Config_Handlers/cdp.cpp index 942e8b3a535..7200d3e3a74 100644 --- a/CIAO/tools/Config_Handlers/cdp.cpp +++ b/CIAO/tools/Config_Handlers/cdp.cpp @@ -21,19 +21,19 @@ namespace CIAO { namespace Config_Handlers { - // DeploymentPlan + // deploymentPlan // - DeploymentPlan:: - DeploymentPlan () + deploymentPlan:: + deploymentPlan () : ::XSCRT::Type (), regulator__ () { } - DeploymentPlan:: - DeploymentPlan (::CIAO::Config_Handlers::DeploymentPlan const& s) + deploymentPlan:: + deploymentPlan (::CIAO::Config_Handlers::deploymentPlan const& s) : ::XSCRT::Type (), label_ (s.label_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.label_) : 0), @@ -67,10 +67,14 @@ namespace CIAO { for (infoProperty_const_iterator i (s.infoProperty_.begin ());i != s.infoProperty_.end ();++i) add_infoProperty (*i); } + + { + for (localityConstraint_const_iterator i (s.localityConstraint_.begin ());i != s.localityConstraint_.end ();++i) add_localityConstraint (*i); + } } - ::CIAO::Config_Handlers::DeploymentPlan& DeploymentPlan:: - operator= (::CIAO::Config_Handlers::DeploymentPlan const& s) + ::CIAO::Config_Handlers::deploymentPlan& deploymentPlan:: + operator= (::CIAO::Config_Handlers::deploymentPlan const& s) { if (s.label_.get ()) label (*(s.label_)); else label_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); @@ -111,25 +115,30 @@ namespace CIAO for (infoProperty_const_iterator i (s.infoProperty_.begin ());i != s.infoProperty_.end ();++i) add_infoProperty (*i); } + localityConstraint_.clear (); + { + for (localityConstraint_const_iterator i (s.localityConstraint_.begin ());i != s.localityConstraint_.end ();++i) add_localityConstraint (*i); + } + return *this; } - // DeploymentPlan + // deploymentPlan // - bool DeploymentPlan:: + bool deploymentPlan:: label_p () const { return label_.get () != 0; } - ::XMLSchema::string< ACE_TCHAR > const& DeploymentPlan:: + ::XMLSchema::string< ACE_TCHAR > const& deploymentPlan:: label () const { return *label_; } - void DeploymentPlan:: + void deploymentPlan:: label (::XMLSchema::string< ACE_TCHAR > const& e) { if (label_.get ()) @@ -144,21 +153,21 @@ namespace CIAO } } - // DeploymentPlan + // deploymentPlan // - bool DeploymentPlan:: + bool deploymentPlan:: UUID_p () const { return UUID_.get () != 0; } - ::XMLSchema::string< ACE_TCHAR > const& DeploymentPlan:: + ::XMLSchema::string< ACE_TCHAR > const& deploymentPlan:: UUID () const { return *UUID_; } - void DeploymentPlan:: + void deploymentPlan:: UUID (::XMLSchema::string< ACE_TCHAR > const& e) { if (UUID_.get ()) @@ -173,21 +182,21 @@ namespace CIAO } } - // DeploymentPlan + // deploymentPlan // - bool DeploymentPlan:: + bool deploymentPlan:: realizes_p () const { return realizes_.get () != 0; } - ::CIAO::Config_Handlers::ComponentInterfaceDescription const& DeploymentPlan:: + ::CIAO::Config_Handlers::ComponentInterfaceDescription const& deploymentPlan:: realizes () const { return *realizes_; } - void DeploymentPlan:: + void deploymentPlan:: realizes (::CIAO::Config_Handlers::ComponentInterfaceDescription const& e) { if (realizes_.get ()) @@ -202,233 +211,271 @@ namespace CIAO } } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::implementation_iterator DeploymentPlan:: + deploymentPlan::implementation_iterator deploymentPlan:: begin_implementation () { return implementation_.begin (); } - DeploymentPlan::implementation_iterator DeploymentPlan:: + deploymentPlan::implementation_iterator deploymentPlan:: end_implementation () { return implementation_.end (); } - DeploymentPlan::implementation_const_iterator DeploymentPlan:: + deploymentPlan::implementation_const_iterator deploymentPlan:: begin_implementation () const { return implementation_.begin (); } - DeploymentPlan::implementation_const_iterator DeploymentPlan:: + deploymentPlan::implementation_const_iterator deploymentPlan:: end_implementation () const { return implementation_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_implementation (::CIAO::Config_Handlers::MonolithicDeploymentDescription const& e) { implementation_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_implementation(void) const { return implementation_.size (); } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::instance_iterator DeploymentPlan:: + deploymentPlan::instance_iterator deploymentPlan:: begin_instance () { return instance_.begin (); } - DeploymentPlan::instance_iterator DeploymentPlan:: + deploymentPlan::instance_iterator deploymentPlan:: end_instance () { return instance_.end (); } - DeploymentPlan::instance_const_iterator DeploymentPlan:: + deploymentPlan::instance_const_iterator deploymentPlan:: begin_instance () const { return instance_.begin (); } - DeploymentPlan::instance_const_iterator DeploymentPlan:: + deploymentPlan::instance_const_iterator deploymentPlan:: end_instance () const { return instance_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_instance (::CIAO::Config_Handlers::InstanceDeploymentDescription const& e) { instance_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_instance(void) const { return instance_.size (); } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::connection_iterator DeploymentPlan:: + deploymentPlan::connection_iterator deploymentPlan:: begin_connection () { return connection_.begin (); } - DeploymentPlan::connection_iterator DeploymentPlan:: + deploymentPlan::connection_iterator deploymentPlan:: end_connection () { return connection_.end (); } - DeploymentPlan::connection_const_iterator DeploymentPlan:: + deploymentPlan::connection_const_iterator deploymentPlan:: begin_connection () const { return connection_.begin (); } - DeploymentPlan::connection_const_iterator DeploymentPlan:: + deploymentPlan::connection_const_iterator deploymentPlan:: end_connection () const { return connection_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_connection (::CIAO::Config_Handlers::PlanConnectionDescription const& e) { connection_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_connection(void) const { return connection_.size (); } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::dependsOn_iterator DeploymentPlan:: + deploymentPlan::dependsOn_iterator deploymentPlan:: begin_dependsOn () { return dependsOn_.begin (); } - DeploymentPlan::dependsOn_iterator DeploymentPlan:: + deploymentPlan::dependsOn_iterator deploymentPlan:: end_dependsOn () { return dependsOn_.end (); } - DeploymentPlan::dependsOn_const_iterator DeploymentPlan:: + deploymentPlan::dependsOn_const_iterator deploymentPlan:: begin_dependsOn () const { return dependsOn_.begin (); } - DeploymentPlan::dependsOn_const_iterator DeploymentPlan:: + deploymentPlan::dependsOn_const_iterator deploymentPlan:: end_dependsOn () const { return dependsOn_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_dependsOn (::CIAO::Config_Handlers::ImplementationDependency const& e) { dependsOn_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_dependsOn(void) const { return dependsOn_.size (); } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::artifact_iterator DeploymentPlan:: + deploymentPlan::artifact_iterator deploymentPlan:: begin_artifact () { return artifact_.begin (); } - DeploymentPlan::artifact_iterator DeploymentPlan:: + deploymentPlan::artifact_iterator deploymentPlan:: end_artifact () { return artifact_.end (); } - DeploymentPlan::artifact_const_iterator DeploymentPlan:: + deploymentPlan::artifact_const_iterator deploymentPlan:: begin_artifact () const { return artifact_.begin (); } - DeploymentPlan::artifact_const_iterator DeploymentPlan:: + deploymentPlan::artifact_const_iterator deploymentPlan:: end_artifact () const { return artifact_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_artifact (::CIAO::Config_Handlers::ArtifactDeploymentDescription const& e) { artifact_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_artifact(void) const { return artifact_.size (); } - // DeploymentPlan + // deploymentPlan // - DeploymentPlan::infoProperty_iterator DeploymentPlan:: + deploymentPlan::infoProperty_iterator deploymentPlan:: begin_infoProperty () { return infoProperty_.begin (); } - DeploymentPlan::infoProperty_iterator DeploymentPlan:: + deploymentPlan::infoProperty_iterator deploymentPlan:: end_infoProperty () { return infoProperty_.end (); } - DeploymentPlan::infoProperty_const_iterator DeploymentPlan:: + deploymentPlan::infoProperty_const_iterator deploymentPlan:: begin_infoProperty () const { return infoProperty_.begin (); } - DeploymentPlan::infoProperty_const_iterator DeploymentPlan:: + deploymentPlan::infoProperty_const_iterator deploymentPlan:: end_infoProperty () const { return infoProperty_.end (); } - void DeploymentPlan:: + void deploymentPlan:: add_infoProperty (::CIAO::Config_Handlers::Property const& e) { infoProperty_.push_back (e); } - size_t DeploymentPlan:: + size_t deploymentPlan:: count_infoProperty(void) const { return infoProperty_.size (); } + + // deploymentPlan + // + deploymentPlan::localityConstraint_iterator deploymentPlan:: + begin_localityConstraint () + { + return localityConstraint_.begin (); + } + + deploymentPlan::localityConstraint_iterator deploymentPlan:: + end_localityConstraint () + { + return localityConstraint_.end (); + } + + deploymentPlan::localityConstraint_const_iterator deploymentPlan:: + begin_localityConstraint () const + { + return localityConstraint_.begin (); + } + + deploymentPlan::localityConstraint_const_iterator deploymentPlan:: + end_localityConstraint () const + { + return localityConstraint_.end (); + } + + void deploymentPlan:: + add_localityConstraint (::CIAO::Config_Handlers::PlanLocality const& e) + { + localityConstraint_.push_back (e); + } + + size_t deploymentPlan:: + count_localityConstraint(void) const + { + return localityConstraint_.size (); + } } } @@ -436,11 +483,11 @@ namespace CIAO { namespace Config_Handlers { - // DeploymentPlan + // deploymentPlan // - DeploymentPlan:: - DeploymentPlan (::XSCRT::XML::Element< ACE_TCHAR > const& e) + deploymentPlan:: + deploymentPlan (::XSCRT::XML::Element< ACE_TCHAR > const& e) :Base (e), regulator__ () { @@ -451,60 +498,66 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("realizes")) + else if (n == "realizes") { ::CIAO::Config_Handlers::ComponentInterfaceDescription t (e); realizes (t); } - else if (n == ACE_TEXT ("implementation")) + else if (n == "implementation") { ::CIAO::Config_Handlers::MonolithicDeploymentDescription t (e); add_implementation (t); } - else if (n == ACE_TEXT ("instance")) + else if (n == "instance") { ::CIAO::Config_Handlers::InstanceDeploymentDescription t (e); add_instance (t); } - else if (n == ACE_TEXT ("connection")) + else if (n == "connection") { ::CIAO::Config_Handlers::PlanConnectionDescription t (e); add_connection (t); } - else if (n == ACE_TEXT ("dependsOn")) + else if (n == "dependsOn") { ::CIAO::Config_Handlers::ImplementationDependency t (e); add_dependsOn (t); } - else if (n == ACE_TEXT ("artifact")) + else if (n == "artifact") { ::CIAO::Config_Handlers::ArtifactDeploymentDescription t (e); add_artifact (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); } + else if (n == "localityConstraint") + { + ::CIAO::Config_Handlers::PlanLocality t (e); + add_localityConstraint (t); + } + else { } @@ -530,11 +583,11 @@ namespace CIAO { ::XMLSchema::TypeInfoInitializer < ACE_TCHAR > XMLSchemaTypeInfoInitializer_ (::XSCRT::extended_type_info_map ()); - struct DeploymentPlanTypeInfoInitializer + struct deploymentPlanTypeInfoInitializer { - DeploymentPlanTypeInfoInitializer () + deploymentPlanTypeInfoInitializer () { - ::XSCRT::TypeId id (typeid (DeploymentPlan)); + ::XSCRT::TypeId id (typeid (deploymentPlan)); ::XSCRT::ExtendedTypeInfo nf (id); nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); @@ -542,7 +595,7 @@ namespace CIAO } }; - DeploymentPlanTypeInfoInitializer DeploymentPlanTypeInfoInitializer_; + deploymentPlanTypeInfoInitializer deploymentPlanTypeInfoInitializer_; } } } @@ -553,11 +606,11 @@ namespace CIAO { namespace Traversal { - // DeploymentPlan + // deploymentPlan // // - void DeploymentPlan:: + void deploymentPlan:: traverse (Type& o) { pre (o); @@ -573,10 +626,11 @@ namespace CIAO dependsOn (o); artifact (o); infoProperty (o); + localityConstraint (o); post (o); } - void DeploymentPlan:: + void deploymentPlan:: traverse (Type const& o) { pre (o); @@ -592,91 +646,92 @@ namespace CIAO dependsOn (o); artifact (o); infoProperty (o); + localityConstraint (o); post (o); } - void DeploymentPlan:: + void deploymentPlan:: pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: label (Type& o) { dispatch (o.label ()); } - void DeploymentPlan:: + void deploymentPlan:: label (Type const& o) { dispatch (o.label ()); } - void DeploymentPlan:: + void deploymentPlan:: label_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: label_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: UUID (Type& o) { dispatch (o.UUID ()); } - void DeploymentPlan:: + void deploymentPlan:: UUID (Type const& o) { dispatch (o.UUID ()); } - void DeploymentPlan:: + void deploymentPlan:: UUID_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: UUID_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: realizes (Type& o) { dispatch (o.realizes ()); } - void DeploymentPlan:: + void deploymentPlan:: realizes (Type const& o) { dispatch (o.realizes ()); } - void DeploymentPlan:: + void deploymentPlan:: realizes_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: realizes_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::implementation_iterator b (o.begin_implementation()), e (o.end_implementation()); + deploymentPlan::Type::implementation_iterator b (o.begin_implementation()), e (o.end_implementation()); if (b != e) { @@ -689,14 +744,16 @@ namespace CIAO implementation_post (o); } + + else implementation_none (o); } - void DeploymentPlan:: + void deploymentPlan:: implementation (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::implementation_const_iterator b (o.begin_implementation()), e (o.end_implementation()); + deploymentPlan::Type::implementation_const_iterator b (o.begin_implementation()), e (o.end_implementation()); if (b != e) { @@ -709,44 +766,56 @@ namespace CIAO implementation_post (o); } + + else implementation_none (o); } - void DeploymentPlan:: + void deploymentPlan:: implementation_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: implementation_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: + implementation_none (Type&) + { + } + + void deploymentPlan:: + implementation_none (Type const&) + { + } + + void deploymentPlan:: instance (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::instance_iterator b (o.begin_instance()), e (o.end_instance()); + deploymentPlan::Type::instance_iterator b (o.begin_instance()), e (o.end_instance()); if (b != e) { @@ -763,12 +832,12 @@ namespace CIAO else instance_none (o); } - void DeploymentPlan:: + void deploymentPlan:: instance (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::instance_const_iterator b (o.begin_instance()), e (o.end_instance()); + deploymentPlan::Type::instance_const_iterator b (o.begin_instance()), e (o.end_instance()); if (b != e) { @@ -785,52 +854,52 @@ namespace CIAO else instance_none (o); } - void DeploymentPlan:: + void deploymentPlan:: instance_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: instance_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: connection (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::connection_iterator b (o.begin_connection()), e (o.end_connection()); + deploymentPlan::Type::connection_iterator b (o.begin_connection()), e (o.end_connection()); if (b != e) { @@ -847,12 +916,12 @@ namespace CIAO else connection_none (o); } - void DeploymentPlan:: + void deploymentPlan:: connection (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::connection_const_iterator b (o.begin_connection()), e (o.end_connection()); + deploymentPlan::Type::connection_const_iterator b (o.begin_connection()), e (o.end_connection()); if (b != e) { @@ -869,52 +938,52 @@ namespace CIAO else connection_none (o); } - void DeploymentPlan:: + void deploymentPlan:: connection_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: connection_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::dependsOn_iterator b (o.begin_dependsOn()), e (o.end_dependsOn()); + deploymentPlan::Type::dependsOn_iterator b (o.begin_dependsOn()), e (o.end_dependsOn()); if (b != e) { @@ -931,12 +1000,12 @@ namespace CIAO else dependsOn_none (o); } - void DeploymentPlan:: + void deploymentPlan:: dependsOn (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::dependsOn_const_iterator b (o.begin_dependsOn()), e (o.end_dependsOn()); + deploymentPlan::Type::dependsOn_const_iterator b (o.begin_dependsOn()), e (o.end_dependsOn()); if (b != e) { @@ -953,52 +1022,52 @@ namespace CIAO else dependsOn_none (o); } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::artifact_iterator b (o.begin_artifact()), e (o.end_artifact()); + deploymentPlan::Type::artifact_iterator b (o.begin_artifact()), e (o.end_artifact()); if (b != e) { @@ -1015,12 +1084,12 @@ namespace CIAO else artifact_none (o); } - void DeploymentPlan:: + void deploymentPlan:: artifact (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::artifact_const_iterator b (o.begin_artifact()), e (o.end_artifact()); + deploymentPlan::Type::artifact_const_iterator b (o.begin_artifact()), e (o.end_artifact()); if (b != e) { @@ -1037,52 +1106,52 @@ namespace CIAO else artifact_none (o); } - void DeploymentPlan:: + void deploymentPlan:: artifact_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: artifact_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty (Type& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::infoProperty_iterator b (o.begin_infoProperty()), e (o.end_infoProperty()); + deploymentPlan::Type::infoProperty_iterator b (o.begin_infoProperty()), e (o.end_infoProperty()); if (b != e) { @@ -1099,12 +1168,12 @@ namespace CIAO else infoProperty_none (o); } - void DeploymentPlan:: + void deploymentPlan:: infoProperty (Type const& o) { // VC6 anathema strikes again // - DeploymentPlan::Type::infoProperty_const_iterator b (o.begin_infoProperty()), e (o.end_infoProperty()); + deploymentPlan::Type::infoProperty_const_iterator b (o.begin_infoProperty()), e (o.end_infoProperty()); if (b != e) { @@ -1121,52 +1190,136 @@ namespace CIAO else infoProperty_none (o); } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_pre (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_pre (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_next (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_next (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_post (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_none (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_none (Type const&) { } - void DeploymentPlan:: + void deploymentPlan:: + localityConstraint (Type& o) + { + // VC6 anathema strikes again + // + deploymentPlan::Type::localityConstraint_iterator b (o.begin_localityConstraint()), e (o.end_localityConstraint()); + + if (b != e) + { + localityConstraint_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) localityConstraint_next (o); + } + + localityConstraint_post (o); + } + + else localityConstraint_none (o); + } + + void deploymentPlan:: + localityConstraint (Type const& o) + { + // VC6 anathema strikes again + // + deploymentPlan::Type::localityConstraint_const_iterator b (o.begin_localityConstraint()), e (o.end_localityConstraint()); + + if (b != e) + { + localityConstraint_pre (o); + for (; b != e;) + { + dispatch (*b); + if (++b != e) localityConstraint_next (o); + } + + localityConstraint_post (o); + } + + else localityConstraint_none (o); + } + + void deploymentPlan:: + localityConstraint_pre (Type&) + { + } + + void deploymentPlan:: + localityConstraint_pre (Type const&) + { + } + + void deploymentPlan:: + localityConstraint_next (Type&) + { + } + + void deploymentPlan:: + localityConstraint_next (Type const&) + { + } + + void deploymentPlan:: + localityConstraint_post (Type&) + { + } + + void deploymentPlan:: + localityConstraint_post (Type const&) + { + } + + void deploymentPlan:: + localityConstraint_none (Type&) + { + } + + void deploymentPlan:: + localityConstraint_none (Type const&) + { + } + + void deploymentPlan:: post (Type&) { } - void DeploymentPlan:: + void deploymentPlan:: post (Type const&) { } @@ -1180,164 +1333,183 @@ namespace CIAO { namespace Writer { - // DeploymentPlan + // deploymentPlan // // - DeploymentPlan:: - DeploymentPlan (::XSCRT::XML::Element< ACE_TCHAR >& e) + deploymentPlan:: + deploymentPlan (::XSCRT::XML::Element< ACE_TCHAR >& e) : ::XSCRT::Writer< ACE_TCHAR > (e) { } - DeploymentPlan:: - DeploymentPlan () + deploymentPlan:: + deploymentPlan () { } - void DeploymentPlan:: + void deploymentPlan:: traverse (Type const& o) { - Traversal::DeploymentPlan::traverse (o); + Traversal::deploymentPlan::traverse (o); } - void DeploymentPlan:: + void deploymentPlan:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); - Traversal::DeploymentPlan::label (o); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); + Traversal::deploymentPlan::label (o); pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); - Traversal::DeploymentPlan::UUID (o); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); + Traversal::deploymentPlan::UUID (o); pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: realizes (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("realizes"), top_ ())); - Traversal::DeploymentPlan::realizes (o); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("realizes", top_ ())); + Traversal::deploymentPlan::realizes (o); pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: implementation_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("implementation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("implementation", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: implementation_next (Type const& o) { implementation_post (o); implementation_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: implementation_post (Type const&) { pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: instance_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("instance"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("instance", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: instance_next (Type const& o) { instance_post (o); instance_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: instance_post (Type const&) { pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: connection_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connection"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connection", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: connection_next (Type const& o) { connection_post (o); connection_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: connection_post (Type const&) { pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dependsOn"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dependsOn", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_next (Type const& o) { dependsOn_post (o); dependsOn_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: dependsOn_post (Type const&) { pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: artifact_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("artifact"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("artifact", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: artifact_next (Type const& o) { artifact_post (o); artifact_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: artifact_post (Type const&) { pop_ (); } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_next (Type const& o) { infoProperty_post (o); infoProperty_pre (o); } - void DeploymentPlan:: + void deploymentPlan:: infoProperty_post (Type const&) { pop_ (); } + + void deploymentPlan:: + localityConstraint_pre (Type const&) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("localityConstraint", top_ ())); + } + + void deploymentPlan:: + localityConstraint_next (Type const& o) + { + localityConstraint_post (o); + localityConstraint_pre (o); + } + + void deploymentPlan:: + localityConstraint_post (Type const&) + { + pop_ (); + } } } } diff --git a/CIAO/tools/Config_Handlers/cdp.hpp b/CIAO/tools/Config_Handlers/cdp.hpp index df7d0a36ad6..4e734efe6fb 100644 --- a/CIAO/tools/Config_Handlers/cdp.hpp +++ b/CIAO/tools/Config_Handlers/cdp.hpp @@ -25,7 +25,7 @@ namespace CIAO { namespace Config_Handlers { - class DeploymentPlan; + class deploymentPlan; } } @@ -39,7 +39,7 @@ namespace CIAO { namespace Config_Handlers { - class XSC_XML_Handlers_Export DeploymentPlan : public ::XSCRT::Type + class XSC_XML_Handlers_Export deploymentPlan : public ::XSCRT::Type { typedef ::XSCRT::Type Base; @@ -163,14 +163,29 @@ namespace CIAO protected: ::std::list< ::CIAO::Config_Handlers::Property > infoProperty_; + // localityConstraint + // public: - DeploymentPlan (); + typedef ::std::list< ::CIAO::Config_Handlers::PlanLocality >::iterator localityConstraint_iterator; + typedef ::std::list< ::CIAO::Config_Handlers::PlanLocality >::const_iterator localityConstraint_const_iterator; + localityConstraint_iterator begin_localityConstraint (); + localityConstraint_iterator end_localityConstraint (); + localityConstraint_const_iterator begin_localityConstraint () const; + localityConstraint_const_iterator end_localityConstraint () const; + void add_localityConstraint (::CIAO::Config_Handlers::PlanLocality const& ); + size_t count_localityConstraint (void) const; + + protected: + ::std::list< ::CIAO::Config_Handlers::PlanLocality > localityConstraint_; - DeploymentPlan (::XSCRT::XML::Element< ACE_TCHAR > const&); - DeploymentPlan (DeploymentPlan const& s); + public: + deploymentPlan (); - DeploymentPlan& - operator= (DeploymentPlan const& s); + deploymentPlan (::XSCRT::XML::Element< ACE_TCHAR > const&); + deploymentPlan (deploymentPlan const& s); + + deploymentPlan& + operator= (deploymentPlan const& s); private: char regulator__; @@ -193,7 +208,7 @@ namespace CIAO { namespace Traversal { - struct XSC_XML_Handlers_Export DeploymentPlan : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::DeploymentPlan > + struct XSC_XML_Handlers_Export deploymentPlan : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::deploymentPlan > { virtual void traverse (Type&); @@ -268,6 +283,12 @@ namespace CIAO implementation_post (Type const&); virtual void + implementation_none (Type&); + + virtual void + implementation_none (Type const&); + + virtual void instance (Type&); virtual void @@ -418,6 +439,36 @@ namespace CIAO infoProperty_none (Type const&); virtual void + localityConstraint (Type&); + + virtual void + localityConstraint (Type const&); + + virtual void + localityConstraint_pre (Type&); + + virtual void + localityConstraint_pre (Type const&); + + virtual void + localityConstraint_next (Type&); + + virtual void + localityConstraint_next (Type const&); + + virtual void + localityConstraint_post (Type&); + + virtual void + localityConstraint_post (Type const&); + + virtual void + localityConstraint_none (Type&); + + virtual void + localityConstraint_none (Type const&); + + virtual void post (Type&); virtual void @@ -435,11 +486,11 @@ namespace CIAO { namespace Writer { - struct DeploymentPlan : Traversal::DeploymentPlan, + struct deploymentPlan : Traversal::deploymentPlan, virtual ::XSCRT::Writer< ACE_TCHAR > { - typedef ::CIAO::Config_Handlers::DeploymentPlan Type; - DeploymentPlan (::XSCRT::XML::Element< ACE_TCHAR >&); + typedef ::CIAO::Config_Handlers::deploymentPlan Type; + deploymentPlan (::XSCRT::XML::Element< ACE_TCHAR >&); virtual void traverse (Type &o) @@ -683,8 +734,41 @@ namespace CIAO virtual void infoProperty_post (Type const&); + virtual void + localityConstraint_pre (Type &o) + { + + this->localityConstraint_pre (const_cast <Type const &> (o)); + } + + + virtual void + localityConstraint_pre (Type const&); + + virtual void + localityConstraint_next (Type &o) + { + + this->localityConstraint_next (const_cast <Type const &> (o)); + } + + + virtual void + localityConstraint_next (Type const&); + + virtual void + localityConstraint_post (Type &o) + { + + this->localityConstraint_post (const_cast <Type const &> (o)); + } + + + virtual void + localityConstraint_post (Type const&); + protected: - DeploymentPlan (); + deploymentPlan (); }; } } diff --git a/CIAO/tools/Config_Handlers/cid.cpp b/CIAO/tools/Config_Handlers/cid.cpp index e35dbea885d..ff69d6d8473 100644 --- a/CIAO/tools/Config_Handlers/cid.cpp +++ b/CIAO/tools/Config_Handlers/cid.cpp @@ -21,6 +21,121 @@ namespace CIAO { namespace Config_Handlers { + // ComponentPackageReference + // + + ComponentPackageReference:: + ComponentPackageReference (::CIAO::Config_Handlers::ComponentInterfaceDescription const& requiredType__) + : + ::XSCRT::Type (), + requiredType_ (new ::CIAO::Config_Handlers::ComponentInterfaceDescription (requiredType__)), + regulator__ () + { + requiredType_->container (this); + } + + ComponentPackageReference:: + ComponentPackageReference (::CIAO::Config_Handlers::ComponentPackageReference const& s) + : + ::XSCRT::Type (), + requiredUUID_ (s.requiredUUID_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.requiredUUID_) : 0), + requiredName_ (s.requiredName_.get () ? new ::XMLSchema::string< ACE_TCHAR > (*s.requiredName_) : 0), + requiredType_ (new ::CIAO::Config_Handlers::ComponentInterfaceDescription (*s.requiredType_)), + regulator__ () + { + if (requiredUUID_.get ()) requiredUUID_->container (this); + if (requiredName_.get ()) requiredName_->container (this); + requiredType_->container (this); + } + + ::CIAO::Config_Handlers::ComponentPackageReference& ComponentPackageReference:: + operator= (::CIAO::Config_Handlers::ComponentPackageReference const& s) + { + if (s.requiredUUID_.get ()) requiredUUID (*(s.requiredUUID_)); + else requiredUUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + if (s.requiredName_.get ()) requiredName (*(s.requiredName_)); + else requiredName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (0); + + requiredType (s.requiredType ()); + + return *this; + } + + + // ComponentPackageReference + // + bool ComponentPackageReference:: + requiredUUID_p () const + { + return requiredUUID_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& ComponentPackageReference:: + requiredUUID () const + { + return *requiredUUID_; + } + + void ComponentPackageReference:: + requiredUUID (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (requiredUUID_.get ()) + { + *requiredUUID_ = e; + } + + else + { + requiredUUID_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + requiredUUID_->container (this); + } + } + + // ComponentPackageReference + // + bool ComponentPackageReference:: + requiredName_p () const + { + return requiredName_.get () != 0; + } + + ::XMLSchema::string< ACE_TCHAR > const& ComponentPackageReference:: + requiredName () const + { + return *requiredName_; + } + + void ComponentPackageReference:: + requiredName (::XMLSchema::string< ACE_TCHAR > const& e) + { + if (requiredName_.get ()) + { + *requiredName_ = e; + } + + else + { + requiredName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); + requiredName_->container (this); + } + } + + // ComponentPackageReference + // + ::CIAO::Config_Handlers::ComponentInterfaceDescription const& ComponentPackageReference:: + requiredType () const + { + return *requiredType_; + } + + void ComponentPackageReference:: + requiredType (::CIAO::Config_Handlers::ComponentInterfaceDescription const& e) + { + *requiredType_ = e; + } + + // SubcomponentInstantiationDescription // @@ -343,11 +458,11 @@ namespace CIAO SubcomponentPropertyReference:: SubcomponentPropertyReference (::XMLSchema::string< ACE_TCHAR > const& propertyName__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__) + ::CIAO::Config_Handlers::IdRef const& instance__) : ::XSCRT::Type (), propertyName_ (new ::XMLSchema::string< ACE_TCHAR > (propertyName__)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (instance__)), + instance_ (new ::CIAO::Config_Handlers::IdRef (instance__)), regulator__ () { propertyName_->container (this); @@ -359,7 +474,7 @@ namespace CIAO : ::XSCRT::Type (), propertyName_ (new ::XMLSchema::string< ACE_TCHAR > (*s.propertyName_)), - instance_ (new ::XMLSchema::IDREF< ACE_TCHAR > (*s.instance_)), + instance_ (new ::CIAO::Config_Handlers::IdRef (*s.instance_)), regulator__ () { propertyName_->container (this); @@ -393,14 +508,14 @@ namespace CIAO // SubcomponentPropertyReference // - ::XMLSchema::IDREF< ACE_TCHAR > const& SubcomponentPropertyReference:: + ::CIAO::Config_Handlers::IdRef const& SubcomponentPropertyReference:: instance () const { return *instance_; } void SubcomponentPropertyReference:: - instance (::XMLSchema::IDREF< ACE_TCHAR > const& e) + instance (::CIAO::Config_Handlers::IdRef const& e) { *instance_ = e; } @@ -1365,6 +1480,45 @@ namespace CIAO { namespace Config_Handlers { + // ComponentPackageReference + // + + ComponentPackageReference:: + ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR > const& e) + :Base (e), regulator__ () + { + + ::XSCRT::Parser< ACE_TCHAR > p (e); + + while (p.more_elements ()) + { + ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); + ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); + + if (n == "requiredUUID") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + requiredUUID (t); + } + + else if (n == "requiredName") + { + ::XMLSchema::string< ACE_TCHAR > t (e); + requiredName (t); + } + + else if (n == "requiredType") + { + requiredType_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentInterfaceDescription > (new ::CIAO::Config_Handlers::ComponentInterfaceDescription (e)); + requiredType_->container (this); + } + + else + { + } + } + } + // SubcomponentInstantiationDescription // @@ -1380,43 +1534,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("basePackage")) + else if (n == "basePackage") { ::CIAO::Config_Handlers::ComponentPackageDescription t (e); basePackage (t); } - else if (n == ACE_TEXT ("specializedConfig")) + else if (n == "specializedConfig") { ::CIAO::Config_Handlers::PackageConfiguration t (e); specializedConfig (t); } - else if (n == ACE_TEXT ("selectRequirement")) + else if (n == "selectRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_selectRequirement (t); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("referencedPackage")) + else if (n == "referencedPackage") { ::CIAO::Config_Handlers::ComponentPackageReference t (e); referencedPackage (t); } - else if (n == ACE_TEXT ("importedPackage")) + else if (n == "importedPackage") { ::CIAO::Config_Handlers::ComponentPackageImport t (e); importedPackage (t); @@ -1431,7 +1585,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("id")) + if (n == "id") { ::XMLSchema::ID< ACE_TCHAR > t (a); id (t); @@ -1458,15 +1612,15 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("propertyName")) + if (n == "propertyName") { propertyName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); propertyName_->container (this); } - else if (n == ACE_TEXT ("instance")) + else if (n == "instance") { - instance_ = ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > (new ::XMLSchema::IDREF< ACE_TCHAR > (e)); + instance_ = ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > (new ::CIAO::Config_Handlers::IdRef (e)); instance_->container (this); } @@ -1491,19 +1645,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("externalName")) + else if (n == "externalName") { externalName_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); externalName_->container (this); } - else if (n == ACE_TEXT ("delegatesTo")) + else if (n == "delegatesTo") { ::CIAO::Config_Handlers::SubcomponentPropertyReference t (e); add_delegatesTo (t); @@ -1530,19 +1684,19 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("instance")) + if (n == "instance") { ::CIAO::Config_Handlers::SubcomponentInstantiationDescription t (e); add_instance (t); } - else if (n == ACE_TEXT ("connection")) + else if (n == "connection") { ::CIAO::Config_Handlers::AssemblyConnectionDescription t (e); add_connection (t); } - else if (n == ACE_TEXT ("externalProperty")) + else if (n == "externalProperty") { ::CIAO::Config_Handlers::AssemblyPropertyMapping t (e); add_externalProperty (t); @@ -1569,25 +1723,25 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("nodeExecParameter")) + if (n == "nodeExecParameter") { ::CIAO::Config_Handlers::Property t (e); add_nodeExecParameter (t); } - else if (n == ACE_TEXT ("componentExecParameter")) + else if (n == "componentExecParameter") { ::CIAO::Config_Handlers::Property t (e); add_componentExecParameter (t); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::ImplementationRequirement t (e); add_deployRequirement (t); } - else if (n == ACE_TEXT ("primaryArtifact")) + else if (n == "primaryArtifact") { ::CIAO::Config_Handlers::NamedImplementationArtifact t (e); add_primaryArtifact (t); @@ -1614,61 +1768,61 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("implements")) + else if (n == "implements") { ::CIAO::Config_Handlers::ComponentInterfaceDescription t (e); implements (t); } - else if (n == ACE_TEXT ("assemblyImpl")) + else if (n == "assemblyImpl") { ::CIAO::Config_Handlers::ComponentAssemblyDescription t (e); assemblyImpl (t); } - else if (n == ACE_TEXT ("monolithicImpl")) + else if (n == "monolithicImpl") { ::CIAO::Config_Handlers::MonolithicImplementationDescription t (e); monolithicImpl (t); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("capability")) + else if (n == "capability") { ::CIAO::Config_Handlers::Capability t (e); add_capability (t); } - else if (n == ACE_TEXT ("dependsOn")) + else if (n == "dependsOn") { ::CIAO::Config_Handlers::ImplementationDependency t (e); add_dependsOn (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); } - else if (n == ACE_TEXT ("contentLocation")) + else if (n == "contentLocation") { ::XMLSchema::string< ACE_TCHAR > t (e); contentLocation (t); @@ -1683,7 +1837,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("href")) + if (n == "href") { ::XMLSchema::string< ACE_TCHAR > t (a); href (t); @@ -1714,6 +1868,20 @@ namespace CIAO { ::XMLSchema::TypeInfoInitializer < ACE_TCHAR > XMLSchemaTypeInfoInitializer_ (::XSCRT::extended_type_info_map ()); + struct ComponentPackageReferenceTypeInfoInitializer + { + ComponentPackageReferenceTypeInfoInitializer () + { + ::XSCRT::TypeId id (typeid (ComponentPackageReference)); + ::XSCRT::ExtendedTypeInfo nf (id); + + nf.add_base (::XSCRT::ExtendedTypeInfo::Access::public_, false, typeid (::XSCRT::Type)); + ::XSCRT::extended_type_info_map ().insert (::std::make_pair (id, nf)); + } + }; + + ComponentPackageReferenceTypeInfoInitializer ComponentPackageReferenceTypeInfoInitializer_; + struct SubcomponentInstantiationDescriptionTypeInfoInitializer { SubcomponentInstantiationDescriptionTypeInfoInitializer () @@ -1807,6 +1975,110 @@ namespace CIAO { namespace Traversal { + // ComponentPackageReference + // + // + + void ComponentPackageReference:: + traverse (Type& o) + { + pre (o); + if (o.requiredUUID_p ()) requiredUUID (o); + else requiredUUID_none (o); + if (o.requiredName_p ()) requiredName (o); + else requiredName_none (o); + requiredType (o); + post (o); + } + + void ComponentPackageReference:: + traverse (Type const& o) + { + pre (o); + if (o.requiredUUID_p ()) requiredUUID (o); + else requiredUUID_none (o); + if (o.requiredName_p ()) requiredName (o); + else requiredName_none (o); + requiredType (o); + post (o); + } + + void ComponentPackageReference:: + pre (Type&) + { + } + + void ComponentPackageReference:: + pre (Type const&) + { + } + + void ComponentPackageReference:: + requiredUUID (Type& o) + { + dispatch (o.requiredUUID ()); + } + + void ComponentPackageReference:: + requiredUUID (Type const& o) + { + dispatch (o.requiredUUID ()); + } + + void ComponentPackageReference:: + requiredUUID_none (Type&) + { + } + + void ComponentPackageReference:: + requiredUUID_none (Type const&) + { + } + + void ComponentPackageReference:: + requiredName (Type& o) + { + dispatch (o.requiredName ()); + } + + void ComponentPackageReference:: + requiredName (Type const& o) + { + dispatch (o.requiredName ()); + } + + void ComponentPackageReference:: + requiredName_none (Type&) + { + } + + void ComponentPackageReference:: + requiredName_none (Type const&) + { + } + + void ComponentPackageReference:: + requiredType (Type& o) + { + dispatch (o.requiredType ()); + } + + void ComponentPackageReference:: + requiredType (Type const& o) + { + dispatch (o.requiredType ()); + } + + void ComponentPackageReference:: + post (Type&) + { + } + + void ComponentPackageReference:: + post (Type const&) + { + } + // SubcomponentInstantiationDescription // // @@ -3588,6 +3860,51 @@ namespace CIAO { namespace Writer { + // ComponentPackageReference + // + // + + ComponentPackageReference:: + ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR >& e) + : ::XSCRT::Writer< ACE_TCHAR > (e) + { + } + + ComponentPackageReference:: + ComponentPackageReference () + { + } + + void ComponentPackageReference:: + traverse (Type const& o) + { + Traversal::ComponentPackageReference::traverse (o); + } + + void ComponentPackageReference:: + requiredUUID (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requiredUUID", top_ ())); + Traversal::ComponentPackageReference::requiredUUID (o); + pop_ (); + } + + void ComponentPackageReference:: + requiredName (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requiredName", top_ ())); + Traversal::ComponentPackageReference::requiredName (o); + pop_ (); + } + + void ComponentPackageReference:: + requiredType (Type const& o) + { + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("requiredType", top_ ())); + Traversal::ComponentPackageReference::requiredType (o); + pop_ (); + } + // SubcomponentInstantiationDescription // // @@ -3612,7 +3929,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::SubcomponentInstantiationDescription::name (o); pop_ (); } @@ -3620,7 +3937,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: basePackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("basePackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("basePackage", top_ ())); Traversal::SubcomponentInstantiationDescription::basePackage (o); pop_ (); } @@ -3628,7 +3945,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: specializedConfig (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("specializedConfig"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("specializedConfig", top_ ())); Traversal::SubcomponentInstantiationDescription::specializedConfig (o); pop_ (); } @@ -3636,7 +3953,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: selectRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("selectRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("selectRequirement", top_ ())); } void SubcomponentInstantiationDescription:: @@ -3655,7 +3972,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void SubcomponentInstantiationDescription:: @@ -3674,7 +3991,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: referencedPackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("referencedPackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("referencedPackage", top_ ())); Traversal::SubcomponentInstantiationDescription::referencedPackage (o); pop_ (); } @@ -3682,7 +3999,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: importedPackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("importedPackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("importedPackage", top_ ())); Traversal::SubcomponentInstantiationDescription::importedPackage (o); pop_ (); } @@ -3690,7 +4007,7 @@ namespace CIAO void SubcomponentInstantiationDescription:: id (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("id"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("id", "", top_ ()); attr_ (&a); Traversal::SubcomponentInstantiationDescription::id (o); attr_ (0); @@ -3720,7 +4037,7 @@ namespace CIAO void SubcomponentPropertyReference:: propertyName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("propertyName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("propertyName", top_ ())); Traversal::SubcomponentPropertyReference::propertyName (o); pop_ (); } @@ -3728,7 +4045,7 @@ namespace CIAO void SubcomponentPropertyReference:: instance (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("instance"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("instance", top_ ())); Traversal::SubcomponentPropertyReference::instance (o); pop_ (); } @@ -3757,7 +4074,7 @@ namespace CIAO void AssemblyPropertyMapping:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::AssemblyPropertyMapping::name (o); pop_ (); } @@ -3765,7 +4082,7 @@ namespace CIAO void AssemblyPropertyMapping:: externalName (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalName"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalName", top_ ())); Traversal::AssemblyPropertyMapping::externalName (o); pop_ (); } @@ -3773,7 +4090,7 @@ namespace CIAO void AssemblyPropertyMapping:: delegatesTo_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("delegatesTo"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("delegatesTo", top_ ())); } void AssemblyPropertyMapping:: @@ -3813,7 +4130,7 @@ namespace CIAO void ComponentAssemblyDescription:: instance_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("instance"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("instance", top_ ())); } void ComponentAssemblyDescription:: @@ -3832,7 +4149,7 @@ namespace CIAO void ComponentAssemblyDescription:: connection_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("connection"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("connection", top_ ())); } void ComponentAssemblyDescription:: @@ -3851,7 +4168,7 @@ namespace CIAO void ComponentAssemblyDescription:: externalProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("externalProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("externalProperty", top_ ())); } void ComponentAssemblyDescription:: @@ -3891,7 +4208,7 @@ namespace CIAO void MonolithicImplementationDescription:: nodeExecParameter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("nodeExecParameter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("nodeExecParameter", top_ ())); } void MonolithicImplementationDescription:: @@ -3910,7 +4227,7 @@ namespace CIAO void MonolithicImplementationDescription:: componentExecParameter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("componentExecParameter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("componentExecParameter", top_ ())); } void MonolithicImplementationDescription:: @@ -3929,7 +4246,7 @@ namespace CIAO void MonolithicImplementationDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void MonolithicImplementationDescription:: @@ -3948,7 +4265,7 @@ namespace CIAO void MonolithicImplementationDescription:: primaryArtifact_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("primaryArtifact"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("primaryArtifact", top_ ())); } void MonolithicImplementationDescription:: @@ -3988,7 +4305,7 @@ namespace CIAO void ComponentImplementationDescription:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::ComponentImplementationDescription::label (o); pop_ (); } @@ -3996,7 +4313,7 @@ namespace CIAO void ComponentImplementationDescription:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::ComponentImplementationDescription::UUID (o); pop_ (); } @@ -4004,7 +4321,7 @@ namespace CIAO void ComponentImplementationDescription:: implements (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("implements"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("implements", top_ ())); Traversal::ComponentImplementationDescription::implements (o); pop_ (); } @@ -4012,7 +4329,7 @@ namespace CIAO void ComponentImplementationDescription:: assemblyImpl (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("assemblyImpl"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("assemblyImpl", top_ ())); Traversal::ComponentImplementationDescription::assemblyImpl (o); pop_ (); } @@ -4020,7 +4337,7 @@ namespace CIAO void ComponentImplementationDescription:: monolithicImpl (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("monolithicImpl"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("monolithicImpl", top_ ())); Traversal::ComponentImplementationDescription::monolithicImpl (o); pop_ (); } @@ -4028,7 +4345,7 @@ namespace CIAO void ComponentImplementationDescription:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void ComponentImplementationDescription:: @@ -4047,7 +4364,7 @@ namespace CIAO void ComponentImplementationDescription:: capability_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("capability"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("capability", top_ ())); } void ComponentImplementationDescription:: @@ -4066,7 +4383,7 @@ namespace CIAO void ComponentImplementationDescription:: dependsOn_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dependsOn"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dependsOn", top_ ())); } void ComponentImplementationDescription:: @@ -4085,7 +4402,7 @@ namespace CIAO void ComponentImplementationDescription:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } void ComponentImplementationDescription:: @@ -4104,7 +4421,7 @@ namespace CIAO void ComponentImplementationDescription:: contentLocation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("contentLocation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("contentLocation", top_ ())); Traversal::ComponentImplementationDescription::contentLocation (o); pop_ (); } @@ -4112,7 +4429,7 @@ namespace CIAO void ComponentImplementationDescription:: href (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("href"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); attr_ (&a); Traversal::ComponentImplementationDescription::href (o); attr_ (0); diff --git a/CIAO/tools/Config_Handlers/cid.hpp b/CIAO/tools/Config_Handlers/cid.hpp index c0b74ebc810..5e02b1729ed 100644 --- a/CIAO/tools/Config_Handlers/cid.hpp +++ b/CIAO/tools/Config_Handlers/cid.hpp @@ -25,6 +25,7 @@ namespace CIAO { namespace Config_Handlers { + class ComponentPackageReference; class SubcomponentInstantiationDescription; class SubcomponentPropertyReference; class AssemblyPropertyMapping; @@ -50,6 +51,53 @@ namespace CIAO { namespace Config_Handlers { + class XSC_XML_Handlers_Export ComponentPackageReference : public ::XSCRT::Type + { + typedef ::XSCRT::Type Base; + + // requiredUUID + // + public: + bool requiredUUID_p () const; + ::XMLSchema::string< ACE_TCHAR > const& requiredUUID () const; + void requiredUUID (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > requiredUUID_; + + // requiredName + // + public: + bool requiredName_p () const; + ::XMLSchema::string< ACE_TCHAR > const& requiredName () const; + void requiredName (::XMLSchema::string< ACE_TCHAR > const& ); + + protected: + ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > requiredName_; + + // requiredType + // + public: + ::CIAO::Config_Handlers::ComponentInterfaceDescription const& requiredType () const; + void requiredType (::CIAO::Config_Handlers::ComponentInterfaceDescription const& ); + + protected: + ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentInterfaceDescription > requiredType_; + + public: + ComponentPackageReference (::CIAO::Config_Handlers::ComponentInterfaceDescription const& requiredType__); + + ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR > const&); + ComponentPackageReference (ComponentPackageReference const& s); + + ComponentPackageReference& + operator= (ComponentPackageReference const& s); + + private: + char regulator__; + }; + + class XSC_XML_Handlers_Export SubcomponentInstantiationDescription : public ::XSCRT::Type { typedef ::XSCRT::Type Base; @@ -174,15 +222,15 @@ namespace CIAO // instance // public: - ::XMLSchema::IDREF< ACE_TCHAR > const& instance () const; - void instance (::XMLSchema::IDREF< ACE_TCHAR > const& ); + ::CIAO::Config_Handlers::IdRef const& instance () const; + void instance (::CIAO::Config_Handlers::IdRef const& ); protected: - ::std::auto_ptr< ::XMLSchema::IDREF< ACE_TCHAR > > instance_; + ::std::auto_ptr< ::CIAO::Config_Handlers::IdRef > instance_; public: SubcomponentPropertyReference (::XMLSchema::string< ACE_TCHAR > const& propertyName__, - ::XMLSchema::IDREF< ACE_TCHAR > const& instance__); + ::CIAO::Config_Handlers::IdRef const& instance__); SubcomponentPropertyReference (::XSCRT::XML::Element< ACE_TCHAR > const&); SubcomponentPropertyReference (SubcomponentPropertyReference const& s); @@ -553,6 +601,57 @@ namespace CIAO { namespace Traversal { + struct XSC_XML_Handlers_Export ComponentPackageReference : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::ComponentPackageReference > + { + virtual void + traverse (Type&); + + virtual void + traverse (Type const&); + + virtual void + pre (Type&); + + virtual void + pre (Type const&); + + virtual void + requiredUUID (Type&); + + virtual void + requiredUUID (Type const&); + + virtual void + requiredUUID_none (Type&); + + virtual void + requiredUUID_none (Type const&); + + virtual void + requiredName (Type&); + + virtual void + requiredName (Type const&); + + virtual void + requiredName_none (Type&); + + virtual void + requiredName_none (Type const&); + + virtual void + requiredType (Type&); + + virtual void + requiredType (Type const&); + + virtual void + post (Type&); + + virtual void + post (Type const&); + }; + struct XSC_XML_Handlers_Export SubcomponentInstantiationDescription : ::XMLSchema::Traversal::Traverser< ::CIAO::Config_Handlers::SubcomponentInstantiationDescription > { virtual void @@ -1266,6 +1365,60 @@ namespace CIAO { namespace Writer { + struct ComponentPackageReference : Traversal::ComponentPackageReference, + virtual ::XSCRT::Writer< ACE_TCHAR > + { + typedef ::CIAO::Config_Handlers::ComponentPackageReference Type; + ComponentPackageReference (::XSCRT::XML::Element< ACE_TCHAR >&); + + virtual void + traverse (Type &o) + { + + this->traverse (const_cast <Type const &> (o)); + } + + + virtual void + traverse (Type const&); + + virtual void + requiredUUID (Type &o) + { + + this->requiredUUID (const_cast <Type const &> (o)); + } + + + virtual void + requiredUUID (Type const&); + + virtual void + requiredName (Type &o) + { + + this->requiredName (const_cast <Type const &> (o)); + } + + + virtual void + requiredName (Type const&); + + virtual void + requiredType (Type &o) + { + + this->requiredType (const_cast <Type const &> (o)); + } + + + virtual void + requiredType (Type const&); + + protected: + ComponentPackageReference (); + }; + struct SubcomponentInstantiationDescription : Traversal::SubcomponentInstantiationDescription, virtual ::XSCRT::Writer< ACE_TCHAR > { diff --git a/CIAO/tools/Config_Handlers/cpd.cpp b/CIAO/tools/Config_Handlers/cpd.cpp index 9ae5c83a9f3..c59e5e18fef 100644 --- a/CIAO/tools/Config_Handlers/cpd.cpp +++ b/CIAO/tools/Config_Handlers/cpd.cpp @@ -453,13 +453,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("referencedImplementation")) + else if (n == "referencedImplementation") { referencedImplementation_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ComponentImplementationDescription > (new ::CIAO::Config_Handlers::ComponentImplementationDescription (e)); referencedImplementation_->container (this); @@ -486,43 +486,43 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("realizes")) + else if (n == "realizes") { ::CIAO::Config_Handlers::ComponentInterfaceDescription t (e); realizes (t); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("implementation")) + else if (n == "implementation") { ::CIAO::Config_Handlers::PackagedComponentImplementation t (e); add_implementation (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); } - else if (n == ACE_TEXT ("contentLocation")) + else if (n == "contentLocation") { ::XMLSchema::string< ACE_TCHAR > t (e); contentLocation (t); @@ -537,7 +537,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("href")) + if (n == "href") { ::XMLSchema::string< ACE_TCHAR > t (a); href (t); @@ -1130,7 +1130,7 @@ namespace CIAO void PackagedComponentImplementation:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::PackagedComponentImplementation::name (o); pop_ (); } @@ -1138,7 +1138,7 @@ namespace CIAO void PackagedComponentImplementation:: referencedImplementation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("referencedImplementation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("referencedImplementation", top_ ())); Traversal::PackagedComponentImplementation::referencedImplementation (o); pop_ (); } @@ -1167,7 +1167,7 @@ namespace CIAO void ComponentPackageDescription:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::ComponentPackageDescription::label (o); pop_ (); } @@ -1175,7 +1175,7 @@ namespace CIAO void ComponentPackageDescription:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::ComponentPackageDescription::UUID (o); pop_ (); } @@ -1183,7 +1183,7 @@ namespace CIAO void ComponentPackageDescription:: realizes (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("realizes"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("realizes", top_ ())); Traversal::ComponentPackageDescription::realizes (o); pop_ (); } @@ -1191,7 +1191,7 @@ namespace CIAO void ComponentPackageDescription:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void ComponentPackageDescription:: @@ -1210,7 +1210,7 @@ namespace CIAO void ComponentPackageDescription:: implementation_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("implementation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("implementation", top_ ())); } void ComponentPackageDescription:: @@ -1229,7 +1229,7 @@ namespace CIAO void ComponentPackageDescription:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } void ComponentPackageDescription:: @@ -1248,7 +1248,7 @@ namespace CIAO void ComponentPackageDescription:: contentLocation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("contentLocation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("contentLocation", top_ ())); Traversal::ComponentPackageDescription::contentLocation (o); pop_ (); } @@ -1256,7 +1256,7 @@ namespace CIAO void ComponentPackageDescription:: href (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("href"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); attr_ (&a); Traversal::ComponentPackageDescription::href (o); attr_ (0); diff --git a/CIAO/tools/Config_Handlers/iad.cpp b/CIAO/tools/Config_Handlers/iad.cpp index fb199c1c5ca..e05cc1272b1 100644 --- a/CIAO/tools/Config_Handlers/iad.cpp +++ b/CIAO/tools/Config_Handlers/iad.cpp @@ -513,13 +513,13 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("name")) + if (n == "name") { name_ = ::std::auto_ptr< ::XMLSchema::string< ACE_TCHAR > > (new ::XMLSchema::string< ACE_TCHAR > (e)); name_->container (this); } - else if (n == ACE_TEXT ("referencedArtifact")) + else if (n == "referencedArtifact") { referencedArtifact_ = ::std::auto_ptr< ::CIAO::Config_Handlers::ImplementationArtifactDescription > (new ::CIAO::Config_Handlers::ImplementationArtifactDescription (e)); referencedArtifact_->container (this); @@ -546,49 +546,49 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("location")) + else if (n == "location") { ::XMLSchema::string< ACE_TCHAR > t (e); add_location (t); } - else if (n == ACE_TEXT ("dependsOn")) + else if (n == "dependsOn") { ::CIAO::Config_Handlers::NamedImplementationArtifact t (e); add_dependsOn (t); } - else if (n == ACE_TEXT ("execParameter")) + else if (n == "execParameter") { ::CIAO::Config_Handlers::Property t (e); add_execParameter (t); } - else if (n == ACE_TEXT ("infoProperty")) + else if (n == "infoProperty") { ::CIAO::Config_Handlers::Property t (e); add_infoProperty (t); } - else if (n == ACE_TEXT ("deployRequirement")) + else if (n == "deployRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_deployRequirement (t); } - else if (n == ACE_TEXT ("contentLocation")) + else if (n == "contentLocation") { ::XMLSchema::string< ACE_TCHAR > t (e); contentLocation (t); @@ -603,7 +603,7 @@ namespace CIAO { ::XSCRT::XML::Attribute< ACE_TCHAR > a (p.next_attribute ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (a.name ())); - if (n == ACE_TEXT ("href")) + if (n == "href") { ::XMLSchema::string< ACE_TCHAR > t (a); href (t); @@ -1342,7 +1342,7 @@ namespace CIAO void NamedImplementationArtifact:: name (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("name"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("name", top_ ())); Traversal::NamedImplementationArtifact::name (o); pop_ (); } @@ -1350,7 +1350,7 @@ namespace CIAO void NamedImplementationArtifact:: referencedArtifact (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("referencedArtifact"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("referencedArtifact", top_ ())); Traversal::NamedImplementationArtifact::referencedArtifact (o); pop_ (); } @@ -1379,7 +1379,7 @@ namespace CIAO void ImplementationArtifactDescription:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::ImplementationArtifactDescription::label (o); pop_ (); } @@ -1387,7 +1387,7 @@ namespace CIAO void ImplementationArtifactDescription:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::ImplementationArtifactDescription::UUID (o); pop_ (); } @@ -1395,7 +1395,7 @@ namespace CIAO void ImplementationArtifactDescription:: location_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("location"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("location", top_ ())); } void ImplementationArtifactDescription:: @@ -1414,7 +1414,7 @@ namespace CIAO void ImplementationArtifactDescription:: dependsOn_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("dependsOn"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("dependsOn", top_ ())); } void ImplementationArtifactDescription:: @@ -1433,7 +1433,7 @@ namespace CIAO void ImplementationArtifactDescription:: execParameter_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("execParameter"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("execParameter", top_ ())); } void ImplementationArtifactDescription:: @@ -1452,7 +1452,7 @@ namespace CIAO void ImplementationArtifactDescription:: infoProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("infoProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("infoProperty", top_ ())); } void ImplementationArtifactDescription:: @@ -1471,7 +1471,7 @@ namespace CIAO void ImplementationArtifactDescription:: deployRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("deployRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("deployRequirement", top_ ())); } void ImplementationArtifactDescription:: @@ -1490,7 +1490,7 @@ namespace CIAO void ImplementationArtifactDescription:: contentLocation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("contentLocation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("contentLocation", top_ ())); Traversal::ImplementationArtifactDescription::contentLocation (o); pop_ (); } @@ -1498,7 +1498,7 @@ namespace CIAO void ImplementationArtifactDescription:: href (Type const& o) { - ::XSCRT::XML::Attribute< ACE_TCHAR > a (ACE_TEXT ("href"), ACE_TEXT (""), top_ ()); + ::XSCRT::XML::Attribute< ACE_TCHAR > a ("href", "", top_ ()); attr_ (&a); Traversal::ImplementationArtifactDescription::href (o); attr_ (0); diff --git a/CIAO/tools/Config_Handlers/pcd.cpp b/CIAO/tools/Config_Handlers/pcd.cpp index 3b16717d996..b74723f1265 100644 --- a/CIAO/tools/Config_Handlers/pcd.cpp +++ b/CIAO/tools/Config_Handlers/pcd.cpp @@ -473,7 +473,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("location")) + if (n == "location") { ::XMLSchema::string< ACE_TCHAR > t (e); add_location (t); @@ -500,55 +500,55 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("label")) + if (n == "label") { ::XMLSchema::string< ACE_TCHAR > t (e); label (t); } - else if (n == ACE_TEXT ("UUID")) + else if (n == "UUID") { ::XMLSchema::string< ACE_TCHAR > t (e); UUID (t); } - else if (n == ACE_TEXT ("basePackage")) + else if (n == "basePackage") { ::CIAO::Config_Handlers::ComponentPackageDescription t (e); basePackage (t); } - else if (n == ACE_TEXT ("specializedConfig")) + else if (n == "specializedConfig") { ::CIAO::Config_Handlers::PackageConfiguration t (e); specializedConfig (t); } - else if (n == ACE_TEXT ("importedPackage")) + else if (n == "importedPackage") { ::CIAO::Config_Handlers::ComponentPackageImport t (e); importedPackage (t); } - else if (n == ACE_TEXT ("referencedPackage")) + else if (n == "referencedPackage") { ::CIAO::Config_Handlers::ComponentPackageReference t (e); referencedPackage (t); } - else if (n == ACE_TEXT ("selectRequirement")) + else if (n == "selectRequirement") { ::CIAO::Config_Handlers::Requirement t (e); add_selectRequirement (t); } - else if (n == ACE_TEXT ("configProperty")) + else if (n == "configProperty") { ::CIAO::Config_Handlers::Property t (e); add_configProperty (t); } - else if (n == ACE_TEXT ("contentLocation")) + else if (n == "contentLocation") { ::XMLSchema::string< ACE_TCHAR > t (e); contentLocation (t); @@ -1151,7 +1151,7 @@ namespace CIAO void ComponentPackageImport:: location_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("location"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("location", top_ ())); } void ComponentPackageImport:: @@ -1191,7 +1191,7 @@ namespace CIAO void PackageConfiguration:: label (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("label"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("label", top_ ())); Traversal::PackageConfiguration::label (o); pop_ (); } @@ -1199,7 +1199,7 @@ namespace CIAO void PackageConfiguration:: UUID (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("UUID"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("UUID", top_ ())); Traversal::PackageConfiguration::UUID (o); pop_ (); } @@ -1207,7 +1207,7 @@ namespace CIAO void PackageConfiguration:: basePackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("basePackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("basePackage", top_ ())); Traversal::PackageConfiguration::basePackage (o); pop_ (); } @@ -1215,7 +1215,7 @@ namespace CIAO void PackageConfiguration:: specializedConfig (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("specializedConfig"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("specializedConfig", top_ ())); Traversal::PackageConfiguration::specializedConfig (o); pop_ (); } @@ -1223,7 +1223,7 @@ namespace CIAO void PackageConfiguration:: importedPackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("importedPackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("importedPackage", top_ ())); Traversal::PackageConfiguration::importedPackage (o); pop_ (); } @@ -1231,7 +1231,7 @@ namespace CIAO void PackageConfiguration:: referencedPackage (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("referencedPackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("referencedPackage", top_ ())); Traversal::PackageConfiguration::referencedPackage (o); pop_ (); } @@ -1239,7 +1239,7 @@ namespace CIAO void PackageConfiguration:: selectRequirement_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("selectRequirement"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("selectRequirement", top_ ())); } void PackageConfiguration:: @@ -1258,7 +1258,7 @@ namespace CIAO void PackageConfiguration:: configProperty_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("configProperty"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("configProperty", top_ ())); } void PackageConfiguration:: @@ -1277,7 +1277,7 @@ namespace CIAO void PackageConfiguration:: contentLocation (Type const& o) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("contentLocation"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("contentLocation", top_ ())); Traversal::PackageConfiguration::contentLocation (o); pop_ (); } diff --git a/CIAO/tools/Config_Handlers/test.cpp b/CIAO/tools/Config_Handlers/test.cpp index 4dddadccde6..fd50374aa7e 100644 --- a/CIAO/tools/Config_Handlers/test.cpp +++ b/CIAO/tools/Config_Handlers/test.cpp @@ -5,18 +5,16 @@ #include "Deployment.hpp" #include "DP_Handler.h" #include "DAnCE/Deployment/Deployment_DataC.h" -#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" #include "ace/Get_Opt.h" -#include "Utils/XML_Helper.h" -#include "DnC_Dump.h" +#include "Utils/XML_Typedefs.h" #include "tao/ORB.h" -static const ACE_TCHAR *input_file = ACE_TEXT ("BasicSP.cdp"); +static const char *input_file = "BasicSP.cdp"; static int -parse_args (int argc, ACE_TCHAR *argv[]) +parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("i:")); + ACE_Get_Opt get_opts (argc, argv, "i:"); int c; @@ -56,14 +54,12 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_UNUSED_ARG (orb); //Create an XML_Helper for all the file work - XML_Helper the_helper; - std::auto_ptr<xercesc::DOMDocument> doc ( - the_helper.create_dom (ACE_TEXT_ALWAYS_CHAR (input_file))); - if (doc.get ()) + if (xercesc::DOMDocument *doc = + XML_Helper::XML_HELPER.create_dom (input_file)) { //Read in the XSC type structure from the DOMDocument - DeploymentPlan dp = deploymentPlan (doc.get ()); + DeploymentPlan dp = deploymentPlan (doc); //Convert the XSC to an IDL datatype @@ -72,24 +68,27 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) std::cout << "Instance document import succeeded. Dumping contents to file\n"; //Retrieve the newly created IDL structure - std::auto_ptr<Deployment::DeploymentPlan> idl (dp_handler.plan()); + Deployment::DeploymentPlan *idl = dp_handler.plan(); // Check for server resources, if present.... - check_srd (*idl.get()); + check_srd (*idl); //Convert it back to an XSC structure with a new DP_Handler - DP_Handler reverse_handler(*idl.get()); + DP_Handler reverse_handler(*idl); //Create a new DOMDocument for writing the XSC into XML - std::auto_ptr<xercesc::DOMDocument> the_xsc (the_helper.create_dom(0)); + xercesc::DOMDocument* the_xsc + (XML_Helper::XML_HELPER.create_dom(0)); //Serialize the XSC into a DOMDocument - std::auto_ptr<DeploymentPlan> plan (reverse_handler.xsc()); - deploymentPlan(*plan.get(), the_xsc.get()); + deploymentPlan(*reverse_handler.xsc(), the_xsc); //Write it to test.xml - the_helper.write_DOM(the_xsc.get(), ACE_TEXT ("test.xml")); + XML_Helper::XML_HELPER.write_DOM(the_xsc, "test.xml"); + + //Cleanliness is next to Godliness + delete doc; } std::cout << "Test completed!\n"; diff --git a/CIAO/tools/Config_Handlers/toplevel.cpp b/CIAO/tools/Config_Handlers/toplevel.cpp index c5f35c34778..4a06443d8fb 100644 --- a/CIAO/tools/Config_Handlers/toplevel.cpp +++ b/CIAO/tools/Config_Handlers/toplevel.cpp @@ -114,7 +114,7 @@ namespace CIAO ::XSCRT::XML::Element< ACE_TCHAR > e (p.next_element ()); ::std::basic_string< ACE_TCHAR > n (::XSCRT::XML::uq_name (e.name ())); - if (n == ACE_TEXT ("basePackage")) + if (n == "basePackage") { ::CIAO::Config_Handlers::PackageConfiguration t (e); add_basePackage (t); @@ -311,7 +311,7 @@ namespace CIAO void TopLevelPackageDescription:: basePackage_pre (Type const&) { - push_ (::XSCRT::XML::Element< ACE_TCHAR > (ACE_TEXT ("basePackage"), top_ ())); + push_ (::XSCRT::XML::Element< ACE_TCHAR > ("basePackage", top_ ())); } void TopLevelPackageDescription:: diff --git a/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp b/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp index 4bced5655f1..e0d6ff98a1e 100644 --- a/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp +++ b/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp @@ -41,7 +41,7 @@ #include "ace/ACE.h" #include "Literals.h" -#include "Config_Handlers/Utils/XercesString.h" +#include "XML/XercesString.h" #include <iostream> #include <limits> @@ -49,14 +49,14 @@ #include "xercesc/dom/DOM.hpp" -#include "Config_Handlers/Utils/XML_Helper.h" +#include "XML/XML_Helper.h" using XERCES_CPP_NAMESPACE::DOMDocument; using XERCES_CPP_NAMESPACE::DOMAttr; using XERCES_CPP_NAMESPACE::DOMElement; using XERCES_CPP_NAMESPACE::DOMText; using XERCES_CPP_NAMESPACE::DOMDocumentType; -using CIAO::Config_Handlers::XStr; +using CIAO::XML::XStr; @@ -1711,8 +1711,11 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "Opening %C\n", target_name.c_str ())); - - CIAO::Config_Handlers::XML_Helper helper; + + CIAO::XML::NoOp_Resolver res_func; + CIAO::XML::XML_Schema_Resolver<> resolver (res_func); + CIAO::XML::XML_Error_Handler handler; + CIAO::XML::XML_Helper<> helper (resolver, handler); // Create XML document std::auto_ptr<DOMDocumentType> doctype ( diff --git a/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h b/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h index ccd06d7ee85..210d814ffa0 100644 --- a/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h +++ b/CIAO/tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h @@ -25,7 +25,7 @@ #include "utl_scoped_name.h" #include "Literals.h" -#include "Config_Handlers/Utils/XercesString.h" +#include "XML/XercesString.h" #include "CIAO_IDL3_TO_XMI_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -224,7 +224,7 @@ namespace CIAO ACE_TCHAR * union_label_value (AST_Expression *exp); typedef ACE_Hash_Map_Manager_Ex< ACE_TString, - CIAO::Config_Handlers::XStr, + CIAO::XML::XStr, ACE_Hash <ACE_TString>, ACE_Equal_To <ACE_TString>, ACE_Null_Mutex > XMI_ID_MAP; @@ -277,7 +277,7 @@ namespace CIAO XERCES_CPP_NAMESPACE::DOMElement *associations_; - const CIAO::Config_Handlers::XStr base_id_; + const CIAO::XML::XStr base_id_; /// true if for some reason the generated output is bad /// and shouldn't be written. diff --git a/CIAO/tools/IDL3_to_XMI/IR_Simulator_visitor.h b/CIAO/tools/IDL3_to_XMI/IR_Simulator_visitor.h index 78b2b0a7ba5..49b8f202449 100644 --- a/CIAO/tools/IDL3_to_XMI/IR_Simulator_visitor.h +++ b/CIAO/tools/IDL3_to_XMI/IR_Simulator_visitor.h @@ -23,7 +23,7 @@ #include "ast_component.h" #include "utl_scoped_name.h" #include "Literals.h" -#include "Config_Handlers/Utils/XercesString.h" +#include "XML/XercesString.h" #include "CIAO_IDL3_TO_XMI_Export.h" diff --git a/CIAO/tools/XML/CIAO_XML_Utils_Export.h b/CIAO/tools/XML/CIAO_XML_Utils_Export.h new file mode 100644 index 00000000000..f4f3ec3a1cd --- /dev/null +++ b/CIAO/tools/XML/CIAO_XML_Utils_Export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl CIAO_XML_Utils +// ------------------------------ +#ifndef CIAO_XML_UTILS_EXPORT_H +#define CIAO_XML_UTILS_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (CIAO_XML_UTILS_HAS_DLL) +# define CIAO_XML_UTILS_HAS_DLL 1 +#endif /* ! CIAO_XML_UTILS_HAS_DLL */ + +#if defined (CIAO_XML_UTILS_HAS_DLL) && (CIAO_XML_UTILS_HAS_DLL == 1) +# if defined (CIAO_XML_UTILS_BUILD_DLL) +# define CIAO_XML_Utils_Export ACE_Proper_Export_Flag +# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* CIAO_XML_UTILS_BUILD_DLL */ +# define CIAO_XML_Utils_Export ACE_Proper_Import_Flag +# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* CIAO_XML_UTILS_BUILD_DLL */ +#else /* CIAO_XML_UTILS_HAS_DLL == 1 */ +# define CIAO_XML_Utils_Export +# define CIAO_XML_UTILS_SINGLETON_DECLARATION(T) +# define CIAO_XML_UTILS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* CIAO_XML_UTILS_HAS_DLL == 1 */ + +// Set CIAO_XML_UTILS_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (CIAO_XML_UTILS_NTRACE) +# if (ACE_NTRACE == 1) +# define CIAO_XML_UTILS_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define CIAO_XML_UTILS_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !CIAO_XML_UTILS_NTRACE */ + +#if (CIAO_XML_UTILS_NTRACE == 1) +# define CIAO_XML_UTILS_TRACE(X) +#else /* (CIAO_XML_UTILS_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define CIAO_XML_UTILS_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (CIAO_XML_UTILS_NTRACE == 1) */ + +#endif /* CIAO_XML_UTILS_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/tools/XML/XML.mpc b/CIAO/tools/XML/XML.mpc new file mode 100644 index 00000000000..398f2cfdd55 --- /dev/null +++ b/CIAO/tools/XML/XML.mpc @@ -0,0 +1,13 @@ +// $Id$ + +project (CIAO_XML_Utils) : acelib, xerces, ciao_lib { + sharedname += CIAO_XML_Utils + dynamicflags = CIAO_XML_UTILS_BUILD_DLL + includes += .. + + Source_Files { + XML_Error_Handler.cpp + XercesString.cpp + XML_Schema_Resolver.cpp + } +} diff --git a/CIAO/tools/XML/XML_Error_Handler.cpp b/CIAO/tools/XML/XML_Error_Handler.cpp new file mode 100644 index 00000000000..ba24b817649 --- /dev/null +++ b/CIAO/tools/XML/XML_Error_Handler.cpp @@ -0,0 +1,70 @@ +// $Id$ + +#include "XML_Error_Handler.h" +#include "ace/Log_Msg.h" +#include "ace/Auto_Ptr.h" +#include <xercesc/util/XMLString.hpp> +#include <xercesc/dom/DOMLocator.hpp> +#include <xercesc/sax/SAXParseException.hpp> +#include "XercesString.h" +#include <iostream> + +using xercesc::SAXParseException; + +namespace CIAO +{ + namespace XML + { + XML_Error_Handler::XML_Error_Handler (void) + : errors_ (false) + { + } + + XML_Error_Handler::~XML_Error_Handler() + { + } + + void XML_Error_Handler::warning(const SAXParseException& toCatch) + { + XStr file (toCatch.getSystemId ()); + XStr msg (toCatch.getMessage ()); + + std::cerr << "Warning: " << file << ':' << toCatch.getLineNumber () + << ':' << toCatch.getColumnNumber () << " - " + << msg << std::endl; + } + + void XML_Error_Handler::error(const SAXParseException& toCatch) + { + XStr file (toCatch.getSystemId ()); + XStr msg (toCatch.getMessage ()); + + std::cerr << "Error: " << file << ':' << toCatch.getLineNumber () + << ':' << toCatch.getColumnNumber () << " - " + << msg << std::endl; + this->errors_ = true; + } + + void XML_Error_Handler::fatalError(const SAXParseException& toCatch) + { + XStr file (toCatch.getSystemId ()); + XStr msg (toCatch.getMessage ()); + + std::cerr << "Fatal Error: " << file << ':' << toCatch.getLineNumber () + << ':' << toCatch.getColumnNumber () << " - " + << msg << std::endl; + this->errors_ = true; + } + + void XML_Error_Handler::resetErrors() + { + this->errors_ = false; + } + + bool + XML_Error_Handler::getErrors (void) const + { + return this->errors_; + } + } +} diff --git a/CIAO/tools/XML/XML_Error_Handler.h b/CIAO/tools/XML/XML_Error_Handler.h new file mode 100644 index 00000000000..7cc65bf86a1 --- /dev/null +++ b/CIAO/tools/XML/XML_Error_Handler.h @@ -0,0 +1,63 @@ +//============================================================== +/** + * @file XML_Error_Handler.h + * + * $Id$ + * + * @brief Error handler for Xerces + * + * @author Bala Natarajan <bala@dre.vanderbilt.edu> + */ +//================================================================ +#ifndef CIAO_XML_ERROR_HANDLER_H +#define CIAO_XML_ERROR_HANDLER_H + +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "XML/CIAO_XML_Utils_Export.h" + +#include <xercesc/sax/ErrorHandler.hpp> + +using xercesc::SAXParseException; + +namespace CIAO +{ + namespace XML + { + /** + * @class XML_Error_Hander + * + * @brief Error handler for XERCES + * + */ + class CIAO_XML_Utils_Export XML_Error_Handler + : public xercesc::ErrorHandler + { + public: + + XML_Error_Handler (void); + + ~XML_Error_Handler (void); + + void warning(const SAXParseException& toCatch); + void error(const SAXParseException& toCatch); + void fatalError(const SAXParseException& toCatch); + void resetErrors(); + bool getErrors (void) const; + private : + // Disallow copying + XML_Error_Handler (const XML_Error_Handler&); + XML_Error_Handler& operator= (const XML_Error_Handler&); + + bool errors_; + }; + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_XML_ERROR_HANDLER_H*/ diff --git a/CIAO/tools/XML/XML_Helper.h b/CIAO/tools/XML/XML_Helper.h new file mode 100644 index 00000000000..69f887cbe40 --- /dev/null +++ b/CIAO/tools/XML/XML_Helper.h @@ -0,0 +1,100 @@ +// $Id$ +//============================================================ +/** + * @file XML_Helper.h + * + * @brief Some helper functions for XML + * + * @author Bala Natarajan <bala@dre.vanderbilt.edu> + * @author William R. Otte <wotte@dre.vanderbilt.edu> + */ +//============================================================ +#ifndef CIAO_XML_HELPER_H +#define CIAO_XML_HELPER_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "XML/CIAO_XML_Utils_Export.h" +#include "XML/XML_Error_Handler.h" +#include "XML/XML_Schema_Resolver.h" + +#include "xercesc/util/XercesDefs.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" + +#include <memory> + +namespace XERCES_CPP_NAMESPACE +{ + class DOMDocument; + class DOMWriter; + class DOMImplementation; + class DOMDocumentType; +} + +namespace CIAO +{ + namespace XML + { + /** + * @class XML_Helper + * + * @brief Helper class for some routine XML stuff. + */ + template <typename Resolver = XML_Schema_Resolver <>, + typename Error_Handler = XML_Error_Handler> + class XML_Helper + { + public: + // XML_Helper (void); + + // Initialize the resolver we should use. + XML_Helper (Resolver &resolver, Error_Handler &eh); + + ~XML_Helper (void); + + /// Create a DOM tree + XERCES_CPP_NAMESPACE::DOMDocument * + create_dom (const ACE_TCHAR *uri) const; + + XERCES_CPP_NAMESPACE::DOMDocument * + create_dom (const ACE_TCHAR *root, + const ACE_TCHAR *ns, + XERCES_CPP_NAMESPACE::DOMDocumentType * doctype = 0) const; + + XERCES_CPP_NAMESPACE::DOMDocumentType * + create_doctype (const ACE_TCHAR *qn, + const ACE_TCHAR *pid, + const ACE_TCHAR *sid) const; + + //Writes out a DOMDocument to an XML file + bool write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, + const ACE_TCHAR *file) const; + + bool is_initialized (void) const; + + protected: + /// Intialize the parser + void init_parser (void); + + /// Terminate the parser + void terminate_parser (void); + + private: + bool initialized_; + XERCES_CPP_NAMESPACE::DOMImplementation *impl_; + mutable std::auto_ptr<XERCES_CPP_NAMESPACE::XercesDOMParser> parser_; + + Resolver &resolver_; + Error_Handler &e_handler_; + }; + + + } +} + +#include "XML_Helper.tpp" + +#include /**/ "ace/post.h" +#endif/*CIAO_CONFIG_HANDLERS_XML_HELPER_H*/ diff --git a/CIAO/tools/XML/XML_Helper.tpp b/CIAO/tools/XML/XML_Helper.tpp new file mode 100644 index 00000000000..7c4b25d6439 --- /dev/null +++ b/CIAO/tools/XML/XML_Helper.tpp @@ -0,0 +1,271 @@ +//$Id$ +#include "XML_Helper.h" +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" +#include "ciao/Logger/Log_Macros.h" +#include "xercesc/util/XMLUniDefs.hpp" +#include "xercesc/dom/DOM.hpp" +#include "XML_Error_Handler.h" +#include "XML_Schema_Resolver.h" +#include "xercesc/framework/LocalFileFormatTarget.hpp" +#include "XercesString.h" + +namespace CIAO +{ + namespace XML + { + using xercesc::XMLException; + using xercesc::XMLString; + using xercesc::DOMImplementation; + using xercesc::DOMImplementationRegistry; +// using xercesc::DOMBuilder; + using xercesc::DOMImplementationLS; + using xercesc::XMLUni; + using xercesc::DOMDocument; + using xercesc::DOMException; + using xercesc::DOMDocumentType; + using xercesc::XercesDOMParser; +/* + template <typename Resolver, typename Error> + XML_Helper<Resolver, Error>::XML_Helper (void) + : initialized_ (false) + { + this->init_parser (); + } +*/ + // TODO this is stub implementation + template <typename Resolver, typename Error> + XML_Helper<Resolver, Error>::XML_Helper (Resolver &resolver, Error &eh) + : initialized_ (false), + resolver_ (resolver), + e_handler_ (eh) + { + this->init_parser (); + } + + template <typename Resolver, typename Error> + XML_Helper<Resolver, Error>::~XML_Helper (void) + { + this->terminate_parser (); + } + + template <typename Resolver, typename Error> + bool + XML_Helper<Resolver, Error>::is_initialized (void) const + { + return this->initialized_ == true; + } + + template <typename Resolver, typename Error> + void + XML_Helper<Resolver, Error>::init_parser (void) + { + if (this->initialized_) + return; + + CIAO_DEBUG ((LM_TRACE, CLINFO + "XML_Helper<>::is_initialized - Initializing the Xerces runtime \n")); + // Initialize the Xerces run-time + try + { + xercesc::XMLPlatformUtils::Initialize(); + } + catch (const XMLException& e) + { + char* message = + XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + + throw; + } + catch (...) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Some other exception," + " returning\n")); + + return; + } + + // Instantiate the DOM parser. + static const XMLCh gLS[] = { xercesc::chLatin_L, + xercesc::chLatin_S, + xercesc::chNull }; + + // Get an implementation of the Load-Store (LS) interface + // and cache it for later use + impl_ = + DOMImplementationRegistry::getDOMImplementation(gLS); + + this->initialized_ = true; + return; + } + + template <typename Resolver, typename Error> + XERCES_CPP_NAMESPACE::DOMDocument * + XML_Helper<Resolver, Error>::create_dom (const ACE_TCHAR *root, + const ACE_TCHAR *ns, + DOMDocumentType *doctype) const + { + if (root == 0 || ns == 0) + return 0; + + return this->impl_->createDocument (XStr (ns), + XStr (root), + doctype); + } + + template <typename Resolver, typename Error> + XERCES_CPP_NAMESPACE::DOMDocumentType * + XML_Helper<Resolver, Error>::create_doctype (const ACE_TCHAR *qn, + const ACE_TCHAR *pid, + const ACE_TCHAR *sid) const + { + return this->impl_->createDocumentType (XStr (qn), + XStr (pid), + XStr (sid)); + } + template <typename Resolver, typename Error> + XERCES_CPP_NAMESPACE::DOMDocument * + XML_Helper<Resolver, Error>::create_dom (const ACE_TCHAR *url) const + { + + if (url == 0) + return 0; + + try + { + if (this->parser_.get () == 0) + this->parser_.reset ((new xercesc::XercesDOMParser ())); + + // Perform Namespace processing. + this->parser_->setDoNamespaces (true); + + // Discard comment nodes in the document + this->parser_->setCreateCommentNodes (false); + + // Disable datatype normalization. The XML 1.0 attribute value + // normalization always occurs though. + // this->parser_->setFeature (XMLUni::fgDOMDatatypeNormalization, true); + + // Do not create EntityReference nodes in the DOM tree. No + // EntityReference nodes will be created, only the nodes + // corresponding to their fully expanded sustitution text will be + // created. + this->parser_->setCreateEntityReferenceNodes (false); + + // Perform Validation + this->parser_->setValidationScheme (xercesc::AbstractDOMParser::Val_Always); + + // Do not include ignorable whitespace in the DOM tree. + this->parser_->setIncludeIgnorableWhitespace (false); + + // Enable the parser's schema support. + this->parser_->setDoSchema (true); + + // Enable full schema constraint checking, including checking which + // may be time-consuming or memory intensive. Currently, particle + // unique attribution constraint checking and particle derivation + // restriction checking are controlled by this option. + this->parser_->setValidationSchemaFullChecking (true); + + // The parser will treat validation error as fatal and will exit. + this->parser_->setValidationConstraintFatal (true); + + this->parser_->setErrorHandler (&e_handler_); + + this->parser_->setEntityResolver (&resolver_); + + this->parser_->parse (url); + + if (e_handler_.getErrors ()) + return 0; + + return this->parser_->getDocument (); + } + catch (const DOMException& e) + { + const unsigned int maxChars = 2047; + XMLCh errText[maxChars + 1]; + + if (DOMImplementation::loadDOMExceptionMsg (e.code, + errText, + maxChars)) + { + char* message = + XMLString::transcode (errText); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + } + return 0; + + } + catch (const XMLException& e) + { + char* message = XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + throw 0; + } + catch (...) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Caught an unknown exception \n")); + throw; + } + + return 0; + } + + template <typename Resolver, typename Error> + void + XML_Helper<Resolver, Error>::terminate_parser (void) + { + try + { + xercesc::XMLPlatformUtils::Terminate(); + } + catch (const XMLException& e) + { + char* message = + XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + throw; + } + + this->initialized_ = false; + return; + } + + template <typename Resolver, typename Error> + bool + XML_Helper<Resolver, Error>::write_DOM (XERCES_CPP_NAMESPACE::DOMDocument *doc, + const ACE_TCHAR *file) const + { + /*try + {*/ + throw 1; + /* @@TODO: Reimplement for xerces 3. + } + catch (const xercesc::XMLException &e) + { + char* message = + XMLString::transcode (e.getMessage()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_message (message); + + char* name = + XMLString::transcode (e.getType()); + ACE_Auto_Basic_Array_Ptr<char> cleanup_name (name); + + ACE_ERROR ((LM_ERROR, "Caught exception while serializing DOM to file.\n" + "Name: %s\n" + "Message: %s\n" + "SrcFile: %s\n" + "SrcLine: %d\n", + name, + message, + e.getSrcFile (), + e.getSrcLine ())); + return false; + }*/ + } + } +} diff --git a/CIAO/tools/XML/XML_Schema_Resolver.cpp b/CIAO/tools/XML/XML_Schema_Resolver.cpp new file mode 100644 index 00000000000..4157b79bbe2 --- /dev/null +++ b/CIAO/tools/XML/XML_Schema_Resolver.cpp @@ -0,0 +1,76 @@ +#include <xercesc/util/PlatformUtils.hpp> +#include <xercesc/util/XercesDefs.hpp> + +#include "XML/XML_Schema_Resolver.h" +#include "XML/XercesString.h" + +#include "ace/Env_Value_T.h" + + +#include <iostream> + +namespace CIAO +{ + namespace XML + { + Basic_Resolver::Basic_Resolver (const ACE_TCHAR *path) + : path_ (path) + { + } + + XMLCh * + Basic_Resolver::operator() (const XMLCh *const, + const XMLCh *const systemId) const + { + XStr path (path_); + path.append (systemId); + return path.release (); + } + + Environment_Resolver::Environment_Resolver (const ACE_TCHAR *variable, + const ACE_TCHAR *relpath) + { + xercesc::XMLPlatformUtils::Initialize(); + this->add_path (variable, relpath); + } + + using xercesc::XMLPlatformUtils; + + void + Environment_Resolver::add_path (const ACE_TCHAR *variable, + const ACE_TCHAR *relpath) + { + ACE_Env_Value <const ACE_TCHAR *> path_env (variable, + ACE_TEXT("")); + + XStr xpath (path_env); + XStr xrelpath (relpath); + + xpath.append (xrelpath); + + paths_.push_back (xpath); + } + + XMLCh * + Environment_Resolver::operator() (const XMLCh *const, + const XMLCh *const systemId) const + { + for (std::vector<XStr>::const_iterator i = this->paths_.begin (); + i != this->paths_.end (); + ++i) + { + XStr path (*i); + path.append(systemId); + + FileHandle file (XMLPlatformUtils::openFile (path)); + + if (file != 0) + { + XMLPlatformUtils::closeFile (file); + return path.release (); + } + } + return 0; + } + } +} diff --git a/CIAO/tools/XML/XML_Schema_Resolver.h b/CIAO/tools/XML/XML_Schema_Resolver.h new file mode 100644 index 00000000000..5ccc00c4bde --- /dev/null +++ b/CIAO/tools/XML/XML_Schema_Resolver.h @@ -0,0 +1,109 @@ +/** + * @file XML_Schema_Resolver.h + * @author Will Otte <wotte@dre.vanderbilt.edu> + * + * $Id$ + * + * Resolves schema locations. + */ + +#ifndef CIAO_XML_SCHEMA_RESOLVER_H +#define CIAO_XML_SCHEMA_RESOLVER_H +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "XML/CIAO_XML_Utils_Export.h" +#include "XML/XercesString.h" + +#include <xercesc/sax/EntityResolver.hpp> +#include <vector> +#include <string> + +using namespace xercesc; + +namespace CIAO +{ + namespace XML + { + // forward decl. + struct NoOp_Resolver; + + /** + * @class CIAO_Schema_Resolver + * @brief Resolves schema locations for CIAO. + * + * Template argument Resolver should be a functor with an operation + * const ACE_TCHAR * operator () (...arguments from resolveEntity...) + */ + template <typename Resolver = NoOp_Resolver> + class XML_Schema_Resolver + : public virtual EntityResolver + { + public: + XML_Schema_Resolver (void); + + XML_Schema_Resolver (Resolver &resolver); + + /// This function is called by the Xerces infrastructure to + /// actually resolve the location of a schema. + virtual InputSource * resolveEntity (const XMLCh *const publicId, + const XMLCh *const systemId); + + private: + XML_Schema_Resolver (XML_Schema_Resolver<Resolver> &); + + Resolver &resolver_; + }; + + /** + * @class NoOp_Resolver + * @brief Resolver that does nothing. + */ + struct NoOp_Resolver + { + const XMLCh* operator() (const XMLCh *const, + const XMLCh *const systemId) const + { return systemId; }; + }; + + /** + * @class Basic_Resolver + * @brief Resolves a schema location from a fixed path. + */ + struct Basic_Resolver + { + Basic_Resolver (const ACE_TCHAR *path); + + XMLCh* operator() (const XMLCh *const publicId, + const XMLCh *const systemId) const; + XStr path_; + }; + + /** + * @class Environment_Resolver + * @brief Resolves a schema location from a path from an environment variable. + */ + struct CIAO_XML_Utils_Export Environment_Resolver + { + Environment_Resolver (const ACE_TCHAR *variable = "", + const ACE_TCHAR *path = "./"); + + void add_path (const ACE_TCHAR *variable, + const ACE_TCHAR *path); + + XMLCh* operator() (const XMLCh *const publicId, + const XMLCh *const systemId) const; + + std::vector<XStr> paths_; + }; + } +} + +#include "XML/XML_Schema_Resolver.tpp" + +#include /**/ "ace/post.h" + +#endif /* CIAO_XML_SCHEMA_RESOLVER_H */ diff --git a/CIAO/tools/XML/XML_Schema_Resolver.tpp b/CIAO/tools/XML/XML_Schema_Resolver.tpp new file mode 100644 index 00000000000..13ff6915e6b --- /dev/null +++ b/CIAO/tools/XML/XML_Schema_Resolver.tpp @@ -0,0 +1,48 @@ +// $Id$ +#ifndef XML_SCHEMA_RESOLVER_TPP +#define XML_SCHEMA_RESOLVER_TPP + +#include "XML/XML_Schema_Resolver.h" +#include "XML/XercesString.h" + +#include <xercesc/framework/LocalFileInputSource.hpp> +#include <xercesc/framework/Wrapper4InputSource.hpp> + +using xercesc::Wrapper4InputSource; +using xercesc::LocalFileInputSource; + + +namespace CIAO +{ + namespace XML + { + template<typename Resolver> + XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (void) + : resolver_ () + { + } + + template<typename Resolver> + XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (Resolver &res) + : resolver_ (res) + { + } + + /// This function is called by the Xerces infrastructure to + /// actually resolve the location of a schema. + template<typename Resolver> + InputSource * + XML_Schema_Resolver<Resolver>::resolveEntity (const XMLCh *const publicId, + const XMLCh *const systemId) + { + XStr path = resolver_ (publicId, systemId); + if (path.begin () == 0) + return 0; + + // Ownership of these objects is given to other people. + return /*new Wrapper4InputSource*/ (new LocalFileInputSource (path)); + } + } +} + +#endif /*XML_SCHEMA_RESOLVER_TPP*/ diff --git a/CIAO/tools/XML/XercesString.cpp b/CIAO/tools/XML/XercesString.cpp new file mode 100644 index 00000000000..e66d4b891ad --- /dev/null +++ b/CIAO/tools/XML/XercesString.cpp @@ -0,0 +1,151 @@ +// $Id$ + +#include <ostream> +#include <algorithm> + +#include "XercesString.h" +using xercesc::XMLString; + +namespace CIAO +{ + namespace XML + { + + XStr::XStr (const char* str) + : _wstr(0) + { + _wstr = XMLString::transcode(str); + } + + XStr::XStr (XMLCh *wstr) + : _wstr(wstr) + { + + } + + XStr::XStr (const XMLCh* wstr) + : _wstr(0) + { + _wstr = XMLString::replicate(wstr); + } + + XStr::XStr (const XStr &right) + : _wstr(0) + { + _wstr = XMLString::replicate(right._wstr); + } + + XStr& XStr::operator= (const XStr& rhs) + { + if (&rhs == this) + return *this; + XStr temp (rhs); + std::swap (this->_wstr, temp._wstr); + return *this; + } + + XStr::~XStr () + { + if (_wstr) + XMLString::release(&_wstr); + } + + const XMLCh* XStr::begin () const + { + return _wstr; + } + + const XMLCh* XStr::end () const + { + return _wstr + size(); + } + + bool XStr::append(const XMLCh *tail) + { + int iTailLen = XMLString::stringLen(tail); + int iWorkLen = XMLString::stringLen(_wstr); + XMLCh *result = new XMLCh[ iWorkLen + iTailLen + 1 ]; + bool bOK = result != 0; + if (bOK) + { + XMLCh *target = result; + XMLString::moveChars(target, _wstr, iWorkLen); + target += iWorkLen; + XMLString::moveChars(target, tail, iTailLen); + target += iTailLen; + *target++ = 0; + XMLString::release(&_wstr); + _wstr = result; + } + return bOK; + } + + bool XStr::erase(const XMLCh *head, const XMLCh *tail) + { + bool bOK = head <= tail && head >= begin() && tail <= end(); + if (bOK) + { + XMLCh *result = new XMLCh[ size() - (tail - head) + 1 ]; + XMLCh *target = result; + bOK = target != 0; + if (bOK) + { + const XMLCh *cursor = begin(); + + while (cursor != head) *target++ = *cursor++; + cursor = tail; + while ( cursor != end() ) *target++ = *cursor++; + *target ++ = 0; + XMLString::release(&_wstr); + _wstr = result; + } + } + return bOK; + } + + int XStr::size () const + { + return XMLString::stringLen(_wstr); + } + + XMLCh XStr::operator [] (const int i) + { + return _wstr[i]; + } + + XMLCh XStr::operator [] (const int i) const + { + return _wstr[i]; + } + + XMLCh * XStr::release (void) + { + XMLCh* tmp = _wstr; + this->_wstr = 0; + return tmp; + } + + bool operator== (const XStr& lhs, const XStr& rhs) + { + return XMLString::compareIString (lhs,rhs) == 0; + } + + bool operator!= (const XStr& lhs, const XStr& rhs) + { + return !operator==(lhs, rhs); + } + + + std::ostream& + operator<< (std::ostream& o, XStr const& str) + { + char* s = XMLString::transcode (str); + + o << s; + + XMLString::release (&s); // idiots? + return o; + } + + } +} diff --git a/CIAO/tools/XML/XercesString.h b/CIAO/tools/XML/XercesString.h new file mode 100644 index 00000000000..11aa6fa7c4d --- /dev/null +++ b/CIAO/tools/XML/XercesString.h @@ -0,0 +1,74 @@ +// $Id$ + +#ifndef _XERCESSTRING_H +#define _XERCESSTRING_H + +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include <iosfwd> + +#include <xercesc/util/XMLString.hpp> + +// Utility class that provides a std::string like facade to XMLString. +// Doesn't implement all of the methods of std::string. +#include "XML/CIAO_XML_Utils_Export.h" + +namespace CIAO +{ + namespace XML + { + class CIAO_XML_Utils_Export XStr + { + public: + XStr() : _wstr(0L) { }; + + XStr (const char* str); + + XStr (XMLCh* wstr); + + XStr (const XMLCh* wstr); + + XStr (const XStr& copy); + + XStr& operator= (const XStr& rhs); + + ~XStr(); + + const XMLCh* begin() const; + + const XMLCh* end() const; + + bool append(const XMLCh* tail); + + bool erase (const XMLCh* head, const XMLCh* tail); + + int size() const; + + XMLCh operator [] (const int i); + + XMLCh operator [] (const int i) const; + + operator const XMLCh* () const { return _wstr; }; + + XMLCh * release (void); + private: + + XMLCh* _wstr; // Internal representation + + }; + + CIAO_XML_Utils_Export bool operator== (const XStr& lhs, const XStr& rhs); + CIAO_XML_Utils_Export bool operator!= (const XStr& lhs, const XStr& rhs); + + CIAO_XML_Utils_Export std::ostream& + operator<< (std::ostream& o, XStr const& str); + + } +} +#include /**/ "ace/post.h" + +#endif /* _XERCESSTRING_H */ diff --git a/CIAO/tools/tools.mwc b/CIAO/tools/tools.mwc index 0d2598613c4..ae28cfcba54 100644 --- a/CIAO/tools/tools.mwc +++ b/CIAO/tools/tools.mwc @@ -4,5 +4,4 @@ workspace { Config_Handlers IDL3_to_IDL2 - IDL3_to_XMI -} +}
\ No newline at end of file |