Java, Terracotta

Terracotta toolkit

The Terracotta Toolkit is an API that provides you many functionalities in a clustered manner.
E.g., you can get a Clustered ReadWrite Lock, so you can do synchronization between different applications running on different machines/JVMs.

In 3.7, you get the Toolkit like this:

ClusteringToolkit toolkit = new TerracottaClient("localhost:9510").getToolkit();

In 4.0, you get the Toolkit like this:

Toolkit toolkit = ToolkitFactory.createToolkit("toolkit:terracotta://localhost:9510");

Then you can use it to get the functionalities you want, e.g.:
Clustered Collections (List, Map, Set):

ToolkitList clusteredKit = toolkit.getList("myList", String.class);

Clustered lock:

ToolkitReadWriteLock rwLock = toolkit.getReadWriteLock("myReadWriteLock");

Clustered Barrier

ToolkitBarrier clusteredBarrier = toolkit.getBarrier("myBarrier", 4);

Learn more here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s