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 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 |
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 |
Bin |
open(com.db4o.io.BinConfiguration config)
opens a Bin for the given URI. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
open
public Bin open(com.db4o.io.BinConfiguration config)
throws Db4oIOException
- opens a Bin for the given URI.
- Specified by:
open
in interface Storage
- Overrides:
open
in class StorageDecorator
- Throws:
Db4oIOException
Copyright 2009 Versant Corporation. All rights reserved.