Name server
Description
As stated in
Name server, the Distributed feature provides a built-in name server. At runtime, several APIs are available to access object references from the name server. A partial list of the methods includes--
• DtNameServerListDictionary
• default
• at: key put: aValue
• DtNameServerDictionary
• at: key
• at: key put: aValue
• referenceAtFirstIdentifier: anIdentifier
• keys
The keys in the name server identify object references. These object references are used to create shadows (or proxies) for the remote object that they describe. Object references can also be represented with string values. The following methods are examples of the object reference API, implemented on class DsGlobalReference:
• shadow
• repString
• repStringOn: aStream
• objectRefString: aString
• objectRefStringOn: aStream
SST equivalent
In order to access well-known remote objects, SST provides primitive naming services through symbolic references. In server object spaces, objects can be exported through symbolic names. Clients can then access these remote objects by using their symbolic name and object space. For global objects, the server object space does not need to explicitly export the object. Remote global objects can be accessed with the following API implemented in String:
• sstGlobalIn: aSpace
• sstGlobalIn: aSpace context: aContext
For non-global objects, the server object space can export objects through a symbolic name. Client object spaces can access the remote object using that symbolic name. The following methods are part of the API, provided by object spaces, to manage exported objects:
• export: object
• export: object as: objectId
• unexportId: key
• unexportObject: object
Example code to make the server object space's date externally known, with the ID #serverDate includes--
serverObjectSpace export: Date today as: #serverDate
The class SstRemoteReference provides the following class method API to access remote objects by symbolic references:
• export: object in: space
• for: object in: space
The following example client code returns a remote reference to the object identified by #serverDate in serverObjectSpace:
SstRemoteReference for: #serverDate in: serverObjectSpace
Porting guidelines
The name server entries provided in the Distributed feature will have to be converted to symbolic references in SST. Global objects can be accessed directly, through the globalIn: API methods. Other objects will need to be explicitly exported by the server object space.
On server object spaces, setup code will be required to define the exported objects. On the client side, references made through the name server will need to be converted to SST API calls to access the global or exported objects.
Last modified date: 07/02/2019