=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tao / Strategies / advanced_resource.cpp
blobce24613ba06b925c99b57ed7992e611276eeaeb0
1 #include "ace/Service_Config.h"
2 #include "tao/Strategies/advanced_resource.h"
4 #include "tao/Strategies/UIOP_Factory.h"
5 #include "tao/Strategies/SHMIOP_Factory.h"
6 #include "tao/Strategies/DIOP_Factory.h"
7 #include "tao/Strategies/SCIOP_Factory.h"
8 #include "tao/Strategies/COIOP_Factory.h"
10 #include "tao/Strategies/LFU_Connection_Purging_Strategy.h"
11 #include "tao/Strategies/FIFO_Connection_Purging_Strategy.h"
12 #include "tao/Strategies/NULL_Connection_Purging_Strategy.h"
14 #include "tao/Strategies/LF_Strategy_Null.h"
16 #include "tao/debug.h"
17 #include "tao/LRU_Connection_Purging_Strategy.h"
18 #include "tao/LF_Strategy_Complete.h"
19 #include "tao/LF_Follower.h"
20 #include "tao/Leader_Follower.h"
21 #include "tao/StringSeqC.h"
22 #include "tao/ORB_Core.h"
23 #include "tao/Load_Protocol_Factory_T.h"
25 #include "ace/Arg_Shifter.h"
26 #include "ace/Service_Config.h"
27 #include "ace/Select_Reactor.h"
28 #include "ace/WFMO_Reactor.h"
29 #include "ace/Msg_WFMO_Reactor.h"
30 #include "ace/TP_Reactor.h"
31 #include "ace/Dev_Poll_Reactor.h"
32 #include "ace/Malloc_T.h"
33 #include "ace/Local_Memory_Pool.h"
34 #include "ace/Null_Mutex.h"
35 #include "ace/OS_NS_strings.h"
36 #include <memory>
38 #if !defined (TAO_DEFAULT_REACTOR_TYPE)
39 #define TAO_DEFAULT_REACTOR_TYPE TAO_REACTOR_TP
40 #endif /* !TAO_DEFAULT_REACTOR_TYPE */
42 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
44 TAO_Resource_Factory_Changer::TAO_Resource_Factory_Changer ()
46 TAO_ORB_Core::set_resource_factory ("Advanced_Resource_Factory");
47 ACE_Service_Config::process_directive (ace_svc_desc_TAO_Advanced_Resource_Factory);
49 #if TAO_HAS_UIOP == 1
50 ACE_Service_Config::process_directive (ace_svc_desc_TAO_UIOP_Protocol_Factory);
51 #endif /* TAO_HAS_UIOP == 1 */
53 #if TAO_HAS_SHMIOP == 1
54 ACE_Service_Config::process_directive (ace_svc_desc_TAO_SHMIOP_Protocol_Factory);
55 #endif /* TAO_HAS_SHMIOP == 1 */
57 #if TAO_HAS_DIOP == 1
58 ACE_Service_Config::process_directive (ace_svc_desc_TAO_DIOP_Protocol_Factory);
59 #endif /* TAO_HAS_DIOP == 1 */
61 #if TAO_HAS_SCIOP == 1
62 ACE_Service_Config::process_directive (ace_svc_desc_TAO_SCIOP_Protocol_Factory);
63 #endif /* TAO_HAS_SCIOP == 1 */
65 #if TAO_HAS_COIOP == 1
66 ACE_Service_Config::process_directive (ace_svc_desc_TAO_COIOP_Protocol_Factory);
67 #endif /* TAO_HAS_SCIOP == 1 */
70 TAO_Advanced_Resource_Factory::TAO_Advanced_Resource_Factory ()
71 : reactor_type_ (TAO_DEFAULT_REACTOR_TYPE),
72 threadqueue_type_ (TAO_THREAD_QUEUE_NOT_SET),
73 cdr_allocator_type_ (TAO_ALLOCATOR_THREAD_LOCK),
74 amh_response_handler_allocator_lock_type_ (TAO_ALLOCATOR_THREAD_LOCK),
75 ami_response_handler_allocator_lock_type_ (TAO_ALLOCATOR_THREAD_LOCK)
77 // Constructor
80 TAO_Advanced_Resource_Factory::~TAO_Advanced_Resource_Factory ()
82 // Destructor
83 TAO_ProtocolFactorySetItor end = this->protocol_factories_.end ();
85 for (TAO_ProtocolFactorySetItor iterator =
86 this->protocol_factories_.begin ();
87 iterator != end;
88 ++iterator)
89 delete *iterator;
91 this->protocol_factories_.reset ();
94 int
95 TAO_Advanced_Resource_Factory::init (int argc, ACE_TCHAR** argv)
97 ACE_TRACE ("TAO_Advanced_Resource_Factory::init");
99 // If this factory has already been disabled then
100 // print a warning and exit because any options
101 // are useless
102 if (this->factory_disabled_)
104 TAOLIB_DEBUG ((LM_WARNING,
105 ACE_TEXT ("TAO (%P|%t) Warning: Resource_Factory options ignored\n")
106 ACE_TEXT ("Advanced Resource Factory is disabled\n")));
107 return 0;
109 this->options_processed_ = 1;
112 // If the default resource factory exists, then disable it.
113 // This causes any directives for the "Resource_Factory" to
114 // report warnings.
115 // Note: this is also being done in init_protocol_factories()
116 // to cover the case where init() is not called.
117 TAO_Resource_Factory *default_resource_factory =
118 ACE_Dynamic_Service<TAO_Resource_Factory>::instance ("Resource_Factory");
119 if (default_resource_factory != 0)
121 default_resource_factory->disable_factory ();
124 ACE_Arg_Shifter arg_shifter (argc, argv);
126 //for (int curarg = 0; curarg < argc; ++curarg)
127 const ACE_TCHAR *current_arg = 0;
128 while (arg_shifter.is_anything_left ())
130 if (arg_shifter.cur_arg_strncasecmp (ACE_TEXT("-ORBReactorRegistry")) == 0)
132 TAOLIB_ERROR_RETURN ((LM_ERROR,
133 ACE_TEXT("TAO_Advanced_Resource_Factory::init - ")
134 ACE_TEXT("-ORBReactorRegistry no longer supported\n")),
135 -1);
137 else if (0 != (current_arg = arg_shifter.get_the_parameter
138 (ACE_TEXT("-ORBReactorLock"))))
140 TAOLIB_DEBUG ((LM_DEBUG,
141 ACE_TEXT("TAO_Advanced_Resource_Factory - obsolete -ORBReactorLock ")
142 ACE_TEXT("option, please use -ORBReactorType\n")));
144 if (ACE_OS::strcasecmp (current_arg, ACE_TEXT("null")) == 0)
145 this->reactor_type_ = TAO_REACTOR_SELECT_ST;
146 else if (ACE_OS::strcasecmp (current_arg, ACE_TEXT("token")) == 0)
147 this->reactor_type_= TAO_REACTOR_SELECT_MT;
149 arg_shifter.consume_arg ();
151 else if (0 != (current_arg = arg_shifter.get_the_parameter
152 (ACE_TEXT("-ORBReactorType"))))
154 if (ACE_OS::strcasecmp (current_arg,
155 ACE_TEXT("select_mt")) == 0)
156 this->reactor_type_ = TAO_REACTOR_SELECT_MT;
157 else if (ACE_OS::strcasecmp (current_arg,
158 ACE_TEXT("select_st")) == 0)
159 this->reactor_type_ = TAO_REACTOR_SELECT_ST;
160 else if (ACE_OS::strcasecmp (current_arg,
161 ACE_TEXT("wfmo")) == 0)
162 #if defined(ACE_WIN32)
163 this->reactor_type_ = TAO_REACTOR_WFMO;
164 #else
165 this->report_unsupported_error (ACE_TEXT("WFMO Reactor"));
166 #endif /* ACE_WIN32 */
167 else if (ACE_OS::strcasecmp (current_arg,
168 ACE_TEXT("msg_wfmo")) == 0)
169 #if defined(ACE_WIN32) && !defined (ACE_LACKS_MSG_WFMO)
170 this->reactor_type_ = TAO_REACTOR_MSGWFMO;
171 #else
172 this->report_unsupported_error (ACE_TEXT("MsgWFMO Reactor"));
173 #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */
175 else if (ACE_OS::strcasecmp (current_arg,
176 ACE_TEXT("tp")) == 0)
177 this->reactor_type_ = TAO_REACTOR_TP;
179 else if (ACE_OS::strcasecmp (current_arg,
180 ACE_TEXT("dev_poll")) == 0)
182 #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
183 this->reactor_type_ = TAO_REACTOR_DEV_POLL;
184 #else
185 this->report_unsupported_error (ACE_TEXT ("Dev_Poll Reactor"));
186 #endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */
189 else if (ACE_OS::strcasecmp (current_arg,
190 ACE_TEXT("fl")) == 0)
191 this->report_option_value_error (
192 ACE_TEXT("FlReactor not supported by Advanced_Resources_Factory. Please use TAO_FlResource_Loader instead."),
193 current_arg);
194 else if (ACE_OS::strcasecmp (current_arg,
195 ACE_TEXT("tk")) == 0)
196 this->report_option_value_error (
197 ACE_TEXT("TkReactor not supported by Advanced_Resources_Factory. Please use TAO_TkResource_Loader instead."),
198 current_arg);
199 else
200 this->report_option_value_error (ACE_TEXT("-ORBReactorType"), current_arg);
202 arg_shifter.consume_arg ();
204 else if (0 != (current_arg = arg_shifter.get_the_parameter
205 (ACE_TEXT("-ORBInputCDRAllocator"))))
207 if (ACE_OS::strcasecmp (current_arg,
208 ACE_TEXT("null")) == 0)
210 this->cdr_allocator_type_ = TAO_ALLOCATOR_NULL_LOCK;
211 this->use_locked_data_blocks_ = 0;
213 else if (ACE_OS::strcasecmp (current_arg,
214 ACE_TEXT("thread")) == 0)
216 this->cdr_allocator_type_ = TAO_ALLOCATOR_THREAD_LOCK;
217 this->use_locked_data_blocks_ = 1;
219 else
221 this->report_option_value_error (ACE_TEXT("-ORBInputCDRAllocator"), current_arg);
224 arg_shifter.consume_arg ();
226 else if (0 != (current_arg = arg_shifter.get_the_parameter
227 (ACE_TEXT("-ORBAMHResponseHandlerAllocator"))))
229 if (ACE_OS::strcasecmp (current_arg,
230 ACE_TEXT("null")) == 0)
232 this->amh_response_handler_allocator_lock_type_ = TAO_ALLOCATOR_NULL_LOCK;
234 else if (ACE_OS::strcasecmp (current_arg,
235 ACE_TEXT("thread")) == 0)
237 this->amh_response_handler_allocator_lock_type_ = TAO_ALLOCATOR_THREAD_LOCK;
239 else
241 this->report_option_value_error (ACE_TEXT("-ORBAMHResponseHandlerAllocator"), current_arg);
244 arg_shifter.consume_arg ();
246 else if (0 != (current_arg = arg_shifter.get_the_parameter
247 (ACE_TEXT("-ORBAMIResponseHandlerAllocator"))))
249 if (ACE_OS::strcasecmp (current_arg,
250 ACE_TEXT("null")) == 0)
252 this->ami_response_handler_allocator_lock_type_ = TAO_ALLOCATOR_NULL_LOCK;
254 else if (ACE_OS::strcasecmp (current_arg,
255 ACE_TEXT("thread")) == 0)
257 this->ami_response_handler_allocator_lock_type_ = TAO_ALLOCATOR_THREAD_LOCK;
259 else
261 this->report_option_value_error (ACE_TEXT("-ORBAMIResponseHandlerAllocator"), current_arg);
264 arg_shifter.consume_arg ();
266 else if (0 != (current_arg = arg_shifter.get_the_parameter
267 (ACE_TEXT("-ORBReactorThreadQueue"))))
269 if (ACE_OS::strcasecmp (current_arg,
270 ACE_TEXT ("LIFO")) == 0)
271 this->threadqueue_type_ = TAO_THREAD_QUEUE_LIFO;
272 else if (ACE_OS::strcasecmp (current_arg,
273 ACE_TEXT ("FIFO")) == 0)
274 this->threadqueue_type_ = TAO_THREAD_QUEUE_FIFO;
275 else
276 this->report_option_value_error (ACE_TEXT ("-ORBReactorThreadQueue"),
277 current_arg);
279 arg_shifter.consume_arg ();
281 else
282 // Any arguments that don't match are ignored so that they can
283 // be passed to the TAO_Default_Resource_Factory.
284 arg_shifter.ignore_arg ();
287 // If -ORBReactorThreadQueue was passed, make sure it matches the
288 // correct reactor type. Currently, only the tp reactor can take
289 // advantage of the LIFO strategy, select_mt hangs.
290 if (this->threadqueue_type_ != TAO_THREAD_QUEUE_NOT_SET &&
291 this->reactor_type_ != TAO_REACTOR_TP)
292 TAOLIB_DEBUG ((LM_DEBUG,
293 ACE_TEXT ("TAO_Advanced_Resource_Factory: -ORBReactorThreadQueue ")
294 ACE_TEXT ("option can only be used with -ORBReactorType ")
295 ACE_TEXT ("tp.\n")));
296 // Explicitely set the default only if not set.
297 else if (this->threadqueue_type_ == TAO_THREAD_QUEUE_NOT_SET)
298 this->threadqueue_type_ = TAO_THREAD_QUEUE_LIFO;
300 return this->TAO_Default_Resource_Factory::init (argc, argv);
304 TAO_Advanced_Resource_Factory::load_default_protocols ()
306 int const r =
307 this->TAO_Default_Resource_Factory::load_default_protocols ();
309 this->protocol_factories_ =
310 this->TAO_Default_Resource_Factory::protocol_factories_;
312 this->TAO_Default_Resource_Factory::protocol_factories_.reset ();
314 if (r == -1)
315 return -1;
316 // Load the UIOP and SHMIOP protocols...
318 return 0;
323 TAO_Advanced_Resource_Factory::init_protocol_factories ()
325 // If the default resource factory exists, then disable it.
326 // This causes any directives for the "Resource_Factory" to
327 // report warnings.
328 // This is needed to ensure warnings when no static directive
329 // for this factory is used (and init() is not called).
330 TAO_Resource_Factory *default_resource_factory =
331 ACE_Dynamic_Service<TAO_Resource_Factory>::instance ("Resource_Factory");
332 if (default_resource_factory != 0)
334 default_resource_factory->disable_factory();
337 TAO_ProtocolFactorySetItor end = protocol_factories_.end ();
338 TAO_ProtocolFactorySetItor factory = protocol_factories_.begin ();
340 if (factory == end)
342 int const r = this->load_default_protocols ();
344 if (r == -1)
345 return -1;
347 #if TAO_HAS_UIOP == 1
348 if (TAO::details::load_protocol_factory <TAO_UIOP_Protocol_Factory> (
349 this->protocol_factories_, "UIOP_Factory") == -1)
350 return -1;
351 #endif /* TAO_HAS_UIOP == 1 */
353 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
354 if (TAO::details::load_protocol_factory <TAO_SHMIOP_Protocol_Factory> (
355 this->protocol_factories_, "SHMIOP_Factory") == -1)
356 return -1;
357 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
359 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
360 if (TAO::details::load_protocol_factory <TAO_DIOP_Protocol_Factory> (
361 this->protocol_factories_, "DIOP_Factory") == -1)
362 return -1;
363 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
365 #if defined (TAO_HAS_SCIOP) && (TAO_HAS_SCIOP != 0)
366 if (TAO::details::load_protocol_factory <TAO_SCIOP_Protocol_Factory> (
367 this->protocol_factories_, "SCIOP_Factory") == -1)
368 return -1;
369 #endif /* TAO_HAS_SCIOP && TAO_HAS_SCIOP != 0 */
371 #if defined (TAO_HAS_COIOP) && (TAO_HAS_COIOP != 0)
372 if (TAO::details::load_protocol_factory <TAO_COIOP_Protocol_Factory> (
373 this->protocol_factories_, "COIOP_Factory") == -1)
374 return -1;
375 #endif /* TAO_HAS_COIOP && TAO_HAS_COIOP != 0 */
377 return 0;
380 for (; factory != end; factory++)
382 const ACE_CString &name = (*factory)->protocol_name ();
384 (*factory)->factory (
385 ACE_Dynamic_Service<TAO_Protocol_Factory>::instance (name.c_str ()));
386 if ((*factory)->factory () == nullptr)
388 TAOLIB_ERROR_RETURN ((LM_ERROR,
389 ACE_TEXT("TAO (%P|%t) Unable to load ")
390 ACE_TEXT("protocol <%C>, %m\n"),
391 name.c_str ()),
392 -1);
395 if (TAO_debug_level > 0)
397 TAOLIB_DEBUG ((LM_DEBUG,
398 ACE_TEXT("TAO (%P|%t) Loaded protocol <%C>\n"),
399 name.c_str ()));
402 return 0;
406 TAO_ProtocolFactorySet *
407 TAO_Advanced_Resource_Factory::get_protocol_factories ()
409 return &protocol_factories_;
412 ACE_Reactor_Impl *
413 TAO_Advanced_Resource_Factory::allocate_reactor_impl () const
415 ACE_Reactor_Impl *impl = 0;
418 * Hook for specializing the Reactor implementation in TAO.
420 // get a timer queue (or not) from a possibly configured
421 // time policy
422 TAO_RSF_Timer_Queue_Ptr tmq (*this, this->create_timer_queue ());
423 switch (this->reactor_type_)
425 case TAO_REACTOR_SELECT_MT:
426 ACE_NEW_RETURN (impl,
427 TAO_REACTOR (ACE::max_handles (),
429 (ACE_Sig_Handler*)0,
430 tmq.get (),
432 (ACE_Reactor_Notify*)0,
433 this->reactor_mask_signals_),
435 break;
437 case TAO_REACTOR_SELECT_ST:
438 ACE_NEW_RETURN (impl,
439 TAO_NULL_LOCK_REACTOR (ACE::max_handles (),
441 (ACE_Sig_Handler*)0,
442 tmq.get (),
444 (ACE_Reactor_Notify*)0,
445 this->reactor_mask_signals_),
447 break;
449 case TAO_REACTOR_WFMO:
450 #if defined(ACE_WIN32)
451 ACE_NEW_RETURN (impl, ACE_WFMO_Reactor (0, tmq.get ()), 0);
452 #endif /* ACE_WIN32 */
453 break;
455 #if defined(ACE_WIN32) && !defined (ACE_LACKS_MSG_WFMO)
456 case TAO_REACTOR_MSGWFMO:
457 ACE_NEW_RETURN (impl, ACE_Msg_WFMO_Reactor (0, tmq.get ()), 0);
458 break;
459 #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */
461 #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL)
462 case TAO_REACTOR_DEV_POLL:
463 ACE_NEW_RETURN (impl,
464 ACE_Dev_Poll_Reactor (ACE::max_handles (),
465 1, // restart
466 (ACE_Sig_Handler*)0,
467 tmq.get (),
468 0, // Do not disable notify
469 0, // Allocate notify handler
470 this->reactor_mask_signals_,
471 ACE_Select_Reactor_Token::LIFO),
473 break;
474 #endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */
476 default:
477 case TAO_REACTOR_TP:
478 ACE_NEW_RETURN (impl,
479 ACE_TP_Reactor (ACE::max_handles (),
481 (ACE_Sig_Handler*)0,
482 tmq.get (),
483 this->reactor_mask_signals_,
484 this->threadqueue_type_ == TAO_THREAD_QUEUE_FIFO ?
485 ACE_Select_Reactor_Token::FIFO :
486 ACE_Select_Reactor_Token::LIFO),
488 break;
491 // safe to release timer queue
492 tmq.release ();
493 return impl;
496 typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,ACE_Null_Mutex> NULL_LOCK_MALLOC;
497 typedef ACE_Allocator_Adapter<NULL_LOCK_MALLOC> NULL_LOCK_ALLOCATOR;
499 ACE_Allocator *
500 TAO_Advanced_Resource_Factory::input_cdr_dblock_allocator ()
502 ACE_Allocator *allocator = 0;
503 switch (this->cdr_allocator_type_)
505 case TAO_ALLOCATOR_NULL_LOCK:
506 ACE_NEW_RETURN (allocator,
507 NULL_LOCK_ALLOCATOR,
509 break;
510 default:
511 return
512 this->TAO_Default_Resource_Factory::input_cdr_dblock_allocator();
515 return allocator;
518 ACE_Allocator *
519 TAO_Advanced_Resource_Factory::input_cdr_buffer_allocator ()
521 ACE_Allocator *allocator = 0;
522 switch (this->cdr_allocator_type_)
524 case TAO_ALLOCATOR_NULL_LOCK:
525 ACE_NEW_RETURN (allocator,
526 NULL_LOCK_ALLOCATOR,
528 break;
529 default:
530 return
531 this->TAO_Default_Resource_Factory::input_cdr_buffer_allocator();
533 return allocator;
536 ACE_Allocator *
537 TAO_Advanced_Resource_Factory::input_cdr_msgblock_allocator ()
539 ACE_Allocator *allocator = 0;
540 switch (this->cdr_allocator_type_)
542 case TAO_ALLOCATOR_NULL_LOCK:
543 ACE_NEW_RETURN (allocator,
544 NULL_LOCK_ALLOCATOR,
546 break;
547 default:
548 return
549 this->TAO_Default_Resource_Factory::input_cdr_msgblock_allocator();
552 return allocator;
555 ACE_Allocator *
556 TAO_Advanced_Resource_Factory::amh_response_handler_allocator ()
558 ACE_Allocator *allocator = 0;
559 switch (this->amh_response_handler_allocator_lock_type_)
561 case TAO_ALLOCATOR_NULL_LOCK:
562 ACE_NEW_RETURN (allocator,
563 NULL_LOCK_ALLOCATOR,
565 break;
566 default:
567 return
568 this->TAO_Default_Resource_Factory::amh_response_handler_allocator();
571 return allocator;
574 ACE_Allocator *
575 TAO_Advanced_Resource_Factory::ami_response_handler_allocator ()
577 ACE_Allocator *allocator = 0;
578 switch (this->ami_response_handler_allocator_lock_type_)
580 case TAO_ALLOCATOR_NULL_LOCK:
581 ACE_NEW_RETURN (allocator,
582 NULL_LOCK_ALLOCATOR,
584 break;
585 default:
586 return
587 this->TAO_Default_Resource_Factory::ami_response_handler_allocator();
590 return allocator;
594 TAO_Advanced_Resource_Factory::input_cdr_allocator_type_locked ()
596 return this->cdr_allocator_type_ == TAO_ALLOCATOR_NULL_LOCK ? 0 : 1;
599 TAO_Connection_Purging_Strategy *
600 TAO_Advanced_Resource_Factory::create_purging_strategy ()
602 TAO_Connection_Purging_Strategy *strategy = 0;
604 switch(this->connection_purging_type_)
606 case TAO_Resource_Factory::LFU:
607 ACE_NEW_RETURN (strategy,
608 TAO_LFU_Connection_Purging_Strategy (
609 this->cache_maximum ()),
611 break;
612 case TAO_Resource_Factory::FIFO:
613 ACE_NEW_RETURN (strategy,
614 TAO_FIFO_Connection_Purging_Strategy (
615 this->cache_maximum ()),
617 break;
618 case TAO_Resource_Factory::NOOP:
619 ACE_NEW_RETURN (strategy,
620 TAO_NULL_Connection_Purging_Strategy (
621 this->cache_maximum ()),
623 break;
624 case TAO_Resource_Factory::LRU:
625 ACE_NEW_RETURN (strategy,
626 TAO_LRU_Connection_Purging_Strategy (
627 this->cache_maximum ()),
629 break;
630 default:
631 TAOLIB_ERROR ((LM_ERROR,
632 ACE_TEXT("TAO (%P|%t) - ")
633 ACE_TEXT("Unknown connection purging strategy ")
634 ACE_TEXT("type was found.\n")));
637 return strategy;
640 TAO_LF_Strategy *
641 TAO_Advanced_Resource_Factory::create_lf_strategy ()
643 TAO_LF_Strategy *strategy = 0;
645 if (this->reactor_type_ == TAO_REACTOR_SELECT_ST)
647 ACE_NEW_RETURN (strategy,
648 TAO_LF_Strategy_Null,
651 else
653 ACE_NEW_RETURN (strategy,
654 TAO_LF_Strategy_Complete,
657 return strategy;
660 void
661 TAO_Advanced_Resource_Factory::report_option_value_error (
662 const ACE_TCHAR* option_name,
663 const ACE_TCHAR* option_value)
665 TAOLIB_DEBUG((LM_DEBUG,
666 ACE_TEXT("Advanced_Resource_Factory - unknown argument")
667 ACE_TEXT(" <%s> for <%s>\n"),
668 option_value,
669 option_name));
672 void
673 TAO_Advanced_Resource_Factory::report_unsupported_error (
674 const ACE_TCHAR* option_name)
676 TAOLIB_DEBUG((LM_DEBUG,
677 ACE_TEXT("Advanced_Resource_Factory - <%s>")
678 ACE_TEXT(" not supported on this platform\n"),
679 option_name));
683 // ****************************************************************
685 ACE_STATIC_SVC_DEFINE (TAO_Advanced_Resource_Factory,
686 ACE_TEXT("Advanced_Resource_Factory"),
687 ACE_SVC_OBJ_T,
688 &ACE_SVC_NAME (TAO_Advanced_Resource_Factory),
689 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
691 ACE_FACTORY_DEFINE (TAO_Strategies, TAO_Advanced_Resource_Factory)
693 // ****************************************************************
694 TAO_END_VERSIONED_NAMESPACE_DECL