com.thimbleware.jmemcached
Interface CacheStorage

All Known Implementing Classes:
LRUCacheStorageDelegate

public interface CacheStorage

Interface for a cache usable by the daemon. Read and write operations need not be thread safe as the caller (ServerSessionHandler) establishes its own locks.


Method Summary
 long count()
           
 void flushAll()
          Flush all entries from the cache
 MCElement get(java.lang.String keystring)
          Retrieve an element from the cache.
 java.util.Set<java.lang.String> keys()
           
 long maxSize()
           
 void put(java.lang.String keystring, MCElement el)
          Put an entry into the cache or replace an existing entry.
 void remove(java.lang.String keystring)
          Remove an entry from the cache
 long size()
           
 

Method Detail

get

MCElement get(java.lang.String keystring)
Retrieve an element from the cache. The retriever is responsible for counting hits, managing expirations, etc.

Parameters:
keystring - the key identifying the entry
Returns:
a cache element

put

void put(java.lang.String keystring,
         MCElement el)
Put an entry into the cache or replace an existing entry.

Parameters:
keystring - the key identifying the entry
el - the element to place in the cache

remove

void remove(java.lang.String keystring)
Remove an entry from the cache

Parameters:
keystring - the key to lookup

keys

java.util.Set<java.lang.String> keys()
Returns:
the list of keys currently managed in the cache

flushAll

void flushAll()
Flush all entries from the cache


size

long size()
Returns:
the total count (in bytes) of all the elements in the cache

maxSize

long maxSize()
Returns:
the maximum capacity (in bytes) of the cache

count

long count()
Returns:
how many entries are in the cache


Copyright © 2008. All Rights Reserved.