tags:

views:

28

answers:

1

Let's say I start with a single CacheManager like this: private static CacheManager manager = CacheManager.create();

When I call getCache or addCache do I need to synchronize on the CacheManager first?

When I call put or get on the Cache, should I synchronize on the Cache first?

A: 

These docs imply that you have to synchronize on the CacheManager instance, as, for example, addCache throws an exception if the given cache "already exists" in the cache.

Jonathan Feinberg