Running the Demos

Start the server

You will get a timestamped message indicating the server is starting, a couple lines logging the initialization process, and another timestamped message saying the service managers are starting.

That message will be followed by a series of messages about the service managers, (one for the demos), and the services they support. This information describes the port each service manager is listening on followed by the services each manager supports and the URL path of each service. Under each service is a list of the commands each service accepts.

When the server is ready you'll get another timestamped message, followed by a dashed line. (The dashed line may come before all the service info finishes listing. This is a minor bug that doesn't affect the server's operation.)

Below the dashed line a one line message will be printed each time a client connects.

Run the demos

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 Broadcast Tool Demo

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 context provider service

The other template service is TpltEvwCtxtProvSrvc. 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.

TpltEvwCtxtProvSrvc and SimpleBcTestSrvc are not the same. This is intentional. The template service uses the full EventWeb 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 TpltEvwCtxtProvSrvc should be educational.

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.

Stopping the server

The EventWeb Server Controller can be used to stop the server. But, for the demos, there is no harm in just killing the server process, (Ctrl-C on Windows, Works on Ubuntu too).

V0.1.1  10/28/13  swt