com.mchange.v1.cachedstore
Class CachedStoreFactory

java.lang.Object
  extended by com.mchange.v1.cachedstore.CachedStoreFactory

public final class CachedStoreFactory
extends Object

Unless otherwise noted, implementations are to be presumed NOT thread safe!!! use the synchronized wrappers defined in CachedStoreUtils for multithreaded situations!

See Also:
CachedStoreUtils.synchronizedCachedStore(com.mchange.v1.cachedstore.CachedStore), CachedStoreUtils.synchronizedTweakableCachedStore(com.mchange.v1.cachedstore.TweakableCachedStore)

Constructor Summary
CachedStoreFactory()
           
 
Method Summary
static WritableCachedStore cacheWritesOnlyWritableCachedStore(WritableCachedStore.Manager mgr)
           
static WritableCachedStore createDefaultWritableCachedStore(WritableCachedStore.Manager manager)
          creates a WritableCachedStore implementation that uses soft keys and synchronous cleanup for its read cache.
static TweakableCachedStore createNoCacheCachedStore(CachedStore.Manager mgr)
          Always reads directly from manager, as if values are always dirty.
static WritableCachedStore createNoCacheWritableCachedStore(WritableCachedStore.Manager mgr)
          Always reads directly from manager, as if values are always dirty.
static TweakableCachedStore createNoCleanupCachedStore(CachedStore.Manager manager)
           
static TweakableCachedStore createSoftValueCachedStore(CachedStore.Manager manager)
          Better to use createSynchronousCleanupSoftKeyCachedStore to prevent the build of cleaned SoftReferences, unless the universe of potential cacheables is small.
static TweakableCachedStore createSynchronousCleanupSoftKeyCachedStore(CachedStore.Manager manager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedStoreFactory

public CachedStoreFactory()
Method Detail

createNoCleanupCachedStore

public static TweakableCachedStore createNoCleanupCachedStore(CachedStore.Manager manager)

createSoftValueCachedStore

public static TweakableCachedStore createSoftValueCachedStore(CachedStore.Manager manager)
Better to use createSynchronousCleanupSoftKeyCachedStore to prevent the build of cleaned SoftReferences, unless the universe of potential cacheables is small.


createSynchronousCleanupSoftKeyCachedStore

public static TweakableCachedStore createSynchronousCleanupSoftKeyCachedStore(CachedStore.Manager manager)

createNoCacheCachedStore

public static TweakableCachedStore createNoCacheCachedStore(CachedStore.Manager mgr)
Always reads directly from manager, as if values are always dirty.


createDefaultWritableCachedStore

public static WritableCachedStore createDefaultWritableCachedStore(WritableCachedStore.Manager manager)
creates a WritableCachedStore implementation that uses soft keys and synchronous cleanup for its read cache.


cacheWritesOnlyWritableCachedStore

public static WritableCachedStore cacheWritesOnlyWritableCachedStore(WritableCachedStore.Manager mgr)

createNoCacheWritableCachedStore

public static WritableCachedStore createNoCacheWritableCachedStore(WritableCachedStore.Manager mgr)
Always reads directly from manager, as if values are always dirty. Always writes to back-end storage. Effectively Autoflushing, since every write is flushed.

See Also:
Autoflushing