diff options
Diffstat (limited to 'TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp')
-rw-r--r-- | TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp | 109 |
1 files changed, 13 insertions, 96 deletions
diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp index c8ce94c72b7..318168c6e50 100644 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp +++ b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp @@ -13,105 +13,22 @@ */ //============================================================================= -#include "ace/pre.h" - -#include "tao/PortableServer/ORB_Manager.h" -#include "orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h" -#include "orbsvcs/FT_ReplicationManagerS.h" -#include "tao/ORB_Core.h" -#include "ace/Get_Opt.h" - -#include "ace/Argv_Type_Converter.h" -#include "tao/PortableServer/ORB_Manager.h" - -#ifdef PG_PS_UNIT_TEST -# include "orbsvcs/PortableGroup/PG_Properties_Encoder.h" -# include "orbsvcs/PortableGroup/PG_Properties_Decoder.h" -#endif // PG_PS_UNIT_TEST - - +#include <tao/Utils/ServantMain.h> +#include "FT_ReplicationManager.h" int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - // Copy command line parameter. - // and hide it's unicodeness. - ACE_Argv_Type_Converter command_line(argc, argv); - - char ** asciiArgv = command_line.get_ASCII_argv(); - - // create an instance of the replication manager and give it the first - // chance at the arguments. - TAO::FT_ReplicationManager rm; - int result = rm.parse_args (argc, asciiArgv); - if (result == 0) - { - ACE_TRY_NEW_ENV - { - - // Create an object that manages all the - // details of being a server. It, too, gets to see the command line. - TAO_ORB_Manager orbManager; + TAO::Utils::ServantMain<TAO::FT_ReplicationManager> servantMain("ReplicationManager"); + return servantMain.Main(argc, argv); +} - result = orbManager.init (argc, asciiArgv - ACE_ENV_ARG_PARAMETER); - if(result == 0) - { - ACE_CHECK_RETURN (-1); +/////////////////////////////////// +// Template instantiation for +// inept compilers. -// property set helper test -#ifdef PG_PS_UNIT_TEST - if ( Portable_Group::Properties::test_encode_decode () ) - { - ACE_ERROR ((LM_ERROR, - "%n\n%T: Passed property set self-test.\n " - )); - } -#endif - - // initialize the replication manager - result = rm.init(orbManager); - if (result == 0) - { - ACE_ERROR ((LM_ERROR, - "%n\n%T: ReplicationManager Ready %s\n", rm.identity() - )); +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + template TAO::Utils::ServantMain<FT_FaultDetectorFactory_i>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +# pragma instantiate TAO::Utils::ServantMain<FT_FaultDetectorFactory_i> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - // Run the main event loop for the ORB. - result = orbManager.run (ACE_ENV_SINGLE_ARG_PARAMETER); - if (result == -1) - { - ACE_ERROR_RETURN ( - (LM_ERROR, "%n\n%T: FT::run error"), - -1); - } - ACE_TRY_CHECK; - ACE_ERROR ((LM_ERROR, - "%n\n%T: Terminated normally. %s\n", rm.identity() - )); - } - else - { - ACE_ERROR ((LM_ERROR, - "%n\n%T: FT_ReplicationManager init failed: %p\n" - )); - result = -1; - } - } - else - { - ACE_ERROR ((LM_ERROR, - "%n\n%T: ORB manager init failed\n" - )); - result = -1; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "FT_ReplicationManager::main\t\n"); - result = -1; - } - ACE_ENDTRY; - } - return result; -} |