diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-18 17:30:55 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-18 17:30:55 +0000 |
commit | 6ba1a3c0fadfe24738e9db057b4318a49230cfe8 (patch) | |
tree | de01fca2b38a8847eab9813c1ae29344e05f9842 | |
parent | 055972dcd3f650114edbca71a65cff8fed185a38 (diff) | |
download | ATCD-6ba1a3c0fadfe24738e9db057b4318a49230cfe8.tar.gz |
*** empty log message ***
4 files changed, 1205 insertions, 0 deletions
diff --git a/TAO/CIAO/DAnCE/examples/EC_Benchmark/Consumer/Consumer_svnt.cpp b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Consumer/Consumer_svnt.cpp new file mode 100644 index 00000000000..fe10858c9f8 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Consumer/Consumer_svnt.cpp @@ -0,0 +1,472 @@ +// $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 "Consumer_svnt.h" +#include "Cookies.h" +#include "ciao/Servant_Activator.h" +#include "ciao/Port_Activator_T.h" + +namespace Consumer_Impl +{ + namespace CIAO_GLUE_EC_Benchmark + { + Consumer_Context::Consumer_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + Consumer_Servant *sv) + : Context_Impl_Base (home, c), + ctx_svnt_base (home, c, sv) + { + } + + Consumer_Context::~Consumer_Context (void) + { + } + + // Operations for Consumer receptacles and event sources, + // defined in ::EC_Benchmark::CCM_Consumer_Context. + + // CIAO-specific. + + Consumer_Context * + Consumer_Context::_narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_NOT_USED) + { + return dynamic_cast<Consumer_Context *> (p); + } + } + + namespace CIAO_GLUE_EC_Benchmark + { + Consumer_Servant::Consumer_Servant ( + ::EC_Benchmark::CCM_Consumer_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : Servant_Impl_Base (c), + comp_svnt_base (exe, c) + { + this->context_ = new Consumer_Context (h, c, this); + + CIAO_REGISTER_OBV_FACTORY ( + ::EC_Benchmark::TimeOut_init, + ::EC_Benchmark::TimeOut); + + 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; + } + + Consumer_Servant::~Consumer_Servant (void) + { + } + + void + Consumer_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); + } + } + + Consumer_Servant::TimeOutConsumer_timeout_Servant::TimeOutConsumer_timeout_Servant ( + ::EC_Benchmark::CCM_Consumer_ptr executor, + ::EC_Benchmark::CCM_Consumer_Context_ptr c) + : executor_ (::EC_Benchmark::CCM_Consumer::_duplicate (executor)), + ctx_ (::EC_Benchmark::CCM_Consumer_Context::_duplicate (c)) + { + } + + Consumer_Servant::TimeOutConsumer_timeout_Servant::~TimeOutConsumer_timeout_Servant (void) + { + } + + CORBA::Object_ptr + Consumer_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 + Consumer_Servant::TimeOutConsumer_timeout_Servant::push_TimeOut ( + ::EC_Benchmark::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 + Consumer_Servant::TimeOutConsumer_timeout_Servant::push_event ( + ::Components::EventBase *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::BadEventType)) + { + ::EC_Benchmark::TimeOut_var ev_type = + ::EC_Benchmark::TimeOut::_downcast (ev); + + if (ev_type != 0) + { + this->push_TimeOut ( + ev_type.in () + ACE_ENV_ARG_PARAMETER); + + return; + } + + ACE_THROW (::Components::BadEventType ()); + } + + ::EC_Benchmark::TimeOutConsumer_ptr + Consumer_Servant::get_consumer_timeout ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (! ::CORBA::is_nil (this->consumes_timeout_.in ())) + { + return ::EC_Benchmark::TimeOutConsumer::_duplicate (this->consumes_timeout_.in ()); + } + + ::Components::EventConsumerBase_var obj = + this->get_consumer_timeout_i ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (::EC_Benchmark::TimeOutConsumer::_nil ()); + + ::EC_Benchmark::TimeOutConsumer_var eco = + ::EC_Benchmark::TimeOutConsumer::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::EC_Benchmark::TimeOutConsumer::_nil ()); + + this->consumes_timeout_ = eco; + return ::EC_Benchmark::TimeOutConsumer::_duplicate (this->consumes_timeout_.in ()); + } + + ::Components::EventConsumerBase_ptr + Consumer_Servant::get_consumer_timeout_i ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::Components::EventConsumerBase_ptr ret = + this->lookup_consumer ("timeout"); + + if (! ::CORBA::is_nil (ret)) + { + return ret; + } + + CIAO::Port_Activator_T< + Consumer_Servant::TimeOutConsumer_timeout_Servant, + ::EC_Benchmark::CCM_Consumer, + ::EC_Benchmark::CCM_Consumer_Context, + Consumer_Servant > *tmp = 0; + + typedef CIAO::Port_Activator_T< + Consumer_Servant::TimeOutConsumer_timeout_Servant, + ::EC_Benchmark::CCM_Consumer, + ::EC_Benchmark::CCM_Consumer_Context, + Consumer_Servant > + MACRO_MADNESS_TYPEDEF; + + + ACE_NEW_THROW_EX ( + tmp, + MACRO_MADNESS_TYPEDEF ( + "EC_Benchmark_Consumer_timeout", + "timeout", + CIAO::Port_Activator::Sink, + this->executor_.in (), + 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 ( + "EC_Benchmark_Consumer_timeout", + "IDL:EC_Benchmark/TimeOutConsumer:1.0", + CIAO::Container::Facet_Consumer + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::EC_Benchmark::TimeOutConsumer::_nil ()); + + ::Components::EventConsumerBase_var ecb = + ::Components::EventConsumerBase::_narrow ( + obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (::EC_Benchmark::TimeOutConsumer::_nil ()); + + this->add_consumer ( + "timeout", + ecb.in ()); + + return ecb._retn (); + } + + ::Components::Cookie * + Consumer_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 + Consumer_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 + Consumer_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 * + Consumer_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 + Consumer_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 + Consumer_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 + Consumer_Servant::populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var obj_var; + ::Components::EventConsumerBase_var ecb_var; + + ecb_var = + this->get_consumer_timeout_i ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + } + + namespace CIAO_GLUE_EC_Benchmark + { + ConsumerHome_Servant::ConsumerHome_Servant ( + ::EC_Benchmark::CCM_ConsumerHome_ptr exe, + ::CIAO::Session_Container *c) + : CIAO::Home_Servant_Impl_Base (c), + home_svnt_base (exe, c) + { + } + + ConsumerHome_Servant::~ConsumerHome_Servant (void) + { + } + + // Home operations. + + // Home supported interface operations. + + // Home factory and finder operations. + + // Home attribute operations. + } + + extern "C" CONSUMER_SVNT_Export ::PortableServer::Servant + createConsumerHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL) + { + if (p == 0) + { + return 0; + } + + ::EC_Benchmark::CCM_ConsumerHome_var x = + ::EC_Benchmark::CCM_ConsumerHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + CIAO_GLUE_EC_Benchmark::ConsumerHome_Servant ( + x.in (), + c); + } +} + diff --git a/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.cpp b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.cpp new file mode 100644 index 00000000000..2040df1735b --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.cpp @@ -0,0 +1,433 @@ +// $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 "Producer_svnt.h" +#include "Cookies.h" +#include "ciao/Servant_Activator.h" +#include "ciao/Port_Activator_T.h" + +namespace Producer_Impl +{ + namespace CIAO_GLUE_EC_Benchmark + { + Producer_Context::Producer_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + Producer_Servant *sv) + : Context_Impl_Base (home, c), + ctx_svnt_base (home, c, sv) + { + } + + Producer_Context::~Producer_Context (void) + { + } + + // Operations for Producer receptacles and event sources, + // defined in ::EC_Benchmark::CCM_Producer_Context. + + void + Producer_Context::push_timeout ( + ::EC_Benchmark::TimeOut *ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + + ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + my_uuid += "_timeout_publisher"; + + ////ACE_DEBUG ((LM_DEBUG, "======== connection_uuid is: %s =============\n", my_uuid.c_str ())); + this->container_->push_event (ev, + my_uuid.c_str () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + /* + this->ciao_emits_timeout_consumer_->push_TimeOut ( + ev + ACE_ENV_ARG_PARAMETER); + */ + } + + void + Producer_Context::connect_timeout ( + ::EC_Benchmark::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected)) + { + if (CORBA::is_nil (c)) + { + ACE_THROW (CORBA::BAD_PARAM ()); + } + + + if (! CORBA::is_nil (this->ciao_emits_timeout_consumer_.in ())) + { + ACE_THROW (::Components::AlreadyConnected ()); + } + + + this->ciao_emits_timeout_consumer_ = + ::EC_Benchmark::TimeOutConsumer::_duplicate (c); + } + + ::EC_Benchmark::TimeOutConsumer_ptr + Producer_Context::disconnect_timeout ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + if (CORBA::is_nil (this->ciao_emits_timeout_consumer_.in ())) + { + ACE_THROW_RETURN ( + ::Components::NoConnection (), + ::EC_Benchmark::TimeOutConsumer::_nil ()); + } + + + return this->ciao_emits_timeout_consumer_._retn (); + } + + // CIAO-specific. + + Producer_Context * + Producer_Context::_narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_NOT_USED) + { + return dynamic_cast<Producer_Context *> (p); + } + } + + namespace CIAO_GLUE_EC_Benchmark + { + Producer_Servant::Producer_Servant ( + ::EC_Benchmark::CCM_Producer_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : Servant_Impl_Base (c), + comp_svnt_base (exe, c) + { + this->context_ = new Producer_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; + } + + Producer_Servant::~Producer_Servant (void) + { + } + + void + Producer_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 * + Producer_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 + Producer_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 + Producer_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 ()); + } + + if (ACE_OS::strcmp (emitter_name, "timeout") == 0) + { + ::EC_Benchmark::TimeOutConsumer_var _ciao_consumer = + ::EC_Benchmark::TimeOutConsumer::_narrow ( + consumer + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (::CORBA::is_nil (_ciao_consumer.in ())) + { + ACE_THROW (::Components::InvalidConnection ()); + } + + this->connect_timeout ( + _ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + + return; + } + + ACE_UNUSED_ARG (consumer); + ACE_THROW (::Components::InvalidName ()); + } + + ::Components::Cookie * + Producer_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 + Producer_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 ()); + } + + void + Producer_Servant::connect_timeout ( + ::EC_Benchmark::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected)) + { + this->context_->connect_timeout ( + c + ACE_ENV_ARG_PARAMETER); + } + + ::EC_Benchmark::TimeOutConsumer_ptr + Producer_Servant::disconnect_timeout ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)) + { + return this->context_->disconnect_timeout ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + CORBA::Object_ptr + Producer_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 + Producer_Servant::start ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + this->executor_->start ( + ACE_ENV_SINGLE_ARG_PARAMETER); + } + + // Component attribute operations. + + // Private method to populate the port tables. + void + Producer_Servant::populate_port_tables ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ::CORBA::Object_var obj_var; + ::Components::EventConsumerBase_var ecb_var; + } + } + + namespace CIAO_GLUE_EC_Benchmark + { + ProducerHome_Servant::ProducerHome_Servant ( + ::EC_Benchmark::CCM_ProducerHome_ptr exe, + ::CIAO::Session_Container *c) + : CIAO::Home_Servant_Impl_Base (c), + home_svnt_base (exe, c) + { + } + + ProducerHome_Servant::~ProducerHome_Servant (void) + { + } + + // Home operations. + + // Home supported interface operations. + + // Home factory and finder operations. + + // Home attribute operations. + } + + extern "C" PRODUCER_SVNT_Export ::PortableServer::Servant + createProducerHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL) + { + if (p == 0) + { + return 0; + } + + ::EC_Benchmark::CCM_ProducerHome_var x = + ::EC_Benchmark::CCM_ProducerHome::_narrow ( + p + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (::CORBA::is_nil (x.in ())) + { + return 0; + } + + return new + CIAO_GLUE_EC_Benchmark::ProducerHome_Servant ( + x.in (), + c); + } +} + diff --git a/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.h b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.h new file mode 100644 index 00000000000..2870bb5c8b9 --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/EC_Benchmark/Producer/Producer_svnt.h @@ -0,0 +1,298 @@ +// $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_PRODUCER_SVNT_H +#define CIAO_GLUE_SESSION_PRODUCER_SVNT_H + +#include /**/ "ace/pre.h" + +#include "ProducerEC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ciao/Container_Base.h" +#include "ciao/Servant_Impl_T.h" +#include "ciao/Context_Impl_T.h" +#include "ciao/Home_Servant_Impl_T.h" +#include "ace/Active_Map_Manager_T.h" + +#include "ProducerS.h" + +namespace Producer_Impl +{ + namespace CIAO_GLUE_EC_Benchmark + { + class Producer_Servant; + + class PRODUCER_SVNT_Export Producer_Context + : public virtual CIAO::Context_Impl< + ::EC_Benchmark::CCM_Producer_Context, + Producer_Servant, + ::EC_Benchmark::Producer, + ::EC_Benchmark::Producer_var + > + { + public: + // We will allow the servant glue code we generate to access our state. + friend class Producer_Servant; + + /// Hack for VC6. + typedef CIAO::Context_Impl< + ::EC_Benchmark::CCM_Producer_Context, + Producer_Servant, + ::EC_Benchmark::Producer, + ::EC_Benchmark::Producer_var + > ctx_svnt_base; + + Producer_Context ( + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + Producer_Servant *sv); + + virtual ~Producer_Context (void); + + // Operations for Producer receptacles and event sources, + // defined in ::EC_Benchmark::CCM_Producer_Context. + + virtual void + push_timeout ( + ::EC_Benchmark::TimeOut *ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO-specific. + + static Producer_Context * + _narrow ( + ::Components::SessionContext_ptr p + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + protected: + // Methods that manage this component's connections and consumers. + + virtual void + connect_timeout ( + ::EC_Benchmark::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected)); + + virtual ::EC_Benchmark::TimeOutConsumer_ptr + disconnect_timeout ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + protected: + ::EC_Benchmark::TimeOutConsumer_var + ciao_emits_timeout_consumer_; + }; + } + + namespace CIAO_GLUE_EC_Benchmark + { + class PRODUCER_SVNT_Export Producer_Servant + : public virtual CIAO::Servant_Impl< + POA_EC_Benchmark::Producer, + ::EC_Benchmark::CCM_Producer, + ::EC_Benchmark::CCM_Producer_var, + Producer_Context + > + { + public: + /// Hack for VC6. + typedef CIAO::Servant_Impl< + POA_EC_Benchmark::Producer, + ::EC_Benchmark::CCM_Producer, + ::EC_Benchmark::CCM_Producer_var, + Producer_Context + > comp_svnt_base; + + Producer_Servant ( + ::EC_Benchmark::CCM_Producer_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + virtual ~Producer_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 void + connect_timeout ( + ::EC_Benchmark::TimeOutConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::AlreadyConnected)); + + virtual ::EC_Benchmark::TimeOutConsumer_ptr + disconnect_timeout ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Components::NoConnection)); + + // Component attribute operations. + + // 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_EC_Benchmark + { + class PRODUCER_SVNT_Export ProducerHome_Servant + : public virtual CIAO::Home_Servant_Impl< + POA_EC_Benchmark::ProducerHome, + ::EC_Benchmark::CCM_ProducerHome, + ::EC_Benchmark::CCM_ProducerHome_var, + ::EC_Benchmark::Producer, + ::EC_Benchmark::Producer_var, + ::EC_Benchmark::CCM_Producer, + ::EC_Benchmark::CCM_Producer_var, + Producer_Servant + > + { + public: + /// Hack for VC6. + typedef CIAO::Home_Servant_Impl< + POA_EC_Benchmark::ProducerHome, + ::EC_Benchmark::CCM_ProducerHome, + ::EC_Benchmark::CCM_ProducerHome_var, + ::EC_Benchmark::Producer, + ::EC_Benchmark::Producer_var, + ::EC_Benchmark::CCM_Producer, + ::EC_Benchmark::CCM_Producer_var, + Producer_Servant + > home_svnt_base; + + ProducerHome_Servant ( + ::EC_Benchmark::CCM_ProducerHome_ptr exe, + ::CIAO::Session_Container *c); + + virtual ~ProducerHome_Servant (void); + + // Home operations. + + // Home factory and finder operations. + + // Attribute operations. + }; + + extern "C" PRODUCER_SVNT_Export ::PortableServer::Servant + createProducerHome_Servant ( + ::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + } +} + +#include /**/ "ace/post.h" + +#endif /* CIAO_GLUE_SESSION_PRODUCER_SVNT_H */ + diff --git a/TAO/CIAO/DAnCE/examples/EC_Benchmark/descriptors/deployment.dat b/TAO/CIAO/DAnCE/examples/EC_Benchmark/descriptors/deployment.dat new file mode 100644 index 00000000000..1f736ad6b9c --- /dev/null +++ b/TAO/CIAO/DAnCE/examples/EC_Benchmark/descriptors/deployment.dat @@ -0,0 +1,2 @@ +WindowsXP corbaloc:iiop:localhost:10000/NodeManager +RedHatLinux corbaloc:iiop:localhost:20000/NodeManager
\ No newline at end of file |