polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [26/34] zest-java git commit: ZEST-136 - Fixed up some smaller issues. Still have the ServiceReference and ImportedService story messed up. ServiceQualifiers are not handled correctly.
Date Thu, 14 Apr 2016 06:13:32 GMT
ZEST-136 - Fixed up some smaller issues. Still have the ServiceReference and ImportedService
story messed up. ServiceQualifiers are not handled correctly.


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/72314b85
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/72314b85
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/72314b85

Branch: refs/heads/develop
Commit: 72314b856f6360a899f48e56a2bf3ae2cc019e74
Parents: dedb068
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Thu Dec 17 21:15:41 2015 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Thu Dec 17 21:15:41 2015 +0800

----------------------------------------------------------------------
 .../zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java   | 6 ++++--
 .../org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java | 2 +-
 .../org/apache/zest/runtime/service/ImportedServiceModel.java | 7 +++++--
 .../java/org/apache/zest/runtime/value/ValueInstance.java     | 2 +-
 .../zest/spi/service/importer/InstanceImporterTest.java       | 2 --
 5 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/72314b85/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java
b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java
index e7dd04f..44ee396 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ImportedServiceAssemblyImpl.java
@@ -24,6 +24,7 @@ import org.apache.zest.api.common.MetaInfo;
 import org.apache.zest.api.common.Visibility;
 import org.apache.zest.api.service.ServiceImporter;
 import org.apache.zest.api.service.importer.InstanceImporter;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.bootstrap.ImportedServiceAssembly;
 import org.apache.zest.runtime.activation.ActivatorsModel;
 import org.apache.zest.runtime.service.ImportedServiceModel;
@@ -59,7 +60,7 @@ public final class ImportedServiceAssemblyImpl
     }
 
     @SuppressWarnings( { "raw", "unchecked" } )
-    void addImportedServiceModel( List<ImportedServiceModel> serviceModels )
+    void addImportedServiceModel( ModuleDescriptor module, List<ImportedServiceModel>
serviceModels )
     {
         try
         {
@@ -69,7 +70,8 @@ public final class ImportedServiceAssemblyImpl
                 id = generateId( serviceModels, serviceType );
             }
 
-            ImportedServiceModel serviceModel = new ImportedServiceModel( serviceType,
+            ImportedServiceModel serviceModel = new ImportedServiceModel( module,
+                                                                          serviceType,
                                                                           visibility,
                                                                           serviceProvider,
                                                                           id,

http://git-wip-us.apache.org/repos/asf/zest-java/blob/72314b85/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java
b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java
index e997460..6e2a356 100755
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ModuleAssemblyImpl.java
@@ -568,7 +568,7 @@ public final class ModuleAssemblyImpl
 
         for( ImportedServiceAssemblyImpl importedServiceDeclaration : importedServiceAssemblies.values()
)
         {
-            importedServiceDeclaration.addImportedServiceModel( importedServiceModels );
+            importedServiceDeclaration.addImportedServiceModel( moduleModel, importedServiceModels
);
         }
 
         // Check for duplicate service identities

http://git-wip-us.apache.org/repos/asf/zest-java/blob/72314b85/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServiceModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServiceModel.java
b/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServiceModel.java
index f3bf992..8ca2dff 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServiceModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServiceModel.java
@@ -39,6 +39,7 @@ import org.apache.zest.runtime.activation.ActivatorsModel;
 public final class ImportedServiceModel
     implements ImportedServiceDescriptor, VisitableHierarchy<Object, Object>
 {
+    private final ModuleDescriptor module;
     private final Class<?> type;
     private final Visibility visibility;
     @SuppressWarnings( "raw" )
@@ -50,7 +51,8 @@ public final class ImportedServiceModel
     private final String moduleName;
 
     @SuppressWarnings( "raw" )
-    public ImportedServiceModel( Class serviceType,
+    public ImportedServiceModel( ModuleDescriptor module,
+                                 Class serviceType,
                                  Visibility visibility,
                                  Class<? extends ServiceImporter> serviceImporter,
                                  String identity,
@@ -60,6 +62,7 @@ public final class ImportedServiceModel
                                  String moduleName
     )
     {
+        this.module = module;
         type = serviceType;
         this.visibility = visibility;
         this.serviceImporter = serviceImporter;
@@ -91,7 +94,7 @@ public final class ImportedServiceModel
     @Override
     public ModuleDescriptor module()
     {
-        return null;
+        return module;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/72314b85/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
index beb232c..184c05b 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
@@ -168,6 +168,6 @@ public final class ValueInstance
     @Override
     public String toString()
     {
-        return ( (ModuleSpi) module() ).valueSerialization().serialize( this.<ValueComposite>proxy()
);
+        return ( (ModuleSpi) module().instance() ).valueSerialization().serialize( this.<ValueComposite>proxy()
);
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/72314b85/core/runtime/src/test/java/org/apache/zest/spi/service/importer/InstanceImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/spi/service/importer/InstanceImporterTest.java
b/core/runtime/src/test/java/org/apache/zest/spi/service/importer/InstanceImporterTest.java
index 045e89e..bca35ee 100644
--- a/core/runtime/src/test/java/org/apache/zest/spi/service/importer/InstanceImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/spi/service/importer/InstanceImporterTest.java
@@ -46,8 +46,6 @@ public class InstanceImporterTest
     @Test
     public void givenSingletonServiceObjectWhenServicesAreInjectedThenSingletonIsFound()
     {
-        module.instance().injectTo( this );
-
         assertThat( "service is injected properly", service.helloWorld(), equalTo( "Hello
World" ) );
     }
 


Mime
View raw message