diff options
Diffstat (limited to 'modules/CIAO/RACE/Input_Adapters')
46 files changed, 4721 insertions, 0 deletions
diff --git a/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.idl b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.idl new file mode 100644 index 00000000000..b1c3f7f0ddb --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.idl @@ -0,0 +1,21 @@ +//$Id$ +//Input_Adapter.idl + +#ifndef RACE_INPUT_ADAPTER_IDL +#define RACE_INPUT_ADAPTER_IDL + +#include <Components.idl> +#include "../../Plan_Analyzer/Interface/PlanIngress.idl" + +module CIAO +{ + module RACE + { + component Input_Adapter + { + uses PlanIngress ingress; + }; + }; +}; + +#endif /* RACE_INPUT_ADAPTER_IDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc new file mode 100644 index 00000000000..8ef8d7bf6d8 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter.mpc @@ -0,0 +1,59 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -n Input_Adapter" + +project(Input_Adapter_stub): ciao_deployment_stub { + + after += Plan_Analyzer_Interface_stub + sharedname = Input_Adapter_stub + idlflags += -Wb,stub_export_macro=INPUT_ADAPTER_STUB_Export \ + -Wb,stub_export_include=Input_Adapter_stub_export.h \ + -Wb,skel_export_macro=INPUT_ADAPTER_SVNT_Export \ + -Wb,skel_export_include=Input_Adapter_svnt_export.h + dynamicflags = INPUT_ADAPTER_STUB_BUILD_DLL + libs += Plan_Analyzer_Interface_stub + + IDL_Files { + Input_Adapter.idl + } + + Source_Files { + Input_AdapterC.cpp + } + + Header_Files { + Input_AdapterC.h + } + + Inline_Files { + Input_AdapterC.inl + } +} + +project(Input_Adapter_svnt) : ciao_servant_dnc { + + after += Input_Adapter_stub + sharedname = Input_Adapter_svnt + libs += Input_Adapter_stub Plan_Analyzer_Interface_stub + + idlflags += -Wb,stub_export_macro=INPUT_ADAPTER_STUB_Export \ + -Wb,stub_export_include=Input_Adapter_stub_export.h \ + -Wb,skel_export_macro=INPUT_ADAPTER_SVNT_Export \ + -Wb,skel_export_include=Input_Adapter_svnt_export.h + dynamicflags = INPUT_ADAPTER_SVNT_BUILD_DLL + + IDL_Files { + Input_Adapter.idl + } + + Source_Files { + Input_AdapterS.cpp + } + + Header_Files { + Input_AdapterS.h + } + + Inline_Files { + Input_AdapterS.inl + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_stub_export.h b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_stub_export.h new file mode 100644 index 00000000000..546b8e64659 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_stub_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl INPUT_ADAPTER_STUB +// ------------------------------ +#ifndef INPUT_ADAPTER_STUB_EXPORT_H +#define INPUT_ADAPTER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (INPUT_ADAPTER_STUB_HAS_DLL) +# define INPUT_ADAPTER_STUB_HAS_DLL 1 +#endif /* ! INPUT_ADAPTER_STUB_HAS_DLL */ + +#if defined (INPUT_ADAPTER_STUB_HAS_DLL) && (INPUT_ADAPTER_STUB_HAS_DLL == 1) +# if defined (INPUT_ADAPTER_STUB_BUILD_DLL) +# define INPUT_ADAPTER_STUB_Export ACE_Proper_Export_Flag +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* INPUT_ADAPTER_STUB_BUILD_DLL */ +# define INPUT_ADAPTER_STUB_Export ACE_Proper_Import_Flag +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* INPUT_ADAPTER_STUB_BUILD_DLL */ +#else /* INPUT_ADAPTER_STUB_HAS_DLL == 1 */ +# define INPUT_ADAPTER_STUB_Export +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) +# define INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* INPUT_ADAPTER_STUB_HAS_DLL == 1 */ + +// Set INPUT_ADAPTER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (INPUT_ADAPTER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define INPUT_ADAPTER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define INPUT_ADAPTER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !INPUT_ADAPTER_STUB_NTRACE */ + +#if (INPUT_ADAPTER_STUB_NTRACE == 1) +# define INPUT_ADAPTER_STUB_TRACE(X) +#else /* (INPUT_ADAPTER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define INPUT_ADAPTER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (INPUT_ADAPTER_STUB_NTRACE == 1) */ + +#endif /* INPUT_ADAPTER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_svnt_export.h b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_svnt_export.h new file mode 100644 index 00000000000..0d7bf2fc787 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Base/Input_Adapter_svnt_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl INPUT_ADAPTER_SVNT +// ------------------------------ +#ifndef INPUT_ADAPTER_SVNT_EXPORT_H +#define INPUT_ADAPTER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (INPUT_ADAPTER_SVNT_HAS_DLL) +# define INPUT_ADAPTER_SVNT_HAS_DLL 1 +#endif /* ! INPUT_ADAPTER_SVNT_HAS_DLL */ + +#if defined (INPUT_ADAPTER_SVNT_HAS_DLL) && (INPUT_ADAPTER_SVNT_HAS_DLL == 1) +# if defined (INPUT_ADAPTER_SVNT_BUILD_DLL) +# define INPUT_ADAPTER_SVNT_Export ACE_Proper_Export_Flag +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* INPUT_ADAPTER_SVNT_BUILD_DLL */ +# define INPUT_ADAPTER_SVNT_Export ACE_Proper_Import_Flag +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* INPUT_ADAPTER_SVNT_BUILD_DLL */ +#else /* INPUT_ADAPTER_SVNT_HAS_DLL == 1 */ +# define INPUT_ADAPTER_SVNT_Export +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) +# define INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* INPUT_ADAPTER_SVNT_HAS_DLL == 1 */ + +// Set INPUT_ADAPTER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (INPUT_ADAPTER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define INPUT_ADAPTER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define INPUT_ADAPTER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !INPUT_ADAPTER_SVNT_NTRACE */ + +#if (INPUT_ADAPTER_SVNT_NTRACE == 1) +# define INPUT_ADAPTER_SVNT_TRACE(X) +#else /* (INPUT_ADAPTER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define INPUT_ADAPTER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (INPUT_ADAPTER_SVNT_NTRACE == 1) */ + +#endif /* INPUT_ADAPTER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.cidl b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.cidl new file mode 100644 index 00000000000..2bbbe6037c6 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.cidl @@ -0,0 +1,25 @@ +//$Id$ +//Interactive_Input_Adapter.cidl + +#ifndef RACE_INTERACTIVE_INPUT_ADAPTER_CIDL +#define RACE_INTERACTIVE_INPUT_ADAPTER_CIDL + +#include "Interactive_Input_Adapter.idl" + +module CIAO +{ + module RACE + { + composition session Interactive_Input_Adapter_Impl + { + home executor Interactive_Input_Adapter_Home_Exec + { + implements RACE::Interactive_Input_Adapter_Home; + manages Interactive_Input_Adapter_Exec; + }; + }; + }; +}; + + +#endif /* RACE_INTERACTIVE_INPUT_ADAPTER_CIDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl new file mode 100644 index 00000000000..d027b608c8b --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.idl @@ -0,0 +1,22 @@ +//$Id$ +#ifndef RACE_INTERACTIVE_INPUT_ADAPTER_IDL +#define RACE_INTERACTIVE_INPUT_ADAPTER_IDL + +#include <Components.idl> +#include "../Base/Input_Adapter.idl" + +module CIAO +{ + module RACE + { + component Interactive_Input_Adapter : Input_Adapter + { + }; + + home Interactive_Input_Adapter_Home manages Interactive_Input_Adapter + { + }; + }; +}; + +#endif /* RACE_INTERACTIVE_INPUT_ADAPTER_IDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc new file mode 100644 index 00000000000..2df82ac4a2f --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter.mpc @@ -0,0 +1,95 @@ +// generate_component_mpc.pl,v 1.9 2003/12/22 21:56:27 boris Exp +//$Id$ + +project(Interactive_Input_Adapter_stub): ciao_deployment_stub { + after += Input_Adapter_stub + sharedname = Interactive_Input_Adapter_stub + idlflags += -Wb,stub_export_macro=INTERACTIVE_INPUT_ADAPTER_STUB_Export \ + -Wb,stub_export_include=Interactive_Input_Adapter_stub_export.h \ + -Wb,skel_export_macro=INTERACTIVE_INPUT_ADAPTER_SVNT_Export \ + -Wb,skel_export_include=Interactive_Input_Adapter_svnt_export.h + dynamicflags = INTERACTIVE_INPUT_ADAPTER_STUB_BUILD_DLL + libs += Input_Adapter_stub \ + Plan_Analyzer_Interface_stub + + IDL_Files { + Interactive_Input_Adapter.idl + } + + Source_Files { + Interactive_Input_AdapterC.cpp + } + + Header_Files { + Interactive_Input_AdapterC.h + } + + Inline_Files { + Interactive_Input_AdapterC.inl + } +} + +project(Interactive_Input_Adapter_svnt) : ciao_servant_dnc { + after += Interactive_Input_Adapter_stub \ + Input_Adapter_svnt + sharedname = Interactive_Input_Adapter_svnt + libs += Interactive_Input_Adapter_stub \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub + + idlflags += -Wb,export_macro=INTERACTIVE_INPUT_ADAPTER_SVNT_Export \ + -Wb,export_include=Interactive_Input_Adapter_svnt_export.h + + dynamicflags = INTERACTIVE_INPUT_ADAPTER_SVNT_BUILD_DLL + + CIDL_Files { + Interactive_Input_Adapter.cidl + } + + IDL_Files { + Interactive_Input_AdapterE.idl + } + + Source_Files { + Interactive_Input_AdapterEC.cpp + Interactive_Input_AdapterS.cpp + Interactive_Input_Adapter_svnt.cpp + } + + Header_Files { + Interactive_Input_AdapterEC.h + Interactive_Input_AdapterS.h + Interactive_Input_Adapter_svnt.h + } + + Inline_Files { + Interactive_Input_AdapterEC.inl + Interactive_Input_AdapterS.inl + Interactive_Input_Adapter_svnt.inl + } +} + + +project(Interactive_Input_Adapter_exec) : ciao_component_dnc, ciao_config_handlers { + after += Interactive_Input_Adapter_svnt XSC_Config_Handlers + sharedname = Interactive_Input_Adapter_exec + libs += Interactive_Input_Adapter_stub \ + Interactive_Input_Adapter_svnt \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub \ + XSC_Config_Handlers + + idlflags += -Wb,export_macro=INTERACTIVE_INPUT_ADAPTER_EXEC_Export \ + -Wb,export_include=Interactive_Input_Adapter_exec_export.h + dynamicflags = INTERACTIVE_INPUT_ADAPTER_EXEC_BUILD_DLL + + IDL_Files { + + } + + Source_Files { + Interactive_Input_Adapter_exec.cpp + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.cpp b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.cpp new file mode 100644 index 00000000000..9d1603361ab --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.cpp @@ -0,0 +1,167 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Interactive_Input_Adapter_exec.h" +#include "ciao/CIAO_common.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_Interactive_Input_Adapter_Impl + { + //================================================================== + // Component Executor Implementation Class: Interactive_Input_Adapter_exec_i + //================================================================== + + Interactive_Input_Adapter_exec_i::Interactive_Input_Adapter_exec_i (void) + { + } + + Interactive_Input_Adapter_exec_i::~Interactive_Input_Adapter_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + void + Interactive_Input_Adapter_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + this->context_ = + Interactive_Input_Adapter_Context::_narrow ( + ctx); + + if (this->context_ == 0) + { + throw CORBA::INTERNAL (); + } + } + + void + Interactive_Input_Adapter_exec_i::ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Interactive_Input_Adapter_exec_i::ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Interactive_Input_Adapter_exec_i::ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Interactive_Input_Adapter_exec_i::ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + Interactive_Input_Adapter_exec_i::ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: Interactive_Input_Adapter_Home_exec_i + //================================================================== + + Interactive_Input_Adapter_Home_exec_i::Interactive_Input_Adapter_Home_exec_i (void) + { + } + + Interactive_Input_Adapter_Home_exec_i::~Interactive_Input_Adapter_Home_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + Interactive_Input_Adapter_Home_exec_i::create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + Interactive_Input_Adapter_exec_i, + CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" INTERACTIVE_INPUT_ADAPTER_EXEC_Export ::Components::HomeExecutorBase_ptr + createInteractive_Input_Adapter_Home_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + Interactive_Input_Adapter_Home_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } + } + } +} + diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.h b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.h new file mode 100644 index 00000000000..d16fbb76110 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec.h @@ -0,0 +1,132 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_INTERACTIVE_INPUT_ADAPTER_EXEC_H +#define CIAO_INTERACTIVE_INPUT_ADAPTER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "Interactive_Input_Adapter_svnt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Interactive_Input_Adapter_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_Interactive_Input_Adapter_Impl + { + class INTERACTIVE_INPUT_ADAPTER_EXEC_Export Interactive_Input_Adapter_exec_i + : public virtual Interactive_Input_Adapter_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + Interactive_Input_Adapter_exec_i (void); + virtual ~Interactive_Input_Adapter_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + protected: + Interactive_Input_Adapter_Context *context_; + }; + + class INTERACTIVE_INPUT_ADAPTER_EXEC_Export Interactive_Input_Adapter_Home_exec_i + : public virtual Interactive_Input_Adapter_Home_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + Interactive_Input_Adapter_Home_exec_i (void); + virtual ~Interactive_Input_Adapter_Home_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + }; + + extern "C" INTERACTIVE_INPUT_ADAPTER_EXEC_Export ::Components::HomeExecutorBase_ptr + createInteractive_Input_Adapter_Home_Impl (void); + } + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_INTERACTIVE_INPUT_ADAPTER_EXEC_H */ + diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec_export.h b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec_export.h new file mode 100644 index 00000000000..147e914cb7c --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_exec_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl INTERACTIVE_INPUT_ADAPTER_EXEC +// ------------------------------ +#ifndef INTERACTIVE_INPUT_ADAPTER_EXEC_EXPORT_H +#define INTERACTIVE_INPUT_ADAPTER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL 1 +#endif /* ! INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL */ + +#if defined (INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL) && (INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL == 1) +# if defined (INTERACTIVE_INPUT_ADAPTER_EXEC_BUILD_DLL) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_Export ACE_Proper_Export_Flag +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* INTERACTIVE_INPUT_ADAPTER_EXEC_BUILD_DLL */ +# define INTERACTIVE_INPUT_ADAPTER_EXEC_Export ACE_Proper_Import_Flag +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* INTERACTIVE_INPUT_ADAPTER_EXEC_BUILD_DLL */ +#else /* INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL == 1 */ +# define INTERACTIVE_INPUT_ADAPTER_EXEC_Export +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARATION(T) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* INTERACTIVE_INPUT_ADAPTER_EXEC_HAS_DLL == 1 */ + +// Set INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE */ + +#if (INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_EXEC_TRACE(X) +#else /* (INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define INTERACTIVE_INPUT_ADAPTER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (INTERACTIVE_INPUT_ADAPTER_EXEC_NTRACE == 1) */ + +#endif /* INTERACTIVE_INPUT_ADAPTER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_stub_export.h b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_stub_export.h new file mode 100644 index 00000000000..381f5d69197 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_stub_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl INTERACTIVE_INPUT_ADAPTER_STUB +// ------------------------------ +#ifndef INTERACTIVE_INPUT_ADAPTER_STUB_EXPORT_H +#define INTERACTIVE_INPUT_ADAPTER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL) +# define INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL 1 +#endif /* ! INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL */ + +#if defined (INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL) && (INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL == 1) +# if defined (INTERACTIVE_INPUT_ADAPTER_STUB_BUILD_DLL) +# define INTERACTIVE_INPUT_ADAPTER_STUB_Export ACE_Proper_Export_Flag +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* INTERACTIVE_INPUT_ADAPTER_STUB_BUILD_DLL */ +# define INTERACTIVE_INPUT_ADAPTER_STUB_Export ACE_Proper_Import_Flag +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* INTERACTIVE_INPUT_ADAPTER_STUB_BUILD_DLL */ +#else /* INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL == 1 */ +# define INTERACTIVE_INPUT_ADAPTER_STUB_Export +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARATION(T) +# define INTERACTIVE_INPUT_ADAPTER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* INTERACTIVE_INPUT_ADAPTER_STUB_HAS_DLL == 1 */ + +// Set INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE */ + +#if (INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_STUB_TRACE(X) +#else /* (INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define INTERACTIVE_INPUT_ADAPTER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (INTERACTIVE_INPUT_ADAPTER_STUB_NTRACE == 1) */ + +#endif /* INTERACTIVE_INPUT_ADAPTER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_svnt_export.h b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_svnt_export.h new file mode 100644 index 00000000000..e50838b8e2f --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/Interactive_Input_Adapter/Interactive_Input_Adapter_svnt_export.h @@ -0,0 +1,54 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl INTERACTIVE_INPUT_ADAPTER_SVNT +// ------------------------------ +#ifndef INTERACTIVE_INPUT_ADAPTER_SVNT_EXPORT_H +#define INTERACTIVE_INPUT_ADAPTER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL 1 +#endif /* ! INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL */ + +#if defined (INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL) && (INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL == 1) +# if defined (INTERACTIVE_INPUT_ADAPTER_SVNT_BUILD_DLL) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_Export ACE_Proper_Export_Flag +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* INTERACTIVE_INPUT_ADAPTER_SVNT_BUILD_DLL */ +# define INTERACTIVE_INPUT_ADAPTER_SVNT_Export ACE_Proper_Import_Flag +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* INTERACTIVE_INPUT_ADAPTER_SVNT_BUILD_DLL */ +#else /* INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL == 1 */ +# define INTERACTIVE_INPUT_ADAPTER_SVNT_Export +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARATION(T) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* INTERACTIVE_INPUT_ADAPTER_SVNT_HAS_DLL == 1 */ + +// Set INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE */ + +#if (INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE == 1) +# define INTERACTIVE_INPUT_ADAPTER_SVNT_TRACE(X) +#else /* (INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define INTERACTIVE_INPUT_ADAPTER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (INTERACTIVE_INPUT_ADAPTER_SVNT_NTRACE == 1) */ + +#endif /* INTERACTIVE_INPUT_ADAPTER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Injector.cpp b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Injector.cpp new file mode 100644 index 00000000000..7b22e519922 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Injector.cpp @@ -0,0 +1,185 @@ +/** + * @file Injector.cpp + * @author Will Otte <wotte@dre.vanderbilt.edu> + * + * $Id$ + */ + +#include "Input_Adapters/LocationUpdater/LocationUpdaterC.h" +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "ace/SString.h" +#include "orbsvcs/CosNamingC.h" +#include "ace/Auto_Ptr.h" + +#include <iostream> +using namespace std; + +namespace CIAO +{ + namespace RACE + { + namespace Injector + { + const char *package_uri = 0; + const char *plan_uri = 0; + const char *iia_ior_file = 0; + const char *iia_name = "RACE::InteractiveInput"; + + bool teardown = false; + + static void + usage (const ACE_TCHAR* program) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Usage %s\n") + ACE_TEXT ("-d <Flatten deployment plan URI>\n") + ACE_TEXT ("-p <Toplevel Package URI>\n") + ACE_TEXT ("-t <Teardown plan>\n") + ACE_TEXT ("-k <Interactive_Input_Adaptor IOR, " + "use naming service if not present\n"), + program)); + } + + static bool + parse_args (int argc, + ACE_TCHAR *argv[]) + { + ACE_Get_Opt get_opt (argc, + argv, + ACE_TEXT ("d:p:k:thn:")); + int c; + + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 'd': + plan_uri = get_opt.opt_arg (); + break; + + case 'p': + package_uri = get_opt.opt_arg (); + break; + + case 'k': + iia_ior_file = get_opt.opt_arg (); + break; + + case 't': + teardown = true; + break; + + case 'n': + iia_name = get_opt.opt_arg (); + + case 'h': + default: + usage (argv[0]); + return false; + } + } + + return true; + } + + CORBA::Object_ptr + fetch_reference_naming (CORBA::ORB_ptr orb, + const ACE_CString &name) + { + ACE_ERROR ((LM_ERROR, "Resolving via nameservice...\n")); + using namespace CosNaming; + // Resolve naming service + CORBA::Object_var tmp = + orb->resolve_initial_references ("NameService"); + + NamingContext_var pns = + NamingContext::_narrow (tmp.in ()); + + Name ns_name; + CORBA::ULong i = 0; + + ACE_Tokenizer tok ( name.rep ()); + tok.delimiter_replace (':', 0); + tok.delimiter_replace ('/', 0); + + char *name_element = 0; + while ((name_element = tok.next ()) != 0) + { + ns_name.length (ns_name.length () + 1); + ns_name[i].id = CORBA::string_dup (name_element); + ++i; + } + + + return pns->resolve (ns_name); + } + + static int + run_main_implementation (int argc, ACE_TCHAR *argv[]) + { + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, ""); + + if (!parse_args (argc, argv)) + return -1; + + + // Resolve our input adapter... + CORBA::Object_var tmp; + + cout << "resolving: " << iia_ior_file << endl; + + if (iia_ior_file != 0) + tmp = orb->string_to_object (iia_ior_file); + else // must be a name.... + tmp = fetch_reference_naming (orb.in (), iia_name); + + CIAO::RACE::LocationUpdater_var iia + = CIAO::RACE::LocationUpdater::_narrow (tmp.in ()); + + // Create deploy input event. + CIAO::RACE::Deploy_Input_var input = + new OBV_CIAO::RACE::Deploy_Input; + + input->plan_uri (plan_uri); + input->package_uri (package_uri); + + if (teardown) + { + input->command (::CIAO::RACE::TEARDOWN); + } + else + { + input->command (::CIAO::RACE::DEPLOY); + } + + + + // Get the consumer for the IIA + ::CIAO::RACE::Deploy_InputConsumer_var consumer = + iia->get_consumer_deployment (); + + // push the event + consumer->push_Deploy_Input (input.in ()); + + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) Injector: Unknown exception\n")); + return -1; + } + + return 0; + } + } + } +} + +int main (int argc, ACE_TCHAR **argv) +{ + return CIAO::RACE::Injector::run_main_implementation (argc, argv); +} diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cdp b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cdp new file mode 100644 index 00000000000..4e72dd5a6c9 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cdp @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<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"> + + <UUID>1D2C2C63-CE33-4088-9443-781D080D8857</UUID> + + <implementation id="_73898E70-9FB1-4881-9313-A2DE181EE48E"> + <name>RT1H_Combined.RA_ComponentImplementations.LocationUpdaterImplementation.LocationUpdaterMonolithicImpl</name> + <source/> + <artifact>__AD4B52E0-103C-49E2-BE47-29CAE978676F</artifact> + <artifact>__E4AF24BF-5A39-46B1-8217-6343D7D53298</artifact> + <artifact>__76A0CEFE-E2F7-4BF7-BB91-F309FB5AD33C</artifact> + </implementation> + + <instance id="_2BD4D476-2F5B-41CA-A8CF-311084273028"> + <name>RT1H_Combined.ComponentImplementations.RACE.RACE.LocationUpdater</name> + <node>blade36</node> + <source/> + <implementation>_73898E70-9FB1-4881-9313-A2DE181EE48E</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>LocationUpdater.ior</string> + </value> + </value> + </configProperty> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>InteractiveAdapter.ior</string> + </value> + </value> + </configProperty> + <configProperty> + <name>RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>RACE::InteractiveInput</string> + </value> + </value> + </configProperty> + </instance> + + <artifact id="__AD4B52E0-103C-49E2-BE47-29CAE978676F"> + <name>RT1H_Combined.RA_ImplementationArtifacts.LocationUpdaterArtifacts.LocationUpdater_stub</name> + <source/> + <node/> + <location>LocationUpdater_stub</location> + </artifact> + + <artifact id="__E4AF24BF-5A39-46B1-8217-6343D7D53298"> + <name>RT1H_Combined.RA_ImplementationArtifacts.LocationUpdaterArtifacts.LocationUpdater_svnt</name> + <source/> + <node/> + <location>LocationUpdater_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CIAO_RACE_LocationUpdater_Home_Servant</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="__76A0CEFE-E2F7-4BF7-BB91-F309FB5AD33C"> + <name>RT1H_Combined.RA_ImplementationArtifacts.LocationUpdaterArtifacts.LocationUpdater_exec</name> + <source/> + <node/> + <location>LocationUpdater_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CIAO_RACE_LocationUpdater_Home_Impl</string> + </value> + </value> + </execParameter> + </artifact> + +</Deployment:deploymentPlan> diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cidl b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cidl new file mode 100644 index 00000000000..fce16e1ac29 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.cidl @@ -0,0 +1,27 @@ +//LOCATION_UPDATING_INPUT_ADAPTER.cidl,v 1.1 spaunov Exp +//LocationUpdater.cidl +//Author: Stoyan Paunov +//$Id$ + +#ifndef RACE_LOCATION_UPDATING_INPUT_ADAPTER_CIDL +#define RACE_LOCATION_UPDATING_INPUT_ADAPTER_CIDL + +#include "LocationUpdater.idl" + +module CIAO +{ + module RACE + { + composition session LocationUpdater_Impl + { + home executor LocationUpdater_Home_Exec + { + implements RACE::LocationUpdater_Home; + manages LocationUpdater_Exec; + }; + }; + }; +}; + + +#endif /* RACE_LOCATION_UPDATING_INPUT_ADAPTER_CIDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.idl b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.idl new file mode 100644 index 00000000000..3cc0f26d215 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater.idl @@ -0,0 +1,34 @@ +//LocationUpdater.idl,v 1.1 spaunov Exp +//Author: Stoyan Paunov +//$Id$ + +#ifndef RACE_LOCATION_UPDATING_INPUT_ADAPTER_IDL +#define RACE_LOCATION_UPDATING_INPUT_ADAPTER_IDL + +#include <Components.idl> +#include "Input_Adapters/Base/Input_Adapter.idl" +#include "common/RACE_common.idl" + +module CIAO +{ + module RACE + { + eventtype Deploy_Input + { + public string plan_uri; + public string package_uri; + public Action command; + }; + + component LocationUpdater : Input_Adapter + { + consumes Deploy_Input deployment; + }; + + home LocationUpdater_Home manages LocationUpdater + { + }; + }; +}; + +#endif /* RACE_LOCATION_UPDATING_INPUT_ADAPTER_IDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_deployment.dat b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_deployment.dat new file mode 100644 index 00000000000..a5a465169b8 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_deployment.dat @@ -0,0 +1 @@ +LocationUpdater corbaloc:iiop:localhost:50000/NodeManager diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.cpp b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.cpp new file mode 100644 index 00000000000..4318902bc32 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.cpp @@ -0,0 +1,312 @@ +// $Id$ +//Author: Stoyan Paunov + + +#include "LocationUpdater_exec.h" +#include "ciao/CIAO_common.h" +#include "Config_Handlers/XML_File_Intf.h" +#include "Config_Handlers/Package_Handlers/PCD_Handler.h" +#include "Config_Handlers/Common.h" + +#include "DAnCE/RepositoryManager/RepositoryManagerDaemonC.h" +#include "PlanUpdater.h" + +#include <iostream> +using namespace std; + + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_LocationUpdater_Impl + { + //================================================================== + // Component Executor Implementation Class: + // LocationUpdater_exec_i + //================================================================== + + LocationUpdater_exec_i::LocationUpdater_exec_i (void) + { + } + + LocationUpdater_exec_i::~LocationUpdater_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + void + LocationUpdater_exec_i::push_deployment ( + ::CIAO::RACE::Deploy_Input * ev) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + bool plan_exists = false; + + try + { + ACE_Auto_Ptr < ::Deployment::DeploymentPlan > dp; + ACE_Auto_Ptr < ::Deployment::PackageConfiguration > pcd; + + if (ev->plan_uri () != 0) + { + ACE_DEBUG ((LM_DEBUG, "Opening the plan\n")); + + Config_Handlers::XML_File_Intf xfi (ev->plan_uri ()); + + dp.reset ( xfi.get_plan ()); + + plan_exists = true; + } + else + { + dp.reset ( new ::Deployment::DeploymentPlan ); + } + + + pcd.reset (new ::Deployment::PackageConfiguration); + + if ((ACE_OS::strcmp (ev->package_uri (), "") != 0)) + { + ACE_DEBUG ((LM_DEBUG, "Opening the package descriptor: :%s:\n", + ev->package_uri ())); + + Config_Handlers::Packaging::PCD_Handler::package_config + (ev->package_uri (), *pcd); + } + + //Get the IOR of the RepoMan from the naming service + + //Obtain a ref to the orb + CORBA::ORB_ptr orb = this->context_->_ciao_the_Container ()->the_ORB (); + + //form the path to the RepoMan IOR file + ACE_CString RepoMan_ior = ("file://"); + RepoMan_ior += ACE_OS::getenv ("CIAO_ROOT"); + RepoMan_ior += "/DAnCE/RepositoryManager/RepositoryManagerDeamon.ior"; + + cout << "RepoMan ior file: " << RepoMan_ior.c_str () << endl; + + CORBA::Object_var obj = + orb->string_to_object (RepoMan_ior.c_str ());//RM_ior); + + CIAO::RepositoryManagerDaemon_var rm = + CIAO::RepositoryManagerDaemon::_narrow (obj.in ()); + + if (CORBA::is_nil (rm.in ())) + { + ACE_ERROR ((LM_ERROR, + "Unable to acquire RepositoryManagerDaemon's objref\n")); + + throw CORBA::INTERNAL (); + } + + //now obtian the corresponding PackageConfiguration from + //the RepositoryManager + + Deployment::PackageConfiguration_var rmpc; + + try + { + //retrieve the curresponding PackageConfiguration + //from the RepoMan + rmpc = rm->findPackageByUUID (pcd->UUID); + + ACE_DEBUG ((LM_INFO, + "The package was found!\nUUID: %s\n", + rmpc->UUID)); + } + catch (Deployment::NoSuchName &) + { + ACE_ERROR ((LM_ERROR, + "Error! Package not found! Location update failed!\n")); + + throw CORBA::INTERNAL (); + + } + catch (CORBA::Exception &) + { + ACE_ERROR ((LM_ERROR, + "Error! General exception! Location update failed!\n")); + + throw CORBA::INTERNAL (); + } + + //now update the plan + if (plan_exists) + { + cout << "Updating plan ..." << endl; + + PlanUpdater updater (*dp, *rmpc); + if (!updater.Visit ()) + ACE_ERROR ((LM_ERROR, + "Partial location update error possible!\n")); + + cout << "Updating plan ... DONE!" << endl; + + size_t add_len = dp->artifact.length (); + + cout << "Updated location: \n"; + for (size_t i = 0; i < add_len; ++i) + { + Deployment::ArtifactDeploymentDescription& add = dp->artifact[i]; + if (ACE_OS::strstr (add.location[0], "http://")) + cout << add.location[0] << endl; + } + } + //Done with the location updating + + //do not call the plan analyzer just yet + return; + + //creat an action sequence and populate it + ::CIAO::RACE::Plan_Actions plan_action_seq; + + /// Create a Plan_Action_seq structure of length 1. + plan_action_seq.length (1); + + /// Now populate the Plan_Action_seq structure. + plan_action_seq [0].command = ev->command (); + plan_action_seq [0].plan = *dp; + plan_action_seq [0].package = *pcd; + + /// Now invoke the plan_analyzer. + this->context_->get_connection_ingress () + ->analyze_plan (plan_action_seq); + } + catch (CIAO::Config_Handlers::Config_Error &ex) + { + ACE_ERROR ((LM_ERROR, "Config_Error exception caught in " + "LocationUpdater::push_deployment: %s, %s\n", + ex.error_.c_str (), + ex.name_.c_str ())); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Exception caught in push_deployment\n")); + } + } + + // Operations from Components::SessionComponent + + void + LocationUpdater_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + this->context_ = + LocationUpdater_Context::_narrow ( + ctx); + + if (this->context_ == 0) + { + throw CORBA::INTERNAL (); + } + } + + void + LocationUpdater_exec_i::ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + LocationUpdater_exec_i::ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + LocationUpdater_exec_i::ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + LocationUpdater_exec_i::ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + LocationUpdater_exec_i::ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: LocationUpdater_Home_exec_i + //================================================================== + + LocationUpdater_Home_exec_i::LocationUpdater_Home_exec_i (void) + { + } + + LocationUpdater_Home_exec_i::~LocationUpdater_Home_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + LocationUpdater_Home_exec_i::create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + LocationUpdater_exec_i, + CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" LOCATIONUPDATER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_LocationUpdater_Home_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + LocationUpdater_Home_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } + } + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.h new file mode 100644 index 00000000000..e3eb2f92fb2 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec.h @@ -0,0 +1,121 @@ +// $Id$ +//Author: Stoyan Paunov + + +#ifndef CIAO_LOCATIONUPDATER_EXEC_H +#define CIAO_LOCATIONUPDATER_EXEC_H + +#include /**/ "ace/pre.h" + +#include "LocationUpdater_svnt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "LocationUpdater_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_LocationUpdater_Impl + { + class LOCATIONUPDATER_EXEC_Export LocationUpdater_exec_i + : public virtual LocationUpdater_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + LocationUpdater_exec_i (void); + virtual ~LocationUpdater_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual void + push_deployment ( + ::CIAO::RACE::Deploy_Input *ev) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + protected: + LocationUpdater_Context *context_; + }; + + class LOCATIONUPDATER_EXEC_Export LocationUpdater_Home_exec_i + : public virtual LocationUpdater_Home_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + LocationUpdater_Home_exec_i (void); + virtual ~LocationUpdater_Home_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + }; + + extern "C" LOCATIONUPDATER_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_LocationUpdater_Home_Impl (void); + } + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_LOCATIONUPDATER_EXEC_H */ + diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec_export.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec_export.h new file mode 100644 index 00000000000..d24b1fc3538 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl LOCATIONUPDATER_EXEC +// ------------------------------ +#ifndef LOCATIONUPDATER_EXEC_EXPORT_H +#define LOCATIONUPDATER_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (LOCATIONUPDATER_EXEC_HAS_DLL) +# define LOCATIONUPDATER_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && LOCATIONUPDATER_EXEC_HAS_DLL */ + +#if !defined (LOCATIONUPDATER_EXEC_HAS_DLL) +# define LOCATIONUPDATER_EXEC_HAS_DLL 1 +#endif /* ! LOCATIONUPDATER_EXEC_HAS_DLL */ + +#if defined (LOCATIONUPDATER_EXEC_HAS_DLL) && (LOCATIONUPDATER_EXEC_HAS_DLL == 1) +# if defined (LOCATIONUPDATER_EXEC_BUILD_DLL) +# define LOCATIONUPDATER_EXEC_Export ACE_Proper_Export_Flag +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* LOCATIONUPDATER_EXEC_BUILD_DLL */ +# define LOCATIONUPDATER_EXEC_Export ACE_Proper_Import_Flag +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* LOCATIONUPDATER_EXEC_BUILD_DLL */ +#else /* LOCATIONUPDATER_EXEC_HAS_DLL == 1 */ +# define LOCATIONUPDATER_EXEC_Export +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARATION(T) +# define LOCATIONUPDATER_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* LOCATIONUPDATER_EXEC_HAS_DLL == 1 */ + +// Set LOCATIONUPDATER_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (LOCATIONUPDATER_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define LOCATIONUPDATER_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define LOCATIONUPDATER_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !LOCATIONUPDATER_EXEC_NTRACE */ + +#if (LOCATIONUPDATER_EXEC_NTRACE == 1) +# define LOCATIONUPDATER_EXEC_TRACE(X) +#else /* (LOCATIONUPDATER_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define LOCATIONUPDATER_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (LOCATIONUPDATER_EXEC_NTRACE == 1) */ + +#endif /* LOCATIONUPDATER_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_stub_export.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_stub_export.h new file mode 100644 index 00000000000..a7318989a5f --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl LOCATIONUPDATER_STUB +// ------------------------------ +#ifndef LOCATIONUPDATER_STUB_EXPORT_H +#define LOCATIONUPDATER_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (LOCATIONUPDATER_STUB_HAS_DLL) +# define LOCATIONUPDATER_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && LOCATIONUPDATER_STUB_HAS_DLL */ + +#if !defined (LOCATIONUPDATER_STUB_HAS_DLL) +# define LOCATIONUPDATER_STUB_HAS_DLL 1 +#endif /* ! LOCATIONUPDATER_STUB_HAS_DLL */ + +#if defined (LOCATIONUPDATER_STUB_HAS_DLL) && (LOCATIONUPDATER_STUB_HAS_DLL == 1) +# if defined (LOCATIONUPDATER_STUB_BUILD_DLL) +# define LOCATIONUPDATER_STUB_Export ACE_Proper_Export_Flag +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* LOCATIONUPDATER_STUB_BUILD_DLL */ +# define LOCATIONUPDATER_STUB_Export ACE_Proper_Import_Flag +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* LOCATIONUPDATER_STUB_BUILD_DLL */ +#else /* LOCATIONUPDATER_STUB_HAS_DLL == 1 */ +# define LOCATIONUPDATER_STUB_Export +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARATION(T) +# define LOCATIONUPDATER_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* LOCATIONUPDATER_STUB_HAS_DLL == 1 */ + +// Set LOCATIONUPDATER_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (LOCATIONUPDATER_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define LOCATIONUPDATER_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define LOCATIONUPDATER_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !LOCATIONUPDATER_STUB_NTRACE */ + +#if (LOCATIONUPDATER_STUB_NTRACE == 1) +# define LOCATIONUPDATER_STUB_TRACE(X) +#else /* (LOCATIONUPDATER_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define LOCATIONUPDATER_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (LOCATIONUPDATER_STUB_NTRACE == 1) */ + +#endif /* LOCATIONUPDATER_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_svnt_export.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_svnt_export.h new file mode 100644 index 00000000000..2bd7f8a87ca --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/LocationUpdater_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl LOCATIONUPDATER_SVNT +// ------------------------------ +#ifndef LOCATIONUPDATER_SVNT_EXPORT_H +#define LOCATIONUPDATER_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (LOCATIONUPDATER_SVNT_HAS_DLL) +# define LOCATIONUPDATER_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && LOCATIONUPDATER_SVNT_HAS_DLL */ + +#if !defined (LOCATIONUPDATER_SVNT_HAS_DLL) +# define LOCATIONUPDATER_SVNT_HAS_DLL 1 +#endif /* ! LOCATIONUPDATER_SVNT_HAS_DLL */ + +#if defined (LOCATIONUPDATER_SVNT_HAS_DLL) && (LOCATIONUPDATER_SVNT_HAS_DLL == 1) +# if defined (LOCATIONUPDATER_SVNT_BUILD_DLL) +# define LOCATIONUPDATER_SVNT_Export ACE_Proper_Export_Flag +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* LOCATIONUPDATER_SVNT_BUILD_DLL */ +# define LOCATIONUPDATER_SVNT_Export ACE_Proper_Import_Flag +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* LOCATIONUPDATER_SVNT_BUILD_DLL */ +#else /* LOCATIONUPDATER_SVNT_HAS_DLL == 1 */ +# define LOCATIONUPDATER_SVNT_Export +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARATION(T) +# define LOCATIONUPDATER_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* LOCATIONUPDATER_SVNT_HAS_DLL == 1 */ + +// Set LOCATIONUPDATER_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (LOCATIONUPDATER_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define LOCATIONUPDATER_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define LOCATIONUPDATER_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !LOCATIONUPDATER_SVNT_NTRACE */ + +#if (LOCATIONUPDATER_SVNT_NTRACE == 1) +# define LOCATIONUPDATER_SVNT_TRACE(X) +#else /* (LOCATIONUPDATER_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define LOCATIONUPDATER_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (LOCATIONUPDATER_SVNT_NTRACE == 1) */ + +#endif /* LOCATIONUPDATER_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Location_Updater.mpc.disable b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Location_Updater.mpc.disable new file mode 100644 index 00000000000..7a404ce4129 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/Location_Updater.mpc.disable @@ -0,0 +1,119 @@ +// generate_component_mpc.pl +//LocationUpdater.mpc, spaunov Exp +//Author: Stoyan Paunov +// $Id$ + + +project(LocationUpdater_stub): ciao_deployment_stub, ciao_race_component { + after += Input_Adapter_stub + sharedname = LocationUpdater_stub + idlflags += -Sc \ + -Wb,stub_export_macro=LOCATIONUPDATER_STUB_Export \ + -Wb,stub_export_include=LocationUpdater_stub_export.h \ + -Wb,skel_export_macro=LOCATIONUPDATER_SVNT_Export \ + -Wb,skel_export_include=LocationUpdater_svnt_export.h + dynamicflags = LOCATIONUPDATER_STUB_BUILD_DLL + libs += Input_Adapter_stub \ + Plan_Analyzer_Interface_stub + + IDL_Files { + LocationUpdater.idl + } + + Source_Files { + LocationUpdaterC.cpp + } + + Header_Files { + LocationUpdaterC.h + } + + Inline_Files { + LocationUpdaterC.inl + } +} + +project(LocationUpdater_svnt) : ciao_servant_dnc, ciao_race_component { + after += LocationUpdater_stub \ + Input_Adapter_svnt + sharedname = LocationUpdater_svnt + libs += LocationUpdater_stub \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub + + idlflags += -Sc \ + -Wb,export_macro=LOCATIONUPDATER_SVNT_Export \ + -Wb,export_include=LocationUpdater_svnt_export.h + + dynamicflags = LOCATIONUPDATER_SVNT_BUILD_DLL + + CIDL_Files { + LocationUpdater.cidl + } + + IDL_Files { + LocationUpdaterE.idl + } + + Source_Files { + LocationUpdaterEC.cpp + LocationUpdaterS.cpp + LocationUpdater_svnt.cpp + } + + Header_Files { + LocationUpdaterEC.h + LocationUpdaterS.h + LocationUpdater_svnt.h + } + + Inline_Files { + LocationUpdaterEC.inl + LocationUpdaterS.inl + LocationUpdater_svnt.inl + } +} + + +project(LocationUpdater_exec) : ciao_component_dnc, ciao_config_handlers, ciao_race_component { + after += LocationUpdater_svnt XSC_Config_Handlers + sharedname = LocationUpdater_exec + libs += LocationUpdater_stub \ + LocationUpdater_svnt \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub \ + + idlflags += -Sc \ + -Wb,export_macro=LOCATIONUPDATER_EXEC_Export \ + -Wb,export_include=LocationUpdater_exec_export.h + dynamicflags = LOCATIONUPDATER_EXEC_BUILD_DLL + + requires += RepositoryManager + after += RepositoryManager + includes += $(CIAO_ROOT)/DAnCE/RepositoryManager + + IDL_Files { + + } + + Source_Files { + LocationUpdater_exec.cpp + PCVisitorBase.cpp + PlanUpdater.cpp + $(CIAO_ROOT)/DAnCE/RepositoryManager/RepositoryManagerDaemonC.cpp + } +} + +project(LocationUpdater_Injector) : ciao_component_dnc, ciao_race_component, taoexe { + exename = injector + + libs += LocationUpdater_stub + + IDL_Files { + } + Source_Files { + Injector.cpp + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.cpp b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.cpp new file mode 100644 index 00000000000..040ecb9eb45 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.cpp @@ -0,0 +1,24 @@ +/* -*- 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) + { + } + +#if !defined (__ACE_INLINE__) +#include "PCVisitorBase.inl" +#endif /* __ACE_INLINE__ */ diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.h new file mode 100644 index 00000000000..cd3cb2b8752 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.h @@ -0,0 +1,214 @@ +/* -*- 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 + + +//forward declaration +class PCVisitorBase; + +//======================================================================== +/** + * class PCAdapter + * + * This class is used as an Adapter around the CIAO::Depolyment elements + * which are part of the PackageConfiguration traversal hierarchy in + * order to adapt each element to exhibit 'Visitor Node'-like structure. + * This allows us to use the Visitor double-dispatch traversal paradigm. + */ +//======================================================================== + +template <typename E> +class PCAdapter +{ +public: + PCAdapter (E& element) : element_ (element) {} + void Accept (PCVisitorBase &v) {v.Visit (*this);} + E& get () {return this-element_;} + +private: + E &element_; +}; + + +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. + */ +//======================================================================== + + +/// I am using this to dispatch sequences +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]); + } +} + +//======================================================================== +/** + * 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); + + ///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); + +}; + +#if defined (__ACE_INLINE__) +#include "PCVisitorBase.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* PC_VISITOR_BASE_H */ diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.inl b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.inl new file mode 100644 index 00000000000..f6787601353 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PCVisitorBase.inl @@ -0,0 +1,162 @@ +/* -*- 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/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.cpp b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.cpp new file mode 100644 index 00000000000..939d015c817 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.cpp @@ -0,0 +1,269 @@ +/* -*- C++ -*- */ + +//======================================================================== +/* + * file PlanUpdater.cpp + * + * $Id$ + * + * This file contains the implementation of the PackageConfiguration + * Visitor class PlanUpdater which derives from PCVisitorBase and attempts + * to update the location fields in the received DeploymentPlan to reflect + * the locations of the implementation artifacts as outlined in the + * PackageConfiguration which are downloadable via HTTP. 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! + * + * author Stoyan Paunov <spaunov@isis.vanderbilt.edu + */ +//======================================================================== + +#include "PCVisitorBase.h" +#include "PlanUpdater.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 + PlanUpdater::PlanUpdater (Deployment::DeploymentPlan &plan, + Deployment::PackageConfiguration &pc) + : PCVisitorBase (), + plan_ (plan), + pc_ (pc), + status_ (true) + { + } + + //entry point for the protected visitor to get it do start + //the visitation process + bool PlanUpdater::Visit () + { + Accept (*this, this->pc_); + + return this->status_; + + } + + // A whole slew of overloaded routines for different IDL + // data types part of the PackageConfiguration. + + + void PlanUpdater::Visit (Deployment::PackageConfiguration &pc) + { + //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, + "[PlanUpdater - PackageConfiguration] We currently " + "do NOT support package references, specializedConfigs", + "or imports!\n")); + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //ComponentPackageDescription descendents + + void PlanUpdater::Visit (Deployment::ComponentPackageDescription &cpd) + { + //do not need to visit the interface + //Accept (*this, cpd.realizes); + + //visit the implementations + Accept (*this, cpd.implementation); + } + + + void PlanUpdater::Visit (Deployment::ComponentInterfaceDescription &cid) + { + //Might want to populate this too once PICML starts supporting it + } + + + void PlanUpdater::Visit (Deployment::PackagedComponentImplementation &pci) + { + //visit the referencedImplementationArtifact + Accept (*this, pci.referencedImplementation); + } + + + void PlanUpdater::Visit (Deployment::ComponentImplementationDescription &cid) + { + if (cid.assemblyImpl.length ()) + //visit the component assembly + Accept (*this, cid.assemblyImpl); + else + //visit the monolithic component + Accept (*this, cid.monolithicImpl); + } + + + void PlanUpdater::Visit (Deployment::ComponentAssemblyDescription &cad) + { + //visit the SubcomponentInstantiationDescription + Accept (*this, cad.instance); + + //do not need to visit the connections + //Accept (*this, cad.connection); + } + + + void PlanUpdater::Visit (Deployment::SubcomponentInstantiationDescription &sid) + { + //visit the ComponentPackageDescription (again) + if (sid.basePackage.length ()) + //visit the base package in the subcomponent + Accept (*this, sid.basePackage); + else + ACE_DEBUG ((LM_WARNING, + "[PlanUpdater - SubcomponentInstantiationDescription] ", + "We currently do NOT support package references, ", + "specializedConfigs or imports!\n")); + } + + + void PlanUpdater::Visit (Deployment::MonolithicImplementationDescription &mid) + { + //NOTE: There are usually 3 NamedImplementationArtifacts per + //MonolithicImplementationDescription *_stub, *_svnt & *_exec + + //visit the NamedImplementationArtifacts + Accept (*this, mid.primaryArtifact); + } + + + void PlanUpdater::Visit (Deployment::NamedImplementationArtifact &nia) + { + //visit the actual ImplementationArtifactDescriptor + Accept (*this, nia.referencedArtifact); + } + + + //This function attempts to update the location of the artifact deployment + //descriptions to reflect the once in the RepositoryManager. + // + //Not sure what the input is here! I am assuming that the + //location came from the descriptor files, so it just holds + //the name of the library. If this code evolves, we will need to + //update the string matching mechanism with a more complicated one. + + + void PlanUpdater::Visit (Deployment::ImplementationArtifactDescription &iad) + { + //some heavy lifting here! + static size_t iters = 0; + ++iters; + ACE_CString iad_loc (iad.location[0]); + + size_t add_len = this->plan_.artifact.length (); + + for (size_t i = 0; i < add_len; ++i) + { + Deployment::ArtifactDeploymentDescription& add = this->plan_.artifact[i]; + + //NOTE: Right now we only populate location[0] + //When this evolves, check needs to evolve as well. + ACE_CString add_loc (add.location[0]); + + //check if the add location has already been updated + if (ACE_OS::strstr (add_loc.c_str (), "http://"))//, add_loc.length ())) + continue; + + //check for a match and update the location + if (ACE_OS::strstr (iad_loc.c_str (), add_loc.c_str ()))//, iad_loc.length ())) + { + //if there is a match substitute one for the other + add.location[0] = CORBA::string_dup (iad_loc.c_str ()); + + //ACE_OS::printf ("Matching %s with %s\n", + // iad_loc.c_str (), + // add_loc.c_str ()); + + } + + } + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //ComponentPackageReference descendents + + void PlanUpdater::Visit (Deployment::ComponentPackageReference &cpr) + { + //not implemented + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //properties + + void PlanUpdater::Visit (Deployment::AssemblyPropertyMapping &apm) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::Property &property) + { + //not needed + } + + + //requirements & capabilities + + void PlanUpdater::Visit (Deployment::Requirement &requirement) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::Capability &capability) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::ImplementationRequirement &ir) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::ImplementationDependency &id) + { + //not needed + } + + //ports and connections + + void PlanUpdater::Visit (Deployment::AssemblyConnectionDescription &acd) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::SubcomponentPortEndpoint &spe) + { + //not needed + } + + + void PlanUpdater::Visit (Deployment::ComponentExternalPortEndpoint &cepe) + { + //not needed + } diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.h b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.h new file mode 100644 index 00000000000..298b1b92fbb --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/PlanUpdater.h @@ -0,0 +1,158 @@ +/* -*- C++ -*- */ + +//======================================================================== +/** + * file PlanUpdater.h + * + * $Id$ + * + * This file contains a Visitor classes which are used to traverse a + * PackageConfiguration and update the location fields in a corresponding + * DeploymentPlan. + * + * author Stoyan Paunov <spaunov@isis.vanderbilt.edu> + */ +//======================================================================== + +#ifndef PLAN_UPDATER_H +#define PLAN_UPDATER_H + +#include /**/ "ace/pre.h" +#include "ace/SString.h" //for the ACE_CString + +#include "PCVisitorBase.h" //for the base visitor +//#include "Node_T.h" //Node +#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" + +//namespace { +////Definition of various Node elements parametrized by +////Deployment specific types +// typedef Node<Deployment::Node> NNode; +// typedef Node<Deployment::MonolithicImplementationDescription> MNode; +// +////Definition of various stacks used to store information +////about the elements being parsed at various levels +// typedef ACE_Bounded_Stack<int> INDEX_STACK; +// +////definition of a Node which takes an ACE_CString +// typedef Node<ACE_CString> SNode; +//} + +//=========================================================================== +/** + * class PlanUpdater + * + * This class takes in a Deployment Plan and a PackageConfiguration and + * attempts to update the location fields in the deployment plan to reflect + * the locations available via HTTP as outlined in the passed Package- + * Configuration. It derives from PCVisitorBase and overloads the functions + * which deal with single elements. Sequences are handled in the base class. + */ +//=========================================================================== + + +class PlanUpdater : public PCVisitorBase +{ +public: + + //constructor + PlanUpdater (Deployment::DeploymentPlan &plan, + Deployment::PackageConfiguration &pc); + + ///Entry point to protected Visitor functions + bool 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_; + bool status_; +}; + +#include /**/ "ace/post.h" + +#endif /* PLAN_UPDATER_H */ diff --git a/modules/CIAO/RACE/Input_Adapters/LocationUpdater/README.txt b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/README.txt new file mode 100644 index 00000000000..fc35c1a633c --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/LocationUpdater/README.txt @@ -0,0 +1,12 @@ + + +//Author: Stoyan Paunov + +This is the README for the LocationUpdater Input Adapter for RACE. This input +adapter has similar functionality to the Interactive Input Adapter, however +instead of using only the descriptors on disk, it uses the UUID from the +parsed PackageConfiguration to retrieve its counterpart from the Repository +Manager and updates the location of the implementation artifact to point to +the HTTP server. This way the files can then be retrieved by DAnCE at +deployment. + diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/Injector.cpp b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/Injector.cpp new file mode 100644 index 00000000000..a0eaa7bbb9b --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/Injector.cpp @@ -0,0 +1,180 @@ +/** + * @file Injector.cpp + * @author Will Otte <wotte@dre.vanderbilt.edu> + * @author Stoyan Paunov + * + * $Id$ + */ + +#include "Input_Adapters/PlanGenerator/PlanGeneratorC.h" +#include "ace/OS.h" +#include "ace/Get_Opt.h" +#include "ace/SString.h" +#include "orbsvcs/CosNamingC.h" +#include "ace/Auto_Ptr.h" + +#include <iostream> +using namespace std; + +namespace CIAO +{ + namespace RACE + { + namespace Injector + { + const char *package_name = 0; + const char *iia_ior_file = 0; + const char *iia_name = "RACE::InteractiveInput"; + + bool teardown = false; + + static void + usage (const ACE_TCHAR* program) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Usage %s\n") + ACE_TEXT ("-p <Name of package to fetch from the RepoMan>\n") + ACE_TEXT ("-t <Teardown plan>\n") + ACE_TEXT ("-k <Interactive_Input_Adaptor IOR, " + "use naming service if not present\n"), + program)); + } + + static bool + parse_args (int argc, + ACE_TCHAR *argv[]) + { + ACE_Get_Opt get_opt (argc, + argv, + ACE_TEXT ("p:k:thn:")); + int c; + + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 'p': + package_name = get_opt.opt_arg (); + break; + + case 'k': + iia_ior_file = get_opt.opt_arg (); + break; + + case 't': + teardown = true; + break; + + case 'n': + iia_name = get_opt.opt_arg (); + + case 'h': + default: + usage (argv[0]); + return false; + } + } + + return true; + } + + CORBA::Object_ptr + fetch_reference_naming (CORBA::ORB_ptr orb, + const ACE_CString &name) + { + ACE_ERROR ((LM_ERROR, "Resolving via nameservice...\n")); + using namespace CosNaming; + + // Resolve naming service + CORBA::Object_var tmp = + orb->resolve_initial_references ("NameService"); + + NamingContext_var pns = + NamingContext::_narrow (tmp.in ()); + + Name ns_name; + CORBA::ULong i = 0; + + ACE_Tokenizer tok ( name.rep ()); + tok.delimiter_replace (':', 0); + tok.delimiter_replace ('/', 0); + + char *name_element = 0; + while ((name_element = tok.next ()) != 0) + { + ns_name.length (ns_name.length () + 1); + ns_name[i].id = CORBA::string_dup (name_element); + ++i; + } + + + return pns->resolve (ns_name); + } + + static int + run_main_implementation (int argc, ACE_TCHAR *argv[]) + { + try + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, ""); + + if (!parse_args (argc, argv)) + return -1; + + + // Resolve our input adapter... + CORBA::Object_var tmp; + + cout << "resolving: " << iia_ior_file << endl; + + if (iia_ior_file != 0) + tmp = orb->string_to_object (iia_ior_file); + else // must be a name.... + tmp = fetch_reference_naming (orb.in (), iia_name); + + CIAO::RACE::PlanGenerator_var iia + = CIAO::RACE::PlanGenerator::_narrow (tmp.in ()); + + // Create deploy input event. + CIAO::RACE::Deploy_Input_var input = + new OBV_CIAO::RACE::Deploy_Input; + + input->package_name (package_name); + + if (teardown) + { + input->command (::CIAO::RACE::TEARDOWN); + } + else + { + input->command (::CIAO::RACE::DEPLOY); + } + + // Get the consumer for the IIA + ::CIAO::RACE::Deploy_InputConsumer_var consumer = + iia->get_consumer_deployment (); + + // push the event + consumer->push_Deploy_Input (input.in ()); + + } + catch (...) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) Injector: Unknown exception\n")); + return -1; + } + + return 0; + } + + } //namespace Injector + } //namespace RACE +} //Namespace CIAO + +int main (int argc, ACE_TCHAR **argv) +{ + return CIAO::RACE::Injector::run_main_implementation (argc, argv); +} + diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.cpp b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.cpp new file mode 100644 index 00000000000..040ecb9eb45 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.cpp @@ -0,0 +1,24 @@ +/* -*- 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) + { + } + +#if !defined (__ACE_INLINE__) +#include "PCVisitorBase.inl" +#endif /* __ACE_INLINE__ */ diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.h new file mode 100644 index 00000000000..cd3cb2b8752 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.h @@ -0,0 +1,214 @@ +/* -*- 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 + + +//forward declaration +class PCVisitorBase; + +//======================================================================== +/** + * class PCAdapter + * + * This class is used as an Adapter around the CIAO::Depolyment elements + * which are part of the PackageConfiguration traversal hierarchy in + * order to adapt each element to exhibit 'Visitor Node'-like structure. + * This allows us to use the Visitor double-dispatch traversal paradigm. + */ +//======================================================================== + +template <typename E> +class PCAdapter +{ +public: + PCAdapter (E& element) : element_ (element) {} + void Accept (PCVisitorBase &v) {v.Visit (*this);} + E& get () {return this-element_;} + +private: + E &element_; +}; + + +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. + */ +//======================================================================== + + +/// I am using this to dispatch sequences +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]); + } +} + +//======================================================================== +/** + * 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); + + ///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); + +}; + +#if defined (__ACE_INLINE__) +#include "PCVisitorBase.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* PC_VISITOR_BASE_H */ diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.inl b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.inl new file mode 100644 index 00000000000..f6787601353 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PCVisitorBase.inl @@ -0,0 +1,162 @@ +/* -*- 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/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cdp b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cdp new file mode 100644 index 00000000000..56ab62c4cb6 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cdp @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<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"> + + <UUID>1D2C2C63-CE33-4088-9443-781F080D8888</UUID> + + <implementation id="_73898E70-9FF1-4881-9313-A2DE181EEEEE"> + <name>RT1H_Combined.RA_ComponentImplementations.PlanGeneratorImplementation.PlanGeneratorMonolithicImpl</name> + <source/> + <artifact>__AD4B52E0-111C-49E2-BE47-29CFF978676F</artifact> + <artifact>__E4AF24BF-5A39-BBB1-8217-6343D7D55598</artifact> + <artifact>__76A0CEFE-22F7-FFF7-BB91-F309FFFAD33C</artifact> + </implementation> + + <instance id="_2BD4D476-2F5B-4CCC-A8CF-311084273028"> + <name>RT1H_Combined.ComponentImplementations.RACE.RACE.PlanGenerator</name> + <node>PlanGenerator</node> + <source/> + <implementation>_73898E70-9FF1-4881-9313-A2DE181EEEEE</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>PlanGenerator.ior</string> + </value> + </value> + </configProperty> + <configProperty> + <name>RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>RACE::InteractiveInput</string> + </value> + </value> + </configProperty> + </instance> + + <artifact id="__AD4B52E0-111C-49E2-BE47-29CFF978676F"> + <name>RT1H_Combined.RA_ImplementationArtifacts.PlanGeneratorArtifacts.PlanGenerator_stub</name> + <source/> + <node/> + <location>PlanGenerator_stub</location> + </artifact> + + <artifact id="__E4AF24BF-5A39-BBB1-8217-6343D7D55598"> + <name>RT1H_Combined.RA_ImplementationArtifacts.PlanGeneratorArtifacts.PlanGenerator_svnt</name> + <source/> + <node/> + <location>PlanGenerator_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CIAO_RACE_PlanGenerator_Home_Servant</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact id="__76A0CEFE-22F7-FFF7-BB91-F309FFFAD33C"> + <name>RT1H_Combined.RA_ImplementationArtifacts.PlanGeneratorArtifacts.PlanGenerator_exec</name> + <source/> + <node/> + <location>PlanGenerator_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_CIAO_RACE_PlanGenerator_Home_Impl</string> + </value> + </value> + </execParameter> + </artifact> + +</Deployment:deploymentPlan> diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cidl b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cidl new file mode 100644 index 00000000000..9ceb659e753 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cidl @@ -0,0 +1,26 @@ +//PlanGenerator.cidl,v 1.1 spaunov Exp +//Author: Stoyan Paunov +//$Id$ + +#ifndef RACE_PLAN_GENERATOR_INPUT_ADAPTER_CIDL +#define RACE_PLAN_GENERATOR_INPUT_ADAPTER_CIDL + +#include "PlanGenerator.idl" + +module CIAO +{ + module RACE + { + composition session PlanGenerator_Impl + { + home executor PlanGenerator_Home_Exec + { + implements RACE::PlanGenerator_Home; + manages PlanGenerator_Exec; + }; + }; + }; +}; + + +#endif /* RACE_PLAN_GENERATOR_INPUT_ADAPTER_CIDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cpp b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cpp new file mode 100644 index 00000000000..eb761275c6e --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.cpp @@ -0,0 +1,451 @@ +/* -*- C++ -*- */ + +//======================================================================== +/* + * file Plan_Generator.cpp + * + * $Id$ + * + * This file contains the implementation of the PackageConfiguration + * Visitor class Plan_Generator 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 grow + * a DeploymentPlan out of it by expanding the latter in width and depth + * simultaneously. At each level of the PackageConfiguration the + * Plan_Generator 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 + */ +//======================================================================== + +#include "PCVisitorBase.h" +#include "PlanGenerator.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 + Plan_Generator::Plan_Generator (Deployment::DeploymentPlan &plan, + Deployment::PackageConfiguration &pc) + : PCVisitorBase (), + plan_ (plan), + pc_ (pc), + last_cad_ (0) + { + } + + //entry point for the protected visitor to get it do start + //the visitation process + void Plan_Generator::Visit () + { + Accept (*this, this->pc_); + } + + // A whole slew of overloaded routines for different IDL + // data types part of the PackageConfiguration. + + + void Plan_Generator::Visit (Deployment::PackageConfiguration &pc) + { + + //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, + "[Plan_Generator - PackageConfiguration] We currently " + "do NOT support package references, specializedConfigs", + "or imports!\n")); + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //ComponentPackageDescription descendents + + void Plan_Generator::Visit (Deployment::ComponentPackageDescription &cpd) + { + Accept (*this, cpd.realizes); + //for (size_t impl = 0; impl < cpd.implementation.length (); ++impl) + Accept (*this, cpd.implementation[0]); + } + + + void Plan_Generator::Visit (Deployment::ComponentInterfaceDescription &cid) + { + //Might want to populate this too once PICML starts supporting it + } + + + void Plan_Generator::Visit (Deployment::PackagedComponentImplementation &pci) + { + Accept (*this, pci.referencedImplementation); + + size_t plan_impl_len = plan_.implementation.length (); + size_t plan_inst_len = plan_.instance.length (); + + //NOTE: order here matters. Need to populate the + //MonolithicDeploymentDescription and the + //InstanceDeploymentDescription first, + //then call the update_configProperty + if (plan_impl_len > 0 && plan_inst_len > 0) + update_configProperty (pci, + plan_.implementation[plan_impl_len - 1], + plan_.instance[plan_inst_len - 1]); + } + + + void Plan_Generator::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 Plan_Generator::Visit (Deployment::ComponentAssemblyDescription &cad) + { + //NOTE: order matters for these calls. We need to populate + //the instances before we try to polulate the connections + + //set the last ComponentAssemblyDescription + this->last_cad_ = &cad; + + //visit the SubcomponentInstantiationDescription + Accept (*this, cad.instance); + //visit the connections + Accept (*this, cad.connection); + + //reset the last ComponentAssemblyDescription + this->last_cad_ = NULL; + } + + + void Plan_Generator::Visit (Deployment::SubcomponentInstantiationDescription &sid) + { + //visit the ComponentPackageDescription (again) + if (sid.basePackage.length ()) + { + size_t inst_len = plan_.instance.length (); + plan_.instance.length (inst_len + 1); + + update_configProperty (sid, plan_.instance[inst_len]); + + plan_.instance[inst_len].name = sid.name; + size_t impl_len = plan_.implementation.length (); + plan_.implementation.length (impl_len + 1); + + ACE_CString mdname (plan_.instance[inst_len].name); + mdname += "-mdd"; + plan_.implementation[impl_len].name = mdname.c_str (); + + plan_.instance[inst_len].implementationRef = impl_len; + + Accept (*this, sid.basePackage); + } + else + ACE_DEBUG ((LM_WARNING, + "[Plan_Generator - SubcomponentInstantiationDescription] ", + "We currently do NOT support package references, ", + "specializedConfigs or imports!\n")); + } + + + void Plan_Generator::Visit (Deployment::MonolithicImplementationDescription &mid) + { + //NOTE: There are usually 3 NamedImplementationArtifacts per + //MonolithicImplementationDescription *_stub, *_svnt & *_exec + + //visit the NamedImplementationArtifacts + Accept (*this, mid.primaryArtifact); + } + + + void Plan_Generator::Visit (Deployment::NamedImplementationArtifact &nia) + { + //increase the artifact length by one + size_t arti_len = plan_.artifact.length (); + plan_.artifact.length (arti_len + 1); + plan_.artifact[arti_len].name = nia.name; + + //increase the artifactRef length by one and + //update the reference + + //get the index of the last MonolithicDeploymentDescription + size_t last_mdd = plan_.implementation.length () - 1; + Deployment::MonolithicDeploymentDescription& mdd = plan_.implementation[last_mdd]; + size_t ref_len = mdd.artifactRef.length (); + mdd.artifactRef.length (ref_len + 1); + mdd.artifactRef[ref_len] = arti_len; + + //visit the actual ImplementationArtifactDescriptor + Accept (*this, nia.referencedArtifact); + } + + + void Plan_Generator::Visit (Deployment::ImplementationArtifactDescription &iad) + { + + size_t last_arti = plan_.artifact.length (); + size_t plan_loc_len = plan_.artifact[last_arti - 1].location.length (); + size_t num_loc = iad.location.length (); + for (size_t i = 0; i < num_loc; ++i) + { + Deployment::ArtifactDeploymentDescription& add = plan_.artifact[last_arti - 1]; + add.location.length (plan_loc_len + 1); + add.location[plan_loc_len] = iad.location[i]; + ++plan_loc_len; + + //update execParameter + update_execParameter (iad, add); + } + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //ComponentPackageReference descendents + + void Plan_Generator::Visit (Deployment::ComponentPackageReference &cpr) + { + //not implemented + } + + //!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-! + + //properties + + void Plan_Generator::Visit (Deployment::AssemblyPropertyMapping &apm) + { + + } + + + void Plan_Generator::Visit (Deployment::Property &property) + { + + } + + + //requirements & capabilities + + void Plan_Generator::Visit (Deployment::Requirement &requirement) + { + + } + + + void Plan_Generator::Visit (Deployment::Capability &capability) + { + + } + + + void Plan_Generator::Visit (Deployment::ImplementationRequirement &ir) + { + + } + + + void Plan_Generator::Visit (Deployment::ImplementationDependency &id) + { + + } + + //ports and connections + + void Plan_Generator::Visit (Deployment::AssemblyConnectionDescription &acd) + { + if (!this->last_cad_) + return; + + Deployment::ComponentAssemblyDescription& cad = *(this->last_cad_); + + size_t plan_conn_len = plan_.connection.length (); + plan_.connection.length (plan_conn_len + 1); + plan_.connection[plan_conn_len].name = acd.name; + + size_t iep_len = acd.internalEndpoint.length (); + size_t plan_iep_len = + plan_.connection[plan_conn_len].internalEndpoint.length (); + + //cout << "==> " << acd.name << " has " << iep_len << " and " + // << acd.externalEndpoint.length () << endl << endl ; + + plan_.connection[plan_conn_len].internalEndpoint.length (plan_iep_len + iep_len); + + for (size_t i = 0; i < iep_len; ++i) + { + plan_.connection[plan_conn_len] + .internalEndpoint[plan_iep_len + i].portName = + acd.internalEndpoint[i].portName; + + size_t inst_ref = acd.internalEndpoint[i].instanceRef; + const char* inst_name = cad.instance[inst_ref].name; + size_t plan_inst_len = plan_.instance.length (); + + for (size_t j = 0; j < plan_inst_len; ++j) + { + const char* plan_inst_name = plan_.instance[j].name; + if (ACE_OS::strcmp (plan_inst_name, inst_name) == 0) + { + plan_.connection[plan_conn_len] + .internalEndpoint[plan_iep_len + i].instanceRef = j; + break; + } + } + + //Now traverse the interface + + //NOTE: move these up and refactor! + Deployment::SubcomponentInstantiationDescription& scid = + cad.instance[inst_ref]; + Deployment::PlanSubcomponentPortEndpoint& pspe = + plan_.connection[plan_conn_len] + .internalEndpoint[plan_iep_len + i]; + + size_t pkg_len = scid.basePackage.length (); + for (size_t k = 0; k < pkg_len; ++k) + { + Deployment::ComponentPackageDescription& package = scid.basePackage[k]; + + //empty unfortunately + Deployment::ComponentInterfaceDescription cid = package.realizes; + //cid = package.implementation[0].referencedImplementation.implements; + + size_t port_len = cid.port.length (); + for (size_t p = 0; p < port_len; ++p) + { + const char* cid_pname = cid.port[p].name; + const char* pspe_pname = pspe.portName; + //cout << "CMP: " << pspe_pname << " <=> " << cid_pname << endl; + if (ACE_OS::strcmp (cid_pname, pspe_pname) == 0) + { + pspe.kind = cid.port[p].kind; + + //cout << "-->" << pspe_pname << " Port kind is " + // << pspe.kind << endl; + + goto interface_end; + break; // ??? + } + } + } + +interface_end: + //cout << endl; + ; + + } + + } + + + void Plan_Generator::Visit (Deployment::SubcomponentPortEndpoint &spe) + { + + } + + + void Plan_Generator::Visit (Deployment::ComponentExternalPortEndpoint &cepe) + { + + } + +//several helper functions + + void Plan_Generator:: + update_execParameter (Deployment::ImplementationArtifactDescription& iad, + Deployment::ArtifactDeploymentDescription& add) + { + //update execParameters + size_t num_execP = iad.execParameter.length (); + for (size_t j = 0; j < num_execP; ++j) + { + size_t execP_len = add.execParameter.length (); + add.execParameter.length (execP_len + 1); + add.execParameter[execP_len] = iad.execParameter[j]; + ++execP_len; + } + } + + void Plan_Generator:: + update_configProperty (Deployment::SubcomponentInstantiationDescription &scid, + Deployment::InstanceDeploymentDescription &idd) + { + size_t scid_plen = + scid.configProperty.length (); + + size_t idd_plen = idd.configProperty.length (); + idd.configProperty.length (idd_plen + scid_plen); + + for (size_t i = 0; i < scid_plen; ++i) + idd.configProperty[idd_plen + i] = + scid.configProperty[i]; + + } + + void Plan_Generator:: + update_configProperty (Deployment::PackagedComponentImplementation& pcid, + Deployment::MonolithicDeploymentDescription& mid, + Deployment::InstanceDeploymentDescription& idd) + { + bool update; + size_t pcid_plen = pcid.referencedImplementation + .configProperty.length (); + + size_t mid_eplen = mid.execParameter.length (); + mid.execParameter.length (mid_eplen + pcid_plen); + + for (size_t i = 0; i < pcid_plen; ++i) + { + update = true; + mid.execParameter[mid_eplen + i] = pcid.referencedImplementation + .configProperty[i]; + + const char* pname = pcid.referencedImplementation + .configProperty[i].name; + + size_t idd_plen = idd.configProperty.length (); + + for (size_t j = 0; j < idd_plen; ++j) + { + const char* idd_pname = idd.configProperty[j].name; + if (ACE_OS::strcmp (idd_pname, pname) == 0) + { + update = false; + break; + } + } + + if (update) + { + idd.configProperty.length (idd_plen + 1); + idd.configProperty[idd_plen] = + pcid.referencedImplementation.configProperty[i]; + } + } + } + diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.h new file mode 100644 index 00000000000..3117540082c --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.h @@ -0,0 +1,151 @@ +/* -*- C++ -*- */ + +//======================================================================== +/** + * file PlanGenerator.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 PLAN_GENERATOR_H +#define PLAN_GENERATOR_H + +#include "PCVisitorBase.h" //for the base visitor + +#include /**/ "ace/pre.h" +#include "ace/SString.h" //for the ACE_CString + +#include "ciao/DeploymentC.h" +#include "ciao/Deployment_BaseC.h" +#include "ciao/Deployment_DataC.h" +#include "ciao/Packaging_DataC.h" + + +//=========================================================================== +/** + * class Plan_Generator + * + * 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 Plan_Generator : public PCVisitorBase +{ +public: + + //constructor + Plan_Generator (Deployment::DeploymentPlan &plan, + Deployment::PackageConfiguration &pc); + + ///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); + +protected: + ///several helper functions + void update_execParameter (Deployment::ImplementationArtifactDescription& iad, + Deployment::ArtifactDeploymentDescription& add); + + void update_configProperty (Deployment::SubcomponentInstantiationDescription &scid, + Deployment::InstanceDeploymentDescription &idd); + + void update_configProperty (Deployment::PackagedComponentImplementation& pcid, + Deployment::MonolithicDeploymentDescription& mid, + Deployment::InstanceDeploymentDescription& idd); + +private: + + Deployment::DeploymentPlan& plan_; + Deployment::PackageConfiguration& pc_; + Deployment::ComponentAssemblyDescription* last_cad_; + +}; + +#include /**/ "ace/post.h" + +#endif /* PLAN_GENERATOR_H */ diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.idl b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.idl new file mode 100644 index 00000000000..3dd220b9b8b --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.idl @@ -0,0 +1,33 @@ +//PlanGenerator.idl,v 1.1 spaunov Exp +//Author: Stoyan Paunov +//$Id$ + +#ifndef RACE_PLAN_GENERATOR_INPUT_ADAPTER_IDL +#define RACE_PLAN_GENERATOR_INPUT_ADAPTER_IDL + +#include <Components.idl> +#include "Input_Adapters/Base/Input_Adapter.idl" +#include "common/RACE_common.idl" + +module CIAO +{ + module RACE + { + eventtype Deploy_Input + { + public string package_name; + public Action command; + }; + + component PlanGenerator : Input_Adapter + { + consumes Deploy_Input deployment; + }; + + home PlanGenerator_Home manages PlanGenerator + { + }; + }; +}; + +#endif /* RACE_PLAN_GENERATOR_INPUT_ADAPTER_IDL */ diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.mpc.disable b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.mpc.disable new file mode 100644 index 00000000000..fdb014ef9cc --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator.mpc.disable @@ -0,0 +1,118 @@ +// generate_component_mpc.pl +//Author: Stoyan Paunov +//PlanGenerator.mpc, spaunov +//$Id$ + +project(PlanGenerator_stub): ciao_deployment_stub, ciao_race_component { + after += Input_Adapter_stub + sharedname = PlanGenerator_stub + idlflags += -Sc \ + -Wb,stub_export_macro=PLANGENERATOR_STUB_Export \ + -Wb,stub_export_include=PlanGenerator_stub_export.h \ + -Wb,skel_export_macro=PLANGENERATOR_SVNT_Export \ + -Wb,skel_export_include=PlanGenerator_svnt_export.h + dynamicflags = PLANGENERATOR_STUB_BUILD_DLL + libs += Input_Adapter_stub \ + Plan_Analyzer_Interface_stub + + IDL_Files { + PlanGenerator.idl + } + + Source_Files { + PlanGeneratorC.cpp + } + + Header_Files { + PlanGeneratorC.h + } + + Inline_Files { + PlanGeneratorC.inl + } +} + +project(PlanGenerator_svnt) : ciao_servant_dnc, ciao_race_component { + after += PlanGenerator_stub \ + Input_Adapter_svnt + sharedname = PlanGenerator_svnt + libs += PlanGenerator_stub \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub + + idlflags += -Sc \ + -Wb,export_macro=PLANGENERATOR_SVNT_Export \ + -Wb,export_include=PlanGenerator_svnt_export.h + + dynamicflags = PLANGENERATOR_SVNT_BUILD_DLL + + CIDL_Files { + PlanGenerator.cidl + } + + IDL_Files { + PlanGeneratorE.idl + } + + Source_Files { + PlanGeneratorEC.cpp + PlanGeneratorS.cpp + PlanGenerator_svnt.cpp + } + + Header_Files { + PlanGeneratorEC.h + PlanGeneratorS.h + PlanGenerator_svnt.h + } + + Inline_Files { + PlanGeneratorEC.inl + PlanGeneratorS.inl + PlanGenerator_svnt.inl + } +} + + +project(PlanGenerator_exec) : ciao_component_dnc, ciao_config_handlers, ciao_race_component { + after += PlanGenerator_svnt XSC_Config_Handlers + sharedname = PlanGenerator_exec + libs += PlanGenerator_stub \ + PlanGenerator_svnt \ + Input_Adapter_stub \ + Input_Adapter_svnt \ + Plan_Analyzer_Interface_stub \ + + idlflags += -Sc \ + -Wb,export_macro=PLANGENERATOR_EXEC_Export \ + -Wb,export_include=PlanGenerator_exec_export.h + dynamicflags = PLANGENERATOR_EXEC_BUILD_DLL + + requires += RepositoryManager + after += RepositoryManager + includes += $(CIAO_ROOT)/DAnCE/RepositoryManager + + IDL_Files { + + } + + Source_Files { + PlanGenerator_exec.cpp + PCVisitorBase.cpp + PlanGenerator.cpp + $(CIAO_ROOT)/DAnCE/RepositoryManager/RepositoryManagerDaemonC.cpp + } +} + +project(PlanGenerator_Injector) : ciao_component_dnc, ciao_race_component, taoexe { + exename = injector + + libs += PlanGenerator_stub + + IDL_Files { + } + Source_Files { + Injector.cpp + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_deployment.dat b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_deployment.dat new file mode 100644 index 00000000000..3621981b2c8 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_deployment.dat @@ -0,0 +1 @@ +PlanGenerator corbaloc:iiop:localhost:50000/NodeManager diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.cpp b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.cpp new file mode 100644 index 00000000000..dd78aafb8b5 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.cpp @@ -0,0 +1,265 @@ +// $Id$ +// Author: Stoyan Paunov + +#include "PlanGenerator_exec.h" +#include "ciao/CIAO_common.h" +#include "Config_Handlers/XML_File_Intf.h" +#include "Config_Handlers/Package_Handlers/PCD_Handler.h" +#include "Config_Handlers/Common.h" +#include "Config_Handlers/DnC_Dump.h" + +#include "DAnCE/RepositoryManager/RepositoryManagerDaemonC.h" +#include "PlanGenerator.h" + +#include <iostream> +using namespace std; + + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_PlanGenerator_Impl + { + //================================================================== + // Component Executor Implementation Class: + // PlanGenerator_exec_i + //================================================================== + + PlanGenerator_exec_i::PlanGenerator_exec_i (void) + { + } + + PlanGenerator_exec_i::~PlanGenerator_exec_i (void) + { + } + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + void + PlanGenerator_exec_i::push_deployment ( + ::CIAO::RACE::Deploy_Input * ev) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + try + { + + //Get the IOR of the RepoMan from the naming service + + //Obtain a ref to the orb + CORBA::ORB_ptr orb = this->context_->_ciao_the_Container ()->the_ORB (); + + //form the path to the RepoMan IOR file + ACE_CString RepoMan_ior = ("file://"); + RepoMan_ior += ACE_OS::getenv ("CIAO_ROOT"); + RepoMan_ior += "/DAnCE/RepositoryManager/RepositoryManagerDeamon.ior"; + + cout << "RepoMan ior file: " << RepoMan_ior.c_str () << endl; + + CORBA::Object_var obj = + orb->string_to_object (RepoMan_ior.c_str ()); + + CIAO::RepositoryManagerDaemon_var rm = + CIAO::RepositoryManagerDaemon::_narrow (obj.in ()); + + if (CORBA::is_nil (rm.in ())) + { + ACE_ERROR ((LM_ERROR, + "Unable to acquire RepositoryManagerDaemon's objref\n")); + + throw CORBA::INTERNAL (); + } + + //now obtian the corresponding PackageConfiguration from + //the RepositoryManager + + Deployment::PackageConfiguration* rmpc; + + try + { + //retrieve the curresponding PackageConfiguration + //from the RepoMan + rmpc = rm->findPackageByName (ev->package_name ()); + + ACE_DEBUG ((LM_INFO, + "The package was found!\nUUID: %s\n", + rmpc->UUID)); + } + catch (Deployment::NoSuchName &) + { + ACE_ERROR ((LM_ERROR, + "Error! Package not found! Location update failed!\n")); + + throw CORBA::INTERNAL (); + + } + catch (CORBA::Exception &) + { + ACE_ERROR ((LM_ERROR, + "Error! General exception! Location update failed!\n")); + + throw CORBA::INTERNAL (); + } + + //now create the plan + + Deployment::DeploymentPlan* plan = 0; + ACE_NEW_THROW_EX (plan, + Deployment::DeploymentPlan (), + CORBA::INTERNAL ()); + + Plan_Generator pgen (*plan, *rmpc); + + //start the generation + pgen.Visit (); + + //So now what? + ::Deployment::DnC_Dump::dump (*plan); + + //do not call the plan analyzer just yet + return; + + //creat an action sequence and populate it + ::CIAO::RACE::Plan_Actions plan_action_seq; + + /// Create a Plan_Action_seq structure of length 1. + plan_action_seq.length (1); + + /// Now populate the Plan_Action_seq structure. + plan_action_seq [0].command = ev->command (); + plan_action_seq [0].plan = *plan; + plan_action_seq [0].package = *rmpc; + + /// Now invoke the plan_analyzer. + this->context_->get_connection_ingress () + ->analyze_plan (plan_action_seq); + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "Exception caught in push_deployment\n")); + } + } + + // Operations from Components::SessionComponent + + void + PlanGenerator_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + this->context_ = + PlanGenerator_Context::_narrow ( + ctx); + + if (this->context_ == 0) + { + throw CORBA::INTERNAL (); + } + } + + void + PlanGenerator_exec_i::ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + PlanGenerator_exec_i::ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + PlanGenerator_exec_i::ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + PlanGenerator_exec_i::ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + void + PlanGenerator_exec_i::ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + // Your code here. + } + + //================================================================== + // Home Executor Implementation Class: PlanGenerator_Home_exec_i + //================================================================== + + PlanGenerator_Home_exec_i::PlanGenerator_Home_exec_i (void) + { + } + + PlanGenerator_Home_exec_i::~PlanGenerator_Home_exec_i (void) + { + } + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + ::Components::EnterpriseComponent_ptr + PlanGenerator_Home_exec_i::create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_THROW_EX ( + retval, + PlanGenerator_exec_i, + CORBA::NO_MEMORY ()); + + return retval; + } + + extern "C" PLANGENERATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_PlanGenerator_Home_Impl (void) + { + ::Components::HomeExecutorBase_ptr retval = + ::Components::HomeExecutorBase::_nil (); + + ACE_NEW_RETURN ( + retval, + PlanGenerator_Home_exec_i, + ::Components::HomeExecutorBase::_nil ()); + + return retval; + } + } + } +} diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.h new file mode 100644 index 00000000000..76fd200c58b --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec.h @@ -0,0 +1,121 @@ +// $Id$ +//Author: Stoyan Paunov + + +#ifndef CIAO_PLANGENERATOR_EXEC_H +#define CIAO_PLANGENERATOR_EXEC_H + +#include /**/ "ace/pre.h" + +#include "PlanGenerator_svnt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "PlanGenerator_exec_export.h" +#include "tao/LocalObject.h" + +namespace CIAO +{ + namespace RACE + { + namespace CIDL_PlanGenerator_Impl + { + class PLANGENERATOR_EXEC_Export PlanGenerator_exec_i + : public virtual PlanGenerator_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + PlanGenerator_exec_i (void); + virtual ~PlanGenerator_exec_i (void); + + // Supported or inherited operations. + + // Attribute operations. + + // Port operations. + + virtual void + push_deployment ( + ::CIAO::RACE::Deploy_Input *ev) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_preactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ciao_postactivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_activate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_passivate () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + virtual void + ccm_remove () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + + protected: + PlanGenerator_Context *context_; + }; + + class PLANGENERATOR_EXEC_Export PlanGenerator_Home_exec_i + : public virtual PlanGenerator_Home_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + PlanGenerator_Home_exec_i (void); + virtual ~PlanGenerator_Home_exec_i (void); + + // Supported or inherited operations. + + // Home operations. + + // Factory and finder operations. + + // Attribute operations. + + // Implicit operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CCMException)); + }; + + extern "C" PLANGENERATOR_EXEC_Export ::Components::HomeExecutorBase_ptr + create_CIAO_RACE_PlanGenerator_Home_Impl (void); + } + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_PLANGENERATOR_EXEC_H */ + diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec_export.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec_export.h new file mode 100644 index 00000000000..b4bb3c8e00d --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl PLANGENERATOR_EXEC +// ------------------------------ +#ifndef PLANGENERATOR_EXEC_EXPORT_H +#define PLANGENERATOR_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (PLANGENERATOR_EXEC_HAS_DLL) +# define PLANGENERATOR_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && PLANGENERATOR_EXEC_HAS_DLL */ + +#if !defined (PLANGENERATOR_EXEC_HAS_DLL) +# define PLANGENERATOR_EXEC_HAS_DLL 1 +#endif /* ! PLANGENERATOR_EXEC_HAS_DLL */ + +#if defined (PLANGENERATOR_EXEC_HAS_DLL) && (PLANGENERATOR_EXEC_HAS_DLL == 1) +# if defined (PLANGENERATOR_EXEC_BUILD_DLL) +# define PLANGENERATOR_EXEC_Export ACE_Proper_Export_Flag +# define PLANGENERATOR_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* PLANGENERATOR_EXEC_BUILD_DLL */ +# define PLANGENERATOR_EXEC_Export ACE_Proper_Import_Flag +# define PLANGENERATOR_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* PLANGENERATOR_EXEC_BUILD_DLL */ +#else /* PLANGENERATOR_EXEC_HAS_DLL == 1 */ +# define PLANGENERATOR_EXEC_Export +# define PLANGENERATOR_EXEC_SINGLETON_DECLARATION(T) +# define PLANGENERATOR_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* PLANGENERATOR_EXEC_HAS_DLL == 1 */ + +// Set PLANGENERATOR_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (PLANGENERATOR_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define PLANGENERATOR_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define PLANGENERATOR_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !PLANGENERATOR_EXEC_NTRACE */ + +#if (PLANGENERATOR_EXEC_NTRACE == 1) +# define PLANGENERATOR_EXEC_TRACE(X) +#else /* (PLANGENERATOR_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define PLANGENERATOR_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (PLANGENERATOR_EXEC_NTRACE == 1) */ + +#endif /* PLANGENERATOR_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_stub_export.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_stub_export.h new file mode 100644 index 00000000000..2a3f42d0fd4 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl PLANGENERATOR_STUB +// ------------------------------ +#ifndef PLANGENERATOR_STUB_EXPORT_H +#define PLANGENERATOR_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (PLANGENERATOR_STUB_HAS_DLL) +# define PLANGENERATOR_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && PLANGENERATOR_STUB_HAS_DLL */ + +#if !defined (PLANGENERATOR_STUB_HAS_DLL) +# define PLANGENERATOR_STUB_HAS_DLL 1 +#endif /* ! PLANGENERATOR_STUB_HAS_DLL */ + +#if defined (PLANGENERATOR_STUB_HAS_DLL) && (PLANGENERATOR_STUB_HAS_DLL == 1) +# if defined (PLANGENERATOR_STUB_BUILD_DLL) +# define PLANGENERATOR_STUB_Export ACE_Proper_Export_Flag +# define PLANGENERATOR_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* PLANGENERATOR_STUB_BUILD_DLL */ +# define PLANGENERATOR_STUB_Export ACE_Proper_Import_Flag +# define PLANGENERATOR_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* PLANGENERATOR_STUB_BUILD_DLL */ +#else /* PLANGENERATOR_STUB_HAS_DLL == 1 */ +# define PLANGENERATOR_STUB_Export +# define PLANGENERATOR_STUB_SINGLETON_DECLARATION(T) +# define PLANGENERATOR_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* PLANGENERATOR_STUB_HAS_DLL == 1 */ + +// Set PLANGENERATOR_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (PLANGENERATOR_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define PLANGENERATOR_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define PLANGENERATOR_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !PLANGENERATOR_STUB_NTRACE */ + +#if (PLANGENERATOR_STUB_NTRACE == 1) +# define PLANGENERATOR_STUB_TRACE(X) +#else /* (PLANGENERATOR_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define PLANGENERATOR_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (PLANGENERATOR_STUB_NTRACE == 1) */ + +#endif /* PLANGENERATOR_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_svnt_export.h b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_svnt_export.h new file mode 100644 index 00000000000..212dd57a8e9 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/PlanGenerator_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl PLANGENERATOR_SVNT +// ------------------------------ +#ifndef PLANGENERATOR_SVNT_EXPORT_H +#define PLANGENERATOR_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (PLANGENERATOR_SVNT_HAS_DLL) +# define PLANGENERATOR_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && PLANGENERATOR_SVNT_HAS_DLL */ + +#if !defined (PLANGENERATOR_SVNT_HAS_DLL) +# define PLANGENERATOR_SVNT_HAS_DLL 1 +#endif /* ! PLANGENERATOR_SVNT_HAS_DLL */ + +#if defined (PLANGENERATOR_SVNT_HAS_DLL) && (PLANGENERATOR_SVNT_HAS_DLL == 1) +# if defined (PLANGENERATOR_SVNT_BUILD_DLL) +# define PLANGENERATOR_SVNT_Export ACE_Proper_Export_Flag +# define PLANGENERATOR_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* PLANGENERATOR_SVNT_BUILD_DLL */ +# define PLANGENERATOR_SVNT_Export ACE_Proper_Import_Flag +# define PLANGENERATOR_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define PLANGENERATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* PLANGENERATOR_SVNT_BUILD_DLL */ +#else /* PLANGENERATOR_SVNT_HAS_DLL == 1 */ +# define PLANGENERATOR_SVNT_Export +# define PLANGENERATOR_SVNT_SINGLETON_DECLARATION(T) +# define PLANGENERATOR_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* PLANGENERATOR_SVNT_HAS_DLL == 1 */ + +// Set PLANGENERATOR_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (PLANGENERATOR_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define PLANGENERATOR_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define PLANGENERATOR_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !PLANGENERATOR_SVNT_NTRACE */ + +#if (PLANGENERATOR_SVNT_NTRACE == 1) +# define PLANGENERATOR_SVNT_TRACE(X) +#else /* (PLANGENERATOR_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define PLANGENERATOR_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (PLANGENERATOR_SVNT_NTRACE == 1) */ + +#endif /* PLANGENERATOR_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/RACE/Input_Adapters/PlanGenerator/README.txt b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/README.txt new file mode 100644 index 00000000000..8cbc5665f85 --- /dev/null +++ b/modules/CIAO/RACE/Input_Adapters/PlanGenerator/README.txt @@ -0,0 +1,15 @@ + + +//Author: Stoyan Paunov + +This is the README for the PlanGenerator Input Adapter for RACE. This input +adapter has similar functionality to the Interactive Input Adapter, however +instead of parsing the descriptors on disk, it takes the provided by the +injector package name, retrieves the corresponding PackageConfiguration, and +finally build a DeploymentPlan in memory. Due to the fact that the XML parsing +is avoided, the operation takes a lot less time than its counterpart in the +Interactive Input Adapter. An added benefit is that the implementation arti- +facts in the constructed DeploymentPlan to point to the HTTP server collocated +with the RepositoryManager. + + |