Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Friends

TAO_Notify_ProxyPushConsumer Class Reference

#include <ProxyPushConsumer.h>

Inheritance diagram for TAO_Notify_ProxyPushConsumer:
Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_ProxyPushConsumer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_Notify_ProxyPushConsumer (void)
 Constructor.
virtual ~TAO_Notify_ProxyPushConsumer ()
 Destructor.
virtual const char * get_proxy_type_name (void) const
virtual void load_attrs (const TAO_Notify::NVPList &attrs)
virtual void validate ()
virtual void configure (TAO_Notify_SupplierAdmin &admin, CosNotifyChannelAdmin::ProxyID_out proxy_id)

Protected Member Functions

virtual
CosNotifyChannelAdmin::ProxyType 
MyType (void)
 = CosNotifyChannelAdmin::ProxyPushConsumer methods
virtual void push (const CORBA::Any &data)
virtual void connect_any_push_supplier (CosEventComm::PushSupplier_ptr push_supplier)
virtual void disconnect_push_consumer (void)

Private Types

typedef
TAO_Notify_ProxyConsumer_T
< POA_CosNotifyChannelAdmin::ProxyPushConsumer > 
SuperClass

Private Member Functions

virtual void release (void)
 Release.

Friends

class TAO_Notify_Builder

Detailed Description

Definition at line 39 of file ProxyPushConsumer.h.


Member Typedef Documentation

typedef TAO_Notify_ProxyConsumer_T<POA_CosNotifyChannelAdmin::ProxyPushConsumer> TAO_Notify_ProxyPushConsumer::SuperClass [private]

Definition at line 44 of file ProxyPushConsumer.h.


Constructor & Destructor Documentation

TAO_Notify_ProxyPushConsumer::TAO_Notify_ProxyPushConsumer ( void   ) 

Constructor.

Definition at line 15 of file ProxyPushConsumer.cpp.

{
}

TAO_Notify_ProxyPushConsumer::~TAO_Notify_ProxyPushConsumer (  )  [virtual]

Destructor.

Definition at line 19 of file ProxyPushConsumer.cpp.

{
}


Member Function Documentation

void TAO_Notify_ProxyPushConsumer::configure ( TAO_Notify_SupplierAdmin admin,
CosNotifyChannelAdmin::ProxyID_out  proxy_id 
) [virtual]

Definition at line 129 of file ProxyPushConsumer.cpp.

{
  // presently nothing to do here.
  // this method was added to support NotificationMC
}

void TAO_Notify_ProxyPushConsumer::connect_any_push_supplier ( CosEventComm::PushSupplier_ptr  push_supplier  )  [protected, virtual]

Definition at line 54 of file ProxyPushConsumer.cpp.

{
  // Convert Supplier to Base Type
  TAO_Notify_PushSupplier *supplier;
  ACE_NEW_THROW_EX (supplier,
                    TAO_Notify_PushSupplier (this),
                    CORBA::NO_MEMORY ());

  supplier->init (push_supplier);

  this->connect (supplier);
  this->self_change ();
}

void TAO_Notify_ProxyPushConsumer::disconnect_push_consumer ( void   )  [protected, virtual]

Definition at line 68 of file ProxyPushConsumer.cpp.

{
  TAO_Notify_ProxyPushConsumer::Ptr guard( this );
  this->destroy ();
  this->self_change ();
}

const char * TAO_Notify_ProxyPushConsumer::get_proxy_type_name ( void   )  const [virtual]

Implements TAO_Notify_Proxy.

Definition at line 76 of file ProxyPushConsumer.cpp.

{
  return "proxy_push_consumer";
}

void TAO_Notify_ProxyPushConsumer::load_attrs ( const TAO_Notify::NVPList attrs  )  [virtual]

Definition at line 99 of file ProxyPushConsumer.cpp.

{
  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);
        }
    }
}

CosNotifyChannelAdmin::ProxyType TAO_Notify_ProxyPushConsumer::MyType ( void   )  [protected, virtual]

= CosNotifyChannelAdmin::ProxyPushConsumer methods

Definition at line 31 of file ProxyPushConsumer.cpp.

{
  return CosNotifyChannelAdmin::PUSH_ANY;
}

void TAO_Notify_ProxyPushConsumer::push ( const CORBA::Any data  )  [protected, virtual]

Definition at line 37 of file ProxyPushConsumer.cpp.

{
  // Check if we should proceed at all.
  if (this->admin_properties().reject_new_events () == 1
      && this->admin_properties().queue_full ())
    throw CORBA::IMP_LIMIT ();

  if (this->is_connected () == 0)
    {
      throw CosEventComm::Disconnected ();
    }

  TAO_Notify_AnyEvent_No_Copy event (any);
  this->push_i (&event);
}

void TAO_Notify_ProxyPushConsumer::release ( void   )  [private, virtual]

Release.

Definition at line 24 of file ProxyPushConsumer.cpp.

{
  delete this;
  //@@ inform factory
}

void TAO_Notify_ProxyPushConsumer::validate (  )  [virtual]

Implements TAO_Notify_Proxy.

Definition at line 82 of file ProxyPushConsumer.cpp.

{
  TAO_Notify_Supplier* sup = this->supplier ();
  if (sup != 0 && ! sup->is_alive (true))
  {
    if (TAO_debug_level > 0)
    {
      ACE_DEBUG ((LM_DEBUG, 
                  ACE_TEXT ("(%P|%t) TAO_Notify_ProxyPushConsumer::validate(%d)")
                  ACE_TEXT ("disconnecting \n"), this->id ()));
    }
    this->disconnect_push_consumer ();
  }
}


Friends And Related Function Documentation

friend class TAO_Notify_Builder [friend]

Definition at line 45 of file ProxyPushConsumer.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines