This sample is a part of the Terracotta Framework Library - tclib. More information is available from the Terracotta Framework Library readme.html.
This application implements a distributed strategy pattern. One node (worker) registers itself to listen for strategies to be sent (aka commands). The other node (master) looks up the list of nodes that are registered and sends the first node in the list a command.
This sample application requires Maven 2 and Java 5. First download and install Maven 2. Then perform these steps:
$ mvn tc:start
$ mvn -DactiveNodes=worker tc:run
$ mvn -DactiveNodes=say tc:run
$ mvn -DactiveNodes=worker tc:run
$ mvn -DactiveNodes=say tc:run
$ mvn -DactiveNodes=sayAll tc:run