#include <tao_imr_i.h>
Inheritance diagram for TAO_IMR_Op:
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_Op * | make_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. |
Provides a base class with virtual methods for each operation strategy.
Definition at line 79 of file tao_imr_i.h.
|
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 }; |
|
Destructor.
Definition at line 172 of file tao_imr_i.cpp.
00173 {
00174 // Nothing
00175 }
|
|
Prints out the information contained in a ServerInformation structure.
Reimplemented in TAO_IMR_Op_List. Definition at line 184 of file tao_imr_i.cpp. References ACE_DEBUG, LM_DEBUG, and ACE_OS::strlen(). Referenced by TAO_IMR_Op_List::display_server_information().
00185 { 00186 // Figure out what the activation string is. 00187 const char *act = "UNKNOWN STARTUP"; 00188 if (info.startup.activation == ImplementationRepository::NORMAL) 00189 act = "NORMAL"; 00190 else if (info.startup.activation == ImplementationRepository::MANUAL) 00191 act = "MANUAL"; 00192 else if (info.startup.activation == ImplementationRepository::PER_CLIENT) 00193 act = "PER_CLIENT"; 00194 else if (info.startup.activation == ImplementationRepository::AUTO_START) 00195 act = "AUTO_START"; 00196 00197 // Print out information 00198 ACE_DEBUG ((LM_DEBUG, "Server <%s>\n", info.server.in ())); 00199 00200 const char * locked_out = ""; 00201 00202 int limit = info.startup.start_limit; 00203 if (info.startup.start_limit < 0) 00204 { 00205 limit = -limit; 00206 locked_out = " Locked Out\n"; 00207 } 00208 00209 ACE_DEBUG ((LM_DEBUG, 00210 " Activator: %s\n" 00211 " Command Line: %s\n" 00212 " Working Directory: %s\n" 00213 " Activation Mode: %s\n" 00214 " Number of retries: %d\n" 00215 "%s", 00216 info.startup.activator.in (), 00217 info.startup.command_line.in (), 00218 info.startup.working_directory.in (), 00219 act, 00220 limit - 1, 00221 locked_out)); 00222 for (CORBA::ULong i = 0; i < info.startup.environment.length (); ++i) 00223 ACE_DEBUG ((LM_DEBUG, "Environment Variable: %s=%s \n", 00224 info.startup.environment[i].name.in (), 00225 info.startup.environment[i].value.in ())); 00226 00227 if (info.startup.activation == ImplementationRepository::PER_CLIENT) 00228 ACE_DEBUG ((LM_DEBUG, 00229 " No running info available for PER_CLIENT mode\n")); 00230 else if (ACE_OS::strlen (info.partial_ior.in ()) > 0) 00231 ACE_DEBUG ((LM_DEBUG, 00232 " Running at endpoint: %s\n", 00233 info.partial_ior.in ())); 00234 else // I am assuming that a blank partial_ior means currently not running. 00235 ACE_DEBUG ((LM_DEBUG, 00236 " Not currently running\n")); 00237 00238 ACE_DEBUG ((LM_DEBUG, "\n")); 00239 } |
|
Factory.
Definition at line 142 of file tao_imr_i.cpp. References ACE_ERROR, ACE_TEXT(), LM_ERROR, and ACE_OS::strcasecmp().
00143 { 00144 if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("activate")) == 0) 00145 { 00146 ACE_ERROR((LM_ERROR, "Warning: The activate option has been renamed to start.\n")); 00147 return new TAO_IMR_Op_Activate (); 00148 } 00149 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("start")) == 0) 00150 return new TAO_IMR_Op_Activate (); 00151 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("add")) == 0) 00152 return new TAO_IMR_Op_Register (true); 00153 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("autostart")) == 0) 00154 return new TAO_IMR_Op_Autostart(); 00155 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("ior")) == 0) 00156 return new TAO_IMR_Op_IOR(); 00157 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("list")) == 0) 00158 return new TAO_IMR_Op_List (); 00159 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("remove")) == 0) 00160 return new TAO_IMR_Op_Remove (); 00161 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown")) == 0) 00162 return new TAO_IMR_Op_Shutdown (); 00163 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("shutdown-repo")) == 0) 00164 return new TAO_IMR_Op_ShutdownRepo (); 00165 else if (ACE_OS::strcasecmp (op_name, ACE_TEXT ("update")) == 0) 00166 return new TAO_IMR_Op_Register (false); 00167 00168 return 0; 00169 } |
|
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. |
|
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. |
|
Sets the implrepo locator pointer.
Definition at line 178 of file tao_imr_i.cpp.
00179 { 00180 this->imr_ = imr; 00181 } |
|
Reference to our implementation repository.
Definition at line 108 of file tao_imr_i.h. |