2 Replies Latest reply: Mar 12, 2012 9:14 AM by Guido Bonazza RSS

AtomicMap: no way to specify lifespan in AtomicMapLookup API?

Guido Bonazza Newbie

I need to specify the lifespan for AtomicMaps when they are created; the problem is that the only legal way is through AtomicMapLookup.getAtomicMap(...) methods, and they do not allow to specify the lifespan in case of creation.

The only workaround that comes to my mind is  to do following:

 

AtomicMap<String, Integer> map = AtomicMapLookup.getAtomicMap(cache, key);
cache.replace(key, map, lifespan, unit);

 

Is this the right way? Shouldn't the AtomicMapLookup API be extended solve this problem?

 

Thanks,

      Guido