org.jboss.errai.bus.server.io
Class MultiMessageFilter
java.lang.Object
org.jboss.errai.bus.server.io.MultiMessageFilter
- All Implemented Interfaces:
- BufferFilter
public class MultiMessageFilter
- extends Object
- implements BufferFilter
This BufferFilter
is used for re-writing the data in the buffer to permit properly formed
multi-message payloads. This is because ErraiBus J.REP messages are delivered into the bus as
single-message payloads. This filter prepends '[' to the data coming from the buffer,
and inserts a ',' between each message in the stream. It then appends a ']' to the
message to complete the payload.
For instance, consider the following buffer data:
{"foo":"bar"}{"bar":"foo"}
This filter will transform this to:
[{"foo":"bar"},{"bar":"foo"}]
- Author:
- Mike Brock
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiMessageFilter
public MultiMessageFilter()
before
public void before(ByteWriteAdapter outstream)
throws IOException
- Specified by:
before
in interface BufferFilter
- Throws:
IOException
each
public int each(int i,
ByteWriteAdapter outstream)
throws IOException
- Specified by:
each
in interface BufferFilter
- Throws:
IOException
after
public void after(ByteWriteAdapter outstream)
throws IOException
- Specified by:
after
in interface BufferFilter
- Throws:
IOException
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.