Package org.infinispan.container.entries

Examples of org.infinispan.container.entries.InternalCacheEntry


            if (next == null) {
               throw new NoSuchElementException();
            }

            InternalCacheEntry ret = next;
            next = null;
            return ret;
         }
View Full Code Here


            fetchNext();
         }

         private void fetchNext() {
            while (it.hasNext()) {
               InternalCacheEntry e = it.next();
               if (e.isExpired()) {
                  continue;
               } else {
                  next = e;
                  break;
               }
View Full Code Here

               fetchNext();

            if (next == null)
               throw new NoSuchElementException();

            InternalCacheEntry ret = next;
            next = null;
            return ret;
         }
View Full Code Here

    * @throws Exception if there's any issues reading the data from the cache or pushing data to the cache store.
    */
   protected void pushState(final Cache cache) throws Exception {
      DataContainer dc = cache.getAdvancedCache().getDataContainer();
      Set keys = dc.keySet();
      InternalCacheEntry entry;
      for (Object k : keys) if ((entry = dc.get(k)) != null) store(entry);
   }
View Full Code Here

   public static DataContainer unBoundedDataContainer(int concurrencyLevel) {
      return new DefaultDataContainer(concurrencyLevel);
   }

   public InternalCacheEntry peek(Object key) {
      InternalCacheEntry e = entries.get(key);
      return e;
   }
View Full Code Here

      InternalCacheEntry e = entries.get(key);
      return e;
   }

   public InternalCacheEntry get(Object k) {
      InternalCacheEntry e = peek(k);
      if (e != null) {
         if (e.isExpired()) {
            entries.remove(k);
            e = null;
         } else {
            e.touch();
         }
      }
      return e;
   }
View Full Code Here

      }
      return e;
   }

   public void put(Object k, Object v, long lifespan, long maxIdle) {
      InternalCacheEntry e = entries.get(k);
      if (e != null) {
         e.setValue(v);
         InternalCacheEntry original = e;
         e = entryFactory.update(e, lifespan, maxIdle);
         // we have the same instance. So we need to reincarnate.
         if(original == e) {
            e.reincarnate();
         }
View Full Code Here

      }
      entries.put(k, e);
   }

   public boolean containsKey(Object k) {
      InternalCacheEntry ice = peek(k);
      if (ice != null && ice.isExpired()) {
         entries.remove(k);
         ice = null;
      }
      return ice != null;
   }
View Full Code Here

      }
      return ice != null;
   }

   public InternalCacheEntry remove(Object k) {
      InternalCacheEntry e = entries.remove(k);
      return e == null || e.isExpired() ? null : e;
   }
View Full Code Here

      return new EntrySet();
   }

   public void purgeExpired() {
      for (Iterator<InternalCacheEntry> purgeCandidates = entries.values().iterator(); purgeCandidates.hasNext();) {
         InternalCacheEntry e = purgeCandidates.next();
         if (e.isExpired()) {
            purgeCandidates.remove();
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.container.entries.InternalCacheEntry

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.