cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf-dosgi git commit: [DOSGI-229] Remove wrongly added method from API again
Date Fri, 04 Mar 2016 11:26:24 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master f54fb69b9 -> 3d3ebed88


[DOSGI-229] Remove wrongly added method from API again


Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/3d3ebed8
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/3d3ebed8
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/3d3ebed8

Branch: refs/heads/master
Commit: 3d3ebed889b1e02c9702079deb62157b018c1a27
Parents: f54fb69
Author: Christian Schneider <chris@die-schneider.net>
Authored: Fri Mar 4 12:26:18 2016 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Fri Mar 4 12:26:18 2016 +0100

----------------------------------------------------------------------
 .../cxf/dosgi/dsw/api/DistributionProvider.java    |  6 ------
 .../AbstractPojoConfigurationTypeHandler.java      |  5 -----
 .../dsw/handlers/CXFDistributionProvider.java      |  4 ----
 .../dosgi/dsw/service/RemoteServiceAdminCore.java  | 17 ++++++++++++++++-
 4 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d3ebed8/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/api/DistributionProvider.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/api/DistributionProvider.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/api/DistributionProvider.java
index ec804be..fad6b03 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/api/DistributionProvider.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/api/DistributionProvider.java
@@ -50,10 +50,4 @@ public interface DistributionProvider {
                           EndpointDescription endpoint)
         throws IntentUnsatisfiedException;
     
-    /**
-     * 
-     * @param endpoint
-     * @return if the provider can handle any of the config types of the endpoint
-     */
-    boolean canHandle(EndpointDescription endpoint);
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d3ebed8/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
index 60f8222..9cbb839 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
@@ -276,9 +276,4 @@ public abstract class AbstractPojoConfigurationTypeHandler implements
Distributi
         }
     }
     
-    @Override
-    public boolean canHandle(EndpointDescription endpoint) {
-        // Will be handled by CXFDistributionProvider at the moment
-        throw new IllegalStateException();
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d3ebed8/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProvider.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProvider.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProvider.java
index 27aff63..dad4a89 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProvider.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/CXFDistributionProvider.java
@@ -170,8 +170,4 @@ public class CXFDistributionProvider implements DistributionProvider {
         return supportedConfigurationTypes;
     }
 
-    @Override
-    public boolean canHandle(EndpointDescription endpoint) {
-        return determineConfigTypesForImport(endpoint).size() > 0;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/3d3ebed8/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
----------------------------------------------------------------------
diff --git a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
index 55a53aa..2a3469c 100644
--- a/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
+++ b/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminCore.java
@@ -315,7 +315,7 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
                 return ir;
             }
 
-            if (!provider.canHandle(endpoint)) {
+            if (determineConfigTypesForImport(endpoint).size() == 0) {
                 LOG.info("No matching handler can be found for remote endpoint {}.", endpoint.getId());
                 return null;
             }
@@ -347,6 +347,21 @@ public class RemoteServiceAdminCore implements RemoteServiceAdmin {
             return imReg;
         }
     }
+    
+    private List<String> determineConfigTypesForImport(EndpointDescription endpoint)
{
+        List<String> remoteConfigurationTypes = endpoint.getConfigurationTypes();
+
+        List<String> usableConfigurationTypes = new ArrayList<String>();
+        for (String ct : provider.getSupportedTypes()) {
+            if (remoteConfigurationTypes.contains(ct)) {
+                usableConfigurationTypes.add(ct);
+            }
+        }
+
+        LOG.info("Ignoring endpoint {} as it has no compatible configuration types: {}.",

+                 endpoint.getId(), remoteConfigurationTypes);
+        return usableConfigurationTypes;
+    }
 
     protected ImportRegistrationImpl exposeServiceFactory(String interfaceName,
                                             EndpointDescription epd,


Mime
View raw message