00001 /* -*- C++ -*- */ 00002 /** 00003 * @file SequencePushConsumer.h 00004 * 00005 * $Id: SequencePushConsumer.h 84685 2009-03-02 22:49:17Z mesnier_p $ 00006 * 00007 * @author Pradeep Gore <pradeep@oomworks.com> 00008 * 00009 * 00010 */ 00011 00012 #ifndef TAO_Notify_SEQUENCEPUSHCONSUMER_H 00013 #define TAO_Notify_SEQUENCEPUSHCONSUMER_H 00014 #include /**/ "ace/pre.h" 00015 00016 #include "orbsvcs/Notify/notify_serv_export.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include "ace/Event_Handler.h" 00023 #include "orbsvcs/Notify/Event.h" 00024 #include "orbsvcs/Notify/Property.h" 00025 #include "orbsvcs/Notify/Property_T.h" 00026 #include "orbsvcs/Notify/Consumer.h" 00027 #include "orbsvcs/Notify/AdminProperties.h" 00028 #include "ace/Null_Condition.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 class TAO_Notify_ProxySupplier; 00033 class TAO_Notify_QoSProperties; 00034 class TAO_Notify_Timer; 00035 00036 /** 00037 * @class TAO_Notify_SequencePushConsumer 00038 * 00039 * @brief 00040 * 00041 */ 00042 class TAO_Notify_Serv_Export TAO_Notify_SequencePushConsumer 00043 : public TAO_Notify_Consumer 00044 { 00045 public: 00046 TAO_Notify_SequencePushConsumer (TAO_Notify_ProxySupplier* proxy); 00047 00048 virtual ~TAO_Notify_SequencePushConsumer (); 00049 00050 /// Init the Consumer 00051 void init (CosNotifyComm::SequencePushConsumer_ptr push_consumer); 00052 00053 /// Add request to a queue if necessary. 00054 /// for Sequence it's always necessary. 00055 virtual bool enqueue_if_necessary( 00056 TAO_Notify_Method_Request_Event * request); 00057 00058 virtual bool dispatch_from_queue ( 00059 Request_Queue & requests, 00060 ACE_Guard <TAO_SYNCH_MUTEX> & ace_mon); 00061 00062 00063 /// Push <event> to this consumer. 00064 virtual void push (const CORBA::Any& event); 00065 00066 // Push event. 00067 virtual void push (const CosNotification::StructuredEvent & event); 00068 00069 /// Push a batch of events to this consumer. 00070 virtual void push (const CosNotification::EventBatch& event); 00071 00072 /// Retrieve the ior of this peer 00073 virtual ACE_CString get_ior (void) const; 00074 00075 /// on reconnect we need to move events from the old consumer 00076 /// to the new one 00077 virtual void reconnect_from_consumer (TAO_Notify_Consumer* old_consumer); 00078 00079 protected: 00080 00081 virtual CORBA::Object_ptr get_consumer (void); 00082 00083 /// The Consumer 00084 CosNotifyComm::SequencePushConsumer_var push_consumer_; 00085 00086 private: 00087 /// TAO_Notify_Destroy_Callback methods. 00088 virtual void release (void); 00089 }; 00090 00091 TAO_END_VERSIONED_NAMESPACE_DECL 00092 00093 #include /**/ "ace/post.h" 00094 #endif /* TAO_Notify_SEQUENCEPUSHCONSUMER_H */