aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseDataHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-02 22:12:44 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-02 22:12:44 +1200
commit06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07 (patch)
tree8f5d7b71ca3fa39448e93b3d0652a7fa8d496932 /src/org/traccar/BaseDataHandler.java
parent5a9811c3771d92832c9bba718b5ec935844978e8 (diff)
downloadtrackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.tar.gz
trackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.tar.bz2
trackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.zip
Start Netty 4 migration
Diffstat (limited to 'src/org/traccar/BaseDataHandler.java')
-rw-r--r--src/org/traccar/BaseDataHandler.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/org/traccar/BaseDataHandler.java b/src/org/traccar/BaseDataHandler.java
index 0c71a6a4d..8a461cc19 100644
--- a/src/org/traccar/BaseDataHandler.java
+++ b/src/org/traccar/BaseDataHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,21 +15,19 @@
*/
package org.traccar;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.handler.codec.oneone.OneToOneDecoder;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
import org.traccar.model.Position;
-public abstract class BaseDataHandler extends OneToOneDecoder {
+public abstract class BaseDataHandler extends ChannelInboundHandlerAdapter {
@Override
- protected final Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
-
+ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof Position) {
- return handlePosition((Position) msg);
+ ctx.fireChannelRead(handlePosition((Position) msg));
+ } else {
+ super.channelRead(ctx, msg);
}
-
- return msg;
}
protected abstract Position handlePosition(Position position);