public void flush() { LRUCacheEntry entry = null; while ((entry = m_list.m_tail) != null) { ageOut(entry); } }
/** * Demotes from the cache the least used entry. <br> * If the cache is not full, does nothing. * @see #promote */ protected void demote() { if (m_capacity < 1) {throw new IllegalStateException("Can't work with capacity < 1");} if (m_count > m_maxCapacity) {throw new IllegalStateException("Cache list entries number (" + m_count + ") > than the maximum allowed (" + m_maxCapacity + ")");} if (m_count == m_maxCapacity) { LRUCacheEntry entry = m_tail; // the entry will be removed by ageOut ageOut(entry); } else {} // cache is not full, do nothing } /**
protected void ageOut(LRUCachePolicy.LRUCacheEntry entry) { try { CachedPreparedStatement ws = (CachedPreparedStatement) entry.m_object; ws.agedOut(); } catch (SQLException e) { log.debug("Failed closing cached statement", e); } finally { super.ageOut(entry); } }