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?
|Retrieving data ...|