diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-02-02 22:08:25 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-02-02 22:08:25 +0000 |
commit | ec3fee3683d2e417c9e7ca2d4a6619502be06eb7 (patch) | |
tree | 1b2030293706481ac1f60a67875da9d62a063b46 | |
parent | d316bf0983e5280c2e3e484f8e3b27d820d56f8a (diff) | |
download | ATCD-ec3fee3683d2e417c9e7ca2d4a6619502be06eb7.tar.gz |
*** empty log message ***
7 files changed, 2224 insertions, 0 deletions
diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/SenderE.idl.new_impl b/TAO/CIAO/DAnCE/examples/Hello/Sender/SenderE.idl.new_impl new file mode 100644 index 00000000000..7237ecb64fd --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/SenderE.idl.new_impl @@ -0,0 +1,69 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Sender.idl" +module Hello +{ + local interface CCM_ReadMessage : ReadMessage + { + }; +}; + +module Hello +{ + local interface CCM_Sender : ::Components::EnterpriseComponent, ::Hello::trigger + { + ::Hello::CCM_ReadMessage get_push_message (); + attribute string local_message; + }; + + local interface CCM_Sender_Context : ::Components::SessionContext + { + void push_click_out (in ::Hello::TimeOut e); + ::Components::ConsumerDescriptions get_registered_consumer + (in ::Components::FeatureName publisher_name); + }; + + local interface CCM_SenderHomeImplicit + { + ::Components::EnterpriseComponent create () raises (::Components::CCMException); + }; + + local interface CCM_SenderHomeExplicit : ::Components::HomeExecutorBase + { + }; + + local interface CCM_SenderHome : CCM_SenderHomeExplicit, CCM_SenderHomeImplicit + { + }; +}; + +module Sender_Impl +{ + typedef ::Hello::CCM_Sender_Context Sender_Exec_Context; + local interface Sender_Exec : ::Hello::CCM_Sender, ::Components::SessionComponent + { + }; + + local interface SenderHome_Exec : ::Hello::CCM_SenderHome + { + }; +}; + diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp new file mode 100644 index 00000000000..ca1bf1698a4 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_1.cpp @@ -0,0 +1,143 @@ +//$Id$ + +#include "Sender_exec_1.h" +#include "Sender_exec.h" + +char* +Sender_Impl::Message_Impl_1::get_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender sending out message. \n")); + return CORBA::string_dup (component_.message_.in ()); +} + +Sender_Impl::Sender_exec_1_i::~Sender_exec_1_i () +{ +} + +void +Sender_Impl::Sender_exec_1_i::local_message (const char * local_message + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + message_ = CORBA::string_dup (local_message); +} + +char * +Sender_Impl::Sender_exec_1_i::local_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup(message_); +} + +Hello::CCM_ReadMessage_ptr +Sender_Impl::Sender_exec_1_i::get_push_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_1_i::get_push_message called\n")); + return ( new Message_Impl_1 (*this) ); +} + +void +Sender_Impl::Sender_exec_1_i::start (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + Hello::TimeOut_var event = new OBV_Hello::TimeOut; + ACE_DEBUG ((LM_DEBUG, "Sender initiates the process.\n")); + this->context_->push_click_out (event ACE_ENV_ARG_PARAMETER); +} + +void +Sender_Impl::Sender_exec_1_i::set_session_context + (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_1_i::set_session_context\n")); + + this->context_ = + Sender_Impl::Sender_Exec_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); +} + +void +Sender_Impl::Sender_exec_1_i::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_1_i::ciao_preactivate\n")); +} + +void +Sender_Impl::Sender_exec_1_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_1_i::ccm_activate\n")); + + CORBA::Object_var o = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +void +Sender_Impl::Sender_exec_1_i::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_1_i::ciao_postactivate\n")); +} + +void +Sender_Impl::Sender_exec_1_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_1_i::ccm_passivate\n")); + CORBA::Object_var comp_object = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + Hello::Sender_var sender = Hello::Sender::_narrow (comp_object.in () + ACE_ENV_ARG_PARAMETER); + + Components::ConsumerDescriptions_var retval = + this->context_->get_registered_consumer ("click_out" + ACE_ENV_ARG_PARAMETER); + ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", retval->length ())); + this->base_exec_->consumers (retval._retn ()); + /* + ::Components::ConsumerDescriptions_var cons_desc = + sender->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + ACE_DEBUG ((LM_DEBUG, "length of consumers is %d\n", cons_desc->length ())); + */ + // this->base_exec_->consumers (cons_desc._retn ()); +} + +void +Sender_Impl::Sender_exec_1_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_1_i::ccm_remove\n")); +} + +extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr +createSenderExec_Impl (Sender_Impl::SenderSwap_exec_i *p) +{ + Sender_Impl::Sender_exec_1_i *tmp = + new Sender_Impl::Sender_exec_1_i (); + + tmp->swap_exec (p); + + return tmp; +} diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp new file mode 100644 index 00000000000..30d08a2f530 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_exec_2.cpp @@ -0,0 +1,145 @@ +//$Id$ + +#include "Sender_exec_2.h" +#include "Sender_exec.h" + +char* +Sender_Impl::Message_Impl_2::get_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender sending out message. \n")); + return CORBA::string_dup (component_.message_.in ()); +} + +Sender_Impl::Sender_exec_2_i::~Sender_exec_2_i () +{ +} + +void +Sender_Impl::Sender_exec_2_i::local_message (const char * local_message + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + message_ = CORBA::string_dup (local_message); +} + +char * +Sender_Impl::Sender_exec_2_i::local_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return CORBA::string_dup(message_); +} + +Hello::CCM_ReadMessage_ptr +Sender_Impl::Sender_exec_2_i::get_push_message (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_2_i::get_push_message called\n")); + return ( new Message_Impl_2 (*this) ); +} + +void +Sender_Impl::Sender_exec_2_i::start (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + Hello::TimeOut_var event = new OBV_Hello::TimeOut; + ACE_DEBUG ((LM_DEBUG, "Sender 2 initiates the process.\n")); + this->context_->push_click_out (event ACE_ENV_ARG_PARAMETER); +} + +void +Sender_Impl::Sender_exec_2_i::set_session_context + (Components::SessionContext_ptr ctx + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_2_i::set_session_context\n")); + + this->context_ = + Sender_Impl::Sender_Exec_Context::_narrow (ctx + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); +} + +void +Sender_Impl::Sender_exec_2_i::ciao_preactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_2_i::ciao_preactivate\n")); +} + +void +Sender_Impl::Sender_exec_2_i::ccm_activate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_2_i::ccm_activate\n")); + + ::Components::ConsumerDescriptions_var c = + this->base_exec_->consumers (); + + if (CORBA::is_nil (this->context_.in ())) + ACE_THROW (CORBA::INTERNAL ()); + ACE_CHECK; + + CORBA::Object_var o = + this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + + Hello::Sender_var sender = + Hello::Sender::_narrow (o.in () + ACE_ENV_ARG_PARAMETER); + + for (CORBA::ULong cnt = 0; + cnt != c->length (); + ++cnt) + { + sender->subscribe ("click_out", + (*c)[cnt]->consumer () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } +} + +void +Sender_Impl::Sender_exec_2_i::ciao_postactivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, + "Sender_Impl::Sender_exec_2_i::ciao_postactivate\n")); +} + +void +Sender_Impl::Sender_exec_2_i::ccm_passivate (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_2_i::ccm_passivate\n")); +} + +void +Sender_Impl::Sender_exec_2_i::ccm_remove (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CCMException)) +{ + ACE_DEBUG ((LM_DEBUG, "Sender_Impl::Sender_exec_2_i::ccm_remove\n")); +} + +extern "C" SENDER_EXEC_Export ::Components::EnterpriseComponent_ptr +createSenderExec_Impl (Sender_Impl::SenderSwap_exec_i *p) +{ + Sender_Impl::Sender_exec_2_i *tmp = + new Sender_Impl::Sender_exec_2_i (); + + tmp->swap_exec (p); + + return tmp; +} diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.no-connections b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.no-connections new file mode 100644 index 00000000000..94723a55331 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.no-connections @@ -0,0 +1,354 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Sender_svnt.h" +#include "Cookies.h" +#include "ciao/Servant_Activator.h" +#include "ciao/Port_Activator_T.h" + +namespace Sender_Impl +{ + namespace CIAO_GLUE_Hello + { + Sender_Context::Sender_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Swapping_Container *c, + Sender_Servant *sv) + : ACE_NESTED_CLASS (CIAO, Context_Impl_Base (home, c)), + ctx_svnt_base (home, c, sv) + { + } + + Sender_Context::~Sender_Context (void) + { + } + + // Operations for Sender receptacles and event sources, + // defined in ::Hello::CCM_Sender_Context. + + // CIAO-specific. + + Sender_Context * + Sender_Context::_narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_NOT_USED) + { + return dynamic_cast<Sender_Context *> (p); + } + } + + namespace CIAO_GLUE_Hello + { + Sender_Servant::Sender_Servant ( + ::Hello::CCM_Sender_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Swapping_Container *c) + : ACE_NESTED_CLASS (CIAO, Servant_Impl_Base (c)), + comp_svnt_base (exe, c) + { + this->context_ = new Sender_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_TRY_CHECK; + } + + this->populate_port_tables ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + + ACE_CATCHANY + { + } + + ACE_ENDTRY; + } + + Sender_Servant::~Sender_Servant (void) + { + } + + void + Sender_Servant::set_attributes ( + const ::Components::ConfigValues &descr + ACE_ENV_ARG_DECL_NOT_USED) + { + for (CORBA::ULong i = 0; + i < descr.length (); + ++i) + { + const char *descr_name = descr[i]->name (); + ::CORBA::Any &descr_value = descr[i]->value (); + + if (ACE_OS::strcmp (descr_name, "local_message") == 0) + { + const char * _ciao_extract_val = 0; + descr_value >>= _ciao_extract_val; + this->local_message (_ciao_extract_val); + continue; + } + + ACE_UNUSED_ARG (descr_name); + ACE_UNUSED_ARG (descr_value); + } + } + + ::Components::Cookie * + Sender_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 the component has no receptacles, this will be unused. + ACE_UNUSED_ARG (connection); + + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + Sender_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 ()); + + ACE_UNUSED_ARG (ck); + } + + void + Sender_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)) + { + if (emitter_name == 0) + { + ACE_THROW (::CORBA::BAD_PARAM ()); + } + + ACE_UNUSED_ARG (consumer); + ACE_THROW (::Components::InvalidName ()); + } + + ::Components::Cookie * + Sender_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)) + { + // Just in case there are no if blocks + ACE_UNUSED_ARG (subscribe); + + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + Sender_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + // Just in case there are no if blocks + ACE_UNUSED_ARG (ck); + + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + CORBA::Object_ptr + Sender_Servant::get_facet_executor (const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException)) + { + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + return CORBA::Object::_nil (); + } + + // Supported operations. + + void + Sender_Servant::start ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->start ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Component attribute operations. + + char * + Sender_Servant::local_message ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->executor_->local_message ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + Sender_Servant::local_message ( + const char * local_message + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->local_message ( + local_message + ACE_ENV_ARG_PARAMETER); + } + + // Private method to populate the port tables. + void + Sender_Servant::populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_ENV_ARG_NOT_USED; + ::CORBA::Object_var obj_var; + ::Components::EventConsumerBase_var ecb_var; + } + } + + namespace CIAO_GLUE_Hello + { + SenderHome_Servant::SenderHome_Servant ( + ::Hello::CCM_SenderHome_ptr exe, + ::CIAO::Swapping_Container *c) + : ACE_NESTED_CLASS (CIAO, Swapping_Servant_Home_Impl_Base (c)), + home_svnt_base (exe, c, "Sender_Impl_Hello_Sender", + "Sender_Impl_Hello_Sender") + { + } + + SenderHome_Servant::~SenderHome_Servant (void) + { + } + + // Home operations. + + // Home supported interface operations. + + // Home factory and finder operations. + + // Home attribute operations. + } + + extern "C" SENDER_SVNT_Export ::PortableServer::Servant + createSenderHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Swapping_Container *c + ACE_ENV_ARG_DECL) + { + if (p == 0) + { + return 0; + } + + ::Hello::CCM_SenderHome_var x = + ::Hello::CCM_SenderHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + CIAO_GLUE_Hello::SenderHome_Servant ( + x.in (), + c); + } +} + diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections new file mode 100644 index 00000000000..9d096ae8202 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.cpp.with-connections @@ -0,0 +1,853 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#include "Sender_svnt.h" +#include "Cookies.h" +#include "ciao/Servant_Activator.h" +#include "ciao/Dynamic_Component_Activator.h" +#include "ciao/Port_Activator_T.h" + +namespace Sender_Impl +{ + namespace CIAO_GLUE_Hello + { + template <typename T> + ReadMessage_Servant_T<T>::ReadMessage_Servant_T ( + ::Hello::CCM_ReadMessage_ptr executor, + ::Components::CCMContext_ptr c) + : executor_ (::Hello::CCM_ReadMessage::_duplicate (executor)), + ctx_ (::Components::CCMContext::_duplicate (c)) + { + } + + template <typename T> + ReadMessage_Servant_T<T>::~ReadMessage_Servant_T (void) + { + } + + template <typename T> + char * + ReadMessage_Servant_T<T>::get_message ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->executor_->get_message ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + template <typename T> + CORBA::Object_ptr + ReadMessage_Servant_T<T>::_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_Hello + { + Sender_Context::Sender_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + Sender_Servant *sv) + : ACE_NESTED_CLASS (CIAO, Context_Impl_Base (home, c)), + ctx_svnt_base (home, c, sv) + { + } + + Sender_Context::~Sender_Context (void) + { + } + + // Operations for Sender receptacles and event sources, + // defined in ::Hello::CCM_Sender_Context. + + ::Components::ConsumerDescriptions * + Sender_Context::get_registered_consumer ( + const char* publisher_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::ConsumerDescriptions *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Components::ConsumerDescriptions + (this->ciao_publishes_click_out_map_.current_size ()), + CORBA::NO_MEMORY ()); + ::Components::ConsumerDescriptions_var retval = tmp; + + retval->length (this->ciao_publishes_click_out_map_.current_size ()); + CORBA::ULong i = 0; + + ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::iterator end = + this->ciao_publishes_click_out_map_.end (); + + for (ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::iterator iter = + this->ciao_publishes_click_out_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::ENTRY &entry = *iter; + + ::Hello::TimeOutConsumer_var c = + ::Hello::TimeOutConsumer::_narrow ( + entry.int_id_.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + ::Components::ConsumerDescription *cd = 0; + ACE_NEW_THROW_EX (cd, + OBV_Components::ConsumerDescription (), + CORBA::NO_MEMORY ()); + ::Components::ConsumerDescription_var safe = cd; + + safe->name (""); + safe->type_id (""); + safe->consumer (c); + + retval[i] = safe; + } + return retval._retn (); + } + + void + Sender_Context::push_click_out ( + ::Hello::TimeOut *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::iterator end = + this->ciao_publishes_click_out_map_.end (); + + for (ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::iterator iter = + this->ciao_publishes_click_out_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var>::ENTRY &entry = *iter; + + ::Hello::TimeOutConsumer_var c = + ::Hello::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 * + Sender_Context::subscribe_click_out ( + ::Hello::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + if (CORBA::is_nil (c)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + } + + ::Hello::TimeOutConsumer_var sub = + ::Hello::TimeOutConsumer::_duplicate (c); + + ACE_Active_Map_Manager_Key key; + this->ciao_publishes_click_out_map_.bind (sub.in (), key); + sub._retn (); + + ::Components::Cookie_var retv = new ::CIAO::Map_Key_Cookie (key); + return retv._retn (); + } + + ::Hello::TimeOutConsumer_ptr + Sender_Context::unsubscribe_click_out ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + ::Hello::TimeOutConsumer_var retv; + ACE_Active_Map_Manager_Key key; + + if (ck == 0 || ::CIAO::Map_Key_Cookie::extract (ck, key) == false) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::Hello::TimeOutConsumer::_nil ()); + } + + if (this->ciao_publishes_click_out_map_.unbind (key, retv) != 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidConnection (), + ::Hello::TimeOutConsumer::_nil ()); + } + + return retv._retn (); + } + + // CIAO-specific. + + Sender_Context * + Sender_Context::_narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_NOT_USED) + { + return dynamic_cast<Sender_Context *> (p); + } + } + + namespace CIAO_GLUE_Hello + { + Sender_Servant::Sender_Servant ( + ::Hello::CCM_Sender_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Home_Servant_Impl_Base *home_servant, + ::CIAO::Session_Container *c) + : ACE_NESTED_CLASS (CIAO, Servant_Impl_Base (h, home_servant, c)), + comp_svnt_base (exe, h, home_servant, c) + { + this->context_ = new Sender_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_TRY_CHECK; + } + + this->populate_port_tables ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + + ACE_CATCHANY + { + } + + ACE_ENDTRY; + } + + Sender_Servant::~Sender_Servant (void) + { + } + + void + Sender_Servant::set_attributes ( + const ::Components::ConfigValues &descr + ACE_ENV_ARG_DECL_NOT_USED) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + for (CORBA::ULong i = 0; + i < descr.length (); + ++i) + { + const char *descr_name = descr[i]->name (); + ::CORBA::Any &descr_value = descr[i]->value (); + + if (ACE_OS::strcmp (descr_name, "local_message") == 0) + { + const char * _ciao_extract_val = 0; + descr_value >>= _ciao_extract_val; + this->local_message (_ciao_extract_val); + continue; + } + + ACE_UNUSED_ARG (descr_name); + ACE_UNUSED_ARG (descr_value); + } + } + + ::Hello::ReadMessage_ptr + Sender_Servant::provide_push_message ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + if (! ::CORBA::is_nil (this->provide_push_message_.in ())) + { + return ::Hello::ReadMessage::_duplicate (this->provide_push_message_.in ()); + } + + ::CORBA::Object_var obj = + this->provide_push_message_i (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::Hello::ReadMessage::_nil ()); + + ::Hello::ReadMessage_var fo = + ::Hello::ReadMessage::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::Hello::ReadMessage::_nil ()); + + this->provide_push_message_ = fo; + return ::Hello::ReadMessage::_duplicate (this->provide_push_message_.in ()); + } + + ::CORBA::Object_ptr + Sender_Servant::provide_push_message_i ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_ptr ret = + this->lookup_facet ("push_message"); + + if (! ::CORBA::is_nil (ret)) + { + return ret; + } + + CIAO::Port_Activator_T< + CIAO_GLUE_Hello::ReadMessage_Servant, + ::Hello::CCM_ReadMessage, + ::Components::CCMContext, + Sender_Servant + > *tmp = 0; + + typedef CIAO::Port_Activator_T< + CIAO_GLUE_Hello::ReadMessage_Servant, + ::Hello::CCM_ReadMessage, + ::Components::CCMContext, + Sender_Servant + > + MACRO_MADNESS_TYPEDEF; + + ACE_NEW_THROW_EX ( + tmp, + MACRO_MADNESS_TYPEDEF ( + "Hello_Sender_push_message", + "push_message", + CIAO::Port_Activator::Facet, + 0, + this->context_, + this), + CORBA::NO_MEMORY ()); + + CIAO::Servant_Activator *sa = + this->container_->ports_servant_activator (); + + if (!sa->register_port_activator (tmp)) + { + return 0; + } + + ::CORBA::Object_var obj = + this->container_->generate_reference ( + "Hello_Sender_push_message", + "IDL:Hello/ReadMessage:1.0", + CIAO::Container::Facet_Consumer + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::Hello::ReadMessage::_nil ()); + + this->add_facet ( + "push_message", + obj.in ()); + + return obj._retn (); + } + + ::Components::Cookie * + Sender_Servant::subscribe_click_out ( + ::Hello::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + return this->context_->subscribe_click_out ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::Hello::TimeOutConsumer_ptr + Sender_Servant::unsubscribe_click_out ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + return this->context_->unsubscribe_click_out ( + ck + ACE_ENV_ARG_PARAMETER); + } + + ::Components::Cookie * + Sender_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 (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // If the component has no receptacles, this will be unused. + ACE_UNUSED_ARG (connection); + + if (name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + CORBA::Object_ptr + Sender_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 (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + if (name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::CORBA::Object::_nil ()); + + ACE_UNUSED_ARG (ck); + } + + void + Sender_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)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + if (emitter_name == 0) + { + ACE_THROW (::CORBA::BAD_PARAM ()); + } + + ACE_UNUSED_ARG (consumer); + ACE_THROW (::Components::InvalidName ()); + } + + ::Components::Cookie * + Sender_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 (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Just in case there are no if blocks + ACE_UNUSED_ARG (subscribe); + + if (publisher_name == 0) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + if (ACE_OS::strcmp (publisher_name, "click_out") == 0) + { + ::Hello::TimeOutConsumer_var _ciao_consumer = + ::Hello::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_click_out ( + _ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + + ::Components::EventConsumerBase_ptr + Sender_Servant::unsubscribe ( + const char *publisher_name, + ::Components::Cookie *ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidName, + ::Components::InvalidConnection)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Just in case there are no if blocks + ACE_UNUSED_ARG (ck); + + if (publisher_name == 0) + { + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + if (ACE_OS::strcmp (publisher_name, "click_out") == 0) + { + return this->unsubscribe_click_out ( + ck + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN ( + ::Components::InvalidName (), + ::Components::EventConsumerBase::_nil ()); + } + + CORBA::Object_ptr + Sender_Servant::get_facet_executor (const char *name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + if (name == 0) + { + ACE_THROW_RETURN ( + ::CORBA::BAD_PARAM (), + ::CORBA::Object::_nil ()); + } + + if (ACE_OS::strcmp (name, "push_message") == 0) + { + return this->executor_->get_push_message (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + return CORBA::Object::_nil (); + } + + // Supported operations. + + void + Sender_Servant::start ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + this->executor_->start ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Component attribute operations. + + char * + Sender_Servant::local_message ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + return this->executor_->local_message ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + void + Sender_Servant::local_message ( + const char * local_message + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (this->is_activated () == 0) + { + this->ciao_preactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_activate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + + this->ciao_postactivate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + this->executor_->local_message ( + local_message + ACE_ENV_ARG_PARAMETER); + } + + // Private method to populate the port tables. + void + Sender_Servant::populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ACE_ENV_ARG_NOT_USED; + ::CORBA::Object_var obj_var; + ::Components::EventConsumerBase_var ecb_var; + + obj_var = + this->provide_push_message_i ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + namespace CIAO_GLUE_Hello + { + SenderHome_Servant::SenderHome_Servant ( + ::Hello::CCM_SenderHome_ptr exe, + ::CIAO::Session_Container *c) + : ACE_NESTED_CLASS (CIAO, Home_Servant_Impl_Base (c)), + home_svnt_base (exe, c, "Sender_Impl_Hello_Sender", + "Sender_Impl_Hello_Sender") + { + } + + SenderHome_Servant::~SenderHome_Servant (void) + { + } + + // Home operations. + + // Home supported interface operations. + + // Home factory and finder operations. + + // Home attribute operations. + } + + extern "C" SENDER_SVNT_Export ::PortableServer::Servant + createSenderHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL) + { + if (p == 0) + { + return 0; + } + + ::Hello::CCM_SenderHome_var x = + ::Hello::CCM_SenderHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + CIAO_GLUE_Hello::SenderHome_Servant ( + x.in (), + c); + } +} + diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.no-connections b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.no-connections new file mode 100644 index 00000000000..c1ce0e63fd2 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.no-connections @@ -0,0 +1,275 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_GLUE_SESSION_SENDER_SVNT_H +#define CIAO_GLUE_SESSION_SENDER_SVNT_H + + +#include /**/ "ace/pre.h" + +#include "SenderEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Container_Base.h" +#include "ciao/Swapping_Container.h" +#include "ciao/Servant_Impl_T.h" +#include "ciao/Context_Impl_T.h" +#include "ciao/Home_Servant_Impl_T.h" +#include "ciao/Swapping_Servant_Home_Impl_T.h" +#include "ace/Active_Map_Manager_T.h" + +#include "SenderS.h" + +namespace Sender_Impl +{ + namespace CIAO_GLUE_Hello + { + class Sender_Servant; + + class SENDER_SVNT_Export Sender_Context + : public virtual CIAO::Context_Impl< + ::Hello::CCM_Sender_Context, + Sender_Servant, + ::Hello::Sender, + ::Hello::Sender_var + > + { + public: + // We will allow the servant glue code we generate to access our state. + friend class Sender_Servant; + + /// Hack for VC6. + typedef CIAO::Context_Impl< + ::Hello::CCM_Sender_Context, + Sender_Servant, + ::Hello::Sender, + ::Hello::Sender_var + > ctx_svnt_base; + + Sender_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Swapping_Container *c, + Sender_Servant *sv); + + virtual ~Sender_Context (void); + + // Operations for Sender receptacles and event sources, + // defined in ::Hello::CCM_Sender_Context. + + // CIAO-specific. + + static Sender_Context * + _narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + protected: + // Methods that manage this component's connections and consumers. + + protected: + }; + } + + namespace CIAO_GLUE_Hello + { + class SENDER_SVNT_Export Sender_Servant + : public virtual CIAO::Servant_Impl< + POA_Hello::Sender, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Context + > + { + public: + /// Hack for VC6. + typedef CIAO::Servant_Impl< + POA_Hello::Sender, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Context + > comp_svnt_base; + + Sender_Servant ( + ::Hello::CCM_Sender_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Swapping_Container *c); + + virtual ~Sender_Servant (void); + + virtual void + set_attributes ( + const ::Components::ConfigValues &descr + ACE_ENV_ARG_DECL); + + // Supported operations. + + virtual void + start ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Public port operations. + + // Component attribute operations. + + virtual char * + local_message ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + local_message ( + const char * + 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)); + + // Operations for Events interface. + + 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)); + + // CIAO specific operations on the servant + CORBA::Object_ptr + get_facet_executor (const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException)); + + private: + + private: + + void + populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + }; + } + + namespace CIAO_GLUE_Hello + { + class SENDER_SVNT_Export SenderHome_Servant + : public virtual CIAO::Swapping_Servant_Home_Impl< + POA_Hello::SenderHome, + ::Hello::CCM_SenderHome, + ::Hello::CCM_SenderHome_var, + ::Hello::Sender, + ::Hello::Sender_var, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Servant + > + { + public: + /// Hack for VC6. + typedef CIAO::Swapping_Servant_Home_Impl< + POA_Hello::SenderHome, + ::Hello::CCM_SenderHome, + ::Hello::CCM_SenderHome_var, + ::Hello::Sender, + ::Hello::Sender_var, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Servant + > home_svnt_base; + + SenderHome_Servant ( + ::Hello::CCM_SenderHome_ptr exe, + ::CIAO::Swapping_Container *c); + + virtual ~SenderHome_Servant (void); + + // Home operations. + + // Home factory and finder operations. + + // Attribute operations. + }; + + extern "C" SENDER_SVNT_Export ::PortableServer::Servant + createSenderHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Swapping_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_GLUE_SESSION_SENDER_SVNT_H */ + diff --git a/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.with-connections b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.with-connections new file mode 100644 index 00000000000..97b425d6dfa --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Sender/Sender_svnt.h.with-connections @@ -0,0 +1,385 @@ +// $Id$ +// +// **** Code generated by the **** +// **** Component Integrated ACE ORB (CIAO) CIDL Compiler **** +// CIAO has been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// CIDL Compiler has been developed by: +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about CIAO is available at: +// http://www.dre.vanderbilt.edu/CIAO + +#ifndef CIAO_GLUE_SESSION_SENDER_SVNT_H +#define CIAO_GLUE_SESSION_SENDER_SVNT_H + +#include /**/ "ace/pre.h" + +#include "SenderEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Container_Base.h" +#include "ciao/Swapping_Container.h" +#include "ciao/Servant_Impl_T.h" +#include "ciao/Context_Impl_T.h" +#include "ciao/Home_Servant_Impl_T.h" +#include "ciao/Home_Servant_Impl_Base.h" +#include "ciao/Swapping_Servant_Home_Impl_T.h" +#include "ace/Active_Map_Manager_T.h" + +#include "SenderS.h" + +namespace Sender_Impl +{ + namespace CIAO_GLUE_Hello + { + template <typename T> + class ReadMessage_Servant_T + : public virtual POA_Hello::ReadMessage, + public virtual PortableServer::RefCountServantBase + { + public: + ReadMessage_Servant_T ( + ::Hello::CCM_ReadMessage_ptr executor, + ::Components::CCMContext_ptr ctx); + + virtual ~ReadMessage_Servant_T (void); + + virtual char * + get_message ( + 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. + ::Hello::CCM_ReadMessage_var executor_; + + // Context object. + ::Components::CCMContext_var ctx_; + }; + + typedef SENDER_SVNT_Export ReadMessage_Servant_T<int> ReadMessage_Servant; + } + + namespace CIAO_GLUE_Hello + { + class Sender_Servant; + + class SENDER_SVNT_Export Sender_Context + : public virtual CIAO::Context_Impl< + ::Hello::CCM_Sender_Context, + Sender_Servant, + ::Hello::Sender, + ::Hello::Sender_var + > + { + public: + // We will allow the servant glue code we generate to access our state. + friend class Sender_Servant; + + /// Hack for VC6. + typedef CIAO::Context_Impl< + ::Hello::CCM_Sender_Context, + Sender_Servant, + ::Hello::Sender, + ::Hello::Sender_var + > ctx_svnt_base; + + Sender_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + Sender_Servant *sv); + + virtual ~Sender_Context (void); + + // Operations for Sender receptacles and event sources, + // defined in ::Hello::CCM_Sender_Context. + + virtual void + push_click_out ( + ::Hello::TimeOut *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_registered_consumer (const char *publisher_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific. + + static Sender_Context * + _narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + protected: + // Methods that manage this component's connections and consumers. + + /* + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + */ + + virtual ::Components::Cookie * + subscribe_click_out ( + ::Hello::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::Hello::TimeOutConsumer_ptr + unsubscribe_click_out ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + protected: + ACE_Active_Map_Manager< + ::Hello::TimeOutConsumer_var> + ciao_publishes_click_out_map_; + }; + } + + namespace CIAO_GLUE_Hello + { + class SENDER_SVNT_Export Sender_Servant + : public virtual CIAO::Servant_Impl< + POA_Hello::Sender, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Context + > + { + public: + /// Hack for VC6. + typedef CIAO::Servant_Impl< + POA_Hello::Sender, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Context + > comp_svnt_base; + + Sender_Servant ( + ::Hello::CCM_Sender_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Home_Servant_Impl_Base *home_servant, + ::CIAO::Session_Container *c); + + virtual ~Sender_Servant (void); + + virtual void + set_attributes ( + const ::Components::ConfigValues &descr + ACE_ENV_ARG_DECL); + + // Supported operations. + + virtual void + start ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Public port operations. + + virtual ::Hello::ReadMessage_ptr + provide_push_message ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::Cookie * + subscribe_click_out ( + ::Hello::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual ::Hello::TimeOutConsumer_ptr + unsubscribe_click_out ( + ::Components::Cookie *ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::InvalidConnection)); + + // Component attribute operations. + + virtual char * + local_message ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + local_message ( + const char * + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /* + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_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)); + + // Operations for Events interface. + + 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)); + + // CIAO specific operations on the servant + CORBA::Object_ptr + get_facet_executor (const char *name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException)); + + private: + + ::Hello::ReadMessage_var + provide_push_message_; + + private: + + void + populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + ::CORBA::Object_ptr + provide_push_message_i ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + }; + } + + namespace CIAO_GLUE_Hello + { + class SENDER_SVNT_Export SenderHome_Servant + : public virtual CIAO::Swapping_Servant_Home_Impl< + POA_Hello::SenderHome, + ::Hello::CCM_SenderHome, + ::Hello::CCM_SenderHome_var, + ::Hello::Sender, + ::Hello::Sender_var, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Servant + > + { + public: + /// Hack for VC6. + typedef CIAO::Swapping_Servant_Home_Impl< + POA_Hello::SenderHome, + ::Hello::CCM_SenderHome, + ::Hello::CCM_SenderHome_var, + ::Hello::Sender, + ::Hello::Sender_var, + ::Hello::CCM_Sender, + ::Hello::CCM_Sender_var, + Sender_Servant + > home_svnt_base; + + SenderHome_Servant ( + ::Hello::CCM_SenderHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~SenderHome_Servant (void); + + // Home operations. + + // Home factory and finder operations. + + // Attribute operations. + }; + + extern "C" SENDER_SVNT_Export ::PortableServer::Servant + createSenderHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_GLUE_SESSION_SENDER_SVNT_H */ + |