T - the type of the distributed valuepublic final class ClusterDistributedObject<T> extends Object implements Serializable
ObjectSerializer that should
be use to share it.
This class allows to switch between the serialized/deserialized representations of such value through the serialize()
and deserialize(SerializationProtocol) methods. Notice however, that this is an immutable object so each of those
methods will return a new instance.
Instances of this class are to be created through the forSerializedValue(byte[]) and
forValue(Object, SerializationProtocol) factory methods.| Modifier and Type | Method and Description |
|---|---|
static <T> ClusterDistributedObject<T> |
createSerializedForValue(T value,
org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
Creates an instance for the given serialized with
serializationProtocol |
ClusterDistributedObject |
deserialize(org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
Creates a new instance of
ClusterDistributedObject holding a deserialized representation of the
distributedValue |
static <T> ClusterDistributedObject<T> |
forSerializedValue(byte[] bytes)
Create an instance from the given serialized
bytes |
static <T> ClusterDistributedObject<T> |
forValue(T value,
org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
Creates an instance for the given which should be serialized with
serializationProtocol |
Object |
getValue()
Returns the value on its current representation.
|
DistributedValue |
serialize()
Creates a new instance of
DistributedValue holding a serialized representation of its value |
void |
setSerializationProtocol(org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol) |
public static <T> ClusterDistributedObject<T> forValue(T value, org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
serializationProtocolvalue - the value to distributeserializationProtocol - the SerializationProtocol to use with serialize()ClusterDistributedObjectpublic static <T> ClusterDistributedObject<T> forSerializedValue(byte[] bytes)
bytesbytes - the bytes of a serialized valueClusterDistributedObjectpublic static <T> ClusterDistributedObject<T> createSerializedForValue(T value, org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
serializationProtocolvalue - the value to distributeserializationProtocol - the SerializationProtocol to use with serialize()ClusterDistributedObjectpublic DistributedValue serialize()
DistributedValue holding a serialized representation of its valueDistributedValuepublic ClusterDistributedObject deserialize(org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
ClusterDistributedObject holding a deserialized representation of the
distributedValueserializationProtocol - the ObjectSerializer to be used for deserializingObjectSerializerpublic Object getValue()
byte[]byte[]public void setSerializationProtocol(org.mule.runtime.api.serialization.SerializationProtocol serializationProtocol)
Copyright © 2006–2022 MuleSoft, Inc.. All rights reserved.