Located in compilation unit of sun.
| Modifier and Type | Class and Description |
|---|---|
| private static interface | |
| private static class | |
| private static class | MemoryCache.
This CacheEntry<k,v> type allows multiple V entries to be stored in one key in the cacheMap. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private static final boolean | |
| private long | |
| private final int | |
| private int | |
| private long | |
| private final ReferenceQueue |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | accept(Cache.
Implements abstract sun. accept a visitor |
| public synchronized void | |
| private void | |
| private void | |
| public synchronized V | |
| private Map | |
| protected MemoryCache. | |
| public synchronized V | |
| public void | |
| public synchronized void | put(K
key to the cacheMap key, V value to be stored value, boolean can the value be put into a QueueCacheEntry canQueue)Overrides sun. This puts an entry into the cacheMap. |
| public synchronized void | remove(Object key)
Implements abstract sun. Remove an entry from the cache. |
| private void | |
| public synchronized void | |
| public synchronized void | setTimeout(int timeout)
Implements abstract sun. Set the timeout(in seconds). |
| public synchronized int | size()
Implements abstract sun. Return the number of currently valid entries in the cache. |
| cacheMap | back to summary |
|---|---|
| private final Map<K, MemoryCache. | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| lifetime | back to summary |
|---|---|
| private long lifetime | |
| maxQueueSize | back to summary |
|---|---|
| private final int maxQueueSize | |
| maxSize | back to summary |
|---|---|
| private int maxSize | |
| nextExpirationTime | back to summary |
|---|---|
| private long nextExpirationTime | |
| queue | back to summary |
|---|---|
| private final ReferenceQueue<V> queue | |
| MemoryCache | back to summary |
|---|---|
| public MemoryCache(boolean soft, int maxSize) | |
| MemoryCache | back to summary |
|---|---|
| public MemoryCache(boolean soft, int maxSize, int lifetime) | |
| MemoryCache | back to summary |
|---|---|
| public MemoryCache(boolean soft, int maxSize, int lifetime, int qSize) | |
| accept | back to summary |
|---|---|
| public synchronized void accept(Cache. Implements abstract sun. Doc from sun. accept a visitor | |
| clear | back to summary |
|---|---|
| public synchronized void clear() Implements abstract sun. Doc from sun. Remove all entries from the cache. | |
| emptyQueue | back to summary |
|---|---|
| private void emptyQueue() Empty the reference queue and remove all corresponding entries from the cache. This method should be called at the beginning of each public method. | |
| expungeExpiredEntries | back to summary |
|---|---|
| private void expungeExpiredEntries() Scan all entries and remove all expired ones. | |
| get | back to summary |
|---|---|
| public synchronized V get(Object key) Implements abstract sun. Doc from sun. Get a value from the cache. | |
| getCachedEntries | back to summary |
|---|---|
| private Map | |
| newEntry | back to summary |
|---|---|
| protected MemoryCache. | |
| pull | back to summary |
|---|---|
| public synchronized V pull(Object key) Implements abstract sun. Doc from sun. Pull an entry from the cache. | |
| put | back to summary |
|---|---|
| public void put(K key, V value) Implements abstract sun. Doc from sun. Add an entry to the cache. | |
| put | back to summary |
|---|---|
| public synchronized void put(K key, V value, boolean canQueue) Overrides sun. This puts an entry into the cacheMap. If canQueue is true, V will be added using a QueueCacheEntry which is added to cacheMap. If false, V is added to the cacheMap directly. The caller must keep a consistent canQueue value, mixing them can result in a queue being replaced with a single entry. This method is synchronized to avoid multiple QueueCacheEntry overwriting the same key.
| |
| remove | back to summary |
|---|---|
| public synchronized void remove(Object key) Implements abstract sun. Doc from sun. Remove an entry from the cache. | |
| removeImpl | back to summary |
|---|---|
| private void removeImpl(Object key) | |
| setCapacity | back to summary |
|---|---|
| public synchronized void setCapacity(int size) Implements abstract sun. Doc from sun. Set the maximum size. | |
| setTimeout | back to summary |
|---|---|
| public synchronized void setTimeout(int timeout) Implements abstract sun. Doc from sun. Set the timeout(in seconds). | |
| size | back to summary |
|---|---|
| public synchronized int size() Implements abstract sun. Doc from sun. Return the number of currently valid entries in the cache. | |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public K | |
| public V | |
| public void | |
| public boolean |
| getExpirationTime | back to summary |
|---|---|
| public long getExpirationTime() | |
| getKey | back to summary |
|---|---|
| public K getKey() | |
| getValue | back to summary |
|---|---|
| public V getValue() | |
| invalidate | back to summary |
|---|---|
| public void invalidate() | |
| isValid | back to summary |
|---|---|
| public boolean isValid(long currentTime) | |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private K | |
| private V |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public K | |
| public V | |
| public void | |
| public boolean |
| expirationTime | back to summary |
|---|---|
| private long expirationTime | |
| key | back to summary |
|---|---|
| private K key | |
| value | back to summary |
|---|---|
| private V value | |
| HardCacheEntry | back to summary |
|---|---|
| pack-priv HardCacheEntry(K key, V value, long expirationTime) | |
| getExpirationTime | back to summary |
|---|---|
| public long getExpirationTime() Implements sun. | |
| getKey | back to summary |
|---|---|
| public K getKey() Implements sun. | |
| getValue | back to summary |
|---|---|
| public V getValue() Implements sun. | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements sun. | |
| isValid | back to summary |
|---|---|
| public boolean isValid(long currentTime) Implements sun. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean | |
| private long | |
| private K | |
| private final int | |
| pack-priv final Queue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public long | |
| public K | |
| public Queue | |
| public V | |
| public V | |
| public void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void |
| DEBUG | back to summary |
|---|---|
| pack-priv final boolean DEBUG | |
| expirationTime | back to summary |
|---|---|
| private long expirationTime | |
| key | back to summary |
|---|---|
| private K key | |
| MAXQUEUESIZE | back to summary |
|---|---|
| private final int MAXQUEUESIZE | |
| queue | back to summary |
|---|---|
| pack-priv final Queue<MemoryCache. | |
| QueueCacheEntry | back to summary |
|---|---|
| pack-priv QueueCacheEntry(K key, MemoryCache. | |
| clear | back to summary |
|---|---|
| public void clear() | |
| getExpirationTime | back to summary |
|---|---|
| public long getExpirationTime() Implements sun. | |
| getKey | back to summary |
|---|---|
| public K getKey() Implements sun. | |
| getQueue | back to summary |
|---|---|
| public Queue | |
| getValue | back to summary |
|---|---|
| public V getValue() Implements sun. | |
| getValue | back to summary |
|---|---|
| public V getValue(long lifetime) | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements sun. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| isValid | back to summary |
|---|---|
| public boolean isValid(long currentTime) Implements sun. | |
| isValid | back to summary |
|---|---|
| public boolean isValid() | |
| putValue | back to summary |
|---|---|
| public void putValue(MemoryCache. | |
| setExpirationTime | back to summary |
|---|---|
| public void setExpirationTime(long time) | |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private K |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public K | |
| public V | |
| public void | |
| public boolean | |
| public String |
| expirationTime | back to summary |
|---|---|
| private long expirationTime | |
| key | back to summary |
|---|---|
| private K key | |
| SoftCacheEntry | back to summary |
|---|---|
| pack-priv SoftCacheEntry(K key, V value, long expirationTime, ReferenceQueue<V> queue) | |
| getExpirationTime | back to summary |
|---|---|
| public long getExpirationTime() Implements sun. | |
| getKey | back to summary |
|---|---|
| public K getKey() Implements sun. | |
| getValue | back to summary |
|---|---|
| public V getValue() Implements sun. | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements sun. | |
| isValid | back to summary |
|---|---|
| public boolean isValid(long currentTime) Implements sun. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |