Package org.axonframework.serialization
Class GapAwareTrackingTokenConverter
java.lang.Object
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
com.thoughtworks.xstream.converters.collections.CollectionConverter
org.axonframework.serialization.GapAwareTrackingTokenConverter
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher
public final class GapAwareTrackingTokenConverter
extends com.thoughtworks.xstream.converters.collections.CollectionConverter
Dedicated
CollectionConverter implementation to de-/serializer the GapAwareTrackingToken and
org.axonframework.eventsourcing.eventstore.GapAwareTrackingToken.
Necessary due to the ConcurrentSkipListSet used within the
GapAwareTrackingToken, as XStream is incapable to marshall / unmarshall these
Collections from the java.util.concurrent package. In pre-JDK16 times, XStream
would use the ReflectionConverter for this.
- Since:
- 4.7.0
- Author:
- Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionGapAwareTrackingTokenConverter(com.thoughtworks.xstream.mapper.Mapper mapper) Constructs aGapAwareTrackingTokenConverter. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class type) voidmarshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) Methods inherited from class com.thoughtworks.xstream.converters.collections.CollectionConverter
addCurrentElementToCollection, createCollection, populateCollection, populateCollectionMethods inherited from class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
-
Constructor Details
-
GapAwareTrackingTokenConverter
public GapAwareTrackingTokenConverter(com.thoughtworks.xstream.mapper.Mapper mapper) Constructs aGapAwareTrackingTokenConverter.- Parameters:
mapper- The mapper to be used by the constructedGapAwareTrackingTokenConverter.
-
-
Method Details
-
marshal
public void marshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) - Specified by:
marshalin interfacecom.thoughtworks.xstream.converters.Converter- Overrides:
marshalin classcom.thoughtworks.xstream.converters.collections.CollectionConverter
-
unmarshal
public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) - Specified by:
unmarshalin interfacecom.thoughtworks.xstream.converters.Converter- Overrides:
unmarshalin classcom.thoughtworks.xstream.converters.collections.CollectionConverter
-
canConvert
- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher- Overrides:
canConvertin classcom.thoughtworks.xstream.converters.collections.CollectionConverter
-