cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r746374 - in /cxf/trunk: api/src/main/java/org/apache/cxf/interceptor/Fault.java api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java
Date Fri, 20 Feb 2009 21:44:25 GMT
Author: dkulp
Date: Fri Feb 20 21:44:25 2009
New Revision: 746374

URL: http://svn.apache.org/viewvc?rev=746374&view=rev
Log:
Restore exception logging in PIC. 
Add utility contructors to Fault to make it easier to use and avoid Message import issues.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java
    cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java?rev=746374&r1=746373&r2=746374&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java Fri Feb 20 21:44:25
2009
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.interceptor;
 
+import java.util.ResourceBundle;
+import java.util.logging.Logger;
+
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
@@ -51,6 +54,19 @@
         code = FAULT_CODE_SERVER;
     }
 
+    public Fault(String message, Logger log) {
+        this(new Message(message, log));
+    }
+    public Fault(String message, ResourceBundle b) {
+        this(new Message(message, b));
+    }
+    public Fault(String message, Logger log, Throwable t) {
+        this(new Message(message, log), t);
+    }
+    public Fault(String message, ResourceBundle b, Throwable t) {
+        this(new Message(message, b), t);
+    }
+    
     public Fault(Throwable t) {
         super(t);
         if (super.getMessage() != null) {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=746374&r1=746373&r2=746374&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Fri Feb 20
21:44:25 2009
@@ -239,23 +239,27 @@
                     FaultMode mode = message.get(FaultMode.class);
                     if (mode == FaultMode.CHECKED_APPLICATION_FAULT) {
                         if (LOG.isLoggable(Level.FINE)) { 
-                            LOG.fine("Application has thrown exception, unwinding now " +
ex.getMessage());
+                            LogUtils.log(LOG, Level.FINE,
+                                         "Application has thrown exception, unwinding now",
ex);
                         } else if (LOG.isLoggable(Level.INFO)) {
                             Throwable t = ex;
                             if (ex instanceof Fault
                                 && ex.getCause() != null) {
                                 t = ex.getCause();
-                            }  
-                                       
-                            LOG.info("Application has thrown exception, unwinding now: "
+                            }                            
+                            
+                            LogUtils.log(LOG, Level.INFO,
+                                         "Application has thrown exception, unwinding now:
"
                                          + t.getClass().getName() 
-                                         + ": " + ex.getMessage());          
+                                         + ": " + ex.getMessage());
                         }
                     } else if (LOG.isLoggable(Level.INFO)) {
                         if (mode == FaultMode.UNCHECKED_APPLICATION_FAULT) {
-                            LOG.info("Application has thrown exception, unwinding now " +
ex.getMessage());
+                            LogUtils.log(LOG, Level.INFO,
+                                         "Application has thrown exception, unwinding now",
ex);
                         } else {
-                            LOG.info("Interceptor has thrown exception, unwinding now " +
ex.getMessage());
+                            LogUtils.log(LOG, Level.INFO,
+                                         "Interceptor has thrown exception, unwinding now",
ex);
                         }
                     }
 

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java?rev=746374&r1=746373&r2=746374&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/cxf1332/Cxf1332Test.java Fri Feb 20 21:44:25
2009
@@ -21,7 +21,6 @@
 
 import org.apache.cxf.test.AbstractCXFSpringTest;
 import org.junit.Test;
-import org.springframework.context.support.GenericApplicationContext;
 
 /**
  * 
@@ -34,11 +33,6 @@
     public Cxf1332Test() throws Exception {
     }
 
-    /** {@inheritDoc}*/
-    @Override
-    protected void additionalSpringConfiguration(GenericApplicationContext context) throws
Exception {
-    }
-    
     @Test
     public void tryToSendStringArray() throws Exception {
         Cxf1332 client = getBean(Cxf1332.class, "client");
@@ -52,5 +46,4 @@
     protected String[] getConfigLocations() {
         return new String[] {"classpath:/org/apache/cxf/cxf1332/beans.xml" };
     }
-
 }



Mime
View raw message