#include <EC_ProxySupplier.h>
Inheritance diagram for TAO_EC_ProxyPushSupplier:
Public Types | |
typedef RtecEventChannelAdmin::ProxyPushSupplier | Interface |
typedef RtecEventChannelAdmin::ProxyPushSupplier_var | _var_type |
typedef RtecEventChannelAdmin::ProxyPushSupplier_ptr | _ptr_type |
Public Member Functions | |
TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base *event_channel, int validate_connection) | |
Constructor... | |
virtual | ~TAO_EC_ProxyPushSupplier (void) |
Destructor... | |
virtual void | disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)=0 |
Disconnect this from. | |
CORBA::Boolean | is_connected (void) const |
Return 0 if no consumer is connected... | |
CORBA::Boolean | is_suspended (void) const |
Return 1 if it is suspended. | |
RtecEventComm::PushConsumer_ptr | consumer (void) const |
const RtecEventChannelAdmin::ConsumerQOS & | subscriptions (void) const |
The QoS (subscription) used to connect to the EC. | |
virtual void | connected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | reconnected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | disconnected (TAO_EC_ProxyPushConsumer *consumer ACE_ENV_ARG_DECL) |
virtual void | connected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | reconnected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | disconnected (TAO_EC_ProxyPushSupplier *supplier ACE_ENV_ARG_DECL) |
virtual void | shutdown (ACE_ENV_SINGLE_ARG_DECL) |
The event channel is shutting down. | |
void | push_to_consumer (RtecEventComm::PushConsumer_ptr consumer, const RtecEventComm::EventSet &event ACE_ENV_ARG_DECL) |
void | reactive_push_to_consumer (RtecEventComm::PushConsumer_ptr consumer, const RtecEventComm::EventSet &event ACE_ENV_ARG_DECL) |
CORBA::Boolean | consumer_non_existent (CORBA::Boolean_out disconnected ACE_ENV_ARG_DECL) |
CORBA::ULong | _incr_refcnt (void) |
Increment and decrement the reference count. | |
CORBA::ULong | _decr_refcnt (void) |
virtual int | filter (const RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info ACE_ENV_ARG_DECL) |
virtual int | filter_nocopy (RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info ACE_ENV_ARG_DECL) |
virtual void | push (const RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info ACE_ENV_ARG_DECL) |
virtual void | push_nocopy (RtecEventComm::EventSet &event, TAO_EC_QOS_Info &qos_info ACE_ENV_ARG_DECL) |
virtual void | clear (void) |
virtual CORBA::ULong | max_event_size (void) const |
Returns the maximum size of the events pushed by this filter. | |
virtual int | can_match (const RtecEventComm::EventHeader &header) const |
virtual int | add_dependencies (const RtecEventComm::EventHeader &header, const TAO_EC_QOS_Info &qos_info ACE_ENV_ARG_DECL) |
Public Attributes | |
virtual void virtual activate(RtecEventChannelAdmin::ProxyPushSupplier_ptr &proxy ACE_ENV_ARG_DECL) ACE_THROW_SPEC((CORBA voi | deactivate )(ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC(()) |
Deactivate from the POA. | |
Protected Member Functions | |
void | consumer (RtecEventComm::PushConsumer_ptr consumer) |
void | consumer_i (RtecEventComm::PushConsumer_ptr consumer) |
void | cleanup_i (void) |
Release the child and the consumer. | |
Protected Attributes | |
void suspend_connection_i(ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((CORBA void resume_connection_i(ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((CORBA void suspend_connection_locked(ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((CORBA void resume_connection_locked(ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC((CORBA CORBA::Boolea | is_connected_i )(void) const |
The private version (without locking) of is_connected(). | |
TAO_EC_Event_Channel_Base * | event_channel_ |
The Event Channel that owns this object. | |
ACE_Lock * | lock_ |
The locking strategy. | |
CORBA::ULong | refcount_ |
The reference count. | |
RtecEventComm::PushConsumer_var | consumer_ |
The consumer.... | |
CORBA::Boolean | suspended_ |
Is this consumer suspended? | |
RtecEventChannelAdmin::ConsumerQOS | qos_ |
The subscription and QoS information... | |
PortableServer::POA_var | default_POA_ |
Store the default POA. | |
TAO_EC_Filter * | child_ |
The filter object. | |
int | consumer_validate_connection_ |
Validate the connection to consumer on connect. | |
Private Member Functions | |
virtual void | refcount_zero_hook (void) |
Template method hooks. | |
virtual void | pre_dispatch_hook (RtecEventComm::EventSet &ACE_ENV_ARG_DECL) |
Implement the RtecEventChannelAdmin::ProxyPushSupplier interface, remember that this class is used to communicate with a PushConsumer, so, in effect, this is the ambassador for a consumer inside the event channel.
It does not assume ownership of the TAO_EC_Dispatching object. It makes a copy of the ConsumerQOS and the consumer object reference.
Locking is strategized, the event channel acts as a factory for the locking strategies.
Definition at line 56 of file EC_ProxySupplier.h.
|
Definition at line 61 of file EC_ProxySupplier.h. |
|
Definition at line 60 of file EC_ProxySupplier.h. |
|
Definition at line 59 of file EC_ProxySupplier.h. |
|
Constructor...
Definition at line 28 of file EC_ProxySupplier.cpp. References TAO_EC_Event_Channel_Base::create_supplier_lock(), and TAO_EC_Event_Channel_Base::supplier_poa().
00029 : event_channel_ (ec), 00030 refcount_ (1), 00031 suspended_ (0), 00032 child_ (0), 00033 consumer_validate_connection_(validate_connection) 00034 { 00035 this->lock_ = 00036 this->event_channel_->create_supplier_lock (); 00037 00038 this->default_POA_ = 00039 this->event_channel_->supplier_poa (); 00040 } |
|
Destructor...
Definition at line 42 of file EC_ProxySupplier.cpp. References cleanup_i(), and TAO_EC_Event_Channel_Base::destroy_supplier_lock().
00043 { 00044 this->event_channel_->destroy_supplier_lock (this->lock_); 00045 this->cleanup_i (); 00046 } |
|
Definition at line 184 of file EC_ProxySupplier.cpp. References ACE_GUARD_RETURN, and refcount_zero_hook(). Referenced by TAO_EC_Default_ProxyPushSupplier::_remove_ref(), TAO_EC_Kokyu_Push_Command::~TAO_EC_Kokyu_Push_Command(), and TAO_EC_Push_Command::~TAO_EC_Push_Command().
00185 { 00186 { 00187 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00188 this->refcount_--; 00189 if (this->refcount_ != 0) 00190 return this->refcount_; 00191 } 00192 00193 this->refcount_zero_hook (); 00194 return 0; 00195 } |
|
Increment and decrement the reference count.
Definition at line 170 of file EC_ProxySupplier.cpp. References ACE_GUARD_RETURN. Referenced by TAO_EC_Default_ProxyPushSupplier::_add_ref(), TAO_EC_Kokyu_Push_Command::TAO_EC_Kokyu_Push_Command(), and TAO_EC_Push_Command::TAO_EC_Push_Command().
00171 { 00172 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00173 return this->refcount_++; 00174 } |
|
This is used for computing the scheduling dependencies: Leaf filters check if the header could be matched, similar to the can_match() method; if it does they return 1, and 0 otherwise. Intermediate nodes always return 0. This is used to build precise dependencies between the suppliers and the leaf of the filters that accept that event. Notice that only the nodes doing scheduling recurse through the list, so in configurations that do no require scheduling the recursion stops fairly soon. Implements TAO_EC_Filter. |
|
Returns 0 if an event with that header could never be accepted. This can used by the suppliers to filter out consumers that couldn't possibly be interested in their events. The rt_info and Implements TAO_EC_Filter. Definition at line 508 of file EC_ProxySupplier.cpp. References ACE_GUARD_RETURN, TAO_EC_Filter::can_match(), and is_connected_i.
00510 { 00511 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00512 00513 if (this->is_connected_i () == 0) 00514 return 0; 00515 00516 return this->child_->can_match (header); 00517 } |
|
Release the child and the consumer.
Definition at line 137 of file EC_ProxySupplier.cpp. Referenced by ~TAO_EC_ProxyPushSupplier().
|
|
Clear any saved state, must reset and assume no events have been received. Implements TAO_EC_Filter. Definition at line 492 of file EC_ProxySupplier.cpp. References ACE_GUARD, and TAO_EC_Filter::clear().
|
|
Usually implemented as no-ops, but some configurations may require this methods. |
|
Concrete implementations can use this methods to keep track of the suppliers that publish its events. |
|
Set the consumer, used by some implementations to change the policies used when invoking operations on the consumer. Definition at line 83 of file EC_ProxySupplier.i. References ACE_GUARD, and consumer_i().
00084 { 00085 ACE_GUARD (ACE_Lock, ace_mon, *this->lock_); 00086 00087 this->consumer_i (consumer); 00088 } |
|
Return the consumer object reference. It returns nil() if it has not connected yet. Definition at line 70 of file EC_ProxySupplier.i. References ACE_GUARD_RETURN.
00071 { 00072 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00073 return RtecEventComm::PushConsumer::_duplicate (this->consumer_.in ()); 00074 } |
|
Definition at line 77 of file EC_ProxySupplier.i. Referenced by consumer().
00078 { 00079 this->consumer_ = consumer; 00080 } |
|
Invoke the _non_existent() pseudo-operation on the consumer. If it is disconnected then it returns true and sets the flag. Definition at line 463 of file EC_ProxySupplier.cpp. References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, and is_connected_i.
00466 { 00467 CORBA::Object_var consumer; 00468 { 00469 ACE_GUARD_THROW_EX ( 00470 ACE_Lock, ace_mon, *this->lock_, 00471 CORBA::INTERNAL ()); 00472 ACE_CHECK_RETURN (0); 00473 00474 disconnected = 0; 00475 if (this->is_connected_i () == 0) 00476 { 00477 disconnected = 1; 00478 return 0; 00479 } 00480 00481 consumer = CORBA::Object::_duplicate (this->consumer_.in ()); 00482 } 00483 00484 #if (TAO_HAS_MINIMUM_CORBA == 0) 00485 return consumer->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); 00486 #else 00487 return 0; 00488 #endif /* TAO_HAS_MINIMUM_CORBA */ 00489 } |
|
Disconnect this from.
Referenced by TAO_EC_Reactive_ConsumerControl::system_exception(). |
|
|
|
|
|
Filter this event, returns 1 if the event is accepted, 0 otherwise. Notice that there are two versions of the method, if the event is not const then filter can take ownership of the event.
Implements TAO_EC_Filter. Referenced by TAO_EC_Timeout_Filter::push_to_proxy(). |
|
Implements TAO_EC_Filter. |
|
Return 0 if no consumer is connected...
Definition at line 54 of file EC_ProxySupplier.i. References ACE_GUARD_RETURN, and is_connected_i.
00055 { 00056 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00057 00058 return this->is_connected_i (); 00059 } |
|
Return 1 if it is suspended.
Definition at line 62 of file EC_ProxySupplier.i. References ACE_GUARD_RETURN, and suspended_.
00063 { 00064 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00065 00066 return this->suspended_; 00067 } |
|
Returns the maximum size of the events pushed by this filter.
Implements TAO_EC_Filter. Definition at line 500 of file EC_ProxySupplier.cpp. References ACE_GUARD_RETURN, and TAO_EC_Filter::max_event_size().
00501 { 00502 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00503 00504 return this->child_->max_event_size (); 00505 } |
|
Definition at line 303 of file EC_ProxySupplier.cpp. References RtecEventComm::EventSet.
00305 { 00306 } |
|
This is called by the children when they accept an event and which to pass it up. Notice that there are two versions of the method, if the event is not const then filter can take ownership of the event. Implements TAO_EC_Filter. |
|
Implements TAO_EC_Filter. |
|
These methods take consumer argument because during the time the filters have been processing the event, this proxy's consumer may have changed. Referenced by TAO_EC_Kokyu_Push_Command::execute(), and TAO_EC_Push_Command::execute(). |
|
|
|
|
|
|
|
Template method hooks.
Definition at line 177 of file EC_ProxySupplier.cpp. References TAO_EC_Event_Channel_Base::destroy_proxy(). Referenced by _decr_refcnt().
00178 { 00179 // Use the event channel 00180 this->event_channel_->destroy_proxy (this); 00181 } |
|
The event channel is shutting down.
|
|
The QoS (subscription) used to connect to the EC.
Definition at line 91 of file EC_ProxySupplier.i. References ACE_GUARD_RETURN.
00092 { 00093 // @@ TODO There should be a better way to signal errors here. 00094 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, this->qos_); 00095 00096 return this->qos_; 00097 } |
|
The filter object.
Definition at line 208 of file EC_ProxySupplier.h. |
|
The consumer....
Definition at line 196 of file EC_ProxySupplier.h. |
|
Validate the connection to consumer on connect.
Definition at line 211 of file EC_ProxySupplier.h. |
|
Deactivate from the POA.
Definition at line 149 of file EC_ProxySupplier.cpp.
00150 { 00151 ACE_TRY 00152 { 00153 PortableServer::ObjectId id = 00154 this->object_id (ACE_ENV_SINGLE_ARG_PARAMETER); 00155 ACE_TRY_CHECK; 00156 this->default_POA_->deactivate_object (id ACE_ENV_ARG_PARAMETER); 00157 ACE_TRY_CHECK; 00158 } 00159 ACE_CATCHANY 00160 { 00161 // Exceptions here should not be propagated. They usually 00162 // indicate that an object is beign disconnected twice, or some 00163 // race condition, but not a fault that the user needs to know 00164 // about. 00165 } 00166 ACE_ENDTRY; 00167 } |
|
Store the default POA.
Definition at line 205 of file EC_ProxySupplier.h. |
|
The Event Channel that owns this object.
Definition at line 187 of file EC_ProxySupplier.h. |
|
The private version (without locking) of is_connected().
Definition at line 48 of file EC_ProxySupplier.i. Referenced by can_match(), consumer_non_existent(), and is_connected().
00049 { 00050 return !CORBA::is_nil (this->consumer_.in ()); 00051 } |
|
The locking strategy.
Definition at line 190 of file EC_ProxySupplier.h. |
|
The subscription and QoS information...
Definition at line 202 of file EC_ProxySupplier.h. |
|
The reference count.
Definition at line 193 of file EC_ProxySupplier.h. |
|
Is this consumer suspended?
Definition at line 199 of file EC_ProxySupplier.h. Referenced by is_suspended(). |