This document contains notes for the Ponder2 examples and the Ponder2 exercises that go with the Ponder2 Tutorial (PDF file containing all the slides).
The first part contains general requirements and preparation for running Ponder2 followed by links to the examples and exercises themselves.
All Ponder2 managed objects have PonderTalk documentation generated automatically by the compiler which uses a combination of @Ponder2op annotations, JavaDoc comments and method signatures within the code. The resulting documentation gives a full description of the PonderTalk messages that can be sent to each managed object.
There are two sets of such documentation included with this distribution, Ponder2 docs is for the core Ponder2 SMC system and Exercise docs which is generated when compiling the code for the examples and exercises described below.
More information about Ponder2 itself can be found at http://www.ponder2.net.
First you need to start a command or terminal window on your computer and change directory to the top level directory of this tutorial distributon. It is the same directory which contains the page you are reading. The command will look something like one the following lines:
cd ~/Ponder2Tutorial
cd c:\Ponder2Tutorial
cd c:\Documents and Settings\yourname\Desktop\Ponder2Tutorial
All the examples use ant to make it easy to set them up and run them. Due to the way the compiler is run, the latest version of ant is required. Version 1.7 is supplied with this tutorial distribution. The Windows ant command, when executed from this directory will use version 1.7 by default. If you are using Unix (Linux/Mac OS X) then you need to include the current directory at the beginning of your path or type the command as "./ant"
The ant build configuration file contains several targets allowing different configurations of the Ponder2 SMC to be run. The command
ant -p or ./ant -p
gives a complete list of the build targets and their descriptions. If you check the version number you should see version 1.7.0:
$ ant -version
Apache Ant version 1.7.0 compiled on December 13 2006
$
All the examples require the RMI registry so the program rmiregistry needs to be started. This is a Java program that facilitates communication between different Java programs. The RMI registry is used by the Body Sensor Node (BSN) example to communicate with the Ponder2 Self Managed Cell (SMC). This can be started with the command
ant rmi
You should see something like the following output (depending upon your operating system)
$ ./ant rmi
Buildfile: build.xml
build:
rmi:
[java] rmiregistry not running
[java] Trying to start rmi registry rmiregistry
[java] rmiregistry running
BUILD SUCCESSFUL
Total time: 1 second
$
If the rmiregistry program fails to start then you will have to start it yourself (do you have Java 1.5 or later installed?). It is contained in the bin directory within your Java installation (on Windows it is somewhere under c:\Program Files\Java. The examples will not work without the RMI registry running.
Once you have verified that you can run the RMI registry as outlined above, you can progress to running the examples and then doing the exercises.
Example | How to run the Body Sensor Node Example |
Exercise 1 | Obligation ECA Policies |
Exercise 2 | Java managed Object |
Exercise 3 | Authorization Policies |