diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-06-24 16:10:33 +0400 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-06-24 16:10:33 +0400 |
commit | 3baeb26089a65ea7b65beedf2f3157dc2aab33a2 (patch) | |
tree | db50048c38a38a5ace5add7dd81bc465955ad43a /src/org/traccar/GenericPipelineFactory.java | |
parent | 7a7c38268e09a67134b34a0a8e4fcba4f8bf639a (diff) | |
download | traccar-server-3baeb26089a65ea7b65beedf2f3157dc2aab33a2.tar.gz traccar-server-3baeb26089a65ea7b65beedf2f3157dc2aab33a2.tar.bz2 traccar-server-3baeb26089a65ea7b65beedf2f3157dc2aab33a2.zip |
Add reverse geocoding (fix #15)
Diffstat (limited to 'src/org/traccar/GenericPipelineFactory.java')
-rw-r--r-- | src/org/traccar/GenericPipelineFactory.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/GenericPipelineFactory.java b/src/org/traccar/GenericPipelineFactory.java index 13a4cf6b6..c5e2cc812 100644 --- a/src/org/traccar/GenericPipelineFactory.java +++ b/src/org/traccar/GenericPipelineFactory.java @@ -19,6 +19,7 @@ import java.net.InetSocketAddress; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.*; import org.jboss.netty.handler.logging.LoggingHandler; +import org.traccar.geocode.ReverseGeocoder; import org.traccar.helper.Log; import org.traccar.model.DataManager; @@ -30,6 +31,7 @@ public abstract class GenericPipelineFactory implements ChannelPipelineFactory { private TrackerServer server; private DataManager dataManager; private Boolean loggerEnabled; + private ReverseGeocoder geocoder; /** * Open channel handler @@ -84,10 +86,11 @@ public abstract class GenericPipelineFactory implements ChannelPipelineFactory { } public GenericPipelineFactory( - TrackerServer server, DataManager dataManager, Boolean loggerEnabled) { + TrackerServer server, DataManager dataManager, Boolean loggerEnabled, ReverseGeocoder geocoder) { this.server = server; this.dataManager = dataManager; this.loggerEnabled = loggerEnabled; + this.geocoder = geocoder; } protected DataManager getDataManager() { @@ -103,6 +106,9 @@ public abstract class GenericPipelineFactory implements ChannelPipelineFactory { pipeline.addLast("logger", new StandardLoggingHandler()); } addSpecificHandlers(pipeline); + if (geocoder != null) { + pipeline.addLast("geocoder", new ReverseGeocoderHandler(geocoder)); + } pipeline.addLast("handler", new TrackerEventHandler(dataManager)); return pipeline; } |