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/Copy_Disabled.h"
00020 #include "ace/Service_Config.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 class TAO_Export TAO_Codeset_Parameters
00056 : public ACE_Copy_Disabled
00057 {
00058 public:
00059 TAO_Codeset_Parameters (void);
00060 ~TAO_Codeset_Parameters (void);
00061
00062
00063 const ACE_TCHAR* native (void);
00064
00065
00066 void native (const ACE_TCHAR* n);
00067
00068
00069 void add_translator (const ACE_TCHAR* name);
00070
00071 typedef ACE_Unbounded_Queue_Iterator<ACE_TCHAR*> iterator;
00072
00073
00074 iterator translators (void);
00075
00076
00077 void apply_to (TAO_Codeset_Descriptor_Base *csd);
00078
00079 private:
00080 ACE_Unbounded_Queue<ACE_TCHAR*> translators_;
00081 ACE_TCHAR* native_;
00082 };
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 class TAO_Export TAO_Default_Resource_Factory
00117 : public TAO_Resource_Factory
00118 {
00119 public:
00120
00121
00122 TAO_Default_Resource_Factory (void);
00123
00124
00125 virtual ~TAO_Default_Resource_Factory (void);
00126
00127
00128
00129
00130
00131
00132 virtual int init (int argc, ACE_TCHAR *argv[]);
00133
00134
00135 int parse_args (int argc, ACE_TCHAR* argv[]);
00136
00137
00138
00139
00140
00141
00142
00143 int get_parser_names (char **&names,
00144 int &number_of_names);
00145 enum
00146 {
00147 TAO_ALLOCATOR_THREAD_LOCK
00148 };
00149
00150
00151 int cdr_allocator_source (void);
00152
00153
00154 virtual int use_locked_data_blocks (void) const;
00155 virtual ACE_Reactor *get_reactor (void);
00156 virtual void reclaim_reactor (ACE_Reactor *);
00157 virtual TAO_Acceptor_Registry *get_acceptor_registry (void);
00158 virtual TAO_Connector_Registry *get_connector_registry (void);
00159 virtual void use_local_memory_pool (bool);
00160 virtual ACE_Allocator* input_cdr_dblock_allocator (void);
00161 virtual ACE_Allocator* input_cdr_buffer_allocator (void);
00162 virtual ACE_Allocator* input_cdr_msgblock_allocator (void);
00163 virtual int input_cdr_allocator_type_locked (void);
00164 virtual ACE_Allocator* output_cdr_dblock_allocator (void);
00165 virtual ACE_Allocator* output_cdr_buffer_allocator (void);
00166 virtual ACE_Allocator* output_cdr_msgblock_allocator (void);
00167 virtual ACE_Allocator* amh_response_handler_allocator (void);
00168 virtual ACE_Allocator* ami_response_handler_allocator (void);
00169 virtual TAO_ProtocolFactorySet *get_protocol_factories (void);
00170
00171 virtual int init_protocol_factories (void);
00172
00173 virtual TAO_Codeset_Manager * codeset_manager (void);
00174
00175 virtual int cache_maximum (void) const;
00176 virtual int purge_percentage (void) const;
00177 virtual int max_muxed_connections (void) const;
00178 virtual ACE_Lock *create_cached_connection_lock (void);
00179 virtual ACE_Lock *create_object_key_table_lock (void);
00180 virtual TAO_Configurable_Refcount create_corba_object_refcount (void);
00181 virtual ACE_Lock *create_corba_object_lock (void);
00182 virtual int locked_transport_cache (void);
00183 virtual TAO_Flushing_Strategy *create_flushing_strategy (void);
00184 virtual TAO_Connection_Purging_Strategy *create_purging_strategy (void);
00185 TAO_Resource_Factory::Resource_Usage resource_usage_strategy (void) const;
00186 virtual TAO_LF_Strategy *create_lf_strategy (void);
00187 virtual auto_ptr<TAO_GIOP_Fragmentation_Strategy>
00188 create_fragmentation_strategy (TAO_Transport * transport,
00189 CORBA::ULong max_message_size) const;
00190 virtual void disable_factory (void);
00191 virtual bool drop_replies_during_shutdown (void) const;
00192
00193
00194 protected:
00195
00196
00197 virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
00198
00199
00200 int add_to_ior_parser_names (const char *);
00201
00202 void report_option_value_error (const ACE_TCHAR* option_name,
00203 const ACE_TCHAR* option_value);
00204
00205 protected:
00206
00207
00208 int use_locked_data_blocks_;
00209
00210
00211 int parser_names_count_;
00212
00213
00214 char **parser_names_;
00215
00216
00217 int index_;
00218
00219
00220 TAO_ProtocolFactorySet protocol_factories_;
00221
00222
00223
00224 TAO_Resource_Factory::Purging_Strategy connection_purging_type_;
00225
00226
00227
00228 int cache_maximum_;
00229
00230
00231
00232 int purge_percentage_;
00233
00234
00235
00236
00237 int max_muxed_connections_;
00238
00239
00240 int reactor_mask_signals_;
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253 bool dynamically_allocated_reactor_;
00254
00255 virtual int load_default_protocols (void);
00256
00257
00258
00259
00260 int options_processed_;
00261
00262
00263
00264
00265 int factory_disabled_;
00266
00267 enum Output_CDR_Allocator_Type
00268 {
00269 LOCAL_MEMORY_POOL,
00270 #if TAO_HAS_SENDFILE == 1
00271 MMAP_ALLOCATOR,
00272 #endif
00273 DEFAULT
00274 };
00275
00276
00277 Output_CDR_Allocator_Type output_cdr_allocator_type_;
00278
00279
00280
00281 bool use_local_memory_pool_;
00282
00283 private:
00284 enum Lock_Type
00285 {
00286 TAO_NULL_LOCK,
00287 TAO_THREAD_LOCK
00288 };
00289
00290
00291 Lock_Type cached_connection_lock_type_;
00292
00293
00294 Lock_Type object_key_table_lock_type_;
00295
00296
00297 Lock_Type corba_object_lock_type_;
00298
00299 enum Flushing_Strategy_Type
00300 {
00301 TAO_LEADER_FOLLOWER_FLUSHING,
00302 TAO_REACTIVE_FLUSHING,
00303 TAO_BLOCKING_FLUSHING
00304 };
00305
00306
00307 Flushing_Strategy_Type flushing_strategy_type_;
00308
00309
00310
00311 TAO_Codeset_Parameters char_codeset_parameters_;
00312 TAO_Codeset_Parameters wchar_codeset_parameters_;
00313
00314
00315 Resource_Usage resource_usage_strategy_;
00316
00317
00318
00319 bool drop_replies_;
00320 };
00321
00322 TAO_END_VERSIONED_NAMESPACE_DECL
00323
00324 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Resource_Factory)
00325 ACE_FACTORY_DECLARE (TAO, TAO_Default_Resource_Factory)
00326
00327 #include "ace/post.h"
00328 #endif