cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1497515 - in /cxf/branches/2.7.x-fixes/rt: core/src/main/java/org/apache/cxf/bus/extension/ transports/http-hc/src/main/resources/META-INF/cxf/
Date Thu, 27 Jun 2013 19:28:41 GMT
Author: dkulp
Date: Thu Jun 27 19:28:41 2013
New Revision: 1497515

URL: http://svn.apache.org/r1497515
Log:
Merged revisions 1497481 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1497481 | dkulp | 2013-06-27 14:04:21 -0400 (Thu, 27 Jun 2013) | 2 lines

  [CXF-5099] Fix problem of optional extensions not being truely optional

........

Modified:
    cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
    cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
    cxf/branches/2.7.x-fixes/rt/transports/http-hc/src/main/resources/META-INF/cxf/bus-extensions.txt

Modified: cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java?rev=1497515&r1=1497514&r2=1497515&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
Thu Jun 27 19:28:41 2013
@@ -230,19 +230,18 @@ public class Extension {
             }
             obj = cls.getConstructor().newInstance();
         } catch (ExtensionException ex) {
-            throw ex;
-        } catch (IllegalAccessException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), ex);
-        } catch (InstantiationException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), ex);
-        } catch (IllegalArgumentException e) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
-        } catch (SecurityException e) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
+            notFound = true;
+            if (!optional) {
+                throw ex;
+            }
         } catch (InvocationTargetException ex) {
-            throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), 
-                                         ex.getCause());
+            notFound = true;
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), 
+                                             ex.getCause());
+            }
         } catch (NoSuchMethodException ex) {
+            notFound = true;
             List<Object> a = new ArrayList<Object>();
             if (b != null) {
                 a.add(b);
@@ -250,8 +249,15 @@ public class Extension {
             if (args != null) {
                 a.add(args);
             }
-            throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
-                                                     cls.getName(), a), ex);
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
+                                                         cls.getName(), a), ex);
+            }
+        } catch (Throwable e) {
+            notFound = true;
+            if (!optional) {
+                throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS",
LOG, cls.getName()), e);
+            }
         }
         return obj;
     }

Modified: cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java?rev=1497515&r1=1497514&r2=1497515&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
Thu Jun 27 19:28:41 2013
@@ -197,6 +197,9 @@ public class ExtensionManagerImpl implem
         }
  
         Object obj = e.load(loader, bus);
+        if (obj == null) {
+            return;
+        }
         
         if (null != activated) {
             Configurer configurer = (Configurer)(activated.get(Configurer.class));

Modified: cxf/branches/2.7.x-fixes/rt/transports/http-hc/src/main/resources/META-INF/cxf/bus-extensions.txt
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/transports/http-hc/src/main/resources/META-INF/cxf/bus-extensions.txt?rev=1497515&r1=1497514&r2=1497515&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/transports/http-hc/src/main/resources/META-INF/cxf/bus-extensions.txt
(original)
+++ cxf/branches/2.7.x-fixes/rt/transports/http-hc/src/main/resources/META-INF/cxf/bus-extensions.txt
Thu Jun 27 19:28:41 2013
@@ -1,2 +1,2 @@
-org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory:org.apache.cxf.transport.http.HTTPConduitFactory:true
+org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory:org.apache.cxf.transport.http.HTTPConduitFactory:true:true
 



Mime
View raw message