DistView Home 

User Guide 
   Overview 
   DistView Tools 
   Related Services 
   Installing and Running CBE servers 
   Compiling the package 
   Running Session Manager 
   Running DistView-Based Applets 

Developer Docs  
   Javadoc 
   Registry Server 
   Sample Clients 
   How to ... 
   Known Problems 

Licensing Information 

Download DistView 

People 

DistView Publications 

Frequently Asked Questions 

Acknowledgments   

Compiling and Running DistView-Based Applets
 

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:

    setenv CLASSPATH $CLASSPATH:/dv
The CLASSPATH variable should also be set when running Corona server and DistView-based applets/applications.

Once CLASSPATH is set, compiling DistView-based applets is straightforward. Using  javac,

    cd to the directory in which the applet to be compiled is located
    At the prompt, do:
    javac *.java
Using make,
    cd to the directory in which the applet to be compiled is located. The directory should contain two files: Makefile and Makefile.filelist. For most users, Makefile need not be changed; make sure that the java executable is in $PATH. Makefile.filelist contains the list of class files needed for the applet; update the file as needed.
    At the prompt, do:
    make
     
Running Corona Server

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.
Make sure that the CLASSPATH environment variable contains the directory in which the DistView packages are installed. For example, using csh,

    setenv CLASSPATH $CLASSPATH:/dv
    cd /dv/umich/cbe/distview/server.
Modify the fields in a configuration file as needed. Make sure that the specified directories exist and can be written. Incorrect directory specifications do not prohibit Corona from running. However, Corona would not be able to provide persistent groups, i.e., groups that survive Corona restarts.
At the prompt, do:
    java umich.cbe.distview.server.Corona demo.config

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.

    <title>TicTacToe (1.1)</title>

    <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>

In the following instructions on running a DistView applet, we assume that the name of the html file is demo.html and that the DistView packages are installed in the /dv directory.
Make sure that the CLASSPATH environment variable contains the directory in which the DistView packages are installed. For example, using csh,
    setenv CLASSPATH $CLASSPATH:/dv
At the prompt, do:
    appletviewer demo.html

 
 
 

Electrical Engineering and Computer Science Department, University of Michigan
 Copyright© 1998 University of Michigan
Last modified: July 10, 1998