import org.osgi.framework.wiring.BundleWiring;
import org.simantics.scl.compiler.internal.codegen.types.JavaReferenceValidatorFactory;
import org.simantics.scl.compiler.module.ImportDeclaration;
import org.simantics.scl.compiler.module.repository.UpdateListener;
import org.simantics.scl.compiler.source.EncodedTextualModuleSource;
import org.simantics.scl.compiler.types.Type;
import org.osgi.framework.wiring.BundleWiring;
import org.simantics.scl.compiler.internal.codegen.types.JavaReferenceValidatorFactory;
import org.simantics.scl.compiler.module.ImportDeclaration;
import org.simantics.scl.compiler.module.repository.UpdateListener;
import org.simantics.scl.compiler.source.EncodedTextualModuleSource;
import org.simantics.scl.compiler.types.Type;
import gnu.trove.set.hash.THashSet;
public class BundleModuleSource extends EncodedTextualModuleSource implements UpdateListener.Observable {
import gnu.trove.set.hash.THashSet;
public class BundleModuleSource extends EncodedTextualModuleSource implements UpdateListener.Observable {
public static final ImportDeclaration[] DEFAULT_IMPORTS = new ImportDeclaration[] {
new ImportDeclaration("Builtin", ""),
new ImportDeclaration("StandardLibrary", "")
public static final ImportDeclaration[] DEFAULT_IMPORTS = new ImportDeclaration[] {
new ImportDeclaration("Builtin", ""),
new ImportDeclaration("StandardLibrary", "")
+ if (wiring == null && bundle.getState() == Bundle.INSTALLED) {
+ try {
+ bundle.start();
+ } catch (BundleException e) {
+ LOGGER.error("Could not start bundle {}", bundle.getSymbolicName(), e);
+ }
+ wiring = bundle.adapt(BundleWiring.class);
+ }
+ if (wiring != null) {