1 package org.simantics.pythonlink;
\r
3 import org.osgi.framework.BundleActivator;
\r
4 import org.osgi.framework.BundleContext;
\r
5 import org.slf4j.Logger;
\r
6 import org.slf4j.LoggerFactory;
\r
8 public class Activator implements BundleActivator {
\r
10 private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
\r
11 private static BundleContext context;
\r
13 private static boolean loaded = false;
\r
15 static BundleContext getContext() {
\r
21 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
\r
23 public void start(BundleContext bundleContext) throws Exception {
\r
24 Activator.context = bundleContext;
\r
26 System.loadLibrary("jnipython");
\r
28 } catch (Exception e) {
\r
29 LOGGER.error("Loading of jnipython.dll failed", e);
\r
33 public static boolean isPythonLoaded() {
\r
39 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
\r
41 public void stop(BundleContext bundleContext) throws Exception {
\r
42 Activator.context = null;
\r