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-6191] Optionally avoiding depending on Spring in ClassHelper and ClasspathScanner
Date Wed, 14 Jan 2015 20:26:58 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes b6b7a419a -> d905b113b


[CXF-6191] Optionally avoiding depending on Spring in ClassHelper and ClasspathScanner


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

Branch: refs/heads/2.7.x-fixes
Commit: d905b113b73b3ecf48332fa02050a8a25feeda2e
Parents: b6b7a41
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Jan 14 17:00:25 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Jan 14 20:26:19 2015 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/common/util/ClassHelper.java | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d905b113/api/src/main/java/org/apache/cxf/common/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/common/util/ClassHelper.java b/api/src/main/java/org/apache/cxf/common/util/ClassHelper.java
index 645f780..ce6e4da 100644
--- a/api/src/main/java/org/apache/cxf/common/util/ClassHelper.java
+++ b/api/src/main/java/org/apache/cxf/common/util/ClassHelper.java
@@ -25,19 +25,29 @@ package org.apache.cxf.common.util;
 public class ClassHelper {
     static final ClassHelper HELPER;
     static {
-        ClassHelper theHelper = null;
-        try {
-            theHelper = new SpringAopClassHelper();
-        } catch (Throwable ex) {
-            theHelper = new ClassHelper();
-        }
-        HELPER = theHelper;
+        HELPER = getClassHelper();
     }
     
     
     protected ClassHelper() {
     }
     
+    private static ClassHelper getClassHelper() { 
+        boolean useSpring = true;
+        String s = SystemPropertyAction.getPropertyOrNull("org.apache.cxf.useSpringClassHelpers");
+        if (!StringUtils.isEmpty(s)) {
+            useSpring = "1".equals(s) || Boolean.parseBoolean(s);
+        }
+        if (useSpring) {
+            try {
+                return new SpringAopClassHelper();
+            } catch (Throwable ex) {
+                // ignore
+            }
+        }
+        return new ClassHelper();
+    }
+
     protected Class<?> getRealClassInternal(Object o) {
         return o.getClass();
     }


Mime
View raw message