src.gov.nasa.worldwind.cache.BasicSessionCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of worldwindx Show documentation
Show all versions of worldwindx Show documentation
World Wind is a collection of components that interactively display 3D geographic information within Java applications or applets.
/*
* Copyright (C) 2012 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/
package gov.nasa.worldwind.cache;
import gov.nasa.worldwind.util.*;
/**
* BasicSessionCache is a general receiving area for data represented as key-value pairs. Entries in a BasicSessionCache
* may persist for the length of a Virtual Machine's run time, but may be evicted if the cache size increases beyond its
* capacity.
*
* Eviction of BasicSessionCache entries is accomplished by controlling the maximum number of entries in the cache. This
* maximum value is set by calling {@link #setCapacity(int)}. The eldest entry in the cache (the first entry added) is
* always evicted before any others.
*
* BasicSessionClass is a thread safe class. Access to the cache data structures is synchronized at the method level.
* Care must be taken by subclasses to ensure that method level synchronization is maintained.
*
* @author dcollins
* @version $Id: BasicSessionCache.java 1171 2013-02-11 21:45:02Z dcollins $
*/
public class BasicSessionCache implements SessionCache
{
protected static final int DEFAULT_CAPACITY = 8;
protected BoundedHashMap