Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

# TAO_Default_Resource_Factory Class Reference

TAO's default resource factory. More...

`#include <default_resource.h>`

Inheritance diagram for TAO_Default_Resource_Factory:

[legend]
Collaboration diagram for TAO_Default_Resource_Factory:

[legend]
List of all members.

## 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 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 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 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.
int | dynamically_allocated_reactor_
int | options_processed_
int | factory_disabled_
bool | use_local_memory_pool_
## Private Types
enum | Lock_Type { TAO_NULL_LOCK, TAO_THREAD_LOCK }
enum | Flushing_Strategy_Type { TAO_LEADER_FOLLOWER_FLUSHING, TAO_REACTIVE_FLUSHING, TAO_BLOCKING_FLUSHING }
## Private Member Functions
void | init_codeset_descriptors (void)
## 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_Manager * | codeset_manager_
TAO_Codeset_Descriptor_Base * | char_codeset_descriptor_
TAO_Codeset_Descriptor_Base * | wchar_codeset_descriptor_
Resource_Usage | resource_usage_strategy_
| Resource usage strategy.
bool | drop_replies_

## Detailed Description

TAO's default 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.

Note:
  When using an ORB created by a dynamically loaded object, it is generally necessary to pre-load a "Resource_Factory" prior to initializing the ORB. In the case of the TAO_Default_Resource_Factory, this can be done by adding the following Service Configurator directive to your `svc.conf' file before your the directive that loads the object that initialized your ORB:

  static Resource_Factory ""

  Alternatively, explicitly pre-load the Resource_Factory using the following in your code:

  ACE_Service_Config::process_directive ( ACE_TEXT ("static Resource_Factory \"\"") );

  In both cases, place the appropriate resource factory arguments, if any, between the quotes immediately following "Resource_Factory."

## Member Enumeration Documentation

anonymous enum

  | Enumeration values:
  TAO_ALLOCATOR_THREAD_LOCK |

enum TAO_Default_Resource_Factory::Flushing_Strategy_Type`[private]`

  | Enumeration values:
  TAO_LEADER_FOLLOWER_FLUSHING |
  TAO_REACTIVE_FLUSHING |
  TAO_BLOCKING_FLUSHING |

enum TAO_Default_Resource_Factory::Lock_Type`[private]`

  | Enumeration values:
  TAO_NULL_LOCK |
  TAO_THREAD_LOCK |

## Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Default_Resource_Factory::TAO_Default_Resource_Factory | ( | void |  | ) |

| Constructor.

TAO_Default_Resource_Factory::~TAO_Default_Resource_Factory | ( | void |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

int TAO_Default_Resource_Factory::add_to_ior_parser_names | ( | const char * |  | ) | `[protected]`

| Add a Parser name to the list of Parser names.

ACE_Reactor_Impl * TAO_Default_Resource_Factory::allocate_reactor_impl | ( | void |  | ) | const`[protected, virtual]`

| Obtain the reactor implementation.

ACE_Allocator * TAO_Default_Resource_Factory::amh_response_handler_allocator | ( | void |  | ) | `[virtual]`

| Access the AMH response handler allocator. Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::ami_response_handler_allocator | ( | void |  | ) | `[virtual]`

| Access the AMI response handler allocator. Reimplemented from TAO_Resource_Factory.

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.

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.

ACE_Lock * TAO_Default_Resource_Factory::create_cached_connection_lock | ( | void |  | ) | `[virtual]`

| Creates the lock for the lock needed in the Cache Map Deprecated: Reimplemented from TAO_Resource_Factory.

ACE_Lock * TAO_Default_Resource_Factory::create_corba_object_lock | ( | void |  | ) | `[virtual]`

| Creates the lock for the CORBA Object. Reimplemented from TAO_Resource_Factory.

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.

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.

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.

TAO_Connection_Purging_Strategy * TAO_Default_Resource_Factory::create_purging_strategy | ( | void |  | ) | `[virtual]`

| Creates the connection purging strategy. Implements TAO_Resource_Factory.

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.

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.

TAO_Acceptor_Registry * TAO_Default_Resource_Factory::get_acceptor_registry | ( | void |  | ) | `[virtual]`

| Return a reference to the acceptor registry. Reimplemented from TAO_Resource_Factory.

TAO_Connector_Registry * TAO_Default_Resource_Factory::get_connector_registry | ( | void |  | ) | `[virtual]`

| Return a connector to be utilized. Reimplemented from TAO_Resource_Factory.

int TAO_Default_Resource_Factory::get_parser_names | ( | char **& | names,
|  | int & | number_of_names
| ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

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.

ACE_Reactor * TAO_Default_Resource_Factory::get_reactor | ( | void |  | ) | `[virtual]`

| Return an ACE_Reactor to be utilized. Reimplemented from TAO_Resource_Factory.

int TAO_Default_Resource_Factory::init | ( | int | argc,
|  | ACE_TCHAR * | argv[]
| ) | `[virtual]`

| Dynamic linking hook. CodeSet Translators CodeSet Translators Reimplemented from ACE_Shared_Object.

void TAO_Default_Resource_Factory::init_codeset_descriptors | ( | void |  | ) | `[private]`

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.

int TAO_Default_Resource_Factory::input_cdr_allocator_type_locked | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_buffer_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_dblock_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::input_cdr_msgblock_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

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.

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.

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.

ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_buffer_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_dblock_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

ACE_Allocator * TAO_Default_Resource_Factory::output_cdr_msgblock_allocator | ( | void |  | ) | `[virtual]`

| Reimplemented from TAO_Resource_Factory.

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.

void TAO_Default_Resource_Factory::reclaim_reactor | ( | ACE_Reactor * |  | ) | `[virtual]`

| Reclaim reactor resources (e.g. deallocate, etc). Reimplemented from TAO_Resource_Factory.

void TAO_Default_Resource_Factory::report_option_value_error | ( | const ACE_TCHAR * | option_name,
|  | const ACE_TCHAR * | option_value
| ) | `[protected]`

TAO_Resource_Factory::Resource_Usage TAO_Default_Resource_Factory::resource_usage_strategy | ( | void |  | ) | const`[virtual]`

| Return the resource usage strategy. Implements TAO_Resource_Factory.

void TAO_Default_Resource_Factory::use_local_memory_pool | ( | bool |  | ) | `[virtual]`

| Return the Allocator's memory pool type. Reimplemented from TAO_Resource_Factory.

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.

## Member Data Documentation

int TAO_Default_Resource_Factory::cache_maximum_`[protected]`

| Specifies the maximum number of connections which should get cached in the ORB.

Lock_Type TAO_Default_Resource_Factory::cached_connection_lock_type_`[private]`

| Type of lock used by the cached connector.

TAO_Codeset_Descriptor_Base* TAO_Default_Resource_Factory::char_codeset_descriptor_`[private]`

TAO_Codeset_Manager* TAO_Default_Resource_Factory::codeset_manager_`[private]`

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

Lock_Type TAO_Default_Resource_Factory::corba_object_lock_type_`[private]`

| Type of lock used by the corba object.

bool TAO_Default_Resource_Factory::drop_replies_`[private]`

| Flag to indicate whether replies should be dropped during ORB shutdown.

int TAO_Default_Resource_Factory::dynamically_allocated_reactor_`[protected]`

| Flag that is set to 1 if the reactor obtained from the get_reactor() method is dynamically allocated. If this flag is set to 1, 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.

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).

Flushing_Strategy_Type TAO_Default_Resource_Factory::flushing_strategy_type_`[private]`

| Type of flushing strategy configured.

int TAO_Default_Resource_Factory::index_`[protected]`

| Index of the current element in the parser_names_ array.

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

Lock_Type TAO_Default_Resource_Factory::object_key_table_lock_type_`[private]`

| Type of lock used by the corba object.

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.

char** TAO_Default_Resource_Factory::parser_names_`[protected]`

| Array consisting of the names of the parsers.

int TAO_Default_Resource_Factory::parser_names_count_`[protected]`

| The number of the different types of Parsers.

TAO_ProtocolFactorySet TAO_Default_Resource_Factory::protocol_factories_`[protected]`

| list of loaded protocol factories.

int TAO_Default_Resource_Factory::purge_percentage_`[protected]`

| Specifies the percentage of entries which should get purged on demand.

int TAO_Default_Resource_Factory::reactor_mask_signals_`[protected]`

| If <0> then we create reactors with signal handling disabled.

Resource_Usage TAO_Default_Resource_Factory::resource_usage_strategy_`[private]`

| Resource usage strategy.

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.

int TAO_Default_Resource_Factory::use_locked_data_blocks_`[protected]`

| The type of data blocks that the ORB should use.

TAO_Codeset_Descriptor_Base* TAO_Default_Resource_Factory::wchar_codeset_descriptor_`[private]`

The documentation for this class was generated from the following files:

- default_resource.h
- default_resource.cpp