Package org.hcjf.cloud.cache
Interface CloudCacheStrategy
-
- All Known Implementing Classes:
SizeStrategy
public interface CloudCacheStrategyThis interface define the cache strategy implementations.- Author:
- javaito
-
-
Method Summary
Modifier and Type Method Description java.util.Set<java.lang.Object>applyStrategy()This method must evaluate the specific strategy and return all the ids that will be removed of the cache implementation.voidinit(CloudCache cacheInstance)Init the strategy for a particular instance of cache.voidonAdd(java.lang.Object id, java.lang.Object value)This method is called when some object was added to the cache instance.voidonRemove(java.lang.Object id)This method is called when some object was removed to the cache instance.
-
-
-
Method Detail
-
init
void init(CloudCache cacheInstance)
Init the strategy for a particular instance of cache.- Parameters:
cacheInstance- Instance of cache.
-
onRemove
void onRemove(java.lang.Object id)
This method is called when some object was removed to the cache instance.- Parameters:
id- Id removed to the cache instance.
-
onAdd
void onAdd(java.lang.Object id, java.lang.Object value)This method is called when some object was added to the cache instance.- Parameters:
id- Id added into the cache instance.value- Value added into cache.
-
applyStrategy
java.util.Set<java.lang.Object> applyStrategy()
This method must evaluate the specific strategy and return all the ids that will be removed of the cache implementation.- Returns:
- Collection of the ids that will be removed.
-
-