diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-18 15:32:05 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-18 15:32:05 +1300 |
commit | 3990d779545c7dba72324182058ae20730311f97 (patch) | |
tree | 3b010a0ce2f2dab29503686c5cc82c6e89e01dde /src/org/traccar/BasePipelineFactory.java | |
parent | 6ec22b7a68b5334e215662e4cb83a20f9a1cad18 (diff) | |
download | trackermap-server-3990d779545c7dba72324182058ae20730311f97.tar.gz trackermap-server-3990d779545c7dba72324182058ae20730311f97.tar.bz2 trackermap-server-3990d779545c7dba72324182058ae20730311f97.zip |
Implement location provider channel handler
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 6b877883d..4244da8c9 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -31,6 +31,7 @@ import org.jboss.netty.channel.SimpleChannelHandler; import org.jboss.netty.handler.logging.LoggingHandler; import org.jboss.netty.handler.timeout.IdleStateHandler; import org.traccar.helper.Log; +import org.traccar.location.LocationProvider; public abstract class BasePipelineFactory implements ChannelPipelineFactory { @@ -40,6 +41,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { private FilterHandler filterHandler; private DistanceHandler distanceHandler; private ReverseGeocoderHandler reverseGeocoderHandler; + private LocationProviderHandler locationProviderHandler; private static final class OpenChannelHandler extends SimpleChannelHandler { @@ -103,6 +105,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { Context.getReverseGeocoder(), Context.getConfig().getBoolean("geocode.processInvalidPositions")); } + if (Context.getLocationProvider() != null) { + locationProviderHandler = new LocationProviderHandler(Context.getLocationProvider()); + } + if (Context.getConfig().getBoolean("distance.enable")) { distanceHandler = new DistanceHandler(); } @@ -132,6 +138,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { if (reverseGeocoderHandler != null) { pipeline.addLast("geocoder", reverseGeocoderHandler); } + if (locationProviderHandler != null) { + pipeline.addLast("location", locationProviderHandler); + } pipeline.addLast("remoteAddress", new RemoteAddressHandler()); addDynamicHandlers(pipeline); |