X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.pythonlink%2Fsrc%2Forg%2Fsimantics%2Fpythonlink%2FActivator.java;h=26798d6f0b6fa53e33a0c4913bfd76195daa8be6;hb=d71490fa46106b0502ee3b903793a16a3bb6f68b;hp=83633a4114c9282b0e86c65f06975681db66c6ae;hpb=d556dfd2739c43551c894dd636bf8e0735fbad55;p=simantics%2Fpython.git diff --git a/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java b/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java index 83633a4..26798d6 100644 --- a/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java +++ b/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java @@ -2,11 +2,16 @@ package org.simantics.pythonlink; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Activator implements BundleActivator { + private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class); private static BundleContext context; + private static boolean loaded = false; + static BundleContext getContext() { return context; } @@ -17,7 +22,16 @@ public class Activator implements BundleActivator { */ public void start(BundleContext bundleContext) throws Exception { Activator.context = bundleContext; - System.loadLibrary("jnipython"); + try { + System.loadLibrary("jnipython"); + loaded = true; + } catch (Exception e) { + LOGGER.error("Loading of jnipython.dll failed", e); + } + } + + public static boolean isPythonLoaded() { + return loaded; } /*