#include <tao_imr_i.h>
Inheritance diagram for TAO_IMR_Op_Remove:
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_ |
Remove is used to unregister a server in the IMR.
Definition at line 223 of file tao_imr_i.h.
|
Parse arguments.
Implements TAO_IMR_Op. Definition at line 454 of file tao_imr_i.cpp. References ACE_ERROR, LM_ERROR, and print_usage().
00455 { 00456 // Check for enough arguments (we need at least one for the server name) 00457 if (argc < 2) 00458 { 00459 this->print_usage (); 00460 return -1; 00461 } 00462 00463 // Skip both the program name and the "remove" command 00464 ACE_Get_Opt get_opts (argc, argv, "h"); 00465 00466 this->server_name_ = argv[1]; 00467 int c; 00468 00469 while ((c = get_opts ()) != -1) 00470 { 00471 switch (c) 00472 { 00473 case 'h': 00474 this->print_usage (); 00475 return -1; 00476 default: 00477 ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c)); 00478 this->print_usage (); 00479 return -1; 00480 } 00481 } 00482 return 0; 00483 } |
|
Prints a message about the usage.
Definition at line 443 of file tao_imr_i.cpp. References ACE_ERROR, and LM_ERROR. Referenced by parse().
00444 { 00445 ACE_ERROR ((LM_ERROR, "Removes a server entry\n" 00446 "\n" 00447 "Usage: tao_imr [options] remove <name>\n" 00448 " where [options] are ORB options\n" 00449 " where <name> is the POA name used by the server object\n" 00450 " -h Displays this\n")); 00451 } |
|
Do the work.
Implements TAO_IMR_Op. Definition at line 903 of file tao_imr_i.cpp. References ACE_ASSERT, ACE_DEBUG, ACE_ERROR, LM_DEBUG, and LM_ERROR.
00904 { 00905 ACE_ASSERT (! CORBA::is_nil(imr_)); 00906 00907 try 00908 { 00909 this->imr_->remove_server (this->server_name_.c_str ()); 00910 00911 ACE_DEBUG ((LM_DEBUG, "Successfully removed server <%s>\n", 00912 this->server_name_.c_str ())); 00913 } 00914 catch (const ImplementationRepository::NotFound&) 00915 { 00916 ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n", 00917 this->server_name_.c_str ())); 00918 return TAO_IMR_Op::NOT_FOUND; 00919 } 00920 catch (const CORBA::NO_PERMISSION&) 00921 { 00922 ACE_ERROR ((LM_ERROR, "No Permission: ImplRepo is in Locked mode\n")); 00923 return TAO_IMR_Op::NO_PERMISSION; 00924 } 00925 catch (const CORBA::Exception& ex) 00926 { 00927 ex._tao_print_exception ("Removing Server"); 00928 return TAO_IMR_Op::UNKNOWN; 00929 } 00930 00931 return TAO_IMR_Op::NORMAL; 00932 } |
|
Definition at line 233 of file tao_imr_i.h. |