00001
00002
00003
00004
00005
00006 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00007
00008 namespace TAO
00009 {
00010 ACE_INLINE int
00011 Transport_Cache_Manager::bind (Cache_ExtId &ext_id,
00012 Cache_IntId &int_id)
00013 {
00014 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00015 guard,
00016 *this->cache_lock_,
00017 -1));
00018
00019 return this->bind_i (ext_id,
00020 int_id);
00021 }
00022
00023 ACE_INLINE int
00024 Transport_Cache_Manager::cache_transport (
00025 TAO_Transport_Descriptor_Interface *prop,
00026 TAO_Transport *transport)
00027 {
00028
00029 Cache_ExtId ext_id (prop);
00030 Cache_IntId int_id (transport);
00031
00032 int retval = 0;
00033 {
00034 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00035 guard,
00036 *this->cache_lock_,
00037 -1));
00038
00039
00040 int_id.recycle_state (ENTRY_BUSY);
00041
00042 retval = this->bind_i (ext_id,
00043 int_id);
00044 }
00045
00046 return retval;
00047 }
00048
00049 ACE_INLINE int
00050 Transport_Cache_Manager::cache_idle_transport (
00051 TAO_Transport_Descriptor_Interface *prop,
00052 TAO_Transport *transport)
00053 {
00054
00055 Cache_ExtId ext_id (prop);
00056 Cache_IntId int_id (transport);
00057
00058 int retval = 0;
00059 {
00060 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00061 guard,
00062 *this->cache_lock_,
00063 -1));
00064
00065
00066 int_id.recycle_state (ENTRY_IDLE_AND_PURGABLE);
00067 retval = this->bind_i (ext_id,
00068 int_id);
00069 }
00070
00071 return retval;
00072 }
00073
00074 ACE_INLINE int
00075 Transport_Cache_Manager::purge_entry (HASH_MAP_ENTRY *&entry)
00076 {
00077
00078 if(entry == 0)
00079 return 0;
00080
00081 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, *this->cache_lock_, -1));
00082
00083 return this->purge_entry_i (entry);
00084 }
00085
00086 ACE_INLINE void
00087 Transport_Cache_Manager::mark_invalid (HASH_MAP_ENTRY *&entry)
00088 {
00089 if(entry == 0)
00090 return;
00091
00092
00093 ACE_MT (ACE_GUARD (ACE_Lock, guard, *this->cache_lock_));
00094
00095 this->mark_invalid_i (entry);
00096 }
00097
00098 ACE_INLINE int
00099 Transport_Cache_Manager::make_idle (HASH_MAP_ENTRY *&entry)
00100 {
00101 if(entry == 0)
00102 return -1;
00103
00104 ACE_MT (ACE_GUARD_RETURN (ACE_Lock, guard, *this->cache_lock_, -1));
00105 return this->make_idle_i (entry);
00106 }
00107
00108 ACE_INLINE int
00109 Transport_Cache_Manager::close (Connection_Handler_Set &handlers)
00110 {
00111
00112
00113
00114
00115 if (this->cache_lock_ == 0)
00116 return -1;
00117
00118 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00119 guard,
00120 *this->cache_lock_,
00121 -1));
00122
00123 return this->close_i (handlers);
00124 }
00125
00126 ACE_INLINE bool
00127 Transport_Cache_Manager::blockable_client_transports (
00128 Connection_Handler_Set &handlers)
00129 {
00130 ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00131 guard,
00132 *this->cache_lock_,
00133 false));
00134
00135 return this->blockable_client_transports_i (handlers);
00136 }
00137
00138 ACE_INLINE size_t
00139 Transport_Cache_Manager::current_size (void) const
00140 {
00141 return this->cache_map_.current_size ();
00142 }
00143
00144 ACE_INLINE size_t
00145 Transport_Cache_Manager::total_size (void) const
00146 {
00147 return this->cache_map_.total_size ();
00148 }
00149
00150 ACE_INLINE Transport_Cache_Manager::HASH_MAP &
00151 Transport_Cache_Manager::map (void)
00152 {
00153 return this->cache_map_;
00154 }
00155 }
00156
00157 TAO_END_VERSIONED_NAMESPACE_DECL