Package net.spy.memcached.transcoders
Class SerializingTranscoder
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.transcoders.BaseSerializingTranscoder
-
- net.spy.memcached.transcoders.SerializingTranscoder
-
- All Implemented Interfaces:
Transcoder<java.lang.Object>
public class SerializingTranscoder extends BaseSerializingTranscoder implements Transcoder<java.lang.Object>
Transcoder that serializes and compresses objects.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
COMPRESSED
(package private) static int
SERIALIZED
(package private) static int
SPECIAL_BOOLEAN
(package private) static int
SPECIAL_BYTE
(package private) static int
SPECIAL_BYTEARRAY
(package private) static int
SPECIAL_DATE
(package private) static int
SPECIAL_DOUBLE
(package private) static int
SPECIAL_FLOAT
(package private) static int
SPECIAL_INT
(package private) static int
SPECIAL_LONG
private static int
SPECIAL_MASK
private TranscoderUtils
tu
-
Fields inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
charset, compressionThreshold, DEFAULT_COMPRESSION_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
asyncDecode(CachedData d)
Should the transcoder be run asyncronously.java.lang.Object
decode(CachedData d)
Decode the cached object into the object it represents.CachedData
encode(java.lang.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.spy.memcached.transcoders.Transcoder
getMaxSize
-
-
-
-
Field Detail
-
SERIALIZED
static final int SERIALIZED
- See Also:
- Constant Field Values
-
COMPRESSED
static final int COMPRESSED
- See Also:
- Constant Field Values
-
SPECIAL_MASK
private static final int SPECIAL_MASK
- See Also:
- Constant Field Values
-
SPECIAL_BOOLEAN
static final int SPECIAL_BOOLEAN
- See Also:
- Constant Field Values
-
SPECIAL_INT
static final int SPECIAL_INT
- See Also:
- Constant Field Values
-
SPECIAL_LONG
static final int SPECIAL_LONG
- See Also:
- Constant Field Values
-
SPECIAL_DATE
static final int SPECIAL_DATE
- See Also:
- Constant Field Values
-
SPECIAL_BYTE
static final int SPECIAL_BYTE
- See Also:
- Constant Field Values
-
SPECIAL_FLOAT
static final int SPECIAL_FLOAT
- See Also:
- Constant Field Values
-
SPECIAL_DOUBLE
static final int SPECIAL_DOUBLE
- See Also:
- Constant Field Values
-
SPECIAL_BYTEARRAY
static final int SPECIAL_BYTEARRAY
- See Also:
- Constant Field Values
-
tu
private final TranscoderUtils tu
-
-
Method Detail
-
asyncDecode
public boolean asyncDecode(CachedData d)
Description copied from interface:Transcoder
Should the transcoder be run asyncronously.- Specified by:
asyncDecode
in interfaceTranscoder<java.lang.Object>
- Overrides:
asyncDecode
in classBaseSerializingTranscoder
- Returns:
- True if the CachedData should be decoded Asyncronously
-
decode
public java.lang.Object decode(CachedData d)
Description copied from interface:Transcoder
Decode the cached object into the object it represents.- Specified by:
decode
in interfaceTranscoder<java.lang.Object>
- Parameters:
d
- the data- Returns:
- the return value
-
encode
public CachedData encode(java.lang.Object o)
Description copied from interface:Transcoder
Encode the given object for storage.- Specified by:
encode
in interfaceTranscoder<java.lang.Object>
- Parameters:
o
- the object- Returns:
- the CachedData representing what should be sent
-
-