org.axonframework.eventhandling.io
Class EventMessageWriter

java.lang.Object
  extended by org.axonframework.eventhandling.io.EventMessageWriter

public class EventMessageWriter
extends Object

Writer that writes Event Messages onto a an OutputStream. The format of the message makes them suitable to be read back in using a EventMessageReader. This writer distinguishes between DomainEventMessage and plain EventMessage when writing. The reader will reconstruct an aggregate implementation for the same message type (i.e. DomainEventMessage or EventMessage).

Since:
2.0
Author:
Allard Buijze

Constructor Summary
EventMessageWriter(DataOutput output, Serializer serializer)
          Creates a new EventMessageWriter writing data to the specified underlying output.
 
Method Summary
 void writeEventMessage(EventMessage eventMessage)
          Writes the given eventMessage to the underling output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventMessageWriter

public EventMessageWriter(DataOutput output,
                          Serializer serializer)
Creates a new EventMessageWriter writing data to the specified underlying output.

Parameters:
output - the underlying output
serializer - The serializer to deserialize payload and metadata with
Method Detail

writeEventMessage

public void writeEventMessage(EventMessage eventMessage)
                       throws IOException
Writes the given eventMessage to the underling output.

Parameters:
eventMessage - the EventMessage to write to the underlying output
Throws:
IOException - when any exception occurs writing to the underlying stream


Copyright © 2010-2016. All Rights Reserved.