Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

A List of What Cannot JCache do

  • JCache cannot save the order of insertion. You should use LinkedHashMap for that purposes.
  • JCache cannot update whole entries in a cache atomically. You should use AtomicReference or some locking mechanisms for that purpose. (Ofcourse you can update a cache atomically if a cache has always only one reference.)
  • JCache doesn't offer read-write lock. You should use ReadWriteLock for that purpose.
  • JCache doesn't offer unmodifiable view of cache. You should use Collections.unmodifiableMap() for that purpose.