TAO_CosNotification  2.2.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TAO_Notify_Consumer Class Referenceabstract

Astract Base class for wrapping consumer objects that connect to the EventChannel. More...

#include <Consumer.h>

Inheritance diagram for TAO_Notify_Consumer:
Inheritance graph
Collaboration diagram for TAO_Notify_Consumer:
Collaboration graph

Public Types

enum  DispatchStatus {
  DISPATCH_SUCCESS, DISPATCH_RETRY, DISPATCH_DISCARD, DISPATCH_FAIL,
  DISPATCH_FAIL_TIMEOUT
}
 Status returned from dispatch attempts. More...
 
typedef
TAO_Notify_Refcountable_Guard_T
< TAO_Notify_Consumer
Ptr
 
- Public Types inherited from TAO_Notify_Peer
typedef
TAO_Notify_Refcountable_Guard_T
< TAO_Notify_Peer
Ptr
 

Public Member Functions

 TAO_Notify_Consumer (TAO_Notify_ProxySupplier *proxy)
 Constructor. More...
 
virtual ~TAO_Notify_Consumer ()
 Destructor. More...
 
CORBA::ULong _incr_refcnt (void)
 This method sigantures deliberately match the RefCounting methods required for ESF Proxy. More...
 
CORBA::ULong _decr_refcnt (void)
 
TAO_Notify_ProxySupplierproxy_supplier (void)
 Access Specific Proxy. More...
 
virtual TAO_Notify_Proxyproxy (void)
 Access Base Proxy. More...
 
void deliver (TAO_Notify_Method_Request_Event *request)
 Dispatch Event to consumer. More...
 
virtual void push (const CORBA::Any &event)=0
 Push event to this consumer. More...
 
virtual void push (const CosNotification::StructuredEvent &event)=0
 Push event to this consumer. More...
 
virtual void push (const CosNotification::EventBatch &event)=0
 Push a batch of events to this consumer. More...
 
DispatchStatus dispatch_batch (const CosNotification::EventBatch &batch)
 Dispatch the batch of events to the attached consumer. More...
 
void dispatch_pending (void)
 Dispatch the pending events. More...
 
CORBA::Boolean is_suspended (void)
 Is the connection suspended? More...
 
void suspend (void)
 Suspend Connection. More...
 
void resume (void)
 Resume Connection. More...
 
virtual void shutdown (void)
 Shutdown the consumer. More...
 
virtual void reconnect_from_consumer (TAO_Notify_Consumer *old_consumer)=0
 
virtual void qos_changed (const TAO_Notify_QoSProperties &qos_properties)
 Override, Peer::qos_changed. More...
 
void assume_pending_events (TAO_Notify_Consumer &rhs)
 
bool is_alive (bool allow_nil_consumer)
 Is the connected consumer still around? More...
 
size_t pending_count (void)
 
- Public Member Functions inherited from TAO_Notify_Peer
 TAO_Notify_Peer (void)
 Constructor. More...
 
virtual ~TAO_Notify_Peer ()
 Destructor. More...
 
CORBA::ULong _incr_refcnt (void)
 
CORBA::ULong _decr_refcnt (void)
 
virtual void dispatch_updates (const TAO_Notify_EventTypeSeq &added, const TAO_Notify_EventTypeSeq &removed)
 
void handle_dispatch_exception (void)
 Handle dispatch exceptions. More...
 
virtual ACE_CString get_ior (void) const =0
 Retrieve the ior of this peer. More...
 

Protected Types

typedef ACE_Unbounded_Queue
< TAO_Notify_Method_Request_Event_Queueable * > 
Request_Queue
 

Protected Member Functions

virtual CORBA::Object_ptr get_consumer (void)=0
 
DispatchStatus dispatch_request (TAO_Notify_Method_Request_Event *request)
 
virtual bool dispatch_from_queue (Request_Queue &requests, ACE_Guard< TAO_SYNCH_MUTEX > &ace_mon)
 Attempt to dispatch event from a queue. More...
 
void enqueue_request (TAO_Notify_Method_Request_Event *request)
 
virtual bool enqueue_if_necessary (TAO_Notify_Method_Request_Event *request)
 
virtual void dispatch_updates_i (const CosNotification::EventTypeSeq &added, const CosNotification::EventTypeSeq &removed)
 Implementation of Peer specific dispatch_updates. More...
 
TAO_SYNCH_MUTEXproxy_lock (void)
 Get the shared Proxy Lock. More...
 
virtual int handle_timeout (const ACE_Time_Value &current_time, const void *act=0)
 
void schedule_timer (bool is_error=false)
 Schedule timer. More...
 
void cancel_timer (void)
 Cancel timer. More...
 
Request_Queuepending_events ()
 = Protected Data Members More...
 

Protected Attributes

TAO_Notify_ProxySupplierproxy_
 The Proxy that we associate with. More...
 
CORBA::Boolean is_suspended_
 Suspended Flag. More...
 
CosNotifyComm::NotifyPublish_var publish_
 Interface that accepts offer_changes. More...
 
bool have_not_yet_verified_publish_
 
const TAO_Notify_Property_Timepacing_
 The Pacing Interval. More...
 
TAO_Notify_Property_Long max_batch_size_
 Max. batch size. More...
 
long timer_id_
 Timer Id. More...
 
TAO_Notify_Timer::Ptr timer_
 The Timer Manager that we use. More...
 
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
ACE_Time_Value
last_ping_
 

Private Attributes

ACE_Auto_Ptr< Request_Queuepending_events_
 Events pending to be delivered. More...
 
CORBA::Object_var rtt_obj_
 

Detailed Description

Astract Base class for wrapping consumer objects that connect to the EventChannel.

Member Typedef Documentation

Member Enumeration Documentation

Status returned from dispatch attempts.

Enumerator
DISPATCH_SUCCESS 
DISPATCH_RETRY 
DISPATCH_DISCARD 
DISPATCH_FAIL 
DISPATCH_FAIL_TIMEOUT 

Constructor & Destructor Documentation

TAO_Notify_Consumer::TAO_Notify_Consumer ( TAO_Notify_ProxySupplier proxy)

Constructor.

TAO_Notify_Consumer::~TAO_Notify_Consumer ( )
virtual

Destructor.

Member Function Documentation

CORBA::ULong TAO_Notify_Consumer::_decr_refcnt ( void  )
CORBA::ULong TAO_Notify_Consumer::_incr_refcnt ( void  )

This method sigantures deliberately match the RefCounting methods required for ESF Proxy.

void TAO_Notify_Consumer::assume_pending_events ( TAO_Notify_Consumer rhs)

Take the pending queue from the rhs, cancel it's timer and schedule our timer. The caller should have locked the proxy lock before calling this method.

void TAO_Notify_Consumer::cancel_timer ( void  )
protected

Cancel timer.

void TAO_Notify_Consumer::deliver ( TAO_Notify_Method_Request_Event request)

Dispatch Event to consumer.

TAO_Notify_Consumer::DispatchStatus TAO_Notify_Consumer::dispatch_batch ( const CosNotification::EventBatch batch)

Dispatch the batch of events to the attached consumer.

bool TAO_Notify_Consumer::dispatch_from_queue ( Request_Queue requests,
ACE_Guard< TAO_SYNCH_MUTEX > &  ace_mon 
)
protectedvirtual

Attempt to dispatch event from a queue.

Called by dispatch_pending. Deliver one or more events to the Consumer. If delivery fails, events are left in the queue (or discarded depending on QoS parameters.) Undelivered, undiscarded requests are left at the front of the queue. Overridden in sequence consumer to dispatch as an EventBatch.

Returns
false if delivery failed and the request(s) cannot be discarded.

Reimplemented in TAO_Notify_SequencePushConsumer.

void TAO_Notify_Consumer::dispatch_pending ( void  )

Dispatch the pending events.

TAO_Notify_Consumer::DispatchStatus TAO_Notify_Consumer::dispatch_request ( TAO_Notify_Method_Request_Event request)
protected
void TAO_Notify_Consumer::dispatch_updates_i ( const CosNotification::EventTypeSeq added,
const CosNotification::EventTypeSeq removed 
)
protectedvirtual

Implementation of Peer specific dispatch_updates.

Implements TAO_Notify_Peer.

bool TAO_Notify_Consumer::enqueue_if_necessary ( TAO_Notify_Method_Request_Event request)
protectedvirtual

Add request to a queue if necessary. Overridden by sequence consumer to "always" put incoming events into the queue.

Returns
true the request has been enqueued; false the request should be handled now.

Reimplemented in TAO_Notify_SequencePushConsumer.

void TAO_Notify_Consumer::enqueue_request ( TAO_Notify_Method_Request_Event request)
protected
virtual CORBA::Object_ptr TAO_Notify_Consumer::get_consumer ( void  )
protectedpure virtual

This method is called by the is_alive() method. It should provide the connected consumer or nil if there is none.

Implemented in TAO_Notify_SequencePushConsumer, TAO_Notify_StructuredPushConsumer, and TAO_Notify_PushConsumer.

int TAO_Notify_Consumer::handle_timeout ( const ACE_Time_Value current_time,
const void *  act = 0 
)
protectedvirtual
bool TAO_Notify_Consumer::is_alive ( bool  allow_nil_consumer)

Is the connected consumer still around?

CORBA::Boolean TAO_Notify_Consumer::is_suspended ( void  )

Is the connection suspended?

size_t TAO_Notify_Consumer::pending_count ( void  )

Estimate how many events are pending delivery for this consumer

The estimate does not include events queued at the admin level which have not been passed to this consumer for delivery yet.

TAO_Notify_Consumer::Request_Queue & TAO_Notify_Consumer::pending_events ( )
protected

= Protected Data Members

TAO_Notify_Proxy * TAO_Notify_Consumer::proxy ( void  )
virtual

Access Base Proxy.

Implements TAO_Notify_Peer.

TAO_SYNCH_MUTEX * TAO_Notify_Consumer::proxy_lock ( void  )
protected

Get the shared Proxy Lock.

TAO_Notify_ProxySupplier * TAO_Notify_Consumer::proxy_supplier ( void  )

Access Specific Proxy.

virtual void TAO_Notify_Consumer::push ( const CORBA::Any &  event)
pure virtual
virtual void TAO_Notify_Consumer::push ( const CosNotification::StructuredEvent event)
pure virtual
virtual void TAO_Notify_Consumer::push ( const CosNotification::EventBatch event)
pure virtual

Push a batch of events to this consumer.

Implemented in TAO_Notify_SequencePushConsumer, TAO_Notify_StructuredPushConsumer, and TAO_Notify_PushConsumer.

void TAO_Notify_Consumer::qos_changed ( const TAO_Notify_QoSProperties qos_properties)
virtual

Override, Peer::qos_changed.

Reimplemented from TAO_Notify_Peer.

virtual void TAO_Notify_Consumer::reconnect_from_consumer ( TAO_Notify_Consumer old_consumer)
pure virtual

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

Implemented in TAO_Notify_SequencePushConsumer, TAO_Notify_StructuredPushConsumer, and TAO_Notify_PushConsumer.

void TAO_Notify_Consumer::resume ( void  )

Resume Connection.

void TAO_Notify_Consumer::schedule_timer ( bool  is_error = false)
protected

Schedule timer.

Todo:

: rather than is_error, use pacing interval so it will be configurable

: find some way to use batch buffering stratgy for sequence consumers.

void TAO_Notify_Consumer::shutdown ( void  )
virtual

Shutdown the consumer.

Reimplemented from TAO_Notify_Peer.

void TAO_Notify_Consumer::suspend ( void  )

Suspend Connection.

Member Data Documentation

bool TAO_Notify_Consumer::have_not_yet_verified_publish_
protected
CORBA::Boolean TAO_Notify_Consumer::is_suspended_
protected

Suspended Flag.

ACE_Atomic_Op<TAO_SYNCH_MUTEX, ACE_Time_Value> TAO_Notify_Consumer::last_ping_
protected

Last time either push an event or validate connection via _non_exist call.

TAO_Notify_Property_Long TAO_Notify_Consumer::max_batch_size_
protected

Max. batch size.

const TAO_Notify_Property_Time& TAO_Notify_Consumer::pacing_
protected

The Pacing Interval.

ACE_Auto_Ptr< Request_Queue > TAO_Notify_Consumer::pending_events_
private

Events pending to be delivered.

TAO_Notify_ProxySupplier* TAO_Notify_Consumer::proxy_
protected

The Proxy that we associate with.

CosNotifyComm::NotifyPublish_var TAO_Notify_Consumer::publish_
protected

Interface that accepts offer_changes.

CORBA::Object_var TAO_Notify_Consumer::rtt_obj_
private
TAO_Notify_Timer::Ptr TAO_Notify_Consumer::timer_
protected

The Timer Manager that we use.

long TAO_Notify_Consumer::timer_id_
protected

Timer Id.


The documentation for this class was generated from the following files: