summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp88
1 files changed, 16 insertions, 72 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
index 39ef736df01..f482f0316ae 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
@@ -2,7 +2,6 @@
#include "EC_SupplierAdmin.h"
#include "EC_ProxyConsumer.h"
-#include "EC_ProxySupplier.h"
#include "EC_Event_Channel.h"
#if ! defined (__ACE_INLINE__)
@@ -14,22 +13,17 @@ ACE_RCSID(Event, EC_SupplierAdmin, "$Id$")
TAO_EC_SupplierAdmin::TAO_EC_SupplierAdmin (TAO_EC_Event_Channel *ec)
: event_channel_ (ec)
{
- this->default_POA_ =
- this->event_channel_->supplier_poa ();
-
- // @@ We must consider using the techniques in the ConsumerAdmin
- // also, i.e. not using locks but delaying operations that modify
- // the set. I don't see much use for them right now, since there
- // is no potential for dead-lock when dispatching events and/or
- // adding multiple suppliers and consumers, but we could avoid
- // some priority inversions.
- this->lock_ =
- this->event_channel_->create_supplier_admin_lock ();
}
TAO_EC_SupplierAdmin::~TAO_EC_SupplierAdmin (void)
{
- this->event_channel_->destroy_supplier_admin_lock (this->lock_);
+}
+
+void
+TAO_EC_SupplierAdmin::set_default_POA (PortableServer::POA_ptr poa)
+{
+ this->default_POA_ =
+ PortableServer::POA::_duplicate (poa);
}
PortableServer::POA_ptr
@@ -40,106 +34,56 @@ TAO_EC_SupplierAdmin::_default_POA (CORBA::Environment&)
void
TAO_EC_SupplierAdmin::connected (TAO_EC_ProxyPushSupplier *supplier,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
{
- ACE_GUARD_THROW_EX (
- ACE_Lock, ace_mon, *this->lock_,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
- ACE_CHECK;
-
ConsumerSetIterator end = this->end ();
for (ConsumerSetIterator i = this->begin ();
i != end;
++i)
{
(*i)->connected (supplier, ACE_TRY_ENV);
- ACE_CHECK;
- supplier->connected (*i, ACE_TRY_ENV);
- ACE_CHECK;
}
}
void
TAO_EC_SupplierAdmin::disconnected (TAO_EC_ProxyPushSupplier *supplier,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
{
- ACE_GUARD_THROW_EX (
- ACE_Lock, ace_mon, *this->lock_,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
- ACE_CHECK;
-
ConsumerSetIterator end = this->end ();
for (ConsumerSetIterator i = this->begin ();
i != end;
++i)
{
(*i)->disconnected (supplier, ACE_TRY_ENV);
- ACE_CHECK;
- supplier->disconnected (*i, ACE_TRY_ENV);
- ACE_CHECK;
}
}
void
TAO_EC_SupplierAdmin::connected (TAO_EC_ProxyPushConsumer *consumer,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
{
- ACE_GUARD_THROW_EX (
- ACE_Lock, ace_mon, *this->lock_,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
- ACE_CHECK;
-
if (this->all_consumers_.insert (consumer) != 0)
- ACE_THROW (CORBA::NO_MEMORY ());
+ ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO));
}
void
TAO_EC_SupplierAdmin::disconnected (TAO_EC_ProxyPushConsumer *consumer,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
{
- ACE_GUARD_THROW_EX (
- ACE_Lock, ace_mon, *this->lock_,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
- ACE_CHECK;
-
if (this->all_consumers_.remove (consumer) != 0)
ACE_THROW (RtecEventChannelAdmin::EventChannel::SUBSCRIPTION_ERROR ());
}
-void
-TAO_EC_SupplierAdmin::shutdown (CORBA::Environment &ACE_TRY_ENV)
-{
- ACE_GUARD_THROW_EX (
- ACE_Lock, ace_mon, *this->lock_,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
- ACE_CHECK;
-
- ConsumerSetIterator end = this->end ();
- for (ConsumerSetIterator i = this->begin ();
- i != end;
- ++i)
- {
- ACE_TRY
- {
- (*i)->shutdown (ACE_TRY_ENV);
- ACE_TRY_CHECK;
- (*i)->_decr_refcnt ();
- }
- ACE_CATCHANY
- {
- /* ignore all exceptions */
- }
- ACE_ENDTRY;
- }
- this->all_consumers_.reset ();
-}
-
RtecEventChannelAdmin::ProxyPushConsumer_ptr
TAO_EC_SupplierAdmin::obtain_push_consumer (CORBA::Environment &ACE_TRY_ENV)
{
TAO_EC_ProxyPushConsumer* consumer =
this->event_channel_->create_proxy_push_consumer ();
+ PortableServer::POA_var poa =
+ this->event_channel_->consumer_poa (ACE_TRY_ENV);
+ consumer->set_default_POA (poa.in ());
+
return consumer->_this (ACE_TRY_ENV);
}