diff options
Diffstat (limited to 'modules/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp')
-rw-r--r-- | modules/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp b/modules/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp new file mode 100644 index 00000000000..3ea45b63aea --- /dev/null +++ b/modules/CIAO/ciao/Deployment/Handlers/CIAO_Handler_Common.cpp @@ -0,0 +1,47 @@ +// $Id$ +#include "CIAO_Handler_Common.h" + +#include "Deployment/Deployment_PlanErrorC.h" +#include "ciao/Logger/Log_Macros.h" + +namespace CIAO +{ + const char * + Deployment_Common::get_implementation (const char *name, + const ::Deployment::DeploymentPlan &plan) + { + if (name == 0) + throw ::Deployment::PlanError (name, + "No such artifact"); + + for (CORBA::ULong i = 0; + i < plan.artifact.length (); + ++i) + { + if (ACE_OS::strcmp (plan.artifact[i].name.in (), + name) == 0) + { + if (plan.artifact[i].location.length () >= 1 && + plan.artifact[i].location[0] != 0) + return plan.artifact[i].location[0].in (); + else + { + CIAO_ERROR (1, (LM_ERROR, CLINFO + "Component_Handler_i::get_implementation - " + "No valid location for artifact <%C>\n", + name)); + throw ::Deployment::PlanError (name, + "No valid location field\n"); + } + } + } + + CIAO_ERROR (1, (LM_ERROR, CLINFO + "Component_Handler_i::get_implementation - " + "Unable to locate artifact <%C>\n", + name)); + throw ::Deployment::PlanError (name, + "Nonexistant artifact"); + return 0; + } +} |