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