diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/CosEvent')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.cpp | 49 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.h | 64 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.cpp | 92 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.h | 86 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.cpp | 171 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.h | 79 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.cpp | 148 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.h | 68 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.cpp | 48 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.h | 66 |
10 files changed, 0 insertions, 871 deletions
diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.cpp deleted file mode 100644 index b7cadbdf951..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// $Id$ - -#include "ConsumerAdmin_i.h" - -TAO_CosEC_ConsumerAdmin_i::TAO_CosEC_ConsumerAdmin_i (void) - : qos_ (), - rtec_consumeradmin_ (RtecEventChannelAdmin::ConsumerAdmin::_nil ()) -{ - // No-Op. -} - -TAO_CosEC_ConsumerAdmin_i::~TAO_CosEC_ConsumerAdmin_i (void) -{ - // No-Op. -} - -int -TAO_CosEC_ConsumerAdmin_i::init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos, - RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin) -{ - this->qos_ = consumerqos; - this->rtec_consumeradmin_ = - RtecEventChannelAdmin::ConsumerAdmin::_duplicate (rtec_consumeradmin); - return 0; -} - -CosEventChannelAdmin::ProxyPushSupplier_ptr -TAO_CosEC_ConsumerAdmin_i::obtain_push_supplier (CORBA::Environment &TAO_IN_ENV) -{ - RtecEventChannelAdmin::ProxyPushSupplier_var rtecproxypushsupplier = - this->rtec_consumeradmin_->obtain_push_supplier (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0); - - TAO_CosEC_ProxyPushSupplier_i *pps; - - ACE_NEW_RETURN (pps, - TAO_CosEC_ProxyPushSupplier_i (this->qos_, - rtecproxypushsupplier.in ()), - CosEventChannelAdmin::ProxyPushSupplier::_nil ()); - - return pps->_this (TAO_IN_ENV); -} - -CosEventChannelAdmin::ProxyPullSupplier_ptr -TAO_CosEC_ConsumerAdmin_i::obtain_pull_supplier (CORBA::Environment &TAO_IN_ENV) -{ - // TODO: implement this. - return CosEventChannelAdmin::ProxyPullSupplier::_nil (); -} diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.h b/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.h deleted file mode 100644 index 4122d74dbbf..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ConsumerAdmin_i.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO services -// -// = FILENAME -// ConsumerAdmin_i -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// = DESCRIPTION -// This has the implementation of the -// CosEventChannelAdmin::ConsumerAdmin interface. -// -// ============================================================================ - -#if !defined (CONSUMERADMIN_I_H) -#define CONSUMERADMIN_I_H - -#include "orbsvcs/RtecEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminS.h" -#include "orbsvcs/CosEvent/ProxyPushSupplier_i.h" - -class TAO_ORBSVCS_Export TAO_CosEC_ConsumerAdmin_i : public POA_CosEventChannelAdmin::ConsumerAdmin -{ - // = TITLE - // class TAO_CosEC_ConsumerAdmin_i implements the ConsumerAdmin interface. - // - // = DESCRIPTION - // This implementation of the ConsumerAdmin uses the - // RtecEventChannelAdmin::ConsumerAdmin. -public: - // = Initialization and termination methods. - TAO_CosEC_ConsumerAdmin_i (void); - // Constructor. - - ~TAO_CosEC_ConsumerAdmin_i (void); - // Destructor. - - int init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos, - RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin); - - virtual CosEventChannelAdmin::ProxyPushSupplier_ptr - obtain_push_supplier(CORBA::Environment &TAO_TRY_ENV); - // Returns a new ProxyPushSupplier_ptr. - - virtual CosEventChannelAdmin::ProxyPullSupplier_ptr - obtain_pull_supplier(CORBA::Environment &TAO_TRY_ENV); - // Returns a new ProxyPullSupplier_ptr. - -private: - RtecEventChannelAdmin::ConsumerQOS qos_; - // The ConsumerQOS specified by the user of this class. - - RtecEventChannelAdmin::ConsumerAdmin_var rtec_consumeradmin_; - // The RtecEventChannelAdmin::ConsumerAdmin specified by the user of - // this class. -}; - -#endif /* CONSUMERADMIN_I_H */ diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.cpp deleted file mode 100644 index 8f2835246f1..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// $Id$ -#include "EventChannel_i.h" - -TAO_CosEC_EventChannel_i::TAO_CosEC_EventChannel_i (void) - : consumer_admin_ (), - supplier_admin_ (), - consumeradmin_ (CosEventChannelAdmin::ConsumerAdmin::_nil ()), - supplieradmin_ (CosEventChannelAdmin::SupplierAdmin::_nil ()) -{ - // No-Op. -} - -TAO_CosEC_EventChannel_i::~TAO_CosEC_EventChannel_i (void) -{ - //No-Op. -} - -int -TAO_CosEC_EventChannel_i::init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos, - const RtecEventChannelAdmin::SupplierQOS &supplierqos, - RtecEventChannelAdmin::EventChannel_ptr rtec, - CORBA::Environment &TAO_IN_ENV) -{ - RtecEventChannelAdmin::ConsumerAdmin_ptr rtec_consumeradmin = - rtec->for_consumers (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, -1); - - if (this->consumer_admin_.init (consumerqos, - rtec_consumeradmin) == -1) - return -1; - - this->consumeradmin_ = consumer_admin_._this (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, -1); - - RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin = - rtec->for_suppliers (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, -1); - - if (this->supplier_admin_.init (supplierqos, - rtec_supplieradmin) == -1) - return -1; - - this->supplieradmin_ = supplier_admin_._this (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, -1); - - return 0; -} - -CosEventChannelAdmin::ConsumerAdmin_ptr -TAO_CosEC_EventChannel_i::for_consumers (CORBA::Environment &TAO_IN_ENV) -{ - // @@ Pradeep: you must make a copy here, because the caller is - // responsible of removing this object. - return - CosEventChannelAdmin::ConsumerAdmin::_duplicate (this->consumeradmin_.in()); -} - -CosEventChannelAdmin::SupplierAdmin_ptr -TAO_CosEC_EventChannel_i::for_suppliers (CORBA::Environment &TAO_IN_ENV) -{ - // @@ Pradeep: you must make a copy here, because the caller is - // responsible of removing this object, same here.. - return - CosEventChannelAdmin::SupplierAdmin::_duplicate (this->supplieradmin_.in ()); -} - -void -TAO_CosEC_EventChannel_i::destroy (CORBA::Environment &TAO_IN_ENV) -{ - // Deactivate the CosEventChannel - PortableServer::POA_var poa = - this->_default_POA (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - PortableServer::ObjectId_var id = poa->servant_to_id (this, - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - poa->deactivate_object (id.in (), - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - this->supplieradmin_ = CosEventChannelAdmin::SupplierAdmin::_nil (); - this->consumeradmin_ = CosEventChannelAdmin::ConsumerAdmin::_nil (); -} - -void -TAO_CosEC_EventChannel_i::shutdown (CORBA::Environment &TAO_IN_ENV) -{ - this->destroy (TAO_IN_ENV); - delete this; -} diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.h b/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.h deleted file mode 100644 index e44087e7c4a..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/EventChannel_i.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO services -// -// = FILENAME -// EventChannel_i -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// = DESCRIPTION -// This has the implementation of the -// CosEventChannelAdmin::EventChannel interface. -// -// ============================================================================ - -#if !defined (EVENTCHANNEL_I_H) -#define EVENTCHANNEL_I_H - -#include "orbsvcs/RtecEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminC.h" -#include "orbsvcs/CosEvent/ConsumerAdmin_i.h" -#include "orbsvcs/CosEvent/SupplierAdmin_i.h" - -class TAO_ORBSVCS_Export TAO_CosEC_EventChannel_i : public POA_CosEventChannelAdmin::EventChannel -{ - // = TITLE - // class TAO_CosEC_EventChannel_i implements the standard Cos EventChannel - // interface. - // - // = DESCRIPTION - // This Cos EventChannel implementation is based on TAO's - // Real-time Event Channel. This TAO_CosEC_EventChannel_i implementation - // delegates all its responsibility to corresponding objects from - // the real-time implementation. - // -public: - // = Initialization and termination methods. - TAO_CosEC_EventChannel_i (void); - // Constructor. - - ~TAO_CosEC_EventChannel_i (void); - // Destructor. - - int init (const RtecEventChannelAdmin::ConsumerQOS &consumerqos, - const RtecEventChannelAdmin::SupplierQOS &supplierqos, - RtecEventChannelAdmin::EventChannel_ptr rtec, - CORBA::Environment &TAO_IN_ENV); - // Activates the ConsumerAdmin and SupplierAdmin servants. Returns - // -1 on error, 0 on success. - - virtual CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers (CORBA::Environment &TAO_IN_ENV); - // The for_consumers method will return the same ConsumerAdmin_ptr - // everytime its called. - - virtual CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers (CORBA::Environment &TAO_IN_ENV); - // The for_suppliers method will return the same SupplierAdmin_ptr - // everytime its called. - - virtual void destroy (CORBA::Environment &TAO_IN_ENV); - // Destroys this Event Channel object. - - void shutdown (CORBA::Environment &TAO_IN_ENV); - // destroys this Event Channel object and <delete>s this object. - -private: - TAO_CosEC_ConsumerAdmin_i consumer_admin_; - // ConsumerAdmin servant object. - - TAO_CosEC_SupplierAdmin_i supplier_admin_; - // SupplierAdmin servant object. - - CosEventChannelAdmin::ConsumerAdmin_var consumeradmin_; - // The reference to the ConsumerAdmin interface returned after - // activating the servant in the ORB. - - CosEventChannelAdmin::SupplierAdmin_var supplieradmin_; - // The reference to the SupplierAdmin interface returned after - // activating the servant in the ORB. -}; - -#endif /* EVENTCHANNEL_I_H */ diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.cpp deleted file mode 100644 index 0844f0b672b..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "orbsvcs/Event_Utilities.h" -#include "orbsvcs/CosEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminS.h" -#include "orbsvcs/RtecEventCommS.h" -#include "orbsvcs/CosEventCommS.h" -#include "ProxyPushConsumer_i.h" - -class TAO_CosEC_PushSupplierWrapper : public POA_RtecEventComm::PushSupplier -{ - // = TITLE - // A Wrapper for the Rtec PushSupplier. - // - // = DESCRIPTION - // The Rtec ProxyPushConsumer uses a Rtec PushSupplier. This - // class wraps the Cos PushSupplier to make it look like a Rtec - // PushSupplier. -public: - // = Initialization and termination methods. - TAO_CosEC_PushSupplierWrapper (CosEventComm::PushSupplier_ptr supplier); - // Constructor. - - ~TAO_CosEC_PushSupplierWrapper (void); - // Destructor. - - virtual void disconnect_push_supplier (CORBA::Environment &TAO_TRY_ENV); - // Disconnects the push supplier. - -private: - // @@ Pradeep: are you sure you want to go through the CORBA - // interface? Maybe the implementation (ProxyPushConsumer_i) is good - // enough at this point? The tradeoff is flexibility (your scheme - // can use remote CosPushSuppliers), but suffers some performance - // penalty: do you need the extra flexibility? Can you use it? [I - // suspect the answers are "not" for both] - CosEventComm::PushSupplier_var supplier_; - // The Cos PushSupplier that we're proxying for. -}; - -TAO_CosEC_PushSupplierWrapper::TAO_CosEC_PushSupplierWrapper -(CosEventComm::PushSupplier_ptr supplier) - : supplier_ (CosEventComm::PushSupplier::_duplicate (supplier)) -{ - // No-Op. -} - -TAO_CosEC_PushSupplierWrapper::~TAO_CosEC_PushSupplierWrapper () -{ - // No-Op. -} - -void -TAO_CosEC_PushSupplierWrapper::disconnect_push_supplier (CORBA::Environment &TAO_TRY_ENV) -{ - this->supplier_->disconnect_push_supplier (TAO_TRY_ENV); - - // Deactivate the supplier proxy - PortableServer::POA_var poa = - this->_default_POA (TAO_TRY_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - PortableServer::ObjectId_var id = - poa->servant_to_id (this, - TAO_TRY_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - poa->deactivate_object (id.in (), - TAO_TRY_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - // @@ If we keep a list remember to remove this object from the - // list. - delete this; -} - -TAO_CosEC_ProxyPushConsumer_i::TAO_CosEC_ProxyPushConsumer_i (const RtecEventChannelAdmin::SupplierQOS &qos, - RtecEventChannelAdmin::ProxyPushConsumer_ptr ppc) - : qos_ (qos), - ppc_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (ppc)), - wrapper_ (0) -{ - // No-Op. -} - -TAO_CosEC_ProxyPushConsumer_i::~TAO_CosEC_ProxyPushConsumer_i (void) -{ - // No-Op. -} - -void -TAO_CosEC_ProxyPushConsumer_i::push (const CORBA::Any &data, - CORBA::Environment &TAO_TRY_ENV) -{ - RtecEventComm::Event buffer[1]; - // Create an event set that does not own the buffer.... - RtecEventComm::EventSet events (1, 1, buffer, 0); - events.length (1); - - RtecEventComm::Event &e = events[0]; - RtecEventComm::Event eqos = - qos_.publications[0].event; - - // @@ what if i initialize the entire <EventSet> with corresponding - // publications entries. - - // NOTE: we initialize the <EventHeader> field using the 1st - // <publications> from the <SupplierQOS>.so we assume that - // publications[0] is initialized. - e.header.source = eqos.header.source; - e.header.ttl = eqos.header.ttl; - e.header.type = eqos.header.type; - - ACE_hrtime_t t = ACE_OS::gethrtime (); - - ORBSVCS_Time::hrtime_to_TimeT (e.header.creation_time, - t); - e.header.ec_recv_time = ORBSVCS_Time::zero; - e.header.ec_send_time = ORBSVCS_Time::zero; - - e.data.any_value = data; - - this->ppc_->push (events, - TAO_TRY_ENV); -} - -void -TAO_CosEC_ProxyPushConsumer_i::disconnect_push_consumer (CORBA::Environment &TAO_TRY_ENV) -{ - this->ppc_->disconnect_push_consumer (TAO_TRY_ENV); - - // Deactivate the ProxyPushConsumer - PortableServer::POA_var poa = - this->_default_POA (TAO_TRY_ENV); - - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - PortableServer::ObjectId_var id = - poa->servant_to_id (this, - TAO_TRY_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - poa->deactivate_object (id.in (), - TAO_TRY_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_TRY_ENV); - - delete this; -} - -void -TAO_CosEC_ProxyPushConsumer_i::connect_push_supplier (CosEventComm::PushSupplier_ptr push_supplier, - CORBA::Environment &TAO_IN_ENV) -{ - if (this->connected ()) - TAO_THROW (CosEventChannelAdmin::AlreadyConnected ()); - - ACE_NEW_THROW (this->wrapper_, - TAO_CosEC_PushSupplierWrapper (push_supplier), - CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); - - this->ppc_->connect_push_supplier (this->wrapper_->_this (TAO_IN_ENV), - this->qos_, - TAO_IN_ENV); -} - -int -TAO_CosEC_ProxyPushConsumer_i::connected (void) -{ - return this->wrapper_ == 0 ? 0 : 1; -} diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.h b/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.h deleted file mode 100644 index 96b16b6f384..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushConsumer_i.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ================================================================ -// -// = LIBRARY -// TAO services -// -// = FILENAME -// ProxyPushConsumer_i -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// = DESCRIPTION -// This has the implementation of the -// CosEventChannelAdmin::ProxyPushConsumer interface. -// -// ================================================================ - -#if !defined (_PROXYPUSHCONSUMER_I_H) -#define _PROXYPUSHCONSUMER_I_H - -#include "orbsvcs/RtecEventChannelAdminS.h" -#include "orbsvcs/CosEventChannelAdminS.h" - -class TAO_CosEC_PushSupplierWrapper; - -class TAO_ORBSVCS_Export TAO_CosEC_ProxyPushConsumer_i : public POA_CosEventChannelAdmin::ProxyPushConsumer -{ - // = TITLE - // class TAO_CosEC_ProxyPushConsumer_i implements the ProxyPushConsumer - // interface. - // - // = DESCRIPTION - // This implementation of the ProxyPushConsumer uses the - // RtecEventChannelAdmin::ProxyPushConsumer. - // - // NOTE: RtecEventChannelAdmin::ProxyPushConsumer::push method is - // passed a RtecEventComm::EventSet.The <EventHeader> field in that is - // initialized using the the 1st <publications> from the <SupplierQOS>. - // so we assume that publications[0] is initialized. - // -public: - // = Initialization and termination methods. - TAO_CosEC_ProxyPushConsumer_i (const RtecEventChannelAdmin::SupplierQOS &qos, - RtecEventChannelAdmin::ProxyPushConsumer_ptr ppc); - // Constructor. - - ~TAO_CosEC_ProxyPushConsumer_i (void); - // Destructor. - - virtual void push (const CORBA::Any &data, - CORBA::Environment &TAO_IN_ENV); - // Suppliers call this method to pass data to connected consumers. - - virtual void disconnect_push_consumer (CORBA::Environment &TAO_IN_ENV); - // Disconnects the supplier from the event communication. - - virtual void connect_push_supplier(CosEventComm::PushSupplier_ptr push_supplier, - CORBA::Environment &TAO_IN_ENV); - // Connects a push supplier. - -private: - int connected (void); - // Returns 0 if a push_supplier is already connected to this - // ProxyPushConsumer, otherwise it returns a 1. - - const RtecEventChannelAdmin::SupplierQOS &qos_; - // The SupplierQOS specified by the user of this class. - - RtecEventChannelAdmin::ProxyPushConsumer_var ppc_; - // The Rtec ProxyPushConsumer specified by the user of this class. - - TAO_CosEC_PushSupplierWrapper *wrapper_; - // The Rtec PushSupplier wrapper used by the Rtec ProxyPushConsumer. -}; - -#endif /* _PROXYPUSHCONSUMER_I_H */ diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.cpp deleted file mode 100644 index ec71465985c..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// $Id$ -// -#include "orbsvcs/RtecEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminS.h" -#include "orbsvcs/CosEventCommS.h" -#include "orbsvcs/RtecEventCommS.h" -#include "ProxyPushSupplier_i.h" - -class TAO_CosEC_PushConsumerWrapper : public POA_RtecEventComm::PushConsumer -{ - // = TITLE - // Wrapper class for the Rtec PushConsumer. - // - // = DESCRIPTION - // The Rtec ProxyPushSupplier uses a Rtec PushConsumer. This - // class wraps the Cos PushConsumer to make it look like a Rtec - // PushConsumer. -public: - // = Initialization and termination methods. - TAO_CosEC_PushConsumerWrapper (CosEventComm::PushConsumer_ptr consumer); - // Constructor. - - ~TAO_CosEC_PushConsumerWrapper (void); - // Destructor. - - virtual void push (const RtecEventComm::EventSet & data, - CORBA::Environment &TAO_IN_ENV); - // This method is called by the RTEvent Channel to supply data. - - virtual void disconnect_push_consumer (CORBA::Environment &TAO_IN_ENV); - // Disconnects the consumer from the event channel. - -private: - CosEventComm::PushConsumer_var consumer_; - // The Cos PushConsumer that we're proxying for. -}; - -TAO_CosEC_PushConsumerWrapper::TAO_CosEC_PushConsumerWrapper -(CosEventComm::PushConsumer_ptr consumer) - : consumer_ (CosEventComm::PushConsumer::_duplicate (consumer)) -{ - // No-Op. -} - -TAO_CosEC_PushConsumerWrapper::~TAO_CosEC_PushConsumerWrapper () -{ - // No-Op. -} - -void -TAO_CosEC_PushConsumerWrapper::push (const RtecEventComm::EventSet& set, - CORBA::Environment &TAO_IN_ENV) -{ - for (CORBA::ULong i = 0; - i < set.length (); - ++i) - this->consumer_->push (set[i].data.any_value, - TAO_IN_ENV); -} - -void -TAO_CosEC_PushConsumerWrapper::disconnect_push_consumer (CORBA::Environment &TAO_IN_ENV) -{ - // Deactivate the supplier proxy. - this->consumer_->disconnect_push_consumer (TAO_IN_ENV); - - PortableServer::POA_var poa = - this->_default_POA (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - PortableServer::ObjectId_var id = - poa->servant_to_id (this, - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - poa->deactivate_object (id.in (), - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - // @@ If we keep a list remember to remove this object from the - // list. - delete this; -} - -TAO_CosEC_ProxyPushSupplier_i::TAO_CosEC_ProxyPushSupplier_i -(const RtecEventChannelAdmin::ConsumerQOS &qos, - RtecEventChannelAdmin::ProxyPushSupplier_ptr pps) - : qos_ (qos), - pps_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (pps)) -{ - // No-Op. -} - -TAO_CosEC_ProxyPushSupplier_i::~TAO_CosEC_ProxyPushSupplier_i (void) -{ - // No-Op. -} - -void -TAO_CosEC_ProxyPushSupplier_i::disconnect_push_supplier (CORBA::Environment &TAO_IN_ENV) -{ - this->pps_->disconnect_push_supplier (TAO_IN_ENV); - - // Deactivate the supplier proxy - PortableServer::POA_var poa = - this->_default_POA (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - PortableServer::ObjectId_var id = - poa->servant_to_id (this, - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - poa->deactivate_object (id.in (), - TAO_IN_ENV); - TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV); - - // @@ If we keep a list remember to remove this object from the - // list. - delete this; -} - -void TAO_CosEC_ProxyPushSupplier_i::connect_push_consumer (CosEventComm::PushConsumer_ptr push_consumer, - CORBA::Environment &TAO_IN_ENV) -{ - if (this->connected ()) - TAO_THROW_ENV (CosEventChannelAdmin::AlreadyConnected (), - TAO_IN_ENV); - - if (push_consumer == CosEventComm::PushConsumer::_nil()) - TAO_THROW_ENV (CORBA::BAD_PARAM (CORBA::COMPLETED_NO), - TAO_IN_ENV); - - ACE_NEW_THROW (this->wrapper_, - TAO_CosEC_PushConsumerWrapper (push_consumer), - CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); - - this->pps_->connect_push_consumer (this->wrapper_->_this (TAO_IN_ENV), - this->qos_, - TAO_IN_ENV); -} - -int -TAO_CosEC_ProxyPushSupplier_i::connected (void) -{ - return this->wrapper_ == 0 ? 0 : 1; -} diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.h b/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.h deleted file mode 100644 index ad3b105db81..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/ProxyPushSupplier_i.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ================================================================ -// -// = LIBRARY -// TAO services -// -// = FILENAME -// ProxyPushSupplier_i -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// = DESCRIPTION -// This has the implementation of the -// CosEventChannelAdmin::ProxyPushSupplier interface. -// -// ================================================================ - -#if !defined (_PROXYPUSHSUPPLIER_H) -#define _PROXYPUSHSUPPLIER_H - -#include "orbsvcs/RtecEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminC.h" - -class TAO_CosEC_PushConsumerWrapper; - -class TAO_ORBSVCS_Export TAO_CosEC_ProxyPushSupplier_i : public POA_CosEventChannelAdmin::ProxyPushSupplier -{ - // = TITLE - // class ProxyPushSupplier-i implements the ProxyPushConsumer interface. - // - // = DESCRIPTION - // This implementation of the ProxyPushSupplier uses the - // RtecEventChannelAdmin::ProxyPushSupplier. -public: - // = Initialization and termination methods. - TAO_CosEC_ProxyPushSupplier_i (const RtecEventChannelAdmin::ConsumerQOS &qos, - RtecEventChannelAdmin::ProxyPushSupplier_ptr pps); - // Constructor. - - ~TAO_CosEC_ProxyPushSupplier_i (void); - // Destructor. - - virtual void disconnect_push_supplier (CORBA::Environment &TAO_IN_ENV); - // Ends the event communication and disposes this object. - - virtual void connect_push_consumer(CosEventComm::PushConsumer_ptr push_consumer, - CORBA::Environment &TAO_IN_ENV); - // Connects the <push_consumer> to the Event Channel. - -private: - int connected (void); - // Returns 0 if a push_consumer is already connected to this - // ProxyPushSupplier, otherwise it returns a 1. - - const RtecEventChannelAdmin::ConsumerQOS &qos_; - // The ConsumerQOS specified by the user of this class. - - RtecEventChannelAdmin::ProxyPushSupplier_var pps_; - // The Rtec ProxyPushSupplier specified by the user of this class. - - TAO_CosEC_PushConsumerWrapper *wrapper_; - // The Rtec PushConsumer wrapper used by the Rtec ProxyPushSupplier. -}; - -#endif /* _PROXYPUSHSUPPLIER_H */ diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.cpp b/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.cpp deleted file mode 100644 index 1a9e6523ceb..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -#include "SupplierAdmin_i.h" - -TAO_CosEC_SupplierAdmin_i::TAO_CosEC_SupplierAdmin_i (void) - : qos_ (), - rtec_supplieradmin_ (RtecEventChannelAdmin::SupplierAdmin::_nil ()) -{ - // No-Op. -} - -TAO_CosEC_SupplierAdmin_i::~TAO_CosEC_SupplierAdmin_i (void) -{ - // No-Op. -} - -int -TAO_CosEC_SupplierAdmin_i::init (const RtecEventChannelAdmin::SupplierQOS &supplierqos, - RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin) -{ - this->qos_ = supplierqos; - this->rtec_supplieradmin_ = - RtecEventChannelAdmin::SupplierAdmin::_duplicate (rtec_supplieradmin); - return 0; -} - -CosEventChannelAdmin::ProxyPushConsumer_ptr -TAO_CosEC_SupplierAdmin_i::obtain_push_consumer (CORBA::Environment &TAO_IN_ENV) -{ - RtecEventChannelAdmin::ProxyPushConsumer_var rtecproxypushconsumer = - this->rtec_supplieradmin_->obtain_push_consumer (TAO_IN_ENV); - TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0); - - TAO_CosEC_ProxyPushConsumer_i *ppc; - - ACE_NEW_RETURN (ppc, - TAO_CosEC_ProxyPushConsumer_i (this->qos_, - rtecproxypushconsumer.in ()), - CosEventChannelAdmin::ProxyPushConsumer::_nil ()); - return ppc->_this (TAO_IN_ENV); -} - -CosEventChannelAdmin::ProxyPullConsumer_ptr -TAO_CosEC_SupplierAdmin_i::obtain_pull_consumer (CORBA::Environment &TAO_IN_ENV) -{ - // TODO: implement this. - return CosEventChannelAdmin::ProxyPullConsumer::_nil (); -} diff --git a/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.h b/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.h deleted file mode 100644 index c18dbf08717..00000000000 --- a/TAO/orbsvcs/orbsvcs/CosEvent/SupplierAdmin_i.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO services -// -// = FILENAME -// SupplierAdmin_i.h -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// = DESCRIPTION -// This has the implementation of the -// CosEventChannelAdmin::SupplierAdmin interface. -// -// ============================================================================ - -#if !defined (SUPPLIER_ADMIN_I_H) -#define SUPPLIER_ADMIN_I_H - -#include "orbsvcs/RtecEventChannelAdminC.h" -#include "orbsvcs/CosEventChannelAdminC.h" -#include "orbsvcs/CosEvent/ProxyPushConsumer_i.h" - -class TAO_ORBSVCS_Export TAO_CosEC_SupplierAdmin_i : public POA_CosEventChannelAdmin::SupplierAdmin -{ - // = TITLE - // class TAO_CosEC_SupplierAdmin_i implements the SupplierAdmin interface. - // - // = DESCRIPTION - // This COS-compliant implementation of the SupplierAdmin uses - // TAO's RtecEventChannelAdmin::SupplierAdmin. -public: - // = Initialization and termination methods. - TAO_CosEC_SupplierAdmin_i (void); - // Constructor. - - ~TAO_CosEC_SupplierAdmin_i (void); - // Destructor. - - int init (const RtecEventChannelAdmin::SupplierQOS &supplierqos, - RtecEventChannelAdmin::SupplierAdmin_ptr rtec_supplieradmin); - // Initializes the SupplierAdmin. Returns 0 on success, -1 on - // error. - - virtual CosEventChannelAdmin::ProxyPushConsumer_ptr - obtain_push_consumer (CORBA::Environment &TAO_IN_ENV); - // Returns a new ProxyPushConsumer_ptr. - - virtual CosEventChannelAdmin::ProxyPullConsumer_ptr - obtain_pull_consumer(CORBA::Environment &TAO_IN_ENV); - // Returns a new ProxyPullConsumer_ptr. - -private: - RtecEventChannelAdmin::SupplierQOS qos_; - // The SupplierQOS specified by the user of this class. - - RtecEventChannelAdmin::SupplierAdmin_var rtec_supplieradmin_; - // The RtecEventChannelAdmin::SupplierAdmin specified by the user of - // this class. -}; - -#endif /* SUPPLIER_ADMIN_I_H */ |