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
33 enum SERVICE_COMMAND
{
40 // This default is based on the value from ACE_Process_Options
41 // however, the real value is protected -- CAE 4/16/2007
42 enum ACTIVATOR_PROCESS
44 ENVIRONMENT_BUFFER
= 16 * 1024,
45 ENVIRONMENT_MAX_VARS
= 512
50 /// Parse the command-line arguments and initialize the options.
51 int init (int argc
, ACE_TCHAR
*argv
[]);
52 /// This version should only be used when run as an nt service.
53 int init_from_registry();
56 bool service () const;
58 /// Notify the ImR when server processes die.
59 /// @note Currently this only works on Unix.
60 bool notify_imr () const;
62 /// When notifying of child death, pause this number of milliseconds
63 /// to simulate a heavily loaded server.
64 unsigned int induce_delay () const;
66 /// Debug level for the Implementation Repository.
67 unsigned int debug () const;
69 /// Returns the file where the IOR should be stored.
70 const ACE_TString
& ior_filename () const;
72 /// The nt service command to run (install/remove)
73 SERVICE_COMMAND
service_command() const;
75 /// Save the command line arguments as registry settings. (Windows only)
76 int save_registry_options ();
78 const char* cmdline() const;
80 const ACE_CString
& name() const;
82 int env_buf_len () const;
84 int max_env_vars () const;
86 bool detach_child () const;
89 /// Parses and pulls out arguments for the ImR
90 int parse_args (int &argc
, ACE_TCHAR
*argv
[]);
92 /// Print the usage information.
93 void print_usage () const;
95 /// Loads options from the registry
96 int load_registry_options ();
99 /// Our extra command line arguments
100 ACE_CString cmdline_
;
105 /// File where the IOR of the server object is stored.
106 ACE_TString ior_output_file_
;
108 /// Should we run as a service?
111 /// Notify the ImR when server processes die.
112 /// @note Currently this only works on Unix.
115 /// When notifying of child death, pause this number of milliseconds
116 /// to simulate a heavily loaded server.
117 unsigned int induce_delay_
;
119 /// SC_NONE, SC_INSTALL, SC_REMOVE, ...
120 SERVICE_COMMAND service_command_
;
124 /// The default environment buffer length
127 /// Maximum number of environment variables
130 /// Control signal handling related to child processes