Skip to content

Instantly share code, notes, and snippets.

@edpichler
Created February 8, 2011 10:45
Show Gist options
  • Save edpichler/816261 to your computer and use it in GitHub Desktop.
Save edpichler/816261 to your computer and use it in GitHub Desktop.
public class AppengineMemCacheMap implements IQuoteCache {
private Cache cache;
public AppengineMemCacheMap() {
Map props = new HashMap();
props.put(GCacheFactory.EXPIRATION_DELTA, 60);// seconds
try {
CacheFactory cacheFactory = CacheManager.getInstance()
.getCacheFactory();
cache = cacheFactory.createCache(props);
}
@Override
public void updateQuote(ICodeQuote stock) {
cache.put(stock.getCodigo(), stock);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment