diff options
author | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-08-05 18:59:46 +0000 |
---|---|---|
committer | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-08-05 18:59:46 +0000 |
commit | 87c4bcb15efc2078019f8ce6a951f392fef4eb55 (patch) | |
tree | 1fdf79f19bcf483d041848f5a735b038921850e9 | |
parent | 94d9d3b2ccd3c555279ef49d11b4a5e4aa522d5a (diff) | |
download | ATCD-87c4bcb15efc2078019f8ce6a951f392fef4eb55.tar.gz |
ChangeLogTag: Tue Aug 05 13:23:12 2003 George Edwards <g.edwards@vanderbilt.edu>
76 files changed, 13430 insertions, 0 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index abdea241782..fcbfc0ae381 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,16 @@ +Tue Aug 05 13:23:12 2003 George Edwards <g.edwards@vanderbilt.edu> + + Added files: + * examples/handcrafted/BasicSP_EC2/*.*: + * examples/handcrafted/BasicSP_EC2/BMClosedED/*.*: + * examples/handcrafted/BasicSP_EC2/BMDevice/*.*: + * examples/handcrafted/BasicSP_EC2/EC/*.*: + * examples/handcrafted/BasicSP_EC2/descriptors/*.*: + * examples/handcrafted/BasicSP_EC2/BMDisplay/*.*: + + Added new event channel example. The event service is + integrated as a separate component. + 2003-08-04 Arvind S. Krishna <arvindk@equus.dre.vanderbilt.edu> * performance-tests/Benchmark/RountTripClient/run_test.pl: diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.cidl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.cidl new file mode 100644 index 00000000000..c241c806a34 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.cidl @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef BMCLOSEDED_CIDL +#define BMCLOSEDED_CIDL + +#include "BMClosedED.idl" + +composition session BMClosedED_Impl +{ + home executor BMClosedEDHome_Exec + { + implements BasicSP::BMClosedEDHome; + manages BMClosedED_Exec; + }; +}; + +#endif /* BMCLOSEDED_CIDL */ + + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.idl new file mode 100644 index 00000000000..60cd4978f23 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.idl @@ -0,0 +1,18 @@ +//$Id$ +#include "../BasicSP.idl" + +module BasicSP +{ + component BMClosedED + { + provides ReadData dataout; + uses ReadData datain; + publishes DataAvailable out_avail; + consumes DataAvailable in_avail; + uses RTEventChannel event_channel; + }; + + home BMClosedEDHome manages BMClosedED + { + }; +}; diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.mpc new file mode 100644 index 00000000000..014268adf82 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED.mpc @@ -0,0 +1,61 @@ +// $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_stub): ciao_client { + after += BasicSP_stub + sharedname = BMClosedED_stub + idlflags += -Wb,stub_export_macro=BMCLOSEDED_STUB_Export -Wb,stub_export_include=BMClosedED_stub_export.h -Wb,skel_export_macro=BMCLOSEDED_SVNT_Export -Wb,skel_export_include=BMClosedED_svnt_export.h + dynamicflags = BMCLOSEDED_STUB_BUILD_DLL + + IDL_Files { + BMClosedED.idl + } + + Source_Files { + BMClosedEDC.cpp + } +} + +project(BMClosedED_svnt) : ciao_servant { + after += BasicSP_svnt BMClosedED_stub + sharedname = BMClosedED_svnt + libs += BMClosedED_stub BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMCLOSEDED_SVNT_Export -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_exec) : ciao_component { + after += BMClosedED_svnt + sharedname = BMClosedED_exec + libs += BMClosedED_stub BMClosedED_svnt BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMCLOSEDED_EXEC_Export -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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedEDEI.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedEDEI.idl new file mode 100644 index 00000000000..a95918e6595 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.cpp new file mode 100644 index 00000000000..401e530ae46 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.cpp @@ -0,0 +1,161 @@ +// $Id$ + +#include "CIAO_common.h" +#include "BMClosedED_exec.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_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return BasicSP::CCM_ReadData::_duplicate (this); +} + +void +MyImpl::BMClosedED_exec_i::push_in_avail (BasicSP::DataAvailable * + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + + 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 (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (dat.in ())) + { + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - got nil from get_connection \n")); + + ACE_THROW (CORBA::BAD_INV_ORDER ()); + } + + char *str = + dat->get_data (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "BMClosedED - Display data is [%s] \n", + str)); + + if (ACE_OS::strcmp (str, "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 + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +// Operations from HUDisplay::position + +char * +MyImpl::BMClosedED_exec_i::get_data (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->str_.inout (); +} + +// Operations from Components::SessionComponent +void +MyImpl::BMClosedED_exec_i::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMClosedED_exec_i::set_session_context\n")); + + this->context_ = + BasicSP::CCM_BMClosedED_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMClosedED_exec_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMClosedED_exec_i::ccm_activate\n")); + + char *argv[1] = { "BMClosedED_exec"}; + + int argc = sizeof(argv)/sizeof(argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv ACE_ENV_ARG_PARAMETER); + + CIAO_REGISTER_VALUE_FACTORY (orb.in(), BasicSP::DataAvailable_init, + BasicSP::DataAvailable); +} + +void +MyImpl::BMClosedED_exec_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMClosedED_exec_i::ccm_passivate\n")); +} + +void +MyImpl::BMClosedED_exec_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + 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_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::BMClosedED_exec_i; +} + + +extern "C" BMCLOSEDED_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMClosedEDHome_Impl (void) +{ + return new MyImpl::BMClosedEDHome_exec_i; +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.h new file mode 100644 index 00000000000..870ca679dfe --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec.h @@ -0,0 +1,119 @@ +// $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_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_in_avail (BasicSP::DataAvailable *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from HUDisplay::position + virtual char * + get_data (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec_export.h new file mode 100644 index 00000000000..b2d7ae01e02 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMCLOSEDED_EXEC +// ------------------------------ +#ifndef BMCLOSEDED_EXEC_EXPORT_H +#define BMCLOSEDED_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMCLOSEDED_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMCLOSEDED_EXEC_NTRACE == 1) */ + +#endif /* BMCLOSEDED_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_stub_export.h new file mode 100644 index 00000000000..a2511681640 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMCLOSEDED_STUB +// ------------------------------ +#ifndef BMCLOSEDED_STUB_EXPORT_H +#define BMCLOSEDED_STUB_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMCLOSEDED_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMCLOSEDED_STUB_NTRACE == 1) */ + +#endif /* BMCLOSEDED_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.cpp new file mode 100644 index 00000000000..b27c29fc434 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.cpp @@ -0,0 +1,1474 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#include "BMClosedED_svnt.h" +#include "Cookies.h" + +namespace CIAO_GLUE_BasicSP +{ + ReadData_Servant::ReadData_Servant ( + ::BasicSP::CCM_ReadData_ptr executor, + ::Components::CCMContext_ptr c) + : executor_ (::BasicSP::CCM_ReadData::_duplicate (executor)), + ctx_ (::Components::CCMContext::_duplicate (c)) + { + } + + ReadData_Servant::~ReadData_Servant (void) + { + } + + char * + ReadData_Servant::get_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->executor_->get_data ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + CORBA::Object_ptr + ReadData_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + } + +} + +namespace CIAO_GLUE_BasicSP +{ + BMClosedED_Context::BMClosedED_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMClosedED_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) + { + } + + BMClosedED_Context::~BMClosedED_Context (void) + { + } + + // Operations from ::Components::CCMContext. + + ::Components::Principal_ptr + BMClosedED_Context::get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Principal::_nil ()); + } + + ::Components::CCMHome_ptr + BMClosedED_Context::get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + BMClosedED_Context::get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::Transaction::UserTransaction_ptr + BMClosedED_Context::get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Transaction::UserTransaction::_nil ()); + } + + CORBA::Boolean + BMClosedED_Context::is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_UNUSED_ARG (role); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + void + BMClosedED_Context::set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW (CORBA::NO_IMPLEMENT ()); + } + + // Operations from ::Components::SessionContext interface. + + CORBA::Object_ptr + BMClosedED_Context::get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = + this->container_->get_objref ( + this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + this->component_ = + ::BasicSP::BMClosedED::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (CORBA::is_nil (this->component_.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + } + + return ::BasicSP::BMClosedED::_duplicate ( + this->component_.in ()); + } + + // Operations for BMClosedED receptacles and event sources, + // defined in ::BasicSP::CCM_BMClosedED_Context. + + ::BasicSP::ReadData_ptr + BMClosedED_Context::get_connection_datain ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::BasicSP::ReadData::_duplicate ( + this->ciao_uses_datain_.in ()); + } + + void + BMClosedED_Context::connect_datain ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + if (! CORBA::is_nil (this->ciao_uses_datain_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + if (CORBA::is_nil (c)) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->ciao_uses_datain_ = + ::BasicSP::ReadData::_duplicate (c); + } + + ::BasicSP::ReadData_ptr + BMClosedED_Context::disconnect_datain ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_uses_datain_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::BasicSP::ReadData::_nil ()); + } + + return this->ciao_uses_datain_._retn (); + } + + void + BMClosedED_Context::push_out_avail ( + ::BasicSP::DataAvailable *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + + // NEW + RtecEventComm::EventSet events (1); + events.length (1); + events[0].header.source = ACE_ES_EVENT_SOURCE_ANY + 3; + events[0].header.type = ACE_ES_EVENT_UNDEFINED + 2; + ::Components::EventBase * ev_base = ev; + ev->_add_ref (); + events[0].data.any_value <<= ev_base; + ciao_proxy_consumer_->push (events ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + // END NEW + + /* + ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::iterator end = + this->ciao_publishes_out_avail_map_.end (); + + for (ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::iterator iter = + this->ciao_publishes_out_avail_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::ENTRY &entry = *iter; + ::BasicSP::DataAvailableConsumer_var c = + ::BasicSP::DataAvailableConsumer::_narrow ( + entry.int_id_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + entry.int_id_->push_DataAvailable ( + ev + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + */ + } + + ::Components::Cookie * + BMClosedED_Context::subscribe_out_avail ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + + // NEW + char * argv[1] = { "BMClosedED_exec" }; + int argc = sizeof (argv) / sizeof (argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->ciao_proxy_consumer_.in ())) + { + ::CORBA::Object_var me = + this->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::String_var ior = orb->object_to_string + (me.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->ciao_uses_event_channel_->connect_supplier + ("DataAvailable", "out_avail", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + CORBA::String_var ior = orb->object_to_string (c ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + ciao_uses_event_channel_->connect_consumer + ("DataAvailable", "data_ready", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + return 0; + // END NEW + + /* + if (CORBA::is_nil (c)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + } + + ::BasicSP::DataAvailableConsumer_var sub = + ::BasicSP::DataAvailableConsumer::_duplicate (c); + + ACE_Active_Map_Manager_Key key; + this->ciao_publishes_out_avail_map_.bind (sub.in (), key); + + sub._retn (); + + ::Components::Cookie_var retv = new ::CIAO::Map_Key_Cookie (key); + return retv._retn (); + */ + } + + ::BasicSP::DataAvailableConsumer_ptr + BMClosedED_Context::unsubscribe_out_avail ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + + return ::BasicSP::DataAvailableConsumer::_nil (); + + /* + ::BasicSP::DataAvailableConsumer_var retv; + ACE_Active_Map_Manager_Key key; + + if (ck == 0 || ::CIAO::Map_Key_Cookie::extract (ck, key) == -1) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::DataAvailableConsumer::_nil ()); + } + + if (this->ciao_publishes_out_avail_map_.unbind (key, retv) != 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::DataAvailableConsumer::_nil ()); + } + + return retv._retn (); + */ + } + + // NEW + void + BMClosedED_Context::connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer) + { + ciao_proxy_consumer_ = proxy_consumer; + } + // END NEW + + ::BasicSP::RTEventChannel_ptr + BMClosedED_Context::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::BasicSP::RTEventChannel::_duplicate ( + this->ciao_uses_event_channel_.in ()); + } + + void + BMClosedED_Context::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + if (! CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + if (CORBA::is_nil (c)) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->ciao_uses_event_channel_ = + ::BasicSP::RTEventChannel::_duplicate (c); + } + + ::BasicSP::RTEventChannel_ptr + BMClosedED_Context::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::BasicSP::RTEventChannel::_nil ()); + } + + return this->ciao_uses_event_channel_._retn (); + } + + + BMClosedED_Servant::BMClosedED_Servant ( + ::BasicSP::CCM_BMClosedED_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMClosedED::_duplicate (exe)), + container_ (c) + { + this->context_ = new BMClosedED_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->set_session_context ( + this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + } + + BMClosedED_Servant::~BMClosedED_Servant (void) + { + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + this->context_->_remove_ref (); + } + + ::BasicSP::ReadData_ptr + BMClosedED_Servant::provide_dataout ( + ACE_ENV_SINGLE_ARG_PARAMETER) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (this->provide_dataout_.in ())) + { + ::BasicSP::CCM_ReadData_var fexe = + this->executor_->get_dataout (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + if (::CORBA::is_nil (fexe.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::ReadData::_nil ()); + } + + ReadData_Servant *svt = + new ReadData_Servant ( + fexe.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + ::CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + ::BasicSP::ReadData_var fo = + ::BasicSP::ReadData::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + this->provide_dataout_ = fo; + } + + return ::BasicSP::ReadData::_duplicate (this->provide_dataout_.in ()); + } + + void + BMClosedED_Servant::connect_datain ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + this->context_->connect_datain ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::ReadData_ptr + BMClosedED_Servant::disconnect_datain ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_datain ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::BasicSP::ReadData_ptr + BMClosedED_Servant::get_connection_datain ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_connection_datain ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::Cookie * + BMClosedED_Servant::subscribe_out_avail ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + return this->context_->subscribe_out_avail ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::DataAvailableConsumer_ptr + BMClosedED_Servant::unsubscribe_out_avail ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + return this->context_->unsubscribe_out_avail ( + ck + ACE_ENV_ARG_PARAMETER); + } + + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant::DataAvailableConsumer_in_avail_Servant ( + ::BasicSP::CCM_BMClosedED_ptr executor, + ::BasicSP::CCM_BMClosedED_Context_ptr c) + : executor_ (::BasicSP::CCM_BMClosedED::_duplicate (executor)), + ctx_ (::BasicSP::CCM_BMClosedED_Context::_duplicate (c)) + { + } + + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant::~DataAvailableConsumer_in_avail_Servant (void) + { + } + + CORBA::Object_ptr + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant::push_DataAvailable ( + ::BasicSP::DataAvailable *evt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->push_in_avail ( + evt + ACE_ENV_ARG_PARAMETER); + } + + // Inherited from ::Components::EventConsumerBase. + void + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant::push_event ( + ::Components::EventBase *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)) + { + ::BasicSP::DataAvailable_var ev_type = + ::BasicSP::DataAvailable::_downcast (ev); + + if (ev_type != 0) + { + this->push_DataAvailable ( + ev_type.in () + ACE_ENV_SINGLE_ARG_PARAMETER); + + return; + } + + ACE_THROW (::Components::BadEventType ()); + } + + ::BasicSP::DataAvailableConsumer_ptr + BMClosedED_Servant::get_consumer_in_avail ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (CORBA::is_nil (this->consumes_in_avail_.in ())) + { + BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant *svt = + new BMClosedED_Servant::DataAvailableConsumer_in_avail_Servant ( + this->executor_.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::DataAvailableConsumer::_nil ()); + + ::BasicSP::DataAvailableConsumer_var eco = + ::BasicSP::DataAvailableConsumer::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::DataAvailableConsumer::_nil ()); + + this->consumes_in_avail_ = eco; + } + + return ::BasicSP::DataAvailableConsumer::_duplicate (this->consumes_in_avail_.in ()); + } + + void + BMClosedED_Servant::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + this->context_->connect_event_channel ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + BMClosedED_Servant::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + BMClosedED_Servant::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for Navigation interface. + + CORBA::Object_ptr + BMClosedED_Servant::provide_facet ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "dataout") == 0) + { + return this->provide_dataout (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::FacetDescriptions * + BMClosedED_Servant::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::FacetDescriptions * + BMClosedED_Servant::get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + CORBA::Boolean + BMClosedED_Servant::same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (object_ref)) + { + ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent ( + the_other.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Receptacles interface. + + ::Components::Cookie * + BMClosedED_Servant::connect ( + const char *name, + ::CORBA::Object_ptr connection + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)) + { + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (name, "datain") == 0) + { + ::BasicSP::ReadData_var _ciao_conn = + ::BasicSP::ReadData::_narrow ( + connection + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_conn.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + // Simplex connect. + this->connect_datain ( + _ciao_conn.in () + ACE_ENV_ARG_PARAMETER); + + return 0; + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + ::BasicSP::RTEventChannel_var _ciao_conn = + ::BasicSP::RTEventChannel::_narrow ( + connection + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_conn.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + // Simplex connect. + this->connect_event_channel ( + _ciao_conn.in () + ACE_ENV_ARG_PARAMETER); + + return 0; + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + BMClosedED_Servant::disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "datain") == 0) + { + // Simplex disconnect. + return this->disconnect_datain (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + // Simplex disconnect. + return this->disconnect_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::ConnectionDescriptions * + BMClosedED_Servant::get_connections ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMClosedED_Servant::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMClosedED_Servant::get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for Events interface. + + // NEW + void + BMClosedED_Servant::connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + this->context_->connect_proxy_consumer (proxy_consumer); + } + // END NEW + + ::Components::EventConsumerBase_ptr + BMClosedED_Servant::get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (sink_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (sink_name, "in_avail") == 0) + { + return this->get_consumer_in_avail (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ::Components::Cookie * + BMClosedED_Servant::subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscribe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (publisher_name, "out_avail") == 0) + { + ::BasicSP::DataAvailableConsumer_var _ciao_consumer = + ::BasicSP::DataAvailableConsumer::_narrow ( + subscribe + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_consumer.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + return this->subscribe_out_avail ( + _ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + BMClosedED_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (publisher_name, "out_avail") == 0) + { + return this->unsubscribe_out_avail ( + ck + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + void + BMClosedED_Servant::connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + ACE_THROW (::CORBA::NO_IMPLEMENT ()); + } + + ::Components::EventConsumerBase_ptr + BMClosedED_Servant::disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMClosedED_Servant::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMClosedED_Servant::get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMClosedED_Servant::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMClosedED_Servant::get_named_emitters ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMClosedED_Servant::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMClosedED_Servant::get_named_publishers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for CCMObject interface. + + CORBA::IRObject_ptr + BMClosedED_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::Components::CCMHome_ptr + BMClosedED_Servant::get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::PrimaryKeyBase * + BMClosedED_Servant::get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)) + { + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); + } + + void + BMClosedED_Servant::configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)) + { + // CIAO to-do + } + + void + BMClosedED_Servant::remove ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + // CIAO to-do + } + + ::Components::ComponentPortDescription * + BMClosedED_Servant::get_all_ports ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + BMClosedED_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + + // CIAO-specific operations. + + void + BMClosedED_Servant::_ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + void + BMClosedED_Servant::_ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + // Supported operations. + + + BMClosedEDHome_Servant::BMClosedEDHome_Servant ( + ::BasicSP::CCM_BMClosedEDHome_ptr exe, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMClosedEDHome::_duplicate (exe)), + container_ (c) + { + } + + BMClosedEDHome_Servant::~BMClosedEDHome_Servant (void) + { + } + + // Operations for keyless home interface. + + ::Components::CCMObject_ptr + BMClosedEDHome_Servant::create_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for implicit home interface. + + ::BasicSP::BMClosedED_ptr + BMClosedEDHome_Servant::create ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + if (this->executor_.in () == 0) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::BMClosedED::_nil ()); + } + + Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + ::BasicSP::CCM_BMClosedED_var _ciao_comp = + ::BasicSP::CCM_BMClosedED::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for CCMHome interface. + + ::CORBA::IRObject_ptr + BMClosedEDHome_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::CORBA::IRObject_ptr + BMClosedEDHome_Servant::get_home_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + void + BMClosedEDHome_Servant::remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + ::BasicSP::BMClosedED_var _ciao_comp = + ::BasicSP::BMClosedED::_narrow ( + comp + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (_ciao_comp.in ())) + { + ACE_THROW (CORBA::INTERNAL ()); + } + + _ciao_comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->_ciao_passivate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // CIAO-specific operations. + + ::BasicSP::BMClosedED_ptr + BMClosedEDHome_Servant::_ciao_activate_component ( + ::BasicSP::CCM_BMClosedED_ptr exe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var hobj = + this->container_->get_objref ( + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + ::Components::CCMHome_var home = + ::Components::CCMHome::_narrow ( + hobj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + BMClosedED_Servant *svt = + new BMClosedED_Servant ( + exe, + home.in (), + this->container_); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_component ( + svt, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + svt->_ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + ::BasicSP::BMClosedED_var ho = + ::BasicSP::BMClosedED::_narrow ( + objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMClosedED::_nil ()); + + if (this->component_map_.bind (oid.in (), svt) == 0) + { + safe._retn (); + } + + return ho._retn (); + } + + void + BMClosedEDHome_Servant::_ciao_passivate_component ( + ::BasicSP::BMClosedED_ptr comp + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid; + + this->container_->uninstall_component ( + comp, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + BMClosedED_Servant *servant = 0; + + if (this->component_map_.unbind (oid.in (), servant) == 0) + { + PortableServer::ServantBase_var safe (servant); + servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + // Supported operations. + + +} + +extern "C" BMCLOSEDED_SVNT_Export ::PortableServer::Servant +createBMClosedEDHome_Servant ( +::Components::HomeExecutorBase_ptr p, +CIAO::Session_Container *c +ACE_ENV_ARG_DECL) +{ + if (p == 0) + { + return 0; + } + + ::BasicSP::CCM_BMClosedEDHome_var x = + ::BasicSP::CCM_BMClosedEDHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + ::CIAO_GLUE_BasicSP::BMClosedEDHome_Servant ( + x.in (), + c); +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.h new file mode 100644 index 00000000000..3e3daf15b4c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt.h @@ -0,0 +1,711 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#ifndef CIAO_GLUE_SESSION_BMCLOSEDED_SVNT_H +#define CIAO_GLUE_SESSION_BMCLOSEDED_SVNT_H +#include "ace/pre.h" + +#include "BMClosedEDS.h" +#include "BMClosedEDEC.h" + +#include "ciao/Container_Base.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +//NEW +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "Event_Utilities.h" +// END NEW + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO_GLUE_BasicSP +{ + class BMCLOSEDED_SVNT_Export ReadData_Servant + : public virtual POA_BasicSP::ReadData, + public virtual PortableServer::RefCountServantBase + { + public: + ReadData_Servant ( + ::BasicSP::CCM_ReadData_ptr executor, + ::Components::CCMContext_ptr ctx); + + virtual ~ReadData_Servant (void); + + virtual char * + get_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Facet executor. + ::BasicSP::CCM_ReadData_var executor_; + + // Context object. + ::Components::CCMContext_var ctx_; + }; + +} + +namespace CIAO_GLUE_BasicSP +{ + class BMCLOSEDED_SVNT_Export BMClosedED_Context + : public virtual ::BasicSP::CCM_BMClosedED_Context, + public virtual TAO_Local_RefCounted_Object + { + public: + // We will allow the servant glue code we generate to access our state. + friend class BMClosedED_Servant; + + BMClosedED_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMClosedED_Servant *sv); + + virtual ~BMClosedED_Context (void); + + // Operations from ::Components::CCMContext. + + virtual ::Components::Principal_ptr + get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations from ::Components::SessionContext interface. + + virtual CORBA::Object_ptr + get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations for BMClosedED receptacles and event sources, + // defined in ::BasicSP::CCM_BMClosedED_Context. + + virtual ::BasicSP::ReadData_ptr + get_connection_datain ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_out_avail ( + ::BasicSP::DataAvailable *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Methods that manage this component's connections and consumers. + + virtual void + connect_datain ( + ::BasicSP::ReadData_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::ReadData_ptr + disconnect_datain ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + virtual ::Components::Cookie * + subscribe_out_avail ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::DataAvailableConsumer_ptr + unsubscribe_out_avail ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + // NEW + void + connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer); + // END NEW + + protected: + + // NEW + RtecEventChannelAdmin::ProxyPushConsumer_var + ciao_proxy_consumer_; + // END NEW + + // Simplex datain connection. + ::BasicSP::ReadData_var + ciao_uses_datain_; + + /* + ACE_Active_Map_Manager< + ::BasicSP::DataAvailableConsumer_var> + ciao_publishes_out_avail_map_; + */ + + // Simplex event_channel connection. + ::BasicSP::RTEventChannel_var + ciao_uses_event_channel_; + + ::Components::CCMHome_var + home_; + + ::CIAO::Session_Container * + container_; + + BMClosedED_Servant * + servant_; + + ::BasicSP::BMClosedED_var + component_; + }; + + class BMCLOSEDED_SVNT_Export BMClosedED_Servant + : public virtual POA_BasicSP::BMClosedED, + public virtual PortableServer::RefCountServantBase + { + public: + BMClosedED_Servant ( + ::BasicSP::CCM_BMClosedED_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~BMClosedED_Servant (void); + + virtual ::BasicSP::ReadData_ptr + provide_dataout ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + connect_datain ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::ReadData_ptr + disconnect_datain ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::ReadData_ptr + get_connection_datain ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::Cookie * + subscribe_out_avail ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::DataAvailableConsumer_ptr + unsubscribe_out_avail ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + // Servant class for the in_avail consumer. + class BMCLOSEDED_SVNT_Export DataAvailableConsumer_in_avail_Servant + : public virtual POA_BasicSP::DataAvailableConsumer, + public virtual PortableServer::RefCountServantBase + { + public: + DataAvailableConsumer_in_avail_Servant ( + ::BasicSP::CCM_BMClosedED_ptr executor, + ::BasicSP::CCM_BMClosedED_Context_ptr c); + + virtual ~DataAvailableConsumer_in_avail_Servant (void); + + virtual void + push_DataAvailable ( + ::BasicSP::DataAvailable *evt + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Inherited from ::Components::EventConsumerBase. + virtual void + push_event (::Components::EventBase *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMClosedED_var + executor_; + + ::BasicSP::CCM_BMClosedED_Context_var + ctx_; + }; + + virtual ::BasicSP::DataAvailableConsumer_ptr + get_consumer_in_avail ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Navigation interface. + + virtual CORBA::Object_ptr + provide_facet ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::FacetDescriptions * + get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual CORBA::Boolean + same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface. + + virtual ::Components::Cookie * + connect ( + const char *name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr + disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for Events interface. + + // NEW + virtual void + connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + // END NEW + + virtual ::Components::EventConsumerBase_ptr + get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::Cookie * + subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void + connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for CCMObject interface. + + virtual CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)); + + virtual void + configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)); + + virtual void + remove ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific operations. + + void + _ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMClosedED_var + executor_; + + BMClosedED_Context * + context_; + + ::CIAO::Session_Container * + container_; + + ::BasicSP::ReadData_var + provide_dataout_; + + ::BasicSP::DataAvailableConsumer_var + consumes_in_avail_; + + }; + + class BMCLOSEDED_SVNT_Export BMClosedEDHome_Servant + : public virtual POA_BasicSP::BMClosedEDHome, + public virtual PortableServer::RefCountServantBase + { + public: + BMClosedEDHome_Servant ( + ::BasicSP::CCM_BMClosedEDHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~BMClosedEDHome_Servant (void); + + // Home factory and other operations. + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr + create_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for implicit home interface. + + virtual ::BasicSP::BMClosedED_ptr + create ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + // Supported operations. + + protected: + // CIAO-specific operations. + + ::BasicSP::BMClosedED_ptr + _ciao_activate_component ( + ::BasicSP::CCM_BMClosedED_ptr exe + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate_component ( + ::BasicSP::BMClosedED_ptr comp + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMClosedEDHome_var + executor_; + + ::CIAO::Session_Container * + container_; + + ACE_Hash_Map_Manager_Ex< + PortableServer::ObjectId, + BMClosedED_Servant *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + component_map_; + }; + + extern "C" BMCLOSEDED_SVNT_Export ::PortableServer::Servant + createBMClosedEDHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + +} + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_BMCLOSEDED_SVNT_H */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt_export.h new file mode 100644 index 00000000000..bcabbe1023e --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMClosedED/BMClosedED_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMCLOSEDED_SVNT +// ------------------------------ +#ifndef BMCLOSEDED_SVNT_EXPORT_H +#define BMCLOSEDED_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMCLOSEDED_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMCLOSEDED_SVNT_NTRACE == 1) */ + +#endif /* BMCLOSEDED_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.cidl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.cidl new file mode 100644 index 00000000000..30026cf8c13 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.cidl @@ -0,0 +1,19 @@ +//$Id$ + +#ifndef BMDEVICE_CIDL +#define BMDEVICE_CIDL + +#include "BMDevice.idl" + +composition session BMDevice_Impl +{ + home executor BMDeviceHome_Exec + { + implements BasicSP::BMDeviceHome; + manages BMDevice_Exec; + }; +}; + +#endif /* BMDEVICE_CIDL */ + + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.idl new file mode 100644 index 00000000000..3732aa091ad --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.idl @@ -0,0 +1,31 @@ +//$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; + uses RTEventChannel event_channel; + }; + + home BMDeviceHome manages BMDevice + { + }; +}; + +#endif /*CIAO_BMDEVICE_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.mpc new file mode 100644 index 00000000000..2c618860cb9 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice.mpc @@ -0,0 +1,64 @@ +// $Id$ + +project(BMDevice_stub): ciao_client { + after += BasicSP_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_svnt) : ciao_servant { + after += BMDevice_stub BasicSP_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_exec) : ciao_component { + after += BMDevice_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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDeviceEI.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDeviceEI.idl new file mode 100644 index 00000000000..18a4ad9eaa4 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.cpp new file mode 100644 index 00000000000..a53ce4f3836 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.cpp @@ -0,0 +1,133 @@ +// $Id$ + +#include "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_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return BasicSP::CCM_ReadData::_duplicate (this); +} + +void +MyImpl::BMDevice_exec_i::push_timeout (BasicSP::TimeOut * + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Nitify others + BasicSP::DataAvailable_var event = new OBV_BasicSP::DataAvailable; + + ACE_DEBUG ((LM_DEBUG, + "BMDevice, received a timeout from EC \n")); + + this->context_->push_data_available (event + ACE_ENV_ARG_PARAMETER); +} + +char * +MyImpl::BMDevice_exec_i::data_read (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->str_; +} + +char * +MyImpl::BMDevice_exec_i::get_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->data_read (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +// Operations from Components::SessionComponent +void +MyImpl::BMDevice_exec_i::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDevice_exec_i::set_session_context\n")); + + this->context_ = + BasicSP::CCM_BMDevice_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMDevice_exec_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDevice_exec_i::ccm_activate\n")); + char *argv[1] = { "BMDevice_exec"}; + + int argc = sizeof(argv)/sizeof(argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv ACE_ENV_ARG_PARAMETER); + + CIAO_REGISTER_VALUE_FACTORY (orb.in(), BasicSP::TimeOut_init, + BasicSP::TimeOut); +} + +void +MyImpl::BMDevice_exec_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDevice_exec_i::ccm_passivate\n")); +} + +void +MyImpl::BMDevice_exec_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + 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_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::BMDevice_exec_i; +} + + +extern "C" BMDEVICE_EXEC_Export ::Components::HomeExecutorBase_ptr +createBMDeviceHome_Impl (void) +{ + return new MyImpl::BMDeviceHome_exec_i; +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.h new file mode 100644 index 00000000000..d65cbca8b9b --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec.h @@ -0,0 +1,122 @@ +// $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_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + push_timeout (BasicSP::TimeOut *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from BasicSP::position + + virtual char * + data_read (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual char * + get_data (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + protected: + 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_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec_export.h new file mode 100644 index 00000000000..0aa2a34ba17 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDEVICE_EXEC +// ------------------------------ +#ifndef BMDEVICE_EXEC_EXPORT_H +#define BMDEVICE_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDEVICE_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDEVICE_EXEC_NTRACE == 1) */ + +#endif /* BMDEVICE_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_stub_export.h new file mode 100644 index 00000000000..b0f1a552d4b --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDEVICE_STUB +// ------------------------------ +#ifndef BMDEVICE_STUB_EXPORT_H +#define BMDEVICE_STUB_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDEVICE_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDEVICE_STUB_NTRACE == 1) */ + +#endif /* BMDEVICE_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.cpp new file mode 100644 index 00000000000..be9d6180a01 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.cpp @@ -0,0 +1,1363 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#include "BMDevice_svnt.h" +#include "Cookies.h" + +namespace CIAO_GLUE_BasicSP +{ + ReadData_Servant::ReadData_Servant ( + ::BasicSP::CCM_ReadData_ptr executor, + ::Components::CCMContext_ptr c) + : executor_ (::BasicSP::CCM_ReadData::_duplicate (executor)), + ctx_ (::Components::CCMContext::_duplicate (c)) + { + } + + ReadData_Servant::~ReadData_Servant (void) + { + } + + char * + ReadData_Servant::get_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->executor_->get_data ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + CORBA::Object_ptr + ReadData_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + } + +} + +namespace CIAO_GLUE_BasicSP +{ + BMDevice_Context::BMDevice_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMDevice_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) + { + } + + BMDevice_Context::~BMDevice_Context (void) + { + } + + // Operations from ::Components::CCMContext. + + ::Components::Principal_ptr + BMDevice_Context::get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Principal::_nil ()); + } + + ::Components::CCMHome_ptr + BMDevice_Context::get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + BMDevice_Context::get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::Transaction::UserTransaction_ptr + BMDevice_Context::get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Transaction::UserTransaction::_nil ()); + } + + CORBA::Boolean + BMDevice_Context::is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_UNUSED_ARG (role); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + void + BMDevice_Context::set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW (CORBA::NO_IMPLEMENT ()); + } + + // Operations from ::Components::SessionContext interface. + + CORBA::Object_ptr + BMDevice_Context::get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = + this->container_->get_objref ( + this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + this->component_ = + ::BasicSP::BMDevice::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (CORBA::is_nil (this->component_.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + } + + return ::BasicSP::BMDevice::_duplicate ( + this->component_.in ()); + } + + // Operations for BMDevice receptacles and event sources, + // defined in ::BasicSP::CCM_BMDevice_Context. + + void + BMDevice_Context::push_data_available ( + ::BasicSP::DataAvailable *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + + // NEW + RtecEventComm::EventSet events (1); + events.length (1); + events[0].header.source = ACE_ES_EVENT_SOURCE_ANY + 2; + events[0].header.type = ACE_ES_EVENT_UNDEFINED + 2; + ::Components::EventBase * ev_base = ev; + ev->_add_ref (); + events[0].data.any_value <<= ev_base; + ciao_proxy_consumer_->push (events ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + // END NEW + + /* + ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::iterator end = + this->ciao_publishes_data_available_map_.end (); + + for (ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::iterator iter = + this->ciao_publishes_data_available_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager<::BasicSP::DataAvailableConsumer_var>::ENTRY &entry = *iter; + ::BasicSP::DataAvailableConsumer_var c = + ::BasicSP::DataAvailableConsumer::_narrow ( + entry.int_id_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + entry.int_id_->push_DataAvailable ( + ev + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + */ + } + + ::Components::Cookie * + BMDevice_Context::subscribe_data_available ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + + // NEW + char * argv[1] = { "BMDevice_exec" }; + int argc = sizeof (argv) / sizeof (argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->ciao_proxy_consumer_.in ())) + { + ::CORBA::Object_var me = + this->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::String_var ior = orb->object_to_string + (me.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->ciao_uses_event_channel_->connect_supplier + ("DataAvailable", "data_available", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + CORBA::String_var ior = orb->object_to_string (c ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + ciao_uses_event_channel_->connect_consumer + ("DataAvailable", "in_avail", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + return 0; + // END NEW + + /* + if (CORBA::is_nil (c)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + } + + ::BasicSP::DataAvailableConsumer_var sub = + ::BasicSP::DataAvailableConsumer::_duplicate (c); + + ACE_Active_Map_Manager_Key key; + this->ciao_publishes_data_available_map_.bind (sub.in (), key); + + sub._retn (); + + ::Components::Cookie_var retv = new ::CIAO::Map_Key_Cookie (key); + return retv._retn (); + */ + } + + ::BasicSP::DataAvailableConsumer_ptr + BMDevice_Context::unsubscribe_data_available ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + return ::BasicSP::DataAvailableConsumer::_nil (); + + /* + ::BasicSP::DataAvailableConsumer_var retv; + ACE_Active_Map_Manager_Key key; + + if (ck == 0 || ::CIAO::Map_Key_Cookie::extract (ck, key) == -1) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::DataAvailableConsumer::_nil ()); + } + + if (this->ciao_publishes_data_available_map_.unbind (key, retv) != 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::DataAvailableConsumer::_nil ()); + } + + return retv._retn (); + */ + } + + // NEW + void + BMDevice_Context::connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer) + { + ciao_proxy_consumer_ = proxy_consumer; + } + // END NEW + + ::BasicSP::RTEventChannel_ptr + BMDevice_Context::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::BasicSP::RTEventChannel::_duplicate ( + this->ciao_uses_event_channel_.in ()); + } + + void + BMDevice_Context::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + if (! CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + if (CORBA::is_nil (c)) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->ciao_uses_event_channel_ = + ::BasicSP::RTEventChannel::_duplicate (c); + } + + ::BasicSP::RTEventChannel_ptr + BMDevice_Context::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::BasicSP::RTEventChannel::_nil ()); + } + + return this->ciao_uses_event_channel_._retn (); + } + + + BMDevice_Servant::BMDevice_Servant ( + ::BasicSP::CCM_BMDevice_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMDevice::_duplicate (exe)), + container_ (c) + { + this->context_ = new BMDevice_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->set_session_context ( + this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + } + + BMDevice_Servant::~BMDevice_Servant (void) + { + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + this->context_->_remove_ref (); + } + + ::BasicSP::ReadData_ptr + BMDevice_Servant::provide_data_read ( + ACE_ENV_SINGLE_ARG_PARAMETER) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (this->provide_data_read_.in ())) + { + ::BasicSP::CCM_ReadData_var fexe = + this->executor_->get_data_read (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + if (::CORBA::is_nil (fexe.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::ReadData::_nil ()); + } + + ReadData_Servant *svt = + new ReadData_Servant ( + fexe.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + ::CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + ::BasicSP::ReadData_var fo = + ::BasicSP::ReadData::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::ReadData::_nil ()); + + this->provide_data_read_ = fo; + } + + return ::BasicSP::ReadData::_duplicate (this->provide_data_read_.in ()); + } + + ::Components::Cookie * + BMDevice_Servant::subscribe_data_available ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + return this->context_->subscribe_data_available ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::DataAvailableConsumer_ptr + BMDevice_Servant::unsubscribe_data_available ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + return this->context_->unsubscribe_data_available ( + ck + ACE_ENV_ARG_PARAMETER); + } + + BMDevice_Servant::TimeOutConsumer_timeout_Servant::TimeOutConsumer_timeout_Servant ( + ::BasicSP::CCM_BMDevice_ptr executor, + ::BasicSP::CCM_BMDevice_Context_ptr c) + : executor_ (::BasicSP::CCM_BMDevice::_duplicate (executor)), + ctx_ (::BasicSP::CCM_BMDevice_Context::_duplicate (c)) + { + } + + BMDevice_Servant::TimeOutConsumer_timeout_Servant::~TimeOutConsumer_timeout_Servant (void) + { + } + + CORBA::Object_ptr + BMDevice_Servant::TimeOutConsumer_timeout_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + BMDevice_Servant::TimeOutConsumer_timeout_Servant::push_TimeOut ( + ::BasicSP::TimeOut *evt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->push_timeout ( + evt + ACE_ENV_ARG_PARAMETER); + } + + // Inherited from ::Components::EventConsumerBase. + void + BMDevice_Servant::TimeOutConsumer_timeout_Servant::push_event ( + ::Components::EventBase *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)) + { + ::BasicSP::TimeOut_var ev_type = + ::BasicSP::TimeOut::_downcast (ev); + + if (ev_type != 0) + { + this->push_TimeOut ( + ev_type.in () + ACE_ENV_SINGLE_ARG_PARAMETER); + + return; + } + + ACE_THROW (::Components::BadEventType ()); + } + + ::BasicSP::TimeOutConsumer_ptr + BMDevice_Servant::get_consumer_timeout ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (CORBA::is_nil (this->consumes_timeout_.in ())) + { + BMDevice_Servant::TimeOutConsumer_timeout_Servant *svt = + new BMDevice_Servant::TimeOutConsumer_timeout_Servant ( + this->executor_.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::TimeOutConsumer::_nil ()); + + ::BasicSP::TimeOutConsumer_var eco = + ::BasicSP::TimeOutConsumer::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::TimeOutConsumer::_nil ()); + + this->consumes_timeout_ = eco; + } + + return ::BasicSP::TimeOutConsumer::_duplicate (this->consumes_timeout_.in ()); + } + + void + BMDevice_Servant::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + this->context_->connect_event_channel ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + BMDevice_Servant::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + BMDevice_Servant::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for Navigation interface. + + CORBA::Object_ptr + BMDevice_Servant::provide_facet ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "data_read") == 0) + { + return this->provide_data_read (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::FacetDescriptions * + BMDevice_Servant::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::FacetDescriptions * + BMDevice_Servant::get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + CORBA::Boolean + BMDevice_Servant::same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (object_ref)) + { + ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent ( + the_other.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Receptacles interface. + + ::Components::Cookie * + BMDevice_Servant::connect ( + const char *name, + ::CORBA::Object_ptr connection + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)) + { + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + ::BasicSP::RTEventChannel_var _ciao_conn = + ::BasicSP::RTEventChannel::_narrow ( + connection + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_conn.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + // Simplex connect. + this->connect_event_channel ( + _ciao_conn.in () + ACE_ENV_ARG_PARAMETER); + + return 0; + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + BMDevice_Servant::disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + // Simplex disconnect. + return this->disconnect_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::ConnectionDescriptions * + BMDevice_Servant::get_connections ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMDevice_Servant::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMDevice_Servant::get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for Events interface. + + // NEW + void + BMDevice_Servant::connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + this->context_->connect_proxy_consumer (proxy_consumer); + } + // END NEW + + ::Components::EventConsumerBase_ptr + BMDevice_Servant::get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (sink_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (sink_name, "timeout") == 0) + { + return this->get_consumer_timeout (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ::Components::Cookie * + BMDevice_Servant::subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscribe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (publisher_name, "data_available") == 0) + { + ::BasicSP::DataAvailableConsumer_var _ciao_consumer = + ::BasicSP::DataAvailableConsumer::_narrow ( + subscribe + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_consumer.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + return this->subscribe_data_available ( + _ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + BMDevice_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (publisher_name, "data_available") == 0) + { + return this->unsubscribe_data_available ( + ck + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + void + BMDevice_Servant::connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + ACE_THROW (::CORBA::NO_IMPLEMENT ()); + } + + ::Components::EventConsumerBase_ptr + BMDevice_Servant::disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMDevice_Servant::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMDevice_Servant::get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMDevice_Servant::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMDevice_Servant::get_named_emitters ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMDevice_Servant::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMDevice_Servant::get_named_publishers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for CCMObject interface. + + CORBA::IRObject_ptr + BMDevice_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::Components::CCMHome_ptr + BMDevice_Servant::get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::PrimaryKeyBase * + BMDevice_Servant::get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)) + { + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); + } + + void + BMDevice_Servant::configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)) + { + // CIAO to-do + } + + void + BMDevice_Servant::remove ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + // CIAO to-do + } + + ::Components::ComponentPortDescription * + BMDevice_Servant::get_all_ports ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + BMDevice_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + + // CIAO-specific operations. + + void + BMDevice_Servant::_ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + void + BMDevice_Servant::_ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + // Supported operations. + + + BMDeviceHome_Servant::BMDeviceHome_Servant ( + ::BasicSP::CCM_BMDeviceHome_ptr exe, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMDeviceHome::_duplicate (exe)), + container_ (c) + { + } + + BMDeviceHome_Servant::~BMDeviceHome_Servant (void) + { + } + + // Operations for keyless home interface. + + ::Components::CCMObject_ptr + BMDeviceHome_Servant::create_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for implicit home interface. + + ::BasicSP::BMDevice_ptr + BMDeviceHome_Servant::create ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + if (this->executor_.in () == 0) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::BMDevice::_nil ()); + } + + Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + ::BasicSP::CCM_BMDevice_var _ciao_comp = + ::BasicSP::CCM_BMDevice::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for CCMHome interface. + + ::CORBA::IRObject_ptr + BMDeviceHome_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::CORBA::IRObject_ptr + BMDeviceHome_Servant::get_home_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + void + BMDeviceHome_Servant::remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + ::BasicSP::BMDevice_var _ciao_comp = + ::BasicSP::BMDevice::_narrow ( + comp + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (_ciao_comp.in ())) + { + ACE_THROW (CORBA::INTERNAL ()); + } + + _ciao_comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->_ciao_passivate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // CIAO-specific operations. + + ::BasicSP::BMDevice_ptr + BMDeviceHome_Servant::_ciao_activate_component ( + ::BasicSP::CCM_BMDevice_ptr exe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var hobj = + this->container_->get_objref ( + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + ::Components::CCMHome_var home = + ::Components::CCMHome::_narrow ( + hobj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + BMDevice_Servant *svt = + new BMDevice_Servant ( + exe, + home.in (), + this->container_); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_component ( + svt, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + svt->_ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + ::BasicSP::BMDevice_var ho = + ::BasicSP::BMDevice::_narrow ( + objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDevice::_nil ()); + + if (this->component_map_.bind (oid.in (), svt) == 0) + { + safe._retn (); + } + + return ho._retn (); + } + + void + BMDeviceHome_Servant::_ciao_passivate_component ( + ::BasicSP::BMDevice_ptr comp + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid; + + this->container_->uninstall_component ( + comp, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + BMDevice_Servant *servant = 0; + + if (this->component_map_.unbind (oid.in (), servant) == 0) + { + PortableServer::ServantBase_var safe (servant); + servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + // Supported operations. + + +} + +extern "C" BMDEVICE_SVNT_Export ::PortableServer::Servant +createBMDeviceHome_Servant ( +::Components::HomeExecutorBase_ptr p, +CIAO::Session_Container *c +ACE_ENV_ARG_DECL) +{ + if (p == 0) + { + return 0; + } + + ::BasicSP::CCM_BMDeviceHome_var x = + ::BasicSP::CCM_BMDeviceHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + ::CIAO_GLUE_BasicSP::BMDeviceHome_Servant ( + x.in (), + c); +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.h new file mode 100644 index 00000000000..830e900d59c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt.h @@ -0,0 +1,669 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#ifndef CIAO_GLUE_SESSION_BMDEVICE_SVNT_H +#define CIAO_GLUE_SESSION_BMDEVICE_SVNT_H +#include "ace/pre.h" + +#include "BMDeviceS.h" +#include "BMDeviceEC.h" + +#include "ciao/Container_Base.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +//NEW +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "Event_Utilities.h" +// END NEW + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO_GLUE_BasicSP +{ + class BMDEVICE_SVNT_Export ReadData_Servant + : public virtual POA_BasicSP::ReadData, + public virtual PortableServer::RefCountServantBase + { + public: + ReadData_Servant ( + ::BasicSP::CCM_ReadData_ptr executor, + ::Components::CCMContext_ptr ctx); + + virtual ~ReadData_Servant (void); + + virtual char * + get_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Facet executor. + ::BasicSP::CCM_ReadData_var executor_; + + // Context object. + ::Components::CCMContext_var ctx_; + }; + +} + +namespace CIAO_GLUE_BasicSP +{ + class BMDEVICE_SVNT_Export BMDevice_Context + : public virtual ::BasicSP::CCM_BMDevice_Context, + public virtual TAO_Local_RefCounted_Object + { + public: + // We will allow the servant glue code we generate to access our state. + friend class BMDevice_Servant; + + BMDevice_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMDevice_Servant *sv); + + virtual ~BMDevice_Context (void); + + // Operations from ::Components::CCMContext. + + virtual ::Components::Principal_ptr + get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations from ::Components::SessionContext interface. + + virtual CORBA::Object_ptr + get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations for BMDevice receptacles and event sources, + // defined in ::BasicSP::CCM_BMDevice_Context. + + virtual void + push_data_available ( + ::BasicSP::DataAvailable *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Methods that manage this component's connections and consumers. + + virtual ::Components::Cookie * + subscribe_data_available ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::DataAvailableConsumer_ptr + unsubscribe_data_available ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + // NEW + void + connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer); + // END NEW + + protected: + + // NEW + RtecEventChannelAdmin::ProxyPushConsumer_var + ciao_proxy_consumer_; + // END NEW + + // OLD + /* + ACE_Active_Map_Manager< + ::BasicSP::DataAvailableConsumer_var> + ciao_publishes_data_available_map_; + */ + // END OLD + + // Simplex event_channel connection. + ::BasicSP::RTEventChannel_var + ciao_uses_event_channel_; + + ::Components::CCMHome_var + home_; + + ::CIAO::Session_Container * + container_; + + BMDevice_Servant * + servant_; + + ::BasicSP::BMDevice_var + component_; + }; + + class BMDEVICE_SVNT_Export BMDevice_Servant + : public virtual POA_BasicSP::BMDevice, + public virtual PortableServer::RefCountServantBase + { + public: + BMDevice_Servant ( + ::BasicSP::CCM_BMDevice_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~BMDevice_Servant (void); + + virtual ::BasicSP::ReadData_ptr + provide_data_read ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::Cookie * + subscribe_data_available ( + ::BasicSP::DataAvailableConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::DataAvailableConsumer_ptr + unsubscribe_data_available ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + // Servant class for the timeout consumer. + class BMDEVICE_SVNT_Export TimeOutConsumer_timeout_Servant + : public virtual POA_BasicSP::TimeOutConsumer, + public virtual PortableServer::RefCountServantBase + { + public: + TimeOutConsumer_timeout_Servant ( + ::BasicSP::CCM_BMDevice_ptr executor, + ::BasicSP::CCM_BMDevice_Context_ptr c); + + virtual ~TimeOutConsumer_timeout_Servant (void); + + virtual void + push_TimeOut ( + ::BasicSP::TimeOut *evt + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Inherited from ::Components::EventConsumerBase. + virtual void + push_event (::Components::EventBase *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDevice_var + executor_; + + ::BasicSP::CCM_BMDevice_Context_var + ctx_; + }; + + virtual ::BasicSP::TimeOutConsumer_ptr + get_consumer_timeout ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Navigation interface. + + virtual CORBA::Object_ptr + provide_facet ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::FacetDescriptions * + get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual CORBA::Boolean + same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface. + + virtual ::Components::Cookie * + connect ( + const char *name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr + disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for Events interface. + + // NEW + virtual void + connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + // END NEW + + virtual ::Components::EventConsumerBase_ptr + get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::Cookie * + subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void + connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for CCMObject interface. + + virtual CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)); + + virtual void + configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)); + + virtual void + remove ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific operations. + + void + _ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDevice_var + executor_; + + BMDevice_Context * + context_; + + ::CIAO::Session_Container * + container_; + + ::BasicSP::ReadData_var + provide_data_read_; + + ::BasicSP::TimeOutConsumer_var + consumes_timeout_; + + }; + + class BMDEVICE_SVNT_Export BMDeviceHome_Servant + : public virtual POA_BasicSP::BMDeviceHome, + public virtual PortableServer::RefCountServantBase + { + public: + BMDeviceHome_Servant ( + ::BasicSP::CCM_BMDeviceHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~BMDeviceHome_Servant (void); + + // Home factory and other operations. + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr + create_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for implicit home interface. + + virtual ::BasicSP::BMDevice_ptr + create ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + // Supported operations. + + protected: + // CIAO-specific operations. + + ::BasicSP::BMDevice_ptr + _ciao_activate_component ( + ::BasicSP::CCM_BMDevice_ptr exe + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate_component ( + ::BasicSP::BMDevice_ptr comp + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDeviceHome_var + executor_; + + ::CIAO::Session_Container * + container_; + + ACE_Hash_Map_Manager_Ex< + PortableServer::ObjectId, + BMDevice_Servant *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + component_map_; + }; + + extern "C" BMDEVICE_SVNT_Export ::PortableServer::Servant + createBMDeviceHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + +} + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_BMDEVICE_SVNT_H */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt_export.h new file mode 100644 index 00000000000..653db47fefb --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDevice/BMDevice_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDEVICE_SVNT +// ------------------------------ +#ifndef BMDEVICE_SVNT_EXPORT_H +#define BMDEVICE_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDEVICE_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDEVICE_SVNT_NTRACE == 1) */ + +#endif /* BMDEVICE_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.cidl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.cidl new file mode 100644 index 00000000000..4342aa753c8 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.idl new file mode 100644 index 00000000000..cbeed950b07 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.mpc new file mode 100644 index 00000000000..5c0a113b9c8 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay.mpc @@ -0,0 +1,60 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p BasicSP -i BMDisplay" + +project(BMDisplay_stub): ciao_client { + after += BasicSP_stub + sharedname = BMDisplay_stub + idlflags += -Wb,stub_export_macro=BMDISPLAY_STUB_Export -Wb,stub_export_include=BMDisplay_stub_export.h -Wb,skel_export_macro=BMDISPLAY_SVNT_Export -Wb,skel_export_include=BMDisplay_svnt_export.h + dynamicflags = BMDISPLAY_STUB_BUILD_DLL + + IDL_Files { + BMDisplay.idl + } + + Source_Files { + BMDisplayC.cpp + } +} + +project(BMDisplay_svnt) : ciao_servant { + after += BasicSP_svnt BMDisplay_stub + sharedname = BMDisplay_svnt + libs += BMDisplay_stub BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMDISPLAY_SVNT_Export -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_exec) : ciao_component { + after += BMDisplay_svnt + sharedname = BMDisplay_exec + libs += BMDisplay_stub BMDisplay_svnt BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=BMDISPLAY_EXEC_Export -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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplayEI.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplayEI.idl new file mode 100644 index 00000000000..8a218debab1 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.cpp new file mode 100644 index 00000000000..f7ac0de4c4a --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.cpp @@ -0,0 +1,135 @@ +// $Id$ + +#include "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_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_UNUSED_ARG (ev); + + 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 (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (dat.in ())) + ACE_THROW (CORBA::BAD_INV_ORDER ()); + + char *str = + dat->get_data (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, + "BMDisplay - Display data is [%s] \n", + str)); + +} + +// Operations from Components::SessionComponent +void +MyImpl::BMDisplay_exec_impl::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDisplay_exec_impl::set_session_context\n")); + + this->context_ = + BasicSP::CCM_BMDisplay_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. +} + +void +MyImpl::BMDisplay_exec_impl::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDisplay_exec_impl::ccm_activate\n")); + + // @@ This hack work around a missing feature in CIAO's assembly + // mechanism where a Softpkg descriptor can specify it's dependency + // to a valuetype factory and instruct the deployment framework to + // initialize and register the corresponding valuefactory in the + // component server. Here, we are registering the valuefactory + // explicitly to work around this problem. + + char *argv[1] = { "BMDisplay_exec"}; + + int argc = sizeof(argv)/sizeof(argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv ACE_ENV_ARG_PARAMETER); + + CIAO_REGISTER_VALUE_FACTORY (orb.in(), BasicSP::DataAvailable_init, + BasicSP::DataAvailable); +} + +void +MyImpl::BMDisplay_exec_impl::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::BMDisplay_exec_impl::ccm_passivate\n")); +} + +void +MyImpl::BMDisplay_exec_impl::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + 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_ENV_SINGLE_ARG_DECL) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.h new file mode 100644 index 00000000000..25c5c4f3488 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec.h @@ -0,0 +1,102 @@ +// $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" + +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_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec_export.h new file mode 100644 index 00000000000..1f684e4e2c0 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDISPLAY_EXEC +// ------------------------------ +#ifndef BMDISPLAY_EXEC_EXPORT_H +#define BMDISPLAY_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDISPLAY_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDISPLAY_EXEC_NTRACE == 1) */ + +#endif /* BMDISPLAY_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_stub_export.h new file mode 100644 index 00000000000..399dbb7425d --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDISPLAY_STUB +// ------------------------------ +#ifndef BMDISPLAY_STUB_EXPORT_H +#define BMDISPLAY_STUB_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDISPLAY_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDISPLAY_STUB_NTRACE == 1) */ + +#endif /* BMDISPLAY_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.cpp new file mode 100644 index 00000000000..61fca1c3e82 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.cpp @@ -0,0 +1,1067 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#include "BMDisplay_svnt.h" +#include "Cookies.h" + +namespace CIAO_GLUE_BasicSP +{ + BMDisplay_Context::BMDisplay_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMDisplay_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) + { + } + + BMDisplay_Context::~BMDisplay_Context (void) + { + } + + // Operations from ::Components::CCMContext. + + ::Components::Principal_ptr + BMDisplay_Context::get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Principal::_nil ()); + } + + ::Components::CCMHome_ptr + BMDisplay_Context::get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + BMDisplay_Context::get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::Transaction::UserTransaction_ptr + BMDisplay_Context::get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Transaction::UserTransaction::_nil ()); + } + + CORBA::Boolean + BMDisplay_Context::is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_UNUSED_ARG (role); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + void + BMDisplay_Context::set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW (CORBA::NO_IMPLEMENT ()); + } + + // Operations from ::Components::SessionContext interface. + + CORBA::Object_ptr + BMDisplay_Context::get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = + this->container_->get_objref ( + this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + this->component_ = + ::BasicSP::BMDisplay::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (CORBA::is_nil (this->component_.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + } + + return ::BasicSP::BMDisplay::_duplicate ( + this->component_.in ()); + } + + // Operations for BMDisplay receptacles and event sources, + // defined in ::BasicSP::CCM_BMDisplay_Context. + + ::BasicSP::ReadData_ptr + BMDisplay_Context::get_connection_comp_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::BasicSP::ReadData::_duplicate ( + this->ciao_uses_comp_data_.in ()); + } + + void + BMDisplay_Context::connect_comp_data ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + if (! CORBA::is_nil (this->ciao_uses_comp_data_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + if (CORBA::is_nil (c)) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->ciao_uses_comp_data_ = + ::BasicSP::ReadData::_duplicate (c); + } + + ::BasicSP::ReadData_ptr + BMDisplay_Context::disconnect_comp_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_uses_comp_data_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::BasicSP::ReadData::_nil ()); + } + + return this->ciao_uses_comp_data_._retn (); + } + + + BMDisplay_Servant::BMDisplay_Servant ( + ::BasicSP::CCM_BMDisplay_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMDisplay::_duplicate (exe)), + container_ (c) + { + this->context_ = new BMDisplay_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->set_session_context ( + this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + } + + BMDisplay_Servant::~BMDisplay_Servant (void) + { + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + this->context_->_remove_ref (); + } + + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant::DataAvailableConsumer_data_ready_Servant ( + ::BasicSP::CCM_BMDisplay_ptr executor, + ::BasicSP::CCM_BMDisplay_Context_ptr c) + : executor_ (::BasicSP::CCM_BMDisplay::_duplicate (executor)), + ctx_ (::BasicSP::CCM_BMDisplay_Context::_duplicate (c)) + { + } + + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant::~DataAvailableConsumer_data_ready_Servant (void) + { + } + + CORBA::Object_ptr + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant::push_DataAvailable ( + ::BasicSP::DataAvailable *evt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->push_data_ready ( + evt + ACE_ENV_ARG_PARAMETER); + } + + // Inherited from ::Components::EventConsumerBase. + void + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant::push_event ( + ::Components::EventBase *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)) + { + ::BasicSP::DataAvailable_var ev_type = + ::BasicSP::DataAvailable::_downcast (ev); + + if (ev_type != 0) + { + this->push_DataAvailable ( + ev_type.in () + ACE_ENV_SINGLE_ARG_PARAMETER); + + return; + } + + ACE_THROW (::Components::BadEventType ()); + } + + ::BasicSP::DataAvailableConsumer_ptr + BMDisplay_Servant::get_consumer_data_ready ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (CORBA::is_nil (this->consumes_data_ready_.in ())) + { + BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant *svt = + new BMDisplay_Servant::DataAvailableConsumer_data_ready_Servant ( + this->executor_.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::DataAvailableConsumer::_nil ()); + + ::BasicSP::DataAvailableConsumer_var eco = + ::BasicSP::DataAvailableConsumer::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::DataAvailableConsumer::_nil ()); + + this->consumes_data_ready_ = eco; + } + + return ::BasicSP::DataAvailableConsumer::_duplicate (this->consumes_data_ready_.in ()); + } + + void + BMDisplay_Servant::connect_comp_data ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + this->context_->connect_comp_data ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::ReadData_ptr + BMDisplay_Servant::disconnect_comp_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_comp_data ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::BasicSP::ReadData_ptr + BMDisplay_Servant::get_connection_comp_data ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_connection_comp_data ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for Navigation interface. + + CORBA::Object_ptr + BMDisplay_Servant::provide_facet ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::FacetDescriptions * + BMDisplay_Servant::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::FacetDescriptions * + BMDisplay_Servant::get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + CORBA::Boolean + BMDisplay_Servant::same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (object_ref)) + { + ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent ( + the_other.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Receptacles interface. + + ::Components::Cookie * + BMDisplay_Servant::connect ( + const char *name, + ::CORBA::Object_ptr connection + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)) + { + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (name, "comp_data") == 0) + { + ::BasicSP::ReadData_var _ciao_conn = + ::BasicSP::ReadData::_narrow ( + connection + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_conn.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + // Simplex connect. + this->connect_comp_data ( + _ciao_conn.in () + ACE_ENV_ARG_PARAMETER); + + return 0; + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + BMDisplay_Servant::disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "comp_data") == 0) + { + // Simplex disconnect. + return this->disconnect_comp_data (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::ConnectionDescriptions * + BMDisplay_Servant::get_connections ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMDisplay_Servant::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + BMDisplay_Servant::get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for Events interface. + + // NEW + void + BMDisplay_Servant::connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW ( + ::Components::InvalidName ()); + } + // END NEW + + ::Components::EventConsumerBase_ptr + BMDisplay_Servant::get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (sink_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (sink_name, "data_ready") == 0) + { + return this->get_consumer_data_ready (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ::Components::Cookie * + BMDisplay_Servant::subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscribe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + BMDisplay_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + void + BMDisplay_Servant::connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + ACE_THROW (::CORBA::NO_IMPLEMENT ()); + } + + ::Components::EventConsumerBase_ptr + BMDisplay_Servant::disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMDisplay_Servant::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + BMDisplay_Servant::get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMDisplay_Servant::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + BMDisplay_Servant::get_named_emitters ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMDisplay_Servant::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + BMDisplay_Servant::get_named_publishers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for CCMObject interface. + + CORBA::IRObject_ptr + BMDisplay_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::Components::CCMHome_ptr + BMDisplay_Servant::get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::PrimaryKeyBase * + BMDisplay_Servant::get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)) + { + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); + } + + void + BMDisplay_Servant::configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)) + { + // CIAO to-do + } + + void + BMDisplay_Servant::remove ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + // CIAO to-do + } + + ::Components::ComponentPortDescription * + BMDisplay_Servant::get_all_ports ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + BMDisplay_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + + // CIAO-specific operations. + + void + BMDisplay_Servant::_ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + void + BMDisplay_Servant::_ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + // Supported operations. + + + BMDisplayHome_Servant::BMDisplayHome_Servant ( + ::BasicSP::CCM_BMDisplayHome_ptr exe, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_BMDisplayHome::_duplicate (exe)), + container_ (c) + { + } + + BMDisplayHome_Servant::~BMDisplayHome_Servant (void) + { + } + + // Operations for keyless home interface. + + ::Components::CCMObject_ptr + BMDisplayHome_Servant::create_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for implicit home interface. + + ::BasicSP::BMDisplay_ptr + BMDisplayHome_Servant::create ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + if (this->executor_.in () == 0) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::BMDisplay::_nil ()); + } + + Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + ::BasicSP::CCM_BMDisplay_var _ciao_comp = + ::BasicSP::CCM_BMDisplay::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for CCMHome interface. + + ::CORBA::IRObject_ptr + BMDisplayHome_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::CORBA::IRObject_ptr + BMDisplayHome_Servant::get_home_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + void + BMDisplayHome_Servant::remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + ::BasicSP::BMDisplay_var _ciao_comp = + ::BasicSP::BMDisplay::_narrow ( + comp + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (_ciao_comp.in ())) + { + ACE_THROW (CORBA::INTERNAL ()); + } + + _ciao_comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->_ciao_passivate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // CIAO-specific operations. + + ::BasicSP::BMDisplay_ptr + BMDisplayHome_Servant::_ciao_activate_component ( + ::BasicSP::CCM_BMDisplay_ptr exe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var hobj = + this->container_->get_objref ( + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + ::Components::CCMHome_var home = + ::Components::CCMHome::_narrow ( + hobj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + BMDisplay_Servant *svt = + new BMDisplay_Servant ( + exe, + home.in (), + this->container_); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_component ( + svt, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + svt->_ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + ::BasicSP::BMDisplay_var ho = + ::BasicSP::BMDisplay::_narrow ( + objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::BMDisplay::_nil ()); + + if (this->component_map_.bind (oid.in (), svt) == 0) + { + safe._retn (); + } + + return ho._retn (); + } + + void + BMDisplayHome_Servant::_ciao_passivate_component ( + ::BasicSP::BMDisplay_ptr comp + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid; + + this->container_->uninstall_component ( + comp, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + BMDisplay_Servant *servant = 0; + + if (this->component_map_.unbind (oid.in (), servant) == 0) + { + PortableServer::ServantBase_var safe (servant); + servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + // Supported operations. + + +} + +extern "C" BMDISPLAY_SVNT_Export ::PortableServer::Servant +createBMDisplayHome_Servant ( +::Components::HomeExecutorBase_ptr p, +CIAO::Session_Container *c +ACE_ENV_ARG_DECL) +{ + if (p == 0) + { + return 0; + } + + ::BasicSP::CCM_BMDisplayHome_var x = + ::BasicSP::CCM_BMDisplayHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + ::CIAO_GLUE_BasicSP::BMDisplayHome_Servant ( + x.in (), + c); +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.h new file mode 100644 index 00000000000..996f8d7658b --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt.h @@ -0,0 +1,564 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#ifndef CIAO_GLUE_SESSION_BMDISPLAY_SVNT_H +#define CIAO_GLUE_SESSION_BMDISPLAY_SVNT_H +#include "ace/pre.h" + +#include "BMDisplayS.h" +#include "BMDisplayEC.h" + +#include "ciao/Container_Base.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO_GLUE_BasicSP +{ + class BMDISPLAY_SVNT_Export BMDisplay_Context + : public virtual ::BasicSP::CCM_BMDisplay_Context, + public virtual TAO_Local_RefCounted_Object + { + public: + // We will allow the servant glue code we generate to access our state. + friend class BMDisplay_Servant; + + BMDisplay_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + BMDisplay_Servant *sv); + + virtual ~BMDisplay_Context (void); + + // Operations from ::Components::CCMContext. + + virtual ::Components::Principal_ptr + get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations from ::Components::SessionContext interface. + + virtual CORBA::Object_ptr + get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations for BMDisplay receptacles and event sources, + // defined in ::BasicSP::CCM_BMDisplay_Context. + + virtual ::BasicSP::ReadData_ptr + get_connection_comp_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Methods that manage this component's connections and consumers. + + virtual void + connect_comp_data ( + ::BasicSP::ReadData_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::ReadData_ptr + disconnect_comp_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + protected: + // Simplex comp_data connection. + ::BasicSP::ReadData_var + ciao_uses_comp_data_; + + ::Components::CCMHome_var + home_; + + ::CIAO::Session_Container * + container_; + + BMDisplay_Servant * + servant_; + + ::BasicSP::BMDisplay_var + component_; + }; + + class BMDISPLAY_SVNT_Export BMDisplay_Servant + : public virtual POA_BasicSP::BMDisplay, + public virtual PortableServer::RefCountServantBase + { + public: + BMDisplay_Servant ( + ::BasicSP::CCM_BMDisplay_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~BMDisplay_Servant (void); + + // Servant class for the data_ready consumer. + class BMDISPLAY_SVNT_Export DataAvailableConsumer_data_ready_Servant + : public virtual POA_BasicSP::DataAvailableConsumer, + public virtual PortableServer::RefCountServantBase + { + public: + DataAvailableConsumer_data_ready_Servant ( + ::BasicSP::CCM_BMDisplay_ptr executor, + ::BasicSP::CCM_BMDisplay_Context_ptr c); + + virtual ~DataAvailableConsumer_data_ready_Servant (void); + + virtual void + push_DataAvailable ( + ::BasicSP::DataAvailable *evt + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Inherited from ::Components::EventConsumerBase. + virtual void + push_event (::Components::EventBase *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDisplay_var + executor_; + + ::BasicSP::CCM_BMDisplay_Context_var + ctx_; + }; + + virtual ::BasicSP::DataAvailableConsumer_ptr + get_consumer_data_ready ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + connect_comp_data ( + ::BasicSP::ReadData_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::ReadData_ptr + disconnect_comp_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::ReadData_ptr + get_connection_comp_data ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Navigation interface. + + virtual CORBA::Object_ptr + provide_facet ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::FacetDescriptions * + get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual CORBA::Boolean + same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface. + + virtual ::Components::Cookie * + connect ( + const char *name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr + disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for Events interface. + + // NEW + virtual void + connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + // END NEW + + virtual ::Components::EventConsumerBase_ptr + get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::Cookie * + subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void + connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for CCMObject interface. + + virtual CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)); + + virtual void + configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)); + + virtual void + remove ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific operations. + + void + _ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDisplay_var + executor_; + + BMDisplay_Context * + context_; + + ::CIAO::Session_Container * + container_; + + ::BasicSP::DataAvailableConsumer_var + consumes_data_ready_; + + }; + + class BMDISPLAY_SVNT_Export BMDisplayHome_Servant + : public virtual POA_BasicSP::BMDisplayHome, + public virtual PortableServer::RefCountServantBase + { + public: + BMDisplayHome_Servant ( + ::BasicSP::CCM_BMDisplayHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~BMDisplayHome_Servant (void); + + // Home factory and other operations. + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr + create_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for implicit home interface. + + virtual ::BasicSP::BMDisplay_ptr + create ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + // Supported operations. + + protected: + // CIAO-specific operations. + + ::BasicSP::BMDisplay_ptr + _ciao_activate_component ( + ::BasicSP::CCM_BMDisplay_ptr exe + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate_component ( + ::BasicSP::BMDisplay_ptr comp + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_BMDisplayHome_var + executor_; + + ::CIAO::Session_Container * + container_; + + ACE_Hash_Map_Manager_Ex< + PortableServer::ObjectId, + BMDisplay_Servant *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + component_map_; + }; + + extern "C" BMDISPLAY_SVNT_Export ::PortableServer::Servant + createBMDisplayHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + +} + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_BMDISPLAY_SVNT_H */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt_export.h new file mode 100644 index 00000000000..2392da154d7 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BMDisplay/BMDisplay_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BMDISPLAY_SVNT +// ------------------------------ +#ifndef BMDISPLAY_SVNT_EXPORT_H +#define BMDISPLAY_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BMDISPLAY_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BMDISPLAY_SVNT_NTRACE == 1) */ + +#endif /* BMDISPLAY_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.idl new file mode 100644 index 00000000000..5ea22ff5c99 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.idl @@ -0,0 +1,61 @@ +// $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 (); + }; + + interface RTEventChannel + { + void connect_consumer (in string event_type, + in string sink_name, + in string consumer_oid); + + void connect_supplier (in string event_type, + in string source_name, + in string supplier_oid); + + }; + + /** + * @eventtype Events that represent timeouts + */ + eventtype TimeOut {}; + + /** + * @eventtype Events that represent data availability + */ + eventtype DataAvailable {}; + +}; + +#endif /*CIAO_BASIC_SP_IDL*/ diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.mpc new file mode 100644 index 00000000000..f58c9efe005 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP.mpc @@ -0,0 +1,30 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -n HUDisplay" + +project(BasicSP_stub): ciao_client { + + 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_svnt) : ciao_server { + after += BasicSP_stub + sharedname = BasicSP_svnt + libs += BasicSP_stub + + idlflags += -Wb,export_macro=BASICSP_SVNT_Export -Wb,export_include=BasicSP_svnt_export.h + dynamicflags = BASICSP_SVNT_BUILD_DLL + + Source_Files { + BasicSPS.cpp + } +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_stub_export.h new file mode 100644 index 00000000000..1ae476b4082 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BASICSP_STUB +// ------------------------------ +#ifndef BASICSP_STUB_EXPORT_H +#define BASICSP_STUB_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BASICSP_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BASICSP_STUB_NTRACE == 1) */ + +#endif /* BASICSP_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_svnt_export.h new file mode 100644 index 00000000000..23c48f384d7 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/BasicSP_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl BASICSP_SVNT +// ------------------------------ +#ifndef BASICSP_SVNT_EXPORT_H +#define BASICSP_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define BASICSP_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (BASICSP_SVNT_NTRACE == 1) */ + +#endif /* BASICSP_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.cidl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.cidl new file mode 100644 index 00000000000..8e9ff0d5575 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.idl new file mode 100644 index 00000000000..5cd5a1a30e9 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.idl @@ -0,0 +1,42 @@ +// $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; + uses RTEventChannel event_channel; + + /// 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.mpc new file mode 100644 index 00000000000..b5d7a251536 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC.mpc @@ -0,0 +1,91 @@ +// $Id$ +// This file is generated with "generate_component_mpc.pl -l .. -p BasicSP -i -c EC" + +project(EC_stub): ciao_client { + after += BasicSP_stub + sharedname = EC_stub + idlflags += -Wb,stub_export_macro=EC_STUB_Export -Wb,stub_export_include=EC_stub_export.h -Wb,skel_export_macro=EC_SVNT_Export -Wb,skel_export_include=EC_svnt_export.h + dynamicflags = EC_STUB_BUILD_DLL + + IDL_Files { + EC.idl + } + + Source_Files { + ECC.cpp + } +} + +project(EC_svnt) : ciao_servant { + after += BasicSP_svnt EC_stub + sharedname = EC_svnt + libs += EC_stub BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=EC_SVNT_Export -Wb,export_include=EC_svnt_export.h + dynamicflags = EC_SVNT_BUILD_DLL + + CIDL_Files { + EC.cidl + } + + IDL_Files { + ECE.idl + } + + Source_Files { + ECEC.cpp + ECS.cpp + EC_svnt.cpp + } +} + + +project(EC_exec) : ciao_component { + after += EC_svnt + sharedname = EC_exec + libs += EC_stub BasicSP_stub EC_svnt + libpaths += .. + idlflags += -Wb,export_macro=EC_EXEC_Export -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_client) : ciao_client, valuetype { + exename = client + after += EC_stub + libs += EC_stub BasicSP_stub + libpaths += .. + + IDL_Files { + } + + Source_Files { + client.cpp + } +} + + +project (EC_controller) : ciao_client, valuetype { + exename = controller + after += EC_stub + libs += EC_stub BasicSP_stub + libpaths += .. + + IDL_Files { + } + + Source_Files { + controller.cpp + } +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/ECEI.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/ECEI.idl new file mode 100644 index 00000000000..9b48d5c74dd --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.cpp new file mode 100644 index 00000000000..8897776433d --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.cpp @@ -0,0 +1,279 @@ +// $Id$ + +#include "EC_exec.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 () +{ + return this->activate (); +} + +int +MyImpl::timeout_Handler::close () +{ + this->done_ = 1; + this->reactor ()->notify (); + + 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) +{ + 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_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->hertz_; +} + +void +MyImpl::EC_exec_i::hertz (CORBA::Long hertz + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->hertz_ = hertz; +} + +// Operations from supported interface(s) + +void +MyImpl::EC_exec_i::start (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (this->hertz_ == 0 || this->pulser_.active()) + ACE_THROW (CORBA::BAD_INV_ORDER ()); + + // @@ Start the rate generator + this->pulser_.start (this->hertz_); +} + +void +MyImpl::EC_exec_i::stop (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (! this->pulser_.active ()) + ACE_THROW (CORBA::BAD_INV_ORDER ()); + + // @@ stop the rate generator + this->pulser_.stop (); +} + +CORBA::Boolean +MyImpl::EC_exec_i::active (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + 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_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::set_session_context\n")); + + this->context_ = + BasicSP::CCM_EC_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + // Urm, we actually discard exceptions thown from this operation. + +} + +void +MyImpl::EC_exec_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_activate\n")); + + this->pulser_.open (); +} + +void +MyImpl::EC_exec_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_passivate\n")); + this->pulser_.close (); +} + +void +MyImpl::EC_exec_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "MyImpl::EC_exec_i::ccm_remove\n")); +} + +void +MyImpl::EC_exec_i::pulse (void) +{ + ACE_TRY_NEW_ENV + { + 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 () + ACE_ENV_ARG_PARAMETER); + } + ACE_CATCHANY + { + // @@ do nothing? + } + ACE_ENDTRY; + +} + +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_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new MyImpl::EC_exec_i (hertz); +} + +::Components::EnterpriseComponent_ptr +MyImpl::ECHome_exec_i::create (ACE_ENV_SINGLE_ARG_DECL) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.h new file mode 100644 index 00000000000..457ec447e68 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec.h @@ -0,0 +1,182 @@ +// $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 (void); + + int close (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. + int 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_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void hertz (CORBA::Long hertz + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from supported interface(s) + + virtual void start (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void stop (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean active (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations from Components::SessionComponent + + virtual void set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + 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/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec_export.h new file mode 100644 index 00000000000..c979debf129 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl EC_EXEC +// ------------------------------ +#ifndef EC_EXEC_EXPORT_H +#define EC_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define EC_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (EC_EXEC_NTRACE == 1) */ + +#endif /* EC_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_stub_export.h new file mode 100644 index 00000000000..2ad9df9cf12 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl EC_STUB +// ------------------------------ +#ifndef EC_STUB_EXPORT_H +#define EC_STUB_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define EC_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (EC_STUB_NTRACE == 1) */ + +#endif /* EC_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.cpp new file mode 100644 index 00000000000..5175df61f35 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.cpp @@ -0,0 +1,1229 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#include "EC_svnt.h" +#include "Cookies.h" + +namespace CIAO_GLUE_BasicSP +{ + EC_Context::EC_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + EC_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) + { + } + + EC_Context::~EC_Context (void) + { + } + + // Operations from ::Components::CCMContext. + + ::Components::Principal_ptr + EC_Context::get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Principal::_nil ()); + } + + ::Components::CCMHome_ptr + EC_Context::get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + EC_Context::get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::Transaction::UserTransaction_ptr + EC_Context::get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Transaction::UserTransaction::_nil ()); + } + + CORBA::Boolean + EC_Context::is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_UNUSED_ARG (role); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + void + EC_Context::set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW (CORBA::NO_IMPLEMENT ()); + } + + // Operations from ::Components::SessionContext interface. + + CORBA::Object_ptr + EC_Context::get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = + this->container_->get_objref ( + this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + this->component_ = + ::BasicSP::EC::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (CORBA::is_nil (this->component_.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + } + + return ::BasicSP::EC::_duplicate ( + this->component_.in ()); + } + + // Operations for EC receptacles and event sources, + // defined in ::BasicSP::CCM_EC_Context. + + void + EC_Context::push_timeout ( + ::BasicSP::TimeOut *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_DEBUG ((LM_DEBUG, "EC_Context::push_timeout\n")); + // NEW + RtecEventComm::EventSet events (1); + events.length (1); + events[0].header.source = ACE_ES_EVENT_SOURCE_ANY + 1; + events[0].header.type = ACE_ES_EVENT_UNDEFINED + 1; + ::Components::EventBase * ev_base = ev; + ev->_add_ref (); + events[0].data.any_value <<= ev_base; + ciao_proxy_consumer_->push (events ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + // END NEW + + /* + ACE_Active_Map_Manager<::BasicSP::TimeOutConsumer_var>::iterator end = + this->ciao_publishes_timeout_map_.end (); + + for (ACE_Active_Map_Manager<::BasicSP::TimeOutConsumer_var>::iterator iter = + this->ciao_publishes_timeout_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager<::BasicSP::TimeOutConsumer_var>::ENTRY &entry = *iter; + ::BasicSP::TimeOutConsumer_var c = + ::BasicSP::TimeOutConsumer::_narrow ( + entry.int_id_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + entry.int_id_->push_TimeOut ( + ev + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + */ + } + + ::Components::Cookie * + EC_Context::subscribe_timeout ( + ::BasicSP::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + ACE_DEBUG ((LM_DEBUG, "EC_Context::subscribe_timeout\n")); + // NEW + char * argv[1] = { "EC_exec" }; + int argc = sizeof (argv) / sizeof (argv[0]); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->ciao_proxy_consumer_.in ())) + { + ::CORBA::Object_var me = + this->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + CORBA::String_var ior = orb->object_to_string + (me.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->ciao_uses_event_channel_->connect_supplier + ("TimeOut", "timeout", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + CORBA::String_var ior = orb->object_to_string (c ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + ciao_uses_event_channel_->connect_consumer + ("TimeOut", "timeout", ior.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + return 0; + // END NEW + + /* + if (CORBA::is_nil (c)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + } + + ::BasicSP::TimeOutConsumer_var sub = + ::BasicSP::TimeOutConsumer::_duplicate (c); + + ACE_Active_Map_Manager_Key key; + this->ciao_publishes_timeout_map_.bind (sub.in (), key); + + sub._retn (); + + ::Components::Cookie_var retv = new ::CIAO::Map_Key_Cookie (key); + return retv._retn (); + */ + } + + ::BasicSP::TimeOutConsumer_ptr + EC_Context::unsubscribe_timeout ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + return ::BasicSP::TimeOutConsumer::_nil (); + + /* + ::BasicSP::TimeOutConsumer_var retv; + ACE_Active_Map_Manager_Key key; + + if (ck == 0 || ::CIAO::Map_Key_Cookie::extract (ck, key) == -1) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::TimeOutConsumer::_nil ()); + } + + if (this->ciao_publishes_timeout_map_.unbind (key, retv) != 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::BasicSP::TimeOutConsumer::_nil ()); + } + + return retv._retn (); + */ + } + + // NEW + void + EC_Context::connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer) + { + ciao_proxy_consumer_ = proxy_consumer; + } + // END NEW + + ::BasicSP::RTEventChannel_ptr + EC_Context::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::BasicSP::RTEventChannel::_duplicate ( + this->ciao_uses_event_channel_.in ()); + } + + void + EC_Context::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + if (! CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + if (CORBA::is_nil (c)) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->ciao_uses_event_channel_ = + ::BasicSP::RTEventChannel::_duplicate (c); + } + + ::BasicSP::RTEventChannel_ptr + EC_Context::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_uses_event_channel_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::BasicSP::RTEventChannel::_nil ()); + } + + return this->ciao_uses_event_channel_._retn (); + } + + + EC_Servant::EC_Servant ( + ::BasicSP::CCM_EC_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_EC::_duplicate (exe)), + container_ (c) + { + this->context_ = new EC_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->set_session_context ( + this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + } + + EC_Servant::~EC_Servant (void) + { + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + this->context_->_remove_ref (); + } + + ::Components::Cookie * + EC_Servant::subscribe_timeout ( + ::BasicSP::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + return this->context_->subscribe_timeout ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::TimeOutConsumer_ptr + EC_Servant::unsubscribe_timeout ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + return this->context_->unsubscribe_timeout ( + ck + ACE_ENV_ARG_PARAMETER); + } + + void + EC_Servant::connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + this->context_->connect_event_channel ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + EC_Servant::disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::BasicSP::RTEventChannel_ptr + EC_Servant::get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::CORBA::Long + EC_Servant::hertz ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->executor_->hertz ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + EC_Servant::hertz ( + ::CORBA::Long val + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->hertz ( + val + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Navigation interface. + + CORBA::Object_ptr + EC_Servant::provide_facet ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::FacetDescriptions * + EC_Servant::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::FacetDescriptions * + EC_Servant::get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + CORBA::Boolean + EC_Servant::same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (object_ref)) + { + ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent ( + the_other.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Receptacles interface. + + ::Components::Cookie * + EC_Servant::connect ( + const char *name, + ::CORBA::Object_ptr connection + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)) + { + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + ::BasicSP::RTEventChannel_var _ciao_conn = + ::BasicSP::RTEventChannel::_narrow ( + connection + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_conn.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + // Simplex connect. + this->connect_event_channel ( + _ciao_conn.in () + ACE_ENV_ARG_PARAMETER); + + return 0; + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + EC_Servant::disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "event_channel") == 0) + { + // Simplex disconnect. + return this->disconnect_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::ConnectionDescriptions * + EC_Servant::get_connections ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + EC_Servant::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + EC_Servant::get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for Events interface. + + ::Components::EventConsumerBase_ptr + EC_Servant::get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (sink_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ::Components::Cookie * + EC_Servant::subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscribe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (publisher_name, "timeout") == 0) + { + ::BasicSP::TimeOutConsumer_var _ciao_consumer = + ::BasicSP::TimeOutConsumer::_narrow ( + subscribe + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (_ciao_consumer.in ())) + { + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + } + + return this->subscribe_timeout ( + _ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + EC_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (publisher_name, "timeout") == 0) + { + return this->unsubscribe_timeout ( + ck + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + // NEW + void + EC_Servant::connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_DEBUG ((LM_DEBUG, "EC_Servant::connect_publisher\n")); + this->context_->connect_proxy_consumer (proxy_consumer); + } + // END NEW + + void + EC_Servant::connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + ACE_THROW (::CORBA::NO_IMPLEMENT ()); + } + + ::Components::EventConsumerBase_ptr + EC_Servant::disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + EC_Servant::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + EC_Servant::get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + EC_Servant::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + EC_Servant::get_named_emitters ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + EC_Servant::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + EC_Servant::get_named_publishers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for CCMObject interface. + + CORBA::IRObject_ptr + EC_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::Components::CCMHome_ptr + EC_Servant::get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::PrimaryKeyBase * + EC_Servant::get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)) + { + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); + } + + void + EC_Servant::configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)) + { + // CIAO to-do + } + + void + EC_Servant::remove ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + // CIAO to-do + } + + ::Components::ComponentPortDescription * + EC_Servant::get_all_ports ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + EC_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + + // CIAO-specific operations. + + void + EC_Servant::_ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + void + EC_Servant::_ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + // Supported operations. + + void + EC_Servant::start ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->start ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + EC_Servant::stop ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->stop ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + + ECHome_Servant::ECHome_Servant ( + ::BasicSP::CCM_ECHome_ptr exe, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_ECHome::_duplicate (exe)), + container_ (c) + { + } + + ECHome_Servant::~ECHome_Servant (void) + { + } + + ::BasicSP::EC_ptr + ECHome_Servant::new_EC ( + ::CORBA::Long hertz + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::EnterpriseComponent_var _ciao_ec = + this->executor_->new_EC ( + hertz + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + ::BasicSP::CCM_EC_var _ciao_comp = + ::BasicSP::CCM_EC::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for keyless home interface. + + ::Components::CCMObject_ptr + ECHome_Servant::create_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for implicit home interface. + + ::BasicSP::EC_ptr + ECHome_Servant::create ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + if (this->executor_.in () == 0) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::EC::_nil ()); + } + + Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + ::BasicSP::CCM_EC_var _ciao_comp = + ::BasicSP::CCM_EC::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for CCMHome interface. + + ::CORBA::IRObject_ptr + ECHome_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::CORBA::IRObject_ptr + ECHome_Servant::get_home_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + void + ECHome_Servant::remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + ::BasicSP::EC_var _ciao_comp = + ::BasicSP::EC::_narrow ( + comp + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (_ciao_comp.in ())) + { + ACE_THROW (CORBA::INTERNAL ()); + } + + _ciao_comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->_ciao_passivate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // CIAO-specific operations. + + ::BasicSP::EC_ptr + ECHome_Servant::_ciao_activate_component ( + ::BasicSP::CCM_EC_ptr exe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var hobj = + this->container_->get_objref ( + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + ::Components::CCMHome_var home = + ::Components::CCMHome::_narrow ( + hobj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + EC_Servant *svt = + new EC_Servant ( + exe, + home.in (), + this->container_); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_component ( + svt, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + svt->_ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + ::BasicSP::EC_var ho = + ::BasicSP::EC::_narrow ( + objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::EC::_nil ()); + + if (this->component_map_.bind (oid.in (), svt) == 0) + { + safe._retn (); + } + + return ho._retn (); + } + + void + ECHome_Servant::_ciao_passivate_component ( + ::BasicSP::EC_ptr comp + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid; + + this->container_->uninstall_component ( + comp, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + EC_Servant *servant = 0; + + if (this->component_map_.unbind (oid.in (), servant) == 0) + { + PortableServer::ServantBase_var safe (servant); + servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + // Supported operations. + + +} + +extern "C" EC_SVNT_Export ::PortableServer::Servant +createECHome_Servant ( +::Components::HomeExecutorBase_ptr p, +CIAO::Session_Container *c +ACE_ENV_ARG_DECL) +{ + if (p == 0) + { + return 0; + } + + ::BasicSP::CCM_ECHome_var x = + ::BasicSP::CCM_ECHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + ::CIAO_GLUE_BasicSP::ECHome_Servant ( + x.in (), + c); +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.h new file mode 100644 index 00000000000..66bb912b0fc --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt.h @@ -0,0 +1,605 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#ifndef CIAO_GLUE_SESSION_EC_SVNT_H +#define CIAO_GLUE_SESSION_EC_SVNT_H +#include "ace/pre.h" + +#include "ECS.h" +#include "ECEC.h" + +#include "ciao/Container_Base.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +//NEW +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "Event_Utilities.h" +// END NEW + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO_GLUE_BasicSP +{ + class EC_SVNT_Export EC_Context + : public virtual ::BasicSP::CCM_EC_Context, + public virtual TAO_Local_RefCounted_Object + { + public: + // We will allow the servant glue code we generate to access our state. + friend class EC_Servant; + + EC_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + EC_Servant *sv); + + virtual ~EC_Context (void); + + // Operations from ::Components::CCMContext. + + virtual ::Components::Principal_ptr + get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations from ::Components::SessionContext interface. + + virtual CORBA::Object_ptr + get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations for EC receptacles and event sources, + // defined in ::BasicSP::CCM_EC_Context. + + virtual void + push_timeout ( + ::BasicSP::TimeOut *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Methods that manage this component's connections and consumers. + + virtual ::Components::Cookie * + subscribe_timeout ( + ::BasicSP::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::TimeOutConsumer_ptr + unsubscribe_timeout ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + // NEW + void + connect_proxy_consumer ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer); + // END NEW + + protected: + + // NEW + RtecEventChannelAdmin::ProxyPushConsumer_var + ciao_proxy_consumer_; + // END NEW + + // OLD + /* + ACE_Active_Map_Manager< + ::BasicSP::TimeOutConsumer_var> + ciao_publishes_timeout_map_; + */ + // END OLD + + // Simplex event_channel connection. + ::BasicSP::RTEventChannel_var + ciao_uses_event_channel_; + + ::Components::CCMHome_var + home_; + + ::CIAO::Session_Container * + container_; + + EC_Servant * + servant_; + + ::BasicSP::EC_var + component_; + }; + + class EC_SVNT_Export EC_Servant + : public virtual POA_BasicSP::EC, + public virtual PortableServer::RefCountServantBase + { + public: + EC_Servant ( + ::BasicSP::CCM_EC_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~EC_Servant (void); + + virtual void + start ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + stop ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::Cookie * + subscribe_timeout ( + ::BasicSP::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::BasicSP::TimeOutConsumer_ptr + unsubscribe_timeout ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + virtual void + connect_event_channel ( + ::BasicSP::RTEventChannel_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::BasicSP::RTEventChannel_ptr + disconnect_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::BasicSP::RTEventChannel_ptr + get_connection_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::Long + hertz ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + hertz ( + ::CORBA::Long + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Navigation interface. + + virtual CORBA::Object_ptr + provide_facet ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::FacetDescriptions * + get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual CORBA::Boolean + same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface. + + virtual ::Components::Cookie * + connect ( + const char *name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr + disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for Events interface. + + virtual ::Components::EventConsumerBase_ptr + get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::Cookie * + subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + // NEW + virtual void + connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + // END NEW + + virtual void + connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for CCMObject interface. + + virtual CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)); + + virtual void + configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)); + + virtual void + remove ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific operations. + + void + _ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_EC_var + executor_; + + EC_Context * + context_; + + ::CIAO::Session_Container * + container_; + + }; + + class EC_SVNT_Export ECHome_Servant + : public virtual POA_BasicSP::ECHome, + public virtual PortableServer::RefCountServantBase + { + public: + ECHome_Servant ( + ::BasicSP::CCM_ECHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~ECHome_Servant (void); + + // Home factory and other operations. + + virtual ::BasicSP::EC_ptr + new_EC ( + ::CORBA::Long hertzACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr + create_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for implicit home interface. + + virtual ::BasicSP::EC_ptr + create ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + // Supported operations. + + protected: + // CIAO-specific operations. + + ::BasicSP::EC_ptr + _ciao_activate_component ( + ::BasicSP::CCM_EC_ptr exe + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate_component ( + ::BasicSP::EC_ptr comp + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_ECHome_var + executor_; + + ::CIAO::Session_Container * + container_; + + ACE_Hash_Map_Manager_Ex< + PortableServer::ObjectId, + EC_Servant *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + component_map_; + }; + + extern "C" EC_SVNT_Export ::PortableServer::Servant + createECHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + +} + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_EC_SVNT_H */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt_export.h new file mode 100644 index 00000000000..41da2dfc871 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/EC_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl EC_SVNT +// ------------------------------ +#ifndef EC_SVNT_EXPORT_H +#define EC_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#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) */ +# define EC_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (EC_SVNT_NTRACE == 1) */ + +#endif /* EC_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/client.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/client.cpp new file mode 100644 index 00000000000..7de404f4beb --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/client.cpp @@ -0,0 +1,72 @@ +// $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" + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + + // Resolve HomeFinder interface + + CORBA::Object_var obj + = orb->string_to_object ("file://ec.ior" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + BasicSP::ECHome_var home + = BasicSP::ECHome::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (home.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire ECHome objref\n"), -1); + + BasicSP::EC_var pulser + = home->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Place to plug in the rate + pulser->hertz (5 + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + pulser->start (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_OS::sleep (45); + + pulser->stop (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + home->remove_component (pulser.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Who is the culprit \n"); + cerr << "Uncaught CORBA exception" << endl; + return 1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/config b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/config new file mode 100644 index 00000000000..527aa2ba7ed --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/config @@ -0,0 +1 @@ +EC_exec|createECHome_Impl|EC_svnt|createECHome_Servant diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/controller.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/controller.cpp new file mode 100644 index 00000000000..0d6a328b217 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/EC/controller.cpp @@ -0,0 +1,125 @@ +// $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" + + +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 = 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); + } + + if (rategen_ior_ == 0) + rategen_ior_ = "file://ec.ior"; + + if (rate == 0) + rate = 3; + + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + // Initialize orb + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + + if (parse_args (argc, argv) != 0) + return -1; + + CORBA::Object_var obj + = orb->string_to_object (rategen_ior_ + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + BasicSP::EC_var pulser + = BasicSP::EC::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (CORBA::is_nil (pulser.in ())) + ACE_ERROR_RETURN ((LM_ERROR, "Unable to acquire 'EC' objref\n"), -1); + + pulser->hertz (rate + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (turn_on) + { + pulser->hertz (rate + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Start up the Event services\n")); + + pulser->start (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + else + { + pulser->stop (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Stop the ES\n")); + } + + orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Who is the culprit \n"); + cerr << "Uncaught CORBA exception" << endl; + return 1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.cidl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.cidl new file mode 100644 index 00000000000..2cb920bbb65 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.cidl @@ -0,0 +1,18 @@ +//$Id$ + +#ifndef RTEVENTSERVICE_CIDL +#define RTEVENTSERVICE_CIDL + +#include "RTEventService.idl" + +composition session RTEventService_Impl +{ + home executor RTEventServiceHome_Exec + { + implements BasicSP::RTEventServiceHome; + manages RTEventService_Exec; + }; +}; + +#endif /* RTEVENTSERVICE_CIDL */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.idl new file mode 100644 index 00000000000..53f578f07b6 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.idl @@ -0,0 +1,32 @@ +// $Id$ +//============================================================================= +/** + * @file RTEventService.idl + * + * Definition of component and home that will provide event channels. + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//============================================================================= + +#include "../BasicSP.idl" + +#ifndef CIAO_RTEVENTSERVICE_IDL +#define CIAO_RTEVENTSERVICE_IDL + + +module BasicSP +{ + + component RTEventService + { + provides RTEventChannel rt_event_channel; + }; + + home RTEventServiceHome manages RTEventService + { + }; + +}; + +#endif /* CIAO_RTEVENTSERVICE_IDL*/ diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.mpc b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.mpc new file mode 100644 index 00000000000..238718f40f4 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService.mpc @@ -0,0 +1,64 @@ +// $Id$ + +project(RTEventService_stub): ciao_client { + after += BasicSP_stub + sharedname = RTEventService_stub + + idlflags += -Wb,stub_export_macro=RTEVENTSERVICE_STUB_Export -Wb,stub_export_include=RTEventService_stub_export.h -Wb,skel_export_macro=RTEVENTSERVICE_SVNT_Export -Wb,skel_export_include=RTEventService_svnt_export.h + libpaths += .. + libs += BasicSP_stub + dynamicflags = RTEVENTSERVICE_STUB_BUILD_DLL + + IDL_Files { + RTEventService.idl + } + + Source_Files { + RTEventServiceC.cpp + } +} + +project(RTEventService_svnt) : ciao_servant { + after += RTEventService_stub BasicSP_stub + sharedname = RTEventService_svnt + libs += RTEventService_stub BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=RTEVENTSERVICE_SVNT_Export -Wb,export_include=RTEventService_svnt_export.h + dynamicflags = RTEVENTSERVICE_SVNT_BUILD_DLL + + CIDL_Files { + RTEventService.cidl + } + + IDL_Files { + RTEventServiceE.idl + } + + Source_Files { + RTEventServiceEC.cpp + RTEventServiceS.cpp + RTEventService_svnt.cpp + } +} + + +project(RTEventService_exec) : ciao_component { + after += RTEventService_svnt + sharedname = RTEventService_exec + libs += RTEventService_stub RTEventService_svnt BasicSP_stub BasicSP_svnt + libpaths += .. + idlflags += -Wb,export_macro=RTEVENTSERVICE_EXEC_Export -Wb,export_include=RTEventService_exec_export.h + dynamicflags = RTEVENTSERVICE_EXEC_BUILD_DLL + + IDL_Files { + RTEventServiceEI.idl + } + + Source_Files { + RTEventServiceES.cpp + RTEventServiceEIC.cpp + RTEventServiceEIS.cpp + RTEventService_exec.cpp + } +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventServiceEI.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventServiceEI.idl new file mode 100644 index 00000000000..b125b7058b0 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventServiceEI.idl @@ -0,0 +1,33 @@ +// $Id$ +//=========================================================== +/** + * @file RTEventServiceEI.idl + * + * Definition of the RTEventService component implementation. + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//=========================================================== +#ifndef CIAO_RTEVENTSERVICEEI_IDL +#define CIAO_RTEVENTSERVICEEI_IDL + +#include "RTEventServiceE.idl" + +module BasicSP +{ + /** + * @interface RTEventService_Exec + * + * The actual RTEventService executor inherits from both CCM_RTEventService + * and session_component interfaces as a monolithic implementation. + */ + local interface RTEventService_Exec : + CCM_RTEventService, + CCM_RTEventChannel, + Components::SessionComponent + { + }; + +}; + +#endif /* CIAO_RTEVENTSERVICEEI_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.cpp new file mode 100644 index 00000000000..2d25405105b --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.cpp @@ -0,0 +1,319 @@ +// $Id$ + +//============================================================== +/** + * @file RTEventService_exec.h + * + * Source file for the actual RTEventService and RTEventServiceHome + * component implementations. + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//============================================================== + +#include "RTEventService_exec.h" + + +MyImpl::RTEventService_exec_impl::RTEventService_exec_impl () +{ + // Get a reference to the ORB + char * argv[1] = { "RTEventService_exec" }; + int argc = sizeof (argv) / sizeof (argv[0]); + this->orb_ = CORBA::ORB_init (argc, argv ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // Get a reference to the POA + CORBA::Object_var poa_object = + orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + this->poa_ = + PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (CORBA::is_nil (this->poa_.in ())) + ACE_ERROR ((LM_ERROR, "Nil RootPOA\n")); + + // Create event channel + TAO_EC_Event_Channel_Attributes attributes (poa_.in (), poa_.in ()); + TAO_EC_Event_Channel * ec_servant; + ACE_NEW (ec_servant, TAO_EC_Event_Channel (attributes)); + ec_servant->activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + this->event_channel_ = ec_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; +} + +MyImpl::RTEventService_exec_impl::~RTEventService_exec_impl () +{ + +} + +void MyImpl::RTEventService_exec_impl::connect_consumer ( + const char * event_type, + const char * sink_name, + const char * consumer_oid + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) +{ + ACE_DEBUG ((LM_DEBUG, "RTEventService_exec_impl::connect_consumer\n")); + + CORBA::Object_var obj = this->orb_->string_to_object (consumer_oid + ACE_ENV_ARG_PARAMETER); + Components::EventConsumerBase_var event_base = + Components::EventConsumerBase::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + if (CORBA::is_nil (event_base.in ())) + ACE_ERROR ((LM_ERROR, "Nil event consumer\n")); + + RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = + this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier = + consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + // Create and register consumer servant + // @@ Bala, the consumer_servant is deactivated in the disconnect_push_consumer method, below + RTEventServiceConsumer_impl * consumer_servant; + ACE_NEW (consumer_servant, RTEventServiceConsumer_impl + (orb_.in (), Components::EventConsumerBase::_duplicate (event_base.in ()))); + RtecEventComm::PushConsumer_var consumer = consumer_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + // Put reference to this PushConsumer in the map so we can disconnect later + ACE_Active_Map_Manager_Key key; + this->proxy_supplier_map_.bind (proxy_supplier.in (), key); + + // Set QoS properties and connect + ACE_ConsumerQOS_Factory qos; + CORBA::Long event_flag; + CORBA::Long source_flag; + + // @@ Bala, let me know the right way to do this + if (ACE_OS::strcmp (event_type, "TimeOut") == 0) + event_flag = ACE_ES_EVENT_UNDEFINED + 1; + + if (ACE_OS::strcmp (event_type, "DataAvailable") == 0) + event_flag = ACE_ES_EVENT_UNDEFINED + 2; + + if (ACE_OS::strcmp (sink_name, "timeout") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 1; + + if (ACE_OS::strcmp (sink_name, "in_avail") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 2; + + if (ACE_OS::strcmp (sink_name, "data_ready") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 3; + + qos.start_logical_and_group (2); + qos.insert_type (event_flag, + 0); + qos.insert_source (source_flag, + 0); + proxy_supplier->connect_push_consumer (consumer.in (), + qos.get_ConsumerQOS () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + +} + +void MyImpl::RTEventService_exec_impl::connect_supplier ( + const char * event_type, + const char * source_name, + const char * supplier_oid + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) +{ + ACE_DEBUG ((LM_DEBUG, "RTEventService_exec_impl::connect_supplier\n")); + + RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = + this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer = + supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + // Create and register supplier servant + RTEventServiceSupplier_impl * supplier_servant; + ACE_NEW (supplier_servant, RTEventServiceSupplier_impl (orb_.in ())); + RtecEventComm::PushSupplier_var supplier = supplier_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + // Set QoS properties and connect + ACE_SupplierQOS_Factory qos; + CORBA::Long event_flag; + CORBA::Long source_flag; + + if (ACE_OS::strcmp (event_type, "TimeOut") == 0) + event_flag = ACE_ES_EVENT_UNDEFINED + 1; + + if (ACE_OS::strcmp (event_type, "DataAvailable") == 0) + event_flag = ACE_ES_EVENT_UNDEFINED + 2; + + if (ACE_OS::strcmp (source_name, "timeout") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 1; + + if (ACE_OS::strcmp (source_name, "data_available") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 2; + + if (ACE_OS::strcmp (source_name, "out_avail") == 0) + source_flag = ACE_ES_EVENT_SOURCE_ANY + 3; + + qos.insert (source_flag, + event_flag, + 0, + 1); + + proxy_consumer->connect_push_supplier (supplier.in (), + qos.get_SupplierQOS () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + CORBA::Object_var obj = this->orb_->string_to_object (supplier_oid + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + Components::CCMObject_var ccm_obj = + Components::CCMObject::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (ccm_obj.in ())) + ACE_ERROR ((LM_ERROR, "Nil event supplier\n")); + + // @@ Bala, the connect_publisher method was added to the Events interface in + // CCM_Event.idl. Let me know if there is a better way. + ccm_obj->connect_publisher + (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (proxy_consumer.in ()) + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +void MyImpl::RTEventService_exec_impl::set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + context_ = BasicSP::CCM_RTEventService_Context::_narrow (ctx); +} + +void MyImpl::RTEventService_exec_impl::ccm_activate (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + +} + +void MyImpl::RTEventService_exec_impl::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + +} + +void MyImpl::RTEventService_exec_impl::ccm_remove (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + +} + +BasicSP::CCM_RTEventChannel_ptr +MyImpl::RTEventService_exec_impl::get_rt_event_channel (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, "RTEventService_exec_impl::get_rt_event_channel\n")); + return BasicSP::CCM_RTEventChannel::_duplicate (this); +} + +MyImpl::RTEventServiceHome_exec_impl::RTEventServiceHome_exec_impl () +{ +} + +MyImpl::RTEventServiceHome_exec_impl::~RTEventServiceHome_exec_impl () +{ +} + +::Components::EnterpriseComponent_ptr +MyImpl::RTEventServiceHome_exec_impl::create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + return new RTEventService_exec_impl; +} + +extern "C" RTEVENTSERVICE_EXEC_Export ::Components::HomeExecutorBase_ptr +createRTEventServiceHome_Impl (void) +{ + return new MyImpl::RTEventServiceHome_exec_impl; +} + +MyImpl::RTEventServiceSupplier_impl::RTEventServiceSupplier_impl (void) +{ +} + +MyImpl::RTEventServiceSupplier_impl::RTEventServiceSupplier_impl (CORBA::ORB_ptr orb) : + orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +void MyImpl::RTEventServiceSupplier_impl::disconnect_push_supplier (void) +{ + CORBA::Object_var poa_object = + orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR ((LM_ERROR, "Nil RootPOA\n")); + PortableServer::ObjectId_var oid = root_poa->servant_to_id (this); + root_poa->deactivate_object (oid); +} + +MyImpl::RTEventServiceConsumer_impl::RTEventServiceConsumer_impl (void) +{ +} + +MyImpl::RTEventServiceConsumer_impl::RTEventServiceConsumer_impl + (CORBA::ORB_ptr orb, + Components::EventConsumerBase_ptr consumer) : + orb_ (CORBA::ORB::_duplicate (orb)), + event_consumer_ (Components::EventConsumerBase::_duplicate (consumer)) +{ +} + +void MyImpl::RTEventServiceConsumer_impl::push (const RtecEventComm::EventSet& events) +{ + ACE_DEBUG ((LM_DEBUG, "CIAO_GLUE_BasicSP::RTEventServiceConsumer_impl::push\n")); + for (unsigned long i = 0; i < events.length (); i++) + { + ::Components::EventBase * ev; + if (events[i].data.any_value >>= ev) + { + this->event_consumer_->push_event (ev + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + } +} + +void MyImpl::RTEventServiceConsumer_impl::disconnect_push_consumer (void) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + CORBA::Object_var poa_object = + orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR ((LM_ERROR, "Nil RootPOA\n")); + PortableServer::ObjectId_var oid = root_poa->servant_to_id (this); + root_poa->deactivate_object (oid); +} diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.h new file mode 100644 index 00000000000..4d272945a49 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec.h @@ -0,0 +1,187 @@ +// $Id$ + +//============================================================== +/** + * @file RTEventService_exec.h + * + * Header file for the actual RTEventService and RTEventServiceHome + * component implementations. + * + * @author George Edwards <g.edwards@vanderbilt.edu> + */ +//============================================================== +#ifndef CIAO_RTEVENTSERVICE_EXEC_H +#define CIAO_RTEVENTSERVICE_EXEC_H + +#include "RTEventServiceS.h" +#include "RTEventServiceEC.h" + +#include "RTEventServiceEIC.h" +#include "tao/LocalObject.h" + +#include <Event_Utilities.h> +#include <RtecEventChannelAdminC.h> +#include <RtecEventCommC.h> +#include <RtecEventCommS.h> +#include <Event/EC_Event_Channel.h> +#include <Event/EC_Default_Factory.h> + +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +namespace MyImpl +{ + /** + * @class RTEventService_exec_impl + * + * Event service executor implementation class. + */ + class RTEVENTSERVICE_EXEC_Export RTEventService_exec_impl : + public virtual BasicSP::RTEventService_Exec, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default constructor. + RTEventService_exec_impl (); + + /// Default destructor. + ~RTEventService_exec_impl (); + + // Operations from BasicSP::CCM_RTEventService + + virtual void connect_consumer ( + const char * event_type, + const char * sink_name, + const char * consumer_oid + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual void connect_supplier ( + const char * event_type, + const char * source_name, + const char * supplier_oid + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + // Operations from Components::SessionComponent + + virtual void + set_session_context (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual void + ccm_remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + + virtual BasicSP::CCM_RTEventChannel_ptr + get_rt_event_channel (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + + /// Component specific context + BasicSP::CCM_RTEventService_Context_var context_; + + // Reference to event channel + RtecEventChannelAdmin::EventChannel_var event_channel_; + + ACE_Active_Map_Manager< + ::RtecEventChannelAdmin::ProxyPushSupplier_var> + proxy_supplier_map_; + + CORBA::ORB_var orb_; + + PortableServer::POA_var poa_; + }; + + /** + * @class RTEventServiceHome_exec_impl + * + * RTEventService home executor implementation class. + */ + class RTEVENTSERVICE_EXEC_Export RTEventServiceHome_exec_impl : + public virtual BasicSP::CCM_RTEventServiceHome, + public virtual TAO_Local_RefCounted_Object + { + public: + /// Default ctor. + RTEventServiceHome_exec_impl (); + + /// Default dtor. + ~RTEventServiceHome_exec_impl (); + + // Explicit home operations. + + // Implicit home operations. + + virtual ::Components::EnterpriseComponent_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)); + }; + + // NEW + class RTEventServiceSupplier_impl : + public virtual POA_RtecEventComm::PushSupplier, + public virtual PortableServer::RefCountServantBase + { + public: + + RTEventServiceSupplier_impl (void); + + RTEventServiceSupplier_impl (CORBA::ORB_ptr orb); + + virtual void disconnect_push_supplier (void) + ACE_THROW_SPEC ((CORBA::SystemException)); + + private: + CORBA::ORB_var orb_; + }; + + class RTEventServiceConsumer_impl : + public virtual POA_RtecEventComm::PushConsumer, + public virtual PortableServer::RefCountServantBase + { + public: + + RTEventServiceConsumer_impl (void); + + RTEventServiceConsumer_impl (CORBA::ORB_ptr orb, + Components::EventConsumerBase_ptr consumer); + + virtual void push (const RtecEventComm::EventSet& events); + + virtual void disconnect_push_consumer (void) + ACE_THROW_SPEC ((CORBA::SystemException)); + + private: + CORBA::ORB_var orb_; + Components::EventConsumerBase_var event_consumer_; + }; + // END NEW + +} + +extern "C" RTEVENTSERVICE_EXEC_Export ::Components::HomeExecutorBase_ptr +createRTEventServiceHome_Impl (void); + +#endif /* RTEVENTSERVICE_EXEC_H */ diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec_export.h new file mode 100644 index 00000000000..879d268cf08 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_exec_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RTEVENTSERVICE_EXEC +// ------------------------------ +#ifndef RTEVENTSERVICE_EXEC_EXPORT_H +#define RTEVENTSERVICE_EXEC_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (RTEVENTSERVICE_EXEC_HAS_DLL) +# define RTEVENTSERVICE_EXEC_HAS_DLL 1 +#endif /* ! RTEVENTSERVICE_EXEC_HAS_DLL */ + +#if defined (RTEVENTSERVICE_EXEC_HAS_DLL) && (RTEVENTSERVICE_EXEC_HAS_DLL == 1) +# if defined (RTEVENTSERVICE_EXEC_BUILD_DLL) +# define RTEVENTSERVICE_EXEC_Export ACE_Proper_Export_Flag +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RTEVENTSERVICE_EXEC_BUILD_DLL */ +# define RTEVENTSERVICE_EXEC_Export ACE_Proper_Import_Flag +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RTEVENTSERVICE_EXEC_BUILD_DLL */ +#else /* RTEVENTSERVICE_EXEC_HAS_DLL == 1 */ +# define RTEVENTSERVICE_EXEC_Export +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARATION(T) +# define RTEVENTSERVICE_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RTEVENTSERVICE_EXEC_HAS_DLL == 1 */ + +// Set RTEVENTSERVICE_EXEC_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RTEVENTSERVICE_EXEC_NTRACE) +# if (ACE_NTRACE == 1) +# define RTEVENTSERVICE_EXEC_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RTEVENTSERVICE_EXEC_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RTEVENTSERVICE_EXEC_NTRACE */ + +#if (RTEVENTSERVICE_EXEC_NTRACE == 1) +# define RTEVENTSERVICE_EXEC_TRACE(X) +#else /* (RTEVENTSERVICE_EXEC_NTRACE == 1) */ +# define RTEVENTSERVICE_EXEC_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (RTEVENTSERVICE_EXEC_NTRACE == 1) */ + +#endif /* RTEVENTSERVICE_EXEC_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_stub_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_stub_export.h new file mode 100644 index 00000000000..d8020c5875c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_stub_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RTEVENTSERVICE_STUB +// ------------------------------ +#ifndef RTEVENTSERVICE_STUB_EXPORT_H +#define RTEVENTSERVICE_STUB_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (RTEVENTSERVICE_STUB_HAS_DLL) +# define RTEVENTSERVICE_STUB_HAS_DLL 1 +#endif /* ! RTEVENTSERVICE_STUB_HAS_DLL */ + +#if defined (RTEVENTSERVICE_STUB_HAS_DLL) && (RTEVENTSERVICE_STUB_HAS_DLL == 1) +# if defined (RTEVENTSERVICE_STUB_BUILD_DLL) +# define RTEVENTSERVICE_STUB_Export ACE_Proper_Export_Flag +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RTEVENTSERVICE_STUB_BUILD_DLL */ +# define RTEVENTSERVICE_STUB_Export ACE_Proper_Import_Flag +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RTEVENTSERVICE_STUB_BUILD_DLL */ +#else /* RTEVENTSERVICE_STUB_HAS_DLL == 1 */ +# define RTEVENTSERVICE_STUB_Export +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARATION(T) +# define RTEVENTSERVICE_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RTEVENTSERVICE_STUB_HAS_DLL == 1 */ + +// Set RTEVENTSERVICE_STUB_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RTEVENTSERVICE_STUB_NTRACE) +# if (ACE_NTRACE == 1) +# define RTEVENTSERVICE_STUB_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RTEVENTSERVICE_STUB_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RTEVENTSERVICE_STUB_NTRACE */ + +#if (RTEVENTSERVICE_STUB_NTRACE == 1) +# define RTEVENTSERVICE_STUB_TRACE(X) +#else /* (RTEVENTSERVICE_STUB_NTRACE == 1) */ +# define RTEVENTSERVICE_STUB_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (RTEVENTSERVICE_STUB_NTRACE == 1) */ + +#endif /* RTEVENTSERVICE_STUB_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.cpp new file mode 100644 index 00000000000..e2311f744ec --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.cpp @@ -0,0 +1,991 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#include "RTEventService_svnt.h" +#include "Cookies.h" + +namespace CIAO_GLUE_BasicSP +{ + RTEventChannel_Servant::RTEventChannel_Servant ( + ::BasicSP::CCM_RTEventChannel_ptr executor, + ::Components::CCMContext_ptr c) + : executor_ (::BasicSP::CCM_RTEventChannel::_duplicate (executor)), + ctx_ (::Components::CCMContext::_duplicate (c)) + { + } + + RTEventChannel_Servant::~RTEventChannel_Servant (void) + { + } + + void + RTEventChannel_Servant::connect_consumer ( + const char * event_type, + const char * sink_name, + const char * consumer_oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->connect_consumer ( + event_type, + sink_name, + consumer_oid + ACE_ENV_ARG_PARAMETER); + } + + void + RTEventChannel_Servant::connect_supplier ( + const char * event_type, + const char * source_name, + const char * supplier_oid + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->connect_supplier ( + event_type, + source_name, + supplier_oid + ACE_ENV_ARG_PARAMETER); + } + + CORBA::Object_ptr + RTEventChannel_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->ctx_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (! CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + } + +} + +namespace CIAO_GLUE_BasicSP +{ + RTEventService_Context::RTEventService_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + RTEventService_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) + { + } + + RTEventService_Context::~RTEventService_Context (void) + { + } + + // Operations from ::Components::CCMContext. + + ::Components::Principal_ptr + RTEventService_Context::get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Principal::_nil ()); + } + + ::Components::CCMHome_ptr + RTEventService_Context::get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return ::Components::CCMHome::_duplicate (this->home_.in ()); + } + + CORBA::Boolean + RTEventService_Context::get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::Transaction::UserTransaction_ptr + RTEventService_Context::get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::Components::Transaction::UserTransaction::_nil ()); + } + + CORBA::Boolean + RTEventService_Context::is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_UNUSED_ARG (role); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + } + + void + RTEventService_Context::set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + ACE_THROW (CORBA::NO_IMPLEMENT ()); + } + + // Operations from ::Components::SessionContext interface. + + CORBA::Object_ptr + RTEventService_Context::get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)) + { + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = + this->container_->get_objref ( + this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + this->component_ = + ::BasicSP::RTEventService::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + + if (CORBA::is_nil (this->component_.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + } + + return ::BasicSP::RTEventService::_duplicate ( + this->component_.in ()); + } + + // Operations for RTEventService receptacles and event sources, + // defined in ::BasicSP::CCM_RTEventService_Context. + + + RTEventService_Servant::RTEventService_Servant ( + ::BasicSP::CCM_RTEventService_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_RTEventService::_duplicate (exe)), + container_ (c) + { + this->context_ = new RTEventService_Context (h, c, this); + + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + exe + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->set_session_context ( + this->context_ + ACE_ENV_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + } + + RTEventService_Servant::~RTEventService_Servant (void) + { + ACE_TRY_NEW_ENV + { + ::Components::SessionComponent_var scom = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! ::CORBA::is_nil (scom.in ())) + { + scom->ccm_remove (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + this->context_->_remove_ref (); + } + + ::BasicSP::RTEventChannel_ptr + RTEventService_Servant::provide_rt_event_channel ( + ACE_ENV_SINGLE_ARG_PARAMETER) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (this->provide_rt_event_channel_.in ())) + { + ::BasicSP::CCM_RTEventChannel_var fexe = + this->executor_->get_rt_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventChannel::_nil ()); + + if (::CORBA::is_nil (fexe.in ())) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::RTEventChannel::_nil ()); + } + + RTEventChannel_Servant *svt = + new RTEventChannel_Servant ( + fexe.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + ::CORBA::Object_var obj = + this->container_->install_servant ( + svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventChannel::_nil ()); + + ::BasicSP::RTEventChannel_var fo = + ::BasicSP::RTEventChannel::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventChannel::_nil ()); + + this->provide_rt_event_channel_ = fo; + } + + return ::BasicSP::RTEventChannel::_duplicate (this->provide_rt_event_channel_.in ()); + } + + // Operations for Navigation interface. + + CORBA::Object_ptr + RTEventService_Servant::provide_facet ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "rt_event_channel") == 0) + { + return this->provide_rt_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::FacetDescriptions * + RTEventService_Servant::get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::FacetDescriptions * + RTEventService_Servant::get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + CORBA::Boolean + RTEventService_Servant::same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (::CORBA::is_nil (object_ref)) + { + ACE_THROW_RETURN (::CORBA::BAD_PARAM (), 0); + } + + ::CORBA::Object_var the_other = + object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::CORBA::Object_var me = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent ( + the_other.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for Receptacles interface. + + ::Components::Cookie * + RTEventService_Servant::connect ( + const char *name, + ::CORBA::Object_ptr connection + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)) + { + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + RTEventService_Servant::disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ::Components::ConnectionDescriptions * + RTEventService_Servant::get_connections ( + const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + RTEventService_Servant::get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ReceptacleDescriptions * + RTEventService_Servant::get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for Events interface. + + // NEW + void + RTEventService_Servant::connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW ( + ::Components::InvalidName ()); + } + // END NEW + + ::Components::EventConsumerBase_ptr + RTEventService_Servant::get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + if (sink_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ::Components::Cookie * + RTEventService_Servant::subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscribe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + RTEventService_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + void + RTEventService_Servant::connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)) + { + ACE_THROW (::CORBA::NO_IMPLEMENT ()); + } + + ::Components::EventConsumerBase_ptr + RTEventService_Servant::disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + RTEventService_Servant::get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::ConsumerDescriptions * + RTEventService_Servant::get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + RTEventService_Servant::get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::EmitterDescriptions * + RTEventService_Servant::get_named_emitters ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + RTEventService_Servant::get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + ::Components::PublisherDescriptions * + RTEventService_Servant::get_named_publishers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)) + { + ACE_THROW_RETURN (::CORBA::NO_IMPLEMENT (), 0); + } + + // Operations for CCMObject interface. + + CORBA::IRObject_ptr + RTEventService_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::Components::CCMHome_ptr + RTEventService_Servant::get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::PrimaryKeyBase * + RTEventService_Servant::get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)) + { + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); + } + + void + RTEventService_Servant::configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)) + { + // CIAO to-do + } + + void + RTEventService_Servant::remove ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + // CIAO to-do + } + + ::Components::ComponentPortDescription * + RTEventService_Servant::get_all_ports ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc = + this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ReceptacleDescriptions_var receptacle_desc = + this->get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::ConsumerDescriptions_var consumer_desc = + this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::EmitterDescriptions_var emitter_desc = + this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ::Components::PublisherDescriptions_var publisher_desc = + this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv->facets (facets_desc.in ()); + retv->receptacles (receptacle_desc.in ()); + retv->consumers (consumer_desc.in ()); + retv->emitters (emitter_desc.in ()); + retv->publishers (publisher_desc.in ()); + + return retv._retn (); + } + + CORBA::Object_ptr + RTEventService_Servant::_get_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (sc.in ())) + { + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow ( + this->context_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::CORBA::Object::_nil ()); + + if (! ::CORBA::is_nil (ec.in ())) + { + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::CORBA::Object::_nil ()); + } + + // CIAO-specific operations. + + void + RTEventService_Servant::_ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + void + RTEventService_Servant::_ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::SessionComponent_var temp = + ::Components::SessionComponent::_narrow ( + this->executor_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (! ::CORBA::is_nil (temp.in ())) + { + temp->ccm_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + } + } + + // Supported operations. + + + RTEventServiceHome_Servant::RTEventServiceHome_Servant ( + ::BasicSP::CCM_RTEventServiceHome_ptr exe, + ::CIAO::Session_Container *c) + : executor_ (::BasicSP::CCM_RTEventServiceHome::_duplicate (exe)), + container_ (c) + { + } + + RTEventServiceHome_Servant::~RTEventServiceHome_Servant (void) + { + } + + // Operations for keyless home interface. + + ::Components::CCMObject_ptr + RTEventServiceHome_Servant::create_component ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Operations for implicit home interface. + + ::BasicSP::RTEventService_ptr + RTEventServiceHome_Servant::create ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)) + { + if (this->executor_.in () == 0) + { + ACE_THROW_RETURN ( + ::CORBA::INTERNAL (), + ::BasicSP::RTEventService::_nil ()); + } + + Components::EnterpriseComponent_var _ciao_ec = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + ::BasicSP::CCM_RTEventService_var _ciao_comp = + ::BasicSP::CCM_RTEventService::_narrow ( + _ciao_ec.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + return this->_ciao_activate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // Operations for CCMHome interface. + + ::CORBA::IRObject_ptr + RTEventServiceHome_Servant::get_component_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + ::CORBA::IRObject_ptr + RTEventServiceHome_Servant::get_home_def ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_THROW_RETURN ( + ::CORBA::NO_IMPLEMENT (), + ::CORBA::IRObject::_nil ()); + } + + void + RTEventServiceHome_Servant::remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)) + { + ::BasicSP::RTEventService_var _ciao_comp = + ::BasicSP::RTEventService::_narrow ( + comp + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (_ciao_comp.in ())) + { + ACE_THROW (CORBA::INTERNAL ()); + } + + _ciao_comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->_ciao_passivate_component ( + _ciao_comp.in () + ACE_ENV_ARG_PARAMETER); + } + + // CIAO-specific operations. + + ::BasicSP::RTEventService_ptr + RTEventServiceHome_Servant::_ciao_activate_component ( + ::BasicSP::CCM_RTEventService_ptr exe + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var hobj = + this->container_->get_objref ( + this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + ::Components::CCMHome_var home = + ::Components::CCMHome::_narrow ( + hobj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + RTEventService_Servant *svt = + new RTEventService_Servant ( + exe, + home.in (), + this->container_); + + PortableServer::ServantBase_var safe (svt); + PortableServer::ObjectId_var oid; + + CORBA::Object_var objref = + this->container_->install_component ( + svt, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + svt->_ciao_activate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + ::BasicSP::RTEventService_var ho = + ::BasicSP::RTEventService::_narrow ( + objref.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::BasicSP::RTEventService::_nil ()); + + if (this->component_map_.bind (oid.in (), svt) == 0) + { + safe._retn (); + } + + return ho._retn (); + } + + void + RTEventServiceHome_Servant::_ciao_passivate_component ( + ::BasicSP::RTEventService_ptr comp + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableServer::ObjectId_var oid; + + this->container_->uninstall_component ( + comp, + oid.out () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + RTEventService_Servant *servant = 0; + + if (this->component_map_.unbind (oid.in (), servant) == 0) + { + PortableServer::ServantBase_var safe (servant); + servant->_ciao_passivate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + // Supported operations. + + +} + +extern "C" RTEVENTSERVICE_SVNT_Export ::PortableServer::Servant +createRTEventServiceHome_Servant ( +::Components::HomeExecutorBase_ptr p, +CIAO::Session_Container *c +ACE_ENV_ARG_DECL) +{ + if (p == 0) + { + return 0; + } + + ::BasicSP::CCM_RTEventServiceHome_var x = + ::BasicSP::CCM_RTEventServiceHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + ::CIAO_GLUE_BasicSP::RTEventServiceHome_Servant ( + x.in (), + c); +} + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.h new file mode 100644 index 00000000000..ac196b89dd3 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt.h @@ -0,0 +1,525 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.cs.wustl.edu/~nanbor/projects/CIAO-src/docs/index.html + +#ifndef CIAO_GLUE_SESSION_RTEVENTSERVICE_SVNT_H +#define CIAO_GLUE_SESSION_RTEVENTSERVICE_SVNT_H +#include "ace/pre.h" + +#include "RTEventServiceS.h" +#include "RTEventServiceEC.h" + +#include "ciao/Container_Base.h" +#include "tao/LocalObject.h" +#include "tao/PortableServer/Key_Adapters.h" +#include "ace/Active_Map_Manager_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO_GLUE_BasicSP +{ + class RTEVENTSERVICE_SVNT_Export RTEventChannel_Servant + : public virtual POA_BasicSP::RTEventChannel, + public virtual PortableServer::RefCountServantBase + { + public: + RTEventChannel_Servant ( + ::BasicSP::CCM_RTEventChannel_ptr executor, + ::Components::CCMContext_ptr ctx); + + virtual ~RTEventChannel_Servant (void); + + virtual void + connect_consumer ( + const char * event_type, + const char * sink_name, + const char * consumer_oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + connect_supplier ( + const char * event_type, + const char * source_name, + const char * supplier_oid + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Facet executor. + ::BasicSP::CCM_RTEventChannel_var executor_; + + // Context object. + ::Components::CCMContext_var ctx_; + }; + +} + +namespace CIAO_GLUE_BasicSP +{ + class RTEVENTSERVICE_SVNT_Export RTEventService_Context + : public virtual ::BasicSP::CCM_RTEventService_Context, + public virtual TAO_Local_RefCounted_Object + { + public: + // We will allow the servant glue code we generate to access our state. + friend class RTEventService_Servant; + + RTEventService_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + RTEventService_Servant *sv); + + virtual ~RTEventService_Context (void); + + // Operations from ::Components::CCMContext. + + virtual ::Components::Principal_ptr + get_caller_principal ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role ( + const char *role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations from ::Components::SessionContext interface. + + virtual CORBA::Object_ptr + get_CCM_object ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::IllegalState)); + + // Operations for RTEventService receptacles and event sources, + // defined in ::BasicSP::CCM_RTEventService_Context. + + protected: + // Methods that manage this component's connections and consumers. + + protected: + ::Components::CCMHome_var + home_; + + ::CIAO::Session_Container * + container_; + + RTEventService_Servant * + servant_; + + ::BasicSP::RTEventService_var + component_; + }; + + class RTEVENTSERVICE_SVNT_Export RTEventService_Servant + : public virtual POA_BasicSP::RTEventService, + public virtual PortableServer::RefCountServantBase + { + public: + RTEventService_Servant ( + ::BasicSP::CCM_RTEventService_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~RTEventService_Servant (void); + + virtual ::BasicSP::RTEventChannel_ptr + provide_rt_event_channel ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Navigation interface. + + virtual CORBA::Object_ptr + provide_facet ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::FacetDescriptions * + get_all_facets ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual CORBA::Boolean + same_component ( + CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface. + + virtual ::Components::Cookie * + connect ( + const char *name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::AlreadyConnected, + ::Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr + disconnect ( + const char *name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::CookieRequired, + ::Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections ( + const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for Events interface. + + // NEW + virtual void + connect_publisher ( + RtecEventChannelAdmin::ProxyPushConsumer * proxy_consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + // END NEW + + virtual ::Components::EventConsumerBase_ptr + get_consumer ( + const char *sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::Cookie * + subscribe ( + const char *publisher_name, + ::Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection, + ::Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)); + + virtual void + connect_consumer ( + const char *emitter_name, + ::Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::AlreadyConnected, + ::Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer ( + const char *source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers ( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers( + const ::Components::NameList &names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName)); + + // Operations for CCMObject interface. + + virtual CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoKeyAvailable)); + + virtual void + configuration_complete ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConfiguration)); + + virtual void + remove ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Get component implementation. + virtual CORBA::Object_ptr + _get_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific operations. + + void + _ciao_activate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_RTEventService_var + executor_; + + RTEventService_Context * + context_; + + ::CIAO::Session_Container * + container_; + + ::BasicSP::RTEventChannel_var + provide_rt_event_channel_; + + }; + + class RTEVENTSERVICE_SVNT_Export RTEventServiceHome_Servant + : public virtual POA_BasicSP::RTEventServiceHome, + public virtual PortableServer::RefCountServantBase + { + public: + RTEventServiceHome_Servant ( + ::BasicSP::CCM_RTEventServiceHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~RTEventServiceHome_Servant (void); + + // Home factory and other operations. + + // Operations for keyless home interface. + + virtual ::Components::CCMObject_ptr + create_component ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for implicit home interface. + + virtual ::BasicSP::RTEventService_ptr + create ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::CreateFailure)); + + // Operations for CCMHome interface. + + virtual ::CORBA::IRObject_ptr + get_component_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + remove_component ( + ::Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::RemoveFailure)); + + // Supported operations. + + protected: + // CIAO-specific operations. + + ::BasicSP::RTEventService_ptr + _ciao_activate_component ( + ::BasicSP::CCM_RTEventService_ptr exe + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void + _ciao_passivate_component ( + ::BasicSP::RTEventService_ptr comp + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + ::BasicSP::CCM_RTEventServiceHome_var + executor_; + + ::CIAO::Session_Container * + container_; + + ACE_Hash_Map_Manager_Ex< + PortableServer::ObjectId, + RTEventService_Servant *, + TAO_ObjectId_Hash, + ACE_Equal_To<PortableServer::ObjectId>, + ACE_SYNCH_MUTEX> + component_map_; + }; + + extern "C" RTEVENTSERVICE_SVNT_Export ::PortableServer::Servant + createRTEventServiceHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + +} + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_RTEVENTSERVICE_SVNT_H */ + diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt_export.h b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt_export.h new file mode 100644 index 00000000000..cb2ff45a558 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/RTEventService/RTEventService_svnt_export.h @@ -0,0 +1,50 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl RTEVENTSERVICE_SVNT +// ------------------------------ +#ifndef RTEVENTSERVICE_SVNT_EXPORT_H +#define RTEVENTSERVICE_SVNT_EXPORT_H + +#include "ace/config-all.h" + +#if !defined (RTEVENTSERVICE_SVNT_HAS_DLL) +# define RTEVENTSERVICE_SVNT_HAS_DLL 1 +#endif /* ! RTEVENTSERVICE_SVNT_HAS_DLL */ + +#if defined (RTEVENTSERVICE_SVNT_HAS_DLL) && (RTEVENTSERVICE_SVNT_HAS_DLL == 1) +# if defined (RTEVENTSERVICE_SVNT_BUILD_DLL) +# define RTEVENTSERVICE_SVNT_Export ACE_Proper_Export_Flag +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* RTEVENTSERVICE_SVNT_BUILD_DLL */ +# define RTEVENTSERVICE_SVNT_Export ACE_Proper_Import_Flag +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* RTEVENTSERVICE_SVNT_BUILD_DLL */ +#else /* RTEVENTSERVICE_SVNT_HAS_DLL == 1 */ +# define RTEVENTSERVICE_SVNT_Export +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARATION(T) +# define RTEVENTSERVICE_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* RTEVENTSERVICE_SVNT_HAS_DLL == 1 */ + +// Set RTEVENTSERVICE_SVNT_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (RTEVENTSERVICE_SVNT_NTRACE) +# if (ACE_NTRACE == 1) +# define RTEVENTSERVICE_SVNT_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define RTEVENTSERVICE_SVNT_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !RTEVENTSERVICE_SVNT_NTRACE */ + +#if (RTEVENTSERVICE_SVNT_NTRACE == 1) +# define RTEVENTSERVICE_SVNT_TRACE(X) +#else /* (RTEVENTSERVICE_SVNT_NTRACE == 1) */ +# define RTEVENTSERVICE_SVNT_TRACE(X) ACE_TRACE_IMPL(X) +#endif /* (RTEVENTSERVICE_SVNT_NTRACE == 1) */ + +#endif /* RTEVENTSERVICE_SVNT_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.csd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.csd new file mode 100644 index 00000000000..e814dfcbc13 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.csd @@ -0,0 +1,45 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- GPS's Software Package Descriptor --> +<!-- This file describes various GPS executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMClosedED" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>BMClosedED</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A BMClosedED executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMClosedED:1.0" homeid="IDL:BasicSP/BMClosedEDHome:1.0"> + <fileinarchive name="BMClosedED.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMClosedED.ccd"/> + </descriptor> + + <implementation id="DCE:8E6C468D-A39F-46b4-962B-265F1AA8D538"> + + <dependency type="CIAODLL"> + <softpkgref> + <fileinarchive name="BMClosedED.ssd"/> + <implref idref="DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78"/> + </softpkgref> + </dependency> + + <code type="DLL"> + <fileinarchive name="BMClosedED_exec"/> + <entrypoint>createBMClosedEDHome_Impl</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.ssd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.ssd new file mode 100644 index 00000000000..8ef62ebaa1c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMClosedED.ssd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Servant Software Descriptor --> +<!-- This file describes various RateGen servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMClosedED-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>BasicSP::BMDevice Servants</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A EC event generator implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMClosedED:1.0" homeid="IDL:BasicSP/BMClosedEDHome:1.0"> + <fileinarchive name="BMClosedED.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMClosedED.ccd"/> + </descriptor> + + <implementation id="DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="BMClosedED_svnt"/> + <entrypoint>createBMClosedEDHome_Servant</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.csd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.csd new file mode 100644 index 00000000000..d4ae1236c6c --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.csd @@ -0,0 +1,46 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- GPS's Software Package Descriptor --> +<!-- This file describes various GPS executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMDevice" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>BMDevice</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A BMDevice executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMDevice:1.0" homeid="IDL:BasicSP/BMDeviceHome:1.0"> + <fileinarchive name="BMDevice.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMDevice.ccd"/> + </descriptor> + + <implementation id="DCE:82C2B032-37F0-4315-A59F-7020D3264E4D"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <fileinarchive name="BMDevice.ssd"/> + <implref idref="DCE:93D254CF-9538-44e8-BB98-AABCD134ADD3"/> + </softpkgref> + </dependency> + + <code type="DLL"> + <fileinarchive name="BMDevice_exec"/> + <entrypoint>createBMDeviceHome_Impl</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.ssd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.ssd new file mode 100644 index 00000000000..500a6284df0 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDevice.ssd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Servant Software Descriptor --> +<!-- This file describes various RateGen servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMDevice-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>BasicSP::BMDevice Servants</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A EC event generator implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMDevice:1.0" homeid="IDL:BasicSP/BMDeviceHome:1.0"> + <fileinarchive name="BMDevice.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMDevice.ccd"/> + </descriptor> + + <implementation id="DCE:93D254CF-9538-44e8-BB98-AABCD134ADD3"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="EC_svnt"/> + <entrypoint>createBMDeviceHome_Servant</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.csd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.csd new file mode 100644 index 00000000000..1f1d5ff0060 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.csd @@ -0,0 +1,46 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- GPS's Software Package Descriptor --> +<!-- This file describes various GPS executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMDisplay" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>BMDisplay</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.cs.wustl.edu/~doc/"/> + </author> + <description>A BMDisplay executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMDisplay:1.0" homeid="IDL:BasicSP/BMDisplayHome:1.0"> + <fileinarchive name="BMDisplay.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMDisplay.ccd"/> + </descriptor> + + <implementation id="DCE:8E92655E-CA07-46C8-B127-0F0872A8CC29"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <fileinarchive name="BMDisplay.ssd"/> + <implref idref="DCE:D7984625-8561-431d-9927-4E498B317C02"/> + </softpkgref> + </dependency> + + <code type="DLL"> + <fileinarchive name="BMDisplay_exec"/> + <entrypoint>createBMDisplayHome_Impl</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.ssd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.ssd new file mode 100644 index 00000000000..37949ebccb6 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BMDisplay.ssd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Servant Software Descriptor --> +<!-- This file describes various RateGen servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-BMDisplay-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>BasicSP::BMDisplay Servants</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A EC event generator implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/BMDisplay:1.0" homeid="IDL:BasicSP/BMDisplayHome:1.0"> + <fileinarchive name="BMDisplay.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="BMDisplay.ccd"/> + </descriptor> + + <implementation id="DCE:D7984625-8561-431d-9927-4E498B317C02"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="BMDisplay_svnt"/> + <entrypoint>createBMDisplayHome_Servant</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BasicSP.cad b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BasicSP.cad new file mode 100644 index 00000000000..e2cb241c2a6 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/BasicSP.cad @@ -0,0 +1,149 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE componentassembly SYSTEM "../../../../docs/XML/componentassembly.dtd"> + +<componentassembly id="Single-process Basic assembly"> + <componentfiles> + <componentfile id="com-EC"> + <fileinarchive name="EC.csd"/> + </componentfile> + <componentfile id="com-BMDevice"> + <fileinarchive name="BMDevice.csd"/> + </componentfile> + <componentfile id="com-BMClosedED"> + <fileinarchive name="BMClosedED.csd"/> + </componentfile> + <componentfile id="com-BMDisplay"> + <fileinarchive name="BMDisplay.csd"/> + </componentfile> + <componentfile id="com-RTEventService"> + <fileinarchive name="RTEventService.csd"/> + </componentfile> + </componentfiles> + + <partitioning> + + <!-- A plain vanilla partition. We don't even need the processcollocation tag here. --> + <homeplacement id="a_ECHome"> + <componentfileref idref="com-EC"/> + <componentinstantiation id="a_EC"> + <registercomponent> + <!-- writeiortofile is a non-standard CIAO extension. --> + <writeiortofile name="ec.ior"/> + </registercomponent> + </componentinstantiation> + </homeplacement> + <homeplacement id="a_BMDeviceHome"> + <componentfileref idref="com-BMDevice"/> + <componentinstantiation id="a_BMDevice"/> + </homeplacement> + <homeplacement id="a_BMClosedEDHome"> + <componentfileref idref="com-BMClosedED"/> + <componentinstantiation id="a_BMClosedED"/> + </homeplacement> + <homeplacement id="a_BMDisplayHome"> + <componentfileref idref="com-BMDisplay"/> + <componentinstantiation id="a_BMDisplay"/> + </homeplacement> + <homeplacement id="a_RTEventServiceHome"> + <componentfileref idref="com-RTEventService"/> + <componentinstantiation id="a_RTEventService"/> + </homeplacement> + + </partitioning> + + <connections> + + <connectinterface> + <usesport> + <usesidentifier>event_channel</usesidentifier> + <componentinstantiationref idref="a_EC"/> + </usesport> + <providesport> + <providesidentifier>rt_event_channel</providesidentifier> + <componentinstantiationref idref="a_RTEventService"/> + </providesport> + </connectinterface> + + <connectinterface> + <usesport> + <usesidentifier>event_channel</usesidentifier> + <componentinstantiationref idref="a_BMDevice"/> + </usesport> + <providesport> + <providesidentifier>rt_event_channel</providesidentifier> + <componentinstantiationref idref="a_RTEventService"/> + </providesport> + </connectinterface> + + <connectinterface> + <usesport> + <usesidentifier>event_channel</usesidentifier> + <componentinstantiationref idref="a_BMClosedED"/> + </usesport> + <providesport> + <providesidentifier>rt_event_channel</providesidentifier> + <componentinstantiationref idref="a_RTEventService"/> + </providesport> + </connectinterface> + + <connectevent> + <consumesport> + <consumesidentifier>timeout</consumesidentifier> + <componentinstantiationref idref="a_BMDevice"/> + </consumesport> + <publishesport> + <publishesidentifier>timeout</publishesidentifier> + <componentinstantiationref idref="a_EC"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>in_avail</consumesidentifier> + <componentinstantiationref idref="a_BMClosedED"/> + </consumesport> + <publishesport> + <publishesidentifier>data_available</publishesidentifier> + <componentinstantiationref idref="a_BMDevice"/> + </publishesport> + </connectevent> + + <connectevent> + <consumesport> + <consumesidentifier>data_ready</consumesidentifier> + <componentinstantiationref idref="a_BMDisplay"/> + </consumesport> + <publishesport> + <publishesidentifier>out_avail</publishesidentifier> + <componentinstantiationref idref="a_BMClosedED"/> + </publishesport> + </connectevent> + + <connectinterface> + <usesport> + <usesidentifier>datain</usesidentifier> + <componentinstantiationref idref="a_BMClosedED"/> + </usesport> + <providesport> + <providesidentifier>data_read</providesidentifier> + <componentinstantiationref idref="a_BMDevice"/> + </providesport> + </connectinterface> + + <connectinterface> + <usesport> + <usesidentifier>comp_data</usesidentifier> + <componentinstantiationref idref="a_BMDisplay"/> + </usesport> + <providesport> + <providesidentifier>dataout</providesidentifier> + <componentinstantiationref idref="a_BMClosedED"/> + </providesport> + </connectinterface> + + </connections> + +</componentassembly> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/CIAO_Installation_Data.ini b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/CIAO_Installation_Data.ini new file mode 100644 index 00000000000..085d68ba66a --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/CIAO_Installation_Data.ini @@ -0,0 +1,11 @@ +[ComponentInstallation] +DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40=EC_svnt +DCE:82C2B032-37F0-4315-A59F-7020D3264E4D=BMDevice_exec +DCE:8E92655E-CA07-46C8-B127-0F0872A8CC29=BMDisplay_exec +DCE:93D254CF-9538-44e8-BB98-AABCD134ADD3=BMDevice_svnt +DCE:CDC06FCA-50FC-43ca-8ECC-BEFBD33FEE78=BMClosedED_svnt +DCE:8E6C468D-A39F-46b4-962B-265F1AA8D538=BMClosedED_exec +DCE:D7984625-8561-431d-9927-4E498B317C02=BMDisplay_svnt +DCE:3148F760-F2ED-4204-A775-6B972C10E8CB=EC_exec +DCE:CC400D95-BF6B-4BBD-8D36-BDDCBB42A3EF=RTEventService_exec +DCE:515351D2-45F7-4BA3-8128-48283B8EEE5F=RTEventService_svnt diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.csd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.csd new file mode 100644 index 00000000000..562ac252743 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.csd @@ -0,0 +1,46 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Software Package Descriptor --> +<!-- This file describes various RateGen executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-EC" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>EC</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A Event executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/EC:1.0" homeid="IDL:BasicSP/ECHome:1.0"> + <fileinarchive name="EC.idl"/> + </idl> + <descriptor type="CORBA Component"> + <fileinarchive name="EC.ccd"/> + </descriptor> + <implementation id="DCE:3148F760-F2ED-4204-A775-6B972C10E8CB"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <!-- .ssd stands for Servant Software Descriptors which is a CIAO extension --> + <fileinarchive name="EC.ssd"/> + <implref idref="DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40"/> + </softpkgref> + </dependency> + + <code type="DLL"> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="EC_exec"/> + <entrypoint>createECHome_Impl</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.ssd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.ssd new file mode 100644 index 00000000000..02110072580 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/EC.ssd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Servant Software Descriptor --> +<!-- This file describes various RateGen servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-EC-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>BasicSP::EC Servants</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A EC event generator implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/EC:1.0" homeid="IDL:BasicSP/ECHome:1.0"> + <fileinarchive name="EC.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="EC.ccd"/> + </descriptor> + + <implementation id="DCE:75309233-0E0A-4cfb-B186-3E99F69B1D40"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="EC_svnt"/> + <entrypoint>createECHome_Servant</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.csd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.csd new file mode 100644 index 00000000000..eb8ef3ad40d --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.csd @@ -0,0 +1,47 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RTEventService's Software Package Descriptor --> +<!-- This file describes various RTEventService executor --> +<!-- implementations. --> + + +<softpkg name="CIAO-RTEventService" version="1.0"> + <pkgtype>CORBA Component</pkgtype> + <title>RTEventService</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>An Event Service executor implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/RTEventService:1.0" homeid="IDL:BasicSP/RTEventServiceHome:1.0"> + <fileinarchive name="RTEventService.idl"/> + </idl> + <descriptor type="CORBA Component"> + <fileinarchive name="RTEventService.ccd"/> + </descriptor> + + <implementation id="DCE:CC400D95-BF6B-4BBD-8D36-BDDCBB42A3EF"> + + <!-- CIAO extension --> + <dependency type="CIAODLL"> + <softpkgref> + <!-- .ssd stands for Servant Software Descriptors which is a CIAO extension --> + <fileinarchive name="RTEventService.ssd"/> + <implref idref="DCE:515351D2-45F7-4BA3-8128-48283B8EEE5F"/> + </softpkgref> + </dependency> + + <code type="DLL"> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="RTEventService_exec"/> + <entrypoint>createRTEventServiceHome_Impl</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.ssd b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.ssd new file mode 100644 index 00000000000..2993f9116c4 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/RTEventService.ssd @@ -0,0 +1,43 @@ +<?xml version="1.0"?> <!-- -*- SGML -*- --> + +<!-- If this file is moved to a different directory, make sure to change the + path to the DTD below. Otherwise the examples won't work. --> +<!DOCTYPE softpkg SYSTEM "../../../../docs/XML/softpkg.dtd"> + +<!-- RateGen's Servant Software Descriptor --> +<!-- This file describes various RateGen servant --> +<!-- implementations. --> + + +<softpkg name="CIAO-RTEventService-Servant" version="1.0"> + <pkgtype>CIAO Servant</pkgtype> + <title>BasicSP::RTEventService Servants</title> + <author> + <company>ISIS at Vanderbilt University</company> + <webpage href="http://www.dre.vanderbilt.edu/"/> + </author> + <description>A RTEventService implementation.</description> + <license href="http://www.cs.wustl.edu/~schmidt/ACE-copying.html"/> + <idl id="IDL:BasicSP/RTEventService:1.0" homeid="IDL:BasicSP/RTEventServiceHome:1.0"> + <fileinarchive name="RTEventService.idl"/> + </idl> + + <descriptor type="CORBA Component"> + <fileinarchive name="RTEventService.ccd"/> + </descriptor> + + <implementation id="DCE:515351D2-45F7-4BA3-8128-48283B8EEE5F"> + + <dependency type="ORB"> + <name>TAO</name> + </dependency> + + <code> + <!-- No need to specify extension below since ACE takes care of that, --> + <fileinarchive name="RTEventService_svnt"/> + <entrypoint>createRTEventServiceHome_Servant</entrypoint> + </code> + + </implementation> + +</softpkg> diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/test.dat b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/test.dat new file mode 100644 index 00000000000..d26b3d4e070 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC2/descriptors/test.dat @@ -0,0 +1,2 @@ +Default corbaloc:iiop:localhost:10000/ServerActivator +Remote corbaloc:iiop:localhost:12000/ServerActivator
\ No newline at end of file |