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 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.Binopen(BinConfiguration config)opens a Bin for the given URI.- 
Methods inherited from class com.db4o.io.StorageDecorator
decorate, delete, exists, rename 
 - 
 
 - 
 
- 
- 
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- theStorageto 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- theStorageto be cached.pageCount- the number of pages the cache should use.pageSize- the size of the pages the cache should use.
 
 - 
 
- 
Method Detail
- 
open
public Bin open(BinConfiguration config) throws Db4oIOException
opens a Bin for the given URI.- Specified by:
 openin interfaceStorage- Overrides:
 openin classStorageDecorator- Throws:
 Db4oIOException
 
- 
newCache
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. 
 - 
 
 -