TAO_Notify_StructuredPushConsumer Class Reference

Wrapper for the StructuredPushConsumer that connect to the EventChannel. More...

#include <StructuredPushConsumer.h>

Inheritance diagram for TAO_Notify_StructuredPushConsumer:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_StructuredPushConsumer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Notify_StructuredPushConsumer (TAO_Notify_ProxySupplier *proxy)
 Constuctor.

void init (CosNotifyComm::StructuredPushConsumer_ptr push_consumer)
 Init the Consumer.

virtual ~TAO_Notify_StructuredPushConsumer ()
 Destructor.

virtual void push (const CORBA::Any &event)
 Push to this consumer.

virtual void push (const CosNotification::StructuredEvent &event)
 Push to this consumer.

virtual void push (const CosNotification::EventBatch &event)
 Push a batch of events to this consumer.

virtual ACE_CString get_ior (void) const
 Retrieve the ior of this peer.

virtual void reconnect_from_consumer (TAO_Notify_Consumer *old_consumer)

Protected Attributes

CosNotifyComm::StructuredPushConsumer_var push_consumer_
 The Consumer.


Private Member Functions

virtual void release (void)
 Release.


Detailed Description

Wrapper for the StructuredPushConsumer that connect to the EventChannel.

Definition at line 35 of file StructuredPushConsumer.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_StructuredPushConsumer::TAO_Notify_StructuredPushConsumer TAO_Notify_ProxySupplier proxy  ) 
 

Constuctor.

Definition at line 12 of file StructuredPushConsumer.cpp.

00013   :TAO_Notify_Consumer (proxy)
00014 {
00015 }

TAO_Notify_StructuredPushConsumer::~TAO_Notify_StructuredPushConsumer  )  [virtual]
 

Destructor.

Definition at line 17 of file StructuredPushConsumer.cpp.

00018 {
00019 }


Member Function Documentation

ACE_CString TAO_Notify_StructuredPushConsumer::get_ior void   )  const [virtual]
 

Retrieve the ior of this peer.

Implements TAO_Notify_Peer.

Definition at line 82 of file StructuredPushConsumer.cpp.

References ACE_CATCHANY, ACE_CString, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, and TAO_Singleton< TYPE, ACE_LOCK >::instance().

00083 {
00084   ACE_CString result;
00085   CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
00086   ACE_DECLARE_NEW_CORBA_ENV;
00087   ACE_TRY
00088   {
00089     CORBA::String_var ior = orb->object_to_string(this->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
00090     ACE_TRY_CHECK;
00091     result = static_cast<const char*> (ior.in ());
00092   }
00093   ACE_CATCHANY
00094   {
00095     result.fast_clear();
00096   }
00097   ACE_ENDTRY;
00098   return result;
00099 }

void TAO_Notify_StructuredPushConsumer::init CosNotifyComm::StructuredPushConsumer_ptr  push_consumer  ) 
 

Init the Consumer.

Definition at line 22 of file StructuredPushConsumer.cpp.

References ACE_ASSERT, ACE_THROW, and CORBA::is_nil().

Referenced by TAO_Notify_StructuredProxyPushSupplier::connect_structured_push_consumer(), and reconnect_from_consumer().

00023 {
00024   // Initialize only once
00025   ACE_ASSERT( CORBA::is_nil (this->push_consumer_.in()) );
00026 
00027   if (CORBA::is_nil (push_consumer))
00028   {
00029     ACE_THROW (CORBA::BAD_PARAM());
00030   }
00031 
00032   this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
00033 
00034   this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
00035 
00036 }

void TAO_Notify_StructuredPushConsumer::push const CosNotification::EventBatch event  )  [virtual]
 

Push a batch of events to this consumer.

Implements TAO_Notify_Consumer.

Definition at line 63 of file StructuredPushConsumer.cpp.

References ACE_ASSERT, and CosNotification::EventBatch.

00064 {
00065   ACE_ASSERT(false);
00066   ACE_UNUSED_ARG (event);
00067   // TODO exception?
00068 }

void TAO_Notify_StructuredPushConsumer::push const CosNotification::StructuredEvent event  )  [virtual]
 

Push to this consumer.

Implements TAO_Notify_Consumer.

Definition at line 56 of file StructuredPushConsumer.cpp.

References ACE_ENV_ARG_PARAMETER.

00057 {
00058   this->push_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
00059 }

void TAO_Notify_StructuredPushConsumer::push const CORBA::Any &  event  )  [virtual]
 

Push to this consumer.

Implements TAO_Notify_Consumer.

Definition at line 46 of file StructuredPushConsumer.cpp.

References ACE_ENV_ARG_PARAMETER, and TAO_Notify_Event::translate().

00047 {
00048   CosNotification::StructuredEvent notification;
00049 
00050   TAO_Notify_Event::translate (event, notification);
00051 
00052   this->push_consumer_->push_structured_event (notification ACE_ENV_ARG_PARAMETER);
00053 }

void TAO_Notify_StructuredPushConsumer::reconnect_from_consumer TAO_Notify_Consumer old_consumer  )  [virtual]
 

on reconnect we need to move events from the old consumer to the new one

Implements TAO_Notify_Consumer.

Definition at line 71 of file StructuredPushConsumer.cpp.

References ACE_ASSERT, ACE_CHECK, ACE_ENV_ARG_PARAMETER, init(), push_consumer_, and TAO_Notify_Consumer::schedule_timer().

00073 {
00074   TAO_Notify_StructuredPushConsumer* tmp = dynamic_cast<TAO_Notify_StructuredPushConsumer *> (old_consumer);
00075   ACE_ASSERT(tmp != 0);
00076   this->init(tmp->push_consumer_.in() ACE_ENV_ARG_PARAMETER);
00077   ACE_CHECK;
00078   this->schedule_timer(false);
00079 }

void TAO_Notify_StructuredPushConsumer::release void   )  [private, virtual]
 

Release.

Implements TAO_Notify_Peer.

Definition at line 39 of file StructuredPushConsumer.cpp.

00040 {
00041   delete this;
00042   //@@ inform factory
00043 }


Member Data Documentation

CosNotifyComm::StructuredPushConsumer_var TAO_Notify_StructuredPushConsumer::push_consumer_ [protected]
 

The Consumer.

Definition at line 71 of file StructuredPushConsumer.h.

Referenced by reconnect_from_consumer().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:33:27 2006 for TAO_CosNotification by doxygen 1.3.6