00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_DEFAULT_RESOURCE_H
00016 #define TAO_DEFAULT_RESOURCE_H
00017
00018 #include "ace/pre.h"
00019 #include "ace/Service_Config.h"
00020 #include "ace/Dynamic_Service_Dependency.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "tao/Resource_Factory.h"
00027
00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00029 class ACE_Reactor_Impl;
00030 ACE_END_VERSIONED_NAMESPACE_DECL
00031
00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00033
00034 class TAO_Object_Adapter;
00035 class TAO_IOR_Parser;
00036 class TAO_LF_Strategy;
00037 class TAO_Codeset_Descriptor_Base;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 class TAO_Export TAO_Default_Resource_Factory
00070 : public TAO_Resource_Factory
00071 {
00072 public:
00073
00074
00075 TAO_Default_Resource_Factory (void);
00076
00077
00078 virtual ~TAO_Default_Resource_Factory (void);
00079
00080
00081
00082
00083
00084
00085 virtual int init (int argc, ACE_TCHAR *argv[]);
00086
00087
00088 int parse_args (int argc, ACE_TCHAR* argv[]);
00089
00090
00091
00092
00093
00094
00095
00096 int get_parser_names (char **&names,
00097 int &number_of_names);
00098 enum
00099 {
00100 TAO_ALLOCATOR_THREAD_LOCK
00101 };
00102
00103
00104 int cdr_allocator_source (void);
00105
00106
00107 virtual int use_locked_data_blocks (void) const;
00108 virtual ACE_Reactor *get_reactor (void);
00109 virtual void reclaim_reactor (ACE_Reactor *);
00110 virtual TAO_Acceptor_Registry *get_acceptor_registry (void);
00111 virtual TAO_Connector_Registry *get_connector_registry (void);
00112 virtual void use_local_memory_pool (bool);
00113 virtual ACE_Allocator* input_cdr_dblock_allocator (void);
00114 virtual ACE_Allocator* input_cdr_buffer_allocator (void);
00115 virtual ACE_Allocator* input_cdr_msgblock_allocator (void);
00116 virtual int input_cdr_allocator_type_locked (void);
00117 virtual ACE_Allocator* output_cdr_dblock_allocator (void);
00118 virtual ACE_Allocator* output_cdr_buffer_allocator (void);
00119 virtual ACE_Allocator* output_cdr_msgblock_allocator (void);
00120 virtual ACE_Allocator* amh_response_handler_allocator (void);
00121 virtual ACE_Allocator* ami_response_handler_allocator (void);
00122 virtual TAO_ProtocolFactorySet *get_protocol_factories (void);
00123
00124 virtual int init_protocol_factories (void);
00125
00126 virtual TAO_Codeset_Manager * codeset_manager (void);
00127
00128 virtual int cache_maximum (void) const;
00129 virtual int purge_percentage (void) const;
00130 virtual int max_muxed_connections (void) const;
00131 virtual ACE_Lock *create_cached_connection_lock (void);
00132 virtual ACE_Lock *create_object_key_table_lock (void);
00133 virtual ACE_Lock *create_corba_object_lock (void);
00134 virtual int locked_transport_cache (void);
00135 virtual TAO_Flushing_Strategy *create_flushing_strategy (void);
00136 virtual TAO_Connection_Purging_Strategy *create_purging_strategy (void);
00137 TAO_Resource_Factory::Resource_Usage resource_usage_strategy (void) const;
00138 virtual TAO_LF_Strategy *create_lf_strategy (void);
00139 virtual auto_ptr<TAO_GIOP_Fragmentation_Strategy>
00140 create_fragmentation_strategy (TAO_Transport * transport,
00141 CORBA::ULong max_message_size) const;
00142 virtual void disable_factory (void);
00143 virtual bool drop_replies_during_shutdown (void) const;
00144
00145
00146 protected:
00147
00148
00149 virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
00150
00151
00152 int add_to_ior_parser_names (const char *);
00153
00154 void report_option_value_error (const ACE_TCHAR* option_name,
00155 const ACE_TCHAR* option_value);
00156
00157 protected:
00158
00159
00160 int use_locked_data_blocks_;
00161
00162
00163 int parser_names_count_;
00164
00165
00166 char **parser_names_;
00167
00168
00169 int index_;
00170
00171
00172 TAO_ProtocolFactorySet protocol_factories_;
00173
00174
00175
00176 TAO_Resource_Factory::Purging_Strategy connection_purging_type_;
00177
00178
00179
00180 int cache_maximum_;
00181
00182
00183
00184 int purge_percentage_;
00185
00186
00187
00188
00189 int max_muxed_connections_;
00190
00191
00192 int reactor_mask_signals_;
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205 int dynamically_allocated_reactor_;
00206
00207 virtual int load_default_protocols (void);
00208
00209
00210
00211
00212 int options_processed_;
00213
00214
00215
00216
00217 int factory_disabled_;
00218
00219 enum Output_CDR_Allocator_Type
00220 {
00221 LOCAL_MEMORY_POOL,
00222 #ifdef ACE_HAS_SENDFILE
00223 MMAP_ALLOCATOR,
00224 #endif
00225 DEFAULT
00226 };
00227
00228
00229 Output_CDR_Allocator_Type output_cdr_allocator_type_;
00230
00231
00232
00233 bool use_local_memory_pool_;
00234
00235 private:
00236 void init_codeset_descriptors (void);
00237
00238 enum Lock_Type
00239 {
00240 TAO_NULL_LOCK,
00241 TAO_THREAD_LOCK
00242 };
00243
00244
00245 Lock_Type cached_connection_lock_type_;
00246
00247
00248 Lock_Type object_key_table_lock_type_;
00249
00250
00251 Lock_Type corba_object_lock_type_;
00252
00253 enum Flushing_Strategy_Type
00254 {
00255 TAO_LEADER_FOLLOWER_FLUSHING,
00256 TAO_REACTIVE_FLUSHING,
00257 TAO_BLOCKING_FLUSHING
00258 };
00259
00260
00261 Flushing_Strategy_Type flushing_strategy_type_;
00262
00263 TAO_Codeset_Manager *codeset_manager_;
00264 TAO_Codeset_Descriptor_Base *char_codeset_descriptor_;
00265 TAO_Codeset_Descriptor_Base * wchar_codeset_descriptor_;
00266
00267
00268 Resource_Usage resource_usage_strategy_;
00269
00270
00271
00272 bool drop_replies_;
00273
00274
00275
00276
00277
00278 ACE_Dynamic_Service_Dependency *principal_;
00279 };
00280
00281 TAO_END_VERSIONED_NAMESPACE_DECL
00282
00283 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Resource_Factory)
00284 ACE_FACTORY_DECLARE (TAO, TAO_Default_Resource_Factory)
00285
00286 #include "ace/post.h"
00287 #endif