Class FSDefaultCacheStore

  • All Implemented Interfaces:
    FSCacheEx<java.lang.String,​FSCacheValue>

    public class FSDefaultCacheStore
    extends java.lang.Object
    implements FSCacheEx<java.lang.String,​FSCacheValue>
    A simple default cache implementation, mainly for testing. For production you will probably want to wrap Guava's cache implementation or something similar. This implementation does not use synchronisation beyond using a ConcurrentHashMap internally. Specifically, the get(String, Callable) may call the loader multiple times if called in close succession.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​FSCacheValue> _store  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FSCacheValue get​(java.lang.String key)  
      FSCacheValue get​(java.lang.String key, java.util.concurrent.Callable<? extends FSCacheValue> loader)  
      void put​(java.lang.String key, FSCacheValue value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait