aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-01-15 16:31:13 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-01-15 16:31:13 +1300
commite1608e2ffcb65afdadf5ef76a08cff1bfab47b49 (patch)
treed439d17048dff84f74beee16f7052761fd6fcc6a /src/org/traccar/ServerManager.java
parent2665120e4f9c450738f2cd218afacb736ad92542 (diff)
downloadtrackermap-server-e1608e2ffcb65afdadf5ef76a08cff1bfab47b49.tar.gz
trackermap-server-e1608e2ffcb65afdadf5ef76a08cff1bfab47b49.tar.bz2
trackermap-server-e1608e2ffcb65afdadf5ef76a08cff1bfab47b49.zip
Start protocol detector implementation
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 6734d343d..fe5745bc8 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -179,7 +179,9 @@ public class ServerManager {
initTramigoServer("tramigo");
initTr900Server("tr900");
initArdi01Server("ardi01");
-
+
+ initProtocolDetector();
+
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
webServer = new WebServer(properties, dataManager.getDataSource());
@@ -233,6 +235,23 @@ public class ServerManager {
return false;
}
+ private void initProtocolDetector() throws SQLException {
+ String protocol = "detector";
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
+ }
+ });
+ serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
+ }
+ });
+ }
+ }
private void initGps103Server(final String protocol) throws SQLException {
if (isProtocolEnabled(properties, protocol)) {
serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {