diff options
Diffstat (limited to 'modules/CIAO/examples/BasicSP')
83 files changed, 4815 insertions, 0 deletions
diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.cidl b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.cidl new file mode 100644 index 00000000000..99263030104 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.cidl @@ -0,0 +1,20 @@ +//$Id$ + +#ifndef BMCLOSEDED_CIDL +#define BMCLOSEDED_CIDL + +#include "../BasicSP.idl" +#include "BMClosedED.idl" + +composition session BMClosedED_Impl +{ + home executor BMClosedEDHome_Exec + { + implements BasicSP::BMClosedEDHome; + manages BMClosedED_Exec; + }; +}; + +#endif /* BMCLOSEDED_CIDL */ + + diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.idl b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.idl new file mode 100644 index 00000000000..2fe200151fe --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.idl @@ -0,0 +1,17 @@ +//$Id$ +#include "../BasicSP.idl" + +module BasicSP +{ + component BMClosedED + { + provides ReadData dataout; + uses ReadData datain; + publishes DataAvailable out_avail; + consumes DataAvailable in_avail; + }; + + home BMClosedEDHome manages BMClosedED + { + }; +}; diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc new file mode 100644 index 00000000000..d08061594a0 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED.mpc @@ -0,0 +1,83 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p HUDisplay -i BMClosedED" +// This file has been manually modified to add a second component implementation. + +project(BMClosedED_DnC_stub): ciao_client_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_stub + sharedname = BMClosedED_stub + + idlflags += -Wb,stub_export_macro=BMCLOSEDED_STUB_Export + idlflags += -Wb,stub_export_include=BMClosedED_stub_export.h + idlflags += -Wb,skel_export_macro=BMCLOSEDED_SVNT_Export + idlflags += -Wb,skel_export_include=BMClosedED_svnt_export.h + + libs += BasicSP_stub + + dynamicflags = BMCLOSEDED_STUB_BUILD_DLL + + IDL_Files { + BMClosedED.idl + } + + Source_Files { + BMClosedEDC.cpp + } +} + +project(BMClosedED_DnC_svnt) : ciao_servant_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_svnt BMClosedED_DnC_stub + + sharedname = BMClosedED_svnt + + libs += BMClosedED_stub BasicSP_stub + libs += BasicSP_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=BMCLOSEDED_SVNT_Export + idlflags += -Wb,export_include=BMClosedED_svnt_export.h + + dynamicflags = BMCLOSEDED_SVNT_BUILD_DLL + + CIDL_Files { + BMClosedED.cidl + } + + IDL_Files { + BMClosedEDE.idl + } + + Source_Files { + BMClosedEDEC.cpp + BMClosedEDS.cpp + BMClosedED_svnt.cpp + } +} + + +project(BMClosedED_DnC_exec) : ciao_component_dnc { + avoids += ace_for_tao + after += BMClosedED_DnC_svnt + + sharedname = BMClosedED_exec + + libs += BMClosedED_stub BMClosedED_svnt + libs += BasicSP_stub BasicSP_svnt + + libpaths += .. + idlflags += -Wb,export_macro=BMCLOSEDED_EXEC_Export + idlflags += -Wb,export_include=BMClosedED_exec_export.h + + dynamicflags = BMCLOSEDED_EXEC_BUILD_DLL + + IDL_Files { + BMClosedEDEI.idl + } + + Source_Files { + BMClosedEDEIC.cpp + BMClosedED_exec.cpp + } +} diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedEDEI.idl b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedEDEI.idl new file mode 100644 index 00000000000..a95918e6595 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedEDEI.idl @@ -0,0 +1,33 @@ +// $Id$ + +/** + * @file BMClosedEDEI.idl + * + * Definition of the GPS component implementation. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ + +#ifndef CIAO_BMCLOSEDEDI_IDL +#define CIAO_BMCLOSEDEDI_IDL + +#include "BMClosedEDE.idl" + +module BasicSP +{ + /** + * @interface BMClosedED_Exec + * + * The actually GPS executor inherits from both CCM_GPS and + * CCM_position interfaces as a monolithic implementation. + */ + local interface BMClosedED_Exec : + CCM_BMClosedED, + CCM_ReadData, + Components::SessionComponent + { + }; + +}; + +#endif /* CIAO_BMCLOSEDEDI_IDL*/ diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp new file mode 100644 index 00000000000..fb92bb2ea66 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.cpp @@ -0,0 +1,191 @@ +// $Id$ + +#include "ciao/CIAO_common.h" +#include "BMClosedED_exec.h" +#include "ace/SString.h" + +#include "ace/OS_NS_string.h" + + +#define DISPLACEMENT 256 + +/// Default constructor. +MyImpl::BMClosedED_exec_i::BMClosedED_exec_i () +{ +} + +/// Default destructor. +MyImpl::BMClosedED_exec_i::~BMClosedED_exec_i () +{ +} + +// Operations from HUDisplay::BMClosedED + +BasicSP::CCM_ReadData_ptr +MyImpl::BMClosedED_exec_i::get_dataout () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return BasicSP::CCM_ReadData::_duplicate (this); +} + +void +MyImpl::BMClosedED_exec_i::push_in_avail (BasicSP::DataAvailable *) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - Doing computations \n")); + + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - Doing data fetch \n")); + } + + // Refresh position + BasicSP::ReadData_var dat + = this->context_->get_connection_datain (); + + if (CORBA::is_nil (dat.in ())) + { + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - got nil from get_connection \n")); + + throw CORBA::BAD_INV_ORDER (); + } + + CORBA::String_var str = + dat->get_data (); + + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - Display data is [%s] \n", + str.in ())); + } + + if (ACE_OS::strcmp (str.in (), "BM DEVICE DATA") == 0) + { + this->str_ = CORBA::string_dup ("BM CLOSED ED DATA"); + } + + // Notify others. + BasicSP::DataAvailable_var event = + new OBV_BasicSP::DataAvailable; + + this->context_->push_out_avail (event); +} + +// Operations from HUDisplay::position + +char * +MyImpl::BMClosedED_exec_i::get_data () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->str_.inout ()); +} + +// Operations from Components::SessionComponent +void +MyImpl::BMClosedED_exec_i::set_session_context ( + Components::SessionContext_ptr ctx + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMClosedED_exec_i::set_session_context\n")); + } + + this->context_ = + BasicSP::CCM_BMClosedED_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw CORBA::INTERNAL (); + } + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMClosedED_exec_i::ciao_preactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMClosedED_exec_i::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMClosedED_exec_i::ccm_activate\n")); + } + +} + +void +MyImpl::BMClosedED_exec_i::ciao_postactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMClosedED_exec_i::ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + // if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMClosedED_exec_i::ccm_passivate\n")); +} + +void +MyImpl::BMClosedED_exec_i::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + // if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMClosedED_exec_i::ccm_remove\n")); +} + +/// Default ctor. +MyImpl::BMClosedEDHome_exec_i::BMClosedEDHome_exec_i () +{ +} + +/// Default dtor. +MyImpl::BMClosedEDHome_exec_i::~BMClosedEDHome_exec_i () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::BMClosedEDHome_exec_i::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + Components::EnterpriseComponent_ptr tmp = + Components::EnterpriseComponent::_nil (); + ACE_NEW_THROW_EX (tmp, + MyImpl::BMClosedED_exec_i, + CORBA::NO_MEMORY ()); + return tmp; +} + + +extern "C" BMCLOSEDED_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMClosedEDHome_Impl (void) +{ + return new MyImpl::BMClosedEDHome_exec_i; +} diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h new file mode 100644 index 00000000000..c6f9c0ff1fe --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec.h @@ -0,0 +1,128 @@ +// $Id$ + +//================================================================ +/** + * @file BMClosedED_exec.h + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//================================================================ + +#ifndef CIAO_BMCLOSED_EXEC_H +#define CIAO_BMCLOSED_EXEC_H + +#include "BMClosedEDEIC.h" +#include "tao/LocalObject.h" + +// The namespace name for the actual implementation classes doesn't +// really matter. Since there may be several different +// implementations for a component, they can very well be in different +// namespaces. +namespace MyImpl +{ + /** + * @class BMClosedED_exec_i + * + * An example RateGen executor implementation class. + */ + class BMCLOSEDED_EXEC_Export BMClosedED_exec_i : + public virtual BasicSP::BMClosedED_Exec, + // CIAO container implementation depends on correct reference + // counting of local interfaces, so we take a short cut to + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + BMClosedED_exec_i (void); + + /// Default destructor. + ~BMClosedED_exec_i (void); + + // Operations from HUDisplay::BMClosedED + + virtual BasicSP::CCM_ReadData_ptr + get_dataout () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_in_avail (BasicSP::DataAvailable *ev) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from HUDisplay::position + virtual char * + get_data () + 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 + ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ciao_postactivate () + 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: + CORBA::String_var str_; + + /// Copmponent specific context + BasicSP::CCM_BMClosedED_Context_var context_; + }; + + /** + * @class BMClosedEDHome_exec_i + * + * BMClosedED home executor implementation class. + */ + class BMCLOSEDED_EXEC_Export BMClosedEDHome_exec_i : + public virtual BasicSP::CCM_BMClosedEDHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + BMClosedEDHome_exec_i (); + + /// Default dtor. + ~BMClosedEDHome_exec_i (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +// Executor DLL entry point. CIAO's deployment and assembly framework +// invokes this function on the resulting DLL to get the home executor. +extern "C" BMCLOSEDED_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMClosedEDHome_Impl (void); + +#endif /* CIAO_BMCLOSED_EXEC_H*/ diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec_export.h b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec_export.h new file mode 100644 index 00000000000..90b64e5262d --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMCLOSEDED_EXEC +// ------------------------------ +#ifndef BMCLOSEDED_EXEC_EXPORT_H +#define BMCLOSEDED_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMCLOSEDED_EXEC_HAS_DLL) +# define BMCLOSEDED_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMCLOSEDED_EXEC_HAS_DLL */ + +#if !defined (BMCLOSEDED_EXEC_HAS_DLL) +# define BMCLOSEDED_EXEC_HAS_DLL 1 +#endif /* ! BMCLOSEDED_EXEC_HAS_DLL */ + +#if defined (BMCLOSEDED_EXEC_HAS_DLL) && (BMCLOSEDED_EXEC_HAS_DLL == 1) +# if defined (BMCLOSEDED_EXEC_BUILD_DLL) +# define BMCLOSEDED_EXEC_Export ACE_Proper_Export_Flag +# define BMCLOSEDED_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMCLOSEDED_EXEC_BUILD_DLL */ +# define BMCLOSEDED_EXEC_Export ACE_Proper_Import_Flag +# define BMCLOSEDED_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMCLOSEDED_EXEC_BUILD_DLL */ +#else /* BMCLOSEDED_EXEC_HAS_DLL == 1 */ +# define BMCLOSEDED_EXEC_Export +# define BMCLOSEDED_EXEC_SINGLETON_DECLARATION(T) +# define BMCLOSEDED_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMCLOSEDED_EXEC_HAS_DLL == 1 */ + +// Set BMCLOSEDED_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMCLOSEDED_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define BMCLOSEDED_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMCLOSEDED_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMCLOSEDED_EXEC_NTRACE */ + +#if (BMCLOSEDED_EXEC_NTRACE == 1) +# define BMCLOSEDED_EXEC_TRACE(X) +#else /* (BMCLOSEDED_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMCLOSEDED_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMCLOSEDED_EXEC_NTRACE == 1) */ + +#endif /* BMCLOSEDED_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_stub_export.h b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_stub_export.h new file mode 100644 index 00000000000..cf7d2418b52 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMCLOSEDED_STUB +// ------------------------------ +#ifndef BMCLOSEDED_STUB_EXPORT_H +#define BMCLOSEDED_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMCLOSEDED_STUB_HAS_DLL) +# define BMCLOSEDED_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMCLOSEDED_STUB_HAS_DLL */ + +#if !defined (BMCLOSEDED_STUB_HAS_DLL) +# define BMCLOSEDED_STUB_HAS_DLL 1 +#endif /* ! BMCLOSEDED_STUB_HAS_DLL */ + +#if defined (BMCLOSEDED_STUB_HAS_DLL) && (BMCLOSEDED_STUB_HAS_DLL == 1) +# if defined (BMCLOSEDED_STUB_BUILD_DLL) +# define BMCLOSEDED_STUB_Export ACE_Proper_Export_Flag +# define BMCLOSEDED_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMCLOSEDED_STUB_BUILD_DLL */ +# define BMCLOSEDED_STUB_Export ACE_Proper_Import_Flag +# define BMCLOSEDED_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMCLOSEDED_STUB_BUILD_DLL */ +#else /* BMCLOSEDED_STUB_HAS_DLL == 1 */ +# define BMCLOSEDED_STUB_Export +# define BMCLOSEDED_STUB_SINGLETON_DECLARATION(T) +# define BMCLOSEDED_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMCLOSEDED_STUB_HAS_DLL == 1 */ + +// Set BMCLOSEDED_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMCLOSEDED_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define BMCLOSEDED_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMCLOSEDED_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMCLOSEDED_STUB_NTRACE */ + +#if (BMCLOSEDED_STUB_NTRACE == 1) +# define BMCLOSEDED_STUB_TRACE(X) +#else /* (BMCLOSEDED_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMCLOSEDED_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMCLOSEDED_STUB_NTRACE == 1) */ + +#endif /* BMCLOSEDED_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_svnt_export.h b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_svnt_export.h new file mode 100644 index 00000000000..f0bb1407c79 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/BMClosedED_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMCLOSEDED_SVNT +// ------------------------------ +#ifndef BMCLOSEDED_SVNT_EXPORT_H +#define BMCLOSEDED_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMCLOSEDED_SVNT_HAS_DLL) +# define BMCLOSEDED_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMCLOSEDED_SVNT_HAS_DLL */ + +#if !defined (BMCLOSEDED_SVNT_HAS_DLL) +# define BMCLOSEDED_SVNT_HAS_DLL 1 +#endif /* ! BMCLOSEDED_SVNT_HAS_DLL */ + +#if defined (BMCLOSEDED_SVNT_HAS_DLL) && (BMCLOSEDED_SVNT_HAS_DLL == 1) +# if defined (BMCLOSEDED_SVNT_BUILD_DLL) +# define BMCLOSEDED_SVNT_Export ACE_Proper_Export_Flag +# define BMCLOSEDED_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMCLOSEDED_SVNT_BUILD_DLL */ +# define BMCLOSEDED_SVNT_Export ACE_Proper_Import_Flag +# define BMCLOSEDED_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMCLOSEDED_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMCLOSEDED_SVNT_BUILD_DLL */ +#else /* BMCLOSEDED_SVNT_HAS_DLL == 1 */ +# define BMCLOSEDED_SVNT_Export +# define BMCLOSEDED_SVNT_SINGLETON_DECLARATION(T) +# define BMCLOSEDED_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMCLOSEDED_SVNT_HAS_DLL == 1 */ + +// Set BMCLOSEDED_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMCLOSEDED_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define BMCLOSEDED_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMCLOSEDED_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMCLOSEDED_SVNT_NTRACE */ + +#if (BMCLOSEDED_SVNT_NTRACE == 1) +# define BMCLOSEDED_SVNT_TRACE(X) +#else /* (BMCLOSEDED_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMCLOSEDED_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMCLOSEDED_SVNT_NTRACE == 1) */ + +#endif /* BMCLOSEDED_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMClosedED/config b/modules/CIAO/examples/BasicSP/BMClosedED/config new file mode 100644 index 00000000000..a122025755d --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMClosedED/config @@ -0,0 +1 @@ +BMClosedED_exec|createBMClosedEDHome_Impl|BMClosedED_svnt|createBMClosedEDHome_Servant diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.cidl b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.cidl new file mode 100644 index 00000000000..94919f15af0 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.cidl @@ -0,0 +1,20 @@ +//$Id$ + +#ifndef BMDEVICE_CIDL +#define BMDEVICE_CIDL + +#include "../BasicSP.idl" +#include "BMDevice.idl" + +composition session BMDevice_Impl +{ + home executor BMDeviceHome_Exec + { + implements BasicSP::BMDeviceHome; + manages BMDevice_Exec; + }; +}; + +#endif /* BMDEVICE_CIDL */ + + diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.idl b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.idl new file mode 100644 index 00000000000..86477c12f8b --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.idl @@ -0,0 +1,30 @@ +//$Id$ +//============================================================================= +/** + * @file BMDevice.idl + * + * Definition of the BMDevice component + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= +#ifndef CIAO_BMDEVICE_IDL +#define CIAO_BMDEVICE_IDL + +#include "../BasicSP.idl" + +module BasicSP +{ + component BMDevice + { + provides ReadData data_read; + publishes DataAvailable data_available; + consumes TimeOut timeout; + }; + + home BMDeviceHome manages BMDevice + { + }; +}; + +#endif /*CIAO_BMDEVICE_IDL */ diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc new file mode 100644 index 00000000000..90212cc63ec --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice.mpc @@ -0,0 +1,66 @@ +// $Id$ + +project(BMDevice_DnC_stub): ciao_client_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_stub + sharedname = BMDevice_stub + + idlflags += -Wb,stub_export_macro=BMDEVICE_STUB_Export -Wb,stub_export_include=BMDevice_stub_export.h -Wb,skel_export_macro=BMDEVICE_SVNT_Export -Wb,skel_export_include=BMDevice_svnt_export.h + libpaths += .. + libs += BasicSP_stub + dynamicflags = BMDEVICE_STUB_BUILD_DLL + + IDL_Files { + BMDevice.idl + } + + Source_Files { + BMDeviceC.cpp + } +} + +project(BMDevice_DnC_svnt) : ciao_servant_dnc { + avoids += ace_for_tao + after += BMDevice_DnC_stub BasicSP_DnC_stub + sharedname = BMDevice_svnt + libs += BMDevice_stub BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMDEVICE_SVNT_Export -Wb,export_include=BMDevice_svnt_export.h + dynamicflags = BMDEVICE_SVNT_BUILD_DLL + + CIDL_Files { + BMDevice.cidl + } + + IDL_Files { + BMDeviceE.idl + } + + Source_Files { + BMDeviceEC.cpp + BMDeviceS.cpp + BMDevice_svnt.cpp + } +} + + +project(BMDevice_DnC_exec) : ciao_component_dnc { + avoids += ace_for_tao + after += BMDevice_DnC_svnt + sharedname = BMDevice_exec + libs += BMDevice_stub BMDevice_svnt BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMDEVICE_EXEC_Export -Wb,export_include=BMDevice_exec_export.h + dynamicflags = BMDEVICE_EXEC_BUILD_DLL + + IDL_Files { + BMDeviceEI.idl + } + + Source_Files { + BMDeviceES.cpp + BMDeviceEIC.cpp + BMDeviceEIS.cpp + BMDevice_exec.cpp + } +} diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDeviceEI.idl b/modules/CIAO/examples/BasicSP/BMDevice/BMDeviceEI.idl new file mode 100644 index 00000000000..18a4ad9eaa4 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDeviceEI.idl @@ -0,0 +1,30 @@ +// $Id$ +//============================================================================= +/** + * @file BMDeviceEI.idl + * + * Definition of the BMDevice component implementation. + * + * @author Nanbor Wang <nanbor@cs.wustl.edu> + */ +//============================================================================= +#ifndef CIAO_BMDEVICEEI_IDL +#define CIAO_BMDEVICEEI_IDL + +#include "BMDeviceE.idl" + +module BasicSP +{ + /** + * @interface BMDevice_Exec + */ + local interface BMDevice_Exec : + CCM_BMDevice, + CCM_ReadData, + Components::SessionComponent + { + }; + +}; + +#endif /* CIAO_BMDEVICEEI_IDL */ diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp new file mode 100644 index 00000000000..5f401e2de5d --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.cpp @@ -0,0 +1,164 @@ +// $Id$ + +#include "ciao/CIAO_common.h" +#include "BMDevice_exec.h" + +#define DISPLACEMENT 256 + +/// Default constructor. +MyImpl::BMDevice_exec_i::BMDevice_exec_i (void) + : str_ ("BM DEVICE DATA") +{ + +} + +/// Default destructor. +MyImpl::BMDevice_exec_i::~BMDevice_exec_i () +{ +} + +BasicSP::CCM_ReadData_ptr +MyImpl::BMDevice_exec_i::get_data_read () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return BasicSP::CCM_ReadData::_duplicate (this); +} + +void +MyImpl::BMDevice_exec_i::push_timeout (BasicSP::TimeOut *) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Nitify others + BasicSP::DataAvailable_var event = new OBV_BasicSP::DataAvailable; + + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "BMDevice, received a timeout from EC \n")); + } + + this->context_->push_data_available (event); +} + +char * +MyImpl::BMDevice_exec_i::data_read () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup (this->str_); +} + +char * +MyImpl::BMDevice_exec_i::get_data () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->data_read (); +} + +// Operations from Components::SessionComponent +void +MyImpl::BMDevice_exec_i::set_session_context ( + Components::SessionContext_ptr ctx + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDevice_exec_i::set_session_context\n")); + } + + this->context_ = + BasicSP::CCM_BMDevice_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + { + throw CORBA::INTERNAL (); + } + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMDevice_exec_i::ciao_preactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMDevice_exec_i::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDevice_exec_i::ccm_activate\n")); + } + +} + +void +MyImpl::BMDevice_exec_i::ciao_postactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMDevice_exec_i::ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDevice_exec_i::ccm_passivate\n")); + } +} + +void +MyImpl::BMDevice_exec_i::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDevice_exec_i::ccm_remove\n")); + } +} + +/// Default ctor. +MyImpl::BMDeviceHome_exec_i::BMDeviceHome_exec_i () +{ +} + +/// Default dtor. +MyImpl::BMDeviceHome_exec_i::~BMDeviceHome_exec_i () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::BMDeviceHome_exec_i::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + Components::EnterpriseComponent_ptr tmp= 0; + ACE_NEW_THROW_EX (tmp, + MyImpl::BMDevice_exec_i, + CORBA::NO_MEMORY ()); + + return tmp; +} + + +extern "C" BMDEVICE_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMDeviceHome_Impl (void) +{ + return new MyImpl::BMDeviceHome_exec_i; +} diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h new file mode 100644 index 00000000000..6ad460faee4 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec.h @@ -0,0 +1,130 @@ +// $Id$ + +// ================================================================ +/** + * @file BMDevice_exec.h + * + * Header file for the actual BMDevice and BMDeviceHome component + * implementations. These classes are the implementations of local + * interfaces defined in BMDeviceEI.idl. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +// ================================================================ + +#ifndef CIAO_BMDEVICE_EXEC_H +#define CIAO_BMDEVICE_EXEC_H + +#include "BMDeviceEIC.h" +#include "tao/LocalObject.h" + +namespace MyImpl +{ + /** + * @class BMDEVICE_exec_i + * + * An example RateGen executor implementation class. + */ + class BMDEVICE_EXEC_Export BMDevice_exec_i : + public virtual BasicSP::BMDevice_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + BMDevice_exec_i (); + + /// Default destructor. + ~BMDevice_exec_i (); + + // Operations from BasicSP::BMDevice + + virtual BasicSP::CCM_ReadData_ptr + get_data_read () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_timeout (BasicSP::TimeOut *ev) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from BasicSP::position + + virtual char * + data_read () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual char * + get_data () + 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 + ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + virtual void + ciao_postactivate () + 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: + const char *str_; + + /// Copmponent specific context + BasicSP::CCM_BMDevice_Context_var context_; + }; + + /** + * @class BMDeviceHome_exec_i + * + * BMDevice home executor implementation class. + */ + class BMDEVICE_EXEC_Export BMDeviceHome_exec_i : + public virtual BasicSP::CCM_BMDeviceHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + BMDeviceHome_exec_i (); + + /// Default dtor. + ~BMDeviceHome_exec_i (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +// Executor DLL entry point. CIAO's deployment and assembly framework +// invokes this function on the resulting DLL to get the home executor. +extern "C" BMDEVICE_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMDeviceHome_Impl (void); + +#endif /* CIAO_BMDEVICE_EXEC_H*/ diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec_export.h b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec_export.h new file mode 100644 index 00000000000..8a5296ac320 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDEVICE_EXEC +// ------------------------------ +#ifndef BMDEVICE_EXEC_EXPORT_H +#define BMDEVICE_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDEVICE_EXEC_HAS_DLL) +# define BMDEVICE_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDEVICE_EXEC_HAS_DLL */ + +#if !defined (BMDEVICE_EXEC_HAS_DLL) +# define BMDEVICE_EXEC_HAS_DLL 1 +#endif /* ! BMDEVICE_EXEC_HAS_DLL */ + +#if defined (BMDEVICE_EXEC_HAS_DLL) && (BMDEVICE_EXEC_HAS_DLL == 1) +# if defined (BMDEVICE_EXEC_BUILD_DLL) +# define BMDEVICE_EXEC_Export ACE_Proper_Export_Flag +# define BMDEVICE_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDEVICE_EXEC_BUILD_DLL */ +# define BMDEVICE_EXEC_Export ACE_Proper_Import_Flag +# define BMDEVICE_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDEVICE_EXEC_BUILD_DLL */ +#else /* BMDEVICE_EXEC_HAS_DLL == 1 */ +# define BMDEVICE_EXEC_Export +# define BMDEVICE_EXEC_SINGLETON_DECLARATION(T) +# define BMDEVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDEVICE_EXEC_HAS_DLL == 1 */ + +// Set BMDEVICE_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDEVICE_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDEVICE_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDEVICE_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDEVICE_EXEC_NTRACE */ + +#if (BMDEVICE_EXEC_NTRACE == 1) +# define BMDEVICE_EXEC_TRACE(X) +#else /* (BMDEVICE_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDEVICE_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDEVICE_EXEC_NTRACE == 1) */ + +#endif /* BMDEVICE_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_stub_export.h b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_stub_export.h new file mode 100644 index 00000000000..d5629993a02 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDEVICE_STUB +// ------------------------------ +#ifndef BMDEVICE_STUB_EXPORT_H +#define BMDEVICE_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDEVICE_STUB_HAS_DLL) +# define BMDEVICE_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDEVICE_STUB_HAS_DLL */ + +#if !defined (BMDEVICE_STUB_HAS_DLL) +# define BMDEVICE_STUB_HAS_DLL 1 +#endif /* ! BMDEVICE_STUB_HAS_DLL */ + +#if defined (BMDEVICE_STUB_HAS_DLL) && (BMDEVICE_STUB_HAS_DLL == 1) +# if defined (BMDEVICE_STUB_BUILD_DLL) +# define BMDEVICE_STUB_Export ACE_Proper_Export_Flag +# define BMDEVICE_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDEVICE_STUB_BUILD_DLL */ +# define BMDEVICE_STUB_Export ACE_Proper_Import_Flag +# define BMDEVICE_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDEVICE_STUB_BUILD_DLL */ +#else /* BMDEVICE_STUB_HAS_DLL == 1 */ +# define BMDEVICE_STUB_Export +# define BMDEVICE_STUB_SINGLETON_DECLARATION(T) +# define BMDEVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDEVICE_STUB_HAS_DLL == 1 */ + +// Set BMDEVICE_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDEVICE_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDEVICE_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDEVICE_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDEVICE_STUB_NTRACE */ + +#if (BMDEVICE_STUB_NTRACE == 1) +# define BMDEVICE_STUB_TRACE(X) +#else /* (BMDEVICE_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDEVICE_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDEVICE_STUB_NTRACE == 1) */ + +#endif /* BMDEVICE_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_svnt_export.h b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_svnt_export.h new file mode 100644 index 00000000000..aef5a60b792 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDevice/BMDevice_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDEVICE_SVNT +// ------------------------------ +#ifndef BMDEVICE_SVNT_EXPORT_H +#define BMDEVICE_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDEVICE_SVNT_HAS_DLL) +# define BMDEVICE_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDEVICE_SVNT_HAS_DLL */ + +#if !defined (BMDEVICE_SVNT_HAS_DLL) +# define BMDEVICE_SVNT_HAS_DLL 1 +#endif /* ! BMDEVICE_SVNT_HAS_DLL */ + +#if defined (BMDEVICE_SVNT_HAS_DLL) && (BMDEVICE_SVNT_HAS_DLL == 1) +# if defined (BMDEVICE_SVNT_BUILD_DLL) +# define BMDEVICE_SVNT_Export ACE_Proper_Export_Flag +# define BMDEVICE_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDEVICE_SVNT_BUILD_DLL */ +# define BMDEVICE_SVNT_Export ACE_Proper_Import_Flag +# define BMDEVICE_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDEVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDEVICE_SVNT_BUILD_DLL */ +#else /* BMDEVICE_SVNT_HAS_DLL == 1 */ +# define BMDEVICE_SVNT_Export +# define BMDEVICE_SVNT_SINGLETON_DECLARATION(T) +# define BMDEVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDEVICE_SVNT_HAS_DLL == 1 */ + +// Set BMDEVICE_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDEVICE_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDEVICE_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDEVICE_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDEVICE_SVNT_NTRACE */ + +#if (BMDEVICE_SVNT_NTRACE == 1) +# define BMDEVICE_SVNT_TRACE(X) +#else /* (BMDEVICE_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDEVICE_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDEVICE_SVNT_NTRACE == 1) */ + +#endif /* BMDEVICE_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.cidl b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.cidl new file mode 100644 index 00000000000..4342aa753c8 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.cidl @@ -0,0 +1,18 @@ +//$Id$ + +#ifndef BMDISPLAY_CIDL +#define BMDISPLAY_CIDL + +#include "BMDisplay.idl" + +composition session BMDisplay_Impl +{ + home executor BMDisplayHome_Exec + { + implements BasicSP::BMDisplayHome; + manages BMDisplay_Exec; + }; +}; + +#endif /* BMDISPLAY_CIDL */ + diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.idl b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.idl new file mode 100644 index 00000000000..cbeed950b07 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.idl @@ -0,0 +1,15 @@ +//$Id$ +#include "../BasicSP.idl" + +module BasicSP +{ + component BMDisplay + { + consumes DataAvailable data_ready; + uses ReadData comp_data; + }; + + home BMDisplayHome manages BMDisplay + { + }; +}; diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc new file mode 100644 index 00000000000..35e0c3196f0 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay.mpc @@ -0,0 +1,82 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p BasicSP -i BMDisplay" + +project(BMDisplay_DnC_stub): ciao_client_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_stub + + sharedname = BMDisplay_stub + + idlflags += -Wb,stub_export_macro=BMDISPLAY_STUB_Export + idlflags += -Wb,stub_export_include=BMDisplay_stub_export.h + idlflags += -Wb,skel_export_macro=BMDISPLAY_SVNT_Export + idlflags += -Wb,skel_export_include=BMDisplay_svnt_export.h + dynamicflags = BMDISPLAY_STUB_BUILD_DLL + + libs += BasicSP_stub + + IDL_Files { + BMDisplay.idl + } + + Source_Files { + BMDisplayC.cpp + } +} + +project(BMDisplay_DnC_svnt) : ciao_servant_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_svnt BMDisplay_DnC_stub + + sharedname = BMDisplay_svnt + + libs += BMDisplay_stub BasicSP_stub BasicSP_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=BMDISPLAY_SVNT_Export + idlflags += -Wb,export_include=BMDisplay_svnt_export.h + + dynamicflags = BMDISPLAY_SVNT_BUILD_DLL + + CIDL_Files { + BMDisplay.cidl + } + + IDL_Files { + BMDisplayE.idl + } + + Source_Files { + BMDisplayEC.cpp + BMDisplayS.cpp + BMDisplay_svnt.cpp + } +} + + +project(BMDisplay_DnC_exec) : ciao_component_dnc { + avoids += ace_for_tao + after += BMDisplay_DnC_svnt + + sharedname = BMDisplay_exec + + libs += BMDisplay_stub BMDisplay_svnt + libs += BasicSP_stub BasicSP_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=BMDISPLAY_EXEC_Export + idlflags += -Wb,export_include=BMDisplay_exec_export.h + + dynamicflags = BMDISPLAY_EXEC_BUILD_DLL + + IDL_Files { + BMDisplayEI.idl + } + + Source_Files { + BMDisplayEIC.cpp + BMDisplay_exec.cpp + } +} diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplayEI.idl b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplayEI.idl new file mode 100644 index 00000000000..8a218debab1 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplayEI.idl @@ -0,0 +1,33 @@ +// $Id$ +//=========================================================== +/** + * @file BMDisplayEI.idl + * + * Definition of the BMDisplay (navigation display) component + * implementation. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//=========================================================== +#ifndef CIAO_BMDISPLAYEI_IDL +#define CIAO_BMDISPLAYEI_IDL + +#include "BMDisplayE.idl" + +module BasicSP +{ + /** + * @interface BMDisplay_Exec + * + * The actually BMDisplay executor inherits from both CCM_BMDisplay + * and session_component interfaces as a monolithic implementation. + */ + local interface BMDisplay_Exec : + CCM_BMDisplay, + Components::SessionComponent + { + }; + +}; + +#endif /* CIAO_BMDISPLAYEI_IDL */ diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp new file mode 100644 index 00000000000..227c26b41a4 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.cpp @@ -0,0 +1,154 @@ +// $Id$ + +#include "ciao/CIAO_common.h" +#include "BMDisplay_exec.h" + +/// Default constructor. +MyImpl::BMDisplay_exec_impl::BMDisplay_exec_impl () +{ +} + +/// Default destructor. +MyImpl::BMDisplay_exec_impl::~BMDisplay_exec_impl () +{ +} + +// Operations from BasicSP::BMDisplay + +void +MyImpl::BMDisplay_exec_impl::push_data_ready ( + BasicSP::DataAvailable *ev + ) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_UNUSED_ARG (ev); + + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "BMDisplay - Doing computations \n")); + + ACE_DEBUG ((LM_DEBUG, + "BMDisplay - Doing data fetch \n")); + } + + // Refresh position + BasicSP::ReadData_var dat + = this->context_->get_connection_comp_data (); + + if (CORBA::is_nil (dat.in ())) + throw CORBA::BAD_INV_ORDER (); + + CORBA::String_var str = + dat->get_data (); + + ACE_DEBUG ((LM_DEBUG, + "BMDisplay - Display data is [%s] \n", + str.in ())); + +} + +// Operations from Components::SessionComponent +void +MyImpl::BMDisplay_exec_impl::set_session_context ( + Components::SessionContext_ptr ctx + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDisplay_exec_impl::set_session_context\n")); + } + + this->context_ = + BasicSP::CCM_BMDisplay_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + throw CORBA::INTERNAL (); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMDisplay_exec_impl::ciao_preactivate ( + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMDisplay_exec_impl::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDisplay_exec_impl::ccm_activate\n")); + } + +} + +void +MyImpl::BMDisplay_exec_impl::ciao_postactivate ( + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::BMDisplay_exec_impl::ccm_passivate ( + ) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDisplay_exec_impl::ccm_passivate\n")); + } +} + +void +MyImpl::BMDisplay_exec_impl::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + { + ACE_DEBUG ((LM_DEBUG, + "MyImpl::BMDisplay_exec_impl::ccm_remove\n")); + } +} + +/// Default ctor. +MyImpl::BMDisplayHome_exec_impl::BMDisplayHome_exec_impl () +{ +} + +/// Default dtor. +MyImpl::BMDisplayHome_exec_impl::~BMDisplayHome_exec_impl () +{ +} + +// Explicit home operations. + +// Implicit home operations. + +::Components::EnterpriseComponent_ptr +MyImpl::BMDisplayHome_exec_impl::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::BMDisplay_exec_impl; +} + + +extern "C" BMDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMDisplayHome_Impl (void) +{ + return new MyImpl::BMDisplayHome_exec_impl; +} diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h new file mode 100644 index 00000000000..4d1f1e9e1a0 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec.h @@ -0,0 +1,111 @@ +// $Id$ + +//============================================================== +/** + * @file BMDisplay_exec.h + * + * Header file for the actual BMDisplay and BMDisplayHome component + * implementations. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================== +#ifndef CIAO_BMDISPLAY_EXEC_H +#define CIAO_BMDISPLAY_EXEC_H + +#include "BMDisplayEIC.h" +#include "tao/LocalObject.h" +#include "BMDisplay_exec_export.h" + +namespace MyImpl +{ + /** + * @class BMDisplay_exec_impl + * + * RateGen executor implementation class. + */ + class BMDISPLAY_EXEC_Export BMDisplay_exec_impl : + public virtual BasicSP::BMDisplay_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + BMDisplay_exec_impl (); + + /// Default destructor. + ~BMDisplay_exec_impl (); + + // Operations from BasicSP::BMDisplay + + virtual void + push_data_ready (BasicSP::DataAvailable *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 + ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ciao_postactivate () + 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: + /// Copmponent specific context + BasicSP::CCM_BMDisplay_Context_var context_; + }; + + /** + * @class BMDisplayHome_exec_impl + * + * BMDisplay home executor implementation class. + */ + class BMDISPLAY_EXEC_Export BMDisplayHome_exec_impl : + public virtual BasicSP::CCM_BMDisplayHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + BMDisplayHome_exec_impl (); + + /// Default dtor. + ~BMDisplayHome_exec_impl (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +extern "C" BMDISPLAY_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMDisplayHome_Impl (void); + +#endif /* BMDISPLAY_EXEC_H */ diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec_export.h b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec_export.h new file mode 100644 index 00000000000..f3c4fb92151 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDISPLAY_EXEC +// ------------------------------ +#ifndef BMDISPLAY_EXEC_EXPORT_H +#define BMDISPLAY_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDISPLAY_EXEC_HAS_DLL) +# define BMDISPLAY_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDISPLAY_EXEC_HAS_DLL */ + +#if !defined (BMDISPLAY_EXEC_HAS_DLL) +# define BMDISPLAY_EXEC_HAS_DLL 1 +#endif /* ! BMDISPLAY_EXEC_HAS_DLL */ + +#if defined (BMDISPLAY_EXEC_HAS_DLL) && (BMDISPLAY_EXEC_HAS_DLL == 1) +# if defined (BMDISPLAY_EXEC_BUILD_DLL) +# define BMDISPLAY_EXEC_Export ACE_Proper_Export_Flag +# define BMDISPLAY_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDISPLAY_EXEC_BUILD_DLL */ +# define BMDISPLAY_EXEC_Export ACE_Proper_Import_Flag +# define BMDISPLAY_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDISPLAY_EXEC_BUILD_DLL */ +#else /* BMDISPLAY_EXEC_HAS_DLL == 1 */ +# define BMDISPLAY_EXEC_Export +# define BMDISPLAY_EXEC_SINGLETON_DECLARATION(T) +# define BMDISPLAY_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDISPLAY_EXEC_HAS_DLL == 1 */ + +// Set BMDISPLAY_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDISPLAY_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDISPLAY_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDISPLAY_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDISPLAY_EXEC_NTRACE */ + +#if (BMDISPLAY_EXEC_NTRACE == 1) +# define BMDISPLAY_EXEC_TRACE(X) +#else /* (BMDISPLAY_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDISPLAY_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDISPLAY_EXEC_NTRACE == 1) */ + +#endif /* BMDISPLAY_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_stub_export.h b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_stub_export.h new file mode 100644 index 00000000000..4fe787f0b9c --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDISPLAY_STUB +// ------------------------------ +#ifndef BMDISPLAY_STUB_EXPORT_H +#define BMDISPLAY_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDISPLAY_STUB_HAS_DLL) +# define BMDISPLAY_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDISPLAY_STUB_HAS_DLL */ + +#if !defined (BMDISPLAY_STUB_HAS_DLL) +# define BMDISPLAY_STUB_HAS_DLL 1 +#endif /* ! BMDISPLAY_STUB_HAS_DLL */ + +#if defined (BMDISPLAY_STUB_HAS_DLL) && (BMDISPLAY_STUB_HAS_DLL == 1) +# if defined (BMDISPLAY_STUB_BUILD_DLL) +# define BMDISPLAY_STUB_Export ACE_Proper_Export_Flag +# define BMDISPLAY_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDISPLAY_STUB_BUILD_DLL */ +# define BMDISPLAY_STUB_Export ACE_Proper_Import_Flag +# define BMDISPLAY_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDISPLAY_STUB_BUILD_DLL */ +#else /* BMDISPLAY_STUB_HAS_DLL == 1 */ +# define BMDISPLAY_STUB_Export +# define BMDISPLAY_STUB_SINGLETON_DECLARATION(T) +# define BMDISPLAY_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDISPLAY_STUB_HAS_DLL == 1 */ + +// Set BMDISPLAY_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDISPLAY_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDISPLAY_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDISPLAY_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDISPLAY_STUB_NTRACE */ + +#if (BMDISPLAY_STUB_NTRACE == 1) +# define BMDISPLAY_STUB_TRACE(X) +#else /* (BMDISPLAY_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDISPLAY_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDISPLAY_STUB_NTRACE == 1) */ + +#endif /* BMDISPLAY_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_svnt_export.h b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_svnt_export.h new file mode 100644 index 00000000000..b80de58508a --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BMDisplay/BMDisplay_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BMDISPLAY_SVNT +// ------------------------------ +#ifndef BMDISPLAY_SVNT_EXPORT_H +#define BMDISPLAY_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BMDISPLAY_SVNT_HAS_DLL) +# define BMDISPLAY_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BMDISPLAY_SVNT_HAS_DLL */ + +#if !defined (BMDISPLAY_SVNT_HAS_DLL) +# define BMDISPLAY_SVNT_HAS_DLL 1 +#endif /* ! BMDISPLAY_SVNT_HAS_DLL */ + +#if defined (BMDISPLAY_SVNT_HAS_DLL) && (BMDISPLAY_SVNT_HAS_DLL == 1) +# if defined (BMDISPLAY_SVNT_BUILD_DLL) +# define BMDISPLAY_SVNT_Export ACE_Proper_Export_Flag +# define BMDISPLAY_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BMDISPLAY_SVNT_BUILD_DLL */ +# define BMDISPLAY_SVNT_Export ACE_Proper_Import_Flag +# define BMDISPLAY_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BMDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BMDISPLAY_SVNT_BUILD_DLL */ +#else /* BMDISPLAY_SVNT_HAS_DLL == 1 */ +# define BMDISPLAY_SVNT_Export +# define BMDISPLAY_SVNT_SINGLETON_DECLARATION(T) +# define BMDISPLAY_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BMDISPLAY_SVNT_HAS_DLL == 1 */ + +// Set BMDISPLAY_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BMDISPLAY_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define BMDISPLAY_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BMDISPLAY_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BMDISPLAY_SVNT_NTRACE */ + +#if (BMDISPLAY_SVNT_NTRACE == 1) +# define BMDISPLAY_SVNT_TRACE(X) +#else /* (BMDISPLAY_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BMDISPLAY_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BMDISPLAY_SVNT_NTRACE == 1) */ + +#endif /* BMDISPLAY_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BasicSP.idl b/modules/CIAO/examples/BasicSP/BasicSP.idl new file mode 100644 index 00000000000..e8e0bf2ae2a --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BasicSP.idl @@ -0,0 +1,47 @@ +// $Id$ +//============================================================================= +/** + * @file BasicSP.idl + * + * Definition of events, and common interfaces used in the BasicSP module. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_BASIC_SP_IDL +#define CIAO_BASIC_SP_IDL + +#include <Components.idl> + +// @@NOTE: Do we need a pragma prefix. Anyway its broken now in TAO.. +// #pragma prefix "" + +module BasicSP +{ + + /** + * @NOTE: Not sure whether this is a good abstraction. Just copying + * the stuff from Cadena folks. + */ + /** + * @interface ReadData + * + */ + + interface ReadData { + string get_data (); + }; + + /** + * @eventtype Events that represent timeouts + */ + eventtype TimeOut {}; + + /** + * @eventtype Events that represent data availability + */ + eventtype DataAvailable {}; +}; + +#endif /*CIAO_BASIC_SP_IDL*/ diff --git a/modules/CIAO/examples/BasicSP/BasicSP.mpc b/modules/CIAO/examples/BasicSP/BasicSP.mpc new file mode 100644 index 00000000000..20f682a413b --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BasicSP.mpc @@ -0,0 +1,30 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -n HUDisplay" + +project(BasicSP_DnC_stub): ciao_client_dnc { + + sharedname = BasicSP_stub + idlflags += -Wb,stub_export_macro=BASICSP_STUB_Export -Wb,stub_export_include=BasicSP_stub_export.h -Wb,skel_export_macro=BASICSP_SVNT_Export -Wb,skel_export_include=BasicSP_svnt_export.h + dynamicflags = BASICSP_STUB_BUILD_DLL + + IDL_Files { + BasicSP.idl + } + + Source_Files { + BasicSPC.cpp + } +} + +project(BasicSP_DnC_svnt) : ciao_servant_dnc { + after += BasicSP_DnC_stub + sharedname = BasicSP_svnt + libs += BasicSP_stub + + idlflags += -Wb,stub_export_macro=BASICSP_STUB_Export -Wb,stub_export_include=BasicSP_stub_export.h -Wb,skel_export_macro=BASICSP_SVNT_Export -Wb,skel_export_include=BasicSP_svnt_export.h + dynamicflags = BASICSP_SVNT_BUILD_DLL + + Source_Files { + BasicSPS.cpp + } +} diff --git a/modules/CIAO/examples/BasicSP/BasicSP_stub_export.h b/modules/CIAO/examples/BasicSP/BasicSP_stub_export.h new file mode 100644 index 00000000000..60b990512f6 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BasicSP_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BASICSP_STUB +// ------------------------------ +#ifndef BASICSP_STUB_EXPORT_H +#define BASICSP_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BASICSP_STUB_HAS_DLL) +# define BASICSP_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BASICSP_STUB_HAS_DLL */ + +#if !defined (BASICSP_STUB_HAS_DLL) +# define BASICSP_STUB_HAS_DLL 1 +#endif /* ! BASICSP_STUB_HAS_DLL */ + +#if defined (BASICSP_STUB_HAS_DLL) && (BASICSP_STUB_HAS_DLL == 1) +# if defined (BASICSP_STUB_BUILD_DLL) +# define BASICSP_STUB_Export ACE_Proper_Export_Flag +# define BASICSP_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BASICSP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BASICSP_STUB_BUILD_DLL */ +# define BASICSP_STUB_Export ACE_Proper_Import_Flag +# define BASICSP_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BASICSP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BASICSP_STUB_BUILD_DLL */ +#else /* BASICSP_STUB_HAS_DLL == 1 */ +# define BASICSP_STUB_Export +# define BASICSP_STUB_SINGLETON_DECLARATION(T) +# define BASICSP_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BASICSP_STUB_HAS_DLL == 1 */ + +// Set BASICSP_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BASICSP_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define BASICSP_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BASICSP_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BASICSP_STUB_NTRACE */ + +#if (BASICSP_STUB_NTRACE == 1) +# define BASICSP_STUB_TRACE(X) +#else /* (BASICSP_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BASICSP_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BASICSP_STUB_NTRACE == 1) */ + +#endif /* BASICSP_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/BasicSP_svnt_export.h b/modules/CIAO/examples/BasicSP/BasicSP_svnt_export.h new file mode 100644 index 00000000000..d031453f444 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/BasicSP_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s BASICSP_SVNT +// ------------------------------ +#ifndef BASICSP_SVNT_EXPORT_H +#define BASICSP_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (BASICSP_SVNT_HAS_DLL) +# define BASICSP_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && BASICSP_SVNT_HAS_DLL */ + +#if !defined (BASICSP_SVNT_HAS_DLL) +# define BASICSP_SVNT_HAS_DLL 1 +#endif /* ! BASICSP_SVNT_HAS_DLL */ + +#if defined (BASICSP_SVNT_HAS_DLL) && (BASICSP_SVNT_HAS_DLL == 1) +# if defined (BASICSP_SVNT_BUILD_DLL) +# define BASICSP_SVNT_Export ACE_Proper_Export_Flag +# define BASICSP_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define BASICSP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* BASICSP_SVNT_BUILD_DLL */ +# define BASICSP_SVNT_Export ACE_Proper_Import_Flag +# define BASICSP_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define BASICSP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* BASICSP_SVNT_BUILD_DLL */ +#else /* BASICSP_SVNT_HAS_DLL == 1 */ +# define BASICSP_SVNT_Export +# define BASICSP_SVNT_SINGLETON_DECLARATION(T) +# define BASICSP_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* BASICSP_SVNT_HAS_DLL == 1 */ + +// Set BASICSP_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (BASICSP_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define BASICSP_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define BASICSP_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !BASICSP_SVNT_NTRACE */ + +#if (BASICSP_SVNT_NTRACE == 1) +# define BASICSP_SVNT_TRACE(X) +#else /* (BASICSP_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define BASICSP_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (BASICSP_SVNT_NTRACE == 1) */ + +#endif /* BASICSP_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/EC/EC.cidl b/modules/CIAO/examples/BasicSP/EC/EC.cidl new file mode 100644 index 00000000000..8e9ff0d5575 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC.cidl @@ -0,0 +1,21 @@ +//$Id$ + +#ifndef EC_CIDL +#define EC_CIDL + +#include "EC.idl" + +composition session EC_Impl +{ + home executor ECHome_Exec + { + implements BasicSP::ECHome; + manages EC_Exec; + }; +}; + +#endif /* EC_CIDL */ + + + + diff --git a/modules/CIAO/examples/BasicSP/EC/EC.idl b/modules/CIAO/examples/BasicSP/EC/EC.idl new file mode 100644 index 00000000000..50ad25afd7f --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC.idl @@ -0,0 +1,41 @@ +// $Id$ +//============================================================================= +/** + * @file EC.idl + * + * Definition of events, and common interfaces used in the BasicSP module. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef CIAO_EC_IDL +#define CIAO_EC_IDL + +#include "../BasicSP.idl" + +module BasicSP +{ + interface trigger + { + void start (); + void stop (); + }; + component EC supports trigger + { + publishes TimeOut timeout; + + /// The attribute can be configured via the home or the + /// component property file. + attribute long hertz; + + }; + + home ECHome manages EC + { + // Explicit operations + factory new_EC (in long hertz); + }; +}; + +#endif /* CIAO_EC_IDL*/ diff --git a/modules/CIAO/examples/BasicSP/EC/EC.mpc b/modules/CIAO/examples/BasicSP/EC/EC.mpc new file mode 100644 index 00000000000..d1068ec6e28 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC.mpc @@ -0,0 +1,113 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p BasicSP -i -c EC" + +project(EC_DnC_stub): ciao_client_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_stub + + sharedname = EC_stub + + idlflags += -Wb,stub_export_macro=EC_STUB_Export + idlflags += -Wb,stub_export_include=EC_stub_export.h + idlflags += -Wb,skel_export_macro=EC_SVNT_Export + idlflags += -Wb,skel_export_include=EC_svnt_export.h + + dynamicflags = EC_STUB_BUILD_DLL + + libs += BasicSP_stub + + IDL_Files { + EC.idl + } + + Source_Files { + ECC.cpp + } +} + +project(EC_DnC_svnt) : ciao_servant_dnc { + avoids += ace_for_tao + after += BasicSP_DnC_svnt EC_DnC_stub + sharedname = EC_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=EC_SVNT_Export + idlflags += -Wb,export_include=EC_svnt_export.h + + dynamicflags = EC_SVNT_BUILD_DLL + + libs += EC_stub BasicSP_stub BasicSP_svnt + + CIDL_Files { + EC.cidl + } + + IDL_Files { + ECE.idl + } + + Source_Files { + ECEC.cpp + ECS.cpp + EC_svnt.cpp + } +} + + +project(EC_DnC_exec) : ciao_component_dnc { + avoids += ace_for_tao + after += EC_DnC_svnt + sharedname = EC_exec + + libs += EC_stub BasicSP_stub BasicSP_svnt EC_svnt + + libpaths += .. + + idlflags += -Wb,export_macro=EC_EXEC_Export + idlflags += -Wb,export_include=EC_exec_export.h + + dynamicflags = EC_EXEC_BUILD_DLL + + IDL_Files { + ECEI.idl + } + + Source_Files { + ECEIC.cpp + EC_exec.cpp + } +} + + + +project (EC_DnC_client) : ciao_client_dnc, valuetype { + avoids += ace_for_tao + exename = client + after += EC_DnC_stub + libs += EC_stub BasicSP_stub + libpaths += .. + + IDL_Files { + } + + Source_Files { + client.cpp + } +} + + +project (EC_DnC_controller) : ciao_events_dnc, valuetype { + avoids += ace_for_tao + exename = controller + after += EC_DnC_stub + libs += EC_stub BasicSP_stub + libpaths += .. + + IDL_Files { + } + + Source_Files { + controller.cpp + } +} diff --git a/modules/CIAO/examples/BasicSP/EC/ECEI.idl b/modules/CIAO/examples/BasicSP/EC/ECEI.idl new file mode 100644 index 00000000000..9b48d5c74dd --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/ECEI.idl @@ -0,0 +1,32 @@ +// $Id$ + +//============================================================================= +/** + * @file ECEI.idl + * + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================================= +#ifndef CIAO_ECEI_IDL +#define CIAO_ECEI_IDL + +#include "ECE.idl" + +module BasicSP +{ + /** + * @interface EC_Exec + * + * The actually EC executor need to support + * Components::SessionComponent interface. Therefore, we need to + * define the component executor interface explicitly here. + */ + local interface EC_Exec : CCM_EC, + Components::SessionComponent + { + }; + +}; + +#endif /* RATEGENEI_IDL */ diff --git a/modules/CIAO/examples/BasicSP/EC/EC_exec.cpp b/modules/CIAO/examples/BasicSP/EC/EC_exec.cpp new file mode 100644 index 00000000000..89a3a57edfd --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC_exec.cpp @@ -0,0 +1,293 @@ +// $Id$ + +#include "EC_exec.h" +#include "CIAO_common.h" +#include "ace/Timer_Queue.h" +#include "ace/Reactor.h" + +//================================================================= + +MyImpl::timeout_Handler::timeout_Handler (MyImpl::EC_exec_i *cb) + : active_ (0), + done_ (0), + tid_ (0), + pulse_callback_ (cb) +{ + // Nothing + this->reactor (new ACE_Reactor); +} + +MyImpl::timeout_Handler::~timeout_Handler () +{ + delete this->reactor (); + this->reactor (0); +} + +int +MyImpl::timeout_Handler::open_h () +{ + return this->activate (); +} + +int +MyImpl::timeout_Handler::close_h () +{ + this->done_ = 1; + this->reactor ()->notify (); + + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "Waiting\n")); + return this->wait (); +} + +int +MyImpl::timeout_Handler::start (CORBA::Long hertz) +{ + if (hertz == 0 || this->active_ != 0) // Not valid + return -1; + + long usec = 1000000 / hertz; + + this->tid_ = this->reactor ()->schedule_timer (this, + 0, + ACE_Time_Value (0, usec), + ACE_Time_Value (0, usec)); + + this->active_ = 1; + return 0; +} + +int +MyImpl::timeout_Handler::stop (void) +{ + if (this->active_ == 0) // Not valid. + return -1; + + this->reactor ()->cancel_timer (this); + + this->active_ = 0; + return 0; +} + +int +MyImpl::timeout_Handler::active (void) +{ + return this->active_; +} + +int +MyImpl::timeout_Handler::handle_close (ACE_HANDLE handle, + ACE_Reactor_Mask close_mask) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("[%x] handle = %d, close_mask = %d\n"), + this, + handle, + close_mask)); + + return 0; +} + +int +MyImpl::timeout_Handler::handle_timeout (const ACE_Time_Value &, + const void *) +{ + this->pulse_callback_->pulse (); + +// ACE_DEBUG ((LM_DEBUG, +// ACE_TEXT ("[%x] with count #%05d timed out at %d.%d!\n"), +// this, +// tv.sec (), +// tv.usec ())); + + return 0; +} + +int +MyImpl::timeout_Handler::svc (void) +{ + this->reactor ()->owner (ACE_OS::thr_self ()); + + while (!this->done_) + this->reactor ()->handle_events (); + + return 0; +} + +//================================================================= + +MyImpl::EC_exec_i::EC_exec_i () + : hertz_ (0), + pulser_ (this) +{ + +} + +MyImpl::EC_exec_i::EC_exec_i (CORBA::Long hz) + : hertz_ (hz), + pulser_ (this) +{ +} + +MyImpl::EC_exec_i::~EC_exec_i () +{ +} + +CORBA::Long +MyImpl::EC_exec_i::hertz () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->hertz_; +} + +void +MyImpl::EC_exec_i::hertz (CORBA::Long hertz) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->hertz_ = hertz; +} + +// Operations from supported interface(s) + +void +MyImpl::EC_exec_i::start () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (this->hertz_ == 0 || this->pulser_.active()) + throw CORBA::BAD_INV_ORDER (); + + // @@ Start the rate generator + this->pulser_.start (this->hertz_); +} + +void +MyImpl::EC_exec_i::stop () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (! this->pulser_.active ()) + throw CORBA::BAD_INV_ORDER (); + + // @@ stop the rate generator + this->pulser_.stop (); +} + +CORBA::Boolean +MyImpl::EC_exec_i::active () + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->pulser_.active (); +} + +// Operations from Components::SessionComponent + +void +MyImpl::EC_exec_i::set_session_context (Components::SessionContext_ptr ctx) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::set_session_context\n")); + + this->context_ = + BasicSP::CCM_EC_Context::_narrow (ctx); + + if (CORBA::is_nil (this->context_.in ())) + throw CORBA::INTERNAL (); + // Urm, we actually discard exceptions thown from this operation. + +} + +void +MyImpl::EC_exec_i::ciao_preactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::EC_exec_i::ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_activate\n")); + + this->pulser_.open_h (); +} + +void +MyImpl::EC_exec_i::ciao_postactivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ +} + +void +MyImpl::EC_exec_i::ccm_passivate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_passivate\n")); + this->pulser_.close_h (); +} + +void +MyImpl::EC_exec_i::ccm_remove () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_remove\n")); +} + +void +MyImpl::EC_exec_i::pulse (void) +{ + try + { + if (CIAO::debug_level () > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Pushing BasicSP::TimeOut event!\n"))); + + BasicSP::TimeOut_var ev = new OBV_BasicSP::TimeOut (); + + this->context_->push_timeout (ev.in ()); + } + catch (const CORBA::Exception&) + { + // @@ do nothing? + } + +} + +MyImpl::ECHome_exec_i::ECHome_exec_i () +{ +} + +MyImpl::ECHome_exec_i::~ECHome_exec_i () +{ +} + +::Components::EnterpriseComponent_ptr +MyImpl::ECHome_exec_i::new_EC (CORBA::Long hertz) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return new MyImpl::EC_exec_i (hertz); +} + +::Components::EnterpriseComponent_ptr +MyImpl::ECHome_exec_i::create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::EC_exec_i (); +} + + +extern "C" EC_EXEC_Export ::Components::HomeExecutorBase_ptr +createECHome_Impl (void) +{ + return new MyImpl::ECHome_exec_i (); +} diff --git a/modules/CIAO/examples/BasicSP/EC/EC_exec.h b/modules/CIAO/examples/BasicSP/EC/EC_exec.h new file mode 100644 index 00000000000..dfc68f19dce --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC_exec.h @@ -0,0 +1,187 @@ +// $Id$ + +//============================================================ +/** + * @file EC_exec.h + * + * Header file for the actualy EC and ECHome component + * implementation. + * + * @author Balachandran Natarajan <bala@dre.vanderbilt.edu> + */ +//============================================================ + +#ifndef EC_EXEC_H +#define EC_EXEC_H + +#include "ECEIC.h" +#include "tao/LocalObject.h" +#include "ace/Thread_Manager.h" +#include "ace/Task.h" + +namespace MyImpl +{ + // Forward decl. + class EC_exec_i; + + /** + * @brief Active pulse generater + */ + class timeout_Handler : public ACE_Task_Base + { + public: + // Default constructor + timeout_Handler (EC_exec_i *cb); + ~timeout_Handler (); + + int open_h (void); + + int close_h (void); + + int start (CORBA::Long hertz); + + int stop (void); + + int active (void); + + // Handle the timeout. + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + + // Called when <Time_Handler> is removed. + virtual int handle_close (ACE_HANDLE handle, + ACE_Reactor_Mask close_mask); + + virtual int svc (void); + + private: + /// Tracking whether we are actively generating pulse or not. + long active_; + + /// Flag to indicate completion of this active object. + int done_; + + /// The timer id we are waiting. + long tid_; + + EC_exec_i *pulse_callback_; + + ACE_Thread_Manager thr_mgr_; + }; + + /** + * @class EC_exec_i + * + * EC executor implementation class. + */ + class EC_EXEC_Export EC_exec_i : + public virtual BasicSP::EC_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + EC_exec_i (); + + /// Initialize with a default frequency. + EC_exec_i (CORBA::Long hz); + + /// Default destructor. + ~EC_exec_i (); + + // Attribute operations. + + virtual CORBA::Long hertz () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void hertz (CORBA::Long hertz) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from supported interface(s) + + virtual void start () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void stop () + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean active () + 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 ccm_activate () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ciao_postactivate () + 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)); + + /// Helper function to be called back by timeout_Handler + void pulse (void); + + protected: + /// Frequency + CORBA::Long hertz_; + + /// Copmponent specific context + BasicSP::CCM_EC_Context_var context_; + + /// An active object that actually trigger the generation of + /// periodic events. + timeout_Handler pulser_; + }; + + /** + * @class ECHome_exec_i + * + * EC home executor implementation class. + */ + class EC_EXEC_Export ECHome_exec_i : + public virtual BasicSP::CCM_ECHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + ECHome_exec_i (); + + /// Default dtor. + ~ECHome_exec_i (); + + // Explicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + new_EC (CORBA::Long hertz) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create () + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + +} + +extern "C" EC_EXEC_Export ::Components::HomeExecutorBase_ptr +createECHome_Impl (void); + +#endif /* CIAO_ECGEN_EXEC_H */ diff --git a/modules/CIAO/examples/BasicSP/EC/EC_exec_export.h b/modules/CIAO/examples/BasicSP/EC/EC_exec_export.h new file mode 100644 index 00000000000..6a2d911d430 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC_exec_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s EC_EXEC +// ------------------------------ +#ifndef EC_EXEC_EXPORT_H +#define EC_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_EXEC_HAS_DLL) +# define EC_EXEC_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && EC_EXEC_HAS_DLL */ + +#if !defined (EC_EXEC_HAS_DLL) +# define EC_EXEC_HAS_DLL 1 +#endif /* ! EC_EXEC_HAS_DLL */ + +#if defined (EC_EXEC_HAS_DLL) && (EC_EXEC_HAS_DLL == 1) +# if defined (EC_EXEC_BUILD_DLL) +# define EC_EXEC_Export ACE_Proper_Export_Flag +# define EC_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* EC_EXEC_BUILD_DLL */ +# define EC_EXEC_Export ACE_Proper_Import_Flag +# define EC_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* EC_EXEC_BUILD_DLL */ +#else /* EC_EXEC_HAS_DLL == 1 */ +# define EC_EXEC_Export +# define EC_EXEC_SINGLETON_DECLARATION(T) +# define EC_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* EC_EXEC_HAS_DLL == 1 */ + +// Set EC_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (EC_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define EC_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define EC_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !EC_EXEC_NTRACE */ + +#if (EC_EXEC_NTRACE == 1) +# define EC_EXEC_TRACE(X) +#else /* (EC_EXEC_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define EC_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (EC_EXEC_NTRACE == 1) */ + +#endif /* EC_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/EC/EC_stub_export.h b/modules/CIAO/examples/BasicSP/EC/EC_stub_export.h new file mode 100644 index 00000000000..cce0970deae --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC_stub_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s EC_STUB +// ------------------------------ +#ifndef EC_STUB_EXPORT_H +#define EC_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_STUB_HAS_DLL) +# define EC_STUB_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && EC_STUB_HAS_DLL */ + +#if !defined (EC_STUB_HAS_DLL) +# define EC_STUB_HAS_DLL 1 +#endif /* ! EC_STUB_HAS_DLL */ + +#if defined (EC_STUB_HAS_DLL) && (EC_STUB_HAS_DLL == 1) +# if defined (EC_STUB_BUILD_DLL) +# define EC_STUB_Export ACE_Proper_Export_Flag +# define EC_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* EC_STUB_BUILD_DLL */ +# define EC_STUB_Export ACE_Proper_Import_Flag +# define EC_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* EC_STUB_BUILD_DLL */ +#else /* EC_STUB_HAS_DLL == 1 */ +# define EC_STUB_Export +# define EC_STUB_SINGLETON_DECLARATION(T) +# define EC_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* EC_STUB_HAS_DLL == 1 */ + +// Set EC_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (EC_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define EC_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define EC_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !EC_STUB_NTRACE */ + +#if (EC_STUB_NTRACE == 1) +# define EC_STUB_TRACE(X) +#else /* (EC_STUB_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define EC_STUB_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (EC_STUB_NTRACE == 1) */ + +#endif /* EC_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/EC/EC_svnt_export.h b/modules/CIAO/examples/BasicSP/EC/EC_svnt_export.h new file mode 100644 index 00000000000..90bc3cf9f4a --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/EC_svnt_export.h @@ -0,0 +1,58 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl -s EC_SVNT +// ------------------------------ +#ifndef EC_SVNT_EXPORT_H +#define EC_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (EC_SVNT_HAS_DLL) +# define EC_SVNT_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && EC_SVNT_HAS_DLL */ + +#if !defined (EC_SVNT_HAS_DLL) +# define EC_SVNT_HAS_DLL 1 +#endif /* ! EC_SVNT_HAS_DLL */ + +#if defined (EC_SVNT_HAS_DLL) && (EC_SVNT_HAS_DLL == 1) +# if defined (EC_SVNT_BUILD_DLL) +# define EC_SVNT_Export ACE_Proper_Export_Flag +# define EC_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* EC_SVNT_BUILD_DLL */ +# define EC_SVNT_Export ACE_Proper_Import_Flag +# define EC_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* EC_SVNT_BUILD_DLL */ +#else /* EC_SVNT_HAS_DLL == 1 */ +# define EC_SVNT_Export +# define EC_SVNT_SINGLETON_DECLARATION(T) +# define EC_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* EC_SVNT_HAS_DLL == 1 */ + +// Set EC_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (EC_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define EC_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define EC_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !EC_SVNT_NTRACE */ + +#if (EC_SVNT_NTRACE == 1) +# define EC_SVNT_TRACE(X) +#else /* (EC_SVNT_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define EC_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (EC_SVNT_NTRACE == 1) */ + +#endif /* EC_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/modules/CIAO/examples/BasicSP/EC/README b/modules/CIAO/examples/BasicSP/EC/README new file mode 100644 index 00000000000..7e032780ab1 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/README @@ -0,0 +1,9 @@ +/** + +@page EC README File + + The EC component. This shouldnt be needed if we had a way to +integrate EC sugly into CIAO. We dont at the time of writing this +example on May 12, 2003. Hence this holy hack! + +*/ diff --git a/modules/CIAO/examples/BasicSP/EC/client.cpp b/modules/CIAO/examples/BasicSP/EC/client.cpp new file mode 100644 index 00000000000..62354cbe814 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/client.cpp @@ -0,0 +1,62 @@ +// $Id$ + +//============================================================== +/** + * @file client.cpp + * + * This is a simple client test program that interact with the EC + * component implementation. This test uses the explicit factory + * operation in the home interface to create a EC component + * instance, run it for a while, and destroy the component instance. + */ +//============================================================== + +#include "ECC.h" +#include "ace/streams.h" +#include "ace/OS_NS_unistd.h" + +int +main (int argc, char *argv[]) +{ + try + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ""); + + // Resolve HomeFinder interface + + CORBA::Object_var obj + = orb->string_to_object ("file://ec.ior"); + + BasicSP::ECHome_var home + = BasicSP::ECHome::_narrow (obj.in ()); + + if (CORBA::is_nil (home.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire ECHome objref\n"), -1); + + BasicSP::EC_var pulser + = home->create (); + + // Place to plug in the rate + pulser->hertz (5); + + pulser->start (); + + ACE_OS::sleep (45); + + pulser->stop (); + + home->remove_component (pulser.in ()); + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Who is the culprit \n"); + ACE_ERROR_RETURN ((LM_ERROR, + "Uncaught CORBA exception\n"), + 1); + } + + return 0; +} diff --git a/modules/CIAO/examples/BasicSP/EC/controller.cpp b/modules/CIAO/examples/BasicSP/EC/controller.cpp new file mode 100644 index 00000000000..13a5fd6d81e --- /dev/null +++ b/modules/CIAO/examples/BasicSP/EC/controller.cpp @@ -0,0 +1,128 @@ +// $Id$ + +/** + * @file controller.cpp + * + * This program interact with a EC component, and set the rate of the + * EC. + */ + +#include "ECC.h" +#include "ace/Get_Opt.h" +#include "ace/streams.h" + +const char *rategen_ior_ = 0; +int rate = 2; +int turn_on = 1; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:r:of"); + int c; + + while ((c = get_opts ()) != -1) + { + switch (c) + { + case 'o': + turn_on = 1; + break; + + case 'f': + turn_on = 0; + break; + + case 'k': + rategen_ior_ = get_opts.opt_arg (); + break; + + case 'r': + rate = ACE_OS::atoi (get_opts.opt_arg ()); + break; + + case '?': // display help for use of the server. + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s\n" + "-o (Turn on the rate generator)\n" + "-f (Turn off the rate generator)\n" + "-k <EC IOR> (default is file://rategen.ior)\n" + "-r <rate in hertz> (default is 3)\n" + "\n", + argv [0]), + -1); + break; + } + } + + if (rategen_ior_ == 0) + { + rategen_ior_ = "file://ec.ior"; + } + + if (rate == 0) + { + rate = 3; + } + + return 0; +} + +int +main (int argc, char *argv[]) +{ + try + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + ""); + + if (parse_args (argc, argv) != 0) + { + return -1; + } + + CORBA::Object_var obj = + orb->string_to_object (rategen_ior_); + + BasicSP::EC_var pulser + = BasicSP::EC::_narrow (obj.in ()); + + if (CORBA::is_nil (pulser.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to acquire 'EC' objref\n"), + -1); + } + + pulser->hertz (rate); + + if (turn_on) + { + pulser->hertz (rate); + + ACE_DEBUG ((LM_DEBUG, "Start up the Event services\n")); + + pulser->start (); + } + else + { + pulser->stop (); + + ACE_DEBUG ((LM_DEBUG, "Stop the ES\n")); + } + + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Who is the culprit \n"); + ACE_ERROR_RETURN ((LM_ERROR, + "Uncaught CORBA exception\n"), + 1); + } + + return 0; +} diff --git a/modules/CIAO/examples/BasicSP/README.html b/modules/CIAO/examples/BasicSP/README.html new file mode 100644 index 00000000000..9bd740215e1 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/README.html @@ -0,0 +1,70 @@ +<HTML> +<!-- $Id$ --> +<BODY> + +This document describes how to compile/run the BasicSP (HUDisplay) example with the new DnC implementation. + +<H3> Installing </H3> + +<UL> + <LI> Make sure you have the latest DAnCE framework built. + </LI> + + <LI> + Get the latest cidl compiler (if you did not compile from source) from: + <A href="http://www.dre.vanderbilt.edu/cidlc/binary/"> + http://www.dre.vanderbilt.edu/cidlc/binary/ + </A> + + Copy the file into the <code> $CIAO_ROOT/bin </code> directory. + Build ACE, TAO, DAnCE before you proceed. + + <br><br> + <em>NOTE</em>: <br> + While buiding DAnCE, we also suggest that you build the tests in the $CIAO_ROOT/test directory and make sure + all the tests run OK before you proceed to try out the BasicSP example or any other DAnCE-based + applications. To do this, open the file + + $ACE_ROOT/bin/MakeProjectCreator/config/global.features, + + then change the line from "cidl = 0" to "cidl = 1". <br><br> + + After this, go back to the $CIAO_ROOT/DAnCE directory to generate your workspace/project or makefile by using MPC.<br> + After the DAnCE and the tests are build OK, go to the $CIAO_ROOT/DAnCE/tests/NodeApplicationTest directory and make + sure all the three perl scripts (run_test.pl, run_test_simple.pl and run_test_ex.pl) run successfully. + + <br><br> + </LI> + + <LI> Generate the project/make files for the <em> BasicSP </em> example directory: + <UL> + <LI> <em> linux: </em> <code> [in $CIAO_ROOT/examples/BasicSP] mwc.pl -type gnuace</code> </LI> + <LI> <em> windows: </em> <code> [in %CIAO_ROOT%/examples/BasicSP] mwc.pl -type vc71</code> </LI> + </UL> + </LI> + + + <LI> Build the generated solution/make files </LI> +</UL> + +<H3> Running the test </H3> + +<UL> + + <LI> Change into the $CIAO_ROOT/examples/BasicSP/descriptors directory Start NodeManagers (NodeDameon) by running <code> basicNodeDaemon.pl </code> + + <LI> Start the execution manager: + <code>$CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager -o EM.ior -i NodeManagerMap.dat </code> + </LI> + + <LI> Start the executor: + <code> $CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattern_deploymentplan.cdp -k file://EM.ior </code> + + <LI> After this, components should be deployed successfully. You can run the $CIAO_ROOT/examples/BasicSP/EC/controller to start the application. + Please make sure that the component IOR file for the EC component is present when you run this client. + + <BR/> + </LI> +</UL> + +</BODY> </HTML> diff --git a/modules/CIAO/examples/BasicSP/RepoMan_Usage.html b/modules/CIAO/examples/BasicSP/RepoMan_Usage.html new file mode 100644 index 00000000000..b0854d03b96 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/RepoMan_Usage.html @@ -0,0 +1,117 @@ +<!-- $Id$ --> + +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> + <title>Step-By-Step instructions about how to use Repository Manager with DAnCE</title> +</head> + +<body + text = "#000000" + link = "#000fff" + vLink= "#ff0f0f" + aLink = "#0000ff" + bgColor = "#ffffff"> + +<hr><h2>Step-By-Step instructions about how to use Repository Manager with DAnCE</h2><hr> + +<P>This file explains how to run the BasicSP example using the integrated Repository Manager (RepoMan).<P> + +<li>Be sure to add $CIAO_ROOT/HTTP_DOWNLOADED_LIBS into your PATH environment variable. This directory include the +downloaded component lib files.</li> <P> + +<li>If you want to use CORBA <em>naming service</em> to get the RepoMan object reference, then please start naming +service with multicast mode.</li> <P> +<PRE> + $TAO_ROOT/orbsvcs/Naming_Service/naming_service -m 1 +</PRE> + +<li>Build & start JAWS server.</li> <P> +<OL> +<li> Be sure to set JAWS_DOCUMENT_ROOT to the installation path of the RepoMan, i.e., +$CIAO_ROOT/DAnCE/RepositoryManager.</li> +<li> Start JAWS:</li> +<PRE> +Change the current directory into $ACE_ROOT/apps/JAWS/server +main +</PRE> +</OL> + +<li>Start RepoMan. Make sure you have BasicSP or BMClosedED, BMDevice, BMDisplay & EC installed in the +RepoMan you want to use. Please refer to the README file of RepoMan to get the instructions +about how to installed Packages into RepoMan.</li> <P> +<OL> +<li>Using ior file: </li> +<PRE> +Change the current directory into $CIAO_ROOT/DAnCE/RepositoryManager +RepositoryManagerDaemon -o +</PRE> +<li>Using Naming Service:</li> +<PRE> +Change the current directory into $CIAO_ROOT/DAnCE/RepositoryManager +RepositoryManagerDaemon -v [NameofRM] +</PRE> +</OL> + +<li>Change the current directory into $CIAO_ROOT/examples/BasicSP/descriptors.</li> <P> + +<li>Start NodeManagers.</li> <P> +<PRE> + basicNodeDaemon.pl +</PRE> + +<li>Start ExecutionManager.</li> <P> +<PRE> + $CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager -o EM.ior -i NodeManagerMap.dat +</PRE> + +<li>Start plan_launcher.</li> <P> +<OL> +<li>Not using RepoMan:</li> +<PRE> +$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattened_deploymentplan.cdp -k file://EM.ior +</PRE> + +<li>Using ior file to get RepoMan, providing the name of one composite componemt:</li> +<PRE> +$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattened_deploymentplan.cdp +-a BasicSP +-k file://EM.ior +-l file://$CIAO_ROOT/DAnCE/RepositoryManager/RepositoryManagerDaemon.ior +</PRE> + +<li>Using naming service to get RepoMan, providing the name of one composite componemt:</li> +<PRE> +$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattened_deploymentplan.cdp +-a BasicSP +-k file://EM.ior +-v [NameofRM] +</PRE> + +<li>Using naming service to get RepoMan, providing the names of several individual componemts:</li> +<PRE> +$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattened_deploymentplan.cdp +-a BMClosedED+BMDevice+BMDisplay+EC +-k file://EM.ior +-v [NameofRM] +</PRE> + +<li>Using naming service to get RepoMan, providing the types of several individual componemts:</li> +<PRE> +$CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattened_deploymentplan.cdp +-e IDL:BasicSP/EC:1.0+IDL:BasicSP/BMDisplay:1.0+IDL:BasicSP/BMDevice:1.0+IDL:BasicSP/BMClosedED:1.0 +-k file://EM.ior +-v [NameofRM] +</PRE> +</OL> + +<li>Start the application.</li> +<PRE> + $CIAO_ROOT/examples/BasicSP/EC/controller +</PRE> + +<hr><b>Email: </b><a href="mailto:"</a<ADDRESS>shanshan.jiang@vanderbilt.edu</ADDRESS> + +</body> + +</html> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe.ccd b/modules/CIAO/examples/BasicSP/descriptors/Airframe.ccd new file mode 100644 index 00000000000..f8a0c2be6bf --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe.ccd @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentInterfaceDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Component</label> + <UUID>058178f1-430a-460c-927a-d3c98b4ec860</UUID> + <specificType>IDL:BasicSP/BMClosedED:1.0</specificType> + <supportedType>IDL:BasicSP/BMClosedED:1.0</supportedType> + <port> + <name>in_avail</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>false</provider> + <supportedType>IDL:BasicSP/DataAvailable:1.0</supportedType> + <specificType>IDL:BasicSP/DataAvailable:1.0</specificType> + <kind>EventConsumer</kind> + </port> + + <port> + <name>out_avail</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/DataAvailable:1.0</supportedType> + <specificType>IDL:BasicSP/DataAvailable:1.0</specificType> + <kind>EventPublisher</kind> + </port> + + <port> + <name>dataout</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/ReadData:1.0</supportedType> + <specificType>IDL:BasicSP/ReadData:1.0</specificType> + <kind>Facet</kind> + </port> + + <port> + <name>datain</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/ReadData:1.0</supportedType> + <specificType>IDL:BasicSP/ReadData:1.0</specificType> + <kind>SimplexReceptacle</kind> + </port> + +</Deployment:ComponentInterfaceDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe.cid b/modules/CIAO/examples/BasicSP/descriptors/Airframe.cid new file mode 100644 index 00000000000..69d19585bee --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe.cid @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentImplementationDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Implementation</label> + <UUID>66a409c2-fa3a-48ea-be50-482dec4ae7a2</UUID> + <implements href="Airframe.ccd"/> + <monolithicImpl> + <primaryArtifact> + <name>BMClosedED_Stub</name> + <referencedArtifact href="Airframe_Stub.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMClosedED_Svnt</name> + <referencedArtifact href="Airframe_Svnt.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMClosedED_Exec</name> + <referencedArtifact href="Airframe_Exec.iad"/> + </primaryArtifact> + </monolithicImpl> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED.ior</string> + </value> + </value> + </configProperty> +</Deployment:ComponentImplementationDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe.cpd b/modules/CIAO/examples/BasicSP/descriptors/Airframe.cpd new file mode 100644 index 00000000000..2b8f461581b --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe.cpd @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentPackageDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Package </label> + <UUID>3c4c5adf-ae85-4b18-a404-a7c4887d6f7d</UUID> + <realizes href="Airframe.ccd"/> + <implementation> + <name>BMClosedED</name> + <referencedImplementation href="Airframe.cid"/> + </implementation> +</Deployment:ComponentPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe_Exec.iad b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Exec.iad new file mode 100644 index 00000000000..7b70be3fd5f --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Exec.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Executor Artifact</label> + <UUID>0f76b3d3-3d50-4d65-88b1-e26b60b624dd</UUID> + <location>BMClosedED_exec</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMClosedED_Stub</name> + <referencedArtifact href="Airframe_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMClosedEDHome_Impl</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe_Stub.iad b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Stub.iad new file mode 100644 index 00000000000..b3e7013091d --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Stub.iad @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Stub Artifact</label> + <UUID>93bbdf7d-d3f7-4227-bb75-b0562ac15b92</UUID> + <location>BMClosedED_stub</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Airframe_Svnt.iad b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Svnt.iad new file mode 100644 index 00000000000..dd086ff5f23 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Airframe_Svnt.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Airframe Servant Artifact</label> + <UUID>88f66272-bdb6-488b-9d95-cfa63317c616</UUID> + <location>BMClosedED_svnt</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMClosedED_Stub</name> + <referencedArtifact href="Airframe_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedEDHome_Servant</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/DeploymentPlan.cdp b/modules/CIAO/examples/BasicSP/descriptors/DeploymentPlan.cdp new file mode 100644 index 00000000000..f25090018df --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/DeploymentPlan.cdp @@ -0,0 +1,24 @@ +<?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"> + <label>HUDisplay Deployment Plan</label> + <instance xmi:id="BMClosedED_Instance"> + <name>BMClosedED_Instance</name> + <node>AirFrameDevice</node> + </instance> + <instance xmi:id="BMDevice_Instance"> + <name>BMDevice_Instance</name> + <node>AirFrameDevice</node> + </instance> + <instance xmi:id="BMDisplay_Instance"> + <name>BMDisplay_Instance</name> + <node>AirFrameDevice</node> + </instance> + <instance xmi:id="EC_Instance"> + <name>EC_Instance</name> + <node>TimerDevice</node> + </instance> +</Deployment:DeploymentPlan> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Domain.cdd b/modules/CIAO/examples/BasicSP/descriptors/Domain.cdd new file mode 100644 index 00000000000..6f5277d799e --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Domain.cdd @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<Deployment:Domain + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> +<label>HUDisplay Domain</label> +<UUID>effd4bd0-6db0-4c50-9bb7-db9decebae1c</UUID> +<node> + <name>EC</name> + <label>Timer's Node</label> +</node> +<node> + <name>BMDisplay</name> + <label>NavDisplay's Node</label> +</node> +<node> + <name>BMDevice</name> + <label>GPS's Node</label> +</node> +<node> + <name>BMClosedED</name> + <label>Airframe's Node</label> +</node> +</Deployment:Domain> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS.ccd b/modules/CIAO/examples/BasicSP/descriptors/GPS.ccd new file mode 100644 index 00000000000..3d7d99491c8 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS.ccd @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentInterfaceDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>GPS Component</label> + <UUID>058178f1-430a-460c-927a-d3c98b4ec860</UUID> + <specificType>IDL:BasicSP/BMDevice:1.0</specificType> + <supportedType>IDL:BasicSP/BMDevice:1.0</supportedType> + <port> + <name>timeout</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>false</provider> + <supportedType>IDL:BasicSP/TimeOut:1.0</supportedType> + <specificType>IDL:BasicSP/TimeOut:1.0</specificType> + <kind>EventConsumer</kind> + </port> + + <port> + <name>data_available</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/DataAvailable:1.0</supportedType> + <specificType>IDL:BasicSP/DataAvailable:1.0</specificType> + <kind>EventPublisher</kind> + </port> + + <port> + <name>data_read</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/ReadData:1.0</supportedType> + <specificType>IDL:BasicSP/ReadData:1.0</specificType> + <kind>Facet</kind> + </port> + +</Deployment:ComponentInterfaceDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS.cid b/modules/CIAO/examples/BasicSP/descriptors/GPS.cid new file mode 100644 index 00000000000..ba56a63c8f5 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS.cid @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentImplementationDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>GPS Implementation</label> + <UUID>154cf3cd-1770-4e92-b19b-8c2c921fea38</UUID> + <implements href="GPS.ccd"/> + <monolithicImpl> + <primaryArtifact> + <name>BMDevice_Stub</name> + <referencedArtifact href="GPS_Stub.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMDevice_Svnt</name> + <referencedArtifact href="GPS_Svnt.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMDevice_Exec</name> + <referencedArtifact href="GPS_Exec.iad"/> + </primaryArtifact> + </monolithicImpl> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice.ior</string> + </value> + </value> + </configProperty> +</Deployment:ComponentImplementationDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS.cpd b/modules/CIAO/examples/BasicSP/descriptors/GPS.cpd new file mode 100644 index 00000000000..3f1424967f4 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS.cpd @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentPackageDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + + <label>GPS System</label> + + <UUID>b55c949b-a9e8-41dd-bbb5-67d8f610dffe</UUID> + + <realizes href="GPS.ccd"/> + + <implementation> + <name>GPSImpl</name> + <referencedImplementation href="GPS.cid"/> + </implementation> + +</Deployment:ComponentPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS_Exec.iad b/modules/CIAO/examples/BasicSP/descriptors/GPS_Exec.iad new file mode 100644 index 00000000000..c6724d39c8a --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS_Exec.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>GPS Executor Artifact</label> + <UUID>9617ed9a-d127-4797-836a-0a3b3d7d8b12</UUID> + <location>BMDevice_exec</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMDevice_Stub</name> + <referencedArtifact href="GPS_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMDeviceHome_Impl</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS_Stub.iad b/modules/CIAO/examples/BasicSP/descriptors/GPS_Stub.iad new file mode 100644 index 00000000000..6968ec7ad74 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS_Stub.iad @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>GPS Stub Artifact</label> + <UUID>c7264c15-d373-4d01-84ee-d37536599240</UUID> + <location>BMDevice_stub</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/GPS_Svnt.iad b/modules/CIAO/examples/BasicSP/descriptors/GPS_Svnt.iad new file mode 100644 index 00000000000..3f4f592cf3f --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/GPS_Svnt.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>GPS Servant Artifact</label> + <UUID>657440e8-9143-494b-928c-2a3df84e509f</UUID> + <location>BMDevice_svnt</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMDevice_Stub</name> + <referencedArtifact href="GPS_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDeviceHome_Servant</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cid b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cid new file mode 100644 index 00000000000..3746e7cae24 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cid @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentImplementationDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>HUDisplay Assembly</label> + <UUID>effd4bd0-6db0-4c50-9bb7-db9decebae1c</UUID> + <assemblyImpl> + <instance xmi:id="a_GPS"> + <name>BMDevice_Instance</name> + <package href="GPS.cpd"/> + </instance> + <instance xmi:id="a_Airframe"> + <name>BMClosedED_Instance</name> + <package href="Airframe.cpd"/> + </instance> + <instance xmi:id="a_NavDisplay"> + <name>BMDisplay_Instance</name> + <package href="NavDisplay.cpd"/> + </instance> + <instance xmi:id="a_Timer"> + <name>EC_Instance</name> + <package href="Timer.cpd"/> + </instance> + <connection> + <name>Timer_NavDisplay</name> + <internalEndpoint> + <portName>timeout</portName> + <instance xmi:idref="a_Timer"/> + </internalEndpoint> + <internalEndpoint> + <portName>timeout</portName> + <instance xmi:idref="a_GPS"/> + </internalEndpoint> + </connection> + <connection> + <name>GPS_Airframe</name> + <internalEndpoint> + <portName>data_available</portName> + <instance xmi:idref="a_GPS"/> + </internalEndpoint> + <internalEndpoint> + <portName>in_avail</portName> + <instance xmi:idref="a_Airframe"/> + </internalEndpoint> + </connection> + <connection> + <name>Airframe_GPS</name> + <internalEndpoint> + <portName>datain</portName> + <instance xmi:idref="a_Airframe"/> + </internalEndpoint> + <internalEndpoint> + <portName>data_read</portName> + <instance xmi:idref="a_GPS"/> + </internalEndpoint> + </connection> + <connection> + <name>Airframe_NavDisplay</name> + <internalEndpoint> + <portName>data_ready</portName> + <instance xmi:idref="a_NavDisplay"/> + </internalEndpoint> + <internalEndpoint> + <portName>out_avail</portName> + <instance xmi:idref="a_Airframe"/> + </internalEndpoint> + </connection> + <connection> + <name>NavDisplay_Airframe</name> + <internalEndpoint> + <portName>comp_data</portName> + <instance xmi:idref="a_NavDisplay"/> + </internalEndpoint> + <internalEndpoint> + <portName>dataout</portName> + <instance xmi:idref="a_Airframe"/> + </internalEndpoint> + </connection> + </assemblyImpl> +</Deployment:ComponentImplementationDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cpd b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cpd new file mode 100644 index 00000000000..9be7a1e0ef2 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.cpd @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentPackageDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>HUDisplay Package</label> + <UUID>823e4287-f53c-4caa-8619-f3dfda4c4998</UUID> + <implementation> + <name>HUDisplay</name> + <referencedImplementation href="HUDisplay.cid"/> + </implementation> +</Deployment:ComponentPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.pcd b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.pcd new file mode 100644 index 00000000000..cbcec4e9113 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/HUDisplay.pcd @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:PackageConfiguration +xmlns:Deployment="http://www.omg.org/Deployment" +xmlns:xmi="http://www.omg.org/XMI" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>HUDisplay Configuration for Unix machines</label> + <UUID>559d65e8-0407-48c0-a158-dafe21360fef</UUID> + <basePackage href="HUDisplay.cpd"/> +</Deployment:PackageConfiguration> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Libraries.iad b/modules/CIAO/examples/BasicSP/descriptors/Libraries.iad new file mode 100644 index 00000000000..720a7ce8219 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Libraries.iad @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription xmlns:Deployment="http://www.omg.org/Deployment" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Common Libraries</label> + <UUID>6bae4fcd-c71c-44b4-a0d4-0e4199ce1a49</UUID> + <location>$ACE_ROOT/lib/libACE</location> + <location>$ACE_ROOT/lib/libTAO</location> + <location>$ACE_ROOT/lib/libCIAO_Client</location> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.ccd b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.ccd new file mode 100644 index 00000000000..175d4067000 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.ccd @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentInterfaceDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>NavDisplay Component </label> + <UUID>589462ed-e88f-4f96-a7a7-359cdc333d63</UUID> + <specificType>IDL:BasicSP/BMDisplay:1.0</specificType> + <supportedType>IDL:BasicSP/BMDisplay:1.0</supportedType> + <idlFile>BMDisplay.idl</idlFile> + <port> + <name>data_ready</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>false</provider> + <supportedType>IDL:BasicSP/DataAvailable:1.0</supportedType> + <specificType>IDL:BasicSP/DataAvailable:1.0</specificType> + <kind>EventConsumer</kind> + </port> + + <port> + <name>comp_data</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>false</provider> + <supportedType>IDL:BasicSP/ReadData:1.0</supportedType> + <specificType>IDL:BasicSP/ReadData:1.0</specificType> + <kind>SimplexReceptacle</kind> + </port> + +</Deployment:ComponentInterfaceDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cid b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cid new file mode 100644 index 00000000000..30b66fea0b2 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cid @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentImplementationDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>NavDisplay Implementation</label> + <UUID>0a52c9de-7852-42e4-aac7-bf478169a21a</UUID> + <implements href="NavDisplay.ccd"/> + <monolithicImpl> + <primaryArtifact> + <name>BMDisplay_Stub</name> + <referencedArtifact href="NavDisplay_Stub.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMDisplay_Svnt</name> + <referencedArtifact href="NavDisplay_Svnt.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>BMDisplay_Exec</name> + <referencedArtifact href="NavDisplay_Exec.iad"/> + </primaryArtifact> + </monolithicImpl> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay.ior</string> + </value> + </value> + </configProperty> +</Deployment:ComponentImplementationDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cpd b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cpd new file mode 100644 index 00000000000..04862555769 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay.cpd @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentPackageDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Navigation Display Package</label> + <UUID>a5923ef4-9c62-4458-9fa4-869b53d834ca</UUID> + <realizes href="NavDisplay.ccd"/> + <implementation> + <name>BMDisplay</name> + <referencedImplementation href="NavDisplay.cid"/> + </implementation> +</Deployment:ComponentPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Exec.iad b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Exec.iad new file mode 100644 index 00000000000..fbd092506a8 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Exec.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>NavDisplay Servant Artifact</label> + <UUID>412f8156-7913-4651-9110-f7a3f98c7a83</UUID> + <location>BMDisplay_exec</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMDisplay_Stub</name> + <referencedArtifact href="NavDisplay_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMDisplayHome_Impl</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Stub.iad b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Stub.iad new file mode 100644 index 00000000000..e79eeea1f4e --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Stub.iad @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>NavDisplay Stub Artifact</label> + <UUID>4d02c22b-768e-4d1a-bf07-76da2f5d1fbf</UUID> + <location>BMDisplay_Stub</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Svnt.iad b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Svnt.iad new file mode 100644 index 00000000000..c6b0e7a34ea --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NavDisplay_Svnt.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>NavDisplay Servant Artifact</label> + <UUID>ad052b10-0806-43c7-9ccc-2dfeda0e0e03</UUID> + <location>BMDisplay_svnt</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>BMDisplay_Stub</name> + <referencedArtifact href="NavDisplay_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplayHome_Servant</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/NodeManagerMap.dat b/modules/CIAO/examples/BasicSP/descriptors/NodeManagerMap.dat new file mode 100644 index 00000000000..6f4bbd25734 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/NodeManagerMap.dat @@ -0,0 +1,2 @@ +AirFrameDevice corbaloc:iiop:localhost:10000/NodeManager +TimerDevice corbaloc:iiop:localhost:20000/NodeManager
\ No newline at end of file diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer.ccd b/modules/CIAO/examples/BasicSP/descriptors/Timer.ccd new file mode 100644 index 00000000000..ba44bcf1a00 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer.ccd @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentInterfaceDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + + <label>Timer Component</label> + <UUID>803f8fc7-55de-4a20-81eb-ae951d85b7f4</UUID> + <specificType>IDL:BasicSP/EC:1.0</specificType> + <supportedType>IDL:BasicSP/EC:1.0</supportedType> + <property> + <name>hertz</name> + <type> + <kind>tk_long</kind> + </type> + </property> + <port> + <name>supports</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/trigger:1.0</supportedType> + <kind>Facet</kind> + </port> + <port> + <name>timeout</name> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <provider>true</provider> + <supportedType>IDL:BasicSP/TimeOut:1.0</supportedType> + <specificType>IDL:BasicSP/TimeOut:1.0</specificType> + <kind>EventPublisher</kind> + </port> + +</Deployment:ComponentInterfaceDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer.cid b/modules/CIAO/examples/BasicSP/descriptors/Timer.cid new file mode 100644 index 00000000000..ac50742d0e3 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer.cid @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentImplementationDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Timer Implementation</label> + <UUID>789e1be2-703f-4bd3-af50-b400eef91fd0</UUID> + <implements href="Timer.ccd"/> + <monolithicImpl> + <primaryArtifact> + <name>EC_Stub</name> + <referencedArtifact href="Timer_Stub.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>EC_Svnt</name> + <referencedArtifact href="Timer_Svnt.iad"/> + </primaryArtifact> + <primaryArtifact> + <name>EC_Exec</name> + <referencedArtifact href="Timer_Exec.iad"/> + </primaryArtifact> + </monolithicImpl> + <configProperty> + <name>hertz</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>40</long> + </value> + </value> + </configProperty> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC.ior</string> + </value> + </value> + </configProperty> +</Deployment:ComponentImplementationDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer.cpd b/modules/CIAO/examples/BasicSP/descriptors/Timer.cpd new file mode 100644 index 00000000000..167b1238934 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer.cpd @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ComponentPackageDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Timer Package</label> + <UUID>07ebf947-2174-4a3b-bd37-bcb92986eaf4</UUID> + <realizes href="Timer.ccd"/> + <implementation> + <name>EC</name> + <referencedImplementation href="Timer.cid"/> + </implementation> +</Deployment:ComponentPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer_Exec.iad b/modules/CIAO/examples/BasicSP/descriptors/Timer_Exec.iad new file mode 100644 index 00000000000..222fc22bc9e --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer_Exec.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Timer Executor Artifact</label> + <UUID>5e4f2366-3810-4d4c-a269-5788a525cbe1</UUID> + <location>EC_exec</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>EC_Stub</name> + <referencedArtifact href="Timer_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createECHome_Impl</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer_Stub.iad b/modules/CIAO/examples/BasicSP/descriptors/Timer_Stub.iad new file mode 100644 index 00000000000..c9d15dcc82e --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer_Stub.iad @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Timer Stub Artifact</label> + <UUID>93bbdf7d-d3f7-4227-bb75-b0562ac15b92</UUID> + <location>EC_stub</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/Timer_Svnt.iad b/modules/CIAO/examples/BasicSP/descriptors/Timer_Svnt.iad new file mode 100644 index 00000000000..0082291e27f --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/Timer_Svnt.iad @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:ImplementationArtifactDescription + xmlns:Deployment="http://www.omg.org/Deployment" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.omg.org/Deployment Deployment.xsd"> + <label>Timer Servant Artifact</label> + <UUID>04e4d246-e6eb-4b0e-8e32-60b996497cea</UUID> + <location>EC_svnt</location> + <dependsOn> + <name>ACE</name> + <referencedArtifact href="Libraries.iad"/> + </dependsOn> + <dependsOn> + <name>EC_Stub</name> + <referencedArtifact href="Timer_Stub.iad"/> + </dependsOn> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_ECHome_Servant</string> + </value> + </value> + </execParameter> +</Deployment:ImplementationArtifactDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/XMI.xsd b/modules/CIAO/examples/BasicSP/descriptors/XMI.xsd new file mode 100644 index 00000000000..f4adac91934 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/XMI.xsd @@ -0,0 +1,35 @@ +<?xml version="1.0" ?> +<xsd:schema targetNamespace="http://www.omg.org/XMI" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation='http://www.w3.org/2001/XMLSchema XMLSchema.xsd'> + <xsd:attribute name="id" type="xsd:ID" /> + <xsd:attributeGroup name="IdentityAttribs"> + <xsd:attribute form="qualified" name="label" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="uuid" type="xsd:string" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="LinkAttribs"> + <xsd:attribute name="href" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="idref" type="xsd:IDREF" use="optional" /> + </xsd:attributeGroup> + <xsd:attributeGroup name="ObjectAttribs"> + <xsd:attributeGroup ref="xmi:IdentityAttribs" /> + <xsd:attributeGroup ref="xmi:LinkAttribs" /> + <xsd:attribute fixed="2.0" form="qualified" name="version" type="xsd:string" use="optional" /> + <xsd:attribute form="qualified" name="type" type="xsd:QName" use="optional" /> + </xsd:attributeGroup> + <xsd:complexType name="Extension"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="lax" /> + </xsd:choice> + <xsd:attribute ref="xmi:id" /> + <xsd:attributeGroup ref="xmi:ObjectAttribs" /> + <xsd:attribute name="extender" type="xsd:string" use="optional" /> + <xsd:attribute name="extenderID" type="xsd:string" use="optional" /> + </xsd:complexType> + <xsd:element name="Extension" type="xmi:Extension" /> + <xsd:complexType name="Any"> + <xsd:choice maxOccurs="unbounded" minOccurs="0"> + <xsd:any processContents="skip" /> + </xsd:choice> + <xsd:anyAttribute processContents="skip" /> + </xsd:complexType> +</xsd:schema> diff --git a/modules/CIAO/examples/BasicSP/descriptors/basicNodeDaemon.pl b/modules/CIAO/examples/BasicSP/descriptors/basicNodeDaemon.pl new file mode 100755 index 00000000000..42bcff41f14 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/basicNodeDaemon.pl @@ -0,0 +1,57 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$status = 0; +$iorfile1 = PerlACE::LocalFile ("NodeApp1.ior"); +$iorfile2 = PerlACE::LocalFile ("NodeApp2.ior"); +$iorfile3 = PerlACE::LocalFile ("NodeApp3.ior"); +$iorfile4 = PerlACE::LocalFile ("NodeApp4.ior"); +$iorfile5 = PerlACE::LocalFile ("NodeApp5.ior"); + +#for ($iter = 0; $iter <= $#ARGV; $iter++) { +# if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") { +# print "Run_Test Perl script for NodeApplicationTest \n\n"; +# print "run_test \n"; +# print "\n"; +# print "-h -- prints this information\n"; +# exit 0; +# } +#} + + +unlink $iorfile1; +unlink $iorfile2; +unlink $iorfile3; +unlink $iorfile4; +unlink $iorfile5; + +$CIAO_ROOT=$ENV{'CIAO_ROOT'}; + +$SV1 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:10000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); + +$SV2 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:20000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); + +$SV3 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:30000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); + +$SV4 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:40000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); + +$SV5 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/NodeManager", + "-ORBEndpoint iiop://localhost:50000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication"); +$SV1->Spawn (); +$SV2->Spawn (); +$SV3->Spawn (); +$SV4->Spawn (); +$SV5->Spawn (); + +sleep (99999999999); diff --git a/modules/CIAO/examples/BasicSP/descriptors/basicsp.dat b/modules/CIAO/examples/BasicSP/descriptors/basicsp.dat new file mode 100644 index 00000000000..8bd5e6a72f6 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/basicsp.dat @@ -0,0 +1,3 @@ +BMClosedED corbaloc:iiop:localhost:10000/NodeManager +EC corbaloc:iiop:localhost:20000/NodeManager + diff --git a/modules/CIAO/examples/BasicSP/descriptors/flattened_deploymentplan.cdp b/modules/CIAO/examples/BasicSP/descriptors/flattened_deploymentplan.cdp new file mode 100644 index 00000000000..d3aa1197327 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/flattened_deploymentplan.cdp @@ -0,0 +1,422 @@ +<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 Modified_Deployment.xsd"> + + <label>BasicSP-DeploymentPlan</label> + <UUID>Test_UUID_0000</UUID> + <!-- Exactly one realizes + This realizes section may also not be right. --> + <realizes> + <label>BasicSP-realizes-cid</label> + <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID> + <specificType><!-- @@ What does here? --></specificType> + <supportedType>IDL:BasicSP/EC:1.0</supportedType> + <port> + <name>timeout</name> + <specificType>IDL:BasicSP/TimeOut:1.0</specificType> + <supportedType>IDL:BasicSP/TimeOut:1.0</supportedType> + <provider>false></provider> + <exclusiveProvider>false</exclusiveProvider> + <exclusiveUser>false</exclusiveUser> + <optional>false</optional> + <kind>EventConsumer</kind> + </port> + </realizes> + + <implementation id="BasicSP-BMClosedED-mdd"> + <name>BasicSP-BMClosedED-mdd</name> + <source><!-- @@ Don't know what goes here --></source> + <artifact>BasicSP-BMClosedED_exec</artifact> + <artifact>BasicSP-BMClosedED_stub</artifact> + <artifact>BasicSP-BMClosedED_svnt</artifact> + <!-- + <execParameter></execParameter> + <deployRequirement></deployRequirement> + --> + </implementation> + + <implementation id="BasicSP-BMDevice-mdd"> + <name>BasicSP-BMDevice-mdd</name> + <source><!-- @@ Don't know what goes here --></source> + + <artifact>BasicSP-BMDevice_exec</artifact> + <artifact>BasicSP-BMDevice_stub</artifact> + <artifact>BasicSP-BMDevice_svnt</artifact> + <!-- + <execParameter></execParameter> + <deployRequirement></deployRequirement> + --> + </implementation> + + <implementation id="BasicSP-BMDisplay-mdd"> + <name>BasicSP-BMDisplay-mdd</name> + <source><!-- @@ Don't know what goes here --></source> + <artifact>BasicSP-BMDisplay_exec</artifact> + <artifact>BasicSP-BMDisplay_svnt</artifact> + <artifact>BasicSP-BMDisplay_stub</artifact> + + <!-- + <execParameter></execParameter> + <deployRequirement></deployRequirement> + --> + </implementation> + + <implementation id="BasicSP-EC-mdd"> + <name>BasicSP-EC-mdd</name> + <source><!-- @@ Don't know what goes here --></source> + + <artifact>BasicSP-EC_stub</artifact> + <artifact>BasicSP-EC_svnt</artifact> + <artifact>BasicSP-EC_exec</artifact> + + <!-- + <execParameter></execParameter> + <deployRequirement></deployRequirement> + --> + </implementation> + + <instance id="BasicSP-BMClosedED-idd"> + <name>BasicSP-BMClosedED-idd</name> + <node>AirFrameDevice</node> + <source><!-- @@ What goes here --></source> + <implementation>BasicSP-BMClosedED-mdd</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMClosedED.ior</string> + </value> + </value> + </configProperty> + + <configProperty> + <name>RegisterNaming</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>AirFrameDevice_001</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="BasicSP-BMDevice-idd"> + <name>BasicSP-BMDevice-idd</name> + <node>AirFrameDevice</node> + <source><!-- @@ What goes here --></source> + <implementation>BasicSP-BMDevice-mdd</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDevice.ior</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="BasicSP-BMDisplay-idd"> + <name>BasicSP-BMDisplay-idd</name> + <node>AirFrameDevice</node> + <source><!-- @@ What goes here --></source> + <implementation>BasicSP-BMDisplay-mdd</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>BMDisplay.ior</string> + </value> + </value> + </configProperty> + </instance> + + <instance id="BasicSP-EC-idd"> + <name>BasicSP-EC-idd</name> + <node>TimerDevice</node> + <source><!-- @@ What goes here --></source> + <implementation>BasicSP-EC-mdd</implementation> + <configProperty> + <name>ComponentIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>EC.ior</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>datain_data_read</name> + <internalEndpoint> + <portName>data_read</portName> + <kind>Facet</kind> + <instance>BasicSP-BMDevice-idd</instance> + </internalEndpoint> + <internalEndpoint> + <portName>datain</portName> + <kind>SimplexReceptacle</kind> + <instance>BasicSP-BMClosedED-idd</instance> + </internalEndpoint> + </connection> + + <connection> + <name>comp_data_dataout</name> + <internalEndpoint> + <portName>dataout</portName> + <kind>Facet</kind> + <instance>BasicSP-BMClosedED-idd</instance> + </internalEndpoint> + <internalEndpoint> + <portName>comp_data</portName> + <kind>SimplexReceptacle</kind> + <instance>BasicSP-BMDisplay-idd</instance> + </internalEndpoint> + </connection> + + <connection> + <name>timeout_timeout</name> + <internalEndpoint> + <portName>timeout</portName> + <kind>EventPublisher</kind> + <instance>BasicSP-EC-idd</instance> + </internalEndpoint> + <internalEndpoint> + <portName>timeout</portName> + <kind>EventConsumer</kind> + <instance>BasicSP-BMDevice-idd</instance> + </internalEndpoint> + </connection> + + <connection> + <name>in_avail_data_available</name> + <internalEndpoint> + <portName>data_available</portName> + <kind>EventPublisher</kind> + <instance>BasicSP-BMDevice-idd</instance> + </internalEndpoint> + <internalEndpoint> + <portName>in_avail</portName> + <kind>EventConsumer</kind> + <instance>BasicSP-BMClosedED-idd</instance> + </internalEndpoint> + </connection> + + <connection> + <name>data_ready_out_avail</name> + <internalEndpoint> + <portName>out_avail</portName> + <kind>EventPublisher</kind> + <instance>BasicSP-BMClosedED-idd</instance> + </internalEndpoint> + <internalEndpoint> + <portName>data_ready</portName> + <kind>EventConsumer</kind> + <instance>BasicSP-BMDisplay-idd</instance> + </internalEndpoint> + </connection> + + <artifact id="BasicSP-BMClosedED_exec"> + <name>BMClosedED_exec</name> + <source><!-- @@ Not sure about this--></source> + <node><!-- blank --></node> + <location>BMClosedED_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMClosedEDHome_Impl</string> + </value> + </value> + </execParameter> + + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMClosedED_svnt"> + <name>BMClosedED_svnt</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMClosedED_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMClosedEDHome_Servant</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMClosedED_stub"> + <name>BMClosedED_stub</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMClosedED_stub</location> + + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDevice_exec"> + <name>BMDevice_exec</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDevice_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMDeviceHome_Impl</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDevice_stub"> + <name>BMDevice_stub</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDevice_stub</location> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDevice_svnt"> + <name>BMDevice_svnt</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDevice_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDeviceHome_Servant</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDisplay_exec"> + <name>BMDisplay_exec</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDisplay_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createBMDisplayHome_Impl</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDisplay_svnt"> + <name>BMDisplay_svnt</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDisplay_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_BMDisplayHome_Servant</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-BMDisplay_stub"> + <name>BMDisplay_stub</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>BMDisplay_stub</location> + + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-EC_stub"> + <name>EC_stub</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>EC_stub</location> + + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-EC_svnt"> + <name>EC_svnt</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>EC_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_BasicSP_ECHome_Servant</string> + </value> + </value> + </execParameter> + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> + + <artifact id="BasicSP-EC_exec"> + <name>EC_exec</name> + <source><!-- @@ Not sure --></source> + <node><!-- blank --></node> + <location>EC_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>createECHome_Impl</string> + </value> + </value> + </execParameter> + + <!-- @@ This has dependancies that need to be specified, how? --> + </artifact> +</Deployment:deploymentPlan> diff --git a/modules/CIAO/examples/BasicSP/descriptors/package.tpd b/modules/CIAO/examples/BasicSP/descriptors/package.tpd new file mode 100644 index 00000000000..9096beb2c48 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/package.tpd @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<Deployment:TopLevelPackageDescription +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"> + <package href="HUDisplay.pcd"/> +</Deployment:TopLevelPackageDescription> diff --git a/modules/CIAO/examples/BasicSP/descriptors/run_test.pl b/modules/CIAO/examples/BasicSP/descriptors/run_test.pl new file mode 100755 index 00000000000..898e8bca092 --- /dev/null +++ b/modules/CIAO/examples/BasicSP/descriptors/run_test.pl @@ -0,0 +1,175 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; +$daemons = 5; +@ports = ( 10000, 20000, 30000, 40000, 50000 ); +@iorfiles = ( "NodeApp1.ior", "NodeApp2.ior", "NodeApp3.ior", "NodeApp4.ior", "NodeApp5.ior" ); +$status = 0; +$dat_file = "NodeManagerMap.dat"; +$cdp_file = "flattern_deploymentplan.cdp"; +$controller_exec = "$CIAO_ROOT/examples/BasicSP/EC/controller"; + +$nsior = PerlACE::LocalFile ("ns.ior"); + +unlink $nsior; + +$E = 0; +$EM = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } + unlink PerlACE::LocalFile ("EM.ior"); + unlink PerlACE::LocalFile ("Receiver.ior"); + unlink PerlACE::LocalFile ("Sender.ior"); + unlink PerlACE::LocalFile ("DAM.ior"); + unlink PerlACE::LocalFile ("ns.ior"); +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } + + if ($em_running == 1) { + $EM->Kill (); + $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); + $NS->TimedWait (1); + } + +} + +# Invoke naming service + +$NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); + +$NS->Spawn (); + +print STDERR "Starting Naming Service\n"; + +if (PerlACE::waitforfile_timed ($nsior, 10) == -1) +{ + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; +} + +$ns_running = 1; + +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + + $iiop = "iiop://localhost:$port"; + $node_app = "$DAnCE/NodeApplication/NodeApplication"; + + $d_cmd = "$DAnCE/NodeManager/NodeManager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +delete_ior_files (); + +# Invoke node daemons. +print "Invoking node daemons\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemons\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager\n"; +$EM = new PerlACE::Process ("$DAnCE/ExecutionManager/Execution_Manager", + "-o EM.ior -i $dat_file"); +$EM->Spawn (); + +if (PerlACE::waitforfile_timed ("EM.ior", + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; +} + +$em_running = 1; + +sleep (10); + +# Invoke executor - start the application -. +print "Invoking executor - start the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/Plan_Launcher/plan_launcher", + "-p flattened_deploymentplan.cdp -k file://EM.ior"); + +$E->SpawnWaitKill (60); + +sleep (10); + +print "Invoking the controller\n"; +$controller = new PerlACE::Process ("$controller_exec", ""); +$result = $controller->SpawnWaitKill (3000); + +if ($result != 0) { + print STDERR "ERROR: The controller returned $result\n"; + $status = 1; +} + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/Plan_Launcher/plan_launcher", + "-p flattern_deploymentplan.cdp -k file://EM.ior"); +$E->SpawnWaitKill (3000); + +sleep (99999999999); |