diff options
author | sjiang <sjiang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-09-23 04:27:55 +0000 |
---|---|---|
committer | sjiang <sjiang@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-09-23 04:27:55 +0000 |
commit | 5413ef1b936f21c56153ff9f35d840dfda1d6832 (patch) | |
tree | 523440c1c57a02f96e51b55808ffa150a81be04f | |
parent | abef30fd40087bd91db948baeef62ac52d435981 (diff) | |
download | ATCD-5413ef1b936f21c56153ff9f35d840dfda1d6832.tar.gz |
ChangeLog Tag: Sat Sep 23 04:07:59 UTC 2006 Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/PCVisitor.cpp | 227 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/PCVisitor.h | 133 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/PCVisitorBase.cpp | 28 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/PCVisitorBase.h | 176 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/PCVisitorBase.inl | 155 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp | 12 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc | 12 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp | 87 | ||||
-rw-r--r-- | CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h | 18 |
9 files changed, 27 insertions, 821 deletions
diff --git a/CIAO/DAnCE/Plan_Launcher/PCVisitor.cpp b/CIAO/DAnCE/Plan_Launcher/PCVisitor.cpp deleted file mode 100644 index fd1996175bd..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/PCVisitor.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- C++ -*- */ - -//======================================================================== -/* - * @file PCVisitor.cpp - * - * $Id$ - * - * This file contains the implementation of the PackageConfiguration - * Visitor class PCVisitor which derives from PCVisitorBase. Each - * Visit function focuses on the functionality necessary to process - * the PackageConfiguration element which is passed to it as an argument - * and on dispatching the next sequence of calls in the correct order! - * - * This implementation takes a PackageConfiguration and tries to modify - * a DeploymentPlan bases on it by expanding the latter in width and depth - * simultaneously. At each level of the PackageConfiguration the - * PCVisitor first expands the DeploymentPlan vertically at the - * corrsponding level and then dispatches the children of the current - * PackageConfiguration element. This in turn might and most probably - * will cause another vertical expansion of the DeploymentPlan, however - * for a different element. This effect is produced due to the flattened - * structure of the DeploymentPlan. - * - * @author Stoyan Paunov <spaunov@isis.vanderbilt.edu> - * Shanshan Jiang <shanshan.jiang@vanderbilt.edu> - */ -//======================================================================== - -#include "PCVisitorBase.h" -#include "PCVisitor.h" - -#include "ace/OS_Memory.h" //for ACE_NEW* macros -#include "ace/SString.h" //for ACE_CString - -#include "ciao/DeploymentC.h" -#include "ciao/Deployment_DataC.h" -#include "ciao/Packaging_DataC.h" - -#include "Config_Handlers/DnC_Dump.h" - -#include <iostream> -using namespace std; - -//Constructor -PCVisitor::PCVisitor (Deployment::DeploymentPlan &plan, - Deployment::PackageConfiguration &pc) - : PCVisitorBase (), - plan_ (plan), - pc_ (pc) -{ -} - -//destructor -PCVisitor::~PCVisitor (void) -{ -} - -//entry point for the protected visitor to get it do start -//the visitation process -void PCVisitor::Visit () -{ - Accept (*this, this->pc_); -} - -// A whole slew of overloaded routines for different IDL -// data types part of the PackageConfiguration. - -void PCVisitor::Visit (Deployment::PackageConfiguration &pc) -{ - cout << "Flattening: " << pc.label << endl; - - //visit the ComponentPackageDescription - if (pc.basePackage.length ()) - { - //currently no support for that anywhere - //for (size_t r = 0; r = pc.selectRequirement.length (); ++r); - - Accept (*this, pc.basePackage); - } - else - ACE_DEBUG ((LM_WARNING, - "[PCVisitor - PackageConfiguration] We currently " - "do NOT support package references, specializedConfigs", - "or imports!\n")); -} - -//ComponentPackageDescription descendents - -void PCVisitor::Visit (Deployment::ComponentPackageDescription &cpd) -{ - Accept (*this, cpd.realizes); - //for (size_t impl = 0; impl < cpd.implementation.length (); ++impl) - Accept (*this, cpd.implementation[0]); -} - - -void PCVisitor::Visit (Deployment::ComponentInterfaceDescription &) -{ - //Might want to populate this too once PICML starts supporting it -} - - -void PCVisitor::Visit (Deployment::PackagedComponentImplementation &pci) -{ - Accept (*this, pci.referencedImplementation); -} - - -void PCVisitor::Visit (Deployment::ComponentImplementationDescription &cid) -{ - if (cid.assemblyImpl.length ()) - Accept (*this, cid.assemblyImpl); - else - //;//Do nothing - monolithic component deployment not supported - Accept (*this, cid.monolithicImpl); -} - - -void PCVisitor::Visit (Deployment::ComponentAssemblyDescription &cad) -{ - //visit the SubcomponentInstantiationDescription - Accept (*this, cad.instance); - //visit the connections - Accept (*this, cad.connection); -} - - -void PCVisitor::Visit (Deployment::SubcomponentInstantiationDescription &sid) -{ - //visit the ComponentPackageDescription (again) - if (sid.basePackage.length ()) - { - Accept (*this, sid.basePackage); - } - else - ACE_DEBUG ((LM_WARNING, - "[PCVisitor - SubcomponentInstantiationDescription] ", - "We currently do NOT support package references, ", - "specializedConfigs or imports!\n")); -} - - -void PCVisitor::Visit (Deployment::MonolithicImplementationDescription &mid) -{ - //NOTE: There are usually 3 NamedImplementationArtifacts per - //MonolithicImplementationDescription *_stub, *_svnt & *_exec - - //visit the NamedImplementationArtifacts - Accept (*this, mid.primaryArtifact); -} - - -void PCVisitor::Visit (Deployment::NamedImplementationArtifact &nia) -{ - //visit the actual ImplementationArtifactDescriptor - Accept (*this, nia.referencedArtifact); -} - - -void PCVisitor::Visit (Deployment::ImplementationArtifactDescription &iad) -{ - size_t num_arti = plan_.artifact.length (); - for (size_t i = 0; i < num_arti; ++i) - { - if (ACE_OS::strstr (iad.location[0], plan_.artifact[i].location[0])) - plan_.artifact[i].location[0] = iad.location[0]; - } -} - - -//ComponentPackageReference descendents - -void PCVisitor::Visit (Deployment::ComponentPackageReference &) -{ - //not implemented -} - - -//properties - -void PCVisitor::Visit (Deployment::AssemblyPropertyMapping &) -{ -} - - -void PCVisitor::Visit (Deployment::Property &) -{ -} - - -//requirements & capabilities - -void PCVisitor::Visit (Deployment::Requirement &) -{ -} - - -void PCVisitor::Visit (Deployment::Capability &) -{ -} - - -void PCVisitor::Visit (Deployment::ImplementationRequirement &) -{ -} - - -void PCVisitor::Visit (Deployment::ImplementationDependency &) -{ -} - -//ports and connections - -void PCVisitor::Visit (Deployment::AssemblyConnectionDescription &) -{ -} - - -void PCVisitor::Visit (Deployment::SubcomponentPortEndpoint &) -{ -} - - -void PCVisitor::Visit (Deployment::ComponentExternalPortEndpoint &) -{ -} diff --git a/CIAO/DAnCE/Plan_Launcher/PCVisitor.h b/CIAO/DAnCE/Plan_Launcher/PCVisitor.h deleted file mode 100644 index c5b7691d472..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/PCVisitor.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- C++ -*- */ - -//======================================================================== -/** - * file PCVisitor.h - * - * $Id$ - * - * This file contains a number of Visitor classes which are used to - * traverse the PackageConfiguration element defined in the - * PackagingData.idl - * - * author Stoyan Paunov <spaunov@isis.vanderbilt.edu> - */ -//======================================================================== - -#ifndef PC_VISITOR_H -#define PC_VISITOR_H - -#include /**/ "ace/pre.h" -#include "ace/SString.h" //for the ACE_CString - -#include "PCVisitorBase.h" //for the base visitor -#include "ace/Containers_T.h" //for ACE_Double_Linked_List - -#include "ciao/DeploymentC.h" -#include "ciao/Deployment_BaseC.h" -#include "ciao/Deployment_DataC.h" -#include "ciao/Packaging_DataC.h" - - -//=========================================================================== -/** - * class PCVisitor - * - * This class is is the actual implementation for the PackageConfiguration - * Visitor. It derives from PCVisitorBase and overloads the functions which - * deal with single elements. Sequences are handled in the base class. - */ -//=========================================================================== - - -class PCVisitor : public PCVisitorBase -{ -public: - //constructor - PCVisitor (Deployment::DeploymentPlan &plan, - Deployment::PackageConfiguration &pc); - - //destructor - ~PCVisitor (void); - - ///Entry point to protected Visitor functions - void Visit (); - -protected: - /// A whole slew of overloaded routines for different IDL - /// data types part of the PackageConfiguration. - - virtual - void Visit (Deployment::PackageConfiguration &pc); - - //ComponentPackageDescription descendents - virtual - void Visit (Deployment::ComponentPackageDescription &cpd); - - virtual - void Visit (Deployment::ComponentInterfaceDescription &cid); - - virtual - void Visit (Deployment::PackagedComponentImplementation &pci); - - virtual - void Visit (Deployment::ComponentImplementationDescription &cid); - - virtual - void Visit (Deployment::ComponentAssemblyDescription &cad); - - virtual - void Visit (Deployment::SubcomponentInstantiationDescription &sid); - - virtual - void Visit (Deployment::MonolithicImplementationDescription &mid); - - virtual - void Visit (Deployment::NamedImplementationArtifact &nia); - - virtual - void Visit (Deployment::ImplementationArtifactDescription &iad); - - //ComponentPackageReference descendents - virtual - void Visit (Deployment::ComponentPackageReference &cpr); - - //properties - virtual - void Visit (Deployment::AssemblyPropertyMapping &apm); - - virtual - void Visit (Deployment::Property &property); - - //requirements & capabilities - virtual - void Visit (Deployment::Requirement &requirement); - - virtual - void Visit (Deployment::Capability &capability); - - virtual - void Visit (Deployment::ImplementationRequirement &ir); - - virtual - void Visit (Deployment::ImplementationDependency &id); - - //ports and connections - virtual - void Visit (Deployment::AssemblyConnectionDescription &acd); - - virtual - void Visit (Deployment::SubcomponentPortEndpoint &spe); - - virtual - void Visit (Deployment::ComponentExternalPortEndpoint &cepe); - - -private: - Deployment::DeploymentPlan& plan_; - Deployment::PackageConfiguration& pc_; -}; - -#include /**/ "ace/post.h" - -#endif /* PC_VISITOR_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.cpp b/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.cpp deleted file mode 100644 index c8ffc983095..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- C++ -*- */ - -//======================================================================== -/* - * file PCVisitorBase.cpp - * - * $Id$ - * - * This file is a dummy which either includes the PCVisitorBase.inl or - * is ignored. - * - * author Stoyan Paunov <spaunov@isis.vanderbilt.edu> - */ -//======================================================================== - -#include "PCVisitorBase.h" - -PCVisitorBase::PCVisitorBase (void) -{ -} - -PCVisitorBase::~PCVisitorBase (void) -{ -} - -#if !defined (__ACE_INLINE__) -#include "PCVisitorBase.inl" -#endif /* __ACE_INLINE__ */ diff --git a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.h b/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.h deleted file mode 100644 index 1893a734d5e..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.h +++ /dev/null @@ -1,176 +0,0 @@ -/* -*- C++ -*- */ - -//======================================================================== -/** - * file PCVisitorBase.h - * - * $Id$ - * - * This file contains the virtual base class for the PackageConfiguration - * Visitor which is used to traverse the PackageConfiguration element - * defined in the PackagingData.idl. The PackageConfiguration has a - * number of sequence elements. This class actually implements the - * operations which involve sequences and delegates the calls to - * the operations which handle single elements from the sequence type. - * - * author Stoyan Paunov <spaunov@isis.vanderbilt.edu> - */ -//======================================================================== - -#ifndef PC_VISITOR_BASE_H -#define PC_VISITOR_BASE_H - -#include /**/ "ace/pre.h" -#include "ciao/DeploymentC.h" -#include "ciao/Deployment_DataC.h" -#include "ciao/Packaging_DataC.h" -#include "ace/SString.h" //for the ACE_CString -#include "ace/Containers_T.h" //for ACE_Unbounded_Stack - -//======================================================================== -/** - * class PCVisitorBase - * - * This class is a virtual base class for the PackageConfiguration Visitor - * The operation which deal with sequences are implemented here by means - * of the visit_sequence function above, in order to make the logic of - * derived classes easier to write. Writers of derived classes need only - * overload the functions which deal with single elements. Sequences are - * always handled here. - */ -//======================================================================== - - -class PCVisitorBase -{ -public: - //constructor - PCVisitorBase (void); - - //destructor - virtual - ~PCVisitorBase (void); - - ///function what dispatches sequences - template <typename SEQ> - friend void visit_sequence (SEQ &seq, PCVisitorBase& v); - - /// A whole slew of overloaded routines for different IDL - /// data types part of the PackageConfiguration. - - virtual - void Visit (Deployment::PackageConfiguration &pc) = 0; - void Visit (Deployment::PackageConfigurations &pcs); - - //ComponentPackageDescription descendents - virtual - void Visit (Deployment::ComponentPackageDescription &cpd) = 0; - void Visit (Deployment::ComponentPackageDescriptions &cpds); - - virtual - void Visit (Deployment::ComponentInterfaceDescription &cid) = 0; - //void Visit (Deployment::ComponentInterfaceDescriptions &cids); - - virtual - void Visit (Deployment::PackagedComponentImplementation &pci) = 0; - void Visit (Deployment::PackagedComponentImplementations &pcis); - - virtual - void Visit (Deployment::ComponentImplementationDescription &cid) = 0; - //void Visit (Deployment::ComponentImplementationDescriptions &cids); - - virtual - void Visit (Deployment::ComponentAssemblyDescription &cad) = 0; - void Visit (Deployment::ComponentAssemblyDescriptions &cads); - - virtual - void Visit (Deployment::SubcomponentInstantiationDescription &sid) = 0; - void Visit (Deployment::SubcomponentInstantiationDescriptions &sids); - - virtual - void Visit (Deployment::MonolithicImplementationDescription &mid) = 0; - void Visit (Deployment::MonolithicImplementationDescriptions &mids); - - virtual - void Visit (Deployment::NamedImplementationArtifact &nia) = 0; - void Visit (Deployment::NamedImplementationArtifacts &nias); - - virtual - void Visit (Deployment::ImplementationArtifactDescription &iad) = 0; - //void Visit (Deployment::ImplementationArtifactDescriptions &iads); - - //ComponentPackageReference descendents - virtual - void Visit (Deployment::ComponentPackageReference &cpr) = 0; - void Visit (Deployment::ComponentPackageReferences &cprs); - - //properties - virtual - void Visit (Deployment::AssemblyPropertyMapping &apm) = 0; - void Visit (Deployment::AssemblyPropertyMappings &apms); - - virtual - void Visit (Deployment::Property &property) = 0; - void Visit (Deployment::Properties &properties); - - //requirements & capabilities - virtual - void Visit (Deployment::Requirement &requirement) = 0; - void Visit (Deployment::Requirements &requirements); - - virtual - void Visit (Deployment::Capability &capability) = 0; - void Visit (Deployment::Capabilities &capabilities); - - virtual - void Visit (Deployment::ImplementationRequirement &ir) = 0; - void Visit (Deployment::ImplementationRequirements &irs); - - virtual - void Visit (Deployment::ImplementationDependency &id) = 0; - void Visit (Deployment::ImplementationDependencies &ids); - - //ports and connections - virtual - void Visit (Deployment::AssemblyConnectionDescription &acd) = 0; - void Visit (Deployment::AssemblyConnectionDescriptions &acds); - - virtual - void Visit (Deployment::SubcomponentPortEndpoint &spe) = 0; - void Visit (Deployment::SubcomponentPortEndpoints &spes); - - virtual - void Visit (Deployment::ComponentExternalPortEndpoint &cepe) = 0; - void Visit (Deployment::ComponentExternalPortEndpoints &cepes); -}; - -template <typename T> -void Accept (PCVisitorBase &v, T& element_to_visit) -{ - v.Visit (element_to_visit); -} - -/** - * function - visit_sequence - * - * This function is used to handle sequences of elements where each - * element takes the form of a Visitor Node. - */ -template <typename SEQ> -void visit_sequence (SEQ &seq, PCVisitorBase& v) -{ - const CORBA::ULong size = seq.length (); - - for (CORBA::ULong i = 0; i < size; ++i) - { - Accept(v, seq[i]); - } -} - -#if defined (__ACE_INLINE__) -#include "PCVisitorBase.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* PC_VISITOR_BASE_H */ diff --git a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.inl b/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.inl deleted file mode 100644 index 955aefb7c4e..00000000000 --- a/CIAO/DAnCE/Plan_Launcher/PCVisitorBase.inl +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- C++ -*- */ - -//======================================================================== -/* - * file PCVisitorBase.inl - * - * $Id$ - * - * This file contains the implementation of the sequence-based - * PackageConfiguration Visitor functions. By implementing these - * we relieve developers of derived classes of the burden of handling - * the correct traversal of sequence-based elements. This implementation - * used the visit_sequence templatized function to do the heavy lifting. - * - * author Stoyan Paunov <spaunov@isis.vanderbilt.edu> - */ -//======================================================================== - - -/// A whole slew of overloaded routines for different IDL -/// data types part of the PackageConfiguration. - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::PackageConfigurations &pcs) -{ - visit_sequence (pcs, *this); -} - -//ComponentPackageDescription descendents - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ComponentPackageDescriptions &cpds) -{ - visit_sequence (cpds, *this); -} - -//NOT a member of Deployment - -//ACE_INLINE void PCVisitorBase::Visit -// (Deployment::ComponentInterfaceDescriptions &cids) -//{ -// visit_sequence (cids, *this); -//} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::PackagedComponentImplementations &pcis) -{ - visit_sequence (pcis, *this); -} - -//NOT a member of Deployment - -//ACE_INLINE void PCVisitorBase::Visit -// (Deployment::ComponentImplementationDescriptions &cids) -//{ -// visit_sequence (cids, *this); -//} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ComponentAssemblyDescriptions &cads) -{ - visit_sequence (cads, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::SubcomponentInstantiationDescriptions &sids) -{ - visit_sequence (sids, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::MonolithicImplementationDescriptions &mids) -{ - visit_sequence (mids, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::NamedImplementationArtifacts &nias) -{ - visit_sequence (nias, *this); -} - -//ACE_INLINE void PCVisitorBase::Visit -// (Deployment::ImplementationArtifactDescriptions &iads) -//{ -// visit_sequence (iads, *this); -//} - -//ComponentPackageReference descendents - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ComponentPackageReferences &cprs) -{ - visit_sequence (cprs, *this); -} - -//properties - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::AssemblyPropertyMappings &apms) -{ - visit_sequence (apms, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::Properties &properties) -{ - visit_sequence (properties, *this); -} - -//requirements & capabilities - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::Requirements &requirements) -{ - visit_sequence (requirements, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::Capabilities &capabilities) -{ - visit_sequence (capabilities, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ImplementationRequirements &irs) -{ - visit_sequence (irs, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ImplementationDependencies &ids) -{ - visit_sequence (ids, *this); -} - -//ports and connections - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::AssemblyConnectionDescriptions &acds) -{ - visit_sequence (acds, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::SubcomponentPortEndpoints &spes) -{ - visit_sequence (spes, *this); -} - -ACE_INLINE void PCVisitorBase::Visit -(Deployment::ComponentExternalPortEndpoints &cepes) -{ - visit_sequence (cepes, *this); -} diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index 932e78a4109..dc0b7965c6e 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -206,14 +206,14 @@ namespace CIAO if (package_names != 0) uuid = launcher.launch_plan (deployment_plan_url, - package_names, - use_package_name, - use_repoman); + package_names, + use_package_name, + use_repoman); else uuid = launcher.launch_plan (deployment_plan_url, - package_types, - use_package_name, - use_repoman); + package_types, + use_package_name, + use_repoman); if (uuid == 0) { diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc index c69a8a8cfe3..918c987a2c8 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc @@ -3,23 +3,21 @@ project(Plan_Launcher_Impl) : ciao_servant_dnc, ciao_config_handlers { sharedname = Plan_Launcher_Impl - after += ExecutionManager_stub - libs += ExecutionManager_stub + + after += Plan_Generator ExecutionManager_stub + libs += Plan_Generator ExecutionManager_stub + includes += $(CIAO_ROOT/DAnCE/Plan_Generator dynamicflags = PLAN_LAUNCHER_IMPL_BUILD_DLL Source_Files { - Plan_Launcher_Impl.cpp + Plan_Launcher_Impl.cpp ../ExecutionManager/DAM_Map.cpp - PCVisitor.cpp - PCVisitorBase.cpp } Header_Files { ../ExecutionManager/DAM_Map.h Plan_Launcher_Impl_Export.h - PCVisitor.h - PCVisitorBase.h } } diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index 0103936f75d..972db3b8cb6 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -10,7 +10,6 @@ namespace CIAO { namespace Plan_Launcher { - static CORBA::Object_ptr fetch_reference_naming (CORBA::ORB_ptr orb, bool use_repoman = 0, @@ -30,21 +29,14 @@ namespace CIAO CosNaming::Name name (1); name.length (1); - if (!use_repoman) - { - name[0].id = CORBA::string_dup ("ExecutionManager"); - } - else - { - name[0].id = CORBA::string_dup (repoman_name); - } + name[0].id = CORBA::string_dup ("ExecutionManager"); return pns->resolve (name ACE_ENV_ARG_PARAMETER); } Plan_Launcher_i::Plan_Launcher_i () - : em_ (), rm_ () + : em_ (), pg_ () { } @@ -53,7 +45,7 @@ namespace CIAO CORBA::ORB_ptr orb, bool use_repoman, bool rm_use_naming, - const char *rm_ior + const char *rm_name ACE_ENV_ARG_DECL) { CORBA::Object_var obj; @@ -88,38 +80,8 @@ namespace CIAO "(%P|%t) CIAO_PlanLauncher: Obtained Execution" " Manager ref \n")); - // RM if (use_repoman) - { - if (rm_use_naming) - { - obj = fetch_reference_naming (orb, use_repoman, rm_ior ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - obj = orb->string_to_object (rm_ior - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - this->rm_ = Deployment::RepositoryManager::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (CORBA::is_nil (this->rm_.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher: nil Repository" - " Manager reference, narrow failed\n")); - return false; - } - - if (CIAO::debug_level () > 9) - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) CIAO_PlanLauncher: Obtained Repository" - " Manager ref \n")); - } + return pg_.init (orb, rm_use_naming, rm_name); return true; } @@ -129,7 +91,7 @@ namespace CIAO Plan_Launcher_i::launch_plan (const char *deployment_plan_uri, const char *package_uri, bool use_package_name, - bool use_repoman + bool use_repoman ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { @@ -140,45 +102,12 @@ namespace CIAO ::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) - { - ::Deployment::PackageConfiguration_var pc; - - ACE_TCHAR package[PACKAGE_NAME_LEN]; - - size_t length = ACE_OS::strlen (package_uri); - - size_t pos1 = 0; - size_t pos2 = ACE_OS::strcspn (package_uri + pos1, "+"); - - while (pos1 < length) { - ACE_OS::strsncpy (package, package_uri + pos1, pos2 + 1); - - if (use_package_name) - { - pc = rm_->findPackageByName (package); - - PCVisitor pcv (plan, *pc); - pcv.Visit (); - } - else - { - CORBA::StringSeq_var seq = rm_->findNamesByType (package); - - for (size_t i = 0; i < seq->length (); ++i) - { - pc = rm_->findPackageByName (seq[i]); - - PCVisitor pcv (plan, *pc); - pcv.Visit (); - } - } - - pos1 += pos2 + 1; - pos2 = ACE_OS::strcspn (package_uri + pos1, "+"); + pg_.generate_plan (plan, package_uri, use_package_name); } - } ACE_DEBUG ((LM_DEBUG, "Parsing complete....\n")); diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h index c45366774f2..73a3ba08fac 100644 --- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h +++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h @@ -10,21 +10,17 @@ #define PLAN_LAUNCHER_IMPL_H #include "ciao/RepositoryManagerC.h" -#include "PCVisitor.h" -#include "PCVisitorBase.h" - #include "Plan_Launcher_Impl_Export.h" #include "ciao/DeploymentS.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" namespace CIAO { namespace Plan_Launcher { - const size_t PACKAGE_NAME_LEN = 1024; - /** * @class Plan_Launcher_i * @brief This class launches and manages deployment plans. @@ -49,7 +45,7 @@ namespace CIAO CORBA::ORB_ptr orb, bool use_repoman = 0, bool rm_use_naming = 0, - const char *rm_ior = 0 + const char *rm_name = 0 ACE_ENV_ARG_DECL_WITH_DEFAULTS); /** @@ -58,8 +54,10 @@ namespace CIAO * @param 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 = 1, bool use_repoman = 0 + const char * launch_plan (const char *deployment_plan_uri, + const char *package_uri = 0, + bool use_package_name = 1, + bool use_repoman = 0 ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment_Failure)); @@ -100,10 +98,10 @@ namespace CIAO private: ::CIAO::ExecutionManagerDaemon_var em_; - Deployment::RepositoryManager_var rm_; - /// Local map for DAMs, to save expensive UUID lookups. Execution_Manager::DAM_Map map_; + + CIAO::Plan_Generator::Plan_Generator_i pg_; }; } |