TAO_IMR_Op_ShutdownRepo Class Reference

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op_ShutdownRepo:

Inheritance graph
[legend]
Collaboration diagram for TAO_IMR_Op_ShutdownRepo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual int run (void)
 Do the work.


Protected Member Functions

void print_usage (void)

Protected Attributes

bool activators_

Detailed Description

Shutdown the ImR and optionally any registered activators.

Definition at line 260 of file tao_imr_i.h.


Constructor & Destructor Documentation

TAO_IMR_Op_ShutdownRepo::TAO_IMR_Op_ShutdownRepo  ) 
 

Definition at line 533 of file tao_imr_i.cpp.

00534 : activators_(false)
00535 {
00536 }


Member Function Documentation

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

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 550 of file tao_imr_i.cpp.

References ACE_ERROR, activators_, LM_ERROR, and print_usage().

00551 {
00552   // Check for enough arguments (we need at least one for the server name)
00553   if (argc < 1)
00554     {
00555       this->print_usage ();
00556       return -1;
00557     }
00558 
00559   // Skip both the program name and the "shutdown-repo" command
00560   ACE_Get_Opt get_opts (argc, argv, "ha");
00561 
00562   int c;
00563 
00564   while ((c = get_opts ()) != -1)
00565     {
00566       switch (c)
00567       {
00568       case 'h':
00569         this->print_usage ();
00570         return -1;
00571       case 'a':
00572         activators_ = true;
00573         break;
00574       default:
00575         ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
00576         this->print_usage ();
00577         return -1;
00578       }
00579     }
00580 
00581   return 0;
00582 }

void TAO_IMR_Op_ShutdownRepo::print_usage void   )  [protected]
 

Definition at line 539 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00540 {
00541   ACE_ERROR ((LM_ERROR, "Shuts down the ImR\n"
00542     "\n"
00543     "Usage: tao_imr [options] shutdown-repo [-a]\n"
00544     "  where [options] are ORB options\n"
00545     "  Specify -a to also shutdown any registered ImR Activators.\n"
00546     "  -h Displays this\n"));
00547 }

int TAO_IMR_Op_ShutdownRepo::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 991 of file tao_imr_i.cpp.

References ACE_ANY_EXCEPTION, ACE_ASSERT, ACE_CATCH, ACE_CATCHANY, ACE_DEBUG, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, activators_, and LM_DEBUG.

00992 {
00993   ACE_ASSERT(! CORBA::is_nil(imr_));
00994 
00995   ACE_DECLARE_NEW_CORBA_ENV;
00996   ACE_TRY
00997     {
00998       bool servers = false; // not implemented yet, if ever
00999       this->imr_->shutdown (activators_, servers ACE_ENV_ARG_PARAMETER);
01000       ACE_TRY_CHECK;
01001 
01002       ACE_DEBUG ((LM_DEBUG, "ImR shutdown initiated.\n"));
01003     }
01004   ACE_CATCH(CORBA::TIMEOUT, ex)
01005     {
01006       ACE_DEBUG ((LM_DEBUG, "Timeout waiting for ImR shutdown.\n"));
01007     }
01008   ACE_CATCHANY
01009     {
01010       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Shutting Down ImR");
01011       return TAO_IMR_Op::UNKNOWN;
01012     }
01013   ACE_ENDTRY;
01014 
01015   return TAO_IMR_Op::NORMAL;
01016 }


Member Data Documentation

bool TAO_IMR_Op_ShutdownRepo::activators_ [protected]
 

Definition at line 270 of file tao_imr_i.h.

Referenced by parse(), and run().


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