diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-18 13:48:54 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-18 13:48:54 +1200 |
commit | c06de84d316e7c67f6d22e12f855e2df34bbc3fb (patch) | |
tree | f7ab337c360bf50a79855787e9fa80e45ebd808c /src/org/traccar/BasePipelineFactory.java | |
parent | afaede42a0cc8170128219bd1dfa6277e4e1809a (diff) | |
parent | 3ad3edfadba59e94d95e967e9d5cd28ae671cae4 (diff) | |
download | trackermap-server-c06de84d316e7c67f6d22e12f855e2df34bbc3fb.tar.gz trackermap-server-c06de84d316e7c67f6d22e12f855e2df34bbc3fb.tar.bz2 trackermap-server-c06de84d316e7c67f6d22e12f855e2df34bbc3fb.zip |
Merge branch odometer
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 4d8b0ffc4..216e48709 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -25,7 +25,6 @@ import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.Channels; import org.jboss.netty.channel.DownstreamMessageEvent; -import org.jboss.netty.channel.ExceptionEvent; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.SimpleChannelHandler; import org.jboss.netty.handler.logging.LoggingHandler; @@ -38,6 +37,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { private int resetDelay; private FilterHandler filterHandler; + private DistanceHandler distanceHandler; private ReverseGeocoderHandler reverseGeocoderHandler; protected class OpenChannelHandler extends SimpleChannelHandler { @@ -96,6 +96,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { reverseGeocoderHandler = new ReverseGeocoderHandler( Context.getReverseGeocoder(), Context.getConfig().getBoolean("geocode.processInvalidPositions")); } + + if (Context.getConfig().getBoolean("distance.enable")) { + distanceHandler = new DistanceHandler(); + } } protected abstract void addSpecificHandlers(ChannelPipeline pipeline); @@ -114,6 +118,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { if (filterHandler != null) { pipeline.addLast("filter", filterHandler); } + if (distanceHandler != null) { + pipeline.addLast("distance", distanceHandler); + } if (reverseGeocoderHandler != null) { pipeline.addLast("geocoder", reverseGeocoderHandler); } |