Skip navigation

Cookbook

Article Rating?


The Cookbook provides you with simple, ready to run examples. Each example demonstrates some particular aspect or functionality of Terracotta. Return to it often, as the "recipes" presented here provide good starting points (components if you will) to use when leveraging Terracotta in your application.

Each recipe provides detailed instructions for running. You will only need Java and Terracotta installed to run these examples. This site will provide you with navigation elements in the left side bar to switch from one recipe to the next.

Start off with the Hello World recipe, which demonstrates a very simple use of Terracotta - a clustered counter.

Cookbook

Get it yourself from svn - http://svn.terracotta.org/svn/forge/cookbook


Hello WorldHello World application that demonstrates POJO clustering.
InstrumentationSample application that demonstrates how to configure Terracotta instrumentation.
LockingDemonstrates how to configure the tc-config.xml locks section
SynchronizedDemonstrates the use of distributed synchronized, wait and notify.
DMIDemonstrates the use of distributed method invocation, which can fire a method on many clients across the cluster.
TransientDemonstrates how transience works in Terracotta.
HashMapDemonstrates the use of a java.util.HashMap.
ConcurrentHashMapDemonstrates the use of a java.util.concurrent.ConcurrentHashMap.
AtomicIntegerDemonstrates the use of an AtomicInteger.
CyclicBarrierCoordinate JVMs using a java.util.concurrent.CyclicBarrier.
Read LockHow to use read locks to improve concurrent access
ReentrantReadWriteLockHow to use java.util.concurrent.ReentrantReadWriteLock.
LinkedBlockingQueueDemonstrates the use of java.util.concurrent.LinkedBlockingQueue
FutureTaskDemonstrates the use of java.util.concurrent.FutureTask
Dirty ReadDemonstrates the use dirty reads to improve data availability at the cost of coherence
ListenerDemonstrates how to implement a clustered listener.
Single ResourceDemonstrates how to assign a single owner for a resource across the cluster.
RMIA complex example using a Queue and a Proxy to emulate an RMI like mechanism.
WildcardsDemonstrates how to use wildcards in the Terracotta tc-config.xml file.

Adaptavist Theme Builder Powered by Atlassian Confluence