diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-12 13:05:10 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-12 13:05:10 +1200 |
commit | f304021d16e433b261226a8293f03e7de30a08a4 (patch) | |
tree | bb908a0e437a4d80b7e5043346545d02e8b235af /src/org/traccar/ExtendedObjectDecoder.java | |
parent | 639b427eba5738534c10f591e285d707e8b060e5 (diff) | |
download | trackermap-server-f304021d16e433b261226a8293f03e7de30a08a4.tar.gz trackermap-server-f304021d16e433b261226a8293f03e7de30a08a4.tar.bz2 trackermap-server-f304021d16e433b261226a8293f03e7de30a08a4.zip |
Re-factor all channel handlers
Diffstat (limited to 'src/org/traccar/ExtendedObjectDecoder.java')
-rw-r--r-- | src/org/traccar/ExtendedObjectDecoder.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/ExtendedObjectDecoder.java b/src/org/traccar/ExtendedObjectDecoder.java index ad0210934..d0f82dace 100644 --- a/src/org/traccar/ExtendedObjectDecoder.java +++ b/src/org/traccar/ExtendedObjectDecoder.java @@ -16,6 +16,7 @@ package org.traccar; import java.net.SocketAddress; +import java.util.Collection; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelEvent; import org.jboss.netty.channel.ChannelHandlerContext; @@ -39,7 +40,13 @@ public abstract class ExtendedObjectDecoder implements ChannelUpstreamHandler { if (originalMessage == decodedMessage) { ctx.sendUpstream(evt); } else if (decodedMessage != null) { - fireMessageReceived(ctx, decodedMessage, e.getRemoteAddress()); + if (decodedMessage instanceof Collection) { + for (Object o : (Collection) e.getMessage()) { + fireMessageReceived(ctx, o, e.getRemoteAddress()); + } + } else { + fireMessageReceived(ctx, decodedMessage, e.getRemoteAddress()); + } } } |