You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/10/08 19:39:18 UTC

svn commit: r582907 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/service/invoker/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/

Author: dkulp
Date: Mon Oct  8 10:39:18 2007
New Revision: 582907

URL: http://svn.apache.org/viewvc?rev=582907&view=rev
Log:
Merged revisions 580130 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r580130 | dkulp | 2007-09-27 15:34:12 -0400 (Thu, 27 Sep 2007) | 2 lines
  
  Add some logging around the method invokation to make some debugging tasks easier.
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?rev=582907&r1=582906&r2=582907&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java Mon Oct  8 10:39:18 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/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties?rev=582907&r1=582906&r2=582907&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/Messages.properties Mon Oct  8 10:39:18 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/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?rev=582907&r1=582906&r2=582907&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java Mon Oct  8 10:39:18 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) {