1 package org.simantics.maps.server.ui;
3 import org.osgi.framework.BundleActivator;
4 import org.osgi.framework.BundleContext;
5 import org.simantics.district.maps.server.TileserverMapnikInstance;
6 import org.simantics.district.maps.server.prefs.MapsServerPreferences;
8 public class Activator implements BundleActivator {
10 public static final String PLUGIN_ID = "org.simantics.maps.server.ui";
12 private static BundleContext context;
14 static BundleContext getContext() {
21 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.
24 public void start(BundleContext bundleContext) throws Exception {
25 Activator.context = bundleContext;
27 // Let's see if server should be automatically started
28 if (MapsServerPreferences.startAutomatically()) {
29 // execute in a separate thread to not slow down the startup process
32 TileserverMapnikInstance.get().start();
33 } catch (Exception e) {
44 * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
46 public void stop(BundleContext bundleContext) throws Exception {
48 TileserverMapnikInstance.get().stop();
49 Activator.context = null;