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;
// 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();
}
}
*/
public void stop(BundleContext bundleContext) throws Exception {
// Stop the server
+ if (LOGGER.isDebugEnabled())
+ LOGGER.debug("Stopping tileserver mapnik");
TileserverMapnikInstance.get().stop();
Activator.context = null;
}