summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/Locator_Options.h')
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Options.h86
1 files changed, 62 insertions, 24 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
index 3585e3bb2cd..cd46ff14751 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.h
@@ -15,17 +15,13 @@
#ifndef LOCATOR_OPTIONS_H
#define LOCATOR_OPTIONS_H
-#include "Repository_Configuration.h"
+#include "locator_export.h"
-#include "tao/ORB.h"
-
-#include "ace/Singleton.h"
#include "ace/SString.h"
-#include "ace/Auto_Ptr.h"
-
-// Forward declarations
-class ACE_ARGV;
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
/**
* @class Options
@@ -34,20 +30,29 @@ class ACE_ARGV;
*
* This is where the settings for TAO's Implementation Repository are stored.
*/
-class Options
+class Locator_Export Options
{
public:
+
enum SERVICE_COMMAND {
SC_NONE,
SC_INSTALL,
SC_REMOVE
};
- /// Default Constructor
+ enum RepoMode {
+ REPO_NONE,
+ REPO_XML_FILE,
+ REPO_HEAP_FILE,
+ REPO_REGISTRY
+ };
+
Options ();
/// Parse the command-line arguments and initialize the options.
int init (int argc, char *argv[]);
+ /// This version should only be used when run as an nt service.
+ int init_from_registry();
/// Service Mode
bool service (void) const;
@@ -56,14 +61,35 @@ public:
unsigned int debug (void) const;
/// Returns the file where the IOR should be stored.
- ACE_CString output_filename (void) const;
-
- /// Returns a pointer to the ORB.
- CORBA::ORB_ptr orb (void) const;
+ const ACE_CString& ior_filename (void) const;
/// Will we listen for multicast location requests?
bool multicast (void) const;
+ /// The nt service command to run (install/remove)
+ SERVICE_COMMAND service_command(void) const;
+
+ int save_registry_options();
+
+ const ACE_CString& cmdline(void) const;
+
+ /// File that contains the activator related information
+ /// that the persistent locator has to save.
+ const ACE_CString& persist_file_name(void) const;
+
+ /// Do we allow modifications to the servers?
+ bool readonly (void) const;
+
+ RepoMode repository_mode (void) const;
+
+ /// Returns the timeout value for program starting.
+ ACE_Time_Value startup_timeout (void) const;
+
+ /// If the server hasn't been verified for a while, then we'll
+ /// ping it. Note : No timers are currently used. We simply ping()
+ /// during indirect invocations, if this interval has elapsed.
+ ACE_Time_Value ping_interval (void) const;
+
private:
/// Parses and pulls out arguments for the ImR
int parse_args (int &argc, char *argv[]);
@@ -74,9 +100,11 @@ private:
/// Run a service command.
int run_service_command (const ACE_CString& cmdline);
- /// Loads ORB options from the registry
- int load_registry_options (char*& cmdline, ACE_ARGV& argv);
- int save_registry_options (const ACE_CString& cmdline);
+ int load_registry_options();
+private:
+
+ // xml, heap, or registry
+ RepoMode repo_mode_;
/// Debug level.
unsigned int debug_;
@@ -87,16 +115,26 @@ private:
/// Will we listen for multicast location requests?
bool multicast_;
- /// The ORB for the Implementation Repository.
- CORBA::ORB_var orb_;
-
/// Are we running as a service?
bool service_;
+ /// The amount of time between successive "are you started yet?" pings.
+ ACE_Time_Value ping_interval_;
+
+ /// The amount of time to wait for a server to response after starting it.
+ ACE_Time_Value startup_timeout_;
+
+ /// Can the server_repository be modified?
+ bool readonly_;
+
/// SC_NONE, SC_INSTALL, SC_REMOVE, ...
- int service_command_;
-};
+ SERVICE_COMMAND service_command_;
-typedef ACE_Singleton <Options, ACE_Null_Mutex> OPTIONS;
+ /// Our extra command line arguments
+ ACE_CString cmdline_;
+
+ /// The persistent XML file name.
+ ACE_CString persist_file_name_;
+};
-#endif
+#endif