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

TAO_Notify_StructuredProxyPushConsumer Class Reference

CosNotifyChannelAdmin::StructuredProxyPushConsumer implementation. More...

#include <StructuredProxyPushConsumer.h>

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

List of all members.

Public Member Functions

 TAO_Notify_StructuredProxyPushConsumer (void)
 Constructor.
virtual ~TAO_Notify_StructuredProxyPushConsumer ()
 Destructor.
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)
virtual void connect_structured_push_supplier (CosNotifyComm::StructuredPushSupplier_ptr push_supplier)
virtual void push_structured_event (const CosNotification::StructuredEvent &notification)
virtual void disconnect_structured_push_consumer ()
virtual const char * get_proxy_type_name (void) const

Private Types

typedef
TAO_Notify_ProxyConsumer_T
< POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer > 
SuperClass

Private Member Functions

virtual void release (void)
 Release.

Friends

class TAO_Notify_Builder

Detailed Description

CosNotifyChannelAdmin::StructuredProxyPushConsumer implementation.

Definition at line 40 of file StructuredProxyPushConsumer.h.


Member Typedef Documentation

typedef TAO_Notify_ProxyConsumer_T<POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer> TAO_Notify_StructuredProxyPushConsumer::SuperClass [private]

Definition at line 43 of file StructuredProxyPushConsumer.h.


Constructor & Destructor Documentation

TAO_Notify_StructuredProxyPushConsumer::TAO_Notify_StructuredProxyPushConsumer ( void   ) 

Constructor.

Definition at line 17 of file StructuredProxyPushConsumer.cpp.

{
}

TAO_Notify_StructuredProxyPushConsumer::~TAO_Notify_StructuredProxyPushConsumer (  )  [virtual]

Destructor.

Definition at line 21 of file StructuredProxyPushConsumer.cpp.

{
}


Member Function Documentation

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

Definition at line 130 of file StructuredProxyPushConsumer.cpp.

{
  // Nothing to do.
  // This virtual method was added to support Notification MC
}

void TAO_Notify_StructuredProxyPushConsumer::connect_structured_push_supplier ( CosNotifyComm::StructuredPushSupplier_ptr  push_supplier  )  [protected, virtual]

Definition at line 39 of file StructuredProxyPushConsumer.cpp.

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

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

void TAO_Notify_StructuredProxyPushConsumer::disconnect_structured_push_consumer ( void   )  [protected, virtual]

Definition at line 70 of file StructuredProxyPushConsumer.cpp.

const char * TAO_Notify_StructuredProxyPushConsumer::get_proxy_type_name ( void   )  const [protected, virtual]

Implements TAO_Notify_Proxy.

Definition at line 78 of file StructuredProxyPushConsumer.cpp.

{
  return "structured_proxy_push_consumer";
}

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

Definition at line 101 of file StructuredProxyPushConsumer.cpp.

{
  SuperClass::load_attrs(attrs);
  ACE_CString ior;
  if (attrs.load("PeerIOR", ior))
  {
    CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
    try
    {
      CosNotifyComm::StructuredPushSupplier_var ps = CosNotifyComm::StructuredPushSupplier::_nil();
      if ( ior.length() > 0 )
      {
        CORBA::Object_var obj = orb->string_to_object(ior.c_str());
        ps = CosNotifyComm::StructuredPushSupplier::_unchecked_narrow(obj.in());
      }
      // minor hack: suppress generating subscription updates during reload.
      bool save_updates = this->updates_off_;
      this->updates_off_ = true;
      this->connect_structured_push_supplier(ps.in());
      this->updates_off_ = save_updates;
    }
    catch (const CORBA::Exception&)
    {
      // if we can't reconnect to peer, tough...
    }
  }
}

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

Definition at line 33 of file StructuredProxyPushConsumer.cpp.

{
  return CosNotifyChannelAdmin::PUSH_STRUCTURED;
}

void TAO_Notify_StructuredProxyPushConsumer::push_structured_event ( const CosNotification::StructuredEvent notification  )  [protected, virtual]

Definition at line 53 of file StructuredProxyPushConsumer.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_StructuredEvent_No_Copy event (notification);
  this->push_i (&event);
}

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

Release.

Definition at line 26 of file StructuredProxyPushConsumer.cpp.

{
  delete this;
  //@@ inform factory
}

void TAO_Notify_StructuredProxyPushConsumer::validate (  )  [virtual]

Implements TAO_Notify_Proxy.

Definition at line 84 of file StructuredProxyPushConsumer.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_StructuredProxyPushConsumer::validate(%d)")
                  ACE_TEXT("disconnecting \n"), this->id ()));
    }

    this->disconnect_structured_push_consumer ();
  }
}


Friends And Related Function Documentation

friend class TAO_Notify_Builder [friend]

Definition at line 44 of file StructuredProxyPushConsumer.h.


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