Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Options Class Reference

Maintains the global options. More...

#include <Activator_Options.h>

Collaboration diagram for Options:

Collaboration graph
[legend]
List of all members.

Public Types

enum  REPO_MODE { REPO_NONE, REPO_XML_FILE, REPO_HEAP_FILE, REPO_REGISTRY }
enum  SERVICE_COMMAND { SC_NONE, SC_INSTALL, SC_REMOVE }
enum  SERVICE_COMMAND { SC_NONE, SC_INSTALL, SC_REMOVE }

Public Methods

 Options ()
 Default Constructor.

int init (int argc, char *argv[])
 Parse the command-line arguments and initialize the options.

bool service (void) const
 Service Mode.

unsigned int debug (void) const
 Debug level for the Implementation Repository.

ACE_CString output_filename (void) const
 Returns the file where the IOR should be stored.

Repository_Configurationconfig (void) const
 Returns the configuration object.

int repository_mode (void)
ACE_CString file_name (void) const
 Returns the file name.

const char * convert_str (ImplementationRepository::ActivationMode mode)
ImplementationRepository::ActivationMode convert_mode (const char *mode)
ACE_Time_Value startup_timeout (void) const
 Returns the timeout value for program starting.

ACE_Time_Value ping_interval (void) const
 Returns the timeout value for program starting.

CORBA::ORB_ptr orb (void) const
 Returns a pointer to the ORB.

bool multicast (void) const
 Will we listen for multicast location requests?

bool readonly (void) const
 Do we allow modifications to the servers?

 Options ()
 Default Constructor.

int init (int argc, char *argv[])
 Parse the command-line arguments and initialize the options.

bool service (void) const
 Service Mode.

unsigned int debug (void) const
 Debug level for the Implementation Repository.

ACE_CString output_filename (void) const
 Returns the file where the IOR should be stored.

CORBA::ORB_ptr orb (void) const
 Returns a pointer to the ORB.

bool multicast (void) const
 Will we listen for multicast location requests?


Private Methods

int parse_args (int &argc, char *argv[])
 Parses and pulls out arguments for the ImR.

void print_usage (void) const
 Print the usage information.

int initialize_persistence (void)
 Wrapper for the other initialize_persistence() methods.

int initialize_heap_persistence (void)
 Initialize heap file persistence.

int initialize_registry_persistence (void)
 Initialize Registry persistence.

int initialize_non_persistence (void)
 Initialize default heap for no persistence.

int initialize_xml_persistence (void)
 Initialize XML file persistence.

int run_service_command (const ACE_CString &cmdline)
 Run a service command.

int load_registry_options (char *&cmdline, ACE_ARGV &argv)
 Loads ORB options from the registry.

int save_registry_options (const ACE_CString &cmdline)
int parse_args (int &argc, char *argv[])
 Parses and pulls out arguments for the ImR.

void print_usage (void) const
 Print the usage information.

int run_service_command (const ACE_CString &cmdline)
 Run a service command.

int load_registry_options (char *&cmdline, ACE_ARGV &argv)
 Loads ORB options from the registry.

int save_registry_options (const ACE_CString &cmdline)

Private Attributes

auto_ptr< Repository_Configurationrepo_config_
 The persistent configuration object.

int repo_mode_
 Mode of the Server Repository: if XML (x) or non-XML (n).

ACE_CString file_name_
 The persistent file option.

unsigned int debug_
 Debug level.

ACE_CString ior_output_file_
 File where the IOR of the server object is stored.

bool multicast_
 Will we listen for multicast location requests?

CORBA::ORB_var orb_
 The ORB for the Implementation Repository.

ACE_Time_Value ping_interval_
 The amount of time between successive "are you started yet?" pings.

bool service_
 Are we running as a service?

ACE_Time_Value startup_timeout_
 The amount of time to wait for a server to response after starting it.

bool readonly_
 Can the server_repository be modified?

int service_command_
 SC_NONE, SC_INSTALL, SC_REMOVE, ...


Detailed Description

Maintains the global options.

This is where all the settings for TAO's Implementation Repository is stored.


Member Enumeration Documentation

enum Options::REPO_MODE
 

Enumeration values:
REPO_NONE 
REPO_XML_FILE 
REPO_HEAP_FILE 
REPO_REGISTRY 

enum Options::SERVICE_COMMAND
 

Enumeration values:
SC_NONE 
SC_INSTALL 
SC_REMOVE 

enum Options::SERVICE_COMMAND
 

Enumeration values:
SC_NONE 
SC_INSTALL 
SC_REMOVE 


Constructor & Destructor Documentation

Options::Options  
 

Default Constructor.

Default Constructor. Assigns default values to all the member variables.

Options::Options  
 

Default Constructor.


Member Function Documentation

Repository_Configuration * Options::config void    const
 

Returns the configuration object.

Returns:
The ACE_Configuration object that is used to store data.

ImplementationRepository::ActivationMode Options::convert_mode const char *    mode
 

const char * Options::convert_str ImplementationRepository::ActivationMode    mode
 

Converts the activation mode to a const char *. Needed to put the activation mode into the XML file or print it out.

unsigned int Options::debug void    const
 

Debug level for the Implementation Repository.

unsigned int Options::debug void    const
 

Debug level for the Implementation Repository.

Debug level for the IR.

Return values:
0  Quiet
1  Trace messages
2  Detailed messages

ACE_CString Options::file_name void    const
 

Returns the file name.

int Options::init int    argc,
char *    argv[]
 

Parse the command-line arguments and initialize the options.

int Options::init int    argc,
char *    argv[]
 

Parse the command-line arguments and initialize the options.

Return values:
0  Success
-1  Error parsing args
1  Success but we should exit.

int Options::initialize_heap_persistence void    [private]
 

Initialize heap file persistence.

The most portable form of persistence is file persistence. Here we assign an ACE_Configuration_Heap object using

Parameters:
filename  as the file.
Return values:
0  Success
-1  Failure

int Options::initialize_non_persistence void    [private]
 

Initialize default heap for no persistence.

In cases where persistence isn't needed, create an object of the ACE_Configuration_Heap class to be used. Initializes this->repo_config_ to an opened ACE_Configuration_Heap.

Return values:
0  Success
-1  Failure

int Options::initialize_persistence void    [private]
 

Wrapper for the other initialize_persistence() methods.

int Options::initialize_registry_persistence void    [private]
 

Initialize Registry persistence.

On Windows, we have the option of using the Registry to store the server data. Assigns a ACE_Configuration_Win32Registry to this->repo_config_. On non-Win32 systems, just returns an error.

Todo:
Where in the registry should this be stored?
Return values:
0  Success
-1  Failure

int Options::initialize_xml_persistence void    [private]
 

Initialize XML file persistence.

int Options::load_registry_options char *&    cmdline,
ACE_ARGV   argv
[private]
 

Loads ORB options from the registry.

int Options::load_registry_options char *&    cmdline,
ACE_ARGV   argv
[private]
 

Loads ORB options from the registry.

We will only load from the registry if we are a service. We load each parameter from individual string keys, and then we have to parse the cmdline property into the orb_options so that they can be passed to ORB_init()

bool Options::multicast void    const
 

Will we listen for multicast location requests?

bool Options::multicast void    const
 

Will we listen for multicast location requests?

Return values:
false  Do not listen for multicast location requests.
true  Do Listen.

CORBA::ORB_ptr Options::orb void    const
 

Returns a pointer to the ORB.

CORBA::ORB_ptr Options::orb void    const
 

Returns a pointer to the ORB.

Returns:
A pointer to the ORB.

ACE_CString Options::output_filename void    const
 

Returns the file where the IOR should be stored.

ACE_CString Options::output_filename void    const
 

Returns the file where the IOR should be stored.

Returns:
The file where the IOR will be stored.

int Options::parse_args int &    argc,
char *    argv[]
[private]
 

Parses and pulls out arguments for the ImR.

int Options::parse_args int &    argc,
char *    argv[]
[private]
 

Parses and pulls out arguments for the ImR.

parse_args uses an ACE_Arg_Shifter to grab all the options that are specific to the ImR. If running as an nt service, most of these options will come from the registry instead.

Return values:
0  Success
-1  Error parsing args
1  Success but we should exit.

ACE_Time_Value Options::ping_interval void    const
 

Returns the timeout value for program starting.

Returns:
The amount of time to wait between pings

void Options::print_usage void    const [private]
 

Print the usage information.

void Options::print_usage void    const [private]
 

Print the usage information.

Just print out the usage message to STDERR

bool Options::readonly void    const
 

Do we allow modifications to the servers?

Return values:
0  Normal operation.
1  Do not let server info be modified.

int Options::repository_mode void   
 

int Options::run_service_command const ACE_CString   cmdline [private]
 

Run a service command.

int Options::run_service_command const ACE_CString   cmdline [private]
 

Run a service command.

Executes the various commands that are useful for a NT service. Right now these include 'install' and 'remove'. Others, such as 'start' and 'stop' can be added, but the 'net' program in Windows already handles these commands.

Todo:
Finish implementing Options::run_service_command

Update to unicode

int Options::save_registry_options const ACE_CString   cmdline [private]
 

int Options::save_registry_options const ACE_CString   cmdline [private]
 

bool Options::service void    const
 

Service Mode.

bool Options::service void    const
 

Service Mode.

Standalone Mode

Return values:
0  Run as standalone service
1  Run as a service (only on NT right now)

ACE_Time_Value Options::startup_timeout void    const
 

Returns the timeout value for program starting.

Returns:
The amount of time to wait for a server to start.


Member Data Documentation

unsigned int Options::debug_ [private]
 

Debug level.

ACE_CString Options::file_name_ [private]
 

The persistent file option.

ACE_CString Options::ior_output_file_ [private]
 

File where the IOR of the server object is stored.

bool Options::multicast_ [private]
 

Will we listen for multicast location requests?

CORBA::ORB_var Options::orb_ [private]
 

The ORB for the Implementation Repository.

ACE_Time_Value Options::ping_interval_ [private]
 

The amount of time between successive "are you started yet?" pings.

bool Options::readonly_ [private]
 

Can the server_repository be modified?

auto_ptr<Repository_Configuration> Options::repo_config_ [private]
 

The persistent configuration object.

int Options::repo_mode_ [private]
 

Mode of the Server Repository: if XML (x) or non-XML (n).

bool Options::service_ [private]
 

Are we running as a service?

int Options::service_command_ [private]
 

SC_NONE, SC_INSTALL, SC_REMOVE, ...

ACE_Time_Value Options::startup_timeout_ [private]
 

The amount of time to wait for a server to response after starting it.


The documentation for this class was generated from the following files:
Generated on Fri Apr 2 18:50:31 2004 for TAO_Implementation_Repository by doxygen1.2.18