public abstract class SmartLengthBasedCache<T> extends Object
Constructor and Description |
---|
SmartLengthBasedCache(int maxCachedBufferLength,
double expungeRatio,
int expungeCount,
int defaultResourceLength,
ISmartLengthBasedCacheCallback callback) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createResource(int length) |
T |
get() |
T |
get(int length) |
long |
getLength() |
protected abstract int |
getResourceCapacity(T resource) |
void |
notifyUsedSize(int usedSize) |
protected abstract void |
prepareResource(T resource) |
protected abstract void |
prepareResource(T resource,
int length) |
void |
set(T resource) |
static ISmartLengthBasedCacheCallback |
toCacheCallback(IMemoryAwareResourcePool resourcePool) |
protected void |
tryCacheResource(T resource) |
public SmartLengthBasedCache(int maxCachedBufferLength, double expungeRatio, int expungeCount, int defaultResourceLength, ISmartLengthBasedCacheCallback callback)
public T get(int length)
protected void tryCacheResource(T resource)
protected abstract void prepareResource(T resource)
protected abstract void prepareResource(T resource, int length)
protected abstract T createResource(int length)
protected abstract int getResourceCapacity(T resource)
public long getLength()
public T get()
public void set(T resource)
public void notifyUsedSize(int usedSize)
public static ISmartLengthBasedCacheCallback toCacheCallback(IMemoryAwareResourcePool resourcePool)
Copyright © GigaSpaces.