X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.maps.server.ui%2Fsrc%2Forg%2Fsimantics%2Fmaps%2Fserver%2Fui%2FActivator.java;h=78b2e7b24118b0a793be76d4ad26074e073c8349;hb=refs%2Fchanges%2F94%2F1894%2F1;hp=cd46e1a517f5c57dcaf64acef5cfe6d8a5570740;hpb=2529be6d456deeb07c128603ce4971f1dc29b695;p=simantics%2Fdistrict.git diff --git a/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java index cd46e1a5..78b2e7b2 100644 --- a/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java +++ b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java @@ -4,9 +4,13 @@ import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.simantics.district.maps.server.TileserverMapnikInstance; import org.simantics.district.maps.server.prefs.MapsServerPreferences; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Activator implements BundleActivator { + private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class); + public static final String PLUGIN_ID = "org.simantics.maps.server.ui"; private static BundleContext context; @@ -27,13 +31,9 @@ public class Activator implements BundleActivator { // Let's see if server should be automatically started if (MapsServerPreferences.startAutomatically()) { // execute in a separate thread to not slow down the startup process - new Thread(() -> { - try { - TileserverMapnikInstance.get().start(); - } catch (Exception e) { - e.printStackTrace(); - } - }).start(); + if (LOGGER.isDebugEnabled()) + LOGGER.debug("Starting tileserver mapnik automatically"); + new TileserverMapnikStartJob().schedule(); } } @@ -45,6 +45,8 @@ public class Activator implements BundleActivator { */ public void stop(BundleContext bundleContext) throws Exception { // Stop the server + if (LOGGER.isDebugEnabled()) + LOGGER.debug("Stopping tileserver mapnik"); TileserverMapnikInstance.get().stop(); Activator.context = null; }