TAO_IMR_Op_Shutdown Class Reference

Shutdown Operation. More...

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op_Shutdown:

Inheritance graph
[legend]
Collaboration diagram for TAO_IMR_Op_Shutdown:

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.


Protected Attributes

ACE_CString server_name_

Detailed Description

Shutdown Operation.

Shutdown is used to shutdown a server through the IMR.

Definition at line 244 of file tao_imr_i.h.


Member Function Documentation

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

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 497 of file tao_imr_i.cpp.

References ACE_ERROR, LM_ERROR, and print_usage().

00498 {
00499   // Check for enough arguments (we need at least one for the server name)
00500   if (argc < 2)
00501     {
00502       this->print_usage ();
00503       return -1;
00504     }
00505 
00506   // Skip both the program name and the "shutdown" command
00507   ACE_Get_Opt get_opts (argc, argv, "h");
00508 
00509   this->server_name_ = argv[1];
00510   int c;
00511 
00512   while ((c = get_opts ()) != -1)
00513     {
00514       switch (c)
00515       {
00516       case 'h':
00517         this->print_usage ();
00518         return -1;
00519       default:
00520         ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
00521         this->print_usage ();
00522         return -1;
00523       }
00524     }
00525   return 0;
00526 }

void TAO_IMR_Op_Shutdown::print_usage void   )  [protected]
 

Prints a message about the usage.

Definition at line 486 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00487 {
00488   ACE_ERROR ((LM_ERROR, "Shuts down a server\n"
00489     "\n"
00490     "Usage: tao_imr [options] shutdown <name>\n"
00491     "  where [options] are ORB options\n"
00492     "  where <name> is the name of the server object\n"
00493     "  -h Displays this\n"));
00494 }

int TAO_IMR_Op_Shutdown::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 935 of file tao_imr_i.cpp.

References ACE_ASSERT, ACE_DEBUG, ACE_ERROR, LM_DEBUG, and LM_ERROR.

00936 {
00937   ACE_ASSERT (! CORBA::is_nil(imr_));
00938 
00939   try
00940     {
00941       this->imr_->shutdown_server (this->server_name_.c_str ());
00942 
00943       ACE_DEBUG ((LM_DEBUG, "Successfully shut down server <%s>\n",
00944         this->server_name_.c_str ()));
00945     }
00946   catch (const ImplementationRepository::NotFound&)
00947     {
00948       ACE_ERROR ((LM_ERROR, "Server <%s> already shut down.\n", this->server_name_.c_str ()));
00949       return TAO_IMR_Op::NOT_FOUND;
00950     }
00951   catch (const CORBA::TIMEOUT&)
00952     {
00953       ACE_DEBUG ((LM_DEBUG, "Timeout waiting for <%s> to shutdown.\n",
00954         this->server_name_.c_str ()));
00955     }
00956   catch (const CORBA::Exception& ex)
00957     {
00958       ex._tao_print_exception ("Shutting Down Server");
00959       return TAO_IMR_Op::UNKNOWN;
00960     }
00961 
00962   return TAO_IMR_Op::NORMAL;
00963 }


Member Data Documentation

ACE_CString TAO_IMR_Op_Shutdown::server_name_ [protected]
 

Definition at line 254 of file tao_imr_i.h.


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