diff options
author | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-28 00:07:23 +0000 |
---|---|---|
committer | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-28 00:07:23 +0000 |
commit | 893aa0386f0ce1143942869d6a3ebd291d4b3263 (patch) | |
tree | c3bd777b5fd1d95494472b993d2a1bab84333e69 /TAO/orbsvcs/Naming_Service | |
parent | 63b51ebce7d5a81ca856990ddac0fa4dd6739e1d (diff) | |
download | ATCD-893aa0386f0ce1143942869d6a3ebd291d4b3263.tar.gz |
ChangeLogTag:Sat May 27 18:58:01 2000 Marina Spivak <marina@cs.wustl.edu>
Diffstat (limited to 'TAO/orbsvcs/Naming_Service')
-rw-r--r-- | TAO/orbsvcs/Naming_Service/Naming_Service.cpp | 21 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/Naming_Service.h | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/Naming_Service/README | 46 |
3 files changed, 57 insertions, 18 deletions
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp index ccb9b22e32a..c4f70c99aae 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp @@ -12,6 +12,7 @@ TAO_Naming_Service::TAO_Naming_Service (void) pid_file_name_ (0), context_size_ (ACE_DEFAULT_MAP_SIZE), persistence_file_name_ (0), + base_address_ (TAO_NAMING_BASE_ADDR), time_ (0) { } @@ -24,6 +25,7 @@ TAO_Naming_Service::TAO_Naming_Service (int argc, pid_file_name_ (0), context_size_ (ACE_DEFAULT_MAP_SIZE), persistence_file_name_ (0), + base_address_ (TAO_NAMING_BASE_ADDR), time_ (0) { this->init (argc, argv); @@ -33,9 +35,10 @@ int TAO_Naming_Service::parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "do:p:s:t:f:"); + ACE_Get_Opt get_opts (argc, argv, "b:do:p:s:t:f:"); int c; - int size, time; + int size, time, result; + long address; while ((c = get_opts ()) != -1) switch (c) @@ -68,6 +71,16 @@ TAO_Naming_Service::parse_args (int argc, if (time >= 0) this->time_ = time; break; + case 'b': + result = ::sscanf (get_opts.optarg, + "%ld", + &address); + if (result == 0 || result == EOF) + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to process <-b> option"), + -1); + this->base_address_ = (void *) address; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -76,6 +89,7 @@ TAO_Naming_Service::parse_args (int argc, "-o <ior_output_file> " "-p <pid_file_name> " "-f <persistence_file_name> " + "-b <base_address> " "\n", argv [0]), -1); @@ -170,7 +184,8 @@ TAO_Naming_Service::init (int argc, context_size_, 0, 0, - persistence_file_name_); + persistence_file_name_, + base_address_); if (result == -1) return result; } diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h index 1ca7fdec243..93436d57def 100644 --- a/TAO/orbsvcs/Naming_Service/Naming_Service.h +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h @@ -14,7 +14,7 @@ // // = AUTHORS // Nagarajan Surendran (naga@cs.wustl.edu) -// +// Marina Spivak <marina@cs.wustl.edu> // ============================================================================ #ifndef TAO_NAMING_SERVICE_H @@ -60,7 +60,7 @@ protected: PortableServer::POA_var ns_poa_; // The Naming Service POA. - + TAO_Naming_Server my_naming_server_; // Naming Server instance. @@ -80,6 +80,10 @@ protected: // Path to the file to be used to store/read in Naming Service // persistent state. + void *base_address_; + // Address to be used for memory mapping Naming Service state file, + // identified by the <persistence_file_name_>. + size_t time_; // After how long the server should stop listening to requests (in // seconds). diff --git a/TAO/orbsvcs/Naming_Service/README b/TAO/orbsvcs/Naming_Service/README index 67f330e674e..b1060475bc7 100644 --- a/TAO/orbsvcs/Naming_Service/README +++ b/TAO/orbsvcs/Naming_Service/README @@ -16,6 +16,7 @@ How to Run the TAO Naming Service [-s context_size] [-t time] [-f persitence_file_name] + [-b base_address] 2. Optional Command-line Arguments @@ -48,6 +49,12 @@ How to Run the TAO Naming Service option, Naming Service is started in non-persistent mode. + -b base_address + The address used for memory mapping the file specified + with the "-f" option above. The value supplied with + this option is only used when the Naming Service runs + in persistent mode, i.e., "-f" option is present. + 3. Environment Variables NameServicePort @@ -68,7 +75,7 @@ How to Run the TAO Naming Service 1. If the specified file does not exist, it is created and used to store the state of the Naming Service. An initial - (root) Naming Context is also created. + (root) Naming Context is also created. 2. If the specified file exists, it is scanned and: @@ -83,6 +90,19 @@ How to Run the TAO Naming Service stored in the file becomes the current state of the Naming Service. + Internally, TAO uses memory mapped file to implement + persistence feature of the Naming Service. A default memory + address (ACE_DEFAULT_BASE_ADDR) is used for mapping the file. + Alternate mapping address can be specified at compile-time by + redefining TAO_NAMING_BASE_ADDR in tao/orbconf.h. Alternate + mapping address can also be specified at run-time + with the "-b" command-line option, which takes precedence over + TAO_NAMING_BASE_ADDR definition. + NOTE: Naming Service stores absolute pointers in its + memory-mapped file. Therefore, it is important to use the + same mapping address on each run for the same persistence file. + + 5. Implementation Policies a. Destroying Binding Iterators @@ -111,7 +131,7 @@ How to Run the TAO Naming Service "NameService". 1. Multicast - + By default (unless other options are specified - see items 2 and 3 below), ip multicast is used to locate a Naming Service. TAO Naming Server is listening for @@ -158,7 +178,7 @@ How to Run the TAO Naming Service below can be used to bootstrap to the Naming Service. 2. Command-line options - + The "-ORBInitRef NameService=IOR:..." or environment variable NameServiceIOR can be used on the client side to specify the object that the call to @@ -179,26 +199,26 @@ How to Run the TAO Naming Service format. 3. Interoperable Naming Service. - + TAO implements the standard CORBA Interoperable Naming Service (ING). Therefore, most initialization options provided by INS can be used to bootstrap to the Naming Service (see TAO's releasenotes for the status of INS implementation). - + How to use the NT_Naming_Service ================================ 1. Syntax % NT_Naming_Server [-i value] - [-r] + [-r] [-s] [-k] [-t n] [-d] -2. Optional Command-line Arguments +2. Optional Command-line Arguments -i value Install this program as an NT service, with specified startup @@ -211,7 +231,7 @@ How to use the NT_Naming_Service -k Kill the service - -t value + -t value Set startup for an existing service -d @@ -225,7 +245,7 @@ How to use the NT_Naming_Service a. First, you must initialize the service in the NT SCM database. Run NT_Naming_Service with -in, where n is one of - the following startup options: + the following startup options: // Start Type (from WinNT.h) // @@ -239,10 +259,10 @@ How to use the NT_Naming_Service b. Now you are ready to run the actual service. Run NT_Naming_Service again, this time with -s option. If the service starts successfully, it will ring the system - bell every second or so until the service is stopped. + bell every second or so until the service is stopped. c. To stop service execution, run NT_Naming_Service with the - -k option. + -k option. d. To remove the service from the Service Control Manager database, run NT_Naming_Service with -r. @@ -250,7 +270,7 @@ How to use the NT_Naming_Service In addition, once you have initialized this service (by using the -i option) you can change its startup type to one of the other values above. To do this, run NT_Naming_Service with - -tn option. n is as explained above for -i. + -tn option. n is as explained above for -i. In order to debug the service's execution itself, use the -d - option. + option. |