]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/Activator.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scl.osgi / src / org / simantics / scl / osgi / internal / Activator.java
1 package org.simantics.scl.osgi.internal;
2
3 import java.util.Hashtable;
4
5 import org.osgi.framework.BundleActivator;
6 import org.osgi.framework.BundleContext;
7 import org.simantics.scl.compiler.source.repository.ModuleSourceRepository;
8 import org.simantics.scl.compiler.source.repository.SourceRepositories;
9
10 public class Activator implements BundleActivator {
11
12     private static BundleContext context;
13
14     public static BundleContext getContext() {
15         return context;
16     }
17
18     @SuppressWarnings({ "rawtypes", "unchecked" })
19     public void start(BundleContext bundleContext) throws Exception {
20         Activator.context = bundleContext;
21
22         Hashtable properties = new Hashtable();
23         bundleContext.registerService(ModuleSourceRepository.class,
24                 SourceRepositories.BUILTIN_SOURCE_REPOSITORY,
25                 properties);
26     }
27
28     public void stop(BundleContext bundleContext) throws Exception {
29         Activator.context = null;
30     }
31
32 }