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-108] Throw exception if a service has multiple interfaces
Date Wed, 14 Sep 2016 09:35:23 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master 8ff43bef6 -> b193d0bdb


[DOSGI-108] Throw exception if a service has multiple interfaces


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

Branch: refs/heads/master
Commit: b193d0bdb4e6b1fa9e1155b16eae091ac9168e4f
Parents: 8ff43be
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Sep 14 11:34:56 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Sep 14 11:34:56 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java   | 3 +++
 .../java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java     | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/b193d0bd/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
----------------------------------------------------------------------
diff --git a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
index b618050..66f6ff1 100644
--- a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
+++ b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
@@ -90,6 +90,9 @@ public class RsProvider implements DistributionProvider {
                                  BundleContext consumerContext,
                                  Class[] interfaces,
                                  EndpointDescription endpoint) {
+        if (interfaces.length > 1) {
+            throw new IllegalArgumentException("Multiple interfaces are not supported by
this provider");
+        }
         Set<String> intentNames = intentManager.getImported(endpoint.getProperties());
         List<Object> intents = intentManager.getRequiredIntents(intentNames);
         Class<?> iClass = interfaces[0];

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/b193d0bd/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
----------------------------------------------------------------------
diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
index 3bc28ee..bd1b541 100644
--- a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
+++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
@@ -95,6 +95,9 @@ public class WsProvider implements DistributionProvider {
                                  BundleContext consumerContext,
                                  Class[] interfaces,
                                  EndpointDescription endpoint) throws IntentUnsatisfiedException
{
+        if (interfaces.length > 1) {
+            throw new IllegalArgumentException("Multiple interfaces are not supported by
this provider");
+        }
         Class<?> iClass = interfaces[0];
         Map<String, Object> sd = endpoint.getProperties();
         String address = getClientAddress(sd);


Mime
View raw message