diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/examples/Hello/Receiver/Receiver_svnt.cpp.no-connections')
-rw-r--r-- | TAO/CIAO/DAnCE/examples/Hello/Receiver/Receiver_svnt.cpp.no-connections | 317 |
1 files changed, 317 insertions, 0 deletions
diff --git a/TAO/CIAO/DAnCE/examples/Hello/Receiver/Receiver_svnt.cpp.no-connections b/TAO/CIAO/DAnCE/examples/Hello/Receiver/Receiver_svnt.cpp.no-connections new file mode 100644 index 00000000000..ade8f64fff2 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/Hello/Receiver/Receiver_svnt.cpp.no-connections @@ -0,0 +1,317 @@ +// $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 "Receiver_svnt.h" +#include "Cookies.h" +#include "ciao/Servant_Activator.h" +#include "ciao/Port_Activator_T.h" + +namespace Receiver_Impl +{ + namespace CIAO_GLUE_Hello + { + Receiver_Context::Receiver_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Swapping_Container *c, + Receiver_Servant *sv) + : ACE_NESTED_CLASS (CIAO, Context_Impl_Base (home, c)), + ctx_svnt_base (home, c, sv) + { + } + + Receiver_Context::~Receiver_Context (void) + { + } + + // Operations for Receiver receptacles and event sources, + // defined in ::Hello::CCM_Receiver_Context. + + // CIAO-specific. + + Receiver_Context * + Receiver_Context::_narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_NOT_USED) + { + return dynamic_cast<Receiver_Context *> (p); + } + } + + namespace CIAO_GLUE_Hello + { + Receiver_Servant::Receiver_Servant ( + ::Hello::CCM_Receiver_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 Receiver_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; + } + + Receiver_Servant::~Receiver_Servant (void) + { + } + + void + Receiver_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 (); + + ACE_UNUSED_ARG (descr_name); + ACE_UNUSED_ARG (descr_value); + } + } + + ::Components::Cookie * + Receiver_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 + Receiver_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 + Receiver_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 * + Receiver_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 + Receiver_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 + Receiver_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. + + // Component attribute operations. + + // Private method to populate the port tables. + void + Receiver_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 + { + ReceiverHome_Servant::ReceiverHome_Servant ( + ::Hello::CCM_ReceiverHome_ptr exe, + ::CIAO::Swapping_Container *c) + : ACE_NESTED_CLASS (CIAO, Swapping_Servant_Home_Impl_Base (c)), + home_svnt_base (exe, c, "Receiver_Impl_Hello_Receiver", + "Receiver_Impl_Hello_Receiver") + { + } + + ReceiverHome_Servant::~ReceiverHome_Servant (void) + { + } + + // Home operations. + + // Home supported interface operations. + + // Home factory and finder operations. + + // Home attribute operations. + } + + extern "C" RECEIVER_SVNT_Export ::PortableServer::Servant + createReceiverHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Swapping_Container *c + ACE_ENV_ARG_DECL) + { + if (p == 0) + { + return 0; + } + + ::Hello::CCM_ReceiverHome_var x = + ::Hello::CCM_ReceiverHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + CIAO_GLUE_Hello::ReceiverHome_Servant ( + x.in (), + c); + } +} + |