Infinispan provides the following APIs to access the grid:
Cache API: This is Infinispan's primary API to access the grid, it's located in the
org.infinispan
package.TreeCache API: Infinispan provides the
org.infinispan.tree.TreeCache
interface to provide compatibility with JBoss Cache. It can be used for caching data organized as tree-like structures, like a filesystem tree.To create an instance of
TreeCache
, you will need a factory class calledorg.infinispan.tree.TreeCacheFactory
. Define the tree structure using theorg.infinispan.tree.Node
interface, by defining a root node and a collection of node objects that contain the key and value data.You can find a simple example of the
TreeCache
API using the Infinispan configuration API here:EmbeddedCacheManager manager = new DefaultCacheManager("sample.xml"); TreeCache<String, String> tc = new TreeCacheFactory().createTreeCache(manager.<String, String>getCache("TreeCache")); tc.put("/books/packt/infinispan/guide...