]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
(refs #7613) Removed some module sources as declarative services 15/1215/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 13 Nov 2017 10:43:16 +0000 (12:43 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 13 Nov 2017 10:43:16 +0000 (12:43 +0200)
Change-Id: I5e7c8a2921c945d802d38baa458d784270373d93

bundles/org.simantics.scl.compiler/META-INF/MANIFEST.MF
bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml [deleted file]
bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml [deleted file]
bundles/org.simantics.scl.compiler/build.properties
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/LoggingModule.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/ReflectionJavaModule.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/BuiltinModuleSourceRepository.java
bundles/org.simantics.scl.osgi/src/org/simantics/scl/osgi/internal/ServiceBasedModuleSourceRepository.java

index 105c28de9b1776c8b86adaaf6f2bc59cd3993fea..a09f40cd504958f94ffb8ae4b72c18aa709a411e 100644 (file)
@@ -75,6 +75,5 @@ Export-Package: org.cojen.classfile,
  org.simantics.scl.compiler.types.kinds,
  org.simantics.scl.compiler.types.util
 Bundle-ClassPath: .
-Service-Component: OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml,
- OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml
 Import-Package: org.osgi.service.component.annotations
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml b/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml
deleted file mode 100644 (file)
index bad60b1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.simantics.scl.compiler.elaboration.java.LoggingModule">
-   <implementation class="org.simantics.scl.compiler.elaboration.java.LoggingModule"/>
-</scr:component>
\ No newline at end of file
diff --git a/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml b/bundles/org.simantics.scl.compiler/OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml
deleted file mode 100644 (file)
index 0faa31e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository">
-   <service>
-      <provide interface="org.simantics.scl.compiler.source.repository.ModuleSourceRepository"/>
-   </service>
-   <implementation class="org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository"/>
-</scr:component>
\ No newline at end of file
index 4b829c259221b62e2b80a1d30b47247bcf98527f..ac7dca70eb8310bb1771ff2ebc42c8555f200aab 100644 (file)
@@ -2,7 +2,5 @@ source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\
-               OSGI-INF/org.simantics.scl.compiler.source.repository.BuiltinModuleSourceRepository.xml,\
-               OSGI-INF/org.simantics.scl.compiler.elaboration.java.LoggingModule.xml,\
                sclTests/,\
                scl/
index 552c93f6464f0e61e8baea3fe1e6ceec6db29f7e..8ce399148b0cb9292ae25bf33156dab6b2d35872 100644 (file)
@@ -23,7 +23,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Marker;
 
-@Component
 public class LoggingModule extends ConcreteModule {
 
     private static final String[] LOGGING_METHODS = new String[] {
index dab0056ae3f1fe69f8ac1d61b8f02be92040cfeb..1ccc4af4d027880c7f758c746cc92e4adf6d28d4 100644 (file)
@@ -17,7 +17,6 @@ import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.compiler.types.kinds.Kinds;
 
-@Component
 public class ReflectionJavaModule extends ConcreteModule {
     
     public static ReflectionJavaModule INSTANCE = new ReflectionJavaModule();
index 650fa1d19cb4d7a77bdc0630c24063cc1326c084..f3fd697401b43f75d70ba420883d5d22101201ae 100644 (file)
@@ -1,13 +1,11 @@
 package org.simantics.scl.compiler.source.repository;
 
-import org.osgi.service.component.annotations.Component;
 import org.simantics.scl.compiler.elaboration.java.Builtins;
 import org.simantics.scl.compiler.elaboration.java.JavaModule;
 import org.simantics.scl.compiler.elaboration.java.LoggingModule;
 import org.simantics.scl.compiler.elaboration.java.MinigraphModule;
 import org.simantics.scl.compiler.elaboration.java.ReflectionJavaModule;
 
-@Component
 public class BuiltinModuleSourceRepository extends MapModuleSourceRepository implements ModuleSourceRepository {
     public BuiltinModuleSourceRepository() {
         super(Builtins.INSTANCE,
index ac8384c242bf54e834148f6cfa8b7c31d2220024..e9d4abd4a01e3a825275f028b31429f5e7852edc 100644 (file)
@@ -25,6 +25,7 @@ public class ServiceBasedModuleSourceRepository implements ModuleSourceRepositor
     public ModuleSource getModuleSource(String moduleName,
             UpdateListener listener) {
         ModuleSource result = null;
+        ModuleSourceRepository resultRepository = null;
         Object[] services = sourceRepositories.getServices();
         if(services != null)
             for(Object sourceRepository_ : services) {
@@ -37,10 +38,11 @@ public class ServiceBasedModuleSourceRepository implements ModuleSourceRepositor
                         if(resultPriority > sourcePriority)
                             continue;
                         if(resultPriority == sourcePriority)
-                            throw new RuntimeException("Module " + moduleName + " has two sources " + result + ", " +
-                                    source + " with the same priority.");
+                            throw new RuntimeException("Module " + moduleName + " has two sources " + result + " (from "+resultRepository+"), " +
+                                    source + " (from "+sourceLoader+")  with the same priority.");
                     }
                     result = source;
+                    resultRepository = sourceLoader;
                 }
             }
         return result;