diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-09-06 07:46:26 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-09-06 07:46:26 +0000 |
commit | a22d92a90cfedeb507cbd641e72606bb737fed60 (patch) | |
tree | d39c7ccaf0a3fd48d89ea60338ac07829004a5dd /TAO/tao/Utils | |
parent | 1844ff8723706a77c7d540076f1a62a3f10a3c8f (diff) | |
download | ATCD-a22d92a90cfedeb507cbd641e72606bb737fed60.tar.gz |
ChangeLogTag:Mon Sep 6 00:42:49 2004 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Utils')
-rw-r--r-- | TAO/tao/Utils/Server_Main.cpp | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/TAO/tao/Utils/Server_Main.cpp b/TAO/tao/Utils/Server_Main.cpp index 3cd07cc85f7..efaf2372215 100644 --- a/TAO/tao/Utils/Server_Main.cpp +++ b/TAO/tao/Utils/Server_Main.cpp @@ -19,39 +19,45 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -ACE_RCSID(Utils, Server_Main, "$Id$") +ACE_RCSID (Utils, + Server_Main, + "$Id$") + #include "ace/Argv_Type_Converter.h" #include "ace/Log_Msg.h" #include "tao/ORB.h" template <typename SERVANT> -TAO::Utils::Server_Main<SERVANT>::Server_Main(const char * name) +TAO::Utils::Server_Main<SERVANT>::Server_Main (const char * name) : name_(name) { } template <typename SERVANT> -TAO::Utils::Server_Main<SERVANT>::~Server_Main() +TAO::Utils::Server_Main<SERVANT>::~Server_Main () { } template <typename SERVANT> -int TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) +int +TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) { int result = 0; // hide unicode if necessary. - ACE_Argv_Type_Converter command_line(argc, argv); + ACE_Argv_Type_Converter command_line (argc, argv); - char ** asciiArgv = command_line.get_ASCII_argv(); + char ** asciiArgv = command_line.get_ASCII_argv (); ACE_TRY_NEW_ENV { // Initialize the orb - CORBA::ORB_var orb = CORBA::ORB_init(argc, asciiArgv, name_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - if(! CORBA::is_nil(orb.in ())) + CORBA::ORB_var orb = + CORBA::ORB_init (argc, asciiArgv, name_ ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (! CORBA::is_nil(orb.in ())) { // create an instance of the servant object and give it a // chance at the arguments. @@ -61,19 +67,19 @@ int TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) { ////////////////////////////////// // let the servant register itself - result = servant.init(orb.in () ACE_ENV_ARG_PARAMETER); + result = servant.init (orb.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; if (result == 0) { ACE_ERROR ((LM_INFO, - "%T %s (%P|%t) Ready %s\n", name_, servant.identity() + "%T %s (%P|%t) Ready %s\n", name_, servant.identity () )); ////////////////////////////////// // Run the event loop for the ORB. // Initial run to initialize the orb - ACE_Time_Value tv(1,0); + ACE_Time_Value tv (1,0); orb->run (tv ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -81,20 +87,22 @@ int TAO::Utils::Server_Main<SERVANT>::run (int argc, ACE_TCHAR *argv[]) int quit = 0; while (result == 0 && ! quit ) { - ACE_Time_Value work_tv(1,0); + ACE_Time_Value work_tv (1,0); orb->perform_work(work_tv ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; quit = servant.idle (result ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } - servant.fini(ACE_ENV_SINGLE_ARG_PARAMETER); + servant.fini (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - orb->shutdown(1 ACE_ENV_ARG_PARAMETER); + orb->shutdown (1 ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_ERROR ((LM_INFO, - "%T %s (%P|%t) Terminated normally. %s\n", name_, servant.identity() + "%T %s (%P|%t) Terminated normally. %s\n", + name_, + servant.identity () )); } else |