#include <default_resource.h>
Inheritance diagram for TAO_Default_Resource_Factory:
Member Accessors | |
enum | { TAO_ALLOCATOR_THREAD_LOCK } |
int | get_parser_names (char **&names, int &number_of_names) |
int | cdr_allocator_source (void) |
Modify and get the source for the CDR allocators. | |
virtual int | use_locked_data_blocks (void) const |
virtual ACE_Reactor * | get_reactor (void) |
Return an ACE_Reactor to be utilized. | |
virtual void | reclaim_reactor (ACE_Reactor *) |
Reclaim reactor resources (e.g. deallocate, etc). | |
virtual TAO_Acceptor_Registry * | get_acceptor_registry (void) |
Return a reference to the acceptor registry. | |
virtual TAO_Connector_Registry * | get_connector_registry (void) |
Return a connector to be utilized. | |
virtual void | use_local_memory_pool (bool) |
Return the Allocator's memory pool type. | |
virtual ACE_Allocator * | input_cdr_dblock_allocator (void) |
virtual ACE_Allocator * | input_cdr_buffer_allocator (void) |
virtual ACE_Allocator * | input_cdr_msgblock_allocator (void) |
virtual int | input_cdr_allocator_type_locked (void) |
virtual ACE_Allocator * | output_cdr_dblock_allocator (void) |
virtual ACE_Allocator * | output_cdr_buffer_allocator (void) |
virtual ACE_Allocator * | output_cdr_msgblock_allocator (void) |
virtual ACE_Allocator * | amh_response_handler_allocator (void) |
Access the AMH response handler allocator. | |
virtual ACE_Allocator * | ami_response_handler_allocator (void) |
Access the AMI response handler allocator. | |
virtual TAO_ProtocolFactorySet * | get_protocol_factories (void) |
virtual int | init_protocol_factories (void) |
virtual TAO_Codeset_Manager * | codeset_manager (void) |
Gets the codeset manager. | |
virtual int | cache_maximum (void) const |
This denotes the maximum number of connections that can be cached. | |
virtual int | purge_percentage (void) const |
virtual int | max_muxed_connections (void) const |
virtual ACE_Lock * | create_cached_connection_lock (void) |
virtual ACE_Lock * | create_object_key_table_lock (void) |
Creates a lock needed for the table that stores the object keys. | |
virtual TAO_Configurable_Refcount | create_corba_object_refcount (void) |
Creates the configurable refcount for the CORBA Object. | |
virtual ACE_Lock * | create_corba_object_lock (void) |
Creates the lock for the CORBA Object. | |
virtual int | locked_transport_cache (void) |
virtual TAO_Flushing_Strategy * | create_flushing_strategy (void) |
virtual TAO_Connection_Purging_Strategy * | create_purging_strategy (void) |
Creates the connection purging strategy. | |
TAO_Resource_Factory::Resource_Usage | resource_usage_strategy (void) const |
Return the resource usage strategy. | |
virtual TAO_LF_Strategy * | create_lf_strategy (void) |
virtual auto_ptr< TAO_GIOP_Fragmentation_Strategy > | create_fragmentation_strategy (TAO_Transport *transport, CORBA::ULong max_message_size) const |
Outgoing fragment creation strategy. | |
virtual void | disable_factory (void) |
virtual bool | drop_replies_during_shutdown (void) const |
Public Member Functions | |
TAO_Default_Resource_Factory (void) | |
Constructor. | |
virtual | ~TAO_Default_Resource_Factory (void) |
Destructor. | |
Service Configurator Hooks | |
virtual int | init (int argc, ACE_TCHAR *argv[]) |
Dynamic linking hook. | |
int | parse_args (int argc, ACE_TCHAR *argv[]) |
Parse svc.conf arguments. | |
Protected Types | |
LOCAL_MEMORY_POOL | |
DEFAULT | |
enum | Output_CDR_Allocator_Type { LOCAL_MEMORY_POOL, DEFAULT } |
Protected Member Functions | |
virtual ACE_Reactor_Impl * | allocate_reactor_impl (void) const |
Obtain the reactor implementation. | |
int | add_to_ior_parser_names (const char *) |
Add a Parser name to the list of Parser names. | |
void | report_option_value_error (const ACE_TCHAR *option_name, const ACE_TCHAR *option_value) |
virtual int | load_default_protocols (void) |
Protected Attributes | |
int | use_locked_data_blocks_ |
The type of data blocks that the ORB should use. | |
int | parser_names_count_ |
The number of the different types of Parsers. | |
char ** | parser_names_ |
Array consisting of the names of the parsers. | |
int | index_ |
Index of the current element in the parser_names_ array. | |
TAO_ProtocolFactorySet | protocol_factories_ |
list of loaded protocol factories. | |
TAO_Resource_Factory::Purging_Strategy | connection_purging_type_ |
int | cache_maximum_ |
int | purge_percentage_ |
int | max_muxed_connections_ |
int | reactor_mask_signals_ |
If <0> then we create reactors with signal handling disabled. | |
bool | dynamically_allocated_reactor_ |
int | options_processed_ |
int | factory_disabled_ |
Output_CDR_Allocator_Type | output_cdr_allocator_type_ |
Type of allocator to use for output CDR buffers. | |
bool | use_local_memory_pool_ |
Private Types | |
TAO_NULL_LOCK | |
TAO_THREAD_LOCK | |
TAO_LEADER_FOLLOWER_FLUSHING | |
TAO_REACTIVE_FLUSHING | |
TAO_BLOCKING_FLUSHING | |
enum | Lock_Type { TAO_NULL_LOCK, TAO_THREAD_LOCK } |
enum | Flushing_Strategy_Type { TAO_LEADER_FOLLOWER_FLUSHING, TAO_REACTIVE_FLUSHING, TAO_BLOCKING_FLUSHING } |
Private Attributes | |
Lock_Type | cached_connection_lock_type_ |
Type of lock used by the cached connector. | |
Lock_Type | object_key_table_lock_type_ |
Type of lock used by the corba object. | |
Lock_Type | corba_object_lock_type_ |
Type of lock used by the corba object. | |
Flushing_Strategy_Type | flushing_strategy_type_ |
Type of flushing strategy configured. | |
TAO_Codeset_Parameters | char_codeset_parameters_ |
TAO_Codeset_Parameters | wchar_codeset_parameters_ |
Resource_Usage | resource_usage_strategy_ |
Resource usage strategy. | |
bool | drop_replies_ |
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 116 of file default_resource.h.
anonymous enum |
enum TAO_Default_Resource_Factory::Flushing_Strategy_Type [private] |
Definition at line 299 of file default_resource.h.
00300 { 00301 TAO_LEADER_FOLLOWER_FLUSHING, 00302 TAO_REACTIVE_FLUSHING, 00303 TAO_BLOCKING_FLUSHING 00304 };
enum TAO_Default_Resource_Factory::Lock_Type [private] |
Definition at line 284 of file default_resource.h.
00285 { 00286 TAO_NULL_LOCK, 00287 TAO_THREAD_LOCK 00288 };
enum TAO_Default_Resource_Factory::Output_CDR_Allocator_Type [protected] |
Definition at line 267 of file default_resource.h.
00268 { 00269 LOCAL_MEMORY_POOL, 00270 #if TAO_HAS_SENDFILE == 1 00271 MMAP_ALLOCATOR, 00272 #endif /* TAO_HAS_SENDFILE == 1*/ 00273 DEFAULT 00274 };
TAO_Default_Resource_Factory::TAO_Default_Resource_Factory | ( | void | ) |
Constructor.
Definition at line 101 of file default_resource.cpp.
References resource_usage_strategy_, and TAO_Resource_Factory::TAO_LAZY.
00102 : use_locked_data_blocks_ (1) 00103 , parser_names_count_ (0) 00104 , parser_names_ (0) 00105 , protocol_factories_ () 00106 , connection_purging_type_ (TAO_CONNECTION_PURGING_STRATEGY) 00107 , cache_maximum_ (TAO_CONNECTION_CACHE_MAXIMUM) 00108 , purge_percentage_ (TAO_PURGE_PERCENT) 00109 , max_muxed_connections_ (0) 00110 , reactor_mask_signals_ (1) 00111 , dynamically_allocated_reactor_ (false) 00112 , options_processed_ (0) 00113 , factory_disabled_ (0) 00114 #if TAO_USE_OUTPUT_CDR_MMAP_MEMORY_POOL == 1 00115 , output_cdr_allocator_type_ (MMAP_ALLOCATOR) 00116 #else 00117 , output_cdr_allocator_type_ (DEFAULT) 00118 #endif 00119 #if TAO_USE_LOCAL_MEMORY_POOL == 1 00120 , use_local_memory_pool_ (true) 00121 #else 00122 , use_local_memory_pool_ (false) 00123 #endif 00124 , cached_connection_lock_type_ (TAO_THREAD_LOCK) 00125 , object_key_table_lock_type_ (TAO_THREAD_LOCK) 00126 , corba_object_lock_type_ (TAO_THREAD_LOCK) 00127 , flushing_strategy_type_ (TAO_LEADER_FOLLOWER_FLUSHING) 00128 , char_codeset_parameters_ () 00129 , wchar_codeset_parameters_ () 00130 , resource_usage_strategy_ (TAO_Resource_Factory::TAO_EAGER) 00131 , drop_replies_ (true) 00132 { 00133 #if TAO_USE_LAZY_RESOURCE_USAGE_STRATEGY == 1 00134 this->resource_usage_strategy_ = 00135 TAO_Resource_Factory::TAO_LAZY; 00136 #endif /*TAO_USE_LAZY_RESOURCE_USAGE_STRATEGY*/ 00137 00138 00139 }
TAO_Default_Resource_Factory::~TAO_Default_Resource_Factory | ( | void | ) | [virtual] |
Destructor.
Definition at line 141 of file default_resource.cpp.
References ACE_Unbounded_Set_Ex< T, C >::end(), parser_names_count_, protocol_factories_, ACE_Unbounded_Set_Ex< T, C >::reset(), and CORBA::string_free().
00142 { 00143 const TAO_ProtocolFactorySetItor end = this->protocol_factories_.end (); 00144 00145 for (TAO_ProtocolFactorySetItor iterator = 00146 this->protocol_factories_.begin (); 00147 iterator != end; 00148 ++iterator) 00149 { 00150 delete *iterator; 00151 } 00152 00153 this->protocol_factories_.reset (); 00154 00155 for (int i = 0; i < this->parser_names_count_; ++i) 00156 CORBA::string_free (this->parser_names_[i]); 00157 00158 delete [] this->parser_names_; 00159 }
int TAO_Default_Resource_Factory::add_to_ior_parser_names | ( | const char * | ) | [protected] |
Add a Parser name to the list of Parser names.
Definition at line 666 of file default_resource.cpp.
References index_, parser_names_, and CORBA::string_dup().
00667 { 00668 this->parser_names_[this->index_] = CORBA::string_dup (curarg); 00669 00670 ++this->index_; 00671 00672 return 0; 00673 }
ACE_Reactor_Impl * TAO_Default_Resource_Factory::allocate_reactor_impl | ( | void | ) | const [protected, virtual] |
Obtain the reactor implementation.
Definition at line 790 of file default_resource.cpp.
References ACE_NEW_RETURN, and ACE::max_handles().
00791 { 00792 ACE_Reactor_Impl *impl = 0; 00793 /* 00794 * Hook to specialize TAO's reactor implementation. 00795 */ 00796 //@@ TAO_REACTOR_SPL_COMMENT_HOOK_START 00797 ACE_NEW_RETURN (impl, 00798 ACE_TP_Reactor (ACE::max_handles (), 00799 1, 00800 (ACE_Sig_Handler*)0, 00801 (ACE_Timer_Queue*)0, 00802 this->reactor_mask_signals_, 00803 ACE_Select_Reactor_Token::LIFO), 00804 0); 00805 //@@ TAO_REACTOR_SPL_COMMENT_HOOK_END 00806 return impl; 00807 }
ACE_Allocator * TAO_Default_Resource_Factory::amh_response_handler_allocator | ( | void | ) | [virtual] |
Access the AMH response handler allocator.
Reimplemented from TAO_Resource_Factory.
Definition at line 991 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00992 { 00993 ACE_Allocator *allocator = 0; 00994 if (use_local_memory_pool_) 00995 { 00996 ACE_NEW_RETURN (allocator, 00997 LOCKED_ALLOCATOR_POOL, 00998 0); 00999 } 01000 else 01001 { 01002 ACE_NEW_RETURN (allocator, 01003 LOCKED_ALLOCATOR_NO_POOL, 01004 0); 01005 } 01006 01007 return allocator; 01008 }
ACE_Allocator * TAO_Default_Resource_Factory::ami_response_handler_allocator | ( | void | ) | [virtual] |
Access the AMI response handler allocator.
Reimplemented from TAO_Resource_Factory.
Definition at line 1011 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
01012 { 01013 ACE_Allocator *allocator = 0; 01014 if (use_local_memory_pool_) 01015 { 01016 ACE_NEW_RETURN (allocator, 01017 LOCKED_ALLOCATOR_POOL, 01018 0); 01019 } 01020 else 01021 { 01022 ACE_NEW_RETURN (allocator, 01023 LOCKED_ALLOCATOR_NO_POOL, 01024 0); 01025 } 01026 01027 return allocator; 01028 }
int TAO_Default_Resource_Factory::cache_maximum | ( | void | ) | const [virtual] |
This denotes the maximum number of connections that can be cached.
Reimplemented from TAO_Resource_Factory.
Definition at line 1031 of file default_resource.cpp.
References cache_maximum_.
01032 { 01033 return this->cache_maximum_; 01034 }
int TAO_Default_Resource_Factory::cdr_allocator_source | ( | void | ) |
Modify and get the source for the CDR allocators.
TAO_Codeset_Manager * TAO_Default_Resource_Factory::codeset_manager | ( | void | ) | [virtual] |
Gets the codeset manager.
Reimplemented from TAO_Resource_Factory.
Definition at line 1251 of file default_resource.cpp.
References ACE_DEBUG, TAO_Codeset_Parameters::apply_to(), TAO_Codeset_Manager::char_codeset_descriptor(), char_codeset_parameters_, TAO_Codeset_Manager_Factory_Base::create(), ACE_Dynamic_Service< TYPE >::instance(), LM_DEBUG, LM_INFO, ACE_Auto_Basic_Ptr< X >::release(), TAO_debug_level, TAO_Codeset_Manager::wchar_codeset_descriptor(), and wchar_codeset_parameters_.
01252 { 01253 TAO_Codeset_Manager_Factory_Base *factory = 01254 ACE_Dynamic_Service<TAO_Codeset_Manager_Factory_Base>::instance ("TAO_Codeset"); 01255 01256 if (factory == 0) 01257 { 01258 if (TAO_debug_level >= 2) 01259 ACE_DEBUG ((LM_DEBUG, 01260 ACE_TEXT ("TAO (%P|%t) Default_Resource_Factory") 01261 ACE_TEXT (" - unable to find codeset manager factory.\n"))); 01262 return 0; 01263 } 01264 01265 TAO_Codeset_Manager* mgr = factory->create (); 01266 01267 if (mgr == 0) 01268 { 01269 if (TAO_debug_level >= 2) 01270 ACE_DEBUG ((LM_INFO, 01271 ACE_TEXT ("TAO (%P|%t) Default_Resource_Factory") 01272 ACE_TEXT (" - unable to create codeset manager.\n"))); 01273 return 0; 01274 } 01275 01276 01277 ACE_Auto_Ptr<TAO_Codeset_Manager> safemgr (mgr); 01278 01279 if (TAO_debug_level >= 1) 01280 ACE_DEBUG ((LM_DEBUG, 01281 ACE_TEXT ("TAO (%P|%t) Default_Resource_Factory - codeset manager=%@\n"), 01282 mgr)); 01283 01284 this->char_codeset_parameters_.apply_to (mgr->char_codeset_descriptor()); 01285 this->wchar_codeset_parameters_.apply_to (mgr->wchar_codeset_descriptor()); 01286 01287 return safemgr.release (); 01288 01289 }
ACE_Lock * TAO_Default_Resource_Factory::create_cached_connection_lock | ( | void | ) | [virtual] |
Creates the lock for the lock needed in the Cache Map
Reimplemented from TAO_Resource_Factory.
Definition at line 1050 of file default_resource.cpp.
References ACE_NEW_RETURN, and TAO_NULL_LOCK.
01051 { 01052 ACE_Lock *the_lock = 0; 01053 01054 if (this->cached_connection_lock_type_ == TAO_NULL_LOCK) 01055 ACE_NEW_RETURN (the_lock, 01056 ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX>, 01057 0); 01058 else 01059 ACE_NEW_RETURN (the_lock, 01060 ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 01061 0); 01062 01063 return the_lock; 01064 }
ACE_Lock * TAO_Default_Resource_Factory::create_corba_object_lock | ( | void | ) | [virtual] |
Creates the lock for the CORBA Object.
Reimplemented from TAO_Resource_Factory.
Definition at line 1094 of file default_resource.cpp.
References ACE_NEW_RETURN, and TAO_NULL_LOCK.
01095 { 01096 ACE_Lock *the_lock = 0; 01097 01098 if (this->corba_object_lock_type_ == TAO_NULL_LOCK) 01099 ACE_NEW_RETURN (the_lock, 01100 ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX>, 01101 0); 01102 else 01103 ACE_NEW_RETURN (the_lock, 01104 ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 01105 0); 01106 01107 return the_lock; 01108 }
TAO_Configurable_Refcount TAO_Default_Resource_Factory::create_corba_object_refcount | ( | void | ) | [virtual] |
Creates the configurable refcount for the CORBA Object.
Reimplemented from TAO_Resource_Factory.
Definition at line 1111 of file default_resource.cpp.
References TAO_Configurable_Refcount::TAO_NULL_LOCK, TAO_NULL_LOCK, TAO_Configurable_Refcount::TAO_THREAD_LOCK, and TAO_THREAD_LOCK.
01112 { 01113 switch (this->corba_object_lock_type_) 01114 { 01115 case TAO_NULL_LOCK: 01116 return TAO_Configurable_Refcount ( 01117 TAO_Configurable_Refcount::TAO_NULL_LOCK); 01118 case TAO_THREAD_LOCK: 01119 default: 01120 return TAO_Configurable_Refcount ( 01121 TAO_Configurable_Refcount::TAO_THREAD_LOCK); 01122 } 01123 }
TAO_Flushing_Strategy * TAO_Default_Resource_Factory::create_flushing_strategy | ( | void | ) | [virtual] |
Creates the flushing strategy. The new instance is owned by the caller.
Implements TAO_Resource_Factory.
Definition at line 1126 of file default_resource.cpp.
References ACE_NEW_RETURN, TAO_LEADER_FOLLOWER_FLUSHING, and TAO_REACTIVE_FLUSHING.
01127 { 01128 TAO_Flushing_Strategy *strategy = 0; 01129 if (this->flushing_strategy_type_ == TAO_LEADER_FOLLOWER_FLUSHING) 01130 ACE_NEW_RETURN (strategy, 01131 TAO_Leader_Follower_Flushing_Strategy, 01132 0); 01133 else if (this->flushing_strategy_type_ == TAO_REACTIVE_FLUSHING) 01134 ACE_NEW_RETURN (strategy, 01135 TAO_Reactive_Flushing_Strategy, 01136 0); 01137 else 01138 ACE_NEW_RETURN (strategy, 01139 TAO_Block_Flushing_Strategy, 01140 0); 01141 return strategy; 01142 }
auto_ptr< TAO_GIOP_Fragmentation_Strategy > TAO_Default_Resource_Factory::create_fragmentation_strategy | ( | TAO_Transport * | transport, | |
CORBA::ULong | max_message_size | |||
) | const [virtual] |
Outgoing fragment creation strategy.
Implements TAO_Resource_Factory.
Definition at line 1180 of file default_resource.cpp.
References ACE_AUTO_PTR_RESET, ACE_NEW_RETURN, TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.
01183 { 01184 auto_ptr<TAO_GIOP_Fragmentation_Strategy> strategy (0); 01185 01186 TAO_GIOP_Fragmentation_Strategy * tmp = 0; 01187 01188 // Minimum GIOP message size is 24 (a multiple of 8): 01189 // 12 GIOP Message Header 01190 // 4 GIOP Fragment Header (request ID) 01191 // + 8 Smallest payload, including padding. 01192 // --- 01193 // 24 01194 static CORBA::ULong const min_message_size = 24; 01195 01196 // GIOP fragments are supported in GIOP 1.1 and better, but TAO only 01197 // supports them in 1.2 or better since GIOP 1.1 fragments do not 01198 // have a fragment message header. 01199 if (transport) // No transport. Cannot fragment. 01200 { 01201 if (max_message_size < min_message_size 01202 || (TAO_DEF_GIOP_MAJOR == 1 && TAO_DEF_GIOP_MINOR < 2)) 01203 { 01204 // No maximum was set by the user. 01205 ACE_NEW_RETURN (tmp, 01206 TAO_Null_Fragmentation_Strategy, 01207 strategy); 01208 01209 } 01210 else 01211 { 01212 ACE_NEW_RETURN (tmp, 01213 TAO_On_Demand_Fragmentation_Strategy ( 01214 transport, 01215 max_message_size), 01216 strategy); 01217 } 01218 } 01219 01220 ACE_AUTO_PTR_RESET (strategy, 01221 tmp, 01222 TAO_GIOP_Fragmentation_Strategy); 01223 01224 return strategy; 01225 }
TAO_LF_Strategy * TAO_Default_Resource_Factory::create_lf_strategy | ( | void | ) | [virtual] |
Creates the leader followers strategy. The new instance is owned by the caller.
Implements TAO_Resource_Factory.
Definition at line 1168 of file default_resource.cpp.
References ACE_NEW_RETURN.
01169 { 01170 TAO_LF_Strategy *strategy = 0; 01171 01172 ACE_NEW_RETURN (strategy, 01173 TAO_LF_Strategy_Complete, 01174 0); 01175 01176 return strategy; 01177 }
ACE_Lock * TAO_Default_Resource_Factory::create_object_key_table_lock | ( | void | ) | [virtual] |
Creates a lock needed for the table that stores the object keys.
Reimplemented from TAO_Resource_Factory.
Definition at line 1077 of file default_resource.cpp.
References ACE_NEW_RETURN, and TAO_NULL_LOCK.
01078 { 01079 ACE_Lock *the_lock = 0; 01080 01081 if (this->object_key_table_lock_type_ == TAO_NULL_LOCK) 01082 ACE_NEW_RETURN (the_lock, 01083 ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX>, 01084 0); 01085 else 01086 ACE_NEW_RETURN (the_lock, 01087 ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 01088 0); 01089 01090 return the_lock; 01091 }
TAO_Connection_Purging_Strategy * TAO_Default_Resource_Factory::create_purging_strategy | ( | void | ) | [virtual] |
Creates the connection purging strategy.
Implements TAO_Resource_Factory.
Definition at line 1145 of file default_resource.cpp.
References ACE_ERROR, ACE_NEW_RETURN, and TAO_Resource_Factory::LRU.
01146 { 01147 TAO_Connection_Purging_Strategy *strategy = 0; 01148 01149 if (this->connection_purging_type_ == TAO_Resource_Factory::LRU) 01150 { 01151 ACE_NEW_RETURN (strategy, 01152 TAO_LRU_Connection_Purging_Strategy ( 01153 this->cache_maximum ()), 01154 0); 01155 } 01156 else 01157 { 01158 ACE_ERROR ((LM_ERROR, 01159 ACE_TEXT ("TAO (%P|%t) - ") 01160 ACE_TEXT ("no usable purging strategy ") 01161 ACE_TEXT ("was found.\n"))); 01162 } 01163 01164 return strategy; 01165 }
void TAO_Default_Resource_Factory::disable_factory | ( | void | ) | [virtual] |
Disables the factory. When a new factory is installed and used, this function should be called on the previously used (default) factory. This should result in proper error reporting if the user attempts to set options on an unused factory.
Implements TAO_Resource_Factory.
Definition at line 1239 of file default_resource.cpp.
References ACE_DEBUG, factory_disabled_, and LM_WARNING.
01240 { 01241 this->factory_disabled_ = 1; 01242 if (this->options_processed_) 01243 { 01244 ACE_DEBUG ((LM_WARNING, 01245 ACE_TEXT ("TAO (%P|%t) Warning: Resource_Factory options ignored\n") 01246 ACE_TEXT ("Default Resource Factory is disabled\n"))); 01247 } 01248 }
bool TAO_Default_Resource_Factory::drop_replies_during_shutdown | ( | void | ) | const [virtual] |
Return the value of the strategy that indicates whether the ORB should wait for the replies during shutdown or drop replies during shutdown.
Implements TAO_Resource_Factory.
Definition at line 1298 of file default_resource.cpp.
References drop_replies_.
01299 { 01300 return this->drop_replies_; 01301 }
TAO_Acceptor_Registry * TAO_Default_Resource_Factory::get_acceptor_registry | ( | void | ) | [virtual] |
Return a reference to the acceptor registry.
Reimplemented from TAO_Resource_Factory.
Definition at line 766 of file default_resource.cpp.
References ACE_NEW_RETURN.
00767 { 00768 TAO_Acceptor_Registry *ar = 0; 00769 00770 ACE_NEW_RETURN(ar, 00771 TAO_Acceptor_Registry, 00772 0); 00773 00774 return ar; 00775 }
TAO_Connector_Registry * TAO_Default_Resource_Factory::get_connector_registry | ( | void | ) | [virtual] |
Return a connector to be utilized.
Reimplemented from TAO_Resource_Factory.
Definition at line 778 of file default_resource.cpp.
References ACE_NEW_RETURN.
00779 { 00780 TAO_Connector_Registry *cr = 0; 00781 00782 ACE_NEW_RETURN(cr, 00783 TAO_Connector_Registry, 00784 0); 00785 00786 return cr; 00787 }
int TAO_Default_Resource_Factory::get_parser_names | ( | char **& | names, | |
int & | number_of_names | |||
) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 591 of file default_resource.cpp.
References ACE_NEW_RETURN, parser_names_, parser_names_count_, and CORBA::string_dup().
00593 { 00594 if (this->parser_names_count_ != 0) 00595 { 00596 // The user used some -ORBIORParser options, just return those. 00597 names = this->parser_names_; 00598 number_of_names = this->parser_names_count_; 00599 00600 return 0; 00601 } 00602 00603 this->parser_names_count_ = 0; 00604 #if (TAO_HAS_DDL_PARSER == 1) 00605 ++this->parser_names_count_; 00606 #endif 00607 #if (TAO_HAS_FILE_PARSER == 1) 00608 ++this->parser_names_count_; 00609 #endif 00610 #if (TAO_HAS_CORBALOC_PARSER == 1) 00611 ++this->parser_names_count_; 00612 #endif 00613 #if (TAO_HAS_CORBANAME_PARSER == 1) 00614 ++this->parser_names_count_; 00615 #endif 00616 #if (TAO_HAS_HTTP_PARSER == 1) 00617 ++this->parser_names_count_; 00618 #endif 00619 #if (TAO_HAS_MCAST_PARSER == 1) 00620 ++this->parser_names_count_; 00621 #endif 00622 ACE_NEW_RETURN (this->parser_names_, 00623 char *[this->parser_names_count_], 00624 -1); 00625 00626 CORBA::ULong index = 0; 00627 00628 #if (TAO_HAS_DDL_PARSER == 1) 00629 this->parser_names_[index] = CORBA::string_dup ("DLL_Parser"); 00630 ++index; 00631 #endif 00632 00633 #if (TAO_HAS_FILE_PARSER == 1) 00634 this->parser_names_[index] = CORBA::string_dup ("FILE_Parser"); 00635 ++index; 00636 #endif 00637 00638 #if (TAO_HAS_CORBALOC_PARSER == 1) 00639 this->parser_names_[index] = CORBA::string_dup ("CORBALOC_Parser"); 00640 ++index; 00641 #endif 00642 00643 #if (TAO_HAS_CORBANAME_PARSER == 1) 00644 this->parser_names_[index] = CORBA::string_dup ("CORBANAME_Parser"); 00645 ++index; 00646 #endif 00647 00648 #if (TAO_HAS_MCAST_PARSER == 1) 00649 this->parser_names_[index] = CORBA::string_dup ("MCAST_Parser"); 00650 ++index; 00651 #endif 00652 00653 #if (TAO_HAS_HTTP_PARSER == 1) 00654 this->parser_names_[index] = CORBA::string_dup ("HTTP_Parser"); 00655 ++index; 00656 #endif 00657 00658 names = this->parser_names_; 00659 00660 number_of_names = index; 00661 00662 return 0; 00663 }
TAO_ProtocolFactorySet * TAO_Default_Resource_Factory::get_protocol_factories | ( | void | ) | [virtual] |
The protocol factory list is implemented in this class since a) it will be a global resource and b) it is initialized at start up and then not altered. Returns a container holding the list of loaded protocols.
Reimplemented from TAO_Resource_Factory.
Definition at line 760 of file default_resource.cpp.
References protocol_factories_.
00761 { 00762 return &protocol_factories_; 00763 }
ACE_Reactor * TAO_Default_Resource_Factory::get_reactor | ( | void | ) | [virtual] |
Return an ACE_Reactor to be utilized.
Reimplemented from TAO_Resource_Factory.
Definition at line 810 of file default_resource.cpp.
References ACE_NEW_RETURN, dynamically_allocated_reactor_, ACE_Reactor::initialized(), and ACE_Event_Handler::reactor().
00811 { 00812 ACE_Reactor *reactor = 0; 00813 ACE_NEW_RETURN (reactor, 00814 ACE_Reactor (this->allocate_reactor_impl (), 1), 00815 0); 00816 00817 if (reactor->initialized () == 0) 00818 { 00819 delete reactor; 00820 reactor = 0; 00821 } 00822 else 00823 this->dynamically_allocated_reactor_ = true; 00824 00825 return reactor; 00826 }
int TAO_Default_Resource_Factory::init | ( | int | argc, | |
ACE_TCHAR * | argv[] | |||
) | [virtual] |
Dynamic linking hook.
CodeSet Translators
CodeSet Translators
Reimplemented from ACE_Shared_Object.
Definition at line 163 of file default_resource.cpp.
References ACE_DEBUG, ACE_NEW_RETURN, ACE_TEXT, ACE_TRACE, LM_WARNING, options_processed_, parser_names_count_, and ACE_OS::strcasecmp().
00164 { 00165 ACE_TRACE ("TAO_Default_Resource_Factory::init"); 00166 00167 // If this factory has already been disabled then 00168 // print a warning and exit because any options 00169 // are useless 00170 if (this->factory_disabled_) { 00171 ACE_DEBUG ((LM_WARNING, 00172 ACE_TEXT ("TAO (%P|%t) Warning: Resource_Factory options ") 00173 ACE_TEXT ("ignored\n") 00174 ACE_TEXT ("Default Resource Factory is disabled\n"))); 00175 return 0; 00176 } 00177 this->options_processed_ = 1; 00178 00179 this->parser_names_count_ = 0; 00180 00181 int curarg = 0; 00182 00183 for (curarg = 0; curarg < argc; ++curarg) 00184 { 00185 // Parse thro' and find the number of Parsers to be loaded. 00186 if (ACE_OS::strcasecmp (argv[curarg], 00187 ACE_TEXT("-ORBIORParser")) == 0) 00188 ++this->parser_names_count_; 00189 00190 ++curarg; 00191 00192 if (curarg == (argc-1) && this->parser_names_count_ != 0) 00193 { 00194 // This is the last loop.. 00195 ACE_NEW_RETURN (this->parser_names_, 00196 char *[this->parser_names_count_], 00197 -1); 00198 00199 for (int i = 0; 00200 i < this->parser_names_count_; 00201 ++i) 00202 this->parser_names_[i] = 0; 00203 00204 this->index_ = 0; 00205 } 00206 } 00207 00208 for (curarg = 0; curarg < argc; ++curarg) 00209 { 00210 if (ACE_OS::strcasecmp (argv[curarg], 00211 ACE_TEXT("-ORBReactorMaskSignals")) == 0) 00212 { 00213 ++curarg; 00214 if (curarg < argc) 00215 { 00216 ACE_TCHAR* name = argv[curarg]; 00217 00218 if (ACE_OS::strcasecmp (name, ACE_TEXT("0")) == 0) 00219 this->reactor_mask_signals_ = 0; 00220 else if (ACE_OS::strcasecmp (name, ACE_TEXT("1")) == 0) 00221 this->reactor_mask_signals_= 1; 00222 else 00223 this->report_option_value_error (ACE_TEXT("-ORBReactorMaskSignals"), name); 00224 } 00225 } 00226 00227 else if (ACE_OS::strcasecmp (argv[curarg], 00228 ACE_TEXT("-ORBProtocolFactory")) == 0) 00229 { 00230 TAO_ProtocolFactorySet *pset = this->get_protocol_factories (); 00231 ++curarg; 00232 if (curarg < argc) 00233 { 00234 TAO_Protocol_Item *item = 0; 00235 ACE_NEW_RETURN (item, 00236 TAO_Protocol_Item (ACE_TEXT_ALWAYS_CHAR(argv[curarg])), 00237 -1); 00238 if (pset->insert (item) == -1) 00239 ACE_ERROR ((LM_ERROR, 00240 ACE_TEXT ("(%P|%t) Unable to add protocol factories ") 00241 ACE_TEXT ("for %s: %m\n"), 00242 argv[curarg])); 00243 } 00244 } 00245 00246 /// CodeSet Translators 00247 else if (ACE_OS::strcasecmp (argv[curarg], 00248 ACE_TEXT("-ORBNativeCharCodeSet")) == 0) 00249 { 00250 ++curarg; 00251 if (curarg < argc) 00252 this->char_codeset_parameters_.native (argv[curarg]); 00253 } 00254 00255 else if (ACE_OS::strcasecmp (argv[curarg], 00256 ACE_TEXT("-ORBNativeWCharCodeSet")) == 0) 00257 { 00258 ++curarg; 00259 if (curarg < argc) 00260 this->wchar_codeset_parameters_.native (argv[curarg]); 00261 } 00262 00263 else if (ACE_OS::strcasecmp (argv[curarg], 00264 ACE_TEXT("-ORBCharCodesetTranslator")) == 0) 00265 { 00266 ++curarg; 00267 if (curarg < argc) 00268 this->char_codeset_parameters_.add_translator (argv[curarg]); 00269 } 00270 00271 /// CodeSet Translators 00272 else if (ACE_OS::strcasecmp (argv[curarg], 00273 ACE_TEXT("-ORBWCharCodesetTranslator")) == 0) 00274 { 00275 ++curarg; 00276 if (curarg < argc) 00277 this->wchar_codeset_parameters_.add_translator (argv[curarg]); 00278 } 00279 00280 else if (ACE_OS::strcasecmp (argv[curarg], 00281 ACE_TEXT("-ORBConnectionCachingStrategy")) == 0) 00282 { 00283 ++curarg; 00284 00285 // @todo: This needs to be removed after a few betas. The 00286 // note is being written during 1.2.3 timeframe. 00287 ACE_DEBUG ((LM_DEBUG, 00288 ACE_TEXT ("(%P|%t) This option would be deprecated \n") 00289 ACE_TEXT ("(%P|%t) Please use -ORBConnectionPurgingStrategy ") 00290 ACE_TEXT ("instead \n"))); 00291 00292 if (curarg < argc) 00293 { 00294 ACE_TCHAR* name = argv[curarg]; 00295 00296 if (ACE_OS::strcasecmp (name, 00297 ACE_TEXT ("lru")) == 0) 00298 this->connection_purging_type_ = 00299 TAO_Resource_Factory::LRU; 00300 else if (ACE_OS::strcasecmp (name, 00301 ACE_TEXT ("lfu")) == 0) 00302 this->connection_purging_type_ = 00303 TAO_Resource_Factory::LFU; 00304 else if (ACE_OS::strcasecmp (name, 00305 ACE_TEXT ("fifo")) == 0) 00306 this->connection_purging_type_ = 00307 TAO_Resource_Factory::FIFO; 00308 else if (ACE_OS::strcasecmp (name, 00309 ACE_TEXT ("null")) == 0) 00310 this->connection_purging_type_ = 00311 TAO_Resource_Factory::NOOP; 00312 else 00313 this->report_option_value_error (ACE_TEXT ("-ORBConnectionCachingStrategy"), name); 00314 } 00315 } 00316 else if (ACE_OS::strcasecmp (argv[curarg], 00317 ACE_TEXT("-ORBConnectionPurgingStrategy")) == 0) 00318 { 00319 ++curarg; 00320 00321 if (curarg < argc) 00322 { 00323 ACE_TCHAR* name = argv[curarg]; 00324 00325 if (ACE_OS::strcasecmp (name, 00326 ACE_TEXT("lru")) == 0) 00327 this->connection_purging_type_ = 00328 TAO_Resource_Factory::LRU; 00329 else if (ACE_OS::strcasecmp (name, 00330 ACE_TEXT("lfu")) == 0) 00331 this->connection_purging_type_ = 00332 TAO_Resource_Factory::LFU; 00333 else if (ACE_OS::strcasecmp (name, 00334 ACE_TEXT("fifo")) == 0) 00335 this->connection_purging_type_ = 00336 TAO_Resource_Factory::FIFO; 00337 else if (ACE_OS::strcasecmp (name, 00338 ACE_TEXT("null")) == 0) 00339 this->connection_purging_type_ = 00340 TAO_Resource_Factory::NOOP; 00341 else 00342 this->report_option_value_error (ACE_TEXT("-ORBConnectionPurgingStrategy"), name); 00343 } 00344 } 00345 else if (ACE_OS::strcasecmp (argv[curarg], 00346 ACE_TEXT("-ORBConnectionCacheMax")) == 0) 00347 { 00348 ++curarg; 00349 if (curarg < argc) 00350 this->cache_maximum_ = ACE_OS::atoi (argv[curarg]); 00351 else 00352 this->report_option_value_error (ACE_TEXT("-ORBConnectionCacheMax"), argv[curarg]); 00353 } 00354 00355 else if (ACE_OS::strcasecmp (argv[curarg], 00356 ACE_TEXT("-ORBConnectionCachePurgePercentage")) == 0) 00357 { 00358 ++curarg; 00359 if (curarg < argc) 00360 this->purge_percentage_ = ACE_OS::atoi (argv[curarg]); 00361 else 00362 this->report_option_value_error (ACE_TEXT("-ORBConnectionCachePurgePercentage"), 00363 argv[curarg]); 00364 } 00365 else if (ACE_OS::strcasecmp (argv[curarg], 00366 ACE_TEXT("-ORBIORParser")) == 0) 00367 { 00368 ++curarg; 00369 00370 if (curarg < argc) 00371 { 00372 this->add_to_ior_parser_names (ACE_TEXT_ALWAYS_CHAR(argv[curarg])); 00373 } 00374 } 00375 00376 else if (ACE_OS::strcasecmp (argv[curarg], 00377 ACE_TEXT("-ORBConnectionCacheLock")) == 0) 00378 { 00379 ++curarg; 00380 if (curarg < argc) 00381 { 00382 ACE_TCHAR* name = argv[curarg]; 00383 00384 if (ACE_OS::strcasecmp (name, 00385 ACE_TEXT("thread")) == 0) 00386 this->cached_connection_lock_type_ = TAO_THREAD_LOCK; 00387 else if (ACE_OS::strcasecmp (name, 00388 ACE_TEXT("null")) == 0) 00389 { 00390 // @@ Bug 940 :This is a sort of hack now. We need to put 00391 // this in a common place once we get the common 00392 // switch that is documented in bug 940... 00393 this->use_locked_data_blocks_ = 0; 00394 this->cached_connection_lock_type_ = TAO_NULL_LOCK; 00395 } 00396 else 00397 this->report_option_value_error (ACE_TEXT("-ORBConnectionCacheLock"), name); 00398 } 00399 } 00400 else if (ACE_OS::strcasecmp (argv[curarg], 00401 ACE_TEXT("-ORBObjectKeyTableLock")) == 0) 00402 { 00403 ++curarg; 00404 if (curarg < argc) 00405 { 00406 ACE_TCHAR* name = argv[curarg]; 00407 00408 if (ACE_OS::strcasecmp (name, 00409 ACE_TEXT("thread")) == 0) 00410 this->object_key_table_lock_type_ = TAO_THREAD_LOCK; 00411 else if (ACE_OS::strcasecmp (name, 00412 ACE_TEXT("null")) == 0) 00413 { 00414 // @@ Bug 940 :This is a sort of hack now. We need to put 00415 // this in a common place once we get the common 00416 // switch that is documented in bug 940... 00417 this->object_key_table_lock_type_ = TAO_NULL_LOCK; 00418 } 00419 else 00420 this->report_option_value_error (ACE_TEXT("-ORBObjectKeyTableLock"), name); 00421 } 00422 } 00423 else if (ACE_OS::strcasecmp (argv[curarg], 00424 ACE_TEXT("-ORBCorbaObjectLock")) == 0) 00425 { 00426 ++curarg; 00427 if (curarg < argc) 00428 { 00429 ACE_TCHAR* name = argv[curarg]; 00430 00431 if (ACE_OS::strcasecmp (name, 00432 ACE_TEXT("thread")) == 0) 00433 this->corba_object_lock_type_ = TAO_THREAD_LOCK; 00434 else if (ACE_OS::strcasecmp (name, 00435 ACE_TEXT("null")) == 0) 00436 { 00437 // @@ Bug 940 :This is a sort of hack now. We need to put 00438 // this in a common place once we get the common 00439 // switch that is documented in bug 940... 00440 this->corba_object_lock_type_ = TAO_NULL_LOCK; 00441 } 00442 else 00443 this->report_option_value_error (ACE_TEXT("-ORBCorbaObjectLock"), name); 00444 } 00445 } 00446 else if (ACE_OS::strcasecmp (argv[curarg], 00447 ACE_TEXT("-ORBResourceUsage")) == 0) 00448 { 00449 ++curarg; 00450 if (curarg < argc) 00451 { 00452 ACE_TCHAR* name = argv[curarg]; 00453 00454 if (ACE_OS::strcasecmp (name, 00455 ACE_TEXT("eager")) == 0) 00456 this->resource_usage_strategy_ = TAO_EAGER; 00457 else if (ACE_OS::strcasecmp (name, 00458 ACE_TEXT("lazy")) == 0) 00459 { 00460 this->resource_usage_strategy_ = TAO_LAZY; 00461 } 00462 else 00463 this->report_option_value_error (ACE_TEXT("-ORBResourceUsage"), name); 00464 } 00465 } 00466 else if (ACE_OS::strcasecmp (argv[curarg], 00467 ACE_TEXT("-ORBFlushingStrategy")) == 0) 00468 { 00469 ++curarg; 00470 /* 00471 * Hook to specialize TAO's Flushing strategy implementations 00472 */ 00473 //@@ FLUSHING_STRATEGY_SPL_COMMENT_HOOK_START 00474 if (curarg < argc) 00475 { 00476 ACE_TCHAR* name = argv[curarg]; 00477 00478 if (ACE_OS::strcasecmp (name, 00479 ACE_TEXT("leader_follower")) == 0) 00480 this->flushing_strategy_type_ = TAO_LEADER_FOLLOWER_FLUSHING; 00481 else if (ACE_OS::strcasecmp (name, 00482 ACE_TEXT("reactive")) == 0) 00483 this->flushing_strategy_type_ = TAO_REACTIVE_FLUSHING; 00484 else if (ACE_OS::strcasecmp (name, 00485 ACE_TEXT("blocking")) == 0) 00486 this->flushing_strategy_type_ = TAO_BLOCKING_FLUSHING; 00487 else 00488 this->report_option_value_error (ACE_TEXT("-ORBFlushingStrategy"), name); 00489 } 00490 //@@ FLUSHING_STRATEGY_SPL_COMMENT_HOOK_END 00491 } 00492 else if (ACE_OS::strcasecmp (argv[curarg], 00493 ACE_TEXT ("-ORBMuxedConnectionMax")) == 0) 00494 { 00495 ++curarg; 00496 if (curarg < argc) 00497 this->max_muxed_connections_ = 00498 ACE_OS::atoi (argv[curarg]); 00499 else 00500 this->report_option_value_error (ACE_TEXT("-ORBMuxedConnectionMax"), 00501 argv[curarg]); 00502 } 00503 else if (ACE_OS::strcasecmp (argv[curarg], 00504 ACE_TEXT("-ORBDropRepliesDuringShutdown")) == 0) 00505 { 00506 ++curarg; 00507 if (curarg < argc) 00508 { 00509 int tmp = ACE_OS::atoi (argv[curarg]); 00510 00511 if (tmp == 0) 00512 this->drop_replies_ = false; 00513 else 00514 this->drop_replies_ = true; 00515 } 00516 else 00517 this->report_option_value_error (ACE_TEXT("-ORBDropRepliesDuringShutdown"), 00518 argv[curarg]); 00519 } 00520 else if (0 == ACE_OS::strcasecmp (argv[curarg], 00521 ACE_TEXT("-ORBOutputCDRAllocator"))) 00522 { 00523 ++curarg; 00524 00525 if (curarg < argc) 00526 { 00527 ACE_TCHAR const * const current_arg = argv[curarg]; 00528 00529 if (ACE_OS::strcasecmp (current_arg, 00530 ACE_TEXT("mmap")) == 0) 00531 { 00532 #if TAO_HAS_SENDFILE == 1 00533 this->output_cdr_allocator_type_ = MMAP_ALLOCATOR; 00534 #else 00535 ACE_DEBUG ((LM_WARNING, 00536 ACE_TEXT ("MMAP allocator unsupport on this platform"))); 00537 #endif /* TAO_HAS_SENDFILE==1 */ 00538 } 00539 else if (ACE_OS::strcasecmp (current_arg, 00540 ACE_TEXT("local_memory_pool")) == 0 00541 && this->output_cdr_allocator_type_ != DEFAULT) 00542 { 00543 this->output_cdr_allocator_type_ = LOCAL_MEMORY_POOL; 00544 } 00545 else if (ACE_OS::strcasecmp (current_arg, 00546 ACE_TEXT("default")) == 0) 00547 { 00548 this->output_cdr_allocator_type_ = DEFAULT; 00549 } 00550 else 00551 { 00552 this->report_option_value_error ( 00553 ACE_TEXT("-ORBOutputCDRAllocator"), current_arg); 00554 } 00555 } 00556 } 00557 else if (0 == ACE_OS::strcasecmp (argv[curarg], 00558 ACE_TEXT("-ORBZeroCopyWrite"))) 00559 { 00560 #if TAO_HAS_SENDFILE == 1 00561 this->output_cdr_allocator_type_ = MMAP_ALLOCATOR; 00562 #else 00563 ACE_DEBUG ((LM_WARNING, 00564 ACE_TEXT ("Zero copy writes unsupported on this platform\n"))); 00565 #endif /* TAO_HAS_SENDFILE==1 */ 00566 } 00567 else if (ACE_OS::strncmp (argv[curarg], 00568 ACE_TEXT ("-ORB"), 00569 4) == 0) 00570 { 00571 // Can we assume there is an argument after the option? 00572 // ++curarg; 00573 ACE_ERROR ((LM_ERROR, 00574 ACE_TEXT ("Default_Resource_Factory - ") 00575 ACE_TEXT ("unknown option <%s>\n"), 00576 argv[curarg])); 00577 } 00578 else 00579 { 00580 ACE_DEBUG ((LM_DEBUG, 00581 ACE_TEXT ("Default_Resource_Factory - ") 00582 ACE_TEXT ("ignoring option <%s>\n"), 00583 argv[curarg])); 00584 } 00585 } 00586 00587 return 0; 00588 }
int TAO_Default_Resource_Factory::init_protocol_factories | ( | void | ) | [virtual] |
This method will loop through the protocol list and using the protocol name field this method will retrieve a pointer to the associated protocol factory from the service configurator. It is assumed that only one thread will call this method at ORB initialization. NON-THREAD-SAFE
Reimplemented from TAO_Resource_Factory.
Definition at line 717 of file default_resource.cpp.
References ACE_DEBUG, ACE_ERROR_RETURN, ACE_TEXT_CHAR_TO_TCHAR, ACE_Unbounded_Set_Ex< T, C >::begin(), ACE_Unbounded_Set_Ex< T, C >::end(), LM_DEBUG, load_default_protocols(), protocol_factories_, and TAO_debug_level.
00718 { 00719 const TAO_ProtocolFactorySetItor end = protocol_factories_.end (); 00720 TAO_ProtocolFactorySetItor factory = protocol_factories_.begin (); 00721 00722 if (factory == end) 00723 { 00724 return this->load_default_protocols (); 00725 } 00726 00727 for (; factory != end; ++factory) 00728 { 00729 const ACE_CString &name = (*factory)->protocol_name (); 00730 (*factory)->factory ( 00731 ACE_Dynamic_Service<TAO_Protocol_Factory>::instance (name.c_str ())); 00732 if ((*factory)->factory () == 0) 00733 { 00734 ACE_ERROR_RETURN ((LM_ERROR, 00735 ACE_TEXT ("TAO (%P|%t) Unable to load ") 00736 ACE_TEXT ("protocol <%s>, %p\n"), 00737 ACE_TEXT_CHAR_TO_TCHAR(name.c_str ()), 00738 ACE_TEXT ("")), 00739 -1); 00740 } 00741 00742 if (TAO_debug_level > 0) 00743 { 00744 ACE_DEBUG ((LM_DEBUG, 00745 ACE_TEXT ("TAO (%P|%t) Loaded protocol <%s>\n"), 00746 ACE_TEXT_CHAR_TO_TCHAR(name.c_str ()))); 00747 } 00748 } 00749 00750 return 0; 00751 }
int TAO_Default_Resource_Factory::input_cdr_allocator_type_locked | ( | void | ) | [virtual] |
ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_buffer_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 870 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00871 { 00872 ACE_Allocator *allocator = 0; 00873 if (use_local_memory_pool_) 00874 { 00875 ACE_NEW_RETURN (allocator, 00876 LOCKED_ALLOCATOR_POOL, 00877 0); 00878 } 00879 else 00880 { 00881 ACE_NEW_RETURN (allocator, 00882 LOCKED_ALLOCATOR_NO_POOL, 00883 0); 00884 } 00885 00886 return allocator; 00887 }
ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_dblock_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 850 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00851 { 00852 ACE_Allocator *allocator = 0; 00853 if (use_local_memory_pool_) 00854 { 00855 ACE_NEW_RETURN (allocator, 00856 LOCKED_ALLOCATOR_POOL, 00857 0); 00858 } 00859 else 00860 { 00861 ACE_NEW_RETURN (allocator, 00862 LOCKED_ALLOCATOR_NO_POOL, 00863 0); 00864 } 00865 00866 return allocator; 00867 }
ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_msgblock_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 890 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00891 { 00892 ACE_Allocator *allocator = 0; 00893 if (use_local_memory_pool_) 00894 { 00895 ACE_NEW_RETURN (allocator, 00896 LOCKED_ALLOCATOR_POOL, 00897 0); 00898 } 00899 else 00900 { 00901 ACE_NEW_RETURN (allocator, 00902 LOCKED_ALLOCATOR_NO_POOL, 00903 0); 00904 } 00905 00906 return allocator; 00907 }
int TAO_Default_Resource_Factory::load_default_protocols | ( | void | ) | [protected, virtual] |
Loads the default protocols. This method is used so that the advanced_resource.cpp can call the one in default_resource.cpp without calling unnecessary functions.
Reimplemented from TAO_Resource_Factory.
Definition at line 678 of file default_resource.cpp.
Referenced by init_protocol_factories().
00679 { 00680 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0) 00681 // If the user did not list any protocols in her svc.conf file 00682 // then default to TAO's basic protocols. 00683 // You do *NOT* need modify this code to add your own protocol, 00684 // instead simply add the following to your svc.conf file: 00685 // 00686 // dynamic PP_Factory Service_Object * LIB:_make_PP_Protocol_Factory() "" 00687 // static Resource_Factory "-ORBProtocolFactory PP_Factory" 00688 // 00689 // where "PP_Factory" is the name of your protocol, i.e. the 00690 // second argument passed to the ACE_STATIC_SVC_DEFINE macro: 00691 // 00692 // ACE_STATIC_SVC_DEFINE (PP_Protocol_Factory, 00693 // ACE_TEXT ("PP_Factory"), ...) 00694 // 00695 // "PP_Protocol_Factory" is the name of your protocol factory 00696 // class. A "_make_" is prepended to your protocol factory 00697 // class name by the ACE_FACTORY_DECLARE macro. The resulting 00698 // factory function "_make_PP_Protocol_Factory()" is what should 00699 // be used in the "dynamic" line in your svc.conf file. 00700 // 00701 // LIB is the base name of the shared library that implements 00702 // the protocol. The directory containing your library must be 00703 // in your library search path, typically defined by the 00704 // LD_LIBRARY_PATH environment variable on UNIX systems, and/or 00705 // the `/etc/ld.so.conf' file on some UNIX systems. Remember to 00706 // run "ldconfig" if you modify `/etc/ld.so.conf'. 00707 00708 if (TAO::details::load_protocol_factory <TAO_IIOP_Protocol_Factory> ( 00709 this->protocol_factories_, "IIOP_Factory") == -1) 00710 return -1; 00711 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */ 00712 00713 return 0; 00714 }
int TAO_Default_Resource_Factory::locked_transport_cache | ( | void | ) | [virtual] |
Should the transport cache have a lock or not? Return 1 if the transport cache needs to be locked else return 0
Reimplemented from TAO_Resource_Factory.
Definition at line 1067 of file default_resource.cpp.
References TAO_NULL_LOCK.
01068 { 01069 if (this->cached_connection_lock_type_ == TAO_NULL_LOCK) 01070 return 0; 01071 01072 return 1; 01073 }
int TAO_Default_Resource_Factory::max_muxed_connections | ( | void | ) | const [virtual] |
Return the number of muxed connections that are allowed for a remote endpoint
Reimplemented from TAO_Resource_Factory.
Definition at line 1043 of file default_resource.cpp.
References max_muxed_connections_.
01044 { 01045 return this->max_muxed_connections_; 01046 }
ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_buffer_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 936 of file default_resource.cpp.
References ACE_NEW_RETURN, DEFAULT, and LOCAL_MEMORY_POOL.
00937 { 00938 ACE_Allocator *allocator = 0; 00939 00940 switch (this->output_cdr_allocator_type_) 00941 { 00942 case LOCAL_MEMORY_POOL: 00943 ACE_NEW_RETURN (allocator, 00944 LOCKED_ALLOCATOR_POOL, 00945 0); 00946 00947 break; 00948 00949 #if TAO_HAS_SENDFILE == 1 00950 case MMAP_ALLOCATOR: 00951 ACE_NEW_RETURN (allocator, 00952 TAO_MMAP_Allocator, 00953 0); 00954 00955 break; 00956 #endif /* TAO_HAS_SENDFILE==1 */ 00957 00958 case DEFAULT: 00959 default: 00960 ACE_NEW_RETURN (allocator, 00961 LOCKED_ALLOCATOR_NO_POOL, 00962 0); 00963 00964 break; 00965 } 00966 00967 return allocator; 00968 }
ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_dblock_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 916 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00917 { 00918 ACE_Allocator *allocator = 0; 00919 if (use_local_memory_pool_) 00920 { 00921 ACE_NEW_RETURN (allocator, 00922 LOCKED_ALLOCATOR_POOL, 00923 0); 00924 } 00925 else 00926 { 00927 ACE_NEW_RETURN (allocator, 00928 LOCKED_ALLOCATOR_NO_POOL, 00929 0); 00930 } 00931 00932 return allocator; 00933 }
ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_msgblock_allocator | ( | void | ) | [virtual] |
Reimplemented from TAO_Resource_Factory.
Definition at line 971 of file default_resource.cpp.
References ACE_NEW_RETURN, and use_local_memory_pool_.
00972 { 00973 ACE_Allocator *allocator = 0; 00974 if (use_local_memory_pool_) 00975 { 00976 ACE_NEW_RETURN (allocator, 00977 LOCKED_ALLOCATOR_POOL, 00978 0); 00979 } 00980 else 00981 { 00982 ACE_NEW_RETURN (allocator, 00983 LOCKED_ALLOCATOR_NO_POOL, 00984 0); 00985 } 00986 00987 return allocator; 00988 }
int TAO_Default_Resource_Factory::parse_args | ( | int | argc, | |
ACE_TCHAR * | argv[] | |||
) |
Parse svc.conf arguments.
int TAO_Default_Resource_Factory::purge_percentage | ( | void | ) | const [virtual] |
This denotes the amount of entries to remove from the connection cache.
Reimplemented from TAO_Resource_Factory.
Definition at line 1037 of file default_resource.cpp.
References purge_percentage_.
01038 { 01039 return this->purge_percentage_; 01040 }
void TAO_Default_Resource_Factory::reclaim_reactor | ( | ACE_Reactor * | ) | [virtual] |
Reclaim reactor resources (e.g. deallocate, etc).
Reimplemented from TAO_Resource_Factory.
Definition at line 829 of file default_resource.cpp.
References ACE_Event_Handler::reactor().
00830 { 00831 if (this->dynamically_allocated_reactor_) 00832 delete reactor; 00833 }
TAO_Resource_Factory::Resource_Usage TAO_Default_Resource_Factory::resource_usage_strategy | ( | void | ) | const [virtual] |
Return the resource usage strategy.
Implements TAO_Resource_Factory.
Definition at line 1292 of file default_resource.cpp.
References resource_usage_strategy_.
01293 { 01294 return this->resource_usage_strategy_; 01295 }
void TAO_Default_Resource_Factory::use_local_memory_pool | ( | bool | ) | [virtual] |
Return the Allocator's memory pool type.
Reimplemented from TAO_Resource_Factory.
Definition at line 841 of file default_resource.cpp.
References DEFAULT, LOCAL_MEMORY_POOL, output_cdr_allocator_type_, and use_local_memory_pool_.
00842 { 00843 this->use_local_memory_pool_ = flag; 00844 00845 if (this->output_cdr_allocator_type_ == DEFAULT) 00846 this->output_cdr_allocator_type_ = LOCAL_MEMORY_POOL; 00847 }
int TAO_Default_Resource_Factory::use_locked_data_blocks | ( | void | ) | const [virtual] |
@ Backwards compatibility, return 1 if the ORB core should use Locked_Data_Blocks
Reimplemented from TAO_Resource_Factory.
Definition at line 754 of file default_resource.cpp.
References use_locked_data_blocks_.
00755 { 00756 return this->use_locked_data_blocks_; 00757 }
int TAO_Default_Resource_Factory::cache_maximum_ [protected] |
Specifies the maximum number of connections which should get cached in the ORB.
Definition at line 228 of file default_resource.h.
Referenced by cache_maximum().
TAO_Resource_Factory::Purging_Strategy TAO_Default_Resource_Factory::connection_purging_type_ [protected] |
Specifies the typeof purging strategy we should use for cleaning up unused connections
Definition at line 224 of file default_resource.h.
bool TAO_Default_Resource_Factory::drop_replies_ [private] |
Flag to indicate whether replies should be dropped during ORB shutdown.
Definition at line 319 of file default_resource.h.
Referenced by drop_replies_during_shutdown().
bool TAO_Default_Resource_Factory::dynamically_allocated_reactor_ [protected] |
Flag that is set to true if the reactor obtained from the get_reactor() method is dynamically allocated. If this flag is set to true, then the reclaim_reactor() method with call the delete operator on the given reactor. This flag is necessary to make sure that a reactor not allocated by the default resource factory is not reclaimed by the default resource factory. Such a situation can occur when a resource factory derived from the default one overrides the get_reactor() method but does not override the reclaim_reactor() method.
Definition at line 253 of file default_resource.h.
Referenced by get_reactor().
int TAO_Default_Resource_Factory::factory_disabled_ [protected] |
This flag specifies whether the factory has been disabled. If it has been disabled we should print warnings if options were processed before (or later).
Definition at line 265 of file default_resource.h.
Referenced by disable_factory().
int TAO_Default_Resource_Factory::index_ [protected] |
Index of the current element in the parser_names_ array.
Definition at line 217 of file default_resource.h.
Referenced by add_to_ior_parser_names().
int TAO_Default_Resource_Factory::max_muxed_connections_ [protected] |
Specifies the limit on the number of muxed connections allowed per-property for the ORB. A value of 0 indicates no limit
Definition at line 237 of file default_resource.h.
Referenced by max_muxed_connections().
int TAO_Default_Resource_Factory::options_processed_ [protected] |
This flag is used to determine whether options have been processed via the init() function. It is necessary to properly report errors when the default factory is replaced.
Definition at line 260 of file default_resource.h.
Referenced by init().
Type of allocator to use for output CDR buffers.
Definition at line 277 of file default_resource.h.
Referenced by use_local_memory_pool().
char** TAO_Default_Resource_Factory::parser_names_ [protected] |
Array consisting of the names of the parsers.
Definition at line 214 of file default_resource.h.
Referenced by add_to_ior_parser_names(), and get_parser_names().
int TAO_Default_Resource_Factory::parser_names_count_ [protected] |
The number of the different types of Parsers.
Definition at line 211 of file default_resource.h.
Referenced by get_parser_names(), init(), and ~TAO_Default_Resource_Factory().
list of loaded protocol factories.
Definition at line 220 of file default_resource.h.
Referenced by get_protocol_factories(), init_protocol_factories(), and ~TAO_Default_Resource_Factory().
int TAO_Default_Resource_Factory::purge_percentage_ [protected] |
Specifies the percentage of entries which should get purged on demand.
Definition at line 232 of file default_resource.h.
Referenced by purge_percentage().
int TAO_Default_Resource_Factory::reactor_mask_signals_ [protected] |
If <0> then we create reactors with signal handling disabled.
Definition at line 240 of file default_resource.h.
Resource usage strategy.
Definition at line 315 of file default_resource.h.
Referenced by resource_usage_strategy(), and TAO_Default_Resource_Factory().
bool TAO_Default_Resource_Factory::use_local_memory_pool_ [protected] |
This flag is used to determine whether the CDR allocators should use the local memory pool or not.
Definition at line 281 of file default_resource.h.
Referenced by amh_response_handler_allocator(), ami_response_handler_allocator(), input_cdr_buffer_allocator(), input_cdr_dblock_allocator(), input_cdr_msgblock_allocator(), output_cdr_dblock_allocator(), output_cdr_msgblock_allocator(), and use_local_memory_pool().
int TAO_Default_Resource_Factory::use_locked_data_blocks_ [protected] |
The type of data blocks that the ORB should use.
Definition at line 208 of file default_resource.h.
Referenced by use_locked_data_blocks().