demo
directory. The demo
system includes:
gubdemo.jar
, containing the class definitions for two Java
application programs:
gubcast.jar
jarfile
(from the lib
directory) in a single directory that is
accessible from your Web server. On a Red Hat Linux system with an Apache
http server, for example, they might go into a directory named
/var/www/html/gubdemo
.cd
into a
directory that contains both gubdemo.jar
and
gubcaster.jar
and enter the following
command:
java -classpath ./gubdemo.jar:./gubcaster.jar Gubdor, on a Windows machine,
java -classpath .\gubdemo.jar;.\gubcaster.jar GubdGubd is intended to be run indefinitely in background as a "daemon" process, so on a Linux or other Unix host you might want to use this variant of the Gubd start command:
java -classpath ./gubdemo.jar:./gubcaster.jar Gubd &
cd
into the directory that contains
gubdemo.jar
and enter the following command:
java -classpath ./gubdemo.jar Gubshellor, for Windows,
java -classpath .\gubdemo.jar GubshellOr, if Gubd is running on a machine named "glop.com":
java -classpath ./gubdemo.jar Gubshell glop.comor, for Windows,
java -classpath .\gubdemo.jar Gubshell glop.com
http://
yourdomainname/gubdemo
.
Whenever this happens, the page that appears in the user's browser window
will have three frames: menu
, top
, and
bottom
. The "menu" frame
contains the Gubcast applet, which will start running shortly after the page
is received (provided the Java plug-in is installed on the user's machine
and the loading of plug-ins is authorized at the browser). The applet will
register with the Gubd server, which in turn will notify Gubshell; the
client name "test" will appear in the dynamic "Client:" menu of the GUI.
At this point you can use Gubshell to push content to the "test" client:
When the browser leaves this Web page, or if you push content to the current frame, the parent frame, or the entire page, the applet must be unloaded and therefore it will stop. At this point it will automatically unregister with Gubd, which will notify Gubshell, which will remove the client's name from the GUI's client menu. You won't be able to push content to the client again until that browser revisits your Gubcast-enabled page.
Three troubleshooting notes:
Make a directory named "gub". Copy all three jarfiles (from the "lib" and
"demo" directories) into it. Copy all the HTML in "demo/HTML" into it. Start
two console windows, and cd
to your "gub" directory in both of
them. In one console window, enter this command:
java -classpath .\gubdemo.jar;.\gubcaster.jar GubdIn the other console window, enter this command:
java -classpath .\gubdemo.jar GubshellThen double-click on the
index.html
file in "gub". Your browser
should pop up with the Gubcast demo page displayed, and a new client named
"test" should appear in the Gubshell window's client menu.
Finally, in the Gubshell window, enter "bottom" as frame name and "www.stepsoncats.com" as URL, and click on the "Push content" button. In the browser window, the bottom frame of the demo page should now display the Steps On Cats home page.