]> gerrit.simantics Code Review - simantics/python.git/blobdiff - org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java
Initial commit of Python Integration feature.
[simantics/python.git] / org.simantics.pythonlink / src / org / simantics / pythonlink / Activator.java
diff --git a/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java b/org.simantics.pythonlink/src/org/simantics/pythonlink/Activator.java
new file mode 100644 (file)
index 0000000..83633a4
--- /dev/null
@@ -0,0 +1,31 @@
+package org.simantics.pythonlink;\r
+\r
+import org.osgi.framework.BundleActivator;\r
+import org.osgi.framework.BundleContext;\r
+\r
+public class Activator implements BundleActivator {\r
+\r
+       private static BundleContext context;\r
+\r
+       static BundleContext getContext() {\r
+               return context;\r
+       }\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)\r
+        */\r
+       public void start(BundleContext bundleContext) throws Exception {\r
+               Activator.context = bundleContext;\r
+        System.loadLibrary("jnipython");\r
+       }\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)\r
+        */\r
+       public void stop(BundleContext bundleContext) throws Exception {\r
+               Activator.context = null;\r
+       }\r
+\r
+}\r