diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-03-01 17:21:57 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-03-01 17:21:57 +0000 |
commit | 1819e2003a5b70a2f5b140138ed0731f69586960 (patch) | |
tree | b6ab021e32d257def1f3a6b467eab1717a29c877 | |
parent | f3e48843b6320f6907765d6eeac02643fa29da8b (diff) | |
download | ATCD-1819e2003a5b70a2f5b140138ed0731f69586960.tar.gz |
Tue Mar 01 11:14:21 2005 Gan Deng <dengg@dre.vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/DAnCE/ChangeLog | 25 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h | 1 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp | 48 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h | 8 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp | 16 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h | 7 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp | 16 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Container_Base.cpp | 1 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Container_Impl.h | 1 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Deployment_Core.idl | 1 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp | 31 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h | 3 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Activator.cpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/DAnCE/ciao/Servant_Activator.h | 2 |
14 files changed, 118 insertions, 44 deletions
diff --git a/TAO/CIAO/DAnCE/ChangeLog b/TAO/CIAO/DAnCE/ChangeLog index ce9e65dbba7..ebe8e70231e 100644 --- a/TAO/CIAO/DAnCE/ChangeLog +++ b/TAO/CIAO/DAnCE/ChangeLog @@ -1,3 +1,28 @@ +Tue Mar 01 11:14:21 2005 Gan Deng <dengg@dre.vanderbilt.edu> + + * DomainApplicationManager/Deployment_Configuration.h + * ExecutionManager/Execution_Manager.cpp + * NodeApplicationManager/ImplementationInfo.cpp + * NodeApplicationManager/ImplementationInfo.h + * NodeApplicationManager/NodeApplicationManager_Impl.cpp + * NodeApplicationManager/NodeApplicationManager_Impl.h + * NodeManager/NodeDaemon_Impl.cpp + * ciao/Container_Base.cpp + * ciao/Container_Impl.h + * ciao/Deployment_Core.idl + * ciao/NodeApplication_Impl.cpp + * ciao/NodeApplication_Impl.h + * ciao/Servant_Activator.cpp + * ciao/Servant_Activator.h + * examples/BasicSP/BMClosedED/BMClosedED_exec.cpp + + Fixed compilation errors due to the recent refactoring + work in TAO. + + Modified to make all the DAnCE tools to work together. + Right now, there is still an exception when tearing down + the assembly, which I will look into soon. + Tue Feb 22 20:33:21 2005 Will Otte <wotte@dre.vanderbilt.edu> * Config_Handlers/Singleton_IDREF_Map.cpp diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h index a02e4c32a48..125f738ff75 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.h @@ -25,6 +25,7 @@ #include "DeploymentC.h" #include "DomainApplicationManager/DomainApplicationManager_Export.h" +#include "ace/SString.h" #include "tao/Valuetype/ValueBase.h" #include "tao/Valuetype/Valuetype_Adapter_Impl.h" diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp index e4710977c72..891b07337e9 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp @@ -1,17 +1,27 @@ //$Id$ -#ifndef CIAO_IMPLEMENTATION_INFO_C -#define CIAO_IMPLEMENTATION_INFO_C +#ifndef CIAO_IMPLEMENTATION_INFO_CPP +#define CIAO_IMPLEMENTATION_INFO_CPP #include "ImplementationInfo.h" // Specialized operation that we will use for now. namespace CIAO { - bool operator<< (Deployment::ImplementationInfos & info, + bool operator<< (Deployment::NodeImplementationInfo & node_info, const Deployment::DeploymentPlan & plan) { const CORBA::ULong len = plan.instance.length (); - info.length (len); + + // @@ Install all the components into a single container. + // @@ Nanbor, I didn't create separate containers since the + // deploymentplan IDL is still unknown at this phase. + + node_info.length (1); //everything is in a single container. + Deployment::ContainerImplementationInfo container_info; + container_info.impl_infos.length (len); + + Deployment::ComponentImplementationInfos impl_infos; + impl_infos.length (len); for (CORBA::ULong i = 0; i < len; ++i) { @@ -19,7 +29,7 @@ namespace CIAO plan.instance[i]; // Get the component instance name. - info[i].component_instance_name = inst.name.in (); + impl_infos[i].component_instance_name = inst.name.in (); const Deployment::MonolithicDeploymentDescription & impl = plan.implementation[inst.implementationRef]; @@ -29,7 +39,7 @@ namespace CIAO // Copy Component instance related Properties if there is any. if (inst.configProperty.length () > 0) { - info[i].component_config = inst.configProperty; + impl_infos[i].component_config = inst.configProperty; } // For svnt artifact @@ -52,12 +62,14 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "Servant Artifact must have a location!\n")); return 0; } - // Cpoy the servant dll/so name. + // Copy the servant dll/so name. // @@ Note: I ignore all the other locations except the first one. - info[i].servant_dll = CORBA::string_dup (arti.location[0].in ()); + impl_infos[i].servant_dll = + CORBA::string_dup (arti.location[0].in ()); + + // Get the entry point. + const CORBA::ULong prop_length = arti.execParameter.length (); - // Get the entry point. - const CORBA::ULong prop_length = arti.execParameter.length (); for (CORBA::ULong prop_num = 0; prop_num < prop_length; ++prop_num) @@ -67,7 +79,7 @@ namespace CIAO { const char * entry; (arti.execParameter[prop_num].value) >>= entry; - info[i].servant_entrypt = CORBA::string_dup (entry); + impl_infos[i].servant_entrypt = CORBA::string_dup (entry); } else { @@ -76,6 +88,7 @@ namespace CIAO } } } + // As one can see, code is duplicated here. I will come back for this later. // For exec artifact if ((pos = tmp.find ("_exec")) != ACE_CString::npos || @@ -88,10 +101,11 @@ namespace CIAO } // Cpoy the servant dll/so name. // @@ Note: I ignore all the other locations except the first one. - info[i].executor_dll = CORBA::string_dup (arti.location[0].in ()); + impl_infos[i].executor_dll = + CORBA::string_dup (arti.location[0].in ()); // Get the entry point. - const CORBA::ULong prop_length = arti.execParameter.length (); + const CORBA::ULong prop_length = arti.execParameter.length (); for (CORBA::ULong prop_num = 0; prop_num < prop_length; ++prop_num) @@ -101,7 +115,7 @@ namespace CIAO { const char * entry; (arti.execParameter[prop_num].value) >>= entry; - info[i].executor_entrypt = CORBA::string_dup (entry); + impl_infos[i].executor_entrypt = CORBA::string_dup (entry); } else { @@ -116,8 +130,12 @@ namespace CIAO continue; } } + + container_info.impl_infos = impl_infos; + node_info[0] = container_info; + return 1; } } -#endif /* CIAO_IMPLEMENTATION_INFO_C */ +#endif /* CIAO_IMPLEMENTATION_INFO_CPP */ diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h index 5bd6c8022ca..a228f4eb68f 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h @@ -8,6 +8,7 @@ * the plan. * * @author Tao Lu <lu@dre.vanderbilt.edu> + * @author Gan Deng <dengg@dre.vanderbilt.edu> ***************************************************************/ #ifndef IMPLEMENTATIONIFO_H @@ -23,15 +24,16 @@ //#include "Deployment_CoreS.h" //#include "ace/os_types.h" #include "ciao/DeploymentC.h" +#include "ace/SString.h" //@@ I wish we could have precompiled header support soon!!! -// This mthod is a helper function to parse the plan into the -// ImplementationInfo struct. +// This method is a helper function to parse the local deployment plan into the +// NodeImplementationInfo struct. namespace CIAO { - bool operator<<(Deployment::ImplementationInfos & info, + bool operator<< (Deployment::NodeImplementationInfo & info, const Deployment::DeploymentPlan & plan); } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index 0aaea995377..2b55ee886fa 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -287,12 +287,12 @@ startLaunch (const Deployment::Properties & configProperty, * 5. get the provided connection endpoints back and return them. */ - Deployment::ImplementationInfos infos; + Deployment::NodeImplementationInfo node_info; - if (!(infos << (this->plan_))) + if (!(node_info << (this->plan_))) { if (CIAO::debug_level () > 1) - ACE_DEBUG ((LM_DEBUG, "Failed to create Component Implementation Infos!\n")); + ACE_DEBUG ((LM_DEBUG, "Failed to create Node Implementation Infos!\n")); ACE_THROW_RETURN (Deployment::StartError (), Deployment::Application::_nil()); @@ -311,6 +311,8 @@ startLaunch (const Deployment::Properties & configProperty, // For debugging. if (true) //(CIAO::debug_level () > 1) { + Deployment::ComponentImplementationInfos infos = node_info[0].impl_infos; + const CORBA::ULong info_len = infos.length (); for (CORBA::ULong i = 0; i < info_len; ++i) { @@ -324,7 +326,7 @@ startLaunch (const Deployment::Properties & configProperty, } // This will install all homes and components. - comp_info = this->nodeapp_->install (infos ACE_ENV_ARG_PARAMETER); + comp_info = this->nodeapp_->install (node_info ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (Deployment::Application::_nil()); @@ -356,8 +358,8 @@ void CIAO::NodeApplicationManager_Impl:: destroyApplication (Deployment::Application_ptr app ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException - , Deployment::StopError)) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StopError)) { ACE_UNUSED_ARG (app); @@ -369,4 +371,6 @@ destroyApplication (Deployment::Application_ptr app this->nodeapp_->remove (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; + + return; } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h index f6ad72f4a79..ece2990270a 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h @@ -23,6 +23,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "ace/SString.h" #include "ciao/DeploymentS.h" #include "CIAO_NAM_Export.h" #include "ciao/NodeApp_CB_Impl.h" @@ -66,10 +67,12 @@ namespace CIAO Deployment::StopError)); /** - * Initialize the NodeApplicationManager. The currently implementation + * 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 + * (pathname) of the NodeApplication and the delay. * CIAO_NodeApplicationManager should wait (in second) for NodeApplication to * call back. * diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp index a48fa385a45..e9a30541740 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp @@ -157,18 +157,20 @@ CIAO::NodeDaemon_Impl::destroyManager (Deployment::NodeApplicationManager_ptr { ACE_TRY { + // @@TODO: Find out why below code throw Object_Not_Active exception. + /* // Deactivate this object PortableServer::ObjectId_var id = this->poa_->reference_to_id (this->manager_.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->poa_->deactivate_object (id.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ACE_TRY_CHECK; - this->manager_ = - Deployment::NodeApplicationManager::_nil (); + this->poa_->deactivate_object (id.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + */ + this->manager_ = + Deployment::NodeApplicationManager::_nil (); } ACE_CATCHANY { diff --git a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp index a2002b38f17..4dac6344d50 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Base.cpp +++ b/TAO/CIAO/DAnCE/ciao/Container_Base.cpp @@ -5,6 +5,7 @@ #include "tao/Utils/PolicyList_Destroyer.h" #include "ace/OS_NS_stdio.h" #include "Servant_Activator.h" +#include "ace/SString.h" #if !defined (__ACE_INLINE__) # include "Container_Base.inl" diff --git a/TAO/CIAO/DAnCE/ciao/Container_Impl.h b/TAO/CIAO/DAnCE/ciao/Container_Impl.h index 125dab5898e..d0cc880859e 100644 --- a/TAO/CIAO/DAnCE/ciao/Container_Impl.h +++ b/TAO/CIAO/DAnCE/ciao/Container_Impl.h @@ -27,6 +27,7 @@ #include "Deployment_CoreS.h" #include "Container_Base.h" +#include "ace/SString.h" #include "Server_init.h" // write_IOR function #include "CIAO_common.h" // CIAO::debug_level diff --git a/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl b/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl index fd7a34de02f..841528c09d1 100644 --- a/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl +++ b/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl @@ -72,7 +72,6 @@ module Deployment string servant_entrypt; Properties component_config; // Properties home_config; //ignored for now. - // Properties container_config //igore for now }; typedef sequence <ComponentImplementationInfo> ComponentImplementationInfos; diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp index 24d465891f9..366062af281 100644 --- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp @@ -1,6 +1,7 @@ //$Id$ #include "NodeApplication_Impl.h" +#include "ace/SString.h" #include "Container_Impl.h" #if !defined (__ACE_INLINE__) @@ -20,7 +21,7 @@ CIAO::NodeApplication_Impl::init (ACE_ENV_SINGLE_ARG_DECL) } CORBA::Long -CIAO::NodeApplication_Impl::init_containers ( +CIAO::NodeApplication_Impl::create_all_containers ( const ::Deployment::NodeImplementationInfo & node_impl_info ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -61,7 +62,7 @@ CIAO::NodeApplication_Impl::finishLaunch ( if (this->component_map_.find (name, comp) != 0) { - ACE_THROW (Deployment::InvalidConnection ()); + ACE_TRY_THROW (Deployment::InvalidConnection ()); } Components::EventConsumerBase_var consumer; @@ -183,8 +184,8 @@ CIAO::NodeApplication_Impl::install ( retv->length (0); - // Call init_containers to create all the necessary containers.. - this->init_containers (node_impl_info); + // Call create_all_containers to create all the necessary containers.. + this->create_all_containers (node_impl_info); // For each container, invoke <install> operation, this will return // the ComponentInfo for components installed in each container. @@ -205,6 +206,23 @@ CIAO::NodeApplication_Impl::install ( for (CORBA::ULong j = curr_len; j < retv->length (); j++) retv[j] = comp_infos[j-curr_len]; } + + // @@ 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 + const CORBA::ULong comp_len = retv->length (); + for (CORBA::ULong len = 0; + len < comp_len; + ++len) + { + //Since we know the type ahead of time...narrow is omitted here. + if (this->component_map_. + bind (retv[len].component_instance_name.in(), + Components::CCMObject::_duplicate (retv[len].component_ref.in()))) + ACE_THROW_RETURN (Deployment::InstallationFailure (), 0); + } } ACE_CATCHANY { @@ -238,10 +256,7 @@ CIAO::NodeApplication_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) if (CIAO::debug_level () > 1) ACE_DEBUG ((LM_DEBUG, "Removed all containers from this NodeApplication!\n")); - //@TODO: Find it out whether we need to shutdown ORB or not. - // My thought is we shouldn't, in case we need to reinstall some other containers - // or components later, such as Jai's swappable components functionality. - //this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h index e611aeb8851..7383eca6eac 100644 --- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h +++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h @@ -23,6 +23,7 @@ #include "tao/ORB.h" #include "ace/Synch.h" #include "ace/Synch_Traits.h" +#include "ace/SString.h" #include "Container_Base.h" #include "Deployment_CoreS.h" #include "Server_init.h" @@ -157,7 +158,7 @@ namespace CIAO protected: /// Create and initialize all the containers - virtual CORBA::Long init_containers ( + virtual CORBA::Long create_all_containers ( const ::Deployment::NodeImplementationInfo & node_impl_info ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Activator.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Activator.cpp index a78c3bfaaa4..03899555bfd 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Activator.cpp +++ b/TAO/CIAO/DAnCE/ciao/Servant_Activator.cpp @@ -95,7 +95,7 @@ namespace CIAO PortableServer::Servant , CORBA::Boolean , CORBA::Boolean - ACE_ENV_ARG_DECL) + ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { /// Need to investigate what needs to be handled here.. diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Activator.h b/TAO/CIAO/DAnCE/ciao/Servant_Activator.h index a9f75028a67..27ed074b1b7 100644 --- a/TAO/CIAO/DAnCE/ciao/Servant_Activator.h +++ b/TAO/CIAO/DAnCE/ciao/Servant_Activator.h @@ -22,6 +22,8 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/PortableServer/PortableServer.h" +#include "tao/PortableServer/ServantActivatorC.h" +#include "tao/PortableServer/ForwardRequestC.h" #include "tao/LocalObject.h" #if defined(_MSC_VER) |