Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Strategies_T.cpp

Go to the documentation of this file.
00001 // $Id: Strategies_T.cpp,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00002 
00003 #ifndef ACE_STRATEGIES_T_C
00004 #define ACE_STRATEGIES_T_C
00005 
00006 #include "ace/Strategies_T.h"
00007 
00008 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00009 # pragma once
00010 #endif /* ACE_LACKS_PRAGMA_ONCE */
00011 
00012 #include "ace/Service_Repository.h"
00013 #include "ace/Synch.h"
00014 #include "ace/Service_Types.h"
00015 #include "ace/Thread_Manager.h"
00016 #include "ace/WFMO_Reactor.h"
00017 
00018 #if defined (ACE_LACKS_INLINE_FUNCTIONS)
00019 #include "ace/Strategies_T.i"
00020 #endif /* ACE_LACKS_INLINE_FUNCTIONS */
00021 
00022 ACE_RCSID(ace, Strategies_T, "$Id: Strategies_T.cpp,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $")
00023 
00024 template <class SVC_HANDLER> int
00025 ACE_Singleton_Strategy<SVC_HANDLER>::open (SVC_HANDLER *sh,
00026                                            ACE_Thread_Manager *)
00027 {
00028   ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::open");
00029 
00030   if (this->delete_svc_handler_
00031       && this->svc_handler_ != 0)
00032     delete this->svc_handler_;
00033 
00034   // If <sh> is NULL then create a new <SVC_HANDLER>.
00035   if (sh == 0)
00036     {
00037       ACE_NEW_RETURN (this->svc_handler_,
00038                       SVC_HANDLER,
00039                       -1);
00040       this->delete_svc_handler_ = 1;
00041     }
00042   else
00043     {
00044       this->svc_handler_ = sh;
00045       this->delete_svc_handler_ = 0;
00046     }
00047 
00048   return 0;
00049 }
00050 
00051 template <class SVC_HANDLER> int
00052 ACE_DLL_Strategy<SVC_HANDLER>::open (const char dll_name[],
00053                                      const char factory_function[],
00054                                      const char svc_name[],
00055                                      ACE_Service_Repository *svc_rep,
00056                                      ACE_Thread_Manager *thr_mgr)
00057 {
00058   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::open");
00059   this->inherited::open (thr_mgr);
00060   ACE_OS::strcpy (this->dll_name_, dll_name);
00061   ACE_OS::strcpy (this->factory_function_, factory_function);
00062   ACE_OS::strcpy (this->svc_name_, svc_name);
00063   this->svc_rep_ = svc_rep;
00064   return 0;
00065 }
00066 
00067 // Create a SVC_HANDLER by dynamically linking it from a DLL.
00068 
00069 template <class SVC_HANDLER> int
00070 ACE_DLL_Strategy<SVC_HANDLER>::make_svc_handler (SVC_HANDLER *&sh)
00071 {
00072   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::make_svc_handler");
00073 
00074   // Open the shared library.
00075   ACE_SHLIB_HANDLE handle = ACE_OS::dlopen (this->dll_name_);
00076 
00077   // Extract the factory function.
00078   SVC_HANDLER *(*factory)(void) =
00079     (SVC_HANDLER *(*)(void)) ACE_OS::dlsym (handle,
00080                                             this->factory_function_);
00081 
00082   // Call the factory function to obtain the new SVC_Handler (should
00083   // use RTTI here when it becomes available...)
00084   SVC_HANDLER *svc_handler;
00085 
00086   ACE_ALLOCATOR_RETURN (svc_handler, (*factory)(), -1);
00087 
00088   if (svc_handler != 0)
00089     {
00090       // Create an ACE_Service_Type containing the SVC_Handler and
00091       // insert into this->svc_rep_;
00092 
00093       ACE_Service_Type_Impl *stp;
00094       ACE_NEW_RETURN (stp,
00095                       ACE_Service_Object_Type (svc_handler,
00096                                                this->svc_name_),
00097                       -1);
00098 
00099       ACE_Service_Type *srp = 0;
00100 
00101       ACE_NEW_RETURN (srp,
00102                       ACE_Service_Type (this->svc_name_,
00103                                         stp,
00104                                         handle,
00105                                         1),
00106                       -1);
00107       if (srp == 0)
00108         {
00109           delete stp;
00110           errno = ENOMEM;
00111           return -1;
00112         }
00113 
00114       if (this->svc_rep_->insert (srp) == -1)
00115         return -1;
00116       // @@ Somehow, we need to deal with this->thr_mgr_...
00117     }
00118 
00119   sh = svc_handler;
00120   return 0;
00121 }
00122 
00123 // Default behavior is to activate the SVC_HANDLER by calling it's
00124 // open() method, which allows the SVC_HANDLER to determine its own
00125 // concurrency strategy.
00126 
00127 template <class SVC_HANDLER> int
00128 ACE_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler,
00129                                                              void *arg)
00130 {
00131   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler");
00132 
00133   int result = 0;
00134 
00135   // See if we should enable non-blocking I/O on the <svc_handler>'s
00136   // peer.
00137   if (ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK) != 0)
00138     {
00139       if (svc_handler->peer ().enable (ACE_NONBLOCK) == -1)
00140         result = -1;
00141     }
00142   // Otherwise, make sure it's disabled by default.
00143   else if (svc_handler->peer ().disable (ACE_NONBLOCK) == -1)
00144     result = -1;
00145 
00146   if (result == 0 && svc_handler->open (arg) == -1)
00147     result = -1;
00148 
00149   if (result == -1)
00150     svc_handler->close (0);
00151 
00152   return result;
00153 }
00154 
00155 template <class SVC_HANDLER> int
00156 ACE_Reactive_Strategy<SVC_HANDLER>::open (ACE_Reactor *reactor,
00157                                           ACE_Reactor_Mask mask,
00158                                           int flags)
00159 {
00160   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::open");
00161   this->reactor_ = reactor;
00162   this->mask_ = mask;
00163   this->flags_ = flags;
00164 
00165   // Must have a <Reactor>
00166   if (this->reactor_ == 0)
00167     return -1;
00168   else
00169     return 0;
00170 }
00171 
00172 template <class SVC_HANDLER> int
00173 ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler,
00174                                                           void *arg)
00175 {
00176   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
00177 
00178   int result = 0;
00179 
00180   if (this->reactor_ == 0)
00181     result = -1;
00182 
00183   // Register with the Reactor with the appropriate <mask>.
00184   else if (this->reactor_->register_handler (svc_handler, this->mask_) == -1)
00185     result = -1;
00186 
00187   // If the implementation of the reactor uses event associations
00188   else if (this->reactor_->uses_event_associations ())
00189     {
00190       // If we don't have non-block on, it won't work with
00191       // WFMO_Reactor
00192       // This maybe too harsh
00193       // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
00194       // goto failure;
00195       if (svc_handler->open (arg) != -1)
00196         return 0;
00197       else
00198         result = -1;
00199     }
00200   else
00201     // Call up to our parent to do the SVC_HANDLER initialization.
00202     return this->inherited::activate_svc_handler (svc_handler, arg);
00203 
00204   if (result == -1)
00205     svc_handler->close (0);
00206 
00207   return result;
00208 }
00209 
00210 template <class SVC_HANDLER> int
00211 ACE_Thread_Strategy<SVC_HANDLER>::open (ACE_Thread_Manager *thr_mgr,
00212                                         long thr_flags,
00213                                         int n_threads,
00214                                         int flags)
00215 {
00216   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::open");
00217   this->thr_mgr_ = thr_mgr;
00218   this->n_threads_ = n_threads;
00219   this->thr_flags_ = thr_flags;
00220   this->flags_ = flags;
00221 
00222   // Must have a thread manager!
00223   if (this->thr_mgr_ == 0)
00224     ACE_ERROR_RETURN ((LM_ERROR,
00225                        ACE_LIB_TEXT ("error: must have a non-NULL thread manager\n")),
00226                       -1);
00227   else
00228     return 0;
00229 }
00230 
00231 template <class SVC_HANDLER> int
00232 ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler,
00233                                                         void *arg)
00234 {
00235   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler");
00236   // Call up to our parent to do the SVC_HANDLER initialization.
00237   if (this->inherited::activate_svc_handler (svc_handler,
00238                                              arg) == -1)
00239     return -1;
00240   else
00241     // Turn the <svc_handler> into an active object (if it isn't
00242     // already one as a result of the first activation...)
00243     return svc_handler->activate (this->thr_flags_,
00244                                   this->n_threads_);
00245 }
00246 
00247 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
00248 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
00249   (const ACE_PEER_ACCEPTOR_ADDR &local_addr, int reuse_addr)
00250 {
00251   this->reuse_addr_ = reuse_addr;
00252   this->peer_acceptor_addr_ = local_addr;
00253   if (this->peer_acceptor_.open (local_addr,
00254                                  reuse_addr) == -1)
00255     return -1;
00256 
00257   // Set the peer acceptor's handle into non-blocking mode.  This is a
00258   // safe-guard against the race condition that can otherwise occur
00259   // between the time when <select> indicates that a passive-mode
00260   // socket handle is "ready" and when we call <accept>.  During this
00261   // interval, the client can shutdown the connection, in which case,
00262   // the <accept> call can hang!
00263   this->peer_acceptor_.enable (ACE_NONBLOCK);
00264   return 0;
00265 }
00266 
00267 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
00268 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy
00269   (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
00270    int reuse_addr,
00271    ACE_Reactor *reactor)
00272     : reactor_ (reactor)
00273 {
00274   ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy");
00275 
00276   if (this->open (local_addr, reuse_addr) == -1)
00277     ACE_ERROR ((LM_ERROR,
00278                 ACE_LIB_TEXT ("%p\n"),
00279                 ACE_LIB_TEXT ("open")));
00280 }
00281 
00282 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
00283 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler
00284   (SVC_HANDLER *svc_handler)
00285 {
00286   ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler");
00287 
00288   // Try to find out if the implementation of the reactor that we are
00289   // using requires us to reset the event association for the newly
00290   // created handle. This is because the newly created handle will
00291   // inherit the properties of the listen handle, including its event
00292   // associations.
00293   int reset_new_handle = this->reactor_->uses_event_associations ();
00294 
00295   if (this->peer_acceptor_.accept (svc_handler->peer (), // stream
00296                                    0, // remote address
00297                                    0, // timeout
00298                                    1, // restart
00299                                    reset_new_handle  // reset new handler
00300                                    ) == -1)
00301     {
00302       // Close down handler to avoid memory leaks.
00303       svc_handler->close (0);
00304 
00305       return -1;
00306     }
00307   else
00308     return 0;
00309 }
00310 
00311 template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> int
00312 ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler
00313 (SVC_HANDLER *&sh,
00314  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00315  ACE_Time_Value *timeout,
00316  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00317  int reuse_addr,
00318  int flags,
00319  int perms)
00320 {
00321   ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler");
00322 
00323   return this->connector_.connect (sh->peer (),
00324                                    remote_addr,
00325                                    timeout,
00326                                    local_addr,
00327                                    reuse_addr,
00328                                    flags,
00329                                    perms);
00330 }
00331 
00332 template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> int
00333 ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler
00334 (SVC_HANDLER *&sh,
00335  SVC_HANDLER *&sh_copy,
00336  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00337  ACE_Time_Value *timeout,
00338  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00339  int reuse_addr,
00340  int flags,
00341  int perms)
00342 {
00343   ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler");
00344 
00345   int result =
00346     this->connector_.connect (sh->peer (),
00347                               remote_addr,
00348                               timeout,
00349                               local_addr,
00350                               reuse_addr,
00351                               flags,
00352                               perms);
00353   sh_copy = sh;
00354   return result;
00355 }
00356 
00357 template <class SVC_HANDLER> int
00358 ACE_Process_Strategy<SVC_HANDLER>::open (size_t n_processes,
00359                                          ACE_Event_Handler *acceptor,
00360                                          ACE_Reactor *reactor,
00361                                          int avoid_zombies)
00362 {
00363   ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::open");
00364   this->n_processes_ = n_processes;
00365   this->acceptor_ = acceptor;
00366   this->reactor_ = reactor;
00367   this->flags_ = avoid_zombies;
00368 
00369   return 0;
00370 }
00371 
00372 template <class SVC_HANDLER> int
00373 ACE_Process_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *svc_handler,
00374                                                          void *arg)
00375 {
00376   ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::activate_svc_handler");
00377 
00378   // If <flags_> is non-0 then we won't create zombies.
00379   switch (ACE::fork (ACE_LIB_TEXT ("child"), this->flags_))
00380     {
00381     case -1:
00382       svc_handler->destroy ();
00383       ACE_ERROR_RETURN ((LM_ERROR,
00384                          ACE_LIB_TEXT ("%p\n"),
00385                          ACE_LIB_TEXT ("fork")),
00386                         -1);
00387       /* NOTREACHED */
00388     case 0: // In child process.
00389 
00390       // Close down the SOCK_Acceptor's handle since we don't need to
00391       // keep it open.
00392       if (this->acceptor_ != 0)
00393         // Ignore the return value here...
00394         (void) this->reactor_->remove_handler (this->acceptor_,
00395                                                ACE_Event_Handler::ACCEPT_MASK);
00396 
00397       // Call up to our ancestor in the inheritance to do the
00398       // SVC_HANDLER initialization.
00399       return this->inherited::activate_svc_handler (svc_handler, arg);
00400       /* NOTREACHED */
00401     default: // In parent process.
00402       // We need to close down the <SVC_HANDLER> here because it's
00403       // running in the child.
00404       svc_handler->destroy ();
00405       return 0;
00406     }
00407 }
00408 
00409 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX>
00410 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::ACE_Cached_Connect_Strategy
00411 (ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
00412  ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
00413  ACE_Recycling_Strategy<SVC_HANDLER> *rec_s,
00414  MUTEX *lock,
00415  int delete_lock)
00416   : lock_ (lock),
00417     delete_lock_ (delete_lock),
00418     reverse_lock_ (0),
00419     creation_strategy_ (0),
00420     delete_creation_strategy_ (0),
00421     concurrency_strategy_ (0),
00422     delete_concurrency_strategy_ (0),
00423     recycling_strategy_ (0),
00424     delete_recycling_strategy_ (0)
00425 {
00426   // Create a new lock if necessary.
00427   if (this->lock_ == 0)
00428     {
00429       ACE_NEW (this->lock_,
00430                MUTEX);
00431 
00432       this->delete_lock_ = 1;
00433     }
00434 
00435   ACE_NEW (this->reverse_lock_,
00436            REVERSE_MUTEX (*this->lock_));
00437 
00438   if (this->open (cre_s,
00439                   con_s,
00440                   rec_s) == -1)
00441     ACE_ERROR ((LM_ERROR,
00442                 ACE_LIB_TEXT ("%p\n"),
00443                 ACE_LIB_TEXT ("ACE_Cached_Connect_Strategy::ACE_Cached_Connect_Strategy")));
00444 }
00445 
00446 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX>
00447 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::~ACE_Cached_Connect_Strategy (void)
00448 {
00449   if (this->delete_lock_)
00450     delete this->lock_;
00451 
00452   delete this->reverse_lock_;
00453 
00454   if (this->delete_creation_strategy_)
00455     delete this->creation_strategy_;
00456   this->delete_creation_strategy_ = 0;
00457   this->creation_strategy_ = 0;
00458 
00459   if (this->delete_concurrency_strategy_)
00460     delete this->concurrency_strategy_;
00461   this->delete_concurrency_strategy_ = 0;
00462   this->concurrency_strategy_ = 0;
00463 
00464   if (this->delete_recycling_strategy_)
00465     delete this->recycling_strategy_;
00466   this->delete_recycling_strategy_ = 0;
00467   this->recycling_strategy_ = 0;
00468 
00469   // Close down all cached service handlers.
00470   CONNECTION_MAP_ENTRY *entry;
00471   for (CONNECTION_MAP_ITERATOR iterator (connection_map_);
00472        iterator.next (entry);
00473        iterator.advance ())
00474     {
00475       entry->int_id_->recycler (0, 0);
00476       entry->int_id_->close ();
00477     }
00478 }
00479 
00480 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00481 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::open
00482 (ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
00483  ACE_Concurrency_Strategy<SVC_HANDLER> *con_s,
00484  ACE_Recycling_Strategy<SVC_HANDLER> *rec_s)
00485 {
00486   // Initialize the creation strategy.
00487 
00488   // First we decide if we need to clean up.
00489   if (this->creation_strategy_ != 0 &&
00490       this->delete_creation_strategy_ != 0 &&
00491       cre_s != 0)
00492     {
00493       delete this->creation_strategy_;
00494       this->creation_strategy_ = 0;
00495       this->delete_creation_strategy_ = 0;
00496     }
00497 
00498   if (cre_s != 0)
00499     this->creation_strategy_ = cre_s;
00500   else if (this->creation_strategy_ == 0)
00501     {
00502       ACE_NEW_RETURN (this->creation_strategy_,
00503                       CREATION_STRATEGY, -1);
00504       this->delete_creation_strategy_ = 1;
00505     }
00506 
00507   // Initialize the concurrency strategy.
00508 
00509   if (this->concurrency_strategy_ != 0 &&
00510       this->delete_concurrency_strategy_ != 0 &&
00511       con_s != 0)
00512     {
00513       delete this->concurrency_strategy_;
00514       this->concurrency_strategy_ = 0;
00515       this->delete_concurrency_strategy_ = 0;
00516     }
00517 
00518   if (con_s != 0)
00519     this->concurrency_strategy_ = con_s;
00520   else if (this->concurrency_strategy_ == 0)
00521     {
00522       ACE_NEW_RETURN (this->concurrency_strategy_,
00523                       CONCURRENCY_STRATEGY, -1);
00524       this->delete_concurrency_strategy_ = 1;
00525     }
00526 
00527   // Initialize the recycling strategy.
00528 
00529   if (this->recycling_strategy_ != 0 &&
00530       this->delete_recycling_strategy_ != 0 &&
00531       rec_s != 0)
00532     {
00533       delete this->recycling_strategy_;
00534       this->recycling_strategy_ = 0;
00535       this->delete_recycling_strategy_ = 0;
00536     }
00537 
00538   if (rec_s != 0)
00539     this->recycling_strategy_ = rec_s;
00540   else if (this->recycling_strategy_ == 0)
00541     {
00542       ACE_NEW_RETURN (this->recycling_strategy_,
00543                       RECYCLING_STRATEGY, -1);
00544       this->delete_recycling_strategy_ = 1;
00545     }
00546 
00547   return 0;
00548 }
00549 
00550 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00551 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::check_hint_i
00552 (SVC_HANDLER *&sh,
00553  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00554  ACE_Time_Value *timeout,
00555  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00556  int reuse_addr,
00557  int flags,
00558  int perms,
00559  ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry,
00560  int &found)
00561 {
00562   ACE_UNUSED_ARG (remote_addr);
00563   ACE_UNUSED_ARG (timeout);
00564   ACE_UNUSED_ARG (local_addr);
00565   ACE_UNUSED_ARG (reuse_addr);
00566   ACE_UNUSED_ARG (flags);
00567   ACE_UNUSED_ARG (perms);
00568 
00569   found = 0;
00570 
00571   // Get the recycling act for the svc_handler
00572   CONNECTION_MAP_ENTRY *possible_entry = (CONNECTION_MAP_ENTRY *) sh->recycling_act ();
00573 
00574   // Check to see if the hint svc_handler has been closed down
00575   if (possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED)
00576     {
00577       // If close, decrement refcount
00578       if (possible_entry->ext_id_.decrement () == 0)
00579         {
00580           // If refcount goes to zero, close down the svc_handler
00581           possible_entry->int_id_->recycler (0, 0);
00582           possible_entry->int_id_->close ();
00583           this->purge_i (possible_entry);
00584         }
00585 
00586       // Hint not successful
00587       found = 0;
00588 
00589       // Reset hint
00590       sh = 0;
00591     }
00592 
00593   // If hint is not closed, see if it is connected to the correct
00594   // address and is recyclable
00595   else if ((possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE ||
00596             possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) &&
00597            possible_entry->ext_id_.subject () == remote_addr)
00598     {
00599       // Hint successful
00600       found = 1;
00601 
00602       // Tell the <svc_handler> that it should prepare itself for
00603       // being recycled.
00604       this->prepare_for_recycling (sh);
00605     }
00606   else
00607     {
00608       // This hint will not be used.
00609       possible_entry->ext_id_.decrement ();
00610 
00611       // Hint not successful
00612       found = 0;
00613 
00614       // If <sh> is not connected to the correct address or is busy,
00615       // we will not use it.
00616       sh = 0;
00617     }
00618 
00619   if (found)
00620     entry = possible_entry;
00621 
00622   return 0;
00623 }
00624 
00625 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00626 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::find_or_create_svc_handler_i
00627 (SVC_HANDLER *&sh,
00628  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00629  ACE_Time_Value *timeout,
00630  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00631  int reuse_addr,
00632  int flags,
00633  int perms,
00634  ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry,
00635  int &found)
00636 {
00637   // Explicit type conversion
00638   REFCOUNTED_HASH_RECYCLABLE_ADDRESS search_addr (remote_addr);
00639 
00640   // Try to find the address in the cache.  Only if we don't find it
00641   // do we create a new <SVC_HANDLER> and connect it with the server.
00642   if (this->find (search_addr, entry) == -1)
00643     {
00644       // Set the flag
00645       found = 0;
00646 
00647       // We need to use a temporary variable here since we are not
00648       // allowed to change <sh> because other threads may use this
00649       // when we let go of the lock during the OS level connect.
00650       //
00651       // Note that making a new svc_handler, connecting remotely,
00652       // binding to the map, and assigning of the hint and recycler
00653       // should be atomic to the outside world.
00654       SVC_HANDLER *potential_handler = 0;
00655 
00656       // Create a new svc_handler
00657       if (this->make_svc_handler (potential_handler) == -1)
00658         return -1;
00659 
00660       // Actively establish the connection.  This is a timed blocking
00661       // connect.
00662       if (this->new_connection (potential_handler,
00663                                 remote_addr,
00664                                 timeout,
00665                                 local_addr,
00666                                 reuse_addr,
00667                                 flags,
00668                                 perms) == -1)
00669         {
00670           // If connect() failed because of timeouts, we have to
00671           // reject the connection entirely. This is necessary since
00672           // currently there is no way for the non-blocking connects
00673           // to complete and for the <Connector> to notify the cache
00674           // of the completion of connect().
00675           if (errno == EWOULDBLOCK)
00676             errno = ENOTSUP;
00677 
00678           // Close the svc handler.
00679           potential_handler->close (0);
00680 
00681           return -1;
00682         }
00683       else
00684         {
00685           // Insert the new SVC_HANDLER instance into the cache.
00686           if (this->connection_map_.bind (search_addr,
00687                                           potential_handler,
00688                                           entry) == -1)
00689             {
00690               // Close the svc handler.
00691               potential_handler->close (0);
00692 
00693               return -1;
00694             }
00695 
00696           // Everything succeeded as planned. Assign <sh> to <potential_handler>.
00697           sh = potential_handler;
00698 
00699           // Set the recycler and the recycling act
00700           this->assign_recycler (sh, this, entry);
00701         }
00702     }
00703   else
00704     // We found a cached svc_handler.
00705     {
00706       // Set the flag
00707       found = 1;
00708 
00709       // Get the cached <svc_handler>
00710       sh = entry->int_id_;
00711 
00712       // Tell the <svc_handler> that it should prepare itself for
00713       // being recycled.
00714       this->prepare_for_recycling (sh);
00715     }
00716 
00717   return 0;
00718 }
00719 
00720 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00721 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::new_connection
00722 (SVC_HANDLER *&sh,
00723  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00724  ACE_Time_Value *timeout,
00725  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00726  int reuse_addr,
00727  int flags,
00728  int perms)
00729 {
00730   // Yow, Reverse Guard!  Let go of the lock for the duration of the
00731   // actual connect.  This will allow other threads to hack on the
00732   // connection cache while this thread creates the new connection.
00733   ACE_GUARD_RETURN (REVERSE_MUTEX, ace_mon, *this->reverse_lock_, -1);
00734 
00735   return this->CONNECT_STRATEGY::connect_svc_handler (sh,
00736                                                       remote_addr,
00737                                                       timeout,
00738                                                       local_addr,
00739                                                       reuse_addr,
00740                                                       flags,
00741                                                       perms);
00742 }
00743 
00744 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00745 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::connect_svc_handler
00746 (SVC_HANDLER *&sh,
00747  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00748  ACE_Time_Value *timeout,
00749  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00750  int reuse_addr,
00751  int flags,
00752  int perms)
00753 {
00754   int found = 0;
00755 
00756   // This artificial scope is required since we need to let go of the
00757   // lock *before* registering the newly created handler with the
00758   // Reactor.
00759   {
00760     // Synchronization is required here as the setting of the
00761     // recyclable state must be done atomically with the finding and
00762     // binding of the service handler in the cache.
00763     ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00764 
00765     int result = this->connect_svc_handler_i (sh,
00766                                               remote_addr,
00767                                               timeout,
00768                                               local_addr,
00769                                               reuse_addr,
00770                                               flags,
00771                                               perms,
00772                                               found);
00773     if (result != 0)
00774       return result;
00775 
00776   }
00777 
00778   // If it is a new connection, activate it.
00779   //
00780   // Note: This activation is outside the scope of the lock of the
00781   // cached connector.  This is necessary to avoid subtle deadlock
00782   // conditions with this lock and the Reactor lock.
00783 
00784   if (!found)
00785     {
00786       if (this->activate_svc_handler (sh) == -1)
00787         {
00788           // If an error occurs while activating the handler, the
00789           // <activate_svc_handler> method will close the handler.
00790           // This in turn will remove this entry from the internal
00791           // table.
00792 
00793           // Synchronization is required here as the setting of the
00794           // handler to zero must be done atomically with the users of
00795           // the cache.
00796           ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00797 
00798           // Reset handler.
00799           sh = 0;
00800 
00801           return -1;
00802         }
00803     }
00804 
00805   return 0;
00806 }
00807 
00808 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00809 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::connect_svc_handler
00810 (SVC_HANDLER *&sh,
00811  SVC_HANDLER *&sh_copy,
00812  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00813  ACE_Time_Value *timeout,
00814  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00815  int reuse_addr,
00816  int flags,
00817  int perms)
00818 {
00819   int found = 0;
00820 
00821   // This artificial scope is required since we need to let go of the
00822   // lock *before* registering the newly created handler with the
00823   // Reactor.
00824   {
00825     // Synchronization is required here as the setting of the
00826     // recyclable state must be done atomically with the finding and
00827     // binding of the service handler in the cache.
00828     ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00829 
00830     int result = this->connect_svc_handler_i (sh,
00831                                               remote_addr,
00832                                               timeout,
00833                                               local_addr,
00834                                               reuse_addr,
00835                                               flags,
00836                                               perms,
00837                                               found);
00838     sh_copy = sh;
00839 
00840     if (result != 0)
00841       return result;
00842 
00843   }
00844 
00845   // If it is a new connection, activate it.
00846   //
00847   // Note: This activation is outside the scope of the lock of the
00848   // cached connector.  This is necessary to avoid subtle deadlock
00849   // conditions with this lock and the Reactor lock.
00850 
00851   if (!found)
00852     {
00853       if (this->activate_svc_handler (sh_copy) == -1)
00854         {
00855           // If an error occurs while activating the handler, the
00856           // <activate_svc_handler> method will close the handler.
00857           // This in turn will remove this entry from the internal
00858           // table.
00859 
00860           // Synchronization is required here as the setting of the
00861           // handler to zero must be done atomically with the users of
00862           // the cache.
00863           ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00864 
00865           // Reset handler.
00866           sh = 0;
00867           sh_copy = 0;
00868 
00869           return -1;
00870         }
00871     }
00872 
00873   return 0;
00874 }
00875 
00876 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00877 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::connect_svc_handler_i
00878 (SVC_HANDLER *&sh,
00879  const ACE_PEER_CONNECTOR_ADDR &remote_addr,
00880  ACE_Time_Value *timeout,
00881  const ACE_PEER_CONNECTOR_ADDR &local_addr,
00882  int reuse_addr,
00883  int flags,
00884  int perms,
00885  int& found)
00886 {
00887   CONNECTION_MAP_ENTRY *entry = 0;
00888 
00889   // Check if the user passed a hint svc_handler
00890   if (sh != 0)
00891     {
00892       int result = this->check_hint_i (sh,
00893                                        remote_addr,
00894                                        timeout,
00895                                        local_addr,
00896                                        reuse_addr,
00897                                        flags,
00898                                        perms,
00899                                        entry,
00900                                        found);
00901       if (result != 0)
00902         return result;
00903     }
00904 
00905   // If not found
00906   if (!found)
00907     {
00908       int result = this->find_or_create_svc_handler_i (sh,
00909                                                        remote_addr,
00910                                                        timeout,
00911                                                        local_addr,
00912                                                        reuse_addr,
00913                                                        flags,
00914                                                        perms,
00915                                                        entry,
00916                                                        found);
00917       if (result != 0)
00918         return result;
00919     }
00920 
00921   // For all successful cases: mark the <svc_handler> in the cache
00922   // as being <in_use>.  Therefore recyclable is BUSY.
00923   entry->ext_id_.recycle_state (ACE_RECYCLABLE_BUSY);
00924 
00925   // And increment the refcount
00926   entry->ext_id_.increment ();
00927 
00928   return 0;
00929 }
00930 
00931 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00932 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cache (const void *recycling_act)
00933 {
00934   // Synchronization is required here as the setting of the recyclable
00935   // state must be done atomically with respect to other threads that
00936   // are querying the cache.
00937   ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00938 
00939   return this->cache_i (recycling_act);
00940 }
00941 
00942 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00943 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cache_i (const void *recycling_act)
00944 {
00945   // The wonders and perils of ACT
00946   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
00947 
00948   // Mark the <svc_handler> in the cache as not being <in_use>.
00949   // Therefore recyclable is IDLE.
00950   entry->ext_id_.recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE);
00951 
00952   return 0;
00953 }
00954 
00955 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00956 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state (const void *recycling_act,
00957                                                                                       ACE_Recyclable_State new_state)
00958 {
00959   // Synchronization is required here as the setting of the recyclable
00960   // state must be done atomically with respect to other threads that
00961   // are querying the cache.
00962   ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
00963 
00964   return this->recycle_state_i (recycling_act,
00965                                 new_state);
00966 }
00967 
00968 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
00969 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state_i (const void *recycling_act,
00970                                                                                         ACE_Recyclable_State new_state)
00971 {
00972   // The wonders and perils of ACT
00973   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
00974 
00975   // Mark the <svc_handler> in the cache as not being <in_use>.
00976   // Therefore recyclable is IDLE.
00977   entry->ext_id_.recycle_state (new_state);
00978 
00979   return 0;
00980 }
00981 
00982 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Recyclable_State
00983 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state (const void *recycling_act) const
00984 {
00985   // Const cast.
00986   SELF *fake_this = ACE_const_cast (SELF *, this);
00987 
00988   // Synchronization is required here.
00989   ACE_GUARD_RETURN (MUTEX, ace_mon, *fake_this->lock_, ACE_RECYCLABLE_UNKNOWN);
00990 
00991   return this->recycle_state_i (recycling_act);
00992 }
00993 
00994 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Recyclable_State
00995 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycle_state_i (const void *recycling_act) const
00996 {
00997   // The wonders and perils of ACT
00998   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
00999 
01000   // Mark the <svc_handler> in the cache as not being <in_use>.
01001   // Therefore recyclable is IDLE.
01002   return entry->ext_id_.recycle_state ();
01003 }
01004 
01005 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01006 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::purge (const void *recycling_act)
01007 {
01008   // Excluded other threads from changing cache while we take this
01009   // entry out.
01010   ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
01011 
01012   return this->purge_i (recycling_act);
01013 }
01014 
01015 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01016 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::purge_i (const void *recycling_act)
01017 {
01018   // The wonders and perils of ACT
01019   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
01020 
01021   return this->connection_map_.unbind (entry);
01022 }
01023 
01024 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01025 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::mark_as_closed (const void *recycling_act)
01026 {
01027   // Excluded other threads from changing cache while we take this
01028   // entry out.
01029   ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
01030 
01031   return this->mark_as_closed_i (recycling_act);
01032 }
01033 
01034 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01035 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::mark_as_closed_i (const void *recycling_act)
01036 {
01037   // The wonders and perils of ACT
01038   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
01039 
01040   // Mark the <svc_handler> in the cache as CLOSED.
01041   entry->ext_id_.recycle_state (ACE_RECYCLABLE_CLOSED);
01042 
01043   return 0;
01044 }
01045 
01046 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01047 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cleanup_hint (const void *recycling_act,
01048                                                                                      void **act_holder)
01049 {
01050   // Excluded other threads from changing cache while we take this
01051   // entry out.
01052   ACE_GUARD_RETURN (MUTEX, ace_mon, *this->lock_, -1);
01053 
01054   return this->cleanup_hint_i (recycling_act,
01055                                act_holder);
01056 }
01057 
01058 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01059 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::cleanup_hint_i (const void *recycling_act,
01060                                                                                        void **act_holder)
01061 {
01062   // Reset the <*act_holder> in the confines and protection of the
01063   // lock.
01064   if (act_holder)
01065     *act_holder = 0;
01066 
01067   // The wonders and perils of ACT
01068   CONNECTION_MAP_ENTRY *entry = (CONNECTION_MAP_ENTRY *) recycling_act;
01069 
01070   // Decrement the refcount on the <svc_handler>.
01071   int refcount = entry->ext_id_.decrement ();
01072 
01073   // If the svc_handler state is closed and the refcount == 0, call
01074   // close() on svc_handler.
01075   if (entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED &&
01076       refcount == 0)
01077     {
01078       entry->int_id_->recycler (0, 0);
01079       entry->int_id_->close ();
01080       this->purge_i (entry);
01081     }
01082 
01083   return 0;
01084 }
01085 
01086 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Creation_Strategy<SVC_HANDLER> *
01087 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::creation_strategy (void) const
01088 {
01089   return this->creation_strategy_;
01090 }
01091 
01092 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Recycling_Strategy<SVC_HANDLER> *
01093 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::recycling_strategy (void) const
01094 {
01095   return this->recycling_strategy_;
01096 }
01097 
01098 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> ACE_Concurrency_Strategy<SVC_HANDLER> *
01099 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::concurrency_strategy (void) const
01100 {
01101   return this->concurrency_strategy_;
01102 }
01103 
01104 template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class MUTEX> int
01105 ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX>::find (ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> &search_addr,
01106                                                                              ACE_Hash_Map_Entry<ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR>, SVC_HANDLER *> *&entry)
01107 {
01108   typedef ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDRESS,
01109                                        SVC_HANDLER *,
01110                                        ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>,
01111                                        ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>,
01112                                        ACE_Null_Mutex>
01113     CONNECTION_MAP_BUCKET_ITERATOR;
01114 
01115   CONNECTION_MAP_BUCKET_ITERATOR iterator (this->connection_map_,
01116                                            search_addr);
01117 
01118   CONNECTION_MAP_BUCKET_ITERATOR end (this->connection_map_,
01119                                       search_addr,
01120                                       1);
01121 
01122   for (;
01123        iterator != end;
01124        ++iterator)
01125     {
01126       REFCOUNTED_HASH_RECYCLABLE_ADDRESS &addr = (*iterator).ext_id_;
01127 
01128       if (addr.recycle_state () != ACE_RECYCLABLE_IDLE_AND_PURGABLE &&
01129           addr.recycle_state () != ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE)
01130         continue;
01131 
01132       if (addr.subject () != search_addr.subject ())
01133         continue;
01134 
01135       entry = &(*iterator);
01136       return 0;
01137     }
01138 
01139   return -1;
01140 }
01141 
01142 template <class SVC_HANDLER> void
01143 ACE_DLL_Strategy<SVC_HANDLER>::dump (void) const
01144 {
01145   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::dump");
01146 }
01147 
01148 template <class SVC_HANDLER> void
01149 ACE_Concurrency_Strategy<SVC_HANDLER>::dump (void) const
01150 {
01151   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::dump");
01152 }
01153 
01154 template <class SVC_HANDLER> void
01155 ACE_Reactive_Strategy<SVC_HANDLER>::dump (void) const
01156 {
01157   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::dump");
01158 }
01159 
01160 template <class SVC_HANDLER> void
01161 ACE_Thread_Strategy<SVC_HANDLER>::dump (void) const
01162 {
01163   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::dump");
01164 }
01165 
01166 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> void
01167 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump (void) const
01168 {
01169   ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump");
01170 }
01171 
01172 template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> void
01173 ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::dump (void) const
01174 {
01175   ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::dump");
01176 }
01177 
01178 template <class SVC_HANDLER> void
01179 ACE_Process_Strategy<SVC_HANDLER>::dump (void) const
01180 {
01181   ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::dump");
01182 }
01183 
01184 template <class SVC_HANDLER> void
01185 ACE_Scheduling_Strategy<SVC_HANDLER>::dump (void) const
01186 {
01187   ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::dump");
01188 
01189   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
01190   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
01191 }
01192 
01193 template <class SVC_HANDLER> void
01194 ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::dump (void) const
01195 {
01196   ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::dump");
01197 
01198   ACE_Scheduling_Strategy<SVC_HANDLER>::dump ();
01199 }
01200 
01201 template <class SVC_HANDLER> void
01202 ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::dump (void) const
01203 {
01204   ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::dump");
01205 
01206   ACE_Scheduling_Strategy<SVC_HANDLER>::dump ();
01207 }
01208 
01209 template <class SVC_HANDLER> ACE_INLINE void
01210 ACE_Singleton_Strategy<SVC_HANDLER>::dump (void) const
01211 {
01212   ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::dump");
01213 }
01214 
01215 template <class SVC_HANDLER> void
01216 ACE_Creation_Strategy<SVC_HANDLER>::dump (void) const
01217 {
01218   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::dump");
01219 }
01220 
01221 ACE_ALLOC_HOOK_DEFINE(ACE_Creation_Strategy)
01222 ACE_ALLOC_HOOK_DEFINE(ACE_Singleton_Strategy)
01223 ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Strategy)
01224 ACE_ALLOC_HOOK_DEFINE(ACE_Concurrency_Strategy)
01225 ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Strategy)
01226 ACE_ALLOC_HOOK_DEFINE(ACE_Connect_Strategy)
01227 ACE_ALLOC_HOOK_DEFINE(ACE_Process_Strategy)
01228 ACE_ALLOC_HOOK_DEFINE(ACE_Accept_Strategy)
01229 ACE_ALLOC_HOOK_DEFINE(ACE_Thread_Strategy)
01230 
01231 #endif /* ACE_STRATEGIES_T_C */

Generated on Mon Jun 16 11:21:26 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002