TAO_IMR_Op_Activate Class Reference

Activation Operation. More...

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op_Activate:

Inheritance graph
[legend]
Collaboration diagram for TAO_IMR_Op_Activate:

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_
 POA server name.


Detailed Description

Activation Operation.

Activation is used to start servers via the Implementation Repository

Definition at line 124 of file tao_imr_i.h.


Member Function Documentation

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

Parse arguments.

Implements TAO_IMR_Op.

Definition at line 273 of file tao_imr_i.cpp.

References ACE_ERROR, LM_ERROR, and print_usage().

00274 {
00275   // Check for enough arguments (we need at least one for the server name)
00276   if (argc < 2)
00277     {
00278       this->print_usage ();
00279       return -1;
00280     }
00281 
00282   // Skip both the program name and the "activate" command
00283   ACE_Get_Opt get_opts (argc, argv, "h");
00284 
00285   this->server_name_ = argv[1];
00286   int c;
00287 
00288   while ((c = get_opts ()) != -1)
00289     {
00290       switch (c)
00291       {
00292       case 'h':
00293         this->print_usage ();
00294         return -1;
00295       default:
00296         ACE_ERROR((LM_ERROR, "ERROR : Unknown option '%c'\n", (char) c));
00297         this->print_usage ();
00298         return -1;
00299       }
00300     }
00301   return 0;
00302 }

void TAO_IMR_Op_Activate::print_usage void   )  [protected]
 

Prints a message about the usage.

Definition at line 262 of file tao_imr_i.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by parse().

00263 {
00264   ACE_ERROR ((LM_ERROR, "Starts a server using its registered Activator.\n"
00265     "\n"
00266     "Usage: tao_imr [options] start <name>\n"
00267     "  where [options] are ORB options\n"
00268     "  where <name> is the name of a registered POA.\n"
00269     "  -h Displays this\n"));
00270 }

int TAO_IMR_Op_Activate::run void   )  [virtual]
 

Do the work.

Implements TAO_IMR_Op.

Definition at line 693 of file tao_imr_i.cpp.

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

00694 {
00695   ACE_ASSERT(! CORBA::is_nil(imr_));
00696   try
00697     {
00698       this->imr_->activate_server (this->server_name_.c_str ());
00699       ACE_DEBUG ((LM_DEBUG,
00700         "Successfully Activated server <%s>\n",
00701         this->server_name_.c_str ()));
00702     }
00703   catch (const ImplementationRepository::CannotActivate& ex)
00704     {
00705       ACE_ERROR ((LM_ERROR, "Cannot activate server <%s>, reason: <%s>\n",
00706         this->server_name_.c_str (),
00707         ex.reason.in ()));
00708       return TAO_IMR_Op::CANNOT_ACTIVATE;
00709     }
00710   catch (const ImplementationRepository::NotFound&)
00711     {
00712       ACE_ERROR ((LM_ERROR, "Could not find server <%s>.\n", this->server_name_.c_str ()));
00713       return TAO_IMR_Op::NOT_FOUND;
00714     }
00715   catch (const PortableServer::ForwardRequest&)
00716     {
00717       throw;
00718     }
00719   catch (const CORBA::Exception& ex)
00720     {
00721       ex._tao_print_exception ("Activating Server");
00722       return TAO_IMR_Op::UNKNOWN;
00723     }
00724 
00725   return TAO_IMR_Op::NORMAL;
00726 }


Member Data Documentation

ACE_CString TAO_IMR_Op_Activate::server_name_ [protected]
 

POA server name.

Definition at line 135 of file tao_imr_i.h.


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