|
⇤ ← Revision 1 as of 2014-01-08 14:30:51
Size: 1345
Comment:
|
Size: 1348
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| == The Name Service == | = The Name Service = |
| Line 7: | Line 7: |
| ===Implementation=== | == Implementation == |
| Line 13: | Line 13: |
| ===APIs=== | == APIs == |
| Line 17: | Line 17: |
| * nameInitialize() | * nameInitialize() |
| Line 20: | Line 20: |
| * nameSet(char* name, HandleT handle); * nameSet(char* name, void* data, int length); |
* nameSet(char* name, HandleT handle); * nameSet(char* name, void* data, int length); |
| Line 25: | Line 25: |
| * HandleT nameGet(char* name) * int nameGet(char* name, void* data, int maxLength) |
* HandleT nameGet(char* name) * int nameGet(char* name, void* data, int maxLength) |
The Name Service
The Name Service allows users to associate a string with a piece of arbitrary data (often a HandleT).
All SAFplus API calls that accept a string name use the Name Service to resolve the string into the actual HandleT or object. Since components and services accept a strings in their "create" APIs, it is possible that the end user will never explicitly use the Name Service yet it be heavily utilized.
Implementation
The Name Service is a client library that is linked with every component that uses it. It opens a cluster-wide, shared memory, non-persistent checkpoint using the name service's well-known HandleT.
The name service uses this checkpoint to resolve string names into objects.
APIs
#include <clNameApi.hpp>
- nameInitialize()
- Optional -- is called automatically on first use. Creates/connects to the Name checkpoint in memory checkpoint.
- nameSet(char* name, HandleT handle);
- nameSet(char* name, void* data, int length);
- Assigns a name into the service. Will overwrite any existing entry.
- HandleT nameGet(char* name)
- int nameGet(char* name, void* data, int maxLength)
returns the length of the data, 0 if the name does not exist or > maxLength (with maxLength bytes copied to data) if the data is longer than the supplied buffer.
