summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/core-spi/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-20 16:46:55 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-05-20 16:46:55 +0000
commitb099739d69690535623b126b37f47bfdfecf040f (patch)
tree252ab5e26d6e6f2c804c43744ff22d68ce3b353f /java/sca/modules/core-spi/src
parentf1863df3c7da7a4632ef3ca70d430d62ed387bad (diff)
Refactoring a few methods on the ServiceDiscover
Adding an OSGi service registry based ExtensionPointRegistry implementation git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@776759 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/core-spi/src')
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java2
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java4
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java4
-rw-r--r--java/sca/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java1
4 files changed, 5 insertions, 6 deletions
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java
index 7a35036f03..3c4be9cd55 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPoint.java
@@ -94,7 +94,7 @@ public class DefaultContextFactoryExtensionPoint implements ContextFactoryExtens
// Dynamically load a factory class declared under META-INF/services
try {
- ServiceDeclaration factoryDeclaration = ServiceDiscovery.getInstance().getFirstServiceDeclaration(factoryInterface.getName());
+ ServiceDeclaration factoryDeclaration = ServiceDiscovery.getInstance().getServiceDeclaration(factoryInterface.getName());
if (factoryDeclaration != null) {
Class<?> factoryClass = factoryDeclaration.loadClass();
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java
index fc1c2ed5af..b68a485e55 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultDefinitionsProviderExtensionPoint.java
@@ -21,8 +21,8 @@ package org.apache.tuscany.sca.provider;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-import java.util.Set;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
@@ -63,7 +63,7 @@ public class DefaultDefinitionsProviderExtensionPoint implements
return;
}
// Get the provider service declarations
- Set<ServiceDeclaration> defnProviderDecls;
+ Collection<ServiceDeclaration> defnProviderDecls;
DefinitionsProvider aProvider = null;
Class<?> providerClass = null;
Constructor<?> constructor = null;
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
index 518927939f..84e000ab10 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
@@ -21,10 +21,10 @@ package org.apache.tuscany.sca.provider;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Implementation;
@@ -128,7 +128,7 @@ public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExte
private List<ProviderFactory> loadProviderFactories(Class<?> factoryClass) {
// Get the provider factory service declarations
- Set<ServiceDeclaration> factoryDeclarations;
+ Collection<ServiceDeclaration> factoryDeclarations;
ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
try {
factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass.getName());
diff --git a/java/sca/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java b/java/sca/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java
index 3a27569a3b..6486a5ed4f 100644
--- a/java/sca/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java
+++ b/java/sca/modules/core-spi/src/test/java/org/apache/tuscany/sca/context/DefaultContextFactoryExtensionPointTestCase.java
@@ -20,7 +20,6 @@ package org.apache.tuscany.sca.context;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-
import org.junit.Assert;
import org.junit.Test;