Class SynchronizedDecoratorExternalizer<T>
java.lang.Object
org.wildfly.clustering.marshalling.spi.DecoratorExternalizer<T>
org.wildfly.clustering.marshalling.spi.SynchronizedDecoratorExternalizer<T>
- All Implemented Interfaces:
Function<T,,T> Externalizer<T>,org.wildfly.security.ParametricPrivilegedAction<T,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
ConstructorsConstructorDescriptionSynchronizedDecoratorExternalizer(Class<T> decoratedClass, UnaryOperator<T> decorator, T sample) Constructs a decorator externalizer. -
Method Summary
Methods inherited from class org.wildfly.clustering.marshalling.spi.DecoratorExternalizer
getTargetClass, readObject, runMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wildfly.clustering.marshalling.Externalizer
sizeMethods inherited from interface org.wildfly.security.ParametricPrivilegedAction
apply
-
Constructor Details
-
SynchronizedDecoratorExternalizer
public SynchronizedDecoratorExternalizer(Class<T> decoratedClass, UnaryOperator<T> decorator, T sample) Constructs a decorator externalizer.- 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 Details
-
writeObject
- Specified by:
writeObjectin interfaceExternalizer<T>- Overrides:
writeObjectin classDecoratorExternalizer<T>- Throws:
IOException
-