Package org.infinispan.container.entries.versioned

Examples of org.infinispan.container.entries.versioned.VersionedImmortalCacheEntry


   @Override
   public InternalCacheEntry create(Object key, Object value, EntryVersion version) {
      if (version == null)
         return new ImmortalCacheEntry(key, value);
      else
         return new VersionedImmortalCacheEntry(key, value, version);
   }
View Full Code Here


         if (lifespan < 0 && maxIdle < 0) return new ImmortalCacheEntry(key, value);
         if (lifespan > -1 && maxIdle < 0) return new MortalCacheEntry(key, value, lifespan, created);
         if (lifespan < 0 && maxIdle > -1) return new TransientCacheEntry(key, value, maxIdle, lastUsed);
         return new TransientMortalCacheEntry(key, value, maxIdle, lifespan, lastUsed, created);
      } else {
         if (lifespan < 0 && maxIdle < 0) return new VersionedImmortalCacheEntry(key, value, version);
         if (lifespan > -1 && maxIdle < 0) return new VersionedMortalCacheEntry(key, value, version, lifespan, created);
         if (lifespan < 0 && maxIdle > -1) return new VersionedTransientCacheEntry(key, value, version, maxIdle, lastUsed);
         return new VersionedTransientMortalCacheEntry(key, value, version, maxIdle, lifespan, lastUsed, created);
      }
   }
View Full Code Here

         if (lifespan < 0 && maxIdle < 0) return new ImmortalCacheEntry(key, value);
         if (lifespan > -1 && maxIdle < 0) return new MortalCacheEntry(key, value, lifespan);
         if (lifespan < 0 && maxIdle > -1) return new TransientCacheEntry(key, value, maxIdle);
         return new TransientMortalCacheEntry(key, value, maxIdle, lifespan);
      } else {
         if (lifespan < 0 && maxIdle < 0) return new VersionedImmortalCacheEntry(key, value, version);
         if (lifespan > -1 && maxIdle < 0) new VersionedMortalCacheEntry(key, value, version, lifespan);
         if (lifespan < 0 && maxIdle > -1) new VersionedTransientCacheEntry(key, value, version, maxIdle);
         return new VersionedTransientMortalCacheEntry(key, value, version, maxIdle, lifespan);
      }
   }
View Full Code Here

            }
         }
      } else if (ice instanceof MortalCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getValue(), version);
            } else {
               return new VersionedTransientCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle);
            }
         } else {
            if (maxIdle < 0) {
               ice.setLifespan(lifespan);
               return ice;
            } else {
               long ctm = System.currentTimeMillis();
               return new VersionedTransientMortalCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle, lifespan, ctm, ctm);
            }
         }
      } else if (ice instanceof TransientCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getVersion(), version);
            } else {
               ice.setMaxIdle(maxIdle);
               return ice;
            }
         } else {
            if (maxIdle < 0) {
               return new VersionedMortalCacheEntry(ice.getKey(), ice.getValue(), version, lifespan);
            } else {
               long ctm = System.currentTimeMillis();
               return new VersionedTransientMortalCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle, lifespan, ctm, ctm);
            }
         }
      } else if (ice instanceof TransientMortalCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getValue(), version);
            } else {
               return new VersionedTransientCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle);
            }
         } else {
            if (maxIdle < 0) {
View Full Code Here

*/
public class VersionedInternalEntryFactoryImpl extends InternalEntryFactoryImpl {

   @Override
   public InternalCacheEntry create(Object key, Object value, EntryVersion version) {
      return new VersionedImmortalCacheEntry(key, value, version);
   }
View Full Code Here

      return new VersionedImmortalCacheEntry(key, value, version);
   }

   @Override
   public InternalCacheEntry create(Object key, Object value, EntryVersion version, long created, long lifespan, long lastUsed, long maxIdle) {
      if (lifespan < 0 && maxIdle < 0) return new VersionedImmortalCacheEntry(key, value, version);
      if (lifespan > -1 && maxIdle < 0) return new VersionedMortalCacheEntry(key, value, version, lifespan, created);
      if (lifespan < 0 && maxIdle > -1) return new VersionedTransientCacheEntry(key, value, version, maxIdle, lastUsed);
      return new VersionedTransientMortalCacheEntry(key, value, version, maxIdle, lifespan, lastUsed, created);
   }
View Full Code Here

      return new VersionedTransientMortalCacheValue(cacheEntry.getValue(), cacheEntry.getVersion(), -1, lifespan, maxIdle, -1);
   }

   @Override
   public InternalCacheEntry create(Object key, Object value, EntryVersion version, long lifespan, long maxIdle) {
      if (lifespan < 0 && maxIdle < 0) return new VersionedImmortalCacheEntry(key, value, version);
      if (lifespan > -1 && maxIdle < 0) new VersionedMortalCacheEntry(key, value, version, lifespan);
      if (lifespan < 0 && maxIdle > -1) new VersionedTransientCacheEntry(key, value, version, maxIdle);

      return new VersionedTransientMortalCacheEntry(key, value, version, maxIdle, lifespan);
   }
View Full Code Here

            }
         }
      } else if (ice instanceof MortalCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getValue(), version);
            } else {
               return new VersionedTransientCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle);
            }
         } else {
            if (maxIdle < 0) {
               ice.setLifespan(lifespan);
               return ice;
            } else {
               long ctm = System.currentTimeMillis();
               return new VersionedTransientMortalCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle, lifespan, ctm, ctm);
            }
         }
      } else if (ice instanceof TransientCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getVersion(), version);
            } else {
               ice.setMaxIdle(maxIdle);
               return ice;
            }
         } else {
            if (maxIdle < 0) {
               return new VersionedMortalCacheEntry(ice.getKey(), ice.getValue(), version, lifespan);
            } else {
               long ctm = System.currentTimeMillis();
               return new VersionedTransientMortalCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle, lifespan, ctm, ctm);
            }
         }
      } else if (ice instanceof TransientMortalCacheEntry) {
         if (lifespan < 0) {
            if (maxIdle < 0) {
               return new VersionedImmortalCacheEntry(ice.getKey(), ice.getValue(), version);
            } else {
               return new VersionedTransientCacheEntry(ice.getKey(), ice.getValue(), version, maxIdle);
            }
         } else {
            if (maxIdle < 0) {
View Full Code Here

TOP

Related Classes of org.infinispan.container.entries.versioned.VersionedImmortalCacheEntry

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.