Top Description Constructors Methods
net.sf.ehcache.store

public abstract Class MemoryLimitedCacheLoader

extends Object
implements BootstrapCacheLoader, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, net.sf.ehcache.bootstrap.BootstrapCacheLoader
Known Direct Subclasses
net.sf.ehcache.terracotta.TerracottaBootstrapCacheLoader, net.sf.ehcache.store.DiskStoreBootstrapCacheLoader
Imports
net.sf.ehcache.Ehcache, net.sf.ehcache.bootstrap.BootstrapCacheLoader

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
protected boolean

Returns:

true if on-heap or off-heap limit has been reached, false otherwise
isInMemoryLimitReached
(final Ehcache
The cache being loaded and to be checked for limit being reached
cache
,
final int
amounts of elements loaded so far
loadedElements
)

Checks whether the cache has reached the limit configured for in-memory storage

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MemoryLimitedCacheLoaderback to summary
public MemoryLimitedCacheLoader()

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Implements net.sf.ehcache.bootstrap.BootstrapCacheLoader.clone.

Doc from net.sf.ehcache.bootstrap.BootstrapCacheLoader.clone.

Clones the loader

Returns:Object

clone of this instance

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface.
isInMemoryLimitReachedback to summary
protected boolean isInMemoryLimitReached(final Ehcache cache, final int loadedElements)

Checks whether the cache has reached the limit configured for in-memory storage

Parameters
cache:Ehcache

The cache being loaded and to be checked for limit being reached

loadedElements:int

amounts of elements loaded so far

Returns:boolean

true if on-heap or off-heap limit has been reached, false otherwise