Package com.db4o.io

Class CachingStorage

  • All Implemented Interfaces:
    Storage

    public class CachingStorage
    extends StorageDecorator
    Caching storage adapter to cache db4o database data in memory until the underlying Bin is instructed to flush its data when Bin.sync() is called.

    You can override the newCache() method if you want to work with a different caching strategy.
    • Constructor Summary

      Constructors 
      Constructor Description
      CachingStorage​(Storage storage)
      default constructor to create a Caching storage with the default page count of 64 and the default page size of 1024.
      CachingStorage​(Storage storage, int pageCount, int pageSize)
      constructor to set up a CachingStorage with a configured page count and page size
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Cache4<java.lang.Long,​java.lang.Object> newCache()
      override this method if you want to work with a different caching strategy than the default LRU2Q cache.
      Bin open​(BinConfiguration config)
      opens a Bin for the given URI.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CachingStorage

        public CachingStorage​(Storage storage)
        default constructor to create a Caching storage with the default page count of 64 and the default page size of 1024.
        Parameters:
        storage - the Storage to be cached.
      • CachingStorage

        public CachingStorage​(Storage storage,
                              int pageCount,
                              int pageSize)
        constructor to set up a CachingStorage with a configured page count and page size
        Parameters:
        storage - the Storage to be cached.
        pageCount - the number of pages the cache should use.
        pageSize - the size of the pages the cache should use.