| Modifier and Type | Method and Description |
|---|---|
default Map<String,Object> |
readAttachments() |
default String |
readEvent() |
Object |
readObject()
Consider use
readObject(Class) or readObject(Class, Type) where possible |
<T> T |
readObject(Class<T> cls)
read object
|
<T> T |
readObject(Class<T> cls,
Type type)
read object
|
default Throwable |
readThrowable()
The following methods are customized for the requirement of Dubbo's RPC protocol implementation.
|
Object readObject() throws IOException, ClassNotFoundException
readObject(Class) or readObject(Class, Type) where possibleIOException - if an I/O error occursClassNotFoundException - if an ClassNotFoundException occurs<T> T readObject(Class<T> cls) throws IOException, ClassNotFoundException
cls - object classIOException - if an I/O error occursClassNotFoundException - if an ClassNotFoundException occurs<T> T readObject(Class<T> cls, Type type) throws IOException, ClassNotFoundException
cls - object classtype - object typeIOException - if an I/O error occursClassNotFoundException - if an ClassNotFoundException occursdefault Throwable readThrowable() throws IOException, ClassNotFoundException
See how ProtobufSerialization, KryoSerialization implemented these methods for more details.
The binding of RPC protocol and biz serialization protocol is not a good practice. Encoding of RPC protocol should be highly independent and portable, easy to cross platforms and languages, for example, like the http headers, restricting the content of headers / attachments to Ascii strings and uses ISO_8859_1 to encode them. https://tools.ietf.org/html/rfc7540#section-8.1.2
IOExceptionClassNotFoundExceptiondefault String readEvent() throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptiondefault Map<String,Object> readAttachments() throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.