Package net.sf.jsr107cache

Examples of net.sf.jsr107cache.CacheFactory


    props.put(GCacheFactory.NAMESPACE, C_NAMESPACE);
//    props.put(GCacheFactory.EXPIRATION_DELTA, C_TIMEOUT);
    CacheManager cMan = CacheManager.getInstance();
    props.put("name", C_NAME);
    try{
      CacheFactory cFac = cMan.getCacheFactory();
      Cache cache = cFac.createCache(props);
      cMan.registerCache(C_NAME, cache);
      cache.put(C_KEY_RESULTS, new Results());
      cache.put(C_KEY_SUMMARY, retrieveSummary());
    }catch(CacheException e){
     
View Full Code Here


    @SuppressWarnings("rawtypes")
    Map props = new HashMap();
        props.put(GCacheFactory.EXPIRATION_DELTA, 604800);
   
        try {
            CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
            cache = cacheFactory.createCache(Collections.emptyMap());
        } catch (CacheException e) {  }
  }
View Full Code Here

  public BloomFilter getCachedBloomFilter() {     

    // check to see if there is already a Bloom Filter in the memcache
    // to do that, first get the cache
      try {
          CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
          cache = cacheFactory.createCache(Collections.emptyMap());
      } catch (CacheException e) {}
      // then, look in it for a Bloom Filter by Key value
      if (cache.containsKey("bloom_filter")) {b = (BloomFilter) cache.get("bloom_filter");}
      // if a Bloom Filter exists already in the memcache, return a reference to that memcached Bloom Filter
      if (b != null) {return b;}
View Full Code Here

 
  public Trie getCachedTrie(String type) {     
    // check to see if there is already a Trie in the memcache
    // to do that, first get the cache
      try {
          CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
          cache = cacheFactory.createCache(Collections.emptyMap());
      } catch (CacheException e) {}
      // then, look in it for a Trie by Key value
      if (cache.containsKey(type+ "_trie")) {t = (Trie) cache.get(type+ "_trie");}
      // if a Trie exists already in the memcache, return a reference to that memcached trie
      if (t != null) {return t;}
View Full Code Here

    private static Cache cacheInit() {

        Cache cache;

        try {
            CacheFactory cacheFactory = CacheManager.getInstance()
                    .getCacheFactory();
            cache = cacheFactory.createCache(Collections.emptyMap());
            return cache;
        } catch (CacheException e) {
            return null;
        }
View Full Code Here

TOP

Related Classes of net.sf.jsr107cache.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.