polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [30/34] zest-java git commit: Fixed missing inclusion for finding importedServices in TypeLookup and findServiceReferences()
Date Thu, 14 Apr 2016 06:13:36 GMT
Fixed missing inclusion for finding importedServices in TypeLookup and findServiceReferences()


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

Branch: refs/heads/develop
Commit: e5c57f95e199f8a79763debb2e101028f8e8f896
Parents: be492ed
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Wed Apr 13 23:14:44 2016 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Wed Apr 13 23:14:44 2016 +0800

----------------------------------------------------------------------
 .../zest/runtime/service/ImportedServicesInstance.java      | 6 ++++++
 .../org/apache/zest/runtime/structure/ModuleInstance.java   | 9 +++++----
 .../org/apache/zest/runtime/structure/TypeLookupImpl.java   | 2 +-
 3 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/e5c57f95/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServicesInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServicesInstance.java
b/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServicesInstance.java
index 4178dc7..6952df7 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServicesInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/service/ImportedServicesInstance.java
@@ -114,4 +114,10 @@ public class ImportedServicesInstance
     {
         return servicesModel.models();
     }
+
+    public Stream<ServiceReference<?>> references()
+    {
+        return serviceReferences.stream();
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e5c57f95/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
index ce458c9..54500e5 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -85,6 +84,7 @@ import org.apache.zest.spi.entitystore.EntityStore;
 import org.apache.zest.spi.metrics.MetricsProviderAdapter;
 import org.apache.zest.spi.module.ModuleSpi;
 
+import static java.util.stream.Stream.concat;
 import static org.apache.zest.functional.Iterables.iterable;
 
 /**
@@ -400,9 +400,10 @@ public class ModuleInstance
     private <T> ServiceReference<T> findServiceReferenceInstance( ModelDescriptor
model )
     {
         ModuleInstance moduleInstanceOfModel = (ModuleInstance) model.module().instance();
-        Optional<ServiceReference<?>> candidate = moduleInstanceOfModel.services.references()
-            .filter( ref -> ref.model().equals( model ) )
-            .findAny();
+        Optional<ServiceReference<?>> candidate =
+            concat( moduleInstanceOfModel.services.references(), moduleInstanceOfModel.importedServices.references()
)
+                .filter( ref -> ref.model().equals( model ) )
+                .findAny();
         if( candidate.isPresent() )
         {
             ServiceReference<?> serviceReference = candidate.get();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/e5c57f95/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookupImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookupImpl.java
b/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookupImpl.java
index aba9b22..3e04d57 100755
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookupImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookupImpl.java
@@ -355,7 +355,7 @@ class TypeLookupImpl
                     )
             );
         Stream<? extends ModelDescriptor> importedServices =
-            concat( moduleModel.serviceComposites(),
+            concat( moduleModel.importedServices(),
                     concat(
                         concat(
                             moduleModel.layer()


Mime
View raw message