Class MemcachedCacheEntryImpl
java.lang.Object
org.apache.http.impl.client.cache.memcached.MemcachedCacheEntryImpl
- All Implemented Interfaces:
MemcachedCacheEntry
Default implementation of
MemcachedCacheEntry. This implementation
simply uses Java serialization to serialize the storage key followed by
the HttpCacheEntry into a byte array.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theHttpCacheEntryassociated with this entry.Returns the storage key associated with this entry.voidset(byte[] bytes) Given a serialized representation of aMemcachedCacheEntry, attempt to reconstitute the storage key andHttpCacheEntryrepresented therein.byte[]Returns a serialized representation of the current cache entry.
-
Constructor Details
-
MemcachedCacheEntryImpl
-
MemcachedCacheEntryImpl
public MemcachedCacheEntryImpl()
-
-
Method Details
-
toByteArray
public byte[] toByteArray()Description copied from interface:MemcachedCacheEntryReturns a serialized representation of the current cache entry.- Specified by:
toByteArrayin interfaceMemcachedCacheEntry
-
getStorageKey
Description copied from interface:MemcachedCacheEntryReturns the storage key associated with this entry. May returnnullif this is an "unset" instance waiting to beMemcachedCacheEntry.set(byte[])with a serialized representation.- Specified by:
getStorageKeyin interfaceMemcachedCacheEntry
-
getHttpCacheEntry
Description copied from interface:MemcachedCacheEntryReturns theHttpCacheEntryassociated with this entry. May returnnullif this is an "unset" instance waiting to beMemcachedCacheEntry.set(byte[])with a serialized representation.- Specified by:
getHttpCacheEntryin interfaceMemcachedCacheEntry
-
set
public void set(byte[] bytes) Description copied from interface:MemcachedCacheEntryGiven a serialized representation of aMemcachedCacheEntry, attempt to reconstitute the storage key andHttpCacheEntryrepresented therein. After a successful call to this method, this object should return updated (as appropriate) values forMemcachedCacheEntry.getStorageKey()andMemcachedCacheEntry.getHttpCacheEntry(). This should be viewed as an atomic operation on theMemcachedCacheEntry.- Specified by:
setin interfaceMemcachedCacheEntry- Parameters:
bytes- serialized representation
-