cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r580130 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/service/invoker/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/
Date Thu, 27 Sep 2007 19:34:13 GMT
Author: dkulp
Date: Thu Sep 27 12:34:12 2007
New Revision: 580130

URL: http://svn.apache.org/viewvc?rev=580130&view=rev
Log:
Add some logging around the method invokation to make some debugging tasks easier.

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?rev=580130&r1=580129&r2=580130&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
Thu Sep 27 12:34:12 2007
@@ -22,8 +22,13 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.util.Arrays;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -36,11 +41,11 @@
 /**
  * Abstract implementation of Invoker.
  * <p>
- * 
- * @author Ben Yu Feb 10, 2006 10:57:23 PM
  */
 public abstract class AbstractInvoker implements Invoker {
-
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractInvoker.class);
+    
+    
     public Object invoke(Exchange exchange, Object o) {
 
         final Object serviceObject = getServiceObject(exchange);
@@ -73,7 +78,7 @@
             if (params != null) {
                 paramArray = params.toArray();
             }
-            
+
             res = performInvocation(exchange, serviceObject, m, paramArray);
             
             if (exchange.isOneWay()) {
@@ -87,23 +92,35 @@
                 t = e;
             }
             exchange.getInMessage().put(FaultMode.class, FaultMode.CHECKED_APPLICATION_FAULT);
-            throw createFault(t);
+            throw createFault(t, m, params, true);
         } catch (Fault f) {
             exchange.getInMessage().put(FaultMode.class, FaultMode.UNCHECKED_APPLICATION_FAULT);
             throw f;
         } catch (Exception e) {
             exchange.getInMessage().put(FaultMode.class, FaultMode.UNCHECKED_APPLICATION_FAULT);
-            throw createFault(e);
+            throw createFault(e, m, params, false);
         }
     }
     
-    protected Fault createFault(Throwable ex) {
-        return new Fault(ex);        
+    protected Fault createFault(Throwable ex, Method m, List<Object> params, boolean
checked) {
+        if (checked) {
+            return new Fault(ex);
+        } else {
+            return new Fault(new Message("EXCEPTION_INVOKING_OBJECT",
+                                         LOG,
+                                         ex.getMessage(), m.toString(), params),
+                                         ex);
+        }
     }
     
     protected Object performInvocation(Exchange exchange, final Object serviceObject, Method
m,
                                        Object[] paramArray) throws Exception {
         paramArray = insertExchange(m, paramArray, exchange);
+        if (LOG.isLoggable(Level.FINER)) {
+            LOG.log(Level.FINER, "INVOKING_METHOD", new Object[] {serviceObject, 
+                                                                  m,
+                                                                  Arrays.asList(paramArray)});
+        }
         return m.invoke(serviceObject, paramArray);
     }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties?rev=580130&r1=580129&r2=580130&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
Thu Sep 27 12:34:12 2007
@@ -22,3 +22,5 @@
 SVC_CLASS_IS_ABSTRACT=Could not instantiate service class {0} because it is abstract.
 COULD_NOT_INSTANTIATE=Couldn't instantiate service object.
 ILLEGAL_ACCESS=Couldn't access service object.
+EXCEPTION_INVOKING_OBJECT={0} while invoking {1} with params {2}.
+INVOKING_METHOD=Invoking method {1} on object {0} with params {2}.
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?rev=580130&r1=580129&r2=580130&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
Thu Sep 27 12:34:12 2007
@@ -61,7 +61,7 @@
         super(factory, scope);
     }
 
-    protected Fault createFault(Throwable ex) {
+    protected Fault createFault(Throwable ex, Method m, List<Object> params, boolean
checked) {
         //map the JAX-WS faults
         if (ex instanceof SOAPFaultException) {
             SOAPFaultException sfe = (SOAPFaultException)ex;
@@ -73,7 +73,7 @@
             
             return fault;
         }
-        return super.createFault(ex);
+        return super.createFault(ex, m, params, checked);
     }
     
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object>
params) {



Mime
View raw message