Resources

SAS® AppDev Studio 3.0 Developer's Site

Remote Method Invocation (RMI)

For a generic overview on RMI, see the An Overview of RMI Applications tutorial [ java.sun.com/docs/books/tutorial/rmi/overview.html ]. There you will find "how to" documentation, and a generic overview such as this quote and picture:

The Java Remote Method Invocation (RMI) system allows an object running in one Java Virtual Machine (VM) to invoke methods on an object running in another Java VM. RMI provides for remote communication between programs written in the Java programming language.

To use RMI within webAF, all information in the above documentation applies, but many of the steps are automated when you use the Proxy Generator. Additionally, exceptions are handled and broadcast as events so the client can use remote and local interfaces interchangeably.

Before you use RMI, it is necessary to start the server processes. Here is one example where the out-of-process-java, commonly used as middleware, runs on the same machine as the Web server.

C:\InetPub\wwwroot\sasweb>type rocforb.bat
rem Copyright (c) 1998 by SAS Institute Inc., Cary, NC 27513
echo Starting the processes for RMI communication
setlocal
set classpath=.
start "rmiregistry" /min \appdevstudio\java\javasoft\bin\rmiregistry
start "rocforb" /min \appdevstudio\java\javasoft\bin\java com.sas.rmi.RocfORB

C:\InetPub\wwwroot\sasweb>rocforb
Starting the processes for RMI communication

When developing a project:

  1. Select proxies for both SAS and RMI in the InformationBean Wizard
  2. Select RMI and Web-server-relative in the Connection customizer panel
  3. Build the project and copy the files to the Web server

You're finished. Simply invoke the Web page from your browser.