Table of Contents

Summary

In this lesson we will start developing new protocols for APPIA.

Objectives

The third laboratory has the following objectives:

* Create a print module (which receives an event and prints it).
* Test the new module
* Create a log module (useful for debug purposes).

Layers, Sessions, QoS and Channels

In Appia the following concepts exist:

* A **Layer** is defined by the properties that a protocol requires and those it will provide. It describes the behaviour of a module.
* A **Session** is a running instance of a layer. A session state is independent from other instances.
* **QoS** ( Quality of Service) is a composition of layers.
* (Communication) **Channels**  are instances of QoS. Composed by a set of sessions.

Running

Part 1 - Understand the Print Module

1. Look at Print Layer class. Notice what it requires and provides.
2. Notice that each event has its own class. Check these classes.
3. Look at the Print Session class. Note how to deal with accepted events.
4. Look at the PrintApplication session and layer classes. See how they generate events.
5. Look at the Example class. Indentify where the QoS and channel are created.
6. Run the Example with the following command. Send a few messages and understand what is happening.

java -cp build:lib/appia-core-4.1.2.jar:lib/log4j-1.2.14.jar print.Example

Part 2 - Create a log module

  1. Create a new module (Layer and session) which logs all events which pass in the layer. Use it to log the messages.
  2. Try to use the log protocol in the lab2 to see events reqired for view synchrony.
Date:2012-03-06
Version:1