1 package org.simantics.scl.osgi.internal;
4 import java.util.Collection;
5 import java.util.Collections;
7 import org.osgi.service.component.annotations.Component;
8 import org.simantics.scl.compiler.module.repository.UpdateListener;
9 import org.simantics.scl.compiler.source.FileModuleSource;
10 import org.simantics.scl.compiler.source.ModuleSource;
11 import org.simantics.scl.compiler.source.TextualModuleSource;
12 import org.simantics.scl.compiler.source.repository.ModuleSourceRepository;
14 import gnu.trove.procedure.TObjectProcedure;
17 public class FileSystemModuleSourceRepository implements ModuleSourceRepository {
19 synchronized public ModuleSource getModuleSource(String moduleName,
20 UpdateListener listener) {
21 if(!moduleName.startsWith("file:"))
23 return new FileModuleSource(moduleName, getClass().getClassLoader(),
24 new File(moduleName.substring(5)), TextualModuleSource.DEFAULT_IMPORTS);
28 public Collection<String> getModuleNames() {
29 return Collections.emptyList();
33 public void forAllModules(TObjectProcedure<String> procedure) {