Last night we released Beta 2 of the Terracotta 3.3 release. It has a number of improvements and updates to the Terracotta Toolkit including improved naming and factoring and additional clustered classes like AtomicLong and List. You can grab that or to get the absolute latest you can grab a nightly (my preference because the beta doesn't work with maven)
I pushed a couple of toolkit samples to GitHub (which by the way is awesome!). I didn't do hardly any cleanup or comments so just post questions to the blog if you need help.
If your a Git user already I don't need to tell you how to check it out. If your not just hit "download source" on the upper right of the web page and don't worry about Git.
Four examples are included:
PlayingWithMapOfLocksExpress - A quick sample that show's how to create a clustered Map of Locks.
PlayingWithToolkitBarrier - Example of using a Cyclic barrier to coordinate between processes
PlayingWithToolkitClusterInfo - Example showing how to register a listener for cluster events.
PlayingWithToolkitQueue - Little sample on using a queue between two nodes
PlayingWithToolkitClusterCounter - Basic sample that show's using a clustered atomic long
You can run these from the command line by:
- Downloading and unpacking the nightly build or beta from Terracotta
- Staring the Terracotta server by calling the ./bin/start-tc-server.sh
- Running 2 instances of the compiled versions of any of the above
java -cp target:INSTALL_DIR/common/terracotta-toolkit-1.0-runtime-ee-1.0.0-SNAPSHOT.jar PlayingWithToolkitClusterInfo
You can also run them using the Terracotta Maven Plugin:
To switch between the samples edit the pom.xml