summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-04-13 23:50:28 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-04-13 23:50:28 +0000
commit8453795061c062a2120521c5b55fc42f55007aed (patch)
treea9264ba08bdab437f8126c9422275908ebff03a8
parentd4f008b1a08b8ceed61c0b041310822383c6ad68 (diff)
downloadATCD-8453795061c062a2120521c5b55fc42f55007aed.tar.gz
Wed Apr 13 18:55:58 2005 Gan Deng <dengg@dre.vanderbilt.edu>
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp41
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h7
-rw-r--r--TAO/CIAO/DAnCE/ciao/CCM_Component.idl3
-rw-r--r--TAO/CIAO/DAnCE/ciao/Container_Impl.cpp36
-rw-r--r--TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp6
-rw-r--r--TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h6
6 files changed, 86 insertions, 13 deletions
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp
index 9fa5cf18fce..2462164d537 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.cpp
@@ -197,8 +197,9 @@ namespace CIAO
//
ART_REF_MAP art_ref_map;
- CORBA::ULong pack_len = instance.package.length ();
+ update_config_property (instance, plan.instance[l]);
+ CORBA::ULong pack_len = instance.package.length ();
for (CORBA::ULong m = 0; m < pack_len; ++m)
{
ComponentPackageDescription
@@ -364,6 +365,22 @@ namespace CIAO
}
void
+ update_config_property (SubcomponentInstantiationDescription &sub_instance,
+ InstanceDeploymentDescription &instance)
+ {
+ CORBA::ULong pro_len =
+ sub_instance.configProperty.length ();
+
+ for (CORBA::ULong x = 0; x < pro_len; ++x)
+ {
+ CORBA::ULong ins_pro_len (instance.configProperty. length ());
+ instance.configProperty.length (ins_pro_len + 1);
+ instance.configProperty[ins_pro_len]
+ = sub_instance.configProperty[x];
+ }
+ }
+
+ void
update_impl_config_property (PackagedComponentImplementation
&impl,
MonolithicDeploymentDescription
@@ -372,19 +389,35 @@ namespace CIAO
InstanceDeploymentDescription
&instance)
{
+ int update_flag;
CORBA::ULong pro_len =
impl.referencedImplementation.configProperty.length ();
for (CORBA::ULong x = 0; x < pro_len; ++x)
{
+ update_flag = 1;
CORBA::ULong impl_pro_len (mid.execParameter.length ());
mid.execParameter.length (impl_pro_len + 1);
mid.execParameter[impl_pro_len]
= impl.referencedImplementation.configProperty[x];
+ const char* property_name =
+ impl.referencedImplementation.configProperty[x].name;
CORBA::ULong ins_pro_len (instance.configProperty. length ());
- instance.configProperty.length (ins_pro_len + 1);
- instance.configProperty[ins_pro_len]
- = impl.referencedImplementation.configProperty[x];
+ for (CORBA::ULong y = 0; y < ins_pro_len; ++y)
+ {
+ const char* ins_pro_name = instance.configProperty[y].name;
+ if (strcmp (ins_pro_name, property_name) == 0)
+ {
+ update_flag = 0;
+ break;
+ }
+ }
+ if (update_flag == 1)
+ {
+ instance.configProperty.length (ins_pro_len + 1);
+ instance.configProperty[ins_pro_len]
+ = impl.referencedImplementation.configProperty[x];
+ }
}
}
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h
index 347330e09fe..9c3125092fd 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/Update_Plan.h
@@ -98,6 +98,13 @@ namespace CIAO
InstanceDeploymentDescription
&instance);
+ void update_config_property (Deployment::
+ SubcomponentInstantiationDescription
+ &sub_instance,
+ Deployment::
+ InstanceDeploymentDescription
+ &instance);
+
void update_common_artifact_and_art_ref (Deployment::
ImplementationArtifactDescription &pack_iad,
REF_MAP &primary_ref_map,
diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Component.idl b/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
index 3dcc86e4dd3..2db6d1700fb 100644
--- a/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
+++ b/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
@@ -95,6 +95,9 @@ module Components
PrimaryKeyBase get_primary_key( )
raises (NoKeyAvailable);
+ // Factory method to return a StandardConfigurator interface
+ StandardConfigurator get_standard_configurator ( );
+
/// CIAO specific operations to have some control on when and how
/// to activate components.
/**
diff --git a/TAO/CIAO/DAnCE/ciao/Container_Impl.cpp b/TAO/CIAO/DAnCE/ciao/Container_Impl.cpp
index f339f63eea1..3ff62b1d7c5 100644
--- a/TAO/CIAO/DAnCE/ciao/Container_Impl.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Container_Impl.cpp
@@ -1,5 +1,6 @@
// $Id$
#include "Container_Impl.h"
+#include "CCM_ComponentC.h" // for calling StandardConfigurator interface
#if !defined (__ACE_INLINE__)
# include "Container_Impl.inl"
@@ -111,12 +112,17 @@ CIAO::Container_Impl::install (
(*retv)[i].component_ref = Components::CCMObject::_duplicate (comp.in ());
// Deal with Component instance related Properties.
- // Now I am only concerning about the COMPOENTIOR and here is only
- // the hardcoded version of the configuration.
+ // 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)
{
@@ -137,9 +143,33 @@ CIAO::Container_Impl::install (
ACE_TRY_THROW (CORBA::INTERNAL ());
}
-
+ continue;
}
+
+ // 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
+ ACE_DEBUG ((LM_DEBUG, "Step 10\n"));
+
+ 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;
}
+
+ ACE_DEBUG ((LM_DEBUG, "Step 20\n"));
+ //std_configurator.set_configuration
+ ::Components::StandardConfigurator_var std_configurator =
+ comp->get_standard_configurator ();
+
+ std_configurator->set_configuration (comp_attributes);
+ ACE_DEBUG ((LM_DEBUG, "Step 30\n"));
}
}
ACE_CATCHANY
diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
index 88b306aced5..46068f11fc9 100644
--- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
@@ -516,9 +516,9 @@ namespace CIAO
return retval;
}
- Components::StandardConfigurator*
- Servant_Impl_Base::get_standard_configurator (
- ACE_ENV_SINGLE_ARG_DECL)
+ ::Components::StandardConfigurator_ptr
+ Servant_Impl_Base::get_standard_configurator (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
// Create the configurator servant.
StandardConfigurator_Impl *config_impl = 0;
diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h
index a56734c08c1..4d8de97166b 100644
--- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h
+++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.h
@@ -167,9 +167,9 @@ namespace CIAO
ACE_ENV_ARG_DECL) = 0;
// Creates and returns the StandardConfigurator for the component.
- virtual Components::StandardConfigurator *get_standard_configurator (
- ACE_ENV_SINGLE_ARG_DECL
- );
+ virtual ::Components::StandardConfigurator_ptr
+ get_standard_configurator (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
/// Override that returns the (passed-in) default POA of our member
/// component's container, to ensure that we get registered