Package io.higson.runtime.engine.cache
Class MapPreparedParamCache
java.lang.Object
io.higson.runtime.engine.cache.MapCache<PreparedParameter>
io.higson.runtime.engine.cache.MapPreparedParamCache
- All Implemented Interfaces:
PreparedParamCache
public class MapPreparedParamCache
extends MapCache<PreparedParameter>
implements PreparedParamCache
Implementation of
PreparedParamCache based on concurrent HashMap version.
Functions stored in this cache do not expire until method MapCache.invalidate(String) will be called.- Author:
- Przemek Hertel
- Since:
- 1.0.0
- Version:
- 1.0.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindKey(int pid) Finds cache entry with given parameter id and returns cache key.voidInvalidate all entries from a cachevoidinvalidate(int pid) will remove: - each parameter with id = [pid] - each slave parameter with mid = [pid]intsize()Returns the number of cache entries.Methods inherited from class io.higson.runtime.engine.cache.MapCache
get, invalidate, list, put, putAllMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.higson.runtime.engine.core.prepared.PreparedParamCache
get, invalidate, list, put
-
Constructor Details
-
MapPreparedParamCache
public MapPreparedParamCache()
-
-
Method Details
-
invalidate
public void invalidate(int pid) will remove: - each parameter with id = [pid] - each slave parameter with mid = [pid]- Specified by:
invalidatein interfacePreparedParamCache- Parameters:
pid- entry id
-
invalidate
public void invalidate()Description copied from interface:PreparedParamCacheInvalidate all entries from a cache- Specified by:
invalidatein interfacePreparedParamCache- Overrides:
invalidatein classMapCache<PreparedParameter>
-
findKey
Description copied from interface:PreparedParamCacheFinds cache entry with given parameter id and returns cache key. Returns null if there is no such parameter in the cache.- Specified by:
findKeyin interfacePreparedParamCache
-
size
public int size()Description copied from interface:PreparedParamCacheReturns the number of cache entries.- Specified by:
sizein interfacePreparedParamCache
-