Running the Demos

Open the Demos Page

    If you are the EvwDemosWs servlet:

    If you are using the stand-alone server with native channels:

This will take you to the home page at the root of the release package. From there you can navigate to the demos. (You can also navigate to this page.)

(If you open the demos with a file URL, (by clicking on EvwDemos.html), the demos may or may not work, depending on which version of the JRE your browser is using.)

The order in which you run the demos is not important, but we'll go through them from top to bottom.

The Message Box Demo

The Message Box web page will pop up in the upper right corner of the screen. The square in the upper right hand corner will turn green in a short time, indicating a successful connection to the server. Other than that, not much will happen.

This is a publish/subscribe demo, and you need another page that uses publish/subscribe to see anything.

The text entry box will clear, and the message will appear in the other box. For now, move on to either the Slide Show or Quote of the Hour demo.

For more info on this demo see the message box discussion

The Slide Show Demo

The browser window will open the Slide Show. (Message Box is the only pop-up demo.) The connection indicator box is in the upper right corner, but this time it's small and unobtrusive.

This is a "client context" demo, If you open another slide show, the slide sequence is independent for each show. Each slide show client has it's own context.

The message will appear near the top of the slide show, and also in the other message box. The Message Box, Slide Show, and Quote of the Hour demos all subscribe to broadcast messages. The Message Box sends broadcast publication requests to the server.

Note that the slide sequence continues unaffected by the broadcast messages.

For more info on this demo see the slide show discussion

The Quote of the Hour Demo

The browser window will open and display a quote. The quote will be updated every hour. There are no user inputs on this page.

This is a "shared context" demo, If you open another quote page, you will get the same quote. Each quote of the hour client receives the same information at the same time.

The message will appear near the top of the quote page. (Same as with the slide show.)

For more info on this demo see the quote of the hour discussion

The System Information Demo

The browser window will open and display a lot of information about the Java runtime environment on the server.

There are no user inputs on this page, and it doesn't subscribe to broadcast messages.

The point of this "demo" is that it uses the template shared provider service. The service is intended as a template for the creation of new services, and thus the service it provides is very simple.

For more info on this demo see the system information discussion

The Bulletin Board Demo

The browser window will display a blue rectangle, and white text entry area with Post and Clear buttons. The blue rectangle is a default post that will initially say Bulletin Board Not Available. As soom as the backchannel connects the contents will change. If the bulletin board has no posts, the blue rectangle will change to Bulletin Board is Empty. If it has posts, the rectangle will be replaced by multiple rectangles, one for each post.

The text area will clear, and your text will be added to the top of the post list, with a green background. (The green background indicates the post has been sent to the server.)

The new post appears above the previous one. Again with a green background.

This (unfinished) version of Bulletin Board doesn't notify the client when it changes, so we have to reload the page to see the updated board.

The two posts appear, and this time they have the normal light blue background.

The background of the post turns red, and you get a Remove this post? prompt.

The post goes back to normal.

The background of the post stays red, and the text turns grey. This indicates the removal request has been sent to the server.

This time, open another browser and navigate to the Bulletin Board page.
The new bulletin board will show the other post, but not the one you removed.

Both pages show the same posts because they're looking at the same Bulletin Board.

For more info on this demo see the bulletin board discussion

The Broadcast Tool Demo

(This only works with native channels. The beta release does'nt have the WebSocket terminal client)

This demo does not use the web browser. It's a Java program that runs from a terminal window. It's purpose is to demonstrate that EventWeb clients don't have to be browser based.

Make sure you have a Message Box open when you run this demo.

You will be prompted for the name of the host to connect to. The default [localhost] should be fine, just press enter. (If you wanted to talk to an EventWeb server on a different machine, you would enter it's host name here.)

You will be prompted for the port to connect to. Enter the port the demo server is running on. (If running with all the default settings, this will be 80).

Next, you will be prompted for the path of the service you want to connect to. The default [/EvwDemos/RqstRouter] should be correct. (Press enter again.)

Finally, you'll get a Send: prompt. Type a message, and press enter again.

Your message will appear in the message box.

The message box clears, but otherwise, nothing happens.

The new message appears in the message box.
And, Your reply is printed out by the Broadcast Tool.

Because the tool is a simple console application, it can't display replies while it's waiting for you to enter a message. Not very practical, but it's only a demo, and keeping the code simple is more important than making it pretty.

You can continue sending and receiving messages. To exit the program press enter at the send prompt, with no text.

For more info on this demo, have a look at the source code.

The Template Provider Service

The other template service is TpltEvwProvFtry. There is no demo specifically for this service, but you can access it using the Backchannel Tester. This template provides the same functionality as the SimpleBcTestSrvr you ran earlier, plus a counter for the number of times a client has run the test.

The counter increments each time a client connects to the service and runs the test. (It doesn't count the times a client stops and then restarts the test.) The counter demonstrates the new architecture facility where a service has keeps data that is unique for each client, and data that is shared by all clients. The test message count is private for each client, and the test run count is shared by all clients.

Even without the test run counter, TpltEvwProvFtry and SimpleBcTestSrvc are coded differently. This is intentional. The TpltEvwProvFtry uses the full EventWeb (new) architecture, which is designed to allow new services to be created with a minimum of new code, and minimum duplication of existing code. This is what we want for a production environment, but not the easiest for a newcomer to figure out.

SimpleBcTestSrvr was written to be both a tester and an example application with the fewest possible moving parts. It is coded to do one thing and only use the classes necessary for that.

The idea is that a newcomer can study the SimpleBcTestSrvr source code to get the basics of how EventWeb works. With that understanding, it should be a lot easier to understand the full architecture. Once you understand SimpleBcTestSrvc, comparing it with TpltEvwProvFtry should be educational.

(There is one additional test service: TpltEvwCtxtProvSrvc. This is the legacy version of TpltEvwProvFtry. It is functionally the same as SimpleBcTestSrvc, but uses the full legacy service architecture. You can try it out if you run the legacy demos.)

Other things to try

Try connecting to the demo server from other hosts. It should make very little difference where the client is located.

Try opening various combinations of demos. Run two slide shows at different speeds or directions and send some messages using the message boxes. Note that the slides are independent, but everyone gets the same messages.

Try embedding some html in the messages you send. Eg: Hello <b>World</b> how <i>are</i> you. The message boxes will render the html, but the slide show and quote demos will strip out tags and display plain text.

04/08/17  swt