#include <CEC_ProxyPullConsumer.h>
Collaboration diagram for TAO_CEC_ProxyPullConsumer:
Public Types | |
typedef CosEventChannelAdmin::ProxyPullConsumer_ptr | _ptr_type |
typedef CosEventChannelAdmin::ProxyPullConsumer_var | _var_type |
Public Member Functions | |
TAO_CEC_ProxyPullConsumer (TAO_CEC_EventChannel *event_channel) | |
constructor... | |
virtual | ~TAO_CEC_ProxyPullConsumer (void) |
destructor... | |
CosEventComm::PullSupplier_ptr | supplier (void) const |
CORBA::Any * | try_pull_from_supplier (CORBA::Boolean_out has_event) |
Pulls from the supplier, verifies that it is connected. | |
CORBA::Any * | pull_from_supplier () |
CORBA::Boolean | supplier_non_existent (CORBA::Boolean_out disconnected) |
virtual void | shutdown () |
The event channel is shutting down. | |
CORBA::ULong | _incr_refcnt (void) |
Increment and decrement the reference count. | |
CORBA::ULong | _decr_refcnt (void) |
virtual void | _add_ref () |
virtual void | _remove_ref () |
Public Attributes | |
virtual void virtual activate(CosEventChannelAdmin::ProxyPullConsumer_ptr &activated_proxy) ACE_THROW_SPEC((CORBA void deactivate() ACE_THROW_SPEC((CORBA CORBA::Boolea | is_connected )(void) const |
Return 0 if no supplier is connected... | |
virtual void virtual connect_pull_supplier(CosEventComm::PullSupplier_ptr pull_supplier) ACE_THROW_SPEC((CORBA void virtual disconnect_pull_consumer() ACE_THROW_SPEC((CORBA PortableServer::POA_pt | _default_POA )() |
Protected Member Functions | |
void | supplier (CosEventComm::PullSupplier_ptr supplier) |
void | supplier_i (CosEventComm::PullSupplier_ptr supplier) |
CORBA::Boolean | is_connected_i (void) const |
The private version (without locking) of is_connected(). | |
void | cleanup_i (void) |
Release the supplier. | |
Private Attributes | |
TAO_CEC_EventChannel * | event_channel_ |
The supplier admin, used for activation and memory managment. | |
ACE_Lock * | lock_ |
The locking strategy. | |
CORBA::ULong | refcount_ |
The reference count. | |
CosEventComm::PullSupplier_var | supplier_ |
The supplier.... | |
PortableServer::POA_var | default_POA_ |
Store the default POA. |
Implement the CosEventChannelAdmin::ProxyPullConsumer interface, remember that this class is used to communicate with a PullSupplier, so, in effect, this is the ambassador for a supplier inside the event channel. = MEMORY MANAGMENT The object commits suicide when disconnect_pull_consumer() is called.
Definition at line 46 of file CEC_ProxyPullConsumer.h.
|
Definition at line 49 of file CEC_ProxyPullConsumer.h. |
|
Definition at line 50 of file CEC_ProxyPullConsumer.h. |
|
constructor...
Definition at line 24 of file CEC_ProxyPullConsumer.cpp. References TAO_CEC_EventChannel::consumer_poa(), TAO_CEC_EventChannel::create_consumer_lock(), and TAO_CEC_EventChannel::get_servant_retry_map().
00025 : event_channel_ (ec), 00026 refcount_ (1) 00027 { 00028 this->lock_ = 00029 this->event_channel_->create_consumer_lock (); 00030 00031 this->default_POA_ = 00032 this->event_channel_->consumer_poa (); 00033 00034 this->event_channel_->get_servant_retry_map ().bind (this, 0); 00035 } |
|
destructor...
Definition at line 37 of file CEC_ProxyPullConsumer.cpp. References TAO_CEC_EventChannel::destroy_consumer_lock(), and TAO_CEC_EventChannel::get_servant_retry_map().
00038 { 00039 this->event_channel_->get_servant_retry_map ().unbind (this); 00040 this->event_channel_->destroy_consumer_lock (this->lock_); 00041 } |
|
Definition at line 384 of file CEC_ProxyPullConsumer.cpp. References _incr_refcnt().
00385 { 00386 this->_incr_refcnt (); 00387 } |
|
Definition at line 267 of file CEC_ProxyPullConsumer.cpp. References ACE_GUARD_RETURN, and TAO_CEC_EventChannel::destroy_proxy(). Referenced by _remove_ref().
00268 { 00269 { 00270 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00271 this->refcount_--; 00272 if (this->refcount_ != 0) 00273 return this->refcount_; 00274 } 00275 00276 // Notify the event channel 00277 this->event_channel_->destroy_proxy (this); 00278 return 0; 00279 } |
|
Increment and decrement the reference count.
Definition at line 260 of file CEC_ProxyPullConsumer.cpp. References ACE_GUARD_RETURN. Referenced by _add_ref().
00261 { 00262 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00263 return this->refcount_++; 00264 } |
|
Definition at line 390 of file CEC_ProxyPullConsumer.cpp. References _decr_refcnt().
00391 { 00392 this->_decr_refcnt (); 00393 } |
|
Release the supplier.
Definition at line 253 of file CEC_ProxyPullConsumer.cpp. References supplier_.
00254 { 00255 this->supplier_ = 00256 CosEventComm::PullSupplier::_nil (); 00257 } |
|
The private version (without locking) of is_connected().
Definition at line 8 of file CEC_ProxyPullConsumer.i. References CORBA::is_nil(). Referenced by pull_from_supplier(), supplier_non_existent(), and try_pull_from_supplier().
00009 { 00010 return !CORBA::is_nil (this->supplier_.in ()); 00011 } |
|
Definition at line 150 of file CEC_ProxyPullConsumer.cpp. References ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_TRY, ACE_TRY_CHECK, is_connected_i(), and supplier().
00152 { 00153 CosEventComm::PullSupplier_var supplier; 00154 { 00155 ACE_GUARD_THROW_EX ( 00156 ACE_Lock, ace_mon, *this->lock_, 00157 CORBA::INTERNAL ()); 00158 // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); 00159 ACE_CHECK_RETURN (0); 00160 00161 if (this->is_connected_i () == 0) 00162 return 0; // ACE_THROW (CosEventComm::Disconnected ());???? 00163 00164 supplier = 00165 CosEventComm::PullSupplier::_duplicate (this->supplier_.in ()); 00166 00167 // The refcount cannot be zero, because we have at least two 00168 // references, 00169 } 00170 00171 CORBA::Any_var any; 00172 ACE_TRY 00173 { 00174 any = supplier->pull (ACE_ENV_SINGLE_ARG_PARAMETER); 00175 ACE_TRY_CHECK; 00176 } 00177 ACE_CATCHANY 00178 { 00179 // @@ This is where the policies for misbehaving suppliers 00180 // should kick in.... for the moment just ignore them. 00181 } 00182 ACE_ENDTRY; 00183 return any._retn (); 00184 } |
|
The event channel is shutting down.
Definition at line 219 of file CEC_ProxyPullConsumer.cpp. References ACE_CATCHANY, ACE_CHECK, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_TRY, ACE_TRY_CHECK, CORBA::is_nil(), supplier(), and supplier_.
00220 { 00221 CosEventComm::PullSupplier_var supplier; 00222 00223 { 00224 ACE_GUARD_THROW_EX ( 00225 ACE_Lock, ace_mon, *this->lock_, 00226 CORBA::INTERNAL ()); 00227 // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); 00228 ACE_CHECK; 00229 00230 supplier = this->supplier_._retn (); 00231 } 00232 00233 this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); 00234 ACE_CHECK; 00235 00236 if (CORBA::is_nil (supplier.in ())) 00237 return; 00238 00239 ACE_TRY 00240 { 00241 supplier->disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER); 00242 ACE_TRY_CHECK; 00243 } 00244 ACE_CATCHANY 00245 { 00246 // Ignore exceptions, we must isolate other clients from 00247 // failures on this one. 00248 } 00249 ACE_ENDTRY; 00250 } |
|
Set the supplier, used by some implementations to change the policies used when invoking operations on the supplier. Definition at line 35 of file CEC_ProxyPullConsumer.i. References ACE_GUARD, and supplier_i().
00036 { 00037 ACE_GUARD (ACE_Lock, ace_mon, *this->lock_); 00038 00039 this->supplier_i (supplier); 00040 } |
|
Return the consumer object reference. It returns nil() if it has not connected yet. Definition at line 22 of file CEC_ProxyPullConsumer.i. References ACE_GUARD_RETURN. Referenced by pull_from_supplier(), shutdown(), supplier_non_existent(), and try_pull_from_supplier().
00023 { 00024 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00025 return CosEventComm::PullSupplier::_duplicate (this->supplier_.in ()); 00026 } |
|
Definition at line 29 of file CEC_ProxyPullConsumer.i. References supplier_. Referenced by supplier().
00030 { 00031 this->supplier_ = supplier; 00032 } |
|
Invoke the _non_existent() pseudo-operation on the supplier. If it is disconnected then it returns true and sets the flag. Definition at line 187 of file CEC_ProxyPullConsumer.cpp. References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_THROW_EX, is_connected_i(), CORBA::is_nil(), and supplier().
00190 { 00191 CORBA::Object_var supplier; 00192 { 00193 ACE_GUARD_THROW_EX ( 00194 ACE_Lock, ace_mon, *this->lock_, 00195 CORBA::INTERNAL ()); 00196 ACE_CHECK_RETURN (0); 00197 00198 disconnected = 0; 00199 if (this->is_connected_i () == 0) 00200 { 00201 disconnected = 1; 00202 return 0; 00203 } 00204 if (CORBA::is_nil (this->supplier_.in ())) 00205 { 00206 return 0; 00207 } 00208 supplier = CORBA::Object::_duplicate (this->supplier_.in ()); 00209 } 00210 00211 #if (TAO_HAS_MINIMUM_CORBA == 0) 00212 return supplier->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); 00213 #else 00214 return 0; 00215 #endif /* TAO_HAS_MINIMUM_CORBA */ 00216 } |
|
Pulls from the supplier, verifies that it is connected.
Definition at line 94 of file CEC_ProxyPullConsumer.cpp. References ACE_CATCH, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_GUARD_THROW_EX, ACE_TRY, ACE_TRY_CHECK, is_connected_i(), TAO_CEC_SupplierControl::successful_transmission(), supplier(), TAO_CEC_EventChannel::supplier_control(), TAO_CEC_SupplierControl::supplier_not_exist(), and TAO_CEC_SupplierControl::system_exception().
00097 { 00098 has_event = 0; 00099 CosEventComm::PullSupplier_var supplier; 00100 { 00101 ACE_GUARD_THROW_EX ( 00102 ACE_Lock, ace_mon, *this->lock_, 00103 CORBA::INTERNAL ()); 00104 // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); 00105 ACE_CHECK_RETURN (0); 00106 00107 if (this->is_connected_i () == 0) 00108 return 0; // ACE_THROW (CosEventComm::Disconnected ());???? 00109 00110 supplier = 00111 CosEventComm::PullSupplier::_duplicate (this->supplier_.in ()); 00112 00113 // The refcount cannot be zero, because we have at least two 00114 // references, 00115 } 00116 00117 CORBA::Any_var any; 00118 TAO_CEC_SupplierControl *control = 00119 this->event_channel_->supplier_control (); 00120 00121 ACE_TRY 00122 { 00123 any = supplier->try_pull (has_event ACE_ENV_ARG_PARAMETER); 00124 ACE_TRY_CHECK; 00125 00126 // Inform the control that we got something from the supplier 00127 control->successful_transmission(this); 00128 } 00129 ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) 00130 { 00131 control->supplier_not_exist (this ACE_ENV_ARG_PARAMETER); 00132 ACE_TRY_CHECK; 00133 } 00134 ACE_CATCH (CORBA::SystemException, sysex) 00135 { 00136 control->system_exception (this, 00137 sysex 00138 ACE_ENV_ARG_PARAMETER); 00139 ACE_TRY_CHECK; 00140 } 00141 ACE_CATCHANY 00142 { 00143 // @@ Should not happen 00144 } 00145 ACE_ENDTRY; 00146 return any._retn (); 00147 } |
|
Definition at line 378 of file CEC_ProxyPullConsumer.cpp.
00379 {
00380 return PortableServer::POA::_duplicate (this->default_POA_.in ());
00381 }
|
|
Store the default POA.
Definition at line 135 of file CEC_ProxyPullConsumer.h. |
|
The supplier admin, used for activation and memory managment.
Definition at line 123 of file CEC_ProxyPullConsumer.h. |
|
Return 0 if no supplier is connected...
Definition at line 14 of file CEC_ProxyPullConsumer.i.
00015 { 00016 ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); 00017 00018 return this->is_connected_i (); 00019 } |
|
The locking strategy.
Definition at line 126 of file CEC_ProxyPullConsumer.h. |
|
The reference count.
Definition at line 129 of file CEC_ProxyPullConsumer.h. |
|
The supplier....
Definition at line 132 of file CEC_ProxyPullConsumer.h. Referenced by cleanup_i(), shutdown(), and supplier_i(). |