|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.serializer.SerializationAwareEventMessage<T> org.axonframework.serializer.SerializationAwareDomainEventMessage<T>
T
- The payload type of the Messagepublic class SerializationAwareDomainEventMessage<T>
Wrapper around a DomainEventMessage that adds "Serialization Awareness" to the message it wraps. This implementation
ensures that, when the payload or meta data is being serialized more than once using the same serializer, only a
single serialization will actually occur. Subsequent invocations will return the same SerializedObject
instance as the first.
Constructor Summary | |
---|---|
protected |
SerializationAwareDomainEventMessage(DomainEventMessage<T> message)
Initialize a new wrapper for the given message . |
Method Summary | ||
---|---|---|
DomainEventMessage<T> |
andMetaData(Map<String,?> metaData)
Returns a copy of this EventMessage with it MetaData merged with the given metaData . |
|
Object |
getAggregateIdentifier()
Returns the identifier of the Aggregate that generated this DomainEvent. |
|
long |
getSequenceNumber()
Returns the sequence number that allows DomainEvents originating from the same Aggregate to be placed in the order of generation. |
|
DomainEventMessage<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this EventMessage with the given metaData . |
|
static
|
wrap(DomainEventMessage<T> message)
Wrap the given message to make it SerializationAware. |
|
protected Object |
writeReplace()
Replacement function for Java Serialization API. |
Methods inherited from class org.axonframework.serializer.SerializationAwareEventMessage |
---|
getIdentifier, getMetaData, getPayload, getPayloadType, getTimestamp, serializeMetaData, serializePayload, wrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.axonframework.domain.EventMessage |
---|
getIdentifier, getTimestamp |
Methods inherited from interface org.axonframework.domain.Message |
---|
getMetaData, getPayload, getPayloadType |
Constructor Detail |
---|
protected SerializationAwareDomainEventMessage(DomainEventMessage<T> message)
message
.
message
- The message to wrapMethod Detail |
---|
public static <T> DomainEventMessage<T> wrap(DomainEventMessage<T> message)
message
to make it SerializationAware. The returning object can be safely cast to
SerializationAware
. If the given message
already implements
SerializationAware
, it is returned as-is. It is therefore not safe to assume the returning message
is an instance of SerializationAwareDomainEventMessage
.
T
- The payload type of the messagemessage
- The message to wrap
public long getSequenceNumber()
DomainEventMessage
getSequenceNumber
in interface DomainEventMessage<T>
public Object getAggregateIdentifier()
DomainEventMessage
getAggregateIdentifier
in interface DomainEventMessage<T>
public DomainEventMessage<T> withMetaData(Map<String,?> metaData)
EventMessage
metaData
. The payload, Timestamp
and Identifier
remain unchanged.
withMetaData
in interface DomainEventMessage<T>
withMetaData
in interface EventMessage<T>
withMetaData
in interface Message<T>
withMetaData
in class SerializationAwareEventMessage<T>
metaData
- The new MetaData for the Message
public DomainEventMessage<T> andMetaData(Map<String,?> metaData)
EventMessage
metaData
. The payload,
Timestamp
and Identifier
remain unchanged.
andMetaData
in interface DomainEventMessage<T>
andMetaData
in interface EventMessage<T>
andMetaData
in interface Message<T>
andMetaData
in class SerializationAwareEventMessage<T>
metaData
- The MetaData to merge with
protected Object writeReplace()
writeReplace
in class SerializationAwareEventMessage<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |