类 GenericProtobufSerialization

  • 所有已实现的接口:
    Serialization

    public class GenericProtobufSerialization
    extends Object
    implements Serialization

    Currently, the Dubbo protocol / framework data, such as attachments, event data, etc., depends on business layer serialization protocol to do serialization before transmitted. That's a problem when using Protobuf as business serialization protocol, because Protobuf does not support raw java Object types, to solve it, we can use one of the following methods:

    • 1. Package these data with Protobuf so that they can be serialized.
    • 2. Separate the serialization of Dubbo protocol/framework and the service args (easy to cross-platform, cross-language serialization) to avoid the binding of this part and serialization protocol.

    • 构造器详细资料

      • GenericProtobufSerialization

        public GenericProtobufSerialization()
    • 方法详细资料

      • getContentTypeId

        public byte getContentTypeId()
        从接口复制的说明: Serialization
        Get content type unique id, recommended that custom implementations use values different with any value of Constants and don't greater than ExchangeCodec.SERIALIZATION_MASK (31) because dubbo protocol use 5 bits to record serialization ID in header.
        指定者:
        getContentTypeId 在接口中 Serialization
        返回:
        content type id
      • serialize

        public ObjectOutput serialize​(URL url,
                                      OutputStream output)
        从接口复制的说明: Serialization
        Get a serialization implementation instance
        指定者:
        serialize 在接口中 Serialization
        参数:
        url - URL address for the remote service
        output - the underlying output stream
        返回:
        serializer
      • deserialize

        public ObjectInput deserialize​(URL url,
                                       InputStream input)
        从接口复制的说明: Serialization
        Get a deserialization implementation instance
        指定者:
        deserialize 在接口中 Serialization
        参数:
        url - URL address for the remote service
        input - the underlying input stream
        返回:
        deserializer