TAO_IMR_Op_Autostart Class Reference

Autostart Operation. More...

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op_Autostart:

Inheritance graph
[legend]
Collaboration diagram for TAO_IMR_Op_Autostart:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int parse (int argc, ACE_TCHAR **argv)
 Parse arguments.

virtual int run (void)
 Do the work.


Protected Member Functions

void print_usage (void)
 Prints a message about the usage.


Detailed Description

Autostart Operation.

Autostart is used to activate all servers with the AUTO_START activation mode.

Definition at line 146 of file tao_imr_i.h.


Member Function Documentation

int TAO_IMR_Op_Autostart::parse int  argc,
ACE_TCHAR **  argv
[virtual]
 

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 318 of file tao_imr_i.cpp.

References ACE_ERROR, LM_ERROR, and print_usage().

00319 {
00320   // Skip the "autostart" command
00321   ACE_Get_Opt get_opts (argc, argv, "h");
00322 
00323   int c;
00324 
00325   while ((c = get_opts ()) != -1)
00326     {
00327       switch (c)
00328       {
00329       case 'h':  // display help
00330         this->print_usage ();
00331         return -1;
00332       default:
00333         ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
00334         this->print_usage ();
00335         return -1;
00336       }
00337     }
00338   return 0;
00339 }

void TAO_IMR_Op_Autostart::print_usage void   )  [protected]
 

Prints a message about the usage.

Definition at line 310 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00311 {
00312   ACE_ERROR ((LM_ERROR, "Usage: tao_imr [options] autostart\n"
00313     "  where [options] are ORB options\n"
00314     "  -h Displays this\n"));
00315 }

int TAO_IMR_Op_Autostart::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 737 of file tao_imr_i.cpp.

References ACE_ANY_EXCEPTION, ACE_ASSERT, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, ACE_TRY_CHECK_EX, and ACE_TRY_EX.

00738 {
00739   ACE_ASSERT(! CORBA::is_nil (imr_));
00740 
00741   ImplementationRepository::ServerInformationList_var server_list;
00742   ImplementationRepository::ServerInformationIterator_var server_iter;
00743 
00744   ACE_DECLARE_NEW_CORBA_ENV;
00745   ACE_TRY
00746     {
00747       this->imr_->list (0,
00748         server_list,
00749         server_iter
00750         ACE_ENV_ARG_PARAMETER);
00751       ACE_TRY_CHECK;
00752 
00753       ACE_ASSERT(CORBA::is_nil (server_iter.in ()));
00754 
00755       CORBA::ULong len = server_list->length ();
00756       for (CORBA::ULong i = 0; i < len; ++i)
00757         {
00758           ACE_TRY_EX (inside)
00759             {
00760               this->imr_->activate_server (server_list[i].server.in () ACE_ENV_ARG_PARAMETER);
00761               ACE_TRY_CHECK_EX (inside);
00762             }
00763           ACE_CATCHANY
00764             {
00765               ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, server_list[i].server.in ());
00766               // Ignore exception
00767             }
00768           ACE_ENDTRY;
00769         }
00770     }
00771   ACE_CATCHANY
00772     {
00773       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "autostart");
00774       return TAO_IMR_Op::UNKNOWN;
00775     }
00776   ACE_ENDTRY;
00777 
00778   return TAO_IMR_Op::NORMAL;
00779 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:37:27 2006 for TAO_Implementation_Repository by doxygen 1.3.6