cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1381380 - in /cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension: Extension.java Messages.properties
Date Wed, 05 Sep 2012 21:18:11 GMT
Author: dkulp
Date: Wed Sep  5 21:18:10 2012
New Revision: 1381380

URL: http://svn.apache.org/viewvc?rev=1381380&view=rev
Log:
Cleanup the exception messages a little bit for extension loading issues.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java?rev=1381380&r1=1381379&r2=1381380&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java Wed Sep  5
21:18:10 2012
@@ -22,12 +22,16 @@ package org.apache.cxf.bus.extension;
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 
 public class Extension {
-   
+    private static final Logger LOG = LogUtils.getL7dLogger(Extension.class);
+    
     protected String className;
     protected ClassLoader classloader;
     protected Class<?> clazz;
@@ -164,7 +168,7 @@ public class Extension {
             } catch (Throwable nex) {
                 notFound = true;
                 if (!optional) {
-                    throw new ExtensionException(nex);
+                    throw new ExtensionException(new Message("PROBLEM_LOADING_EXTENSION_CLASS",
LOG, name), nex);
                 }
             }
         }
@@ -216,6 +220,8 @@ public class Extension {
                 //ignore
             }
             obj = cls.newInstance();
+        } catch (ExtensionException ex) {
+            throw ex;
         } catch (IllegalAccessException ex) {
             throw new ExtensionException(ex);
         } catch (InstantiationException ex) {

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties?rev=1381380&r1=1381379&r2=1381380&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties Wed Sep
 5 21:18:10 2012
@@ -19,3 +19,4 @@
 #
 #
 DEPRECATED_EXTENSIONS = Loading Bus extensions via {0} (found url {1}) is deprecated.  Use
{2} instead.
+PROBLEM_LOADING_EXTENSION_CLASS = Could not load extension class {0}.
\ No newline at end of file



Mime
View raw message