cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6131] Minor updates
Date Wed, 03 Dec 2014 10:57:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 25d92ab9b -> 29f0620a9


[CXF-6131] Minor updates


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

Branch: refs/heads/master
Commit: 29f0620a9a025afcd2057cdf97c7d93caf6c179f
Parents: 25d92ab
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Dec 3 10:56:45 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Dec 3 10:56:45 2014 +0000

----------------------------------------------------------------------
 .../apache/cxf/common/util/SpringClasspathScanner.java    |  3 +++
 .../spring/JAXRSServerFactoryBeanDefinitionParser.java    | 10 +---------
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/29f0620a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
index ce4dd7f..de9369e 100644
--- a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
+++ b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
@@ -165,6 +165,9 @@ class SpringClasspathScanner extends ClasspathScanner {
             //in OSGi should use spring-dm OsgiBundleResourcePatternResolver
             // which can handle bundle url
             Bundle bundle = null;
+            if (loader == null) {
+                loader = Thread.currentThread().getContextClassLoader();
+            }
             if (loader instanceof BundleDelegatingClassLoader) {
                 bundle = ((BundleDelegatingClassLoader)loader).getBundle();
             } else {

http://git-wip-us.apache.org/repos/asf/cxf/blob/29f0620a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
index e17bd1a..7f15346 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
@@ -21,7 +21,6 @@ package org.apache.cxf.jaxrs.spring;
 import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -32,7 +31,6 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.bus.osgi.CXFActivator;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.util.ClasspathScanner;
 import org.apache.cxf.common.util.StringUtils;
@@ -194,14 +192,8 @@ public class JAXRSServerFactoryBeanDefinitionParser extends AbstractBeanDefiniti
             
             try {
                 if (basePackages != null) {
-                    //if run CXF in OSGi, we should pass in the classloader associated with
-                    //the bundle which has JAXRS resources under a certain basePackages
-                    ClassLoader loader = Thread.currentThread().getContextClassLoader();
                     final Map< Class< ? extends Annotation >, Collection< Class<
? > > > classes =
-                        CXFActivator.isInOSGi()
-                            ? ClasspathScanner.findClasses(
-                                  basePackages, Arrays.asList(Provider.class, Path.class),
loader)
-                            : ClasspathScanner.findClasses(basePackages, Provider.class,
Path.class);
+                        ClasspathScanner.findClasses(basePackages, Provider.class, Path.class);
                                               
                     this.setProviders(createBeans(classes.get(Provider.class)));
                     this.setServiceBeans(createBeans(classes.get(Path.class)));


Mime
View raw message