3 //=============================================================================
5 * @file Activator_Options.h
7 * @brief Definition of the Options class for the Implementation Repository.
9 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
11 //=============================================================================
13 #ifndef ACTIVATOR_OPTIONS_H
14 #define ACTIVATOR_OPTIONS_H
16 #include "activator_export.h"
18 #include "ace/SString.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
27 * This is where all the settings for TAO's Implementation Repository are
30 class Activator_Export Activator_Options
34 enum SERVICE_COMMAND
{
41 // This default is based on the value from ACE_Process_Options
42 // however, the real value is protected -- CAE 4/16/2007
43 enum ACTIVATOR_PROCESS
45 ENVIRONMENT_BUFFER
= 16 * 1024,
46 ENVIRONMENT_MAX_VARS
= 512
51 /// Parse the command-line arguments and initialize the options.
52 int init (int argc
, ACE_TCHAR
*argv
[]);
53 /// This version should only be used when run as an nt service.
54 int init_from_registry();
57 bool service (void) const;
59 /// Notify the ImR when server processes die.
60 /// @note Currently this only works on Unix.
61 bool notify_imr (void) const;
63 /// When notifying of child death, pause this number of milliseconds
64 /// to simulate a heavily loaded server.
65 unsigned int induce_delay (void) const;
67 /// Debug level for the Implementation Repository.
68 unsigned int debug (void) const;
70 /// Returns the file where the IOR should be stored.
71 const ACE_TString
& ior_filename (void) const;
73 /// The nt service command to run (install/remove)
74 SERVICE_COMMAND
service_command(void) const;
76 /// Save the command line arguments as registry settings. (Windows only)
77 int save_registry_options ();
79 const char* cmdline(void) const;
81 const ACE_CString
& name(void) const;
83 int env_buf_len (void) const;
85 int max_env_vars (void) const;
87 bool detach_child (void) const;
90 /// Parses and pulls out arguments for the ImR
91 int parse_args (int &argc
, ACE_TCHAR
*argv
[]);
93 /// Print the usage information.
94 void print_usage (void) const;
96 /// Loads options from the registry
97 int load_registry_options ();
101 /// Our extra command line arguments
102 ACE_CString cmdline_
;
107 /// File where the IOR of the server object is stored.
108 ACE_TString ior_output_file_
;
110 /// Should we run as a service?
113 /// Notify the ImR when server processes die.
114 /// @note Currently this only works on Unix.
117 /// When notifying of child death, pause this number of milliseconds
118 /// to simulate a heavily loaded server.
119 unsigned int induce_delay_
;
121 /// SC_NONE, SC_INSTALL, SC_REMOVE, ...
122 SERVICE_COMMAND service_command_
;
126 /// The default environment buffer length
129 /// Maximum number of environment variables
132 /// Control signal handling related to child processes