Package javax.cache

Examples of javax.cache.CacheFactory


  }
 
  public static Image findImage(String value) {
    if (value != null) {
      try {
        CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
        Cache cache = cacheFactory.createCache(Collections.emptyMap());
        return (Image) cache.get(value);
      } catch (CacheException e) {
        logger.error(e.getMessage(), e);
      }
    }
View Full Code Here


    if (expirationSeconds > 0) {
      properties.put(GCacheFactory.EXPIRATION_DELTA, expirationSeconds);
    }
   
    try {
      CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
      memcache = cacheFactory.createCache(properties);
    } catch (CacheException ex) {
      throw new RuntimeException(ex);
    }
  }
View Full Code Here

 
  public static Cache getInstance() throws CacheException {
    if(datacache == null) {
      Map props = new HashMap();
      props.put(MemcacheService.SetPolicy.SET_ALWAYS, true);
      CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
      datacache = cacheFactory.createCache(props);
    }
    return datacache;
  }
View Full Code Here

TOP

Related Classes of javax.cache.CacheFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.