From 9a33a3ae6c50b505bfe22596ae4e68b6b0ed57d0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Nov 2013 12:50:45 +1300 Subject: Change server init order --- src/org/traccar/ServerManager.java | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 32afc29fc..daa2981b6 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -152,12 +152,12 @@ public class ServerManager { initLaipacServer("laipac"); initAplicomServer("aplicom"); initGotopServer("gotop"); + initSanavServer("sanav"); initGatorServer("gator"); initNoranServer("noran"); initM2mServer("m2m"); initOsmAndServer("osmand"); initEasyTrackServer("easytrack"); - initSanavServer("sanav"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -941,6 +941,21 @@ public class ServerManager { } } + private void initSanavServer(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + byte delimiter[] = { (byte) '*' }; + pipeline.addLast("frameDecoder", + new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this)); + } + }); + } + } + private void initGatorServer(String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) { @@ -1003,19 +1018,4 @@ public class ServerManager { } } - private void initSanavServer(String protocol) throws SQLException { - if (isProtocolEnabled(properties, protocol)) { - serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { - @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { - byte delimiter[] = { (byte) '*' }; - pipeline.addLast("frameDecoder", - new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter))); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this)); - } - }); - } - } - } -- cgit v1.2.3