Package org.infinispan.container.entries

Examples of org.infinispan.container.entries.InternalCacheEntry


      buttonSearch.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          String key = keytext.getText();
          String value = delegate.getGenericCache().get(key);
          InternalCacheEntry cacheEntry = delegate.getGenericCache().getAdvancedCache().getDataContainer().get(key);
          if(value != null) {
            if(null != cacheEntry){
              entity = new CacheEntry(key, value, cacheEntry.getLifespan() + "", cacheEntry.getMaxIdle() + "", "");
            } else {
              entity = new CacheEntry(key, value, "", "", "");
            }
          }
          shell.dispose();
View Full Code Here


 
  private void handleSearch(String pointer) {

    String key = readString("Enter Key:", "key", true);
    String value = delegate.getGenericCache().get(key);
    InternalCacheEntry cacheEntry = delegate.getGenericCache().getAdvancedCache().getDataContainer().get(key);
    println("Search Result:");
    if(value != null) {
      CacheEntry entity = null;
      if(null != cacheEntry) {
        entity = new CacheEntry(key, value, cacheEntry.getLifespan() + "", cacheEntry.getMaxIdle() + "", "");
      } else {
        entity = new CacheEntry(key, value, "", "", "");
      }
      prompt(entity);
    } else {
View Full Code Here

      }

      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
         if (data.size() > rowIndex) {
            InternalCacheEntry e = data.get(rowIndex);
            switch (columnIndex) {
               case 0:
                  return e.getKey();
               case 1:
                  return e.getValue();
               case 2:
                  return e.getLifespan();
               case 3:
                  return e.getMaxIdle();
            }
         }
         return "NULL!";
      }
View Full Code Here

               Set<Object> storedKeys = cacheStore.loadAllKeys(new ReadOnlyDataContainerBackedKeySet(dataContainer));
               for (Object key : storedKeys) {
                  int segmentId = readCh.getSegment(key);
                  if (segments.contains(segmentId)) {
                     try {
                        InternalCacheEntry ice = cacheStore.load(key);
                        if (ice != null) { // check entry still exists
                           sendEntry(ice, segmentId);
                        }
                     } catch (CacheLoaderException e) {
                        log.failedLoadingValueFromCacheStore(key, e);
View Full Code Here

    */
   private Object remoteGetAndStoreInL1(InvocationContext ctx, Object key) throws Throwable {
      if (ctx.isOriginLocal() && !dm.isLocal(key) && isNotInL1(key)) {
         if (trace) log.trace("Doing a remote get for key {0}", key);
         // attempt a remote lookup
         InternalCacheEntry ice = dm.retrieveFromRemoteSource(key);

         if (ice != null) {
            if (isL1CacheEnabled) {
               if (trace) log.trace("Caching remotely retrieved entry for key {0} in L1", key);
               long lifespan = ice.getLifespan() < 0 ? configuration.getL1Lifespan() : Math.min(ice.getLifespan(), configuration.getL1Lifespan());
               PutKeyValueCommand put = cf.buildPutKeyValueCommand(ice.getKey(), ice.getValue(), lifespan, -1);
               invokeNextInterceptor(ctx, put);
            } else {
               if (trace) log.trace("Not caching remotely retrieved entry for key {0} in L1", key);
            }
            return ice.getValue();
         }

      } else {
         if (trace)
            log.trace("Not doing a remote get for key {0} since entry is mapped to current node, or is in L1", key);
View Full Code Here

      }
   }

   @Override
   public InternalCacheEntry load(Object key) throws CacheLoaderException {
      InternalCacheEntry se = null;
      loadersAndStoresMutex.readLock().lock();
      try {
         for (CacheLoader l : loaders.keySet()) {
            se = l.load(key);
            if (se != null) break;
View Full Code Here

    * @param context invocation context, ignored.
    * @return returns an <code>CacheEntry</code> or null, if no entry is found.
    */
   public CacheEntry perform(InvocationContext context) throws Throwable {
      if (key != null) {
         InternalCacheEntry cacheEntry = dataContainer.get(key);
         if (trace) log.trace("Found InternalCacheEntry {0} for key {1}", cacheEntry, key);
         if (cacheEntry == null) {
            if (trace) log.trace("Checking in cache loader");
            // hack -> the call is here to make sure that the current thread is associated with
            // the remote InvocationCOntext in order to make sure that ClusterCL won't trigger a recurring cluster get
View Full Code Here

      verifyFullTextHasMatches(1);

      cache.evict("IT");
      assert store.contains("IT");

      InternalCacheEntry internalCacheEntry = cache.getAdvancedCache().getDataContainer().get("IT");
      assert internalCacheEntry==null;

      verifyFullTextHasMatches(1);

      Country country = cache.get("IT");
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<Object, Object> cache) throws Exception {
      DataContainer dc = cache.getAdvancedCache().getDataContainer();
      Set<Object> keys = dc.keySet();
      InternalCacheEntry entry;
      for (Object k : keys) if ((entry = dc.get(k)) != null) store(entry);
   }
View Full Code Here

         switch (mod.getType()) {
            case REMOVE:
            case CLEAR:
               return null;
            case STORE:
               InternalCacheEntry ice = ((Store) mod).getStoredEntry();
               if (ice.isExpired(timeService.wallClockTime()))
                  return null;
               return ice;
         }
      }
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.