Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef TAO_ADVANCED_RESOURCE_H
00006 #define TAO_ADVANCED_RESOURCE_H
00007 #include "ace/pre.h"
00008
00009 #include "tao/Strategies/strategies_export.h"
00010 #include "tao/default_resource.h"
00011
00012 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00013 # pragma once
00014 #endif
00015
00016 #include "tao/ORB_Core.h"
00017
00018 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00019
00020 class TAO_Connection_Purging_Strategy;
00021
00022 class TAO_Strategies_Export TAO_Resource_Factory_Changer
00023 {
00024 public:
00025 TAO_Resource_Factory_Changer (void);
00026 };
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class TAO_Strategies_Export TAO_Advanced_Resource_Factory :
00040 public TAO_Default_Resource_Factory
00041 {
00042 public:
00043
00044
00045 TAO_Advanced_Resource_Factory (void);
00046
00047
00048 virtual ~TAO_Advanced_Resource_Factory (void);
00049
00050
00051
00052 virtual int init (int argc, ACE_TCHAR* argv[]);
00053
00054
00055 enum Allocator_Lock_Type
00056 {
00057 TAO_ALLOCATOR_NULL_LOCK,
00058 TAO_ALLOCATOR_THREAD_LOCK
00059 };
00060
00061
00062 enum
00063 {
00064
00065 TAO_REACTOR_SELECT_MT = 1,
00066
00067
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 };
00074
00075
00076 enum
00077 {
00078
00079 TAO_THREAD_QUEUE_NOT_SET,
00080
00081
00082 TAO_THREAD_QUEUE_FIFO,
00083
00084
00085 TAO_THREAD_QUEUE_LIFO
00086 };
00087
00088
00089
00090
00091
00092 virtual int init_protocol_factories (void);
00093 virtual ACE_Allocator* input_cdr_dblock_allocator (void);
00094 virtual ACE_Allocator* input_cdr_buffer_allocator (void);
00095 virtual ACE_Allocator* input_cdr_msgblock_allocator (void);
00096 virtual ACE_Allocator* amh_response_handler_allocator (void);
00097 virtual ACE_Allocator* ami_response_handler_allocator (void);
00098 virtual int input_cdr_allocator_type_locked (void);
00099 virtual TAO_ProtocolFactorySet *get_protocol_factories (void);
00100
00101
00102 virtual TAO_Connection_Purging_Strategy *create_purging_strategy (void);
00103 virtual TAO_LF_Strategy *create_lf_strategy (void);
00104
00105 protected:
00106
00107
00108 virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
00109
00110 void report_option_value_error (const ACE_TCHAR* option_name,
00111 const ACE_TCHAR* option_value);
00112
00113 void report_unsupported_error (const ACE_TCHAR* option_name);
00114
00115
00116 TAO_ProtocolFactorySet protocol_factories_;
00117
00118
00119 int reactor_registry_type_;
00120
00121
00122 int reactor_type_;
00123
00124
00125
00126 int threadqueue_type_;
00127
00128
00129 Allocator_Lock_Type cdr_allocator_type_;
00130
00131
00132 Allocator_Lock_Type amh_response_handler_allocator_lock_type_;
00133
00134
00135 Allocator_Lock_Type ami_response_handler_allocator_lock_type_;
00136
00137 virtual int load_default_protocols (void);
00138
00139 };
00140
00141 static TAO_Resource_Factory_Changer TAO_changer;
00142
00143
00144 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Strategies, TAO_Advanced_Resource_Factory)
00145 ACE_FACTORY_DECLARE (TAO_Strategies, TAO_Advanced_Resource_Factory)
00146
00147 TAO_END_VERSIONED_NAMESPACE_DECL
00148
00149 #include "ace/post.h"
00150 #endif