SstApplicationContext provides some methods for manipulating RMI-related objects.
rmiNaming returns a naming service object which responds to the standard Java naming (java.rmi.Naming) protocols. Creating a naming service (actually a class method) runs a Java-style naming service in your Smalltalk image. This service then is accessible to all hosts running RMI (those running Java or SST's RMI Support).
You can use any available RMI Naming service when using the SST RMI support facilities.
Setting up an RMI-enabled application context is very much the same as setting up normal SST contexts. In fact, for RMI it is generally not necessary to define the remote spaces with which you interact. This is done automatically whenever a new space is detected. The major differences are highlighted by the following example code:
self context addSpace: #ping on: 'Ping' at: #('rmi://foo.com:2345'); setupFor: #ping using: SstSpaceConfiguration rmiProxyConfiguration; rmiStartUpWith: self typeRepository
The code specifies a Java type repository and defines a space configuration which uses RMI remote references (rmiProxyConfiguration). This type repository must contain definitions for all the Java types you plan on using in your application. As discussed in Java type information, you can dynamically extend the repository if required.
When setting up an RMI-enabled context, keep in mind the following:
The URL specified for the local space contains the host and port at which the RMI-enabled objects will appear to be living to other RMI-based systems.
Typically SST does not contain predefined invocation configurations as it is nearly impossible to predict what users will want. In the case of RMI however, there is a reasonably well-defined behavior which satisfies most users. Accordingly, SST provides a standard RMI invocation scheme, named rmi, as well as a transport named rmi. The declaration of these is in the SstRmiSupport class.
SST's RMI support also includes a new kind of URL which supports the format: 'rmi://host:port/<information>'. This is typically used in conjunction with the Naming service, where <information> is the name on which to operate.