BEA Systems, Inc.

com.beasys.commerce.foundation.cache
Interface Cache

All Known Implementing Classes:
CacheImpl

public interface Cache
extends java.util.Map

The main interface for the cache. Provides administrative methods as well as methods to add, lookup, and remove entries from a cache.


Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Method Summary
 void addEntry(java.lang.Object key, java.lang.Object value)
          Deprecated. use put
 void addEntry(java.lang.Object key, java.lang.Object value, long ttl)
          Deprecated. use put
 boolean containsEntry(java.lang.Object key)
          Deprecated. use containsKey
 void disable()
          Enable or disable the whole cache.
 void enable()
           
 java.lang.Object fetchEntry(java.lang.Object key)
          Deprecated. use get
 int getEntryCount()
          Deprecated. use size
 long getHitCount()
           
 int getHitRate()
          Percent of cache calls which hit - a whole number percentage.
 int getMaxEntries()
          Set the max number of items the cache can have.
 long getMissCount()
           
 long getTtl()
           
 boolean isEnabled()
          Is enabled.
 boolean isFull()
          Is full.
 java.lang.Object put(java.lang.Object key, java.lang.Object value, long ttl)
          Put a value into the cache.
 void remove(java.lang.Object[] keys)
          Remove an array of entries.
 void removeAllEntries()
          Deprecated. use clear
 void removeEntry(java.lang.Object key)
          Deprecated. use remove
 void resetStats()
          Reset hitCount and missCount
 void setMaxEntries(int maxEntries)
          Set the max number of items the cache can have.
 void setTtl(long ttlMillis)
          Set a time-to-live for entries in this cache.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

containsEntry

public boolean containsEntry(java.lang.Object key)
Deprecated. use containsKey

Contains entry.
Parameters:
key -  
Returns:
boolean

fetchEntry

public java.lang.Object fetchEntry(java.lang.Object key)
Deprecated. use get

Fetch entry.
Parameters:
key -  
Returns:
Object

addEntry

public void addEntry(java.lang.Object key,
                     java.lang.Object value)
Deprecated. use put

Add entry.
Parameters:
key -  
value -  

addEntry

public void addEntry(java.lang.Object key,
                     java.lang.Object value,
                     long ttl)
Deprecated. use put

Add entry.
Parameters:
key -  
value -  
ttl -  

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value,
                            long ttl)
Put a value into the cache.
Parameters:
key -  
value -  
ttl -  
Returns:
Object

removeEntry

public void removeEntry(java.lang.Object key)
Deprecated. use remove

Remove entry.
Parameters:
key -  

remove

public void remove(java.lang.Object[] keys)
Remove an array of entries.
Parameters:
key -  

isFull

public boolean isFull()
Is full.
Returns:
boolean

isEnabled

public boolean isEnabled()
Is enabled.
Returns:
boolean

setTtl

public void setTtl(long ttlMillis)
Set a time-to-live for entries in this cache.

getTtl

public long getTtl()

disable

public void disable()
Enable or disable the whole cache.

enable

public void enable()

resetStats

public void resetStats()
Reset hitCount and missCount

getHitCount

public long getHitCount()

getMissCount

public long getMissCount()

getHitRate

public int getHitRate()
Percent of cache calls which hit - a whole number percentage.

setMaxEntries

public void setMaxEntries(int maxEntries)
Set the max number of items the cache can have.

getMaxEntries

public int getMaxEntries()
Set the max number of items the cache can have.

getEntryCount

public int getEntryCount()
Deprecated. use size

Get the current number of items the cache has.

removeAllEntries

public void removeAllEntries()
Deprecated. use clear

Flush the whole cache.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved