Beispiel #1
0
TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_NotifyLogNotification::TAO_NotifyLogNotification (
  CosNotifyChannelAdmin::EventChannel_ptr ec)
  : TAO_LogNotification (),
    event_channel_ (CosNotifyChannelAdmin::EventChannel::_duplicate (ec))
{

  CosNotifyComm::PushSupplier_var objref =
    this->_this ();
  ACE_ASSERT (!CORBA::is_nil (objref.in ()));

  CosNotifyChannelAdmin::AdminID adminID;
  CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
    this->event_channel_->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, adminID);

  ACE_ASSERT (!CORBA::is_nil (supplier_admin.in ()));

  CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer =
    supplier_admin->obtain_notification_push_consumer (CosNotifyChannelAdmin::ANY_EVENT, proxy_consumer_id_);

  ACE_ASSERT (!CORBA::is_nil (proxyconsumer.in ()));

  // narrow
  this->proxy_consumer_ =
    CosNotifyChannelAdmin::ProxyPushConsumer::_narrow (proxyconsumer.in ());

  ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));

  proxy_consumer_->connect_any_push_supplier (objref.in ());
}
Beispiel #2
0
void
TAO_Notify_ProxyPushConsumer::load_attrs (const TAO_Notify::NVPList& attrs)
{
  SuperClass::load_attrs(attrs);
  ACE_CString ior;
  if (attrs.load("PeerIOR", ior))
    {
      CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
      try
        {
          CosNotifyComm::PushSupplier_var ps = CosNotifyComm::PushSupplier::_nil();
          if ( ior.length() > 0 )
            {
              CORBA::Object_var obj =
                orb->string_to_object(ior.c_str());
              ps = CosNotifyComm::PushSupplier::_unchecked_narrow(obj.in());
            }
          // minor hack: suppress generating subscription updates during reload.
          bool save_updates = this->updates_off_;
          this->updates_off_ = true;
          this->connect_any_push_supplier(ps.in());
          this->updates_off_ = save_updates;
        }
      catch (...)
        {
          ACE_ASSERT(0);
        }
    }
}