Interface MemcachedCacheEntryFactory
- All Known Implementing Classes:
MemcachedCacheEntryFactoryImpl
public interface MemcachedCacheEntryFactory
Creates
MemcachedCacheEntry instances that can be used for
serializing and deserializing HttpCacheEntry instances for
storage in memcached.-
Method Summary
Modifier and TypeMethodDescriptiongetMemcachedCacheEntry(String storageKey, HttpCacheEntry entry) Creates a newMemcachedCacheEntryfor storing the givenHttpCacheEntryunder the given storage key.Creates an "unset"MemcachedCacheEntryready to accept a serialized representation viaMemcachedCacheEntry.set(byte[])and deserialize it into a storage key and aHttpCacheEntry.
-
Method Details
-
getMemcachedCacheEntry
Creates a newMemcachedCacheEntryfor storing the givenHttpCacheEntryunder the given storage key. Since we are hashing storage keys into cache keys to accommodate limitations in memcached's key space, it is possible to have cache collisions. Therefore, we store the storage key along with theHttpCacheEntryso it can be compared on retrieval and thus detect collisions.- Parameters:
storageKey- storage key under which the entry will be logically storedentry- the cache entry to store- Returns:
- a
MemcachedCacheEntryready to provide a serialized representation
-
getUnsetCacheEntry
MemcachedCacheEntry getUnsetCacheEntry()Creates an "unset"MemcachedCacheEntryready to accept a serialized representation viaMemcachedCacheEntry.set(byte[])and deserialize it into a storage key and aHttpCacheEntry.- Returns:
MemcachedCacheEntry
-