TAO_IMR_Op Class Reference

IMR Operation Base Class. More...

#include <tao_imr_i.h>

Inheritance diagram for TAO_IMR_Op:

Inheritance graph
[legend]
List of all members.

Public Types

enum  RETURN_CODES {
  NORMAL = 0, UNKNOWN, NO_PERMISSION, ALREADY_REGISTERED,
  CANNOT_ACTIVATE, NOT_FOUND
}

Public Member Functions

virtual ~TAO_IMR_Op (void)
 Destructor.

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

virtual int run (void)=0
 Do the work.

void set_imr (ImplementationRepository::Administration_ptr imr)
 Sets the implrepo locator pointer.


Static Public Member Functions

TAO_IMR_Opmake_op (const ACE_TCHAR *op_name)
 Factory.


Protected Member Functions

void display_server_information (const ImplementationRepository::ServerInformation &info)
 Prints out the information contained in a ServerInformation structure.


Protected Attributes

ImplementationRepository::Administration_ptr imr_
 Reference to our implementation repository.


Detailed Description

IMR Operation Base Class.

Provides a base class with virtual methods for each operation strategy.

Definition at line 79 of file tao_imr_i.h.


Member Enumeration Documentation

enum TAO_IMR_Op::RETURN_CODES
 

Enumeration values:
NORMAL 
UNKNOWN 
NO_PERMISSION 
ALREADY_REGISTERED 
CANNOT_ACTIVATE 
NOT_FOUND 

Definition at line 82 of file tao_imr_i.h.

00082                     {
00083     NORMAL = 0,
00084     UNKNOWN,
00085     NO_PERMISSION,
00086     ALREADY_REGISTERED,
00087     CANNOT_ACTIVATE,
00088     NOT_FOUND
00089   };


Constructor & Destructor Documentation

TAO_IMR_Op::~TAO_IMR_Op void   )  [virtual]
 

Destructor.

Definition at line 177 of file tao_imr_i.cpp.

00178 {
00179   // Nothing
00180 }


Member Function Documentation

void TAO_IMR_Op::display_server_information const ImplementationRepository::ServerInformation &  info  )  [protected]
 

Prints out the information contained in a ServerInformation structure.

Reimplemented in TAO_IMR_Op_List.

Definition at line 189 of file tao_imr_i.cpp.

References ACE_DEBUG, LM_DEBUG, and ACE_OS::strlen().

Referenced by TAO_IMR_Op_List::display_server_information().

00190 {
00191   // Figure out what the activation string is.
00192   const char *act = "UNKNOWN STARTUP";
00193   if (info.startup.activation == ImplementationRepository::NORMAL)
00194     act = "NORMAL";
00195   else if (info.startup.activation == ImplementationRepository::MANUAL)
00196     act = "MANUAL";
00197   else if (info.startup.activation == ImplementationRepository::PER_CLIENT)
00198     act = "PER_CLIENT";
00199   else if (info.startup.activation == ImplementationRepository::AUTO_START)
00200     act = "AUTO_START";
00201 
00202   // Print out information
00203   ACE_DEBUG ((LM_DEBUG, "Server <%s>\n", info.server.in ()));
00204 
00205   const char * locked_out = "";
00206 
00207   int limit = info.startup.start_limit;
00208   if (info.startup.start_limit < 0)
00209     {
00210       limit = -limit;
00211       locked_out = "  Locked Out\n";
00212     }
00213 
00214   ACE_DEBUG ((LM_DEBUG,
00215     "  Activator: %s\n"
00216     "  Command Line: %s\n"
00217     "  Working Directory: %s\n"
00218     "  Activation Mode: %s\n"
00219     "  Number of retries: %d\n"
00220     "%s",
00221     info.startup.activator.in (),
00222     info.startup.command_line.in (),
00223     info.startup.working_directory.in (),
00224     act,
00225     limit - 1,
00226     locked_out));
00227   for (CORBA::ULong i = 0; i < info.startup.environment.length (); ++i)
00228     ACE_DEBUG ((LM_DEBUG, "Environment Variable: %s=%s \n",
00229     info.startup.environment[i].name.in (),
00230     info.startup.environment[i].value.in ()));
00231 
00232   if (info.startup.activation == ImplementationRepository::PER_CLIENT)
00233     ACE_DEBUG ((LM_DEBUG,
00234                 "  No running info available for PER_CLIENT mode\n"));
00235   else if (ACE_OS::strlen (info.partial_ior.in ()) > 0)
00236     ACE_DEBUG ((LM_DEBUG,
00237                 "  Running at endpoint: %s\n",
00238                 info.partial_ior.in ()));
00239   else   // I am assuming that a blank partial_ior means currently not running.
00240     ACE_DEBUG ((LM_DEBUG,
00241                 "  Not currently running\n"));
00242 
00243   ACE_DEBUG ((LM_DEBUG, "\n"));
00244 }

TAO_IMR_Op * TAO_IMR_Op::make_op const ACE_TCHAR op_name  )  [static]
 

Factory.

Definition at line 147 of file tao_imr_i.cpp.

References ACE_ERROR, ACE_TEXT(), LM_ERROR, and ACE_OS::strcasecmp().

00148 {
00149   if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("activate")) == 0)
00150     {
00151       ACE_ERROR((LM_ERROR, "Warning: The activate option has been renamed to start.\n"));
00152       return new TAO_IMR_Op_Activate ();
00153     }
00154   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("start")) == 0)
00155     return new TAO_IMR_Op_Activate ();
00156   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("add")) == 0)
00157     return new TAO_IMR_Op_Register (true);
00158   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("autostart")) == 0)
00159     return new TAO_IMR_Op_Autostart();
00160   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("ior")) == 0)
00161     return new TAO_IMR_Op_IOR();
00162   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("list")) == 0)
00163     return new TAO_IMR_Op_List ();
00164   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("remove")) == 0)
00165     return new TAO_IMR_Op_Remove ();
00166   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown")) == 0)
00167     return new TAO_IMR_Op_Shutdown ();
00168   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown-repo")) == 0)
00169     return new TAO_IMR_Op_ShutdownRepo ();
00170   else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("update")) == 0)
00171     return new TAO_IMR_Op_Register (false);
00172 
00173   return 0;
00174 }

virtual int TAO_IMR_Op::parse int  argc,
ACE_TCHAR **  argv
[pure virtual]
 

Parse arguments.

Implemented in TAO_IMR_Op_Activate, TAO_IMR_Op_Autostart, TAO_IMR_Op_IOR, TAO_IMR_Op_List, TAO_IMR_Op_Remove, TAO_IMR_Op_Shutdown, TAO_IMR_Op_ShutdownRepo, and TAO_IMR_Op_Register.

virtual int TAO_IMR_Op::run void   )  [pure virtual]
 

Do the work.

Implemented in TAO_IMR_Op_Activate, TAO_IMR_Op_Autostart, TAO_IMR_Op_IOR, TAO_IMR_Op_List, TAO_IMR_Op_Remove, TAO_IMR_Op_Shutdown, TAO_IMR_Op_ShutdownRepo, and TAO_IMR_Op_Register.

void TAO_IMR_Op::set_imr ImplementationRepository::Administration_ptr  imr  ) 
 

Sets the implrepo locator pointer.

Definition at line 183 of file tao_imr_i.cpp.

00184 {
00185   this->imr_ = imr;
00186 }


Member Data Documentation

ImplementationRepository::Administration_ptr TAO_IMR_Op::imr_ [protected]
 

Reference to our implementation repository.

Definition at line 108 of file tao_imr_i.h.


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