#include <StructuredPushConsumer.h>
Inheritance diagram for TAO_Notify_StructuredPushConsumer:
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. |
Definition at line 35 of file StructuredPushConsumer.h.
|
Constuctor.
Definition at line 12 of file StructuredPushConsumer.cpp.
00013 :TAO_Notify_Consumer (proxy) 00014 { 00015 } |
|
Destructor.
Definition at line 17 of file StructuredPushConsumer.cpp.
00018 { 00019 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
Release.
Implements TAO_Notify_Peer. Definition at line 39 of file StructuredPushConsumer.cpp.
00040 { 00041 delete this; 00042 //@@ inform factory 00043 } |
|
The Consumer.
Definition at line 71 of file StructuredPushConsumer.h. Referenced by reconnect_from_consumer(). |