1 #ifndef ACE_STRATEGIES_T_CPP
2 #define ACE_STRATEGIES_T_CPP
4 #include "ace/Strategies_T.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #include "ace/Service_Repository.h"
11 #include "ace/Service_Types.h"
12 #include "ace/Thread_Manager.h"
13 #include "ace/WFMO_Reactor.h"
15 #include "ace/OS_NS_dlfcn.h"
16 #include "ace/OS_NS_string.h"
17 #include "ace/OS_Errno.h"
18 #include "ace/Svc_Handler.h"
20 #if !defined (__ACE_INLINE__)
21 #include "ace/Strategies_T.inl"
22 #endif /* __ACE_INLINE__ */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 template<class SVC_HANDLER
>
27 ACE_Recycling_Strategy
<SVC_HANDLER
>::~ACE_Recycling_Strategy ()
31 template<class SVC_HANDLER
> int
32 ACE_Recycling_Strategy
<SVC_HANDLER
>::assign_recycler (SVC_HANDLER
*svc_handler
,
33 ACE_Connection_Recycling_Strategy
*recycler
,
34 const void *recycling_act
)
36 svc_handler
->recycler (recycler
, recycling_act
);
40 template<class SVC_HANDLER
> int
41 ACE_Recycling_Strategy
<SVC_HANDLER
>::prepare_for_recycling (SVC_HANDLER
*svc_handler
)
43 return svc_handler
->recycle ();
46 template <class SVC_HANDLER
>
47 ACE_Singleton_Strategy
<SVC_HANDLER
>::~ACE_Singleton_Strategy ()
49 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::~ACE_Singleton_Strategy");
50 if (this->delete_svc_handler_
)
51 delete this->svc_handler_
;
54 // Create a Singleton SVC_HANDLER by always returning the same
57 template <class SVC_HANDLER
> int
58 ACE_Singleton_Strategy
<SVC_HANDLER
>::make_svc_handler (SVC_HANDLER
*&sh
)
60 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::make_svc_handler");
61 sh
= this->svc_handler_
;
65 template <class SVC_HANDLER
> int
66 ACE_Singleton_Strategy
<SVC_HANDLER
>::open (SVC_HANDLER
*sh
,
69 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::open");
71 if (this->delete_svc_handler_
)
72 delete this->svc_handler_
;
74 // If <sh> is NULL then create a new <SVC_HANDLER>.
77 ACE_NEW_RETURN (this->svc_handler_
,
80 this->delete_svc_handler_
= true;
84 this->svc_handler_
= sh
;
85 this->delete_svc_handler_
= false;
91 template <class SVC_HANDLER
> int
92 ACE_DLL_Strategy
<SVC_HANDLER
>::open (const ACE_TCHAR dll_name
[],
93 const ACE_TCHAR factory_function
[],
94 const ACE_TCHAR svc_name
[],
95 ACE_Service_Repository
*svc_rep
,
96 ACE_Thread_Manager
*thr_mgr
)
98 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::open");
99 this->inherited::open (thr_mgr
);
100 ACE_OS::strcpy (this->dll_name_
, dll_name
);
101 ACE_OS::strcpy (this->factory_function_
, factory_function
);
102 ACE_OS::strcpy (this->svc_name_
, svc_name
);
103 this->svc_rep_
= svc_rep
;
107 // Create a SVC_HANDLER by dynamically linking it from a DLL.
109 template <class SVC_HANDLER
> int
110 ACE_DLL_Strategy
<SVC_HANDLER
>::make_svc_handler (SVC_HANDLER
*&sh
)
112 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::make_svc_handler");
114 // Open the shared library.
115 ACE_SHLIB_HANDLE handle
= ACE_OS::dlopen (this->dll_name_
);
117 // Extract the factory function.
118 SVC_HANDLER
*(*factory
)(void) =
119 (SVC_HANDLER
*(*)(void)) ACE_OS::dlsym (handle
, this->factory_function_
);
121 // Call the factory function to obtain the new SVC_Handler (should
122 // use RTTI here when it becomes available...)
123 SVC_HANDLER
*svc_handler
= 0;
125 ACE_ALLOCATOR_RETURN (svc_handler
, (*factory
)(), -1);
127 if (svc_handler
!= 0)
129 // Create an ACE_Service_Type containing the SVC_Handler and
130 // insert into this->svc_rep_;
132 ACE_Service_Type_Impl
*stp
= 0;
134 ACE_Service_Object_Type (svc_handler
,
138 ACE_Service_Type
*srp
= 0;
141 ACE_Service_Type (this->svc_name_
,
153 if (this->svc_rep_
->insert (srp
) == -1)
155 // @@ Somehow, we need to deal with this->thr_mgr_...
162 // Default behavior is to activate the SVC_HANDLER by calling it's
163 // open() method, which allows the SVC_HANDLER to determine its own
164 // concurrency strategy.
166 template <class SVC_HANDLER
> int
167 ACE_Concurrency_Strategy
<SVC_HANDLER
>::activate_svc_handler (SVC_HANDLER
*svc_handler
,
170 ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler");
174 // See if we should enable non-blocking I/O on the <svc_handler>'s
176 if (ACE_BIT_ENABLED (this->flags_
, ACE_NONBLOCK
) != 0)
178 if (svc_handler
->peer ().enable (ACE_NONBLOCK
) == -1)
181 // Otherwise, make sure it's disabled by default.
182 else if (svc_handler
->peer ().disable (ACE_NONBLOCK
) == -1)
185 if (result
== 0 && svc_handler
->open (arg
) == -1)
189 // The connection was already made; so this close is a "normal" close
191 svc_handler
->close (NORMAL_CLOSE_OPERATION
);
196 template <class SVC_HANDLER
> int
197 ACE_Reactive_Strategy
<SVC_HANDLER
>::open (ACE_Reactor
*reactor
,
198 ACE_Reactor_Mask mask
,
201 ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::open");
202 this->reactor_
= reactor
;
204 this->flags_
= flags
;
206 // Must have a <Reactor>
207 if (this->reactor_
== 0)
213 template <class SVC_HANDLER
> int
214 ACE_Reactive_Strategy
<SVC_HANDLER
>::activate_svc_handler (SVC_HANDLER
*svc_handler
,
217 ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
221 if (this->reactor_
== 0)
224 // Register with the Reactor with the appropriate <mask>.
225 else if (this->reactor_
->register_handler (svc_handler
, this->mask_
) == -1)
228 // If the implementation of the reactor uses event associations
229 else if (this->reactor_
->uses_event_associations ())
231 // If we don't have non-block on, it won't work with
233 // This maybe too harsh
234 // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
236 if (svc_handler
->open (arg
) != -1)
242 // Call up to our parent to do the SVC_HANDLER initialization.
243 return this->inherited::activate_svc_handler (svc_handler
, arg
);
246 // The connection was already made; so this close is a "normal" close
248 svc_handler
->close (NORMAL_CLOSE_OPERATION
);
253 template <class SVC_HANDLER
> int
254 ACE_Thread_Strategy
<SVC_HANDLER
>::open (ACE_Thread_Manager
*thr_mgr
,
259 ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::open");
260 this->thr_mgr_
= thr_mgr
;
261 this->n_threads_
= n_threads
;
262 this->thr_flags_
= thr_flags
;
263 this->flags_
= flags
;
265 // Must have a thread manager!
266 if (this->thr_mgr_
== 0)
267 ACELIB_ERROR_RETURN ((LM_ERROR
,
268 ACE_TEXT ("error: must have a non-NULL thread manager\n")),
274 template <class SVC_HANDLER
> int
275 ACE_Thread_Strategy
<SVC_HANDLER
>::activate_svc_handler (SVC_HANDLER
*svc_handler
,
278 ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler");
279 // Call up to our parent to do the SVC_HANDLER initialization.
280 if (this->inherited::activate_svc_handler (svc_handler
,
284 // Turn the <svc_handler> into an active object (if it isn't
285 // already one as a result of the first activation...)
286 return svc_handler
->activate (this->thr_flags_
,
290 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
> int
291 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::open
292 (const ACE_PEER_ACCEPTOR_ADDR
&local_addr
, bool reuse_addr
)
294 this->reuse_addr_
= reuse_addr
;
295 this->peer_acceptor_addr_
= local_addr
;
296 if (this->peer_acceptor_
.open (local_addr
, reuse_addr
) == -1)
299 // Set the peer acceptor's handle into non-blocking mode. This is a
300 // safe-guard against the race condition that can otherwise occur
301 // between the time when <select> indicates that a passive-mode
302 // socket handle is "ready" and when we call <accept>. During this
303 // interval, the client can shutdown the connection, in which case,
304 // the <accept> call can hang!
305 if (this->peer_acceptor_
.enable (ACE_NONBLOCK
) == -1)
311 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
>
312 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::ACE_Accept_Strategy
313 (const ACE_PEER_ACCEPTOR_ADDR
&local_addr
,
315 ACE_Reactor
*reactor
)
318 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy");
320 if (this->open (local_addr
, reuse_addr
) == -1)
321 ACELIB_ERROR ((LM_ERROR
,
326 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
> int
327 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::accept_svc_handler
328 (SVC_HANDLER
*svc_handler
)
330 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::accept_svc_handler");
332 // Try to find out if the implementation of the reactor that we are
333 // using requires us to reset the event association for the newly
334 // created handle. This is because the newly created handle will
335 // inherit the properties of the listen handle, including its event
337 bool reset_new_handle
= this->reactor_
->uses_event_associations ();
339 if (this->peer_acceptor_
.accept (svc_handler
->peer (), // stream
343 reset_new_handle
// reset new handler
346 // Ensure that errno is preserved in case the svc_handler
347 // close() method resets it
348 ACE_Errno_Guard
error(errno
);
350 // Close down handler to avoid memory leaks.
351 svc_handler
->close (CLOSE_DURING_NEW_CONNECTION
);
359 template <class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
> int
360 ACE_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
>::connect_svc_handler
362 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
363 ACE_Time_Value
*timeout
,
364 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
369 ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler");
371 return this->connector_
.connect (sh
->peer (),
380 template <class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
> int
381 ACE_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
>::connect_svc_handler
383 SVC_HANDLER
*&sh_copy
,
384 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
385 ACE_Time_Value
*timeout
,
386 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
391 ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connect_svc_handler");
394 this->connector_
.connect (sh
->peer (),
405 template <class SVC_HANDLER
> int
406 ACE_Process_Strategy
<SVC_HANDLER
>::open (size_t n_processes
,
407 ACE_Event_Handler
*acceptor
,
408 ACE_Reactor
*reactor
,
411 ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::open");
412 this->n_processes_
= n_processes
;
413 this->acceptor_
= acceptor
;
414 this->reactor_
= reactor
;
415 this->flags_
= avoid_zombies
;
420 template <class SVC_HANDLER
> int
421 ACE_Process_Strategy
<SVC_HANDLER
>::activate_svc_handler (SVC_HANDLER
*svc_handler
,
424 ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::activate_svc_handler");
426 // If <flags_> is non-0 then we won't create zombies.
427 switch (ACE::fork (ACE_TEXT ("child"), this->flags_
))
429 case static_cast<pid_t
>(-1):
431 ACE_Errno_Guard
error (errno
);
432 svc_handler
->close ();
434 ACELIB_ERROR_RETURN ((LM_ERROR
,
439 case 0: // In child process.
441 // Close down the SOCK_Acceptor's handle since we don't need to
443 if (this->acceptor_
!= 0)
444 // Ignore the return value here...
445 (void) this->reactor_
->remove_handler (this->acceptor_
,
446 ACE_Event_Handler::ACCEPT_MASK
);
448 // Call up to our ancestor in the inheritance to do the
449 // SVC_HANDLER initialization.
450 return this->inherited::activate_svc_handler (svc_handler
, arg
);
452 default: // In parent process.
453 // We need to close down the <SVC_HANDLER> here because it's
454 // running in the child.
455 svc_handler
->close ();
460 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
>
461 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::ACE_Cached_Connect_Strategy
462 (creation_strategy_type
*cre_s
,
463 ACE_Concurrency_Strategy
<SVC_HANDLER
> *con_s
,
464 ACE_Recycling_Strategy
<SVC_HANDLER
> *rec_s
,
468 delete_lock_ (delete_lock
),
470 creation_strategy_ (0),
471 delete_creation_strategy_ (false),
472 concurrency_strategy_ (0),
473 delete_concurrency_strategy_ (false),
474 recycling_strategy_ (0),
475 delete_recycling_strategy_ (false)
477 // Create a new lock if necessary.
478 if (this->lock_
== 0)
480 ACE_NEW (this->lock_
,
483 this->delete_lock_
= true;
486 ACE_NEW (this->reverse_lock_
,
487 REVERSE_MUTEX (*this->lock_
));
489 if (this->open (cre_s
,
492 ACELIB_ERROR ((LM_ERROR
,
494 ACE_TEXT ("ACE_Cached_Connect_Strategy::ACE_Cached_Connect_Strategy")));
497 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
>
498 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::~ACE_Cached_Connect_Strategy ()
500 if (this->delete_lock_
)
503 delete this->reverse_lock_
;
505 if (this->delete_creation_strategy_
)
506 delete this->creation_strategy_
;
507 this->delete_creation_strategy_
= false;
508 this->creation_strategy_
= 0;
510 if (this->delete_concurrency_strategy_
)
511 delete this->concurrency_strategy_
;
512 this->delete_concurrency_strategy_
= false;
513 this->concurrency_strategy_
= 0;
515 if (this->delete_recycling_strategy_
)
516 delete this->recycling_strategy_
;
517 this->delete_recycling_strategy_
= false;
518 this->recycling_strategy_
= 0;
520 // Close down all cached service handlers.
521 CONNECTION_MAP_ENTRY
*entry
= 0;
522 for (CONNECTION_MAP_ITERATOR
iterator (connection_map_
);
523 iterator
.next (entry
);
526 entry
->int_id_
->recycler (0, 0);
527 entry
->int_id_
->close ();
531 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
532 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::open
533 (creation_strategy_type
*cre_s
,
534 ACE_Concurrency_Strategy
<SVC_HANDLER
> *con_s
,
535 ACE_Recycling_Strategy
<SVC_HANDLER
> *rec_s
)
537 // Initialize the creation strategy.
539 // First we decide if we need to clean up.
540 if (this->creation_strategy_
!= 0 &&
541 this->delete_creation_strategy_
&&
544 delete this->creation_strategy_
;
545 this->creation_strategy_
= 0;
546 this->delete_creation_strategy_
= false;
550 this->creation_strategy_
= cre_s
;
551 else if (this->creation_strategy_
== 0)
553 ACE_NEW_RETURN (this->creation_strategy_
,
554 CREATION_STRATEGY
, -1);
555 this->delete_creation_strategy_
= true;
558 // Initialize the concurrency strategy.
560 if (this->concurrency_strategy_
!= 0 &&
561 this->delete_concurrency_strategy_
&&
564 delete this->concurrency_strategy_
;
565 this->concurrency_strategy_
= 0;
566 this->delete_concurrency_strategy_
= false;
570 this->concurrency_strategy_
= con_s
;
571 else if (this->concurrency_strategy_
== 0)
573 ACE_NEW_RETURN (this->concurrency_strategy_
,
574 CONCURRENCY_STRATEGY
, -1);
575 this->delete_concurrency_strategy_
= true;
578 // Initialize the recycling strategy.
580 if (this->recycling_strategy_
!= 0 &&
581 this->delete_recycling_strategy_
&&
584 delete this->recycling_strategy_
;
585 this->recycling_strategy_
= 0;
586 this->delete_recycling_strategy_
= false;
590 this->recycling_strategy_
= rec_s
;
591 else if (this->recycling_strategy_
== 0)
593 ACE_NEW_RETURN (this->recycling_strategy_
,
594 RECYCLING_STRATEGY
, -1);
595 this->delete_recycling_strategy_
= true;
601 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
602 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::make_svc_handler
605 return this->creation_strategy_
->make_svc_handler (sh
);
608 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
609 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::activate_svc_handler
610 (SVC_HANDLER
*svc_handler
)
612 return this->concurrency_strategy_
->activate_svc_handler (svc_handler
);
615 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
616 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::assign_recycler
617 (SVC_HANDLER
*svc_handler
,
618 ACE_Connection_Recycling_Strategy
*recycler
,
619 const void *recycling_act
)
621 return this->recycling_strategy_
->assign_recycler (svc_handler
,
626 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
627 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::prepare_for_recycling
628 (SVC_HANDLER
*svc_handler
)
630 return this->recycling_strategy_
->prepare_for_recycling (svc_handler
);
633 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
634 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::check_hint_i
636 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
637 ACE_Time_Value
*timeout
,
638 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
642 CONNECTION_MAP_ENTRY
*&entry
,
645 ACE_UNUSED_ARG (remote_addr
);
646 ACE_UNUSED_ARG (timeout
);
647 ACE_UNUSED_ARG (local_addr
);
648 ACE_UNUSED_ARG (reuse_addr
);
649 ACE_UNUSED_ARG (flags
);
650 ACE_UNUSED_ARG (perms
);
654 // Get the recycling act for the svc_handler
655 CONNECTION_MAP_ENTRY
*possible_entry
= (CONNECTION_MAP_ENTRY
*) sh
->recycling_act ();
657 // Check to see if the hint svc_handler has been closed down
658 if (possible_entry
->ext_id_
.recycle_state () == ACE_RECYCLABLE_CLOSED
)
660 // If close, decrement refcount
661 if (possible_entry
->ext_id_
.decrement () == 0)
663 // If refcount goes to zero, close down the svc_handler
664 possible_entry
->int_id_
->recycler (0, 0);
665 possible_entry
->int_id_
->close ();
666 this->purge_i (possible_entry
);
669 // Hint not successful
676 // If hint is not closed, see if it is connected to the correct
677 // address and is recyclable
678 else if ((possible_entry
->ext_id_
.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE
||
679 possible_entry
->ext_id_
.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE
) &&
680 possible_entry
->ext_id_
.subject () == remote_addr
)
685 // Tell the <svc_handler> that it should prepare itself for
687 this->prepare_for_recycling (sh
);
691 // This hint will not be used.
692 possible_entry
->ext_id_
.decrement ();
694 // Hint not successful
697 // If <sh> is not connected to the correct address or is busy,
698 // we will not use it.
703 entry
= possible_entry
;
708 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
709 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::find_or_create_svc_handler_i
711 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
712 ACE_Time_Value
*timeout
,
713 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
717 CONNECTION_MAP_ENTRY
*&entry
,
720 // Explicit type conversion
721 REFCOUNTED_HASH_RECYCLABLE_ADDRESS
search_addr (remote_addr
);
723 // Try to find the address in the cache. Only if we don't find it
724 // do we create a new <SVC_HANDLER> and connect it with the server.
725 if (this->find (search_addr
, entry
) == -1)
730 // We need to use a temporary variable here since we are not
731 // allowed to change <sh> because other threads may use this
732 // when we let go of the lock during the OS level connect.
734 // Note that making a new svc_handler, connecting remotely,
735 // binding to the map, and assigning of the hint and recycler
736 // should be atomic to the outside world.
737 SVC_HANDLER
*potential_handler
= 0;
739 // Create a new svc_handler
740 if (this->make_svc_handler (potential_handler
) == -1)
743 // Actively establish the connection. This is a timed blocking
745 if (this->new_connection (potential_handler
,
753 // If connect() failed because of timeouts, we have to
754 // reject the connection entirely. This is necessary since
755 // currently there is no way for the non-blocking connects
756 // to complete and for the <Connector> to notify the cache
757 // of the completion of connect().
758 if (errno
== EWOULDBLOCK
)
761 // Close the svc handler.
762 potential_handler
->close (0);
768 // Insert the new SVC_HANDLER instance into the cache.
769 if (this->connection_map_
.bind (search_addr
,
773 // Close the svc handler.
774 potential_handler
->close (CLOSE_DURING_NEW_CONNECTION
);
779 // Everything succeeded as planned. Assign <sh> to <potential_handler>.
780 sh
= potential_handler
;
782 // Set the recycler and the recycling act
783 this->assign_recycler (sh
, this, entry
);
787 // We found a cached svc_handler.
792 // Get the cached <svc_handler>
795 // Tell the <svc_handler> that it should prepare itself for
797 this->prepare_for_recycling (sh
);
803 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
804 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::new_connection
806 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
807 ACE_Time_Value
*timeout
,
808 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
813 // Yow, Reverse Guard! Let go of the lock for the duration of the
814 // actual connect. This will allow other threads to hack on the
815 // connection cache while this thread creates the new connection.
816 ACE_GUARD_RETURN (REVERSE_MUTEX
, ace_mon
, *this->reverse_lock_
, -1);
818 return this->CONNECT_STRATEGY::connect_svc_handler (sh
,
827 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
828 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::connect_svc_handler
830 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
831 ACE_Time_Value
*timeout
,
832 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
839 // This artificial scope is required since we need to let go of the
840 // lock *before* registering the newly created handler with the
843 // Synchronization is required here as the setting of the
844 // recyclable state must be done atomically with the finding and
845 // binding of the service handler in the cache.
846 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
848 int result
= this->connect_svc_handler_i (sh
,
860 // If it is a new connection, activate it.
862 // Note: This activation is outside the scope of the lock of the
863 // cached connector. This is necessary to avoid subtle deadlock
864 // conditions with this lock and the Reactor lock.
868 if (this->activate_svc_handler (sh
) == -1)
870 // If an error occurs while activating the handler, the
871 // <activate_svc_handler> method will close the handler.
872 // This in turn will remove this entry from the internal
875 // Synchronization is required here as the setting of the
876 // handler to zero must be done atomically with the users of
878 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
890 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
891 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::connect_svc_handler
893 SVC_HANDLER
*&sh_copy
,
894 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
895 ACE_Time_Value
*timeout
,
896 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
903 // This artificial scope is required since we need to let go of the
904 // lock *before* registering the newly created handler with the
907 // Synchronization is required here as the setting of the
908 // recyclable state must be done atomically with the finding and
909 // binding of the service handler in the cache.
910 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
912 int result
= this->connect_svc_handler_i (sh
,
926 // If it is a new connection, activate it.
928 // Note: This activation is outside the scope of the lock of the
929 // cached connector. This is necessary to avoid subtle deadlock
930 // conditions with this lock and the Reactor lock.
934 if (this->activate_svc_handler (sh_copy
) == -1)
936 // If an error occurs while activating the handler, the
937 // <activate_svc_handler> method will close the handler.
938 // This in turn will remove this entry from the internal
941 // Synchronization is required here as the setting of the
942 // handler to zero must be done atomically with the users of
944 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
957 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
958 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::connect_svc_handler_i
960 const ACE_PEER_CONNECTOR_ADDR
&remote_addr
,
961 ACE_Time_Value
*timeout
,
962 const ACE_PEER_CONNECTOR_ADDR
&local_addr
,
968 CONNECTION_MAP_ENTRY
*entry
= 0;
970 // Check if the user passed a hint svc_handler
973 int result
= this->check_hint_i (sh
,
989 int result
= this->find_or_create_svc_handler_i (sh
,
1004 // For all successful cases: mark the <svc_handler> in the cache
1005 // as being <in_use>. Therefore recyclable is BUSY.
1006 entry
->ext_id_
.recycle_state (ACE_RECYCLABLE_BUSY
);
1008 // And increment the refcount
1009 entry
->ext_id_
.increment ();
1015 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1016 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::cache (const void *recycling_act
)
1018 // Synchronization is required here as the setting of the recyclable
1019 // state must be done atomically with respect to other threads that
1020 // are querying the cache.
1021 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
1023 return this->cache_i (recycling_act
);
1026 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1027 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::cache_i (const void *recycling_act
)
1029 // The wonders and perils of ACT
1030 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1032 // Mark the <svc_handler> in the cache as not being <in_use>.
1033 // Therefore recyclable is IDLE.
1034 entry
->ext_id_
.recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE
);
1039 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1040 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::recycle_state (const void *recycling_act
,
1041 ACE_Recyclable_State new_state
)
1043 // Synchronization is required here as the setting of the recyclable
1044 // state must be done atomically with respect to other threads that
1045 // are querying the cache.
1046 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
1048 return this->recycle_state_i (recycling_act
,
1052 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1053 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::recycle_state_i (const void *recycling_act
,
1054 ACE_Recyclable_State new_state
)
1056 // The wonders and perils of ACT
1057 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1059 // Mark the <svc_handler> in the cache as not being <in_use>.
1060 // Therefore recyclable is IDLE.
1061 entry
->ext_id_
.recycle_state (new_state
);
1066 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> ACE_Recyclable_State
1067 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::recycle_state (const void *recycling_act
) const
1070 SELF
*fake_this
= const_cast<SELF
*> (this);
1072 // Synchronization is required here.
1073 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *fake_this
->lock_
, ACE_RECYCLABLE_UNKNOWN
);
1075 return this->recycle_state_i (recycling_act
);
1078 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> ACE_Recyclable_State
1079 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::recycle_state_i (const void *recycling_act
) const
1081 // The wonders and perils of ACT
1082 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1084 // Mark the <svc_handler> in the cache as not being <in_use>.
1085 // Therefore recyclable is IDLE.
1086 return entry
->ext_id_
.recycle_state ();
1089 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1090 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::purge (const void *recycling_act
)
1092 // Excluded other threads from changing cache while we take this
1094 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
1096 return this->purge_i (recycling_act
);
1099 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1100 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::purge_i (const void *recycling_act
)
1102 // The wonders and perils of ACT
1103 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1105 return this->connection_map_
.unbind (entry
);
1108 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1109 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::mark_as_closed (const void *recycling_act
)
1111 // Excluded other threads from changing cache while we take this
1113 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
1115 return this->mark_as_closed_i (recycling_act
);
1118 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1119 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::mark_as_closed_i (const void *recycling_act
)
1121 // The wonders and perils of ACT
1122 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1124 // Mark the <svc_handler> in the cache as CLOSED.
1125 entry
->ext_id_
.recycle_state (ACE_RECYCLABLE_CLOSED
);
1130 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1131 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::cleanup_hint (const void *recycling_act
,
1134 // Excluded other threads from changing cache while we take this
1136 ACE_GUARD_RETURN (MUTEX
, ace_mon
, *this->lock_
, -1);
1138 return this->cleanup_hint_i (recycling_act
,
1142 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1143 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::cleanup_hint_i (const void *recycling_act
,
1146 // Reset the <*act_holder> in the confines and protection of the
1151 // The wonders and perils of ACT
1152 CONNECTION_MAP_ENTRY
*entry
= (CONNECTION_MAP_ENTRY
*) recycling_act
;
1154 // Decrement the refcount on the <svc_handler>.
1155 int refcount
= entry
->ext_id_
.decrement ();
1157 // If the svc_handler state is closed and the refcount == 0, call
1158 // close() on svc_handler.
1159 if (entry
->ext_id_
.recycle_state () == ACE_RECYCLABLE_CLOSED
&&
1162 entry
->int_id_
->recycler (0, 0);
1163 entry
->int_id_
->close ();
1164 this->purge_i (entry
);
1170 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> ACE_Creation_Strategy
<SVC_HANDLER
> *
1171 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::creation_strategy () const
1173 return this->creation_strategy_
;
1176 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> ACE_Recycling_Strategy
<SVC_HANDLER
> *
1177 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::recycling_strategy () const
1179 return this->recycling_strategy_
;
1182 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> ACE_Concurrency_Strategy
<SVC_HANDLER
> *
1183 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::concurrency_strategy () const
1185 return this->concurrency_strategy_
;
1188 template<class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
, class MUTEX
> int
1189 ACE_Cached_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
, MUTEX
>::find (
1190 REFCOUNTED_HASH_RECYCLABLE_ADDRESS
&search_addr
,
1191 CONNECTION_MAP_ENTRY
*&entry
)
1193 typedef ACE_Hash_Map_Bucket_Iterator
<REFCOUNTED_HASH_RECYCLABLE_ADDRESS
,
1195 ACE_Hash
<REFCOUNTED_HASH_RECYCLABLE_ADDRESS
>,
1196 ACE_Equal_To
<REFCOUNTED_HASH_RECYCLABLE_ADDRESS
>,
1198 CONNECTION_MAP_BUCKET_ITERATOR
;
1200 CONNECTION_MAP_BUCKET_ITERATOR
iterator (this->connection_map_
,
1203 CONNECTION_MAP_BUCKET_ITERATOR
end (this->connection_map_
,
1211 REFCOUNTED_HASH_RECYCLABLE_ADDRESS
&addr
= (*iterator
).ext_id_
;
1213 if (addr
.recycle_state () != ACE_RECYCLABLE_IDLE_AND_PURGABLE
&&
1214 addr
.recycle_state () != ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE
)
1217 if (addr
.subject () != search_addr
.subject ())
1220 entry
= &(*iterator
);
1227 template <class SVC_HANDLER
> void
1228 ACE_DLL_Strategy
<SVC_HANDLER
>::dump () const
1230 #if defined (ACE_HAS_DUMP)
1231 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::dump");
1232 #endif /* ACE_HAS_DUMP */
1235 template <class SVC_HANDLER
>
1236 ACE_Concurrency_Strategy
<SVC_HANDLER
>::~ACE_Concurrency_Strategy ()
1238 ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::~ACE_Concurrency_Strategy");
1242 template <class SVC_HANDLER
> void
1243 ACE_Concurrency_Strategy
<SVC_HANDLER
>::dump () const
1245 #if defined (ACE_HAS_DUMP)
1246 ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::dump");
1247 #endif /* ACE_HAS_DUMP */
1250 template <class SVC_HANDLER
>
1251 ACE_Reactive_Strategy
<SVC_HANDLER
>::~ACE_Reactive_Strategy ()
1253 ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::~ACE_Reactive_Strategy");
1257 template <class SVC_HANDLER
> void
1258 ACE_Reactive_Strategy
<SVC_HANDLER
>::dump () const
1260 #if defined (ACE_HAS_DUMP)
1261 ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::dump");
1262 #endif /* ACE_HAS_DUMP */
1265 template <class SVC_HANDLER
>
1266 ACE_Thread_Strategy
<SVC_HANDLER
>::~ACE_Thread_Strategy ()
1268 ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::~ACE_Thread_Strategy");
1271 template <class SVC_HANDLER
> void
1272 ACE_Thread_Strategy
<SVC_HANDLER
>::dump () const
1274 #if defined (ACE_HAS_DUMP)
1275 ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::dump");
1276 #endif /* ACE_HAS_DUMP */
1279 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
>
1280 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::~ACE_Accept_Strategy ()
1282 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::~ACE_Accept_Strategy");
1284 // Close the underlying acceptor.
1285 this->peer_acceptor_
.close ();
1288 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
> ACE_HANDLE
1289 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::get_handle () const
1291 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::get_handle");
1292 return this->peer_acceptor_
.get_handle ();
1295 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
> ACE_PEER_ACCEPTOR
&
1296 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::acceptor () const
1298 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor");
1299 return (ACE_PEER_ACCEPTOR
&) this->peer_acceptor_
;
1302 template <class SVC_HANDLER
, ACE_PEER_ACCEPTOR_1
> void
1303 ACE_Accept_Strategy
<SVC_HANDLER
, ACE_PEER_ACCEPTOR_2
>::dump () const
1305 #if defined (ACE_HAS_DUMP)
1306 ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump");
1307 #endif /* ACE_HAS_DUMP */
1310 template <class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
>
1311 ACE_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
>::~ACE_Connect_Strategy ()
1313 ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::~ACE_Connect_Strategy");
1316 template <class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
> ACE_PEER_CONNECTOR
&
1317 ACE_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
>::connector () const
1319 ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::connector");
1320 return (ACE_PEER_CONNECTOR
&) this->connector_
;
1323 template <class SVC_HANDLER
, ACE_PEER_CONNECTOR_1
> void
1324 ACE_Connect_Strategy
<SVC_HANDLER
, ACE_PEER_CONNECTOR_2
>::dump () const
1326 #if defined (ACE_HAS_DUMP)
1327 ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::dump");
1328 #endif /* ACE_HAS_DUMP */
1331 template <class SVC_HANDLER
>
1332 ACE_Process_Strategy
<SVC_HANDLER
>::~ACE_Process_Strategy ()
1334 ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::~ACE_Process_Strategy");
1337 template <class SVC_HANDLER
> void
1338 ACE_Process_Strategy
<SVC_HANDLER
>::dump () const
1340 #if defined (ACE_HAS_DUMP)
1341 ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::dump");
1342 #endif /* ACE_HAS_DUMP */
1345 template <class SVC_HANDLER
>
1346 ACE_Scheduling_Strategy
<SVC_HANDLER
>::~ACE_Scheduling_Strategy ()
1348 ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::~ACE_Scheduling_Strategy");
1351 template <class SVC_HANDLER
> int
1352 ACE_Scheduling_Strategy
<SVC_HANDLER
>::suspend ()
1354 ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::suspend");
1358 template <class SVC_HANDLER
> int
1359 ACE_Scheduling_Strategy
<SVC_HANDLER
>::resume ()
1361 ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::resume");
1365 template <class SVC_HANDLER
> void
1366 ACE_Scheduling_Strategy
<SVC_HANDLER
>::dump () const
1368 #if defined (ACE_HAS_DUMP)
1369 ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::dump");
1371 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
1372 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
1373 #endif /* ACE_HAS_DUMP */
1376 template <class SVC_HANDLER
> int
1377 ACE_Schedule_All_Reactive_Strategy
<SVC_HANDLER
>::suspend ()
1379 ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::suspend");
1380 return this->reactor_
->suspend_handlers ();
1383 template <class SVC_HANDLER
> int
1384 ACE_Schedule_All_Reactive_Strategy
<SVC_HANDLER
>::resume ()
1386 ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::resume");
1387 return this->reactor_
->resume_handlers ();
1390 template <class SVC_HANDLER
> void
1391 ACE_Schedule_All_Reactive_Strategy
<SVC_HANDLER
>::dump () const
1393 #if defined (ACE_HAS_DUMP)
1394 ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::dump");
1396 ACE_Scheduling_Strategy
<SVC_HANDLER
>::dump ();
1397 #endif /* ACE_HAS_DUMP */
1400 template <class SVC_HANDLER
> int
1401 ACE_Schedule_All_Threaded_Strategy
<SVC_HANDLER
>::suspend ()
1403 ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::suspend");
1404 return this->thr_mgr_
->suspend_all ();
1407 template <class SVC_HANDLER
> int
1408 ACE_Schedule_All_Threaded_Strategy
<SVC_HANDLER
>::resume ()
1410 ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::resume");
1411 return this->thr_mgr_
->resume_all ();
1414 template <class SVC_HANDLER
> void
1415 ACE_Schedule_All_Threaded_Strategy
<SVC_HANDLER
>::dump () const
1417 #if defined (ACE_HAS_DUMP)
1418 ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::dump");
1420 ACE_Scheduling_Strategy
<SVC_HANDLER
>::dump ();
1421 #endif /* ACE_HAS_DUMP */
1425 ACE_Refcounted_Hash_Recyclable
<T
>::~ACE_Refcounted_Hash_Recyclable ()
1429 template <class SVC_HANDLER
> void
1430 ACE_Singleton_Strategy
<SVC_HANDLER
>::dump () const
1432 #if defined (ACE_HAS_DUMP)
1433 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::dump");
1434 #endif /* ACE_HAS_DUMP */
1437 template <class SVC_HANDLER
>
1438 ACE_Creation_Strategy
<SVC_HANDLER
>::~ACE_Creation_Strategy ()
1440 ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::~ACE_Creation_Strategy");
1443 // Default behavior is to make a new SVC_HANDLER, passing in the
1444 // Thread_Manager (if any).
1446 template <class SVC_HANDLER
> int
1447 ACE_Creation_Strategy
<SVC_HANDLER
>::make_svc_handler (SVC_HANDLER
*&sh
)
1449 ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::make_svc_handler");
1452 ACE_NEW_RETURN (sh
, SVC_HANDLER (this->thr_mgr_
), -1);
1453 sh
->reactor (this->reactor_
);
1457 template <class SVC_HANDLER
> void
1458 ACE_Creation_Strategy
<SVC_HANDLER
>::dump () const
1460 #if defined (ACE_HAS_DUMP)
1461 ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::dump");
1462 #endif /* ACE_HAS_DUMP */
1465 template <class SVC_HANDLER
> int
1466 ACE_NOOP_Creation_Strategy
<SVC_HANDLER
>::make_svc_handler (SVC_HANDLER
*&)
1468 ACE_TRACE ("ACE_NOOP_Creation_Strategy<SVC_HANDLER>::make_svc_handler");
1472 template <class SVC_HANDLER
> int
1473 ACE_NOOP_Concurrency_Strategy
<SVC_HANDLER
>::activate_svc_handler (SVC_HANDLER
*,
1476 ACE_TRACE ("ACE_NOOP_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler");
1480 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Creation_Strategy
)
1481 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Singleton_Strategy
)
1482 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_DLL_Strategy
)
1483 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Concurrency_Strategy
)
1484 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Reactive_Strategy
)
1485 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Thread_Strategy
)
1486 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Process_Strategy
)
1487 ACE_ALLOC_HOOK_DEFINE_Tca(ACE_Accept_Strategy
)
1488 ACE_ALLOC_HOOK_DEFINE_Tco(ACE_Connect_Strategy
)
1490 ACE_END_VERSIONED_NAMESPACE_DECL
1492 #endif /* ACE_STRATEGIES_T_CPP */