public class JavaObjectSerializer extends AbstractObjectSerializer
ObjectSerializer that uses Java's default serialization
mechanism. This means that exceptions will come from serializing objects that do
not implement SerializablemuleContext| Constructor and Description |
|---|
JavaObjectSerializer() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
doDeserialize(InputStream inputStream,
ClassLoader classLoader)
Deserializes the given
inputStream using the provided classLoader. |
protected byte[] |
doSerialize(Object object)
Serializes the given object.
|
protected <T> T |
postInitialize(T object) |
void |
serialize(Object object,
OutputStream out)
Serializes the given object and writes the result into
out |
deserialize, deserialize, deserialize, deserialize, serialize, setMuleContextpublic void serialize(Object object, OutputStream out) throws SerializationException
outserialize in interface ObjectSerializerserialize in class AbstractObjectSerializerobject - the object to be serialized. Might be nullout - an OutputStream where the result will be writtenSerializationException - in case of unexpected exceptionprotected byte[] doSerialize(Object object) throws Exception
doSerialize in class AbstractObjectSerializerobject - the object to be serializedException - any exception thrown. Base class will handle accordinglyprotected <T> T doDeserialize(InputStream inputStream, ClassLoader classLoader) throws Exception
inputStream using the provided classLoader.
No need to worry about error handling or deserialization post initialization. Base class
does all of that automaticallydoDeserialize in class AbstractObjectSerializerinputStream - an open InputStream, not to be explicitly closed in this methodclassLoader - a ClassLoaderExceptionprotected <T> T postInitialize(T object)
postInitialize in class AbstractObjectSerializerCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.