Package net.sf.ehcache.store
Class MemoryLimitedCacheLoader
- java.lang.Object
-
- net.sf.ehcache.store.MemoryLimitedCacheLoader
-
- All Implemented Interfaces:
java.lang.Cloneable,BootstrapCacheLoader
- Direct Known Subclasses:
DiskStoreBootstrapCacheLoader,TerracottaBootstrapCacheLoader
public abstract class MemoryLimitedCacheLoader extends java.lang.Object implements BootstrapCacheLoader, java.lang.Cloneable
Abstract class for BootstrapCacheLoader implementers that should alter their load behavior (probably stop loading) whenever the cache being bootstrapped has reached its in-memory limit (off- or on-heap)- Author:
- Alex Snaps
-
-
Constructor Summary
Constructors Constructor Description MemoryLimitedCacheLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clones the loaderprotected booleanisInMemoryLimitReached(Ehcache cache, int loadedElements)Checks whether the cache has reached the limit configured for in-memory storage-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.ehcache.bootstrap.BootstrapCacheLoader
isAsynchronous, load
-
-
-
-
Method Detail
-
isInMemoryLimitReached
protected boolean isInMemoryLimitReached(Ehcache cache, int loadedElements)
Checks whether the cache has reached the limit configured for in-memory storage- Parameters:
cache- The cache being loaded and to be checked for limit being reachedloadedElements- amounts of elements loaded so far- Returns:
- true if on-heap or off-heap limit has been reached, false otherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClones the loader- Specified by:
clonein interfaceBootstrapCacheLoader- Overrides:
clonein classjava.lang.Object- Returns:
- clone of this instance
- Throws:
java.lang.CloneNotSupportedException- if the object's class does not support theCloneableinterface.
-
-