X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.osgi%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fosgi%2Finternal%2FActivator.java;fp=bundles%2Forg.simantics.scl.osgi%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fosgi%2Finternal%2FActivator.java;h=ea113017a1458790a57567a7498b4d5339285689;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/Activator.java b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/Activator.java new file mode 100755 index 000000000..ea113017a --- /dev/null +++ b/bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/Activator.java @@ -0,0 +1,32 @@ +package org.simantics.scl.osgi.internal; + +import java.util.Hashtable; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.simantics.scl.compiler.source.repository.ModuleSourceRepository; +import org.simantics.scl.compiler.source.repository.SourceRepositories; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + public static BundleContext getContext() { + return context; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + + Hashtable properties = new Hashtable(); + bundleContext.registerService(ModuleSourceRepository.class, + SourceRepositories.BUILTIN_SOURCE_REPOSITORY, + properties); + } + + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +}