summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2000-01-04 19:53:11 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2000-01-04 19:53:11 +0000
commitf7dcade8398de78df09b0fef899c4867a7df81ab (patch)
treef42ec2c45e4055e1593c340cf10fb12344165ed5
parent9a504a36bdb182c767e6c842888d9f5e56d830f1 (diff)
downloadATCD-f7dcade8398de78df09b0fef899c4867a7df81ab.tar.gz
ChangeLogTag:Tue Jan 4 13:23:26 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLogs/ChangeLog-02a6
-rw-r--r--ChangeLogs/ChangeLog-03a6
-rw-r--r--ace/Service_Config.cpp43
-rw-r--r--ace/Service_Config.h63
-rw-r--r--ace/Service_Config.i15
6 files changed, 99 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index bbc40b9f7ee..e16b21c77a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 4 13:23:26 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Service_Config: Updated the documentation for the various
+ open() methods and the constructors. Thanks to Christopher
+ Kohlhoff <chris@kohlhoff.com> for reporting this.
+
Tue Jan 4 12:58:54 2000 Ossama Othman <othman@cs.wustl.edu>
* Makefile (CONTROLLED_FILES):
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index bbc40b9f7ee..e16b21c77a2 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,9 @@
+Tue Jan 4 13:23:26 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Service_Config: Updated the documentation for the various
+ open() methods and the constructors. Thanks to Christopher
+ Kohlhoff <chris@kohlhoff.com> for reporting this.
+
Tue Jan 4 12:58:54 2000 Ossama Othman <othman@cs.wustl.edu>
* Makefile (CONTROLLED_FILES):
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index bbc40b9f7ee..e16b21c77a2 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,9 @@
+Tue Jan 4 13:23:26 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Service_Config: Updated the documentation for the various
+ open() methods and the constructors. Thanks to Christopher
+ Kohlhoff <chris@kohlhoff.com> for reporting this.
+
Tue Jan 4 12:58:54 2000 Ossama Othman <othman@cs.wustl.edu>
* Makefile (CONTROLLED_FILES):
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index afcd273306e..100be63168e 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -54,7 +54,8 @@ char ACE_Service_Config::no_static_svcs_ = 1;
// Number of the signal used to trigger reconfiguration.
int ACE_Service_Config::signum_ = SIGHUP;
-// Name of file used to store messages.
+// Indicates where to write the logging output. This is typically
+// either a STREAM pipe or a socket address.
LPCTSTR ACE_Service_Config::logger_key_ = ACE_DEFAULT_LOGGER_KEY;
// The ACE_Service_Manager static service object is now defined by the
@@ -544,10 +545,11 @@ ACE_Service_Config::load_static_svcs (void)
int
ACE_Service_Config::open_i (const ASYS_TCHAR program_name[],
LPCTSTR logger_key,
- int ignore_default_svc_conf_file)
+ int ignore_default_svc_conf_file,
+ int ignore_debug_flag)
{
int result = 0;
- ACE_TRACE ("ACE_Service_Config::open");
+ ACE_TRACE ("ACE_Service_Config::open_i");
ACE_Log_Msg *log_msg = ACE_LOG_MSG;
// Record the current log setting upon entering this thread.
@@ -573,13 +575,16 @@ ACE_Service_Config::open_i (const ASYS_TCHAR program_name[],
"enqueue_tail"),
-1);
- // If -d was included as a startup parameter, the user wants debug
- // information printed during service initialization.
- if (ACE::debug ())
- ACE_Log_Msg::enable_debug_messages ();
- else
- // The user has requested no debugging info.
- ACE_Log_Msg::disable_debug_messages ();
+ if (ignore_debug_flag == 0)
+ {
+ // If -d was included as a startup parameter, the user wants debug
+ // information printed during service initialization.
+ if (ACE::debug ())
+ ACE_Log_Msg::enable_debug_messages ();
+ else
+ // The user has requested no debugging info.
+ ACE_Log_Msg::disable_debug_messages ();
+ }
// Become a daemon before doing anything else.
if (ACE_Service_Config::be_a_daemon_)
@@ -647,14 +652,18 @@ ACE_Service_Config::open_i (const ASYS_TCHAR program_name[],
ace_yy_delete_parse_buffer ();
- // Reset debugging back to the way it was when we came into into
- // <open_i>.
- if (debugging_enabled)
- ACE_Log_Msg::enable_debug_messages ();
- else
- // Debugging was off when we entered <open_i>.
- ACE_Log_Msg::disable_debug_messages ();
+ if (ignore_debug_flag == 0)
+ {
+ // Reset debugging back to the way it was when we came into
+ // into <open_i>.
+ if (debugging_enabled)
+ ACE_Log_Msg::enable_debug_messages ();
+ else
+ // Debugging was off when we entered <open_i>.
+ ACE_Log_Msg::disable_debug_messages ();
+ }
}
+
return result;
}
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index 233634957fc..c8f791f57cd 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -100,7 +100,7 @@ class ACE_Export ACE_Service_Config
// static <ACE_Service_Config> objects, there might be
// initialization order problems. They can be minimized, but
// not eliminated, by _not_ #defining
- // ACE_HAS_NONSTATIC_OBJECT_MANAGER.
+ // <ACE_HAS_NONSTATIC_OBJECT_MANAGER>.
public:
enum
{
@@ -116,37 +116,51 @@ public:
ACE_Service_Config (const ASYS_TCHAR program_name[],
LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY);
- // Performs an open without parsing command-line arguments.
+ // Performs an open without parsing command-line arguments. The
+ // <logger_key> indicates where to write the logging output, which
+ // is typically either a STREAM pipe or a socket address.
static int open_i (const ASYS_TCHAR program_name[],
LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY,
- int ignore_default_svc_conf_file = 0);
- // Performs an open without parsing command-line arguments. If
+ int ignore_default_svc_conf_file = 0,
+ int ignore_debug_flag = 0);
+ // Performs an open without parsing command-line arguments. The
+ // <logger_key> indicates where to write the logging output, which
+ // is typically either a STREAM pipe or a socket address. If
// <ignore_default_svc_conf_file> is non-0 then the "svc.conf" file
- // will be ignored. Returns number of errors that occurred on
- // failure and 0 otherwise.
+ // will be ignored. If <ignore_debug_flag> is non-0 then the
+ // application is responsible for setting the
+ // <ACE_Log_Msg::priority_mask> appropriately. Returns number of
+ // errors that occurred on failure and 0 otherwise.
static int open (const ASYS_TCHAR program_name[],
LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY,
int ignore_static_svcs = 1,
- int ignore_default_svc_conf_file = 0);
- // Performs an open without parsing command-line arguments. If
- // <ignore_default_svc_conf_file> is non-0 then the <svc.conf>
- // configuration file will be ignored. Returns zero upon success,
- // -1 if the file is not found or cannot be opened (errno is set
- // accordingly), otherwise returns the number of errors encountered
- // loading the services in the specified svc.conf configuration
- // file.
+ int ignore_default_svc_conf_file = 0,
+ int ignore_debug_flag = 0);
+ // Performs an open without parsing command-line arguments. The
+ // <logger_key> indicates where to write the logging output, which
+ // is typically either a STREAM pipe or a socket address. If
+ // <ignore_static_svcs> is 1 then static services are not loaded,
+ // otherwise, they are loaded. If <ignore_default_svc_conf_file> is
+ // non-0 then the <svc.conf> configuration file will be ignored.
+ // Returns zero upon success, -1 if the file is not found or cannot
+ // be opened (errno is set accordingly), otherwise returns the
+ // number of errors encountered loading the services in the
+ // specified svc.conf configuration file. If <ignore_debug_flag> is
+ // non-0 then the application is responsible for setting the
+ // <ACE_Log_Msg::priority_mask> appropriately.
static int open (int argc,
ASYS_TCHAR *argv[],
LPCTSTR logger_key = ACE_DEFAULT_LOGGER_KEY,
int ignore_static_svcs = 1,
- int ignore_default_svc_conf = 0);
+ int ignore_default_svc_conf = 0,
+ int ignore_debug_flag = 0);
// This is the primary entry point into the ACE_Service_Config (the
// constructor just handles simple initializations). It parses
- // arguments passed in from the command-line. The arguments that
- // are valid in a call to this method include:
+ // arguments passed in from <argc> and <argv> parameters. The
+ // arguments that are valid in a call to this method include:
//
// '-b' - Option to indicate that we should be a daemon
// '-d' - Turn on debugging mode
@@ -165,6 +179,18 @@ public:
//
// Returns number of errors that occurred on failure and 0
// otherwise.
+ //
+ // The <logger_key> indicates where to write the logging output,
+ // which is typically either a STREAM pipe or a socket address. If
+ // <ignore_static_svcs> is 1 then static services are not loaded,
+ // otherwise, they are loaded. If <ignore_default_svc_conf_file> is
+ // non-0 then the <svc.conf> configuration file will be ignored.
+ // Returns zero upon success, -1 if the file is not found or cannot
+ // be opened (errno is set accordingly), otherwise returns the
+ // number of errors encountered loading the services in the
+ // specified svc.conf configuration file. If <ignore_debug_flag> is
+ // non-0 then the application is responsible for setting the
+ // <ACE_Log_Msg::priority_mask> appropriately.
virtual ~ACE_Service_Config (void);
// Perform user-specified close activities and remove dynamic
@@ -373,7 +399,8 @@ protected:
private:
static LPCTSTR logger_key_;
- // Where to write the logging output.
+ // Indicates where to write the logging output. This is typically
+ // either a STREAM pipe or a socket address.
static ACE_STATIC_SVCS *static_svcs_;
// Singleton repository of statically linked services.
diff --git a/ace/Service_Config.i b/ace/Service_Config.i
index c0aff18fde6..f4129aae6d0 100644
--- a/ace/Service_Config.i
+++ b/ace/Service_Config.i
@@ -10,14 +10,16 @@ ACE_INLINE int
ACE_Service_Config::open (const ASYS_TCHAR program_name[],
LPCTSTR logger_key,
int ignore_static_svcs,
- int ignore_default_svc_conf)
+ int ignore_default_svc_conf,
+ int ignore_debug_flag)
{
ACE_TRACE ("ACE_Service_Config::open");
ACE_Service_Config::no_static_svcs_ = ignore_static_svcs;
return ACE_Service_Config::open_i (program_name,
logger_key,
- ignore_default_svc_conf);
+ ignore_default_svc_conf,
+ ignore_debug_flag);
}
ACE_INLINE int
@@ -25,17 +27,20 @@ ACE_Service_Config::open (int argc,
ASYS_TCHAR *argv[],
LPCTSTR logger_key,
int ignore_static_svcs,
- int ignore_default_svc_conf)
+ int ignore_default_svc_conf,
+ int ignore_debug_flag)
{
ACE_TRACE ("ACE_Service_Config::open");
ACE_Service_Config::no_static_svcs_ = ignore_static_svcs;
- if (ACE_Service_Config::parse_args (argc, argv) == -1)
+ if (ACE_Service_Config::parse_args (argc,
+ argv) == -1)
return -1;
else
return ACE_Service_Config::open_i (argv[0],
logger_key,
- ignore_default_svc_conf);
+ ignore_default_svc_conf,
+ ignore_debug_flag);
}
// Compare two service descriptors for equality.