ro.isdc.wro.cache.support
Class DefaultSynchronizedCacheStrategyDecorator

java.lang.Object
  extended by ro.isdc.wro.util.AbstractDecorator<CacheStrategy<K,V>>
      extended by ro.isdc.wro.cache.support.CacheStrategyDecorator<K,V>
          extended by ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator<CacheKey,CacheValue>
              extended by ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator
All Implemented Interfaces:
CacheStrategy<CacheKey,CacheValue>, ObjectDecorator<CacheStrategy<CacheKey,CacheValue>>

public class DefaultSynchronizedCacheStrategyDecorator
extends AbstractSynchronizedCacheStrategyDecorator<CacheKey,CacheValue>

Responsible for invoking GroupsProcessor when cache key is missed.

Since:
1.4.6
Author:
Alex Objelean

Method Summary
 void clear()
          Clear all cache contents.
static CacheStrategy<CacheKey,CacheValue> decorate(CacheStrategy<CacheKey,CacheValue> decorated)
          Decorates the provided CacheStrategy.
protected  CacheValue loadValue(CacheKey key)
          Loads the value associated with the key.
protected  void onBeforeGet(CacheKey key)
          Invoked just before the get method is invoked.
 
Methods inherited from class ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator
get, put
 
Methods inherited from class ro.isdc.wro.cache.support.CacheStrategyDecorator
destroy
 
Methods inherited from class ro.isdc.wro.util.AbstractDecorator
getDecoratedObject, getOriginalDecoratedObject, getOriginalDecoratedObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

decorate

public static CacheStrategy<CacheKey,CacheValue> decorate(CacheStrategy<CacheKey,CacheValue> decorated)
Decorates the provided CacheStrategy. The provided CacheStrategy won't be decorated if the operation is redundant.


loadValue

protected CacheValue loadValue(CacheKey key)
Loads the value associated with the key. This is a potential slow operation which will be prevented to be called multiple times for the same key.

Specified by:
loadValue in class AbstractSynchronizedCacheStrategyDecorator<CacheKey,CacheValue>

onBeforeGet

protected void onBeforeGet(CacheKey key)
Invoked just before the get method is invoked. Can be useful for checking if resources are stale and invalidating the cache.

Overrides:
onBeforeGet in class AbstractSynchronizedCacheStrategyDecorator<CacheKey,CacheValue>

clear

public void clear()
Clear all cache contents.

Specified by:
clear in interface CacheStrategy<CacheKey,CacheValue>
Overrides:
clear in class CacheStrategyDecorator<CacheKey,CacheValue>


Copyright © 2008-2013. All Rights Reserved.