aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Main.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-27 14:39:34 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-27 14:39:34 +1300
commitdcf55c4f291c441b5e9921ec5b25ec8d3414140d (patch)
tree49997e43f6524162a95065d8fb405ed5f2b30c1f /src/org/traccar/Main.java
parent67f512fb2b481ebca78dab2163733ca2c3cef55a (diff)
downloadtrackermap-server-dcf55c4f291c441b5e9921ec5b25ec8d3414140d.tar.gz
trackermap-server-dcf55c4f291c441b5e9921ec5b25ec8d3414140d.tar.bz2
trackermap-server-dcf55c4f291c441b5e9921ec5b25ec8d3414140d.zip
Option to enable H2 database console
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r--src/org/traccar/Main.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java
index a51fa80bf..7c2e00ca0 100644
--- a/src/org/traccar/Main.java
+++ b/src/org/traccar/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,12 +33,18 @@ public final class Main {
if (Context.getWebServer() != null) {
Context.getWebServer().start();
}
+ if (Context.getDatabaseConsole() != null) {
+ Context.getDatabaseConsole().start();
+ }
- // Shutdown server properly
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
Log.info("Shutting down server...");
+
+ if (Context.getDatabaseConsole() != null) {
+ Context.getDatabaseConsole().stop();
+ }
if (Context.getWebServer() != null) {
Context.getWebServer().stop();
}