]> gerrit.simantics Code Review - simantics/3d.git/blob - Activator.java
4976309535b905380c89b00a8f909f1e411f13c8
[simantics/3d.git] / Activator.java
1 package org.jcae.opencascade;\r
2 \r
3 import org.osgi.framework.BundleActivator;\r
4 import org.osgi.framework.BundleContext;\r
5 \r
6 public class Activator implements BundleActivator {\r
7 \r
8         private static BundleContext context;\r
9 \r
10         static BundleContext getContext() {\r
11                 return context;\r
12         }\r
13 \r
14         /*\r
15          * (non-Javadoc)\r
16          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)\r
17          */\r
18         public void start(BundleContext bundleContext) throws Exception {\r
19                 String mmg_opt= System.getenv("MMGT_OPT");\r
20                 if(mmg_opt != null && !"0".equals(mmg_opt))\r
21                         throw new Exception("The MMGT_OPT environement variable must be set to 0 before using occjava.");\r
22                 Activator.context = bundleContext;\r
23         }\r
24 \r
25         /*\r
26          * (non-Javadoc)\r
27          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)\r
28          */\r
29         public void stop(BundleContext bundleContext) throws Exception {\r
30                 Activator.context = null;\r
31         }\r
32 \r
33 }\r