Class SynchronizedDecoratorMarshaller<T>
- java.lang.Object
-
- org.wildfly.clustering.marshalling.protostream.reflect.AbstractMemberMarshaller<T,M>
-
- org.wildfly.clustering.marshalling.protostream.reflect.UnaryMemberMarshaller<T,Field,F>
-
- org.wildfly.clustering.marshalling.protostream.reflect.UnaryFieldMarshaller<T,T>
-
- org.wildfly.clustering.marshalling.protostream.reflect.DecoratorMarshaller<T>
-
- org.wildfly.clustering.marshalling.protostream.reflect.SynchronizedDecoratorMarshaller<T>
-
- All Implemented Interfaces:
Function<Object[],T>,org.infinispan.protostream.BaseMarshaller<T>,org.infinispan.protostream.ProtobufTagMarshaller<T>,Marshallable<T>,ProtoStreamMarshaller<T>,Readable<T>,Writable<T>
public class SynchronizedDecoratorMarshaller<T> extends DecoratorMarshaller<T>
A decorator marshaller that writes the decorated object while holding its monitor lock. e.g. to enable iteration over a decorated collection without the risk of a ConcurrentModificationException.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description SynchronizedDecoratorMarshaller(Class<T> decoratedClass, UnaryOperator<T> decorator, T sample)Constructs a decorator marshaller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwriteTo(ProtoStreamWriter writer, T value)Writes the specified object to the specified writer.-
Methods inherited from class org.wildfly.clustering.marshalling.protostream.reflect.UnaryMemberMarshaller
apply
-
Methods inherited from class org.wildfly.clustering.marshalling.protostream.reflect.AbstractMemberMarshaller
getJavaClass, readFrom
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.Marshallable
size
-
Methods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamMarshaller
getTypeName, read, write
-
-
-
-
Constructor Detail
-
SynchronizedDecoratorMarshaller
public SynchronizedDecoratorMarshaller(Class<T> decoratedClass, UnaryOperator<T> decorator, T sample)
Constructs a decorator marshaller.- Parameters:
decoratedClass- the generalized type of the decorated objectdecorator- the decoration functionsample- a sample object used to determine the type of the decorated object
-
-
Method Detail
-
writeTo
public void writeTo(ProtoStreamWriter writer, T value) throws IOException
Description copied from interface:WritableWrites the specified object to the specified writer.- Specified by:
writeToin interfaceWritable<T>- Overrides:
writeToin classAbstractMemberMarshaller<T,Field>- Parameters:
writer- a ProtoStream writervalue- the object to be written- Throws:
IOException- if the object could not be written
-
-