Server Smalltalk Guide : Java RMI support : Examples of Java RMI support
Examples of Java RMI support
Tip icon
To better understand this section, examine the sample SstPingPongRmi examples.
SST provides a set of PingPong examples for RMI. The examples are structured such that Ping runs in SST and Pong runs in Java. Communication is through RMI. The SstPingPongRmi* classes are in the SstRmiExamples application. You can find the Java source for Pong in the java subdirectory of the product installation directory.
On the Java side you start the example by creating and registering a PingPong factory. This is an object which knows how to create PingPong objects. This is done by running com.ibm.sst.examples.PingPongFactory.main (). This starts the factory on the current host at the default port.
The Smalltalk side is run in much the same way as the other examples:
SstPingPongRmi setupPing: 'rmi/:<your port>' pinging: nil.
[(SstPingPongRmi createPingAndPong: 'rmi://<host:port>')
start: 5 with: 'test'] fork.
where <host:port> is the host and port of the Naming service on the machine running the Java PingPong factory. <your port> is the port of your local (Ping) machine used for the Smalltalk-based RMI support server.
There is also an example which demonstrates the integration of Java and Smalltalk exceptions. This example is similar to the Halt example but rather than halting when the count reaches 0, an exception is thrown. This exception is propagated all the way back along the call chain to the originator of the example (Ping) printing things along the way.
Last modified date: 10/02/2020