#include <CEC_TypedEventChannel.h>
Collaboration diagram for TAO_CEC_TypedEventChannel:
Public Types | |
typedef ACE_Hash_Map_Manager_Ex< PortableServer::ServantBase *, unsigned int, ServantBaseHash, ACE_Equal_To< PortableServer::ServantBase * >, TAO_SYNCH_MUTEX > | ServantRetryMap |
typedef ACE_Hash_Map_Manager_Ex< const char *, TAO_CEC_Operation_Params *, ACE_Hash< const char * >, ACE_Equal_To< const char * >, ACE_Null_Mutex > | InterfaceDescription |
typedef InterfaceDescription::iterator | Iterator |
Public Member Functions | |
TAO_CEC_TypedEventChannel (const TAO_CEC_TypedEventChannel_Attributes &attributes, TAO_CEC_Factory *factory=0, int own_factory=0) | |
virtual | ~TAO_CEC_TypedEventChannel (void) |
Destructor. | |
virtual void | activate (void) |
virtual void | shutdown (void) |
TAO_CEC_Dispatching * | dispatching (void) const |
Access the dispatching module.... | |
TAO_CEC_TypedConsumerAdmin * | typed_consumer_admin (void) const |
Access the consumer admin implementation. | |
TAO_CEC_TypedSupplierAdmin * | typed_supplier_admin (void) const |
Access the supplier admin implementation. | |
TAO_CEC_ConsumerControl * | consumer_control (void) const |
Access the consumer control strategy. | |
TAO_CEC_SupplierControl * | supplier_control (void) const |
Access the supplier control strategy. | |
void | create_proxy (TAO_CEC_ProxyPushSupplier *&) |
Create and destroy a ProxyPushSupplier. | |
void | destroy_proxy (TAO_CEC_ProxyPushSupplier *) |
void | create_proxy (TAO_CEC_TypedProxyPushConsumer *&) |
Create and destroy a TypedProxyPushConsumer. | |
void | destroy_proxy (TAO_CEC_TypedProxyPushConsumer *) |
void | create_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection *&) |
void | destroy_proxy_collection (TAO_CEC_ProxyPushSupplier_Collection *) |
void | create_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection *&) |
void | destroy_proxy_collection (TAO_CEC_TypedProxyPushConsumer_Collection *) |
PortableServer::POA_ptr | typed_supplier_poa (void) |
Access the supplier and consumer POAs from the factory. | |
PortableServer::POA_ptr | typed_consumer_poa (void) |
ACE_Lock * | create_consumer_lock (void) |
void | destroy_consumer_lock (ACE_Lock *) |
ACE_Lock * | create_supplier_lock (void) |
void | destroy_supplier_lock (ACE_Lock *) |
virtual void | connected (TAO_CEC_TypedProxyPushConsumer *) |
virtual void | reconnected (TAO_CEC_TypedProxyPushConsumer *) |
virtual void | disconnected (TAO_CEC_TypedProxyPushConsumer *) |
virtual void | connected (TAO_CEC_ProxyPushSupplier *) |
virtual void | reconnected (TAO_CEC_ProxyPushSupplier *) |
virtual void | disconnected (TAO_CEC_ProxyPushSupplier *) |
int | consumer_reconnect (void) const |
Can the consumers reconnect to the EC? | |
int | supplier_reconnect (void) const |
Can the suppliers reconnect to the EC? | |
int | disconnect_callbacks (void) const |
TAO_CEC_Operation_Params * | find_from_ifr_cache (const char *operation) |
Finds a operation/parameter from the IFR cache. | |
int | consumer_register_uses_interace (const char *uses_interface) |
Function allows consumer admin to register the uses interface. | |
int | supplier_register_supported_interface (const char *supported_interface) |
Function allows supplier admin to register the supported interface. | |
const char * | supported_interface (void) const |
Function to return the supported_interface_. | |
CORBA::RepositoryId | base_interfaces (CORBA::ULong index) const |
Function to return the base_interfaces_. | |
CORBA::ULong | number_of_base_interfaces (void) const |
Function to return the number of base_interfaces_. | |
virtual void | create_operation_list (TAO_CEC_Operation_Params *oper_params, CORBA::NVList_out new_list) |
Function populates the NVList from the provide param information. | |
virtual void | create_list (CORBA::Long count, CORBA::NVList_out new_list) |
Function creates an empty NVList. | |
virtual ::CosTypedEventChannelAdmin::TypedConsumerAdmin_ptr | for_consumers (void) |
virtual ::CosTypedEventChannelAdmin::TypedSupplierAdmin_ptr | for_suppliers (void) |
virtual void | destroy (void) |
ServantRetryMap & | get_servant_retry_map (void) |
CORBA::Policy_ptr | create_roundtrip_timeout_policy (const ACE_Time_Value &timeout) |
Forwarded to the factory. | |
Protected Member Functions | |
int | cache_interface_description (const char *interface_) |
Function caches the full interface description from the IFR. | |
int | insert_into_ifr_cache (const char *operation, TAO_CEC_Operation_Params *parameters) |
Insert a operation/parameter into the IFR cache. | |
int | clear_ifr_cache (void) |
Function clears the IFR cache. | |
Private Attributes | |
PortableServer::POA_var | typed_supplier_poa_ |
PortableServer::POA_var | typed_consumer_poa_ |
CORBA::ORB_var | orb_ |
The ORB. | |
CORBA::Repository_var | interface_repository_ |
Storage of the IFR reference. | |
TAO_CEC_Factory * | factory_ |
int | own_factory_ |
Flag that indicates if we own the factory. | |
TAO_CEC_Dispatching * | dispatching_ |
The dispatching "module". | |
TAO_CEC_TypedConsumerAdmin * | typed_consumer_admin_ |
The ConsumerAdmin implementation. | |
TAO_CEC_TypedSupplierAdmin * | typed_supplier_admin_ |
The SupplierAdmin implementation. | |
int | consumer_reconnect_ |
Consumer reconnection flags. | |
int | supplier_reconnect_ |
Supplier reconnection flags. | |
int | disconnect_callbacks_ |
If not zero we send callbacks when a proxy is disconnected. | |
int | destroy_on_shutdown_ |
If not zero the event channel is destroyed on shutdown. | |
int | destroyed_ |
Set if the event channel has been destroyed. | |
TAO_CEC_ConsumerControl * | consumer_control_ |
ServantRetryMap | retry_map_ |
TAO_CEC_SupplierControl * | supplier_control_ |
ACE_CString | uses_interface_ |
The uses_interface_ for the TypedConsumerAdmin. | |
ACE_CString | supported_interface_ |
The supported_interface_ for the TypedSupplierAdmin. | |
InterfaceDescription | interface_description_ |
The IFR cache for the interface description. | |
CORBA::RepositoryIdSeq | base_interfaces_ |
The supported_interface_ base interfaces. | |
Classes | |
class | ServantBaseHash |
Definition at line 113 of file CEC_TypedEventChannel.h.
typedef ACE_Hash_Map_Manager_Ex<const char *, TAO_CEC_Operation_Params *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex> TAO_CEC_TypedEventChannel::InterfaceDescription |
Definition at line 219 of file CEC_TypedEventChannel.h.
Definition at line 220 of file CEC_TypedEventChannel.h.
typedef ACE_Hash_Map_Manager_Ex<PortableServer::ServantBase*, unsigned int, ServantBaseHash, ACE_Equal_To<PortableServer::ServantBase*>, TAO_SYNCH_MUTEX> TAO_CEC_TypedEventChannel::ServantRetryMap |
Definition at line 128 of file CEC_TypedEventChannel.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_CEC_TypedEventChannel::TAO_CEC_TypedEventChannel | ( | const TAO_CEC_TypedEventChannel_Attributes & | attributes, | |
TAO_CEC_Factory * | factory = 0 , |
|||
int | own_factory = 0 | |||
) |
Constructor If <own_factory> is not 0 it assumes ownership of the factory. If the factory is <nil> it uses the Service_Configurator to load the Factory, if not found it uses TAO_CEC_Default_Resource_Factory
Definition at line 25 of file CEC_TypedEventChannel.cpp.
References ACE_ASSERT, consumer_control_, TAO_CEC_Factory::create_consumer_admin(), TAO_CEC_Factory::create_consumer_control(), TAO_CEC_Factory::create_dispatching(), TAO_CEC_Factory::create_supplier_admin(), TAO_CEC_Factory::create_supplier_control(), dispatching_, factory_, ACE_Dynamic_Service< TYPE >::instance(), own_factory_, supplier_control_, typed_consumer_admin_, and typed_supplier_admin_.
00028 : typed_supplier_poa_ (PortableServer::POA::_duplicate (attr.typed_supplier_poa)), 00029 typed_consumer_poa_ (PortableServer::POA::_duplicate (attr.typed_consumer_poa)), 00030 orb_ (CORBA::ORB::_duplicate (attr.orb)), 00031 interface_repository_ (CORBA::Repository::_duplicate (attr.interface_repository)), 00032 factory_ (factory), 00033 own_factory_ (own_factory), 00034 consumer_reconnect_ (attr.consumer_reconnect), 00035 supplier_reconnect_ (attr.supplier_reconnect), 00036 disconnect_callbacks_ (attr.disconnect_callbacks), 00037 destroy_on_shutdown_ (attr.destroy_on_shutdown), 00038 destroyed_ (0) 00039 { 00040 if (this->factory_ == 0) 00041 { 00042 this->factory_ = 00043 ACE_Dynamic_Service<TAO_CEC_Factory>::instance ("CEC_Factory"); 00044 this->own_factory_ = 0; 00045 ACE_ASSERT (this->factory_ != 0); 00046 } 00047 00048 this->dispatching_ = 00049 this->factory_->create_dispatching (this); 00050 this->typed_consumer_admin_ = 00051 this->factory_->create_consumer_admin (this); 00052 this->typed_supplier_admin_ = 00053 this->factory_->create_supplier_admin (this); 00054 this->consumer_control_ = 00055 this->factory_->create_consumer_control (this); 00056 this->supplier_control_ = 00057 this->factory_->create_supplier_control (this); 00058 }
TAO_CEC_TypedEventChannel::~TAO_CEC_TypedEventChannel | ( | void | ) | [virtual] |
Destructor.
Definition at line 61 of file CEC_TypedEventChannel.cpp.
References clear_ifr_cache(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close(), TAO_CEC_Factory::destroy_consumer_admin(), TAO_CEC_Factory::destroy_dispatching(), TAO_CEC_Factory::destroy_supplier_admin(), dispatching_, factory_, interface_description_, typed_consumer_admin_, and typed_supplier_admin_.
00062 { 00063 this->clear_ifr_cache (); 00064 this->interface_description_.close (); 00065 00066 this->factory_->destroy_dispatching (this->dispatching_); 00067 this->dispatching_ = 0; 00068 00069 this->factory_->destroy_consumer_admin (this->typed_consumer_admin_); 00070 this->typed_consumer_admin_ = 0; 00071 this->factory_->destroy_supplier_admin (this->typed_supplier_admin_); 00072 this->typed_supplier_admin_ = 0; 00073 00074 if (this->own_factory_) 00075 delete this->factory_; 00076 }
void TAO_CEC_TypedEventChannel::activate | ( | void | ) | [virtual] |
Start the internal threads (if any), etc. After this call the EC can be used.
Definition at line 79 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_SupplierControl::activate(), TAO_CEC_ConsumerControl::activate(), TAO_CEC_Dispatching::activate(), consumer_control_, dispatching_, and supplier_control_.
00080 { 00081 this->dispatching_->activate (); 00082 this->consumer_control_->activate (); 00083 this->supplier_control_->activate (); 00084 }
ACE_INLINE CORBA::RepositoryId TAO_CEC_TypedEventChannel::base_interfaces | ( | CORBA::ULong | index | ) | const |
Function to return the base_interfaces_.
Definition at line 165 of file CEC_TypedEventChannel.inl.
References base_interfaces_.
00166 { 00167 return const_cast <CORBA::RepositoryId>(this->base_interfaces_[index].in ()); 00168 }
int TAO_CEC_TypedEventChannel::cache_interface_description | ( | const char * | interface_ | ) | [protected] |
Function caches the full interface description from the IFR.
Definition at line 251 of file CEC_TypedEventChannel.cpp.
References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, ACE_TEXT(), base_interfaces_, TAO_CEC_Param::direction_, insert_into_ifr_cache(), interface_repository_, CORBA::is_nil(), LM_DEBUG, TAO_CEC_Param::name_, TAO_CEC_Operation_Params::num_params_, TAO_CEC_Operation_Params::parameters_, TAO_debug_level, and TAO_CEC_Param::type_.
Referenced by consumer_register_uses_interace(), and supplier_register_supported_interface().
00252 { 00253 try 00254 { 00255 // Lookup the Interface Name in the IFR 00256 CORBA::Contained_var contained = 00257 this->interface_repository_->lookup_id (interface_); 00258 00259 // Narrow the interface 00260 CORBA::InterfaceDef_var intface = 00261 CORBA::InterfaceDef::_narrow (contained.in ()); 00262 00263 if (CORBA::is_nil (intface.in () )) 00264 { 00265 if (TAO_debug_level >= 10) 00266 { 00267 ACE_DEBUG ((LM_DEBUG, 00268 ACE_TEXT ("***** CORBA::InterfaceDef::_narrow failed for interface %s *****\n"), 00269 interface_)); 00270 } 00271 return -1; 00272 } 00273 else 00274 { 00275 // Obtain the full interface description 00276 CORBA::InterfaceDef::FullInterfaceDescription_var fid = 00277 intface->describe_interface (); 00278 00279 // Obtain the base interfaces 00280 this->base_interfaces_ = fid->base_interfaces; 00281 if (TAO_debug_level >= 10) 00282 { 00283 for (CORBA::ULong base=0; base<fid->base_interfaces.length(); base++) 00284 { 00285 ACE_DEBUG ((LM_DEBUG, 00286 ACE_TEXT ("***** Base interface %s found on interface %s *****\n"), 00287 static_cast<char const*>(fid->base_interfaces[base]), 00288 interface_ )); 00289 } 00290 } 00291 00292 // Obtain the operations 00293 for (CORBA::ULong oper=0; oper<fid->operations.length(); oper++) 00294 { 00295 if (TAO_debug_level >= 10) 00296 { 00297 ACE_DEBUG ((LM_DEBUG, 00298 ACE_TEXT ("***** Operation %s found on interface %s, num params %d *****\n"), 00299 fid->operations[oper].name.in(), 00300 interface_, 00301 fid->operations[oper].parameters.length() )); 00302 } 00303 00304 // Obtain the parameters 00305 CORBA::ULong num_params = fid->operations[oper].parameters.length(); 00306 TAO_CEC_Operation_Params *oper_params = new TAO_CEC_Operation_Params (num_params); 00307 00308 for (CORBA::ULong param=0; param<num_params; param++) 00309 { 00310 oper_params->parameters_[param].name_ = fid->operations[oper].parameters[param].name.in(); 00311 oper_params->parameters_[param].type_ = fid->operations[oper].parameters[param].type; 00312 switch (fid->operations[oper].parameters[param].mode) 00313 { 00314 case CORBA::PARAM_IN: 00315 oper_params->parameters_[param].direction_ = CORBA::ARG_IN; 00316 break; 00317 case CORBA::PARAM_OUT: 00318 oper_params->parameters_[param].direction_ = CORBA::ARG_OUT; 00319 break; 00320 case CORBA::PARAM_INOUT: 00321 oper_params->parameters_[param].direction_ = CORBA::ARG_INOUT; 00322 break; 00323 } 00324 00325 if (TAO_debug_level >= 10) 00326 { 00327 ACE_DEBUG ((LM_DEBUG, 00328 ACE_TEXT ("***** Parameter %s found on operation %s *****\n"), 00329 oper_params->parameters_[param].name_.in(), 00330 fid->operations[oper].name.in() )); 00331 } 00332 } 00333 00334 if (TAO_debug_level >= 10) 00335 { 00336 ACE_DEBUG ((LM_DEBUG, 00337 ACE_TEXT ("***** Adding operation %s with %d parameters to the IFR cache *****\n"), 00338 fid->operations[oper].name.in(), 00339 oper_params->num_params_ )); 00340 } 00341 00342 int result = insert_into_ifr_cache (fid->operations[oper].name.in(), oper_params); 00343 if (result != 0) 00344 { 00345 if (TAO_debug_level >= 10) 00346 { 00347 ACE_DEBUG ((LM_DEBUG, 00348 ACE_TEXT ("***** Adding operation to IFR cache failed *****\n"))); 00349 } 00350 } 00351 } 00352 } 00353 } 00354 catch (const CORBA::SystemException& sysex) 00355 { 00356 if (TAO_debug_level >= 4) 00357 { 00358 sysex._tao_print_exception ( 00359 "during TAO_CEC_TypedEventChannel::cache_interface_description"); 00360 } 00361 return -1; 00362 } 00363 catch (const CORBA::Exception& ex) 00364 { 00365 if (TAO_debug_level >= 4) 00366 { 00367 ex._tao_print_exception ( 00368 "ex raised during TAO_CEC_TypedEventChannel::cache_interface_description"); 00369 } 00370 return -1; 00371 } 00372 return 0; 00373 }
int TAO_CEC_TypedEventChannel::clear_ifr_cache | ( | void | ) | [protected] |
Function clears the IFR cache.
Definition at line 219 of file CEC_TypedEventChannel.cpp.
References ACE_DEBUG, ACE_TEXT(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), interface_description_, LM_DEBUG, CORBA::string_free(), TAO_debug_level, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all().
Referenced by ~TAO_CEC_TypedEventChannel().
00220 { 00221 for (Iterator i = this->interface_description_.begin (); 00222 i != this->interface_description_.end (); 00223 ++i) 00224 { 00225 if (TAO_debug_level >= 10) 00226 { 00227 ACE_DEBUG ((LM_DEBUG, 00228 ACE_TEXT ("***** Destroying operation %s from ifr cache *****\n"), 00229 const_cast<char *> ((*i).ext_id_))); 00230 } 00231 00232 // Deallocate the operation 00233 CORBA::string_free (const_cast<char *> ((*i).ext_id_)); 00234 00235 // Destroy the parameter 00236 delete ((*i).int_id_); 00237 } 00238 00239 int result = this->interface_description_.unbind_all (); 00240 00241 return result; 00242 }
void TAO_CEC_TypedEventChannel::connected | ( | TAO_CEC_ProxyPushSupplier * | ) | [virtual] |
Used to inform the EC that a Supplier has connected or disconnected from it.
Definition at line 163 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedConsumerAdmin::connected(), and typed_consumer_admin_.
00164 { 00165 this->typed_consumer_admin_->connected (supplier); 00166 }
void TAO_CEC_TypedEventChannel::connected | ( | TAO_CEC_TypedProxyPushConsumer * | ) | [virtual] |
Used to inform the EC that a Consumer has connected or disconnected from it.
Definition at line 145 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedSupplierAdmin::connected(), and typed_supplier_admin_.
Referenced by TAO_CEC_TypedProxyPushConsumer::connect_push_supplier().
00146 { 00147 this->typed_supplier_admin_->connected (consumer); 00148 }
ACE_INLINE TAO_CEC_ConsumerControl * TAO_CEC_TypedEventChannel::consumer_control | ( | void | ) | const |
Access the consumer control strategy.
Definition at line 45 of file CEC_TypedEventChannel.inl.
References consumer_control_.
00046 { 00047 return this->consumer_control_; 00048 }
ACE_INLINE int TAO_CEC_TypedEventChannel::consumer_reconnect | ( | void | ) | const |
Can the consumers reconnect to the EC?
Definition at line 141 of file CEC_TypedEventChannel.inl.
References consumer_reconnect_.
00142 { 00143 return this->consumer_reconnect_; 00144 }
int TAO_CEC_TypedEventChannel::consumer_register_uses_interace | ( | const char * | uses_interface | ) |
Function allows consumer admin to register the uses interface.
Definition at line 384 of file CEC_TypedEventChannel.cpp.
References ACE_DEBUG, ACE_TEXT(), cache_interface_description(), LM_DEBUG, TAO_debug_level, and uses_interface_.
Referenced by TAO_CEC_TypedConsumerAdmin::obtain_typed_push_supplier().
00385 { 00386 // Check if a consumer has already registered an interface with the typed EC 00387 if (this->uses_interface_.length() > 0) 00388 { 00389 // Check if the registered uses_interface_ == the new uses_interface 00390 if (this->uses_interface_ == ACE_CString (uses_interface)) 00391 { 00392 return 0; 00393 } 00394 else 00395 { 00396 if (TAO_debug_level >= 10) 00397 { 00398 ACE_DEBUG ((LM_DEBUG, 00399 ACE_TEXT ("***** different uses_interface_ already registered *****\n"))); 00400 } 00401 return -1; 00402 } 00403 } 00404 00405 // Check if a supplier has already registered an inerface with the typed EC 00406 if (this->supported_interface_.length() > 0) 00407 { 00408 // Check if the registered supported_interface_ == the new uses_interface 00409 if (this->supported_interface_ == ACE_CString (uses_interface)) 00410 { 00411 this->uses_interface_ = uses_interface; 00412 return 0; 00413 } 00414 else 00415 { 00416 if (TAO_debug_level >= 10) 00417 { 00418 ACE_DEBUG ((LM_DEBUG, 00419 ACE_TEXT ("***** different supported_interface_ already registered *****\n"))); 00420 } 00421 return -1; 00422 } 00423 } 00424 else 00425 { 00426 // Neither a consumer nor a supplier has connected yet 00427 int result = cache_interface_description (uses_interface); 00428 00429 if (result == 0) 00430 { 00431 this->uses_interface_ = uses_interface; 00432 } 00433 return result; 00434 } 00435 }
ACE_INLINE ACE_Lock * TAO_CEC_TypedEventChannel::create_consumer_lock | ( | void | ) |
Locking strategies for the ProxyPushConsumer and ProxyPushSupplier objects
Definition at line 117 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_consumer_lock(), and factory_.
00118 { 00119 return this->factory_->create_consumer_lock (); 00120 }
void TAO_CEC_TypedEventChannel::create_list | ( | CORBA::Long | count, | |
CORBA::NVList_out | new_list | |||
) | [virtual] |
Function creates an empty NVList.
Definition at line 520 of file CEC_TypedEventChannel.cpp.
References orb_.
Referenced by TAO_CEC_DynamicImplementationServer::invoke(), and TAO_CEC_DynamicImplementationServer::is_a().
00522 { 00523 this->orb_->create_list (count, new_list); 00524 }
void TAO_CEC_TypedEventChannel::create_operation_list | ( | TAO_CEC_Operation_Params * | oper_params, | |
CORBA::NVList_out | new_list | |||
) | [virtual] |
Function populates the NVList from the provide param information.
Definition at line 501 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_Param::direction_, TAO_Pseudo_Var_T< T >::in(), TAO_CEC_Param::name_, TAO_CEC_Operation_Params::num_params_, orb_, TAO_CEC_Operation_Params::parameters_, and TAO_CEC_Param::type_.
Referenced by TAO_CEC_DynamicImplementationServer::invoke().
00503 { 00504 this->orb_->create_list (0, new_list); 00505 00506 for (CORBA::ULong param=0; param<oper_params->num_params_; param++) 00507 { 00508 00509 CORBA::Any any_1; 00510 any_1._tao_set_typecode(oper_params->parameters_[param].type_.in ()); 00511 00512 new_list->add_value (oper_params->parameters_[param].name_. in (), 00513 any_1, 00514 oper_params->parameters_[param].direction_); 00515 } 00516 }
ACE_INLINE void TAO_CEC_TypedEventChannel::create_proxy | ( | TAO_CEC_TypedProxyPushConsumer *& | ) |
Create and destroy a TypedProxyPushConsumer.
Definition at line 69 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_proxy_push_consumer(), and factory_.
00070 { 00071 x = this->factory_->create_proxy_push_consumer (this); 00072 }
ACE_INLINE void TAO_CEC_TypedEventChannel::create_proxy | ( | TAO_CEC_ProxyPushSupplier *& | ) |
Create and destroy a ProxyPushSupplier.
Definition at line 57 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_proxy_push_supplier(), and factory_.
00058 { 00059 x = this->factory_->create_proxy_push_supplier (this); 00060 }
ACE_INLINE void TAO_CEC_TypedEventChannel::create_proxy_collection | ( | TAO_CEC_TypedProxyPushConsumer_Collection *& | ) |
Create and destroy a the collections used to store Proxy*Consumers
Definition at line 93 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_proxy_push_consumer_collection(), and factory_.
00094 { 00095 x = this->factory_->create_proxy_push_consumer_collection (this); 00096 }
ACE_INLINE void TAO_CEC_TypedEventChannel::create_proxy_collection | ( | TAO_CEC_ProxyPushSupplier_Collection *& | ) |
Create and destroy a the collections used to store Proxy*Suppliers
Definition at line 81 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_proxy_push_supplier_collection(), and factory_.
00082 { 00083 x = this->factory_->create_proxy_push_supplier_collection (this); 00084 }
CORBA::Policy_ptr TAO_CEC_TypedEventChannel::create_roundtrip_timeout_policy | ( | const ACE_Time_Value & | timeout | ) |
Forwarded to the factory.
Definition at line 551 of file CEC_TypedEventChannel.cpp.
Referenced by TAO_CEC_TypedProxyPushConsumer::apply_policy().
00552 { 00553 return this->factory_->create_roundtrip_timeout_policy (timeout); 00554 }
ACE_INLINE ACE_Lock * TAO_CEC_TypedEventChannel::create_supplier_lock | ( | void | ) |
Definition at line 129 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::create_supplier_lock(), and factory_.
00130 { 00131 return this->factory_->create_supplier_lock (); 00132 }
void TAO_CEC_TypedEventChannel::destroy | ( | void | ) | [virtual] |
Definition at line 540 of file CEC_TypedEventChannel.cpp.
References destroyed_, and shutdown().
00541 { 00542 if (!destroyed_) 00543 { 00544 destroyed_ = 1; 00545 this->shutdown (); 00546 } 00547 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_consumer_lock | ( | ACE_Lock * | ) |
Definition at line 123 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_consumer_lock(), and factory_.
Referenced by TAO_CEC_TypedProxyPushConsumer::~TAO_CEC_TypedProxyPushConsumer().
00124 { 00125 this->factory_->destroy_consumer_lock (x); 00126 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_proxy | ( | TAO_CEC_TypedProxyPushConsumer * | ) |
Definition at line 75 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_proxy_push_consumer(), and factory_.
00076 { 00077 this->factory_->destroy_proxy_push_consumer (consumer); 00078 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_proxy | ( | TAO_CEC_ProxyPushSupplier * | ) |
Definition at line 63 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_proxy_push_supplier(), and factory_.
Referenced by TAO_CEC_TypedProxyPushConsumer::_decr_refcnt(), and TAO_CEC_TypedProxyPushConsumer_Guard::~TAO_CEC_TypedProxyPushConsumer_Guard().
00064 { 00065 this->factory_->destroy_proxy_push_supplier (supplier); 00066 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_proxy_collection | ( | TAO_CEC_TypedProxyPushConsumer_Collection * | ) |
Definition at line 99 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_proxy_push_consumer_collection(), and factory_.
00100 { 00101 this->factory_->destroy_proxy_push_consumer_collection (x); 00102 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_proxy_collection | ( | TAO_CEC_ProxyPushSupplier_Collection * | ) |
Definition at line 87 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_proxy_push_supplier_collection(), and factory_.
00088 { 00089 this->factory_->destroy_proxy_push_supplier_collection (x); 00090 }
ACE_INLINE void TAO_CEC_TypedEventChannel::destroy_supplier_lock | ( | ACE_Lock * | ) |
Definition at line 135 of file CEC_TypedEventChannel.inl.
References TAO_CEC_Factory::destroy_supplier_lock(), and factory_.
00136 { 00137 this->factory_->destroy_supplier_lock (x); 00138 }
ACE_INLINE int TAO_CEC_TypedEventChannel::disconnect_callbacks | ( | void | ) | const |
Should we send callback disconnect messages when a proxy is disconnected by the client
Definition at line 153 of file CEC_TypedEventChannel.inl.
References disconnect_callbacks_.
00154 { 00155 return this->disconnect_callbacks_; 00156 }
void TAO_CEC_TypedEventChannel::disconnected | ( | TAO_CEC_ProxyPushSupplier * | ) | [virtual] |
Definition at line 175 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedConsumerAdmin::disconnected(), and typed_consumer_admin_.
00176 { 00177 this->typed_consumer_admin_->disconnected (supplier); 00178 }
void TAO_CEC_TypedEventChannel::disconnected | ( | TAO_CEC_TypedProxyPushConsumer * | ) | [virtual] |
Definition at line 157 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedSupplierAdmin::disconnected(), and typed_supplier_admin_.
Referenced by TAO_CEC_TypedProxyPushConsumer::connect_push_supplier(), and TAO_CEC_TypedProxyPushConsumer::disconnect_push_consumer().
00158 { 00159 this->typed_supplier_admin_->disconnected (consumer); 00160 }
ACE_INLINE TAO_CEC_Dispatching * TAO_CEC_TypedEventChannel::dispatching | ( | void | ) | const |
Access the dispatching module....
Definition at line 27 of file CEC_TypedEventChannel.inl.
References dispatching_.
00028 { 00029 return this->dispatching_; 00030 }
TAO_CEC_Operation_Params * TAO_CEC_TypedEventChannel::find_from_ifr_cache | ( | const char * | operation | ) |
Finds a operation/parameter from the IFR cache.
Definition at line 182 of file CEC_TypedEventChannel.cpp.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and interface_description_.
Referenced by TAO_CEC_DynamicImplementationServer::invoke().
00183 { 00184 TAO_CEC_Operation_Params *found = 0; 00185 00186 this->interface_description_.find (operation, found); 00187 00188 return found; 00189 }
CosTypedEventChannelAdmin::TypedConsumerAdmin_ptr TAO_CEC_TypedEventChannel::for_consumers | ( | void | ) |
Definition at line 528 of file CEC_TypedEventChannel.cpp.
References typed_consumer_admin_.
00529 { 00530 return this->typed_consumer_admin_->_this (); 00531 }
CosTypedEventChannelAdmin::TypedSupplierAdmin_ptr TAO_CEC_TypedEventChannel::for_suppliers | ( | void | ) |
Definition at line 534 of file CEC_TypedEventChannel.cpp.
References typed_supplier_admin_.
00535 { 00536 return this->typed_supplier_admin_->_this (); 00537 }
ACE_INLINE TAO_CEC_TypedEventChannel::ServantRetryMap & TAO_CEC_TypedEventChannel::get_servant_retry_map | ( | void | ) |
Definition at line 177 of file CEC_TypedEventChannel.inl.
References retry_map_.
Referenced by TAO_CEC_TypedProxyPushConsumer::~TAO_CEC_TypedProxyPushConsumer().
00178 { 00179 return this->retry_map_; 00180 }
int TAO_CEC_TypedEventChannel::insert_into_ifr_cache | ( | const char * | operation, | |
TAO_CEC_Operation_Params * | parameters | |||
) | [protected] |
Insert a operation/parameter into the IFR cache.
Definition at line 193 of file CEC_TypedEventChannel.cpp.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), interface_description_, and CORBA::string_dup().
Referenced by cache_interface_description().
00195 { 00196 // Make sure that the supplied Object reference is valid, 00197 // i.e. not nil. 00198 if (operation_ == 0 || parameters_ == 0) 00199 { 00200 errno = EINVAL; 00201 return -1; 00202 }; 00203 00204 CORBA::String_var operation = CORBA::string_dup (operation_); 00205 00206 int result = this->interface_description_.bind (operation.in (), parameters_); 00207 00208 if (result == 0) 00209 { 00210 // Transfer ownership to the Object InterfaceDescription map. 00211 (void) operation._retn (); 00212 } 00213 00214 return result; 00215 }
ACE_INLINE CORBA::ULong TAO_CEC_TypedEventChannel::number_of_base_interfaces | ( | void | ) | const |
Function to return the number of base_interfaces_.
Definition at line 171 of file CEC_TypedEventChannel.inl.
References base_interfaces_.
Referenced by TAO_CEC_DynamicImplementationServer::is_a().
00172 { 00173 return this->base_interfaces_.length (); 00174 }
void TAO_CEC_TypedEventChannel::reconnected | ( | TAO_CEC_ProxyPushSupplier * | ) | [virtual] |
Definition at line 169 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedConsumerAdmin::reconnected(), and typed_consumer_admin_.
00170 { 00171 this->typed_consumer_admin_->reconnected (supplier); 00172 }
void TAO_CEC_TypedEventChannel::reconnected | ( | TAO_CEC_TypedProxyPushConsumer * | ) | [virtual] |
Definition at line 151 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedSupplierAdmin::reconnected(), and typed_supplier_admin_.
00152 { 00153 this->typed_supplier_admin_->reconnected (consumer); 00154 }
void TAO_CEC_TypedEventChannel::shutdown | ( | void | ) | [virtual] |
Shutdown any internal threads, cleanup all the internal structures, flush all the messages, etc.
Definition at line 104 of file CEC_TypedEventChannel.cpp.
References TAO_CEC_TypedSupplierAdmin::_default_POA(), TAO_CEC_TypedConsumerAdmin::_default_POA(), ACE_NEW, consumer_control_, destroy_on_shutdown_, dispatching_, orb_, ACE_Reactor::schedule_timer(), TAO_CEC_TypedConsumerAdmin::shutdown(), TAO_CEC_TypedSupplierAdmin::shutdown(), TAO_CEC_ConsumerControl::shutdown(), TAO_CEC_SupplierControl::shutdown(), TAO_CEC_Dispatching::shutdown(), supplier_control_, typed_consumer_admin_, typed_consumer_poa(), typed_supplier_admin_, and typed_supplier_poa().
Referenced by destroy().
00105 { 00106 this->dispatching_->shutdown (); 00107 this->supplier_control_->shutdown (); 00108 this->consumer_control_->shutdown (); 00109 00110 PortableServer::POA_var typed_consumer_poa = 00111 this->typed_consumer_admin_->_default_POA (); 00112 PortableServer::ObjectId_var typed_consumer_id = 00113 typed_consumer_poa->servant_to_id (this->typed_consumer_admin_); 00114 typed_consumer_poa->deactivate_object (typed_consumer_id.in ()); 00115 00116 PortableServer::POA_var typed_supplier_poa = 00117 this->typed_supplier_admin_->_default_POA (); 00118 PortableServer::ObjectId_var typed_supplier_id = 00119 typed_supplier_poa->servant_to_id (this->typed_supplier_admin_); 00120 typed_supplier_poa->deactivate_object (typed_supplier_id.in ()); 00121 00122 this->typed_supplier_admin_->shutdown (); 00123 00124 this->typed_consumer_admin_->shutdown (); 00125 00126 if (destroy_on_shutdown_) 00127 { 00128 // Deactivate the Typed EC 00129 PortableServer::POA_var t_poa = 00130 this->_default_POA (); 00131 00132 PortableServer::ObjectId_var t_id = 00133 t_poa->servant_to_id (this); 00134 00135 t_poa->deactivate_object (t_id.in ()); 00136 00137 ACE_Event_Handler *timer; 00138 ACE_NEW (timer, ShutdownHandler (this->orb_.in ())); 00139 ACE_Reactor *reactor = this->orb_->orb_core ()->reactor (); 00140 reactor->schedule_timer (timer, 0, ACE_Time_Value (1)); 00141 } 00142 }
ACE_INLINE TAO_CEC_SupplierControl * TAO_CEC_TypedEventChannel::supplier_control | ( | void | ) | const |
Access the supplier control strategy.
Definition at line 51 of file CEC_TypedEventChannel.inl.
References supplier_control_.
00052 { 00053 return this->supplier_control_; 00054 }
ACE_INLINE int TAO_CEC_TypedEventChannel::supplier_reconnect | ( | void | ) | const |
Can the suppliers reconnect to the EC?
Definition at line 147 of file CEC_TypedEventChannel.inl.
References supplier_reconnect_.
00148 { 00149 return this->supplier_reconnect_; 00150 }
int TAO_CEC_TypedEventChannel::supplier_register_supported_interface | ( | const char * | supported_interface | ) |
Function allows supplier admin to register the supported interface.
Definition at line 446 of file CEC_TypedEventChannel.cpp.
References ACE_DEBUG, ACE_TEXT(), cache_interface_description(), LM_DEBUG, supported_interface_, and TAO_debug_level.
Referenced by TAO_CEC_TypedSupplierAdmin::obtain_typed_push_consumer().
00447 { 00448 // Check if a supplier has already registered an interface with the typed EC 00449 if (this->supported_interface_.length() > 0) 00450 { 00451 // Check if the registered interface == the new supported_interface 00452 if (this->supported_interface_ == ACE_CString (supported_interface)) 00453 { 00454 return 0; 00455 } 00456 else 00457 { 00458 if (TAO_debug_level >= 10) 00459 { 00460 ACE_DEBUG ((LM_DEBUG, 00461 ACE_TEXT ("***** different supported_interface_ already registered *****\n"))); 00462 } 00463 return -1; 00464 } 00465 } 00466 00467 // Check if a consumer has already registered an inerface with the typed EC 00468 if (this->uses_interface_.length() > 0) 00469 { 00470 // Check if the registered uses_interface_ == the new supported_interface 00471 if (this->uses_interface_ == ACE_CString (supported_interface)) 00472 { 00473 this->supported_interface_ = supported_interface; 00474 return 0; 00475 } 00476 else 00477 { 00478 if (TAO_debug_level >= 10) 00479 { 00480 ACE_DEBUG ((LM_DEBUG, 00481 ACE_TEXT ("***** different uses_interface_ already registered *****\n"))); 00482 } 00483 return -1; 00484 } 00485 } 00486 else 00487 { 00488 // Neither a consumer nor a supplier has connected yet 00489 int result = cache_interface_description (supported_interface); 00490 00491 if (result == 0) 00492 { 00493 this->supported_interface_ = supported_interface; 00494 } 00495 return result; 00496 } 00497 }
ACE_INLINE const char * TAO_CEC_TypedEventChannel::supported_interface | ( | void | ) | const |
Function to return the supported_interface_.
Definition at line 159 of file CEC_TypedEventChannel.inl.
References ACE_String_Base< CHAR >::c_str(), and supported_interface_.
00160 { 00161 return this->supported_interface_.c_str (); 00162 }
ACE_INLINE TAO_CEC_TypedConsumerAdmin * TAO_CEC_TypedEventChannel::typed_consumer_admin | ( | void | ) | const |
Access the consumer admin implementation.
Definition at line 33 of file CEC_TypedEventChannel.inl.
References typed_consumer_admin_.
Referenced by TAO_CEC_TypedProxyPushConsumer::invoke().
00034 { 00035 return this->typed_consumer_admin_; 00036 }
ACE_INLINE PortableServer::POA_ptr TAO_CEC_TypedEventChannel::typed_consumer_poa | ( | void | ) |
Definition at line 111 of file CEC_TypedEventChannel.inl.
Referenced by shutdown(), and TAO_CEC_TypedConsumerAdmin::TAO_CEC_TypedConsumerAdmin().
ACE_INLINE TAO_CEC_TypedSupplierAdmin * TAO_CEC_TypedEventChannel::typed_supplier_admin | ( | void | ) | const |
Access the supplier admin implementation.
Definition at line 39 of file CEC_TypedEventChannel.inl.
References typed_supplier_admin_.
00040 { 00041 return this->typed_supplier_admin_; 00042 }
ACE_INLINE PortableServer::POA_ptr TAO_CEC_TypedEventChannel::typed_supplier_poa | ( | void | ) |
Access the supplier and consumer POAs from the factory.
Definition at line 105 of file CEC_TypedEventChannel.inl.
Referenced by shutdown(), and TAO_CEC_TypedSupplierAdmin::TAO_CEC_TypedSupplierAdmin().
CORBA::RepositoryIdSeq TAO_CEC_TypedEventChannel::base_interfaces_ [private] |
The supported_interface_ base interfaces.
Definition at line 336 of file CEC_TypedEventChannel.h.
Referenced by base_interfaces(), cache_interface_description(), and number_of_base_interfaces().
Strategies to disconnect misbehaving or destroyed consumers and suppliers
Definition at line 321 of file CEC_TypedEventChannel.h.
Referenced by activate(), consumer_control(), shutdown(), and TAO_CEC_TypedEventChannel().
int TAO_CEC_TypedEventChannel::consumer_reconnect_ [private] |
Consumer reconnection flags.
Definition at line 305 of file CEC_TypedEventChannel.h.
Referenced by consumer_reconnect().
int TAO_CEC_TypedEventChannel::destroy_on_shutdown_ [private] |
If not zero the event channel is destroyed on shutdown.
Definition at line 314 of file CEC_TypedEventChannel.h.
Referenced by shutdown().
int TAO_CEC_TypedEventChannel::destroyed_ [private] |
Set if the event channel has been destroyed.
Definition at line 317 of file CEC_TypedEventChannel.h.
Referenced by destroy().
int TAO_CEC_TypedEventChannel::disconnect_callbacks_ [private] |
If not zero we send callbacks when a proxy is disconnected.
Definition at line 311 of file CEC_TypedEventChannel.h.
Referenced by disconnect_callbacks().
The dispatching "module".
Definition at line 296 of file CEC_TypedEventChannel.h.
Referenced by activate(), dispatching(), shutdown(), TAO_CEC_TypedEventChannel(), and ~TAO_CEC_TypedEventChannel().
This is the abstract factory that creates all the objects that compose an event channel, the event channel simply acts as a Mediator among them.
Definition at line 290 of file CEC_TypedEventChannel.h.
Referenced by create_consumer_lock(), create_proxy(), create_proxy_collection(), create_supplier_lock(), destroy_consumer_lock(), destroy_proxy(), destroy_proxy_collection(), destroy_supplier_lock(), TAO_CEC_TypedEventChannel(), and ~TAO_CEC_TypedEventChannel().
The IFR cache for the interface description.
Definition at line 333 of file CEC_TypedEventChannel.h.
Referenced by clear_ifr_cache(), find_from_ifr_cache(), insert_into_ifr_cache(), and ~TAO_CEC_TypedEventChannel().
CORBA::Repository_var TAO_CEC_TypedEventChannel::interface_repository_ [private] |
Storage of the IFR reference.
Definition at line 283 of file CEC_TypedEventChannel.h.
Referenced by cache_interface_description().
The ORB.
Definition at line 280 of file CEC_TypedEventChannel.h.
Referenced by create_list(), create_operation_list(), and shutdown().
int TAO_CEC_TypedEventChannel::own_factory_ [private] |
Flag that indicates if we own the factory.
Definition at line 293 of file CEC_TypedEventChannel.h.
Referenced by TAO_CEC_TypedEventChannel().
Definition at line 324 of file CEC_TypedEventChannel.h.
Referenced by activate(), shutdown(), supplier_control(), and TAO_CEC_TypedEventChannel().
int TAO_CEC_TypedEventChannel::supplier_reconnect_ [private] |
Supplier reconnection flags.
Definition at line 308 of file CEC_TypedEventChannel.h.
Referenced by supplier_reconnect().
The supported_interface_ for the TypedSupplierAdmin.
Definition at line 330 of file CEC_TypedEventChannel.h.
Referenced by supplier_register_supported_interface(), and supported_interface().
The ConsumerAdmin implementation.
Definition at line 299 of file CEC_TypedEventChannel.h.
Referenced by connected(), disconnected(), for_consumers(), reconnected(), shutdown(), TAO_CEC_TypedEventChannel(), typed_consumer_admin(), and ~TAO_CEC_TypedEventChannel().
Definition at line 277 of file CEC_TypedEventChannel.h.
The SupplierAdmin implementation.
Definition at line 302 of file CEC_TypedEventChannel.h.
Referenced by connected(), disconnected(), for_suppliers(), reconnected(), shutdown(), TAO_CEC_TypedEventChannel(), typed_supplier_admin(), and ~TAO_CEC_TypedEventChannel().
The POAs used to activate "supplier-side" and "consumer-side" objects.
Definition at line 276 of file CEC_TypedEventChannel.h.
The uses_interface_ for the TypedConsumerAdmin.
Definition at line 327 of file CEC_TypedEventChannel.h.
Referenced by consumer_register_uses_interace().