This method moves the specified entry to the end of the LRU queue.

@param ce The cache entry
509316
public void refreshEntry(com.ibm.wsspi.cache.CacheEntry ce){
		cacheInstance.refreshEntry(ce.cacheEntry);
	}
1174639
protected void flush ()
    {
        if (!_canFlush) {
            return;
        }

        // If we've exceeded our size, remove things until we're back
        // under the required size.
        if (_size > _maxSize) {
            // This works because the entrySet iterator of a LinkedHashMap
            // returns the entries in LRU order
            Iterator<Map.Entry<K,V>> iter = _delegate.entrySet().iterator();
            // don't remove the last entry, even if it's too big, because
            // a cache with nothing in it sucks
            for (int ii = size(); (ii > 1) && (_size > _maxSize); ii--) {
                Map.Entry<K,V> entry = iter.next();
                entryRemoved(entry.getValue());
                iter.remove();
            }
        }
    }
949564
private void cleanup() {
		CacheEntry oldest = null;
		_count = 0;

		// Cleanup obsolete entries and find the oldest
		for (Map.Entry<String, CacheEntry> e : _cache.entrySet()) {
			String key = e.getKey();
			CacheEntry entry = e.getValue();
			// Remove obsolete entry
			if (entry.isExpired()) {
				_cache.remove(key);
			}
			// Count the remaining entry
			else {
				_count++;
				if (oldest == null || oldest.getExpiration() > entry.getExpiration())
					oldest = entry;
			}
		}

		// Remove the oldest if cache size exceeded maximum
		if (_count > _maxSize && oldest != null) {
			_cache.remove(oldest.getKey());
			_count--;
		}
	}
1274117
public void remove(K k) {
        if (cache.containsKey(k)) {
            cache.remove(k);
            locks.remove(k);
        }
    }
1232989
private void cacheEntryInserted(String key, T value)
    {
        InfinispanCacheEntryEvent<T> event =
            new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value));

        T previousValue = this.preEventData.get(key);

        if (previousValue != null) {
            if (previousValue != value) {
                disposeCacheValue(previousValue);
            }

            sendEntryModifiedEvent(event);
        } else {
            sendEntryAddedEvent(event);
        }
    }
893123
public int writeCacheEntry(CacheEntry ce) {

        final String methodName = "writeCacheEntry()";
        int returnCode = NO_EXCEPTION;
        Exception diskException = null;
        this.invalidationBuffer.remove(ce.id);
        byte[] serializedData = null; // retrieve byte array directly (avoid copy)
        int serializedDataLength = -1;
        try {
            ce.skipValueSerialized = true;
            serializedData = SerializationUtility.serialize(ce);
            serializedDataLength = serializedData.length;
        } catch (Exception ex) {
            returnCode = SERIALIZATION_EXCEPTION;
            com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.HTODDynacache.writeCacheEntry", "1174", this);
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName, "cacheName=" + this.cacheName + "\nException: " + ExceptionUtility.getStackTrace(ex));
            return returnCode;
        } finally {
            ce.skipValueSerialized = false;
        }

        try {
            rwLock.writeLock().lock();
            int dataSize = HashtableOnDisk.HTENTRY_OVERHEAD_SIZE + ce.serializedId.length + serializedDataLength + ce.serializedValue.length;
            if (dataSize % 512 != 0) { // size adjustment for 512 blocks
                dataSize = (dataSize / 512 + 1) * 512;
            }
            //if (this.testException) {
            //    throw new FileManagerException("*** Generate filemanager exception");
            //}
            int oldEntrySize = 0; // initialize the oldEntry size to 0
            HashtableEntry htEntry = null;
            if (ce.valueHashcode == 0 && null != ce.value) {
                ce.valueHashcode = ce.value.hashCode();
            }
            if (ce.timeLimit > 0) {
                htEntry = object_cache.put(ce.id, serializedData, serializedDataLength, ce.expirationTime, ce.validatorExpirationTime, ce.serializedId, ce.serializedValue,
                                           ce.valueHashcode, !HashtableOnDisk.ALIAS_ID); // LI4337-17  // put into HTOD
            } else {
                htEntry = object_cache.put(ce.id, serializedData, serializedDataLength, -1, ce.validatorExpirationTime, ce.serializedId, ce.serializedValue, ce.valueHashcode,
                                           !HashtableOnDisk.ALIAS_ID); // LI4337-17  // put into HTOD
            }
            //delete old entry from eviction table or insert into eviction table only if eviction policy is set
            if (this.cod.evictionPolicy != CacheConfig.EVICTION_NONE) {
                boolean bInsertEntry = true;
                if (htEntry != null) {
                    // check whether EvictionTable's attributes match or not
                    if ((ce.getId()).hashCode() == (htEntry.getKey()).hashCode() &&
                        ce.expirationTime == htEntry.expirationTime() &&
                        dataSize == htEntry.size()) {
                        // old entry exists and eviction's attributes match
                        // skip inserting the entry into EvictionTable because it already exists in EvictionTable
                        bInsertEntry = false;
                    } else {
                        // old entry exists but eviction's attributes do not match 
                        // then delete the entry from EvictionTable
                        synchronized (evictionTableMonitor) {
                            long expTime = htEntry.expirationTime();
                            if (expTime <= 0)
                                expTime = Long.MAX_VALUE;
                            EvictionTableEntry evt = EvictionTable.findAndRemove(expTime, (htEntry.getKey()).hashCode(), htEntry.size());
                            if (evt != null) {
                                if (tc.isDebugEnabled())
                                    Tr.debug(tc, "writeCacheEntry()", " **deleting** id=" + ce.id + " hc=" + evt.hashcode + " expirationTime=" + evt.expirationTime + " size="
                                                                      + evt.size);
                                evictionEntryPool.add(evt); // return evt to the pool
                            }
                        }
                    }
                }
                // if bInsertEntry boolean is true, insert the entry into EvictionTable. Else skip inserting.
                if (bInsertEntry == true) {
                    EvictionTableEntry evt = (EvictionTableEntry) evictionEntryPool.remove();
                    evt.hashcode = (ce.getId()).hashCode();
                    evt.expirationTime = ce.expirationTime;
                    if (evt.expirationTime <= 0)
                        evt.expirationTime = Long.MAX_VALUE;
                    evt.size = dataSize;
                    evt.id = ce.id; // use it for debug
                    synchronized (evictionTableMonitor) {
                        EvictionTable.insert(evt);
                    }
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "WriteCacheEntry()", "**adding** id=" + ce.id + " hc=" + evt.hashcode + " expirationTime=" + evt.expirationTime + " size=" + evt.size);
                }
            }
            // if htEntry is not null, it means the entry is overwritten
            if (htEntry != null) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName, "cacheName=" + this.cacheName + " overwritten with id=" + ce.id);
                returnCode = NO_EXCEPTION_ENTRY_OVERWRITTEN;
                oldEntrySize = htEntry.size();
                returnToHashtableEntryPool(htEntry);
            }
            if (this.cod.enableCacheSizeInBytes) {
                this.cod.currentCacheSizeInBytes = this.cod.currentCacheSizeInBytes + dataSize - oldEntrySize;
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "WriteCacheEntry()", "**** id=" + ce.id + " size=" + dataSize + " currentCacheSizeInBytes" + this.cod.currentCacheSizeInBytes + " overhead="
                                                      + HashtableOnDisk.HTENTRY_OVERHEAD_SIZE + " idSize=" + ce.serializedId.length + " ceSize=" + serializedDataLength
                                                      + " valueSize=" + ce.serializedValue.length);
            }
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName, "cacheName=" + this.cacheName + " cacheSizeInBytes" + this.cod.currentCacheSizeInBytes + " newSize=" + dataSize + " oldSize="
                                         + oldEntrySize + " id=" + ce.id + " enable=" + this.cod.enableCacheSizeInBytes);
            this.cache.getCacheStatisticsListener().writeEntryToDisk(ce.id, dataSize);
            for (int i = 0; i < ce.aliasList.length; i++) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName, "cacheName=" + this.cacheName + " adding alias with id=" + ce.id + " alias=" + ce.aliasList[i]);
                // alias id has no expiration time
                object_cache.put(ce.aliasList[i], ce.getIdObject(), -1, -1, -1, null, null, 0, HashtableOnDisk.ALIAS_ID);
                this.invalidationBuffer.remove(ce.aliasList[i], HTODInvalidationBuffer.EXPLICIT_BUFFER);
            }
        } catch (FileManagerException ex) {
            this.diskCacheException = ex;
            diskException = ex;
            returnCode = DISK_EXCEPTION;
        } catch (HashtableOnDiskException ex) {
            this.diskCacheException = ex;
            diskException = ex;
            returnCode = DISK_EXCEPTION;
        } catch (IOException ex) {
            diskException = ex;
            if (ex.getMessage().equals(DISK_CACHE_IN_GB_OVER_LIMIT_MSG)) {
                returnCode = DISK_SIZE_OVER_LIMIT_EXCEPTION;
            } else {
                this.diskCacheException = ex;
                returnCode = DISK_EXCEPTION;
            }
        } catch (Exception ex) {
            returnCode = OTHER_EXCEPTION;
            diskException = ex;
        } finally {
            rwLock.writeLock().unlock();
            if (returnCode != NO_EXCEPTION && returnCode != NO_EXCEPTION_ENTRY_OVERWRITTEN) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName, "cacheName=" + this.cacheName + "\n Exception: " + ExceptionUtility.getStackTrace(diskException));
            }
            if (returnCode == DISK_EXCEPTION || returnCode == OTHER_EXCEPTION) {
                com.ibm.ws.ffdc.FFDCFilter.processException(diskException, "com.ibm.ws.cache.HTODDynacache.writeCacheEntry", "1239", this);
            }
        }

        return returnCode;
    }
1306779
private void cacheEntryRemoved(String key, T value)
    {
        InfinispanCacheEntryEvent<T> event =
            new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value));

        sendEntryRemovedEvent(event);
    }
626007
private void putEntry(String key, CacheHeader entry) {
        if (!mEntries.containsKey(key)) {
            mTotalSize += entry.size;
        } else {
            CacheHeader oldEntry = mEntries.get(key);
            mTotalSize += (entry.size - oldEntry.size);
        }
        mEntries.put(key, entry);
    }
1186171
public static void endRequest() {
        final List<RequestScopedItem> result = CACHE.get();
        if (result != null) {
            CACHE.remove();
            for (final RequestScopedItem item : result) {
                item.invalidate();
            }
        }
    }
943570
private void releaseCloseLock()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "releaseCloseLock");
      closeLock.readLock().unlock();
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "releaseCloseLock");
   }
289397
private void removeEntry(EntryImpl<K, V> entry) {

    // Removes from bucket.
    EntryImpl<K, V> previous = entry._previous;
    EntryImpl<K, V> next = entry._next;
    if (previous != null) {
      previous._next = next;
      entry._previous = null;
    } else { // First in bucket.
      _entries[entry._index] = next;
    }
    if (next != null) {
      next._previous = previous;
      entry._next = null;
    } // Else do nothing, no last pointer.

    // Removes from collection.
    EntryImpl<K, V> before = entry._before;
    EntryImpl<K, V> after = entry._after;
    if (before != null) {
      before._after = after;
      entry._before = null;
    } else { // First in collection.
      _mapFirst = after;
    }
    if (after != null) {
      after._before = before;
    } else { // Last in collection.
      _mapLast = before;
    }

    // Clears value and key.
    entry._key = null;
    entry._value = null;

    // Recycles.
    entry._after = _poolFirst;
    _poolFirst = entry;

    // Updates size.
    _size--;
    sizeChanged();
  }
1136574
public void releaseExceptionallyAndReset(Throwable e) {
        ArrayList<CompletableFuture<T>> toComplete = null;
        synchronized (lock) {
            if (!waitingFutures.isEmpty()) {
                toComplete = new ArrayList<>(waitingFutures);
                waitingFutures.clear();
            }
            released = false;
            this.e = null;
            result = null;
            runningThreadId = null;
        }
        if (toComplete != null) {
            for (CompletableFuture<T> f : toComplete) {
                f.completeExceptionally(e);
            }
        }
    }
24916
public void purge(String cacheKey) {
        try {
            if (useMemoryCache) {
                if (memoryCache != null) {
                    memoryCache.remove(cacheKey);
                }
            }

            if (useDiskCache) {
                if (diskLruCache != null) {
                    diskLruCache.remove(cacheKey);
                }
            }
        } catch (Exception e) {
            Log.w(TAG, "Could not remove entry in cache purge", e);
        }
    }
835429
@Override
    public void end() {
        final EntityManager em = entityManager.get();

        // Let's not penalize users for calling end() multiple times.
        if (null == em) {
          return;
        }

        final EntityTransaction tx = em.getTransaction();

        if(tx.isActive()) {
            LOG.warn("There was an active transaction at the end of a request");
            tx.commit();
        }

        em.close();
        entityManager.remove();
    }
635952
public void finishAppending()
  {
    checkStateTransition(this.state, SegmentState.APPENDING, SegmentState.APPEND_FINISHED);
    this.state = SegmentState.APPEND_FINISHED;
  }
575139
private void deallocate(HashtableEntry entry)
                    throws IOException,
                    EOFException,
                    FileManagerException,
                    ClassNotFoundException,
                    HashtableOnDiskException {
        if (entry.location == 0) {
            throw (new HashtableOnDiskException("deallocate:  space not allocated."));
        }

        filemgr.deallocate(entry.location);
        entry.location = 0;
    }
449651
public void endElement(String namespaceURI, String localName, String qName)
        throws SAXException
    {
        if (m_firstTagNotEmitted)
        {
            flush();
            if (namespaceURI == null && m_firstElementURI != null)
                namespaceURI = m_firstElementURI;


            if (localName == null && m_firstElementLocalName != null)
                localName = m_firstElementLocalName;
        }
        
        m_handler.endElement(namespaceURI, localName, qName);
    }