|
User
Guide
Developer
Docs
|
Introduction Compiling DistView-based applets is not much different from compiling
regular Java applets. Here, we provide same Makefiles. However, running
a DistView applet consists of two tasks: 1) running Corona server and 2)
running the applet itself. Briefly, Corona
is a communication service provider for DistView-based applets/applications.
DistView-based applets need to know the host on which Corona is running
and the port to which Corona is listening in order to connect to Corona
and subscribe to its services, e.g., create and/or join a group, broadcast
messages etc.
Compiling DistView-Based Applets One thing to remember when compiling a DistView-based applet/application is to correctly set the CLASSPATH environment variable. That is, the CLASSPATH environment variable should include the directory in which the DistView packages are installed. For example, assuming that the DistView packages are installed in the /dv directory and that the csh is used, the CLASSPATH should be set to:
Once CLASSPATH is set, compiling DistView-based applets is straightforward. Using javac,
At the prompt, do: javac *.java
At the prompt, do: make There are two ways to run Corona. First, Corona can be run as part of
the CBE setup or installation process. See Installing
and Running CBE Servers. Corona can also be run as a stand-alone Java
application process. Doing so requires a configuration file, e.g. demo.config.
The following instructions on running Corona assume that the DistView packages
are installed in the /dv directory, that the configuration file is named
demo.config, and that demo.config is in the same directory as the Corona
application.
cd /dv/umich/cbe/distview/server. At the prompt, do:
Running DistView-Based Applets As with any Java applet, running a DistView-based applet (DistView applet for short) requires an html file. In the minimum, the html file for a DistView applet should contain parameters for the host on which Corona is running and the port to which Corona is listening, so that the applet can connect to Corona when needed. The names for these parameters are applet-specific. For example, in the following example, the parameters, "ServerHost" and "ServerPort" represent the Corona host and port respectively.
<h1>TicTacToe (1.1)</h1> <hr> <applet code=DVTicTacToe.class width=120 height=120> <param name=ServerHost value="localhost"> <param name=ServerPort value="12345"> </applet> <hr> Make sure that the CLASSPATH environment variable contains the directory in which the DistView packages are installed. For example, using csh,
|
||||||
![]() |
|||||||