MemcacheSerialization (Google App Engine API for Java)

Class MemcacheSerialization

  • java.lang.Object

  • public class MemcacheSerialization
    extends java.lang.Object
    Static serialization helpers shared by MemcacheServiceImpl and LocalMemcacheService. This class is thread-safe.
    • Field Detail


        public static final java.lang.String USE_THREAD_CONTEXT_CLASSLOADER_PROPERTY
        See Also:
        Constant Field Values
    • Method Detail

      • deserialize

        public static java.lang.Object deserialize(byte[] value,
                                                   int flags)
                                            throws java.lang.ClassNotFoundException,
        Deserialize the object, according to its flags. This would have private visibility, but is also used by LocalMemcacheService for the increment operation.
        value -
        flags -
        the Object originally stored
        java.lang.ClassNotFoundException - if the object can't be re-instantiated due to being an unlocatable type - if the object can't be re-instantiated for some other reason
      • makePbKey

        public static byte[] makePbKey(java.lang.Object key)
        Converts the user's key Object into a byte[] for the MemcacheGetRequest. Because the underlying service has a length limit, we actually use the SHA1 hash of the serialized object as its key if it's not a basic type. For the basic types (that is, String, Boolean, and the fixed-point numbers), we use a human-readable representation.
        key -
        hash result. For the key null, the hash is also null.
      • serialize

        public static MemcacheSerialization.ValueAndFlags serialize(java.lang.Object value)
        value -
        the ValueAndFlags containing a serialized representation of the Object and the flags to hint deserialization.
        Throws: - for serialization errors, normally due to a non-serializable object type
Оцените, насколько информация на этой странице была вам полезна:

Оставить отзыв о...

Текущей странице
App Engine standard environment for Java 8