TAO_IMR_Op_Remove Class Reference

Remove Operation. More...

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op_Remove:

Inheritance graph
[legend]
Collaboration diagram for TAO_IMR_Op_Remove:

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

Remove Operation.

Remove is used to unregister a server in the IMR.

Definition at line 223 of file tao_imr_i.h.


Member Function Documentation

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

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 459 of file tao_imr_i.cpp.

References ACE_ERROR, LM_ERROR, and print_usage().

00460 {
00461   // Check for enough arguments (we need at least one for the server name)
00462   if (argc < 2)
00463     {
00464       this->print_usage ();
00465       return -1;
00466     }
00467 
00468   // Skip both the program name and the "remove" command
00469   ACE_Get_Opt get_opts (argc, argv, "h");
00470 
00471   this->server_name_ = argv[1];
00472   int c;
00473 
00474   while ((c = get_opts ()) != -1)
00475     {
00476       switch (c)
00477       {
00478       case 'h':
00479         this->print_usage ();
00480         return -1;
00481       default:
00482         ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
00483         this->print_usage ();
00484         return -1;
00485       }
00486     }
00487   return 0;
00488 }

void TAO_IMR_Op_Remove::print_usage void   )  [protected]
 

Prints a message about the usage.

Definition at line 448 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00449 {
00450   ACE_ERROR ((LM_ERROR, "Removes a server entry\n"
00451     "\n"
00452     "Usage: tao_imr [options] remove <name>\n"
00453     "  where [options] are ORB options\n"
00454     "  where <name> is the POA name used by the server object\n"
00455     "  -h Displays this\n"));
00456 }

int TAO_IMR_Op_Remove::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 922 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_ERROR, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, LM_DEBUG, and LM_ERROR.

00923 {
00924   ACE_ASSERT (! CORBA::is_nil(imr_));
00925 
00926   ACE_DECLARE_NEW_CORBA_ENV;
00927   ACE_TRY
00928     {
00929       this->imr_->remove_server (this->server_name_.c_str () ACE_ENV_ARG_PARAMETER);
00930       ACE_TRY_CHECK;
00931 
00932       ACE_DEBUG ((LM_DEBUG, "Successfully removed server <%s>\n",
00933         this->server_name_.c_str ()));
00934     }
00935   ACE_CATCH (ImplementationRepository::NotFound, ex)
00936     {
00937       ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n",
00938         this->server_name_.c_str ()));
00939       return TAO_IMR_Op::NOT_FOUND;
00940     }
00941   ACE_CATCH (CORBA::NO_PERMISSION, ex)
00942     {
00943       ACE_ERROR ((LM_ERROR, "No Permission: ImplRepo is in Locked mode\n"));
00944       return TAO_IMR_Op::NO_PERMISSION;
00945     }
00946   ACE_CATCHANY
00947     {
00948       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Removing Server");
00949       return TAO_IMR_Op::UNKNOWN;
00950     }
00951   ACE_ENDTRY;
00952 
00953   return TAO_IMR_Op::NORMAL;
00954 }


Member Data Documentation

ACE_CString TAO_IMR_Op_Remove::server_name_ [protected]
 

Definition at line 233 of file tao_imr_i.h.


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