2 Replies Latest reply on Mar 12, 2012 9:14 AM by guidbona

    AtomicMap: no way to specify lifespan in AtomicMapLookup API?

    guidbona

      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:

       

      {noformat}

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

      cache.replace(key, map, lifespan, unit);

      {noformat}

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

       

      Thanks,

            Guido