Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2.  
  3. public class AppengineMemCacheMap implements IQuoteCache {
  4. private Cache cache;
  5.  
  6. public AppengineMemCacheMap() {
  7. Map props = new HashMap();
  8. props.put(GCacheFactory.EXPIRATION_DELTA, 60);// seconds
  9.  
  10. try {
  11. CacheFactory cacheFactory = CacheManager.getInstance()
  12. .getCacheFactory();
  13. cache = cacheFactory.createCache(props);
  14.  
  15. }
  16.  
  17. @Override
  18. public void updateQuote(ICodeQuote stock) {
  19. cache.put(stock.getCodigo(), stock);
  20. }
  21.  
  22. ...
  23. }
Add Comment
Please, Sign In to add comment