]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.auditlogging/src/org/simantics/audit/Activator.java
Support ontology install option trueWhenDeployed also during development
[simantics/platform.git] / bundles / org.simantics.auditlogging / src / org / simantics / audit / Activator.java
1 package org.simantics.audit;
2
3 import java.nio.file.Path;
4 import java.nio.file.Paths;
5
6 import org.eclipse.core.runtime.IPath;
7 import org.eclipse.core.runtime.Platform;
8 import org.osgi.framework.BundleActivator;
9 import org.osgi.framework.BundleContext;
10
11 public class Activator implements BundleActivator {
12
13         private static BundleContext context;
14         private static Path logLocation;
15
16         static BundleContext getContext() {
17                 return context;
18         }
19
20         /*
21          * (non-Javadoc)
22          * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
23          */
24         public void start(BundleContext bundleContext) throws Exception {
25                 Activator.context = bundleContext;
26                 IPath ipath = Platform.getStateLocation(getContext().getBundle());
27                 logLocation = Paths.get(ipath.toOSString());
28         }
29
30         /*
31          * (non-Javadoc)
32          * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
33          */
34         public void stop(BundleContext bundleContext) throws Exception {
35                 Activator.context = null;
36         }
37         
38     public static Path getLogLocation() {
39         return logLocation;
40     }
41
42 }