diff options
Diffstat (limited to 'TAO/tao/default_resource.cpp')
-rw-r--r-- | TAO/tao/default_resource.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp index 08b52c3c2dd..fcbfeb234fc 100644 --- a/TAO/tao/default_resource.cpp +++ b/TAO/tao/default_resource.cpp @@ -12,9 +12,13 @@ #include "tao/Reactive_Flushing_Strategy.h" #include "tao/Block_Flushing_Strategy.h" +#include "tao/Leader_Follower_Flushing_Strategy.h" + #include "tao/Leader_Follower.h" #include "tao/LRU_Connection_Purging_Strategy.h" +#include "tao/LF_Strategy_Complete.h" + #include "ace/TP_Reactor.h" #include "ace/Dynamic_Service.h" #include "ace/Arg_Shifter.h" @@ -26,8 +30,6 @@ ACE_RCSID(tao, default_resource, "$Id$") - - TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void) : use_tss_resources_ (0), use_locked_data_blocks_ (1), @@ -42,7 +44,7 @@ TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void) options_processed_ (0), factory_disabled_ (0), cached_connection_lock_type_ (TAO_THREAD_LOCK), - flushing_strategy_type_ (TAO_REACTIVE_FLUSHING) + flushing_strategy_type_ (TAO_LEADER_FOLLOWER_FLUSHING) { } @@ -81,7 +83,7 @@ TAO_Default_Resource_Factory::init (int argc, char **argv) return 0; } this->options_processed_ = 1; - + this->parser_names_count_ = 0; int curarg = 0; @@ -335,6 +337,9 @@ TAO_Default_Resource_Factory::init (int argc, char **argv) char *name = argv[curarg]; if (ACE_OS::strcasecmp (name, + "leader_follower") == 0) + this->flushing_strategy_type_ = TAO_LEADER_FOLLOWER_FLUSHING; + else if (ACE_OS::strcasecmp (name, "reactive") == 0) this->flushing_strategy_type_ = TAO_REACTIVE_FLUSHING; else if (ACE_OS::strcasecmp (name, @@ -378,7 +383,7 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, } // OK fallback on the hardcoded ones.... - this->parser_names_count_ = 4; // HOW MANY DO WE HAVE? + this->parser_names_count_ = 4; /*HOW MANY DO WE HAVE?*/ this->parser_names_ = new char *[this->parser_names_count_]; @@ -387,9 +392,7 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, ++i) this->parser_names_[i] = 0; - // Ensure that there is enough space in the parser_names_ array - - size_t index = 0; + // Ensure that there is enough space in the parser_names_ array */ // DLL_Parser TAO_IOR_Parser *tmp = @@ -408,8 +411,12 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, } } - this->parser_names_[index] = CORBA::string_dup ("DLL_Parser"); - index++; + int index = 0; + if (tmp != 0) + { + this->parser_names_[index] = CORBA::string_dup ("DLL_Parser"); + index++; + } // FILE_Parser tmp = @@ -428,9 +435,12 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, "Error Configuring FILE Parser\n"), -1); } } + if (tmp != 0) + { + this->parser_names_[index] = CORBA::string_dup ("FILE_Parser"); + index++; + } - this->parser_names_[index] = CORBA::string_dup ("FILE_Parser"); - index++; // CORBALOC_Parser tmp = @@ -839,7 +849,11 @@ TAO_Flushing_Strategy * TAO_Default_Resource_Factory::create_flushing_strategy (void) { TAO_Flushing_Strategy *strategy = 0; - if (this->flushing_strategy_type_ == TAO_REACTIVE_FLUSHING) + if (this->flushing_strategy_type_ == TAO_LEADER_FOLLOWER_FLUSHING) + ACE_NEW_RETURN (strategy, + TAO_Leader_Follower_Flushing_Strategy, + 0); + else if (this->flushing_strategy_type_ == TAO_REACTIVE_FLUSHING) ACE_NEW_RETURN (strategy, TAO_Reactive_Flushing_Strategy, 0); @@ -879,7 +893,7 @@ TAO_Default_Resource_Factory::create_lf_strategy (void) TAO_LF_Strategy *strategy = 0; ACE_NEW_RETURN (strategy, - TAO_Complete_LF_Strategy, + TAO_LF_Strategy_Complete, 0); return strategy; |