summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-29 20:01:06 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-29 20:01:06 +0000
commit977882357fc03f46c53986b757472b3bfe4c3b5e (patch)
treed16c1d026c6c1a3373f011f10a67750c4b273ae2
parent3121eb7decd58cee34f165224d8117c088a882ed (diff)
downloadATCD-977882357fc03f46c53986b757472b3bfe4c3b5e.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp10
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp200
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h26
-rw-r--r--TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp37
-rw-r--r--TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h5
-rw-r--r--TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp185
-rw-r--r--TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h12
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp134
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h5
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl10
-rw-r--r--TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp28
-rw-r--r--TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp23
-rw-r--r--TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp42
-rw-r--r--TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h8
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp2
-rw-r--r--TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp3
-rw-r--r--TAO/CIAO/ciao/Deployment.idl13
-rw-r--r--TAO/CIAO/ciao/Deployment_Core.idl4
-rw-r--r--TAO/CIAO/examples/Hello/descriptors/flattened_deploymentplan_without_ns.cdp2
19 files changed, 605 insertions, 144 deletions
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp
index 6b5325e840c..9743299d27f 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp
@@ -48,11 +48,10 @@ CIAO::Deployment_Configuration::init (const char *filename)
//
if (this->deployment_info_.bind (destination, ior) != 0)
{
- ACE_ERROR_RETURN ((LM_ERROR,
- "DAnCE (%P|%t) Deployment_Configuration.cpp:"
- "Failed to bind destination [%s] : \n",
- destination),
- -1);
+ ACE_DEBUG ((LM_ERROR,
+ "DAnCE (%P|%t) Deployment_Configuration.cpp:"
+ "Reuse existing node in the cached map: [%s]\n",
+ destination));
}
if (first)
@@ -61,6 +60,7 @@ CIAO::Deployment_Configuration::init (const char *filename)
first = 0;
}
}
+ ACE_OS::fclose (inf);
return 0;
}
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
index 0a606cbca13..fa8a39d90eb 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
@@ -37,7 +37,7 @@ DomainApplicationManager_Impl (CORBA::ORB_ptr orb,
//
deployment_file_ (CORBA::string_dup (deployment_file)),
deployment_config_ (orb),
- is_redeployment (false)
+ is_redeployment_ (false)
{
ACE_DECLARE_NEW_CORBA_ENV;
ACE_NEW_THROW_EX (this->all_connections_,
@@ -231,6 +231,8 @@ get_plan_info (void)
// node_manager_map.
//
int num_plans = 0;
+ this->node_manager_names_.clear ();
+
for (CORBA::ULong index = 0; index < length; index ++)
{
bool matched = false;
@@ -329,7 +331,9 @@ split_plan (void)
this->deployment_config_.get_node_manager
(this->node_manager_names_[i].c_str ());
- this->artifact_map_.bind (node_manager_names_[i], artifacts);
+ // In case we are doing redeployment, we could clean up the old
+ // child plan through the "rebind" mechanism.
+ this->artifact_map_.rebind (node_manager_names_[i], artifacts);
}
// (1) Iterate over the <instance> field of the global DeploymentPlan
@@ -339,6 +343,11 @@ split_plan (void)
for ( i = 0; i < (this->plan_.instance).length (); ++i)
{
// 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 =
@@ -456,6 +465,9 @@ startLaunch (const ::Deployment::Properties & configProperty,
ACE_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)
{
@@ -514,12 +526,12 @@ startLaunch (const ::Deployment::Properties & configProperty,
// Obtained the returned NodeApplication object reference
// and the returned Connections variable.
::Deployment::Application_var temp_application;
- if (!is_redeployment)
+ if (!is_redeployment_)
{
temp_application =
my_nam->startLaunch (configProperty,
- retn_connections.out (),
- 0);
+ retn_connections.out (),
+ 0);
}
else
{
@@ -578,7 +590,8 @@ startLaunch (const ::Deployment::Properties & configProperty,
void
CIAO::DomainApplicationManager_Impl::
-finishLaunch (::CORBA::Boolean start
+finishLaunch (CORBA::Boolean start,
+ CORBA::Boolean is_ReDAC
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError))
@@ -612,7 +625,6 @@ finishLaunch (::CORBA::Boolean start
error.c_str ()));
}
-
//@@ Note: Don't delete the below debugging helpers.
// Dump the connections for debug purpose.
if (CIAO::debug_level () > 9)
@@ -626,28 +638,56 @@ finishLaunch (::CORBA::Boolean start
"==============================================\n"));
}
- // Get the Connections variable.
+ // Get the Connections variable, if ReDAC is true, then we get
+ // all the connections in the old plan, otherwise, we get all
+ // the connections in the new plan.
Deployment::Connections * my_connections =
- this->get_outgoing_connections ((entry->int_id_).child_plan_.in ()
+ this->get_outgoing_connections (
+ (entry->int_id_).child_plan_.in (),
+ is_ReDAC
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- if (my_connections == 0)
+ if (!is_ReDAC)
{
- 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 ()));
-
- ACE_TRY_THROW
- (Deployment::StartError
- ("DomainApplicationManager_Impl::finish_launch",
- "There was some error establishing 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 ()));
+
+ ACE_TRY_THROW
+ (Deployment::StartError
+ ("DomainApplicationManager_Impl::finish_launch",
+ "There was some error establishing connections."));
+ }
+ }
+ else
+ {
+ // populate the <my_connections> sequence which contains
+ // all the to-be-removed connections
+
+ // Pass in the "false" parameter to get the connections in
+ // the new deployment plan
+ Deployment::Connections * connections_in_new_plan =
+ this->get_outgoing_connections (
+ (entry->int_id_).child_plan_.in (),
+ false
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We should remove those connections instances in the
+ // <connections_in_new_plan> from <my_connections>,
+ // and then we can get a result of <to-be-removed> connections
+ Deployment::Connections * tmp = my_connections;
+ my_connections =
+ this->subtract_connections (*tmp,
+ *connections_in_new_plan);
+ delete tmp;
}
-
- Deployment::Connections_var safe (my_connections);
// Dump the connections for debug purpose.
if (CIAO::debug_level () > 1)
@@ -656,17 +696,21 @@ finishLaunch (::CORBA::Boolean start
"==============================================\n"));
ACE_DEBUG ((LM_DEBUG,
"dump outgoing connections for child plan:%d\n", i));
- dump_connections (safe.in ());
+ dump_connections (*my_connections);
ACE_DEBUG ((LM_DEBUG,
"==============================================\n"));
}
// Invoke finishLaunch() operation on NodeApplication.
- entry->int_id_.node_application_->finishLaunch
- (safe.in (),
- start
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ if (my_connections->length () != 0)
+ {
+ entry->int_id_.node_application_->finishLaunch
+ (*my_connections,
+ start,
+ is_ReDAC
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
}
}
ACE_CATCHANY
@@ -953,8 +997,8 @@ perform_redeployment (
// 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.
- Deployment::DeploymentPlan backup_plan = this->plan_;
- this->is_redeployment = true;
+ this->old_plan_ = this->plan_;
+ this->is_redeployment_ = true;
this->plan_ = plan;
ACE_TRY
@@ -976,18 +1020,19 @@ perform_redeployment (
this->startLaunch (properties.in (), false);
- // finishLaunch() will not only establish necessary connections, but also
+ // finishLaunch() will not only establish new connections, but also
// should 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); // yes, start activtion also.
+ this->finishLaunch (true, true); // true means start activtion also.
+ // ture means "ReDAC" is desired
}
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
"DomainApplicationManager_Impl::perform_redeployment\t\n");
- this->plan_ = backup_plan;
+ this->plan_ = this->old_plan_;
ACE_RE_THROW;
}
ACE_ENDTRY;
@@ -1014,8 +1059,9 @@ getPlan (ACE_ENV_SINGLE_ARG_DECL)
Deployment::Connections *
CIAO::DomainApplicationManager_Impl::
-get_outgoing_connections (const Deployment::DeploymentPlan &plan
- ACE_ENV_ARG_DECL)
+get_outgoing_connections (const Deployment::DeploymentPlan &plan,
+ bool is_ReDAC
+ ACE_ENV_ARG_DECL)
{
CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_outgoing_connections");
Deployment::Connections_var connections;
@@ -1028,8 +1074,9 @@ get_outgoing_connections (const Deployment::DeploymentPlan &plan
{
// Get the component instance name
if (!get_outgoing_connections_i (plan.instance[i].name.in (),
- connections.inout ()
- ACE_ENV_ARG_PARAMETER))
+ connections.inout (),
+ is_ReDAC
+ ACE_ENV_ARG_PARAMETER))
return 0;
}
return connections._retn ();
@@ -1038,20 +1085,30 @@ get_outgoing_connections (const Deployment::DeploymentPlan &plan
bool
CIAO::DomainApplicationManager_Impl::
get_outgoing_connections_i (const char * instname,
- Deployment::Connections & retv
- ACE_ENV_ARG_DECL)
+ Deployment::Connections & retv,
+ bool is_ReDAC
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((Deployment::StartError))
{
CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_outoing_connections_i");
+ Deployment::DeploymentPlan tmp_plan;
+ if (is_ReDAC)
+ tmp_plan = this->old_plan_;
+ else
+ tmp_plan = this->plan_;
+
// Search in all the connections in the plan.
- for (CORBA::ULong i = 0; i < this->plan_.connection.length(); ++i)
+ for (CORBA::ULong i = 0; i < tmp_plan.connection.length(); ++i)
{
CORBA::ULong len = retv.length ();
// Current connection that we are looking at.
const Deployment::PlanConnectionDescription & curr_conn =
- this->plan_.connection[i];
+ tmp_plan.connection[i];
+
+ if (already_exists (curr_conn) && is_ReDAC) // ignore existing connections
+ continue;
//The modeling tool should make sure there are always 2 endpoints
//in a connection.
@@ -1065,7 +1122,7 @@ get_outgoing_connections_i (const char * instname,
// If the component name matches the name of one of the
// endpoints in the connection.
- if (ACE_OS::strcmp (this->plan_.instance[endpoint.instanceRef].name.in (),
+ if (ACE_OS::strcmp (tmp_plan.instance[endpoint.instanceRef].name.in (),
instname) == 0 )
{
//Look at the port kind to make sure it's what we are interested in.
@@ -1077,12 +1134,11 @@ get_outgoing_connections_i (const char * instname,
//Cache the name of the other component for later usage (search).
ACE_CString name =
- this->plan_.instance[curr_conn.internalEndpoint[index].
+ tmp_plan.instance[curr_conn.internalEndpoint[index].
instanceRef].name.in ();
// Cache the name of the port from the
// other component for searching later.
-
ACE_CString port_name =
curr_conn.internalEndpoint[index].portName.in ();
@@ -1094,7 +1150,6 @@ get_outgoing_connections_i (const char * instname,
// Now we have to search in the received
// connections to get the objRef.
-
const CORBA::ULong all_conn_len = this->all_connections_->length ();
for (CORBA::ULong conn_index = 0;
conn_index < all_conn_len;
@@ -1111,7 +1166,6 @@ get_outgoing_connections_i (const char * instname,
port_name.c_str ()) == 0)
{
//ACE_DEBUG ((LM_DEBUG, "step5\n"));
-
retv.length (len+1);
retv[len].instanceName = instname;
retv[len].portName = endpoint.portName.in ();
@@ -1126,7 +1180,6 @@ get_outgoing_connections_i (const char * instname,
// We didnt find the counter part connection even
// we are sure there must be 1.
-
if (!found)
{
ACE_CString error ("Creating connections for ");
@@ -1144,7 +1197,7 @@ get_outgoing_connections_i (const char * instname,
}
}
}
- return 1;
+ return true;
}
void
@@ -1196,3 +1249,52 @@ dump_connections (const ::Deployment::Connections & connections)
}
}
}
+
+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)
+ {
+ for (CORBA::ULong j = 0; i < 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 ()))
+ continue;
+
+ CORBA::ULong curr_length = retv->length ();
+ retv->length (curr_length + 1);
+ retv[curr_length] = left[i];
+ }
+ }
+
+ return retv._retn ();
+}
+
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
index 20b5990af78..1a82fe702b8 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
@@ -140,7 +140,8 @@ namespace CIAO
* is started as well. Raises the StartError exception if
* launching or starting the application fails.
*/
- virtual void finishLaunch (::CORBA::Boolean start
+ virtual void finishLaunch (CORBA::Boolean start,
+ CORBA::Boolean is_ReDAC
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
::Deployment::StartError));
@@ -229,19 +230,29 @@ namespace CIAO
* child deployment plan as Receiver side.
*/
Deployment::Connections *
- get_outgoing_connections (const Deployment::DeploymentPlan &plan
- ACE_ENV_ARG_DECL);
+ get_outgoing_connections (const Deployment::DeploymentPlan &plan,
+ bool is_ReDAC
+ ACE_ENV_ARG_DECL);
/// This is a helper function to find the connection for a component.
bool
get_outgoing_connections_i (const char * instname,
- Deployment::Connections & retv
- ACE_ENV_ARG_DECL)
+ Deployment::Connections & retv,
+ bool is_ReDAC
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((Deployment::StartError));
/// 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);
+
protected:
/// location of the Domainapplication
CORBA::String_var domainapp_path_;
@@ -265,6 +276,9 @@ namespace CIAO
/// 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_;
@@ -303,7 +317,7 @@ namespace CIAO
/// 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;
+ bool is_redeployment_;
};
}
diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp
index be2fb9aaa12..f29ffbf4d7e 100644
--- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp
@@ -215,13 +215,9 @@ namespace CIAO
ACE_TRY
{
- // Reset the plan_ private instance variable of the DAM servant
- //dam->set_plan (plan);
-
// Call perform_redeployment() on the DAM, which will do the
// actual redeployment and reconfiguration on the dommain level.
dam->perform_redeployment (plan);
-
}
ACE_CATCHANY
{
@@ -232,5 +228,38 @@ namespace CIAO
ACE_ENDTRY;
ACE_CHECK;
}
+
+ Deployment::DeploymentPlan *
+ Execution_Manager_Impl::getPlan (
+ const char * plan_uuid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((::CORBA::SystemException))
+ {
+ Deployment::DomainApplicationManager_var dam;
+
+ if (this->map_.is_plan_available (plan_uuid))
+ dam = this->map_.fetch_dam_reference (plan_uuid);
+ else
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "DAnCE (%P|%t) ExecutionManager_Impl.cpp -"
+ "CIAO::Execution_Manager_Impl::getPlan -"
+ "Invalid plan uuid: %s!\n", plan_uuid));
+ ACE_THROW (::CORBA::BAD_PARAM ());
+ }
+
+ ACE_TRY
+ {
+ return dam->getPlan ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Execution_Manager_Impl::getPlan\t\n");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
}
}
diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h
index d30ae85db9f..5060ce44847 100644
--- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h
+++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h
@@ -90,6 +90,11 @@ namespace CIAO
::Deployment::InvalidProperty,
::Components::RemoveFailure));
+ virtual Deployment::DeploymentPlan * getPlan (
+ const char * plan_uuid
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((::CORBA::SystemException));
+
protected:
/// Destructor.
~Execution_Manager_Impl (void);
diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
index fa6b51d8de2..e17807bf7e3 100644
--- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
+++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
@@ -39,6 +39,16 @@ CIAO::NodeApplication_Impl::create_all_containers (
// 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 ()));
+ }
}
return 0;
@@ -47,7 +57,25 @@ CIAO::NodeApplication_Impl::create_all_containers (
void
CIAO::NodeApplication_Impl::finishLaunch (
const Deployment::Connections & providedReference,
- CORBA::Boolean start
+ CORBA::Boolean start,
+ CORBA::Boolean is_ReDAC
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Deployment::StartError,
+ Deployment::InvalidConnection))
+{
+ ACE_UNUSED_ARG (start);
+
+ // parameter "true" means we want to establish new connections
+ // instead of "remove" existing connections.
+ this->finishLaunch_i (providedReference, start, is_ReDAC);
+}
+
+void
+CIAO::NodeApplication_Impl::finishLaunch_i (
+ const Deployment::Connections & providedReference,
+ CORBA::Boolean start,
+ bool is_ReDAC
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError,
@@ -97,20 +125,39 @@ CIAO::NodeApplication_Impl::finishLaunch (
name.c_str ()));
}
- comp->connect (providedReference[i].portName.in (),
- providedReference[i].endpoint.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (CIAO::debug_level () > 9)
+ if (!is_ReDAC)
{
- ACE_DEBUG ((LM_DEBUG,
- "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
- "CIAO::NodeApplication_Impl::finishLaunch, "
- "success connecting port name [%s] in "
- "instance [%s] \n",
- providedReference[i].portName.in (),
- name.c_str ()));
+ // We don't care about the returned "cookie" here for
+ // SimplexReceptable type, but what about MultiplexReceptable?
+ comp->connect (providedReference[i].portName.in (),
+ providedReference[i].endpoint.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success connecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
+ }
+ else
+ {
+ comp->disconnect (providedReference[i].portName.in (), 0);
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success disconnecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
}
break;
@@ -146,20 +193,42 @@ CIAO::NodeApplication_Impl::finishLaunch (
name.c_str ()));
}
- comp->connect_consumer (providedReference[i].portName.in (),
- consumer.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (CIAO::debug_level () > 9)
+ if (!is_ReDAC)
{
- ACE_DEBUG ((LM_DEBUG,
- "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
- "CIAO::NodeApplication_Impl::finishLaunch, "
- "success connecting port name [%s] in "
- "instance [%s] \n",
- providedReference[i].portName.in (),
- name.c_str ()));
+ comp->connect_consumer (providedReference[i].portName.in (),
+ consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success connecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
+ }
+ else
+ {
+// Operation not implemented by the CIDLC.
+// comp->disconnect_consumer (providedReference[i].portName.in (),
+// 0
+// ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success disconnecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
}
break;
@@ -192,20 +261,41 @@ CIAO::NodeApplication_Impl::finishLaunch (
name.c_str ()));
}
- comp->subscribe (providedReference[i].portName.in (),
- consumer.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- if (CIAO::debug_level () > 9)
+ if (!is_ReDAC)
{
- ACE_DEBUG ((LM_DEBUG,
- "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
- "CIAO::NodeApplication_Impl::finishLaunch, "
- "success connecting port name [%s] in "
- "instance [%s] \n",
- providedReference[i].portName.in (),
- name.c_str ()));
+ comp->subscribe (providedReference[i].portName.in (),
+ consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success connecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
+ }
+ else
+ {
+ comp->unsubscribe (providedReference[i].portName.in (),
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CIAO::debug_level () > 9)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO (%P|%t) - NodeApplication_Impl.cpp, "
+ "CIAO::NodeApplication_Impl::finishLaunch, "
+ "success disconnecting port name [%s] in "
+ "instance [%s] \n",
+ providedReference[i].portName.in (),
+ name.c_str ()));
+ }
}
break;
@@ -351,8 +441,7 @@ CIAO::NodeApplication_Impl::install (
// 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
+ // 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;
@@ -499,18 +588,6 @@ CIAO::NodeApplication_Impl::create_container (
this->container_set_.add (ci.in ());
}
- /*
- // Build the Component_Container_Map
- for (CORBA::ULong j = 0;
- j < container_info.impl_infos.length ();
- ++j)
- {
- this->component_container_map_.bind (
- container_info.impl_infos[j].component_instance_name.in (),
- ::Deployment::Container::_duplicate (ci.in ()));
- }
-*/
-
if (CIAO::debug_level () > 1)
ACE_DEBUG ((LM_DEBUG,
"LEAVING: NodeApplication_Impl::create_container()\n"));
diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h
index cf4ac4a4ec0..0d9eb7d548f 100644
--- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h
+++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h
@@ -85,7 +85,8 @@ namespace CIAO
*/
virtual void
finishLaunch (const Deployment::Connections & providedReference,
- CORBA::Boolean start
+ CORBA::Boolean start,
+ CORBA::Boolean is_ReDAC
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError,
@@ -195,6 +196,15 @@ namespace CIAO
get_objref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
protected:
+ virtual void
+ finishLaunch_i (const Deployment::Connections & providedReference,
+ CORBA::Boolean start,
+ bool is_establishing_connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Deployment::StartError,
+ Deployment::InvalidConnection));
+
/// Create and initialize all the containers
virtual CORBA::Long create_all_containers (
const ::Deployment::ContainerImplementationInfos & container_infos
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp
index 3fe7d5728b3..58d4794ff5c 100644
--- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp
@@ -160,7 +160,6 @@ startLaunch (const Deployment::Properties & configProperty,
{
ACE_TRY
{
-
CIAO_TRACE("CIAO::NodeApplicationManager_Impl::startLaunch");
ACE_UNUSED_ARG (configProperty);
ACE_UNUSED_ARG (start);
@@ -302,8 +301,28 @@ perform_redeployment (const Deployment::Properties & configProperty,
::Deployment::InvalidProperty,
::Components::RemoveFailure))
{
+ // 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 coudl pretty much clone the "startLaunch" implementation.
+ // This capability is useful to install a set of new components into
+ // some totally new nodes.
+
ACE_UNUSED_ARG (configProperty);
- ACE_UNUSED_ARG (providedReference);
ACE_UNUSED_ARG (start);
CIAO_TRACE ("CIAO::NodeApplicationManager_Impl_Base::perform_redeployment");
@@ -311,8 +330,117 @@ perform_redeployment (const Deployment::Properties & configProperty,
ACE_DEBUG ((LM_DEBUG,
"CIAO (%P|%t) NodeApplicationManager_Impl_Base: "
"invoked CIAO::NodeApplicationManager_Impl_Base::perform_redeployment \n"));
+ ACE_TRY
+ {
+ if (! CORBA::is_nil (this->nodeapp_))
+ {
+ // 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);
+
+ 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];
+ }
+ }
+
+ // package the components
+ NodeImplementationInfoHandler handler (tmp_plan);
+ Deployment::NodeImplementationInfo * node_info =
+ handler.node_impl_info ();
+
+ if (!node_info)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "DAnCE (%P|%t) NodeApplicationManager.cpp -"
+ "CIAO::NodeApplicationManager_Impl::perform_redeployment -"
+ "Failed to create Node Implementation Infos!\n"));
+
+ ACE_TRY_THROW
+ (Deployment::PlanError ("NodeApplicationManager_Imp::perform_redeployment",
+ "Unable to get node level infos"));
+ }
+
+ // Install the components
+ // This is what we will get back, a sequence of compoent object refs.
+ Deployment::ComponentInfos_var comp_info;
+ comp_info = this->nodeapp_->install (*node_info ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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)
+ {
+ //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())))
+ {
+ ACE_CString error ("Duplicate component instance name ");
+ error += comp_info[len].component_instance_name.in();
+
+ ACE_TRY_THROW
+ (Deployment::StartError
+ ("NodeApplicationManager_Impl::startLaunch",
+ error.c_str ()));
+ }
+ }
+
+ // NOTE: We are propogating back "all" the facets/consumers object
+ // references to the DAM, including the previous existing ones.
+ providedReference =
+ this->create_connections (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (providedReference == 0)
+ {
+ ACE_TRY_THROW
+ (Deployment::StartError
+ ("NodeApplicationManager_Impl::startLaunch",
+ "Error creating connections during startLaunch."));
+ }
+ // @@TODO
+ // Do an iteration over the <component_map_>, for those components that
+ // are not in the "new plan", we should remove them.
+ }
+ 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.
+ {
- return 0;
+ }
+ }
+ ACE_CATCH (Deployment::UnknownImplId, e)
+ {
+ ACE_THROW_RETURN (Deployment::StartError (e.name.in (),
+ e.reason.in ()),
+ Deployment::Application::_nil());
+ }
+ ACE_CATCH (Deployment::ImplEntryPointNotFound, e)
+ {
+ ACE_THROW_RETURN (Deployment::StartError (e.name.in (),
+ e.reason.in ()),
+ Deployment::Application::_nil());
+ }
+ ACE_CATCH (Deployment::InstallationFailure,e)
+ {
+ ACE_THROW_RETURN (Deployment::StartError (e.name.in (),
+ e.reason.in ()),
+ Deployment::Application::_nil());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (Deployment::Application::_nil());
+
+ return Deployment::NodeApplication::_duplicate (this->nodeapp_.in ());
}
void
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
index f7a672a6386..935a2e87470 100644
--- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
+++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
@@ -82,6 +82,11 @@ namespace CIAO
::Deployment::InvalidProperty,
::Components::RemoveFailure));
+ virtual void
+ reset_plan (const ::Deployment::DeploymentPlan & plan
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((::CORBA::SystemException));
+
/**
* A factory operation to create NodeApplicationManager interface, and return
* the object reference.
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl
index 5a29debbb53..000e8475e3c 100644
--- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl
+++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.inl
@@ -8,6 +8,7 @@ NodeApplicationManager_Impl_Base (CORBA::ORB_ptr o,
: orb_ (CORBA::ORB::_duplicate (o)),
poa_ (PortableServer::POA::_duplicate (p)),
callback_poa_ (PortableServer::POA::_nil ()),
+ nodeapp_ (Deployment::NodeApplication::_nil ()),
spawn_delay_ (5)
// @@ (OO) The default size for an ACE_Hash_Map_Mapanger is quiet
// large. The maximum size of an ACE_Hash_Map_Manager is
@@ -24,3 +25,12 @@ 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
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((::CORBA::SystemException))
+{
+ this->plan_ = plan;
+}
diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp
index 4980b26ef2c..31ac4a31485 100644
--- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp
@@ -149,6 +149,14 @@ CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan
ACE_TRY_CHECK;
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 ()));
+ ACE_TRY_CHECK;
+
+ // narrow should return a nil reference if it fails.
+ return
+ Deployment::NodeApplicationManager::_narrow (obj.in ());
}
else
{
@@ -158,16 +166,22 @@ CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan
"with UUID: %s\n",
plan.UUID.in ()));
}
- }
+ CORBA::Object_var obj =
+ this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ()));
+ ACE_TRY_CHECK;
+
+ Deployment::NodeApplicationManager_var nam =
+ Deployment::NodeApplicationManager::_narrow (obj.in ());
+ ACE_TRY_CHECK;
- CORBA::Object_var obj =
- this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ()));
- ACE_TRY_CHECK;
+ nam->reset_plan (plan);
+ ACE_TRY_CHECK;
- // narrow should return a nil reference if it fails.
- return
- Deployment::NodeApplicationManager::_narrow (obj.in ());
+ // Potentially we could reset many other configuration settings
+ // such as command line options, service configuration file, etc.
+ return nam._retn ();
+ }
}
ACE_CATCH (PortableServer::POA::ObjectNotActive, ex)
{
diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
index 654e3b2a59e..5408bfaf8dd 100644
--- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
+++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
@@ -13,6 +13,7 @@ namespace CIAO
{
// deployment plan URL
const char* package_url = 0;
+ const char* new_package_url = 0;
bool use_naming = false;
const char* ior_file = "file://em.ior";
const char* dap_ior_filename = 0;
@@ -37,6 +38,7 @@ namespace CIAO
ACE_TEXT (" Execution Manager IOR Alternative to -k\n")
ACE_TEXT ("-o <DOMAIN_APPLICATION_MANAGER_IOR_OUTPUT_FILE>\n")
ACE_TEXT ("-i <DOMAIN_APPLICATION_MANAGER_IOR_FOR_INPUT>\n")
+ ACE_TEXT ("-r <NEW_PLAN_DESCRIPTOR_FOR_REDEPLOYMENT>\n")
ACE_TEXT ("-h : Show this usage information\n"),
program));
}
@@ -47,7 +49,7 @@ namespace CIAO
{
ACE_Get_Opt get_opt (argc,
argv,
- ACE_TEXT ("p:nk:o:i:h"));
+ ACE_TEXT ("p:nk:o:i:r:h"));
int c;
while ((c = get_opt ()) != EOF)
@@ -71,6 +73,9 @@ namespace CIAO
dap_ior = get_opt.opt_arg ();
mode = pl_mode_stop;
break;
+ case 'r':
+ new_package_url = get_opt.opt_arg ();
+ break;
case 'h':
default:
usage(argv[0]);
@@ -78,7 +83,9 @@ namespace CIAO
}
}
- if ((mode != pl_mode_stop) && (package_url == 0))
+ if ((mode != pl_mode_stop) &&
+ (package_url == 0) &&
+ (new_package_url ==0))
{
usage (argv[0]);
return false;
@@ -147,7 +154,7 @@ namespace CIAO
::Deployment::DomainApplicationManager_var dapp_mgr;
- if (mode != pl_mode_stop)
+ if (mode != pl_mode_stop && new_package_url == 0) // do initial deployment
{
const char* uuid = launcher.launch_plan (package_url);
@@ -171,6 +178,16 @@ namespace CIAO
std::cin.getline (dummy, 256);
}
}
+ else if (mode != pl_mode_stop && new_package_url != 0) // do redeployment
+ {
+ const char* uuid = launcher.re_launch_plan (new_package_url);
+
+ if (uuid == 0)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) Plan_Launcher: Error re-launching plan\n"));
+ return -1;
+ }
+ }
else
{
dapp_mgr = read_dap_ior (orb.in ()
diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp
index cd98314ce84..c24eda63055 100644
--- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp
+++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp
@@ -91,7 +91,7 @@ namespace CIAO
return this->launch_plan (plan.in ());
}
-
+
const char *
Plan_Launcher_i::launch_plan (const ::Deployment::DeploymentPlan &plan ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure))
@@ -143,7 +143,7 @@ namespace CIAO
if (CIAO::debug_level ())
ACE_DEBUG ((LM_DEBUG,
"CIAO_PlanLauncher: finish Launch application...\n"));
- dam->finishLaunch (start);
+ dam->finishLaunch (start, false); // is_ReDAC by default is <false>
if (CIAO::debug_level ())
ACE_DEBUG ((LM_DEBUG, "[success]\n"));
@@ -164,8 +164,6 @@ namespace CIAO
map_.bind_dam_reference (plan.UUID.in (),
Deployment::DomainApplicationManager::_duplicate (dam.in ()));
-
-
}
ACE_CATCH (Deployment::ResourceNotAvailable, ex)
{
@@ -272,7 +270,39 @@ namespace CIAO
if (CIAO::debug_level ())
ACE_DEBUG ((LM_DEBUG, "[success]\n"));
}
-
+
+ const char *
+ Plan_Launcher_i::re_launch_plan (const char *plan_uri ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure))
+ {
+ CIAO::Config_Handlers::XML_File_Intf intf (plan_uri);
+
+ ::Deployment::DeploymentPlan_var plan =
+ intf.get_plan ();
+
+ return this->re_launch_plan (plan.in ());
+ }
+
+ const char *
+ Plan_Launcher_i::re_launch_plan (const ::Deployment::DeploymentPlan &plan ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure))
+ {
+
+ 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 ())
+ ACE_DEBUG ((LM_DEBUG,
+ "CIAO_PlanLauncher: new plan redeployed ...\n"));
+
+ return 0;
+ }
}
-
}
diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
index 41e2cebacb8..a58c95f1434 100644
--- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
+++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h
@@ -45,6 +45,10 @@ namespace CIAO
const char * launch_plan (const char *plan_uri
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((Deployment_Failure));
+
+ const char * re_launch_plan (const char *plan_uri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Deployment_Failure));
/**
* @fn launch_plan
@@ -55,6 +59,10 @@ namespace CIAO
const char * launch_plan (const ::Deployment::DeploymentPlan &plan
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((Deployment_Failure));
+
+ const char * re_launch_plan (const ::Deployment::DeploymentPlan &plan
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Deployment_Failure));
/// Returns the DAM associated with a given plan URI
::Deployment::DomainApplicationManager_ptr get_dam (const char *uuid
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp b/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp
index 8aa41d076fa..7cb4fb21be0 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/Repository_Manager.cpp
@@ -235,7 +235,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Call finish Launch to complete the connections
ACE_DEBUG ((LM_DEBUG, "Executor: finish Launch application....."));
- dapp_mgr->finishLaunch (start);
+ dapp_mgr->finishLaunch (start, true);
ACE_DEBUG ((LM_DEBUG, "[success]\n"));
// Call start to activate components
diff --git a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp
index 81a9ed3a390..b85b39185dc 100644
--- a/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp
+++ b/TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeApp_test_client_dynamic.cpp
@@ -144,11 +144,10 @@ main (int argc, char *argv[])
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_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG, "=====Test success!!\n"));
diff --git a/TAO/CIAO/ciao/Deployment.idl b/TAO/CIAO/ciao/Deployment.idl
index 9ef7d45f3e9..2eb745dcf98 100644
--- a/TAO/CIAO/ciao/Deployment.idl
+++ b/TAO/CIAO/ciao/Deployment.idl
@@ -53,14 +53,20 @@ module Deployment {
interface DomainApplicationManager
{
DeploymentPlan getPlan ();
+
void startLaunch (in Properties configProperty, in boolean start)
raises (ResourceNotAvailable, StartError, InvalidProperty);
- void finishLaunch (in boolean start)
+
+ void finishLaunch (in boolean start,
+ in boolean is_ReDAC)
raises (StartError, InvalidConnection);
+
void start ()
raises (StartError);
+
void destroyApplication ()
raises (StopError);
+
void destroyManager ()
raises (StopError);
@@ -97,6 +103,9 @@ module Deployment {
InvalidConnection,
InvalidProperty,
::Components::RemoveFailure);
+
+ // Get operation
+ DeploymentPlan getPlan (in string plan_uuid);
};
interface TargetManager {
@@ -128,6 +137,8 @@ module Deployment {
InvalidConnection,
InvalidProperty,
::Components::RemoveFailure);
+
+ void reset_plan (in DeploymentPlan plan);
};
interface NodeManager {
diff --git a/TAO/CIAO/ciao/Deployment_Core.idl b/TAO/CIAO/ciao/Deployment_Core.idl
index 29171f09a98..30a42bc1e57 100644
--- a/TAO/CIAO/ciao/Deployment_Core.idl
+++ b/TAO/CIAO/ciao/Deployment_Core.idl
@@ -123,7 +123,9 @@ module Deployment
//==================================
interface Application
{
- void finishLaunch (in Connections providedReference, in boolean start)
+ void finishLaunch (in Connections providedReference,
+ in boolean start,
+ in boolean is_ReDAC)
raises (StartError, InvalidConnection);
void start ()
raises (StartError);
diff --git a/TAO/CIAO/examples/Hello/descriptors/flattened_deploymentplan_without_ns.cdp b/TAO/CIAO/examples/Hello/descriptors/flattened_deploymentplan_without_ns.cdp
index 93ea095a6e5..8f61ed445fa 100644
--- a/TAO/CIAO/examples/Hello/descriptors/flattened_deploymentplan_without_ns.cdp
+++ b/TAO/CIAO/examples/Hello/descriptors/flattened_deploymentplan_without_ns.cdp
@@ -120,7 +120,7 @@
<connection>
- <name>hell_event_connection</name>
+ <name>hello_event_connection</name>
<internalEndpoint>
<portName>click_out</portName>
<kind>EventPublisher</kind>