net.spy.memcached.transcoders
Class SerializingTranscoder

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by net.spy.memcached.transcoders.BaseSerializingTranscoder
          extended by net.spy.memcached.transcoders.SerializingTranscoder
All Implemented Interfaces:
Transcoder<Object>

public class SerializingTranscoder
extends BaseSerializingTranscoder
implements Transcoder<Object>

Transcoder that serializes and compresses objects.


Field Summary
 
Fields inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
charset, compressionThreshold, DEFAULT_COMPRESSION_THRESHOLD
 
Constructor Summary
SerializingTranscoder()
          Get a serializing transcoder with the default max data size.
SerializingTranscoder(int max)
          Get a serializing transcoder that specifies the max data size.
 
Method Summary
 boolean asyncDecode(CachedData d)
          Should the transcoder be run asyncronously.
 Object decode(CachedData d)
          Decode the cached object into the object it represents.
 CachedData encode(Object o)
          Encode the given object for storage.
 
Methods inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
compress, decodeString, decompress, deserialize, encodeString, getMaxSize, serialize, setCharset, setCompressionThreshold
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.spy.memcached.transcoders.Transcoder
getMaxSize
 

Constructor Detail

SerializingTranscoder

public SerializingTranscoder()
Get a serializing transcoder with the default max data size.


SerializingTranscoder

public SerializingTranscoder(int max)
Get a serializing transcoder that specifies the max data size.

Method Detail

asyncDecode

public boolean asyncDecode(CachedData d)
Description copied from interface: Transcoder
Should the transcoder be run asyncronously.

Specified by:
asyncDecode in interface Transcoder<Object>
Overrides:
asyncDecode in class BaseSerializingTranscoder
Returns:
True if the CachedData should be decoded Asyncronously

decode

public Object decode(CachedData d)
Description copied from interface: Transcoder
Decode the cached object into the object it represents.

Specified by:
decode in interface Transcoder<Object>
Parameters:
d - the data
Returns:
the return value

encode

public CachedData encode(Object o)
Description copied from interface: Transcoder
Encode the given object for storage.

Specified by:
encode in interface Transcoder<Object>
Parameters:
o - the object
Returns:
the CachedData representing what should be sent