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 <Options.h>

Collaboration diagram for Options:

Collaboration graph
[legend]
List of all members.

Public Methods

 Options ()
 Default Constructor.

 ~Options ()
 Destructor.

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

int service (void) const
 Service Mode.

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

FILE * output_file (void) const
 Returns the file where the IOR should be stored.

Repository_Configurationconfig (void) const
 Returns the configuration object.

char * repository_mode (void)
char * file_name (void) const
 Returns the file addr.

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

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

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

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

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


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_file_persistence (const char *filename)
 Initialize 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 (const char *file_name)
 Initialize XML file persistence.

int run_service_command (const char *command)
 Run a service command.

int load_registry_options (ACE_ARGV &orb_options)
 Loads ORB options from the registry.


Private Attributes

Repository_Configurationrepo_config_
 The persistent configuration object.

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

char * file_name_
 The persistent file option.

unsigned int debug_
 Debug level.

FILE * ior_output_file_
 File where the IOR of the server object is stored.

int 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.

int 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.

int readonly_
 Can the server_repository be modified?


Detailed Description

Maintains the global options.

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


Constructor & Destructor Documentation

Options::Options  
 

Default Constructor.

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

Options::~Options  
 

Destructor.

Destructor. Just deletes this->repo_config_.


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.

Debug level for the IR.

Return values:
0  Quiet
1  Trace messages
2  Detailed messages

char * Options::file_name void    const
 

Returns the file addr.

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_file_persistence const char *    filename [private]
 

Initialize 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_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 const char *    file_name [private]
 

Initialize XML file persistence.

int Options::load_registry_options ACE_ARGV   orb_options [private]
 

Loads ORB options from the registry.

We will only load from the registry if we are a service. The location we store options in is HKEY_LOCAL_MACHINE: SYSTEM\CurrentControlSet\Services\TAOImplRepo\Parameters

The only key currently supported is ORBOptions

Todo:
Is there a better way to handle the hKey? (as in a auto_ptr)

int Options::multicast void    const
 

Will we listen for multicast location requests?

Return values:
0  Do not listen for multicast location requests.
1  Do Listen.

CORBA::ORB_ptr Options::orb void    const
 

Returns a pointer to the ORB.

Returns:
A pointer to the ORB.

FILE * Options::output_file 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.

parse_args uses an ACE_Arg_Shifter to grab all the options that are specific to the ImR.

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

const 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.

Just print out the usage message to STDERR

int Options::readonly void    const
 

Do we allow modifications to the servers?

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

char * Options::repository_mode void   
 

int Options::run_service_command const char *    command [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::service void    const
 

Service Mode.

Standalone Mode

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

const 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.

char* Options::file_name_ [private]
 

The persistent file option.

FILE* Options::ior_output_file_ [private]
 

File where the IOR of the server object is stored.

int 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.

int Options::readonly_ [private]
 

Can the server_repository be modified?

Repository_Configuration* Options::repo_config_ [private]
 

The persistent configuration object.

char Options::repo_mode_ [private]
 

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

int Options::service_ [private]
 

Are we running as a service?

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 Wed Feb 19 16:50:32 2003 for TAO_Implementation_Repository by doxygen1.2.18