Class MemcachedCacheEntryFactoryImpl
java.lang.Object
org.apache.http.impl.client.cache.memcached.MemcachedCacheEntryFactoryImpl
- All Implemented Interfaces:
MemcachedCacheEntryFactory
Default implementation of
MemcachedCacheEntryFactory
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMemcachedCacheEntry
(String key, HttpCacheEntry entry) Creates a newMemcachedCacheEntry
for storing the givenHttpCacheEntry
under the given storage key.Creates an "unset"MemcachedCacheEntry
ready to accept a serialized representation viaMemcachedCacheEntry.set(byte[])
and deserialize it into a storage key and aHttpCacheEntry
.
-
Constructor Details
-
MemcachedCacheEntryFactoryImpl
public MemcachedCacheEntryFactoryImpl()
-
-
Method Details
-
getMemcachedCacheEntry
Description copied from interface:MemcachedCacheEntryFactory
Creates a newMemcachedCacheEntry
for storing the givenHttpCacheEntry
under 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 theHttpCacheEntry
so it can be compared on retrieval and thus detect collisions.- Specified by:
getMemcachedCacheEntry
in interfaceMemcachedCacheEntryFactory
- Parameters:
key
- storage key under which the entry will be logically storedentry
- the cache entry to store- Returns:
- a
MemcachedCacheEntry
ready to provide a serialized representation
-
getUnsetCacheEntry
Description copied from interface:MemcachedCacheEntryFactory
Creates an "unset"MemcachedCacheEntry
ready to accept a serialized representation viaMemcachedCacheEntry.set(byte[])
and deserialize it into a storage key and aHttpCacheEntry
.- Specified by:
getUnsetCacheEntry
in interfaceMemcachedCacheEntryFactory
- Returns:
MemcachedCacheEntry
-