#include <Trader_Interfaces.h>
Inheritance diagram for TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >:
Public Member Functions | |
TAO_Admin (TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > &trader) | |
~TAO_Admin (void) | |
virtual CORBA::ULong | set_def_search_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_max_search_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_def_match_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_max_match_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_def_return_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_max_return_card (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_max_list (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::Boolean | set_supports_modifiable_properties (CORBA::Boolean value) throw (CORBA::SystemException) |
virtual CORBA::Boolean | set_supports_dynamic_properties (CORBA::Boolean value) throw (CORBA::SystemException) |
virtual CORBA::Boolean | set_supports_proxy_offers (CORBA::Boolean value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_def_hop_count (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CORBA::ULong | set_max_hop_count (CORBA::ULong value) throw (CORBA::SystemException) |
virtual CosTrading::FollowOption | set_def_follow_policy (CosTrading::FollowOption policy) throw (CORBA::SystemException) |
virtual CosTrading::FollowOption | set_max_follow_policy (CosTrading::FollowOption policy) throw (CORBA::SystemException) |
virtual CosTrading::FollowOption | set_max_link_follow_policy (CosTrading::FollowOption policy) throw (CORBA::SystemException) |
virtual CosTrading::TypeRepository_ptr | set_type_repos (CosTrading::TypeRepository_ptr repository) throw (CORBA::SystemException) |
virtual CosTrading::Admin::OctetSeq * | request_id_stem () throw (CORBA::SystemException) |
virtual CosTrading::Admin::OctetSeq * | set_request_id_stem (const CosTrading::Admin::OctetSeq &stem) throw (CORBA::SystemException) |
virtual void | list_offers (CORBA::ULong how_many, CosTrading::OfferIdSeq_out ids, CosTrading::OfferIdIterator_out id_itr) throw (CORBA::SystemException, CosTrading::NotImplemented) |
virtual void | list_proxies (CORBA::ULong, CosTrading::OfferIdSeq_out, CosTrading::OfferIdIterator_out) throw (CORBA::SystemException, CosTrading::NotImplemented) |
Private Member Functions | |
void | operator= (const TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > &) |
TAO_Admin (const TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > &) | |
Private Attributes | |
TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > & | trader_ |
CosTrading::Admin::OctetSeq | stem_id_ |
Unique prefix to create a sequence number space. | |
CORBA::ULong | sequence_number_ |
Current sequence number. | |
TRADER_LOCK_TYPE | lock_ |
DESCRIPTION (FROM SPEC) The admin interface enables the values of the trader attributes to be read and written. All attributes are defined as readonly in either SupportAttributes, ImportAttributes, LinkAttributes, or Admin. To set the trader "attribute" to a new value, set_<attribute_name> operations are defined in Admin. Each of these set operations returns the previous value of the attribute as its function value. If the admin interface operation set_support_proxy_offers is invoked with a value set to FALSE in a trader which supports the proxy interface, the set_support_proxy_offer value does not affect the function of operations in the proxy interface. However, in this case, it does have the effect of making any proxy offers exported via the proxy interface for that trader unavailable to satisfy queries on that trader's lookup interface.
Definition at line 610 of file Trader_Interfaces.h.
|
Definition at line 1287 of file Trader_Interfaces.cpp. References ACE_TCHAR, ACE_INET_Addr::get_ip_address(), ACE_OS::getpid(), ACE_OS::hostname(), pid_t, ACE_OS::rand(), ACE_OS::srand(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::stem_id_, and ACE_OS::time().
01288 : TAO_Trader_Components <POA_CosTrading::Admin> (trader.trading_components ()), 01289 TAO_Support_Attributes <POA_CosTrading::Admin> (trader.support_attributes ()), 01290 TAO_Import_Attributes <POA_CosTrading::Admin> (trader.import_attributes ()), 01291 TAO_Link_Attributes <POA_CosTrading::Admin> (trader.link_attributes ()), 01292 trader_ (trader), 01293 sequence_number_ (0) 01294 { 01295 // A random 4-bytes will prefix the sequence number space for each 01296 // trader, making it extremely unlikely that the sequence spaces for 01297 // two traders will over lap. @@ TODO: This is a bad way to 01298 // generate pseudo random numbers. 01299 01300 // Ok, then, Carlos, we'll do it a different way: ip addr + pid. 01301 ACE_UINT32 ip_addr = 0; 01302 ACE_TCHAR host_name[BUFSIZ]; 01303 01304 if (ACE_OS::hostname (host_name, 01305 BUFSIZ) != -1) 01306 { 01307 ACE_INET_Addr addr ((u_short) 0, host_name); 01308 ip_addr = addr.get_ip_address (); 01309 } 01310 // The better way to do unique stem identifiers. 01311 this->stem_id_.length (12); 01312 01313 if (ip_addr != 0) 01314 { 01315 pid_t pid = ACE_OS::getpid (); 01316 this->stem_id_[0] = static_cast<CORBA::Octet> ((ip_addr >> 24) & 0xff); 01317 this->stem_id_[1] = static_cast<CORBA::Octet> ((ip_addr >> 16) & 0xff); 01318 this->stem_id_[2] = static_cast<CORBA::Octet> ((ip_addr >> 8) & 0xff); 01319 this->stem_id_[3] = static_cast<CORBA::Octet> (ip_addr & 0xff); 01320 this->stem_id_[4] = static_cast<CORBA::Octet> ((pid >> 24) & 0xff); 01321 this->stem_id_[5] = static_cast<CORBA::Octet> ((pid >> 16) & 0xff); 01322 this->stem_id_[6] = static_cast<CORBA::Octet> ((pid >> 8) & 0xff); 01323 this->stem_id_[7] = static_cast<CORBA::Octet> (pid & 0xff); 01324 } 01325 01326 // The default way -- eight random integers. 01327 else 01328 { 01329 time_t time_value = ACE_OS::time (); 01330 ACE_OS::srand (static_cast<u_int> (time_value)); 01331 01332 this->stem_id_[0] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01333 this->stem_id_[1] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01334 this->stem_id_[2] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01335 this->stem_id_[3] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01336 this->stem_id_[4] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01337 this->stem_id_[5] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01338 this->stem_id_[6] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01339 this->stem_id_[7] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01340 } 01341 } |
|
Definition at line 1344 of file Trader_Interfaces.cpp.
01345 { 01346 } |
|
|
|
Definition at line 1609 of file Trader_Interfaces.cpp. References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, CORBA::is_nil(), TAO_Offer_Id_Iterator::next_n(), CosTrading::OfferIdSeq, and TAO_Offer_Database< LOCK_TYPE >::retrieve_all_offer_ids().
01614 { 01615 // This method only applies when the register interface is implemented 01616 if (CORBA::is_nil (this->trader_.trading_components().register_if())) 01617 ACE_THROW (CosTrading::NotImplemented()); 01618 01619 TAO_Offer_Database<MAP_LOCK_TYPE>& type_map = this->trader_.offer_database (); 01620 TAO_Offer_Id_Iterator* offer_id_iter = type_map.retrieve_all_offer_ids (); 01621 01622 id_itr = CosTrading::OfferIdIterator::_nil (); 01623 if (how_many > 0) 01624 { 01625 int check = offer_id_iter->next_n (how_many, ids ACE_ENV_ARG_PARAMETER); 01626 ACE_CHECK; 01627 01628 if (check == 1) 01629 { 01630 id_itr = offer_id_iter->_this (ACE_ENV_SINGLE_ARG_PARAMETER); 01631 ACE_CHECK; 01632 offer_id_iter->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); 01633 ACE_CHECK; 01634 } 01635 else 01636 delete offer_id_iter; 01637 } 01638 else 01639 ids = new CosTrading::OfferIdSeq (0); 01640 } |
|
Definition at line 1645 of file Trader_Interfaces.cpp. References ACE_THROW.
01651 { 01652 ACE_THROW (CosTrading::NotImplemented ()); 01653 } |
|
|
|
Definition at line 1350 of file Trader_Interfaces.cpp. References ACE_GUARD_RETURN, and CosTrading::Admin::OctetSeq.
01352 { 01353 ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 0); 01354 01355 // Add one to the sequence_number and concatenate it to the unique 01356 // prefix. The sequence number is four octets long, the unique 01357 // prefix, also 4 bytes long. 01358 01359 this->stem_id_[8] = static_cast<CORBA::Octet> (this->sequence_number_ & 0xff); 01360 this->stem_id_[9] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 8) & 0xff); 01361 this->stem_id_[10] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 16) & 0xff); 01362 this->stem_id_[11] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 24) & 0xff); 01363 01364 // Increment the sequence number and return a copy of the stem_id. 01365 this->sequence_number_++; 01366 return new CosTrading::Admin::OctetSeq (this->stem_id_); 01367 } |
|
Definition at line 1540 of file Trader_Interfaces.cpp.
|
|
Definition at line 1512 of file Trader_Interfaces.cpp.
|
|
Match card is the cardinality of offers found compliant with the constraints. Definition at line 1400 of file Trader_Interfaces.cpp.
|
|
Return card is the cardinality of the offers returned from Lookup. Definition at line 1428 of file Trader_Interfaces.cpp.
|
|
Search card is the cardinality of the offers searched for constraint compliance. Definition at line 1372 of file Trader_Interfaces.cpp.
|
|
Definition at line 1554 of file Trader_Interfaces.cpp.
|
|
Definition at line 1526 of file Trader_Interfaces.cpp.
|
|
Definition at line 1568 of file Trader_Interfaces.cpp.
|
|
Types of offers available for consideration. Ween out those offers with modifiable properties Definition at line 1456 of file Trader_Interfaces.cpp.
|
|
Definition at line 1414 of file Trader_Interfaces.cpp.
|
|
Definition at line 1442 of file Trader_Interfaces.cpp.
|
|
Definition at line 1386 of file Trader_Interfaces.cpp.
|
|
Definition at line 1596 of file Trader_Interfaces.cpp. References ACE_GUARD_RETURN.
01599 { 01600 ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 01601 &this->stem_id_); 01602 this->stem_id_ = stem; 01603 return &this->stem_id_; 01604 } |
|
Definition at line 1484 of file Trader_Interfaces.cpp.
|
|
Definition at line 1470 of file Trader_Interfaces.cpp.
|
|
Definition at line 1498 of file Trader_Interfaces.cpp.
|
|
Definition at line 1582 of file Trader_Interfaces.cpp.
|
|
Definition at line 755 of file Trader_Interfaces.h. |
|
Current sequence number.
Definition at line 753 of file Trader_Interfaces.h. |
|
Unique prefix to create a sequence number space.
Definition at line 750 of file Trader_Interfaces.h. Referenced by TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TAO_Admin(). |
|
Definition at line 747 of file Trader_Interfaces.h. |