aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-22 23:00:35 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-22 23:00:35 +1200
commitcefba4b9227c8aeb96e290f70689960541755f0d (patch)
treebe4dbe695d79e3b6cad12724ea596c3f112aff97 /src/org/traccar/BasePipelineFactory.java
parent05b0272bff05efaffcdfe416d1b258607a908d2b (diff)
downloadtrackermap-server-cefba4b9227c8aeb96e290f70689960541755f0d.tar.gz
trackermap-server-cefba4b9227c8aeb96e290f70689960541755f0d.tar.bz2
trackermap-server-cefba4b9227c8aeb96e290f70689960541755f0d.zip
Add latest position cache
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 3a8d1f48f..469bbc49f 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -21,26 +21,22 @@ import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.*;
import org.jboss.netty.handler.logging.LoggingHandler;
import org.jboss.netty.handler.timeout.IdleStateHandler;
+import org.traccar.database.DataCache;
+import org.traccar.database.DataManager;
import org.traccar.geocode.ReverseGeocoder;
import org.traccar.helper.Log;
-import org.traccar.database.DataManager;
-/**
- * Base pipeline factory
- */
public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private final TrackerServer server;
private final DataManager dataManager;
+ private final DataCache dataCache;
private final Boolean loggerEnabled;
private final ReverseGeocoder reverseGeocoder;
private FilterHandler filterHandler;
private Integer resetDelay;
private Boolean processInvalidPositions;
- /**
- * Open channel handler
- */
protected class OpenChannelHandler extends SimpleChannelHandler {
private final TrackerServer server;
@@ -90,6 +86,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
public BasePipelineFactory(ServerManager serverManager, TrackerServer server, String protocol) {
this.server = server;
dataManager = serverManager.getDataManager();
+ dataCache = serverManager.getDataCache();
loggerEnabled = serverManager.isLoggerEnabled();
reverseGeocoder = serverManager.getReverseGeocoder();
@@ -133,7 +130,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (reverseGeocoder != null) {
pipeline.addLast("geocoder", new ReverseGeocoderHandler(reverseGeocoder, processInvalidPositions));
}
- pipeline.addLast("handler", new TrackerEventHandler(dataManager));
+ pipeline.addLast("handler", new TrackerEventHandler(dataManager, dataCache));
return pipeline;
}