JBossCache200Migration

This page is for users of JBoss Cache 1.x.x who wish to move to JBoss Cache 2.x.x, and talks about how things have changed, and how existing code can be migrated to the new APIs.

 

It is assumed that you have already read the JBoss Cache User Guide and FAQs.

 

Q: Where is TreeCache?

 

A: TreeCache, the central class in JBoss Cache 1.x.x, has been removed in favour of API access via a Cache interface.  This gives the implementation more flexibility, and adds further safety by restricting the API methods exposed.

 

Q: Can Nodes be directly manipulated now, and will aspects such as locking, replication and cache loading still be applied?

 

A: Yes.  JBoss Cache 1.x.x exposed Node objects but did not apply any of the JBoss Cache aspects when directly manipulating a Node.  In 2.0.0 we have promoted Node to a top-level construct and it is in fact encouraged to use Nodes directly rather than operations on Cache.

 

Q: How do I create a Cache then?

 

A: Use a CacheFactory.  JBoss Cache 2.0.0 ships with a DefaultCacheFactory implementation.  See the User Guide for examples.