Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 Methods

 TAO_IMR_Op_Autostart (void)
 ~TAO_IMR_Op_Autostart (void)
virtual int parse (int argc, ACE_TCHAR **argv)
 Parse arguments. More...

virtual int run (void)
 Do the work. More...


Protected Methods

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


Detailed Description

Autostart Operation.

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

Definition at line 188 of file tao_imr_i.h.


Constructor & Destructor Documentation

TAO_IMR_Op_Autostart::TAO_IMR_Op_Autostart void   
 

Definition at line 214 of file tao_imr_i.cpp.

00215 {
00216   // Nothing
00217 }

TAO_IMR_Op_Autostart::~TAO_IMR_Op_Autostart void   
 

Definition at line 270 of file tao_imr_i.cpp.

00271 {
00272   // Nothing
00273 }


Member Function Documentation

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

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 410 of file tao_imr_i.cpp.

References ACE_TCHAR, and print_usage.

00411 {
00412   // Skip the "autostart" command
00413   ACE_Get_Opt get_opts (argc, argv, "h", 0);
00414 
00415   int c;
00416 
00417   while ((c = get_opts ()) != -1)
00418     switch (c)
00419       {
00420       case 'h':  // display help
00421       default:
00422         this->print_usage ();
00423         return -1;
00424       }
00425 
00426   // Success
00427   return 0;
00428 }

void TAO_IMR_Op_Autostart::print_usage void    [protected]
 

Prints a message about the usage.

Definition at line 1139 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse.

01140 {
01141   ACE_ERROR ((LM_ERROR, "Usage: tao_imr [options] autostart [command-arguments]\n"
01142                         "  where [options] are ORB options\n"
01143                         "  where [command-arguments] can be\n"
01144                         "    -h            Displays this\n"));
01145 }

int TAO_IMR_Op_Autostart::run void    [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 749 of file tao_imr_i.cpp.

References ACE_ANY_EXCEPTION, 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, ACE_TRY_EX, TAO_IMR_Op::imr_locator_, ImplementationRepository::ServerInformationList_var::in, ImplementationRepository::ServerInformationIterator_var::in, IR_LIST_CHUNK, CORBA::is_nil, NORMAL, and UNKNOWN.

00750 {
00751   ImplementationRepository::ServerInformationList_var server_list;
00752   ImplementationRepository::ServerInformationIterator_var server_iter;
00753 
00754   ACE_DECLARE_NEW_CORBA_ENV;
00755   ACE_TRY
00756     {
00757       this->imr_locator_->list (0, server_list, server_iter ACE_ENV_ARG_PARAMETER);
00758       ACE_TRY_CHECK;
00759 
00760       // Check for more to be displayed
00761       if (!CORBA::is_nil (server_iter.in ()))
00762         {
00763           int flag = 1;
00764 
00765           while (flag)
00766             {
00767               // @@ To do: modify implementation of next_n to NOT
00768               // return a boolean.
00769               // flag =
00770               server_iter->next_n (IR_LIST_CHUNK,
00771                                    server_list
00772                                    ACE_ENV_ARG_PARAMETER);
00773               ACE_TRY_CHECK;
00774 
00775               for (CORBA::ULong i = 0; i < server_list->length (); i++)
00776                 {
00777                   ACE_TRY_EX (inside)
00778                     {
00779                       this->imr_locator_->activate_server (
00780                             server_list[i].server.in ()
00781                             ACE_ENV_ARG_PARAMETER);
00782                       ACE_TRY_CHECK_EX (inside);
00783                     }
00784                   ACE_CATCHANY
00785                     {
00786                       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00787                                            server_list[i].server.in ());
00788                       // Ignore exception
00789                     }
00790                   ACE_ENDTRY;
00791                 }
00792             }
00793 
00794           // We are done with the iterator, so it can go away now.
00795           server_iter->destroy ();
00796         }
00797     }
00798   ACE_CATCHANY
00799     {
00800       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "autostart");
00801       return UNKNOWN;
00802     }
00803   ACE_ENDTRY;
00804 
00805   return NORMAL;
00806 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 20:04:32 2003 for TAO_Implementation_Repository by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002