#include <advanced_resource.h>
Inheritance diagram for TAO_Advanced_Resource_Factory:
Using a <{resource source specifier}> as a discriminator, the factory can return resource instances which are, e.g., global, stored in thread-specific storage, stored in shared memory, etc.
Definition at line 39 of file advanced_resource.h.
|
Type of Reactor.
Definition at line 62 of file advanced_resource.h.
00063 { 00064 /// Use ACE_Token 00065 TAO_REACTOR_SELECT_MT = 1, 00066 00067 /// Use ACE_Noop_Token 00068 TAO_REACTOR_SELECT_ST = 2, 00069 TAO_REACTOR_WFMO = 3, 00070 TAO_REACTOR_MSGWFMO = 4, 00071 TAO_REACTOR_TP = 5, 00072 TAO_REACTOR_DEV_POLL = 6 00073 }; |
|
Thread queueing Strategy.
Definition at line 76 of file advanced_resource.h.
00077 { 00078 /// Not set, use LIFO. 00079 TAO_THREAD_QUEUE_NOT_SET, 00080 00081 /// FIFO, first-in-first-out. 00082 TAO_THREAD_QUEUE_FIFO, 00083 00084 /// LIFO, last-in-first-out (default). 00085 TAO_THREAD_QUEUE_LIFO 00086 }; |
|
Type of lock used for the allocators.
Definition at line 55 of file advanced_resource.h.
00056 { 00057 TAO_ALLOCATOR_NULL_LOCK, 00058 TAO_ALLOCATOR_THREAD_LOCK 00059 }; |
|
Constructor.
Definition at line 69 of file advanced_resource.cpp.
00070 : reactor_type_ (TAO_REACTOR_TP), 00071 threadqueue_type_ (TAO_THREAD_QUEUE_NOT_SET), 00072 cdr_allocator_type_ (TAO_ALLOCATOR_THREAD_LOCK), 00073 amh_response_handler_allocator_lock_type_ (TAO_ALLOCATOR_THREAD_LOCK), 00074 ami_response_handler_allocator_lock_type_ (TAO_ALLOCATOR_THREAD_LOCK) 00075 { 00076 // Constructor 00077 } |
|
Destructor.
Definition at line 79 of file advanced_resource.cpp. References TAO_ProtocolFactorySetItor.
00080 { 00081 // Destructor 00082 TAO_ProtocolFactorySetItor end = this->protocol_factories_.end (); 00083 00084 for (TAO_ProtocolFactorySetItor iterator = 00085 this->protocol_factories_.begin (); 00086 iterator != end; 00087 ++iterator) 00088 delete *iterator; 00089 00090 this->protocol_factories_.reset (); 00091 } |
|
Obtain the reactor implementation.
Reimplemented from TAO_Default_Resource_Factory. Definition at line 416 of file advanced_resource.cpp. References ACE_NEW_RETURN, ACE_Timer_Queue, reactor_type_, TAO_NULL_LOCK_REACTOR, TAO_REACTOR, and TAO_THREAD_QUEUE_FIFO.
00417 { 00418 ACE_Reactor_Impl *impl = 0; 00419 00420 /* 00421 * Hook for specializing the Reactor implementation in TAO. 00422 */ 00423 //@@ TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START 00424 switch (this->reactor_type_) 00425 { 00426 case TAO_REACTOR_SELECT_MT: 00427 ACE_NEW_RETURN (impl, 00428 TAO_REACTOR ((ACE_Sig_Handler*)0, 00429 (ACE_Timer_Queue*)0, 00430 0, 00431 (ACE_Reactor_Notify*)0, 00432 this->reactor_mask_signals_), 00433 0); 00434 break; 00435 00436 case TAO_REACTOR_SELECT_ST: 00437 ACE_NEW_RETURN (impl, 00438 TAO_NULL_LOCK_REACTOR ((ACE_Sig_Handler*)0, 00439 (ACE_Timer_Queue*)0, 00440 0, 00441 (ACE_Reactor_Notify*)0, 00442 this->reactor_mask_signals_), 00443 0); 00444 break; 00445 00446 case TAO_REACTOR_WFMO: 00447 #if defined(ACE_WIN32) 00448 ACE_NEW_RETURN (impl, ACE_WFMO_Reactor, 0); 00449 #endif /* ACE_WIN32 */ 00450 break; 00451 00452 #if defined(ACE_WIN32) \ 00453 && !defined (ACE_LACKS_MSG_WFMO) \ 00454 && !defined (ACE_HAS_WINCE) \ 00455 && !defined (ACE_HAS_PHARLAP) 00456 case TAO_REACTOR_MSGWFMO: 00457 ACE_NEW_RETURN (impl, ACE_Msg_WFMO_Reactor, 0); 00458 break; 00459 #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */ 00460 00461 #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) 00462 case TAO_REACTOR_DEV_POLL: 00463 ACE_NEW_RETURN (impl, 00464 ACE_Dev_Poll_Reactor (ACE::max_handles (), 00465 1, // restart 00466 (ACE_Sig_Handler*)0, 00467 (ACE_Timer_Queue*)0, 00468 0, // Do not disable notify 00469 0, // Allocate notify handler 00470 this->reactor_mask_signals_, 00471 ACE_Select_Reactor_Token::LIFO), 00472 0); 00473 break; 00474 #endif /* ACE_HAS_EVENT_POLL || ACE_HAS_DEV_POLL */ 00475 00476 default: 00477 case TAO_REACTOR_TP: 00478 ACE_NEW_RETURN (impl, 00479 ACE_TP_Reactor (ACE::max_handles (), 00480 1, 00481 (ACE_Sig_Handler*)0, 00482 (ACE_Timer_Queue*)0, 00483 this->reactor_mask_signals_, 00484 this->threadqueue_type_ == TAO_THREAD_QUEUE_FIFO ? 00485 ACE_Select_Reactor_Token::FIFO : 00486 ACE_Select_Reactor_Token::LIFO), 00487 0); 00488 break; 00489 } 00490 00491 //@@ TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END 00492 00493 return impl; 00494 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 556 of file advanced_resource.cpp. References ACE_NEW_RETURN, TAO_Default_Resource_Factory::amh_response_handler_allocator(), amh_response_handler_allocator_lock_type_, NULL_LOCK_ALLOCATOR, and TAO_ALLOCATOR_NULL_LOCK.
00557 { 00558 ACE_Allocator *allocator = 0; 00559 switch (this->amh_response_handler_allocator_lock_type_) 00560 { 00561 case TAO_ALLOCATOR_NULL_LOCK: 00562 ACE_NEW_RETURN (allocator, 00563 NULL_LOCK_ALLOCATOR, 00564 0); 00565 break; 00566 default: 00567 return 00568 this->TAO_Default_Resource_Factory::amh_response_handler_allocator(); 00569 } 00570 00571 return allocator; 00572 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 575 of file advanced_resource.cpp. References ACE_NEW_RETURN, TAO_Default_Resource_Factory::ami_response_handler_allocator(), ami_response_handler_allocator_lock_type_, NULL_LOCK_ALLOCATOR, and TAO_ALLOCATOR_NULL_LOCK.
00576 { 00577 ACE_Allocator *allocator = 0; 00578 switch (this->ami_response_handler_allocator_lock_type_) 00579 { 00580 case TAO_ALLOCATOR_NULL_LOCK: 00581 ACE_NEW_RETURN (allocator, 00582 NULL_LOCK_ALLOCATOR, 00583 0); 00584 break; 00585 default: 00586 return 00587 this->TAO_Default_Resource_Factory::ami_response_handler_allocator(); 00588 } 00589 00590 return allocator; 00591 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 641 of file advanced_resource.cpp. References ACE_NEW_RETURN, and reactor_type_.
00642 { 00643 TAO_LF_Strategy *strategy = 0; 00644 00645 if (this->reactor_type_ == TAO_REACTOR_SELECT_ST) 00646 { 00647 ACE_NEW_RETURN (strategy, 00648 TAO_LF_Strategy_Null, 00649 0); 00650 } 00651 else 00652 { 00653 ACE_NEW_RETURN (strategy, 00654 TAO_LF_Strategy_Complete, 00655 0); 00656 } 00657 return strategy; 00658 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 600 of file advanced_resource.cpp. References ACE_ERROR, ACE_NEW_RETURN, ACE_TEXT, and LM_ERROR.
00601 { 00602 TAO_Connection_Purging_Strategy *strategy = 0; 00603 00604 switch(this->connection_purging_type_) 00605 { 00606 case TAO_Resource_Factory::LFU: 00607 ACE_NEW_RETURN (strategy, 00608 TAO_LFU_Connection_Purging_Strategy ( 00609 this->cache_maximum ()), 00610 0); 00611 break; 00612 case TAO_Resource_Factory::FIFO: 00613 ACE_NEW_RETURN (strategy, 00614 TAO_FIFO_Connection_Purging_Strategy ( 00615 this->cache_maximum ()), 00616 0); 00617 break; 00618 case TAO_Resource_Factory::NOOP: 00619 ACE_NEW_RETURN (strategy, 00620 TAO_NULL_Connection_Purging_Strategy ( 00621 this->cache_maximum ()), 00622 0); 00623 break; 00624 case TAO_Resource_Factory::LRU: 00625 ACE_NEW_RETURN (strategy, 00626 TAO_LRU_Connection_Purging_Strategy ( 00627 this->cache_maximum ()), 00628 0); 00629 break; 00630 default: 00631 ACE_ERROR ((LM_ERROR, 00632 ACE_TEXT("TAO (%P|%t) - ") 00633 ACE_TEXT("Unknown connection purging strategy ") 00634 ACE_TEXT("type was found.\n"))); 00635 } 00636 00637 return strategy; 00638 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 410 of file advanced_resource.cpp.
00411 { 00412 return &protocol_factories_; 00413 } |
|
Dynamic linking hook.
Reimplemented from TAO_Default_Resource_Factory. |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 323 of file advanced_resource.cpp. References ACE_CString, ACE_DEBUG, ACE_ERROR_RETURN, ACE_TEXT, ACE_TEXT_CHAR_TO_TCHAR, TAO_Resource_Factory::disable_factory(), ACE_Dynamic_Service< TYPE >::instance(), LM_DEBUG, LM_ERROR, load_default_protocols(), TAO_debug_level, and TAO_ProtocolFactorySetItor.
00324 { 00325 00326 // If the default resource factory exists, then disable it. 00327 // This causes any directives for the "Resource_Factory" to 00328 // report warnings. 00329 // This is needed to ensure warnings when no static directive 00330 // for this factory is used (and init() is not called). 00331 TAO_Resource_Factory *default_resource_factory = 00332 ACE_Dynamic_Service<TAO_Resource_Factory>::instance ("Resource_Factory"); 00333 if (default_resource_factory != 0) 00334 { 00335 default_resource_factory->disable_factory(); 00336 } 00337 00338 TAO_ProtocolFactorySetItor end = protocol_factories_.end (); 00339 TAO_ProtocolFactorySetItor factory = protocol_factories_.begin (); 00340 00341 if (factory == end) 00342 { 00343 int const r = this->load_default_protocols (); 00344 00345 if (r == -1) 00346 return -1; 00347 00348 #if TAO_HAS_UIOP == 1 00349 if (TAO::details::load_protocol_factory <TAO_UIOP_Protocol_Factory> ( 00350 this->protocol_factories_, "UIOP_Factory") == -1) 00351 return -1; 00352 #endif /* TAO_HAS_UIOP == 1 */ 00353 00354 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0) 00355 if (TAO::details::load_protocol_factory <TAO_SHMIOP_Protocol_Factory> ( 00356 this->protocol_factories_, "SHMIOP_Factory") == -1) 00357 return -1; 00358 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */ 00359 00360 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0) 00361 if (TAO::details::load_protocol_factory <TAO_DIOP_Protocol_Factory> ( 00362 this->protocol_factories_, "DIOP_Factory") == -1) 00363 return -1; 00364 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */ 00365 00366 #if defined (TAO_HAS_SCIOP) && (TAO_HAS_SCIOP != 0) 00367 if (TAO::details::load_protocol_factory <TAO_SCIOP_Protocol_Factory> ( 00368 this->protocol_factories_, "SCIOP_Factory") == -1) 00369 return -1; 00370 #endif /* TAO_HAS_SCIOP && TAO_HAS_SCIOP != 0 */ 00371 00372 #if defined (TAO_HAS_COIOP) && (TAO_HAS_COIOP != 0) 00373 if (TAO::details::load_protocol_factory <TAO_COIOP_Protocol_Factory> ( 00374 this->protocol_factories_, "COIOP_Factory") == -1) 00375 return -1; 00376 #endif /* TAO_HAS_COIOP && TAO_HAS_COIOP != 0 */ 00377 00378 return 0; 00379 00380 } 00381 00382 for (; factory != end; factory++) 00383 { 00384 const ACE_CString &name = (*factory)->protocol_name (); 00385 00386 (*factory)->factory ( 00387 ACE_Dynamic_Service<TAO_Protocol_Factory>::instance (name.c_str ())); 00388 if ((*factory)->factory () == 0) 00389 { 00390 ACE_ERROR_RETURN ((LM_ERROR, 00391 ACE_TEXT("TAO (%P|%t) Unable to load ") 00392 ACE_TEXT("protocol <%s>, %m\n"), 00393 ACE_TEXT_CHAR_TO_TCHAR(name.c_str ())), 00394 -1); 00395 } 00396 00397 if (TAO_debug_level > 0) 00398 { 00399 ACE_DEBUG ((LM_DEBUG, 00400 ACE_TEXT("TAO (%P|%t) Loaded protocol <%s>\n"), 00401 ACE_TEXT_CHAR_TO_TCHAR(name.c_str ()))); 00402 } 00403 } 00404 return 0; 00405 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 594 of file advanced_resource.cpp. References cdr_allocator_type_, and TAO_ALLOCATOR_NULL_LOCK.
00595 { 00596 return this->cdr_allocator_type_ == TAO_ALLOCATOR_NULL_LOCK ? 0 : 1; 00597 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 519 of file advanced_resource.cpp. References ACE_NEW_RETURN, cdr_allocator_type_, TAO_Default_Resource_Factory::input_cdr_buffer_allocator(), NULL_LOCK_ALLOCATOR, and TAO_ALLOCATOR_NULL_LOCK.
00520 { 00521 ACE_Allocator *allocator = 0; 00522 switch (this->cdr_allocator_type_) 00523 { 00524 case TAO_ALLOCATOR_NULL_LOCK: 00525 ACE_NEW_RETURN (allocator, 00526 NULL_LOCK_ALLOCATOR, 00527 0); 00528 break; 00529 default: 00530 return 00531 this->TAO_Default_Resource_Factory::input_cdr_buffer_allocator(); 00532 } 00533 return allocator; 00534 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 500 of file advanced_resource.cpp. References ACE_NEW_RETURN, cdr_allocator_type_, TAO_Default_Resource_Factory::input_cdr_dblock_allocator(), NULL_LOCK_ALLOCATOR, and TAO_ALLOCATOR_NULL_LOCK.
00501 { 00502 ACE_Allocator *allocator = 0; 00503 switch (this->cdr_allocator_type_) 00504 { 00505 case TAO_ALLOCATOR_NULL_LOCK: 00506 ACE_NEW_RETURN (allocator, 00507 NULL_LOCK_ALLOCATOR, 00508 0); 00509 break; 00510 default: 00511 return 00512 this->TAO_Default_Resource_Factory::input_cdr_dblock_allocator(); 00513 } 00514 00515 return allocator; 00516 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 537 of file advanced_resource.cpp. References ACE_NEW_RETURN, cdr_allocator_type_, TAO_Default_Resource_Factory::input_cdr_msgblock_allocator(), NULL_LOCK_ALLOCATOR, and TAO_ALLOCATOR_NULL_LOCK.
00538 { 00539 ACE_Allocator *allocator = 0; 00540 switch (this->cdr_allocator_type_) 00541 { 00542 case TAO_ALLOCATOR_NULL_LOCK: 00543 ACE_NEW_RETURN (allocator, 00544 NULL_LOCK_ALLOCATOR, 00545 0); 00546 break; 00547 default: 00548 return 00549 this->TAO_Default_Resource_Factory::input_cdr_msgblock_allocator(); 00550 } 00551 00552 return allocator; 00553 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 304 of file advanced_resource.cpp. References TAO_Default_Resource_Factory::load_default_protocols(). Referenced by init_protocol_factories().
00305 { 00306 const int r = 00307 this->TAO_Default_Resource_Factory::load_default_protocols (); 00308 00309 this->protocol_factories_ = 00310 this->TAO_Default_Resource_Factory::protocol_factories_; 00311 00312 this->TAO_Default_Resource_Factory::protocol_factories_.reset (); 00313 00314 if (r == -1) 00315 return -1; 00316 // Load the UIOP and SHMIOP protocols... 00317 00318 return 0; 00319 } |
|
Reimplemented from TAO_Default_Resource_Factory. Definition at line 661 of file advanced_resource.cpp. References ACE_DEBUG, ACE_TEXT, and LM_DEBUG.
|
|
Definition at line 673 of file advanced_resource.cpp. References ACE_DEBUG, ACE_TEXT, and LM_DEBUG.
|
|
Type of lock used by AMH response handler allocator.
Definition at line 132 of file advanced_resource.h. Referenced by amh_response_handler_allocator(). |
|
Type of lock used by AMI response handler allocator.
Definition at line 135 of file advanced_resource.h. Referenced by ami_response_handler_allocator(). |
|
The type of CDR allocators.
Definition at line 129 of file advanced_resource.h. Referenced by input_cdr_allocator_type_locked(), input_cdr_buffer_allocator(), input_cdr_dblock_allocator(), and input_cdr_msgblock_allocator(). |
|
List of loaded protocol factories.
Reimplemented from TAO_Default_Resource_Factory. Definition at line 116 of file advanced_resource.h. |
|
The type of reactor registry.
Definition at line 119 of file advanced_resource.h. |
|
Flag indicating which kind of reactor we should use.
Definition at line 122 of file advanced_resource.h. Referenced by allocate_reactor_impl(), and create_lf_strategy(). |
|
The type of queueing strategy to use for multi-threaded select reactors, TAO_REACTOR_SELECT_MT and TAO_REACTOR_TP. Definition at line 126 of file advanced_resource.h. |