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 313 of file tao_imr_i.cpp.

References ACE_ERROR, LM_ERROR, and print_usage().

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

void TAO_IMR_Op_Autostart::print_usage void   )  [protected]
 

Prints a message about the usage.

Definition at line 305 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00306 {
00307   ACE_ERROR ((LM_ERROR, "Usage: tao_imr [options] autostart\n"
00308     "  where [options] are ORB options\n"
00309     "  -h Displays this\n"));
00310 }

int TAO_IMR_Op_Autostart::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 729 of file tao_imr_i.cpp.

References ACE_ASSERT.

00730 {
00731   ACE_ASSERT(! CORBA::is_nil (imr_));
00732 
00733   ImplementationRepository::ServerInformationList_var server_list;
00734   ImplementationRepository::ServerInformationIterator_var server_iter;
00735 
00736   try
00737     {
00738       this->imr_->list (0,
00739         server_list,
00740         server_iter);
00741 
00742       ACE_ASSERT(CORBA::is_nil (server_iter.in ()));
00743 
00744       CORBA::ULong len = server_list->length ();
00745       for (CORBA::ULong i = 0; i < len; ++i)
00746         {
00747           try
00748             {
00749               this->imr_->activate_server (server_list[i].server.in ());
00750             }
00751           catch (const CORBA::Exception& ex)
00752             {
00753               ex._tao_print_exception (
00754                 server_list[i].server.in (
00755                   ));
00756               // Ignore exception
00757             }
00758         }
00759     }
00760   catch (const CORBA::Exception& ex)
00761     {
00762       ex._tao_print_exception ("autostart");
00763       return TAO_IMR_Op::UNKNOWN;
00764     }
00765 
00766   return TAO_IMR_Op::NORMAL;
00767 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 15:56:05 2008 for TAO_Implementation_Repository by doxygen 1.3.6