summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/CIAO/ChangeLog14
-rw-r--r--modules/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp2
-rw-r--r--modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.cpp215
-rw-r--r--modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.h126
-rw-r--r--modules/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleProcessColocation.cdp117
5 files changed, 473 insertions, 1 deletions
diff --git a/modules/CIAO/ChangeLog b/modules/CIAO/ChangeLog
index 26ffb513b8f..9214c684a87 100644
--- a/modules/CIAO/ChangeLog
+++ b/modules/CIAO/ChangeLog
@@ -1,3 +1,17 @@
+Tue Jun 16 19:11:49 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * DAnCE/NodeApplication/NodeApplication_Impl.cpp:
+
+ Fix for a segmentation fault with unhomed components.
+
+ * DAnCE/tests/CIAO/Components/ProcessColocation_exec.h:
+ * DAnCE/tests/CIAO/Components/ProcessColocation_exec.cpp:
+ * DAnCE/tests/CIAO/NodeManager-Deployments/SimpleProcessColocation.cdp:
+
+ Simple test to determine if PlanLocality constraints work or not. Note
+ that as this support has yet to be implemented, this test is currently designed
+ to fail.
+
Tue Jun 16 18:46:22 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* examples/DevGuideExamples/Messenger/Administrator.mpc
diff --git a/modules/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/modules/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
index b242c1a24af..86657aa8052 100644
--- a/modules/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
+++ b/modules/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp
@@ -1189,7 +1189,7 @@ NodeApplication_Impl::init_components()
DANCE_DEBUG ((LM_DEBUG, DLINFO "NodeApplication_impl::init_components - "
"Allocating instance %C as a standalone component\n",
this->plan_.instance[i].name.in ()));
- size_t pos = this->servers_[0].containers[0].homes.size ();
+ size_t pos = this->servers_[0].containers[0].components.size ();
this->servers_[0].containers[0].components.size (pos + 1);
this->servers_[0].containers[0].components[pos] = Instance (eComponent,
&this->servers_[0].containers[0],
diff --git a/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.cpp b/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.cpp
new file mode 100644
index 00000000000..ebb4c682d1a
--- /dev/null
+++ b/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.cpp
@@ -0,0 +1,215 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.6.9 ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be/be_codegen.cpp:1372
+
+#include "ProcessColocation_exec.h"
+#include "ciao/CIAO_common.h"
+#include "ace/Singleton.h"
+
+namespace
+{
+ class Colocation_Tester
+ {
+ public:
+ Colocation_Tester (void)
+ : value_ ("")
+ {
+ }
+
+ ACE_CString value (void)
+ {
+ return value_;
+ }
+
+ void value (const ACE_CString &s)
+ {
+ value_ = s;
+ }
+
+ private:
+ ACE_CString value_;
+ };
+
+ typedef ACE_Singleton <Colocation_Tester,
+ ACE_SYNCH_RECURSIVE_MUTEX> Colocation_Tester_Singleton;
+
+#define TESTER Colocation_Tester_Singleton::instance ()
+}
+
+namespace CIAO_Simple_ProcessColocation_Impl
+{
+ //============================================================
+ // Component Executor Implementation Class: ProcessColocation_exec_i
+ //============================================================
+
+ ProcessColocation_exec_i::ProcessColocation_exec_i (void)
+ {
+ }
+
+ ProcessColocation_exec_i::~ProcessColocation_exec_i (void)
+ {
+ }
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ char *
+ ProcessColocation_exec_i::process_name (void)
+ {
+ return CORBA::string_dup (this->process_name_.c_str ());
+ }
+
+ void
+ ProcessColocation_exec_i::process_name (
+ const char * process_name )
+ {
+ CIAO_DEBUG ((LM_EMERGENCY, "Setting attr process name:%s\n",
+ process_name));
+
+ this->process_name_ = process_name;
+ TESTER->value (process_name);
+ }
+
+ // Port operations.
+
+ // Operations from Components::SessionComponent.
+
+ void
+ ProcessColocation_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ ::Simple::CCM_ProcessColocation_Context::_narrow (ctx);
+
+ if ( ::CORBA::is_nil (this->context_.in ()))
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ ProcessColocation_exec_i::configuration_complete (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ ProcessColocation_exec_i::ccm_activate (void)
+ {
+ ACE_CString value = TESTER->value ();
+
+ if (this->process_name_ != value)
+ {
+ CIAO_DEBUG ((LM_EMERGENCY, "ProcessColocation_exec_i::ccm_activate - "
+ "Error: I am colocated with someone I shouldn't be. My process value is %s, expected %s\n",
+ value.c_str (),
+ this->process_name_.c_str ()));
+ // throw CORBA::BAD_PARAM ();
+ }
+ }
+
+ void
+ ProcessColocation_exec_i::ccm_passivate (void)
+ {
+ /* Your code here. */
+ }
+
+ void
+ ProcessColocation_exec_i::ccm_remove (void)
+ {
+ /* Your code here. */
+ }
+
+ extern "C" PROCESSCOLOCATION_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Simple_ProcessColocation_Impl (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ ProcessColocation_exec_i,
+ ::Components::EnterpriseComponent::_nil ());
+
+ return retval;
+ }
+}
+
+namespace CIAO_Simple_ProcessColocation_Impl
+{
+ //============================================================
+ // Home Executor Implementation Class: ProcessColocationHome_exec_i
+ //============================================================
+
+ ProcessColocationHome_exec_i::ProcessColocationHome_exec_i (void)
+ {
+ }
+
+ ProcessColocationHome_exec_i::~ProcessColocationHome_exec_i (void)
+ {
+ }
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ ::Components::EnterpriseComponent_ptr
+ ProcessColocationHome_exec_i::create (void)
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_THROW_EX (
+ retval,
+ ProcessColocation_exec_i,
+ ::CORBA::NO_MEMORY ());
+
+ return retval;
+ }
+
+ extern "C" PROCESSCOLOCATION_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_Simple_ProcessColocationHome_Impl (void)
+ {
+ ::Components::HomeExecutorBase_ptr retval =
+ ::Components::HomeExecutorBase::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ ProcessColocationHome_exec_i,
+ ::Components::HomeExecutorBase::_nil ());
+
+ return retval;
+ }
+}
+
diff --git a/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.h b/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.h
new file mode 100644
index 00000000000..ed5e8d3d950
--- /dev/null
+++ b/modules/CIAO/DAnCE/tests/CIAO/Components/ProcessColocation_exec.h
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.6.9 ****
+// TAO and the TAO IDL Compiler have been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// and
+// Distributed Object Computing Laboratory
+// University of California at Irvine
+// Irvine, CA
+// USA
+// http://doc.ece.uci.edu/
+// and
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about TAO is available at:
+// http://www.cs.wustl.edu/~schmidt/TAO.html
+
+// TAO_IDL - Generated from
+// be/be_codegen.cpp:1301
+
+#ifndef CIAO_PROCESSCOLOCATION_EXEC_H_
+#define CIAO_PROCESSCOLOCATION_EXEC_H_
+
+#include /**/ "ace/pre.h"
+
+#include "ProcessColocationEC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include /**/ "ProcessColocation_exec_export.h"
+#include "tao/LocalObject.h"
+#include "ace/String_Base.h"
+
+namespace CIAO_Simple_ProcessColocation_Impl
+{
+ class PROCESSCOLOCATION_EXEC_Export ProcessColocation_exec_i
+ : public virtual ProcessColocation_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ ProcessColocation_exec_i (void);
+ virtual ~ProcessColocation_exec_i (void);
+
+ // Supported operations and attributes.
+
+ // Component attributes.
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual char *
+ process_name (void);
+
+ // TAO_IDL - Generated from
+ // be/be_visitor_operation/operation_ch.cpp:46
+
+ virtual void
+ process_name (
+ const char * process_name);
+
+ // Port operations.
+
+ // Operations from Components::SessionComponent.
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void configuration_complete (void);
+
+ virtual void ccm_activate (void);
+ virtual void ccm_passivate (void);
+ virtual void ccm_remove (void);
+
+ private:
+ ACE_CString process_name_;
+ ::Simple::CCM_ProcessColocation_Context_var context_;
+ };
+
+ extern "C" PROCESSCOLOCATION_EXEC_Export ::Components::EnterpriseComponent_ptr
+ create_Simple_ProcessColocation_Impl (void);
+}
+
+namespace CIAO_Simple_ProcessColocation_Impl
+{
+ class PROCESSCOLOCATION_EXEC_Export ProcessColocationHome_exec_i
+ : public virtual ProcessColocationHome_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ ProcessColocationHome_exec_i (void);
+
+ virtual ~ProcessColocationHome_exec_i (void);
+
+ // All operations and attributes.
+
+ // Factory operations.
+
+ // Finder operations.
+
+ // Implicit operations.
+
+ virtual ::Components::EnterpriseComponent_ptr
+ create (void);
+ };
+
+ extern "C" PROCESSCOLOCATION_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_Simple_ProcessColocationHome_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* ifndef */
+
diff --git a/modules/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleProcessColocation.cdp b/modules/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleProcessColocation.cdp
new file mode 100644
index 00000000000..90aafda82e1
--- /dev/null
+++ b/modules/CIAO/DAnCE/tests/CIAO/NodeManager-Deployments/SimpleProcessColocation.cdp
@@ -0,0 +1,117 @@
+<Deployment:DeploymentPlan
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd">
+ <label>SimpleComponent_Home</label>
+ <UUID>SimpleComponent_Home</UUID>
+
+ <!-- Implementations declarations -->
+
+ <!-- Server Dance implementation-->
+ <implementation xmi:id="ProcessColocationComponentImplementation">
+ <name>ProcessColocationComponentImplementation</name>
+ <source/>
+ <artifact xmi:idref="ProcessColocation_ExecArtifact" />
+ <artifact xmi:idref="ProcessColocation_SvntArtifact" />
+ <execParameter>
+ <!-- entrypoint as exec parameter (see ยง10.6.1) -->
+ <name>component factory</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Simple_ProcessColocation_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_Simple_ProcessColocation_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>ProcessColocation_svnt</string>
+ </value>
+ </value>
+ </execParameter>
+ <execParameter>
+ <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>ProcessColocation_exec</string>
+ </value>
+ </value>
+ </execParameter>
+ </implementation>
+
+ <instance xmi:id="ProcessColocationComponentInstance_1">
+ <name>ProcessColocationComponent_One</name>
+ <node>Node</node>
+ <!-- hostname -->
+ <source/>
+ <implementation xmi:idref="ProcessColocationComponentImplementation" />
+
+ <configProperty>
+ <name>process_name</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Process One</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
+
+ <instance xmi:id="ProcessColocationComponentInstance_2">
+ <name>ProcessColocationComponent_Two</name>
+ <node>Node</node>
+ <!-- hostname -->
+ <source/>
+ <implementation xmi:idref="ProcessColocationComponentImplementation" />
+ <configProperty>
+ <name>process_name</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>Process Two</string>
+ </value>
+ </value>
+ </configProperty>
+ </instance>
+
+ <!-- Artifacts declarations -->
+ <artifact xmi:id="ProcessColocation_ExecArtifact">
+ <name>ProcessColocation_exec</name>
+ <source/>
+ <node/>
+ <location>ProcessColocation_exec</location>
+ </artifact>
+ <artifact xmi:id="ProcessColocation_SvntArtifact">
+ <name>ProcessColocation_svnt</name>
+ <source/>
+ <node/>
+ <location>ProcessColocation_svnt</location>
+ </artifact>
+
+ </Deployment:DeploymentPlan>