aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
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);