5 * @author Pradeep Gore <pradeep@oomworks.com>
8 #ifndef TAO_Notify_CONSUMER_H
9 #define TAO_Notify_CONSUMER_H
11 #include /**/ "ace/pre.h"
13 #include "ORB_Objects.h"
14 #include "tao/RTCORBA/RTCORBA.h"
15 #include "orbsvcs/CosNotifyChannelAdminS.h"
16 #include "orbsvcs/CosNotifyCommC.h"
17 #include "ace/SString.h"
18 #include "ace/OS_NS_time.h"
21 * @class TAO_Notify_ThreadPool_Consumer
26 class TAO_Notify_ThreadPool_Consumer
27 : public POA_CosNotifyComm::StructuredPushConsumer
31 TAO_Notify_ThreadPool_Consumer (TAO_Notify_ORB_Objects
& orb_objects
);
34 void init (PortableServer::POA_var
& poa
, CosNotifyChannelAdmin::ConsumerAdmin_var
& admin
, int proxy_supplier_thread_count
, int max_events
, long delay
);
39 /// Print the consumer throughput
40 void dump_throughput (void);
45 virtual ~TAO_Notify_ThreadPool_Consumer (void);
47 /// Connect the Consumer to the EventChannel.
48 /// Creates a new proxy supplier and connects to it.
51 /// Disconnect the supplier.
52 void disconnect (void);
55 void deactivate (void);
57 // = ServantBase operations
58 virtual PortableServer::POA_ptr
_default_POA (void);
60 // = NotifyPublish method
61 virtual void offer_change (
62 const CosNotification::EventTypeSeq
& added
,
63 const CosNotification::EventTypeSeq
& removed
);
65 // = StructuredPushSupplier methods
66 virtual void push_structured_event (
67 const CosNotification::StructuredEvent
& notification
);
69 virtual void disconnect_structured_push_consumer ();
74 TAO_SYNCH_MUTEX lock_
;
77 TAO_Notify_ORB_Objects orb_objects_
;
80 PortableServer::POA_var default_POA_
;
82 /// The proxy that we are connected to.
83 CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_
;
85 /// The proxy_supplier id.
86 CosNotifyChannelAdmin::ProxyID proxy_supplier_id_
;
89 CosNotifyChannelAdmin::ConsumerAdmin_var admin_
;
91 /// The Type the Consumer should subscribe to.
92 ACE_CString event_type_
;
94 /// ProxySupplier thread count.
95 int proxy_supplier_thread_count_
;
97 /// Max events to receive
100 /// Count the number of events received.
101 int events_received_count_
;
103 /// Time when the first sample was received.
104 //ACE_UINT64 t_first_;
105 ACE_hrtime_t t_first_
;
107 /// Time when the last sample was received.
108 //ACE_UINT64 t_last_;
109 ACE_hrtime_t t_last_
;
111 /// Delay: Sec of wait in each push.
112 ACE_Time_Value delay_
;
115 #include /**/ "ace/post.h"
116 #endif /* TAO_Notify_CONSUMER_H */