You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2016/05/10 23:55:11 UTC

[1/2] cxf git commit: CXF-6896: CDI integration: duplicate service / feature / provider beans are registered when Application class has singletons

Repository: cxf
Updated Branches:
  refs/heads/master 01d06cee0 -> 61765fce3


CXF-6896: CDI integration: duplicate service / feature / provider beans are registered when Application class has singletons


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

Branch: refs/heads/master
Commit: e14d803ff84be7c59dd7c2321f1090231967d45c
Parents: 01d06ce
Author: reta <dr...@gmail.com>
Authored: Tue May 10 19:53:39 2016 -0400
Committer: reta <dr...@gmail.com>
Committed: Tue May 10 19:53:39 2016 -0400

----------------------------------------------------------------------
 .../cxf/cdi/JAXRSCdiResourceExtension.java      | 36 --------------------
 1 file changed, 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e14d803f/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
----------------------------------------------------------------------
diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
index b5d88c6..85b63f0 100644
--- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
+++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java
@@ -19,10 +19,7 @@
 package org.apache.cxf.cdi;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.ServiceLoader;
 
 import javax.enterprise.event.Observes;
@@ -44,7 +41,6 @@ import javax.ws.rs.ext.Provider;
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.extension.ExtensionManagerBus;
 import org.apache.cxf.feature.Feature;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
 
@@ -146,44 +142,12 @@ public class JAXRSCdiResourceExtension implements Extension {
     private JAXRSServerFactoryBean createFactoryInstance(final Application application) {
         
         final JAXRSServerFactoryBean instance = ResourceUtils.createApplication(application, false, false);
-        final Map< Class< ? >, List< Object > > classified = classifySingletons(application.getSingletons());
-        instance.setServiceBeans(classified.get(Path.class));
-        instance.setProviders(classified.get(Provider.class));
-        instance.setFeatures(CastUtils.cast(classified.get(Feature.class), Feature.class));
         instance.setBus(bus);
 
         return instance; 
     }
     
     /**
-     * JAX-RS application has defined singletons as being instances of any providers, resources and features.
-     * In the JAXRSServerFactoryBean, those should be split around several method calls depending on instance
-     * type. At the moment, only the Feature is CXF-specific and should be replaced by JAX-RS Feature implementation.
-     * @param singletons application singletons
-     * @return classified singletons by instance types
-     */
-    private Map< Class< ? >, List< Object > > classifySingletons(final Collection< Object > singletons) {
-        final Map< Class< ? >, List< Object > > classified = 
-            new HashMap< Class< ? >, List< Object > >();
-        
-        classified.put(Feature.class, new ArrayList< Object >());
-        classified.put(Provider.class, new ArrayList< Object >());
-        classified.put(Path.class, new ArrayList< Object >());
-        
-        for (final Object singleton: singletons) {
-            if (singleton instanceof Feature) {
-                classified.get(Feature.class).add(singleton);
-            } else if (singleton.getClass().isAnnotationPresent(Provider.class)) {
-                classified.get(Provider.class).add(singleton);
-            } else if (singleton.getClass().isAnnotationPresent(Path.class)) {
-                classified.get(Path.class).add(singleton);
-            }
-        }
-        
-        return classified;
-    }
-
-    /**
      * Load external providers from service loader
      * @return loaded external providers
      */


[2/2] cxf git commit: Fixing spring-boot module build files (pom.xml)

Posted by re...@apache.org.
Fixing spring-boot module build files (pom.xml)


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

Branch: refs/heads/master
Commit: 61765fce367f92dc4338b3b8c6a8a45ef9fcb6dc
Parents: e14d803
Author: reta <dr...@gmail.com>
Authored: Tue May 10 19:54:52 2016 -0400
Committer: reta <dr...@gmail.com>
Committed: Tue May 10 19:54:52 2016 -0400

----------------------------------------------------------------------
 integration/spring-boot/autoconfigure/pom.xml  | 1 +
 integration/spring-boot/pom.xml                | 1 +
 integration/spring-boot/starter-jax-rs/pom.xml | 1 +
 integration/spring-boot/starter-jax-ws/pom.xml | 1 +
 4 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/61765fce/integration/spring-boot/autoconfigure/pom.xml
----------------------------------------------------------------------
diff --git a/integration/spring-boot/autoconfigure/pom.xml b/integration/spring-boot/autoconfigure/pom.xml
index 3608885..f22048c 100644
--- a/integration/spring-boot/autoconfigure/pom.xml
+++ b/integration/spring-boot/autoconfigure/pom.xml
@@ -28,6 +28,7 @@
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-parent</artifactId>
         <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
     <dependencies>
         <!-- Compile -->

http://git-wip-us.apache.org/repos/asf/cxf/blob/61765fce/integration/spring-boot/pom.xml
----------------------------------------------------------------------
diff --git a/integration/spring-boot/pom.xml b/integration/spring-boot/pom.xml
index 580767b..a50fd10 100644
--- a/integration/spring-boot/pom.xml
+++ b/integration/spring-boot/pom.xml
@@ -28,6 +28,7 @@
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-integration</artifactId>
         <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
     </parent>
     <modules>
         <module>autoconfigure</module>

http://git-wip-us.apache.org/repos/asf/cxf/blob/61765fce/integration/spring-boot/starter-jax-rs/pom.xml
----------------------------------------------------------------------
diff --git a/integration/spring-boot/starter-jax-rs/pom.xml b/integration/spring-boot/starter-jax-rs/pom.xml
index 1bc54db..a08889b 100644
--- a/integration/spring-boot/starter-jax-rs/pom.xml
+++ b/integration/spring-boot/starter-jax-rs/pom.xml
@@ -28,6 +28,7 @@
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-parent</artifactId>
         <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/cxf/blob/61765fce/integration/spring-boot/starter-jax-ws/pom.xml
----------------------------------------------------------------------
diff --git a/integration/spring-boot/starter-jax-ws/pom.xml b/integration/spring-boot/starter-jax-ws/pom.xml
index 6117393..03aabb0 100644
--- a/integration/spring-boot/starter-jax-ws/pom.xml
+++ b/integration/spring-boot/starter-jax-ws/pom.xml
@@ -28,6 +28,7 @@
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-parent</artifactId>
         <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
     <dependencies>
         <dependency>