Package com.db4o.io
Class CachingStorage
- java.lang.Object
- 
- com.db4o.io.StorageDecorator
- 
- com.db4o.io.CachingStorage
 
 
- 
- All Implemented Interfaces:
- Storage
 
 public class CachingStorage extends StorageDecorator Caching storage adapter to cache db4o database data in memory until the underlyingBinis instructed to flush its data whenBin.sync()is called.
 You can override thenewCache()method if you want to work with a different caching strategy.
- 
- 
Field Summary- 
Fields inherited from class com.db4o.io.StorageDecorator_storage
 
- 
 - 
Constructor SummaryConstructors 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 SummaryAll 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.Binopen(BinConfiguration config)opens a Bin for the given URI.- 
Methods inherited from class com.db4o.io.StorageDecoratordecorate, delete, exists, rename
 
- 
 
- 
- 
- 
Constructor Detail- 
CachingStoragepublic 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- Storageto be cached.
 
 - 
CachingStoragepublic CachingStorage(Storage storage, int pageCount, int pageSize) constructor to set up a CachingStorage with a configured page count and page size- Parameters:
- storage- the- Storageto be cached.
- pageCount- the number of pages the cache should use.
- pageSize- the size of the pages the cache should use.
 
 
- 
 - 
Method Detail- 
openpublic Bin open(BinConfiguration config) throws Db4oIOException opens a Bin for the given URI.- Specified by:
- openin interface- Storage
- Overrides:
- openin class- StorageDecorator
- Throws:
- Db4oIOException
 
 - 
newCacheprotected 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.
 
- 
 
-