Application contexts
When you use the remote object invocation model of distributed programming, you manage the SST infrastructure on an end-user application basis using application contexts. Application contexts maintain lists of the machines and spaces related to the developer's application. Using this, your objects and distributed infrastructure is isolated from outside influence and can be controlled (for example, shutDown) separately. Application contexts adhere to the IuSstStartable interface. Application contexts also support the following API for managing the SST infrastructure:
addRemoteSpace: spaceName at: urlList
Adds a remote space named @spaceName to the receiver. The space is created so it can be contacted at the URLs given by @urlList. If the space already exists then it is modified to ensure that its location is the machine named @machineName.
addSpace: spaceName at: urlList
Adds to the receiver a specification for a space named @spaceName. The space's location is described by @urlList.
name
Answers the name of the receiver.
removeSpace: oldSpace
Removes space @oldSpace from the receiver's list of available spaces. Note that requests to remove the receiver's space (the local space) are ignored. All transient references to objects in @oldSpace are invalidated and @oldSpace's machine is also removed.
setupFor: spaceName using: config
Sets up the receiver to run in the object space named @spaceName configured according to @config. This method can only be called once and should be done after all statically known space/machine specifications have been added (see addSpace:*). Once this method has completed the receiver may be started up. Note that further remote spaces can be added using addRemoteSpace:*.
spaceFor: id
Answers the space registered under the name @id or nil if none.
spaceFor: id ifNone: absentHandler
Answers the space registered under the name @id. If there is none, answers the result of evaluating @absentHandler with no arguments.
spaceHosting: endpoint
Answers a remote object space which hosts @endpoint. That is, an object space in which messages sent to @endpoint will be executed.
Application contexts also give users access to the managed space components through the following API:
space
Answers the space in which the receiver is running.
spaces
Answers a collection of all spaces managed by the receiver.
SST supports the association of a default naming service object with an application context. This naming service can be an instance of SstNamingContext (and its subclasses) or some other mechanism. The relevant SstApplicationContext API is as follows:
defaultNamingService
Answers the naming service object associated with the receiver.
defaultNamingService: value
Updates the default naming service object associated with the receiver to be @value. It automatically exports @value as the key SstNamingServiceKey. It answers @value.
defaultNamingServiceFor: value
Creates a remote reference to the default naming service residing at @value. The default naming service at @value may not exist, or be exported, at the time this operation is performed. You must ensure that this occurs prior to sending any requests to this service. If you provide the receiver's local space instead, then any local default naming service is returned.
Last modified date: 01/29/2015