[jboss-svn-commits] JBL Code SVN: r31049 - in labs/jbossesb/trunk/product/services/soap: aop/resources/META-INF and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jan 13 05:12:45 EST 2010


Author: tfennelly
Date: 2010-01-13 05:12:45 -0500 (Wed, 13 Jan 2010)
New Revision: 31049

Added:
   labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodIsOneWayAspect.java
Modified:
   labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
https://jira.jboss.org/jira/browse/JBESB-3117
Merge JBESB-3083: Wise SOAPClient action is unable to invoke oneway methods on the endpoints

Copied: labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodIsOneWayAspect.java (from rev 31048, labs/jbossesb/branches/JBESB_4_7_CP/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodIsOneWayAspect.java)
===================================================================
--- labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodIsOneWayAspect.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodIsOneWayAspect.java	2010-01-13 10:12:45 UTC (rev 31049)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.soap.wise;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * Aspect used to bypass erroneous OneWay handling inside the WSMethod.invoke method.
+ * <p/>
+ * The WSMethod.invoke method does not invoke the endpoint for OneWay ops.  This advice
+ * forces the WSMethod.invoke to always return false and so execute as though it
+ * was a TwoWay.
+ * 
+ * @author <a href='mailto:tom.fennelly at jboss.com'>Tom Fennelly</a>
+ */
+public class WSMethodIsOneWayAspect {
+	
+    public Object isOneWay(final MethodInvocation invocation) throws Throwable {
+        return false;
+    }
+}

Modified: labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml	2010-01-13 10:04:26 UTC (rev 31048)
+++ labs/jbossesb/trunk/product/services/soap/aop/resources/META-INF/jboss-aop.xml	2010-01-13 10:12:45 UTC (rev 31049)
@@ -2,6 +2,7 @@
 <aop xmlns="urn:jboss:aop-beans:1.0">
    <aspect class="org.jboss.internal.soa.esb.soap.wise.WSMethodParameterMappingAspect" scope="PER_VM"/>
    <aspect class="org.jboss.internal.soa.esb.soap.wise.WSDynamicClientClasspathAspect" scope="PER_VM"/>
+   <aspect class="org.jboss.internal.soa.esb.soap.wise.WSMethodIsOneWayAspect" scope="PER_VM"/>
    <aspect class="org.jboss.internal.soa.esb.soap.ws.CompilerAspect" scope="PER_VM"/>
    
    <bind pointcut="execution(* it.javalinux.wise.core.client.WSMethod->getParmeterInRightPositionArray(..))">
@@ -16,6 +17,10 @@
       <advice name="defineAdditionalCompilerClassPath" aspect="org.jboss.internal.soa.esb.soap.wise.WSDynamicClientClasspathAspect"/>
    </bind>
    
+   <bind pointcut="execution(* it.javalinux.wise.core.client.WSMethod->isOneWay(..))">
+      <advice name="isOneWay" aspect="org.jboss.internal.soa.esb.soap.wise.WSMethodIsOneWayAspect"/>
+   </bind>
+   
    <bind pointcut="execution(* com.sun.tools.ws.wscompile.JavaCompilerHelper->getJarFile(..))">
       <advice name="getJarFile" aspect="org.jboss.internal.soa.esb.soap.ws.CompilerAspect"/>
    </bind>

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java	2010-01-13 10:04:26 UTC (rev 31048)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java	2010-01-13 10:12:45 UTC (rev 31049)
@@ -31,9 +31,11 @@
 import it.javalinux.wise.core.mapper.WiseMapper;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
+import javax.jws.Oneway;
 import javax.xml.ws.handler.Handler;
 
 import org.apache.log4j.Logger;
@@ -249,6 +251,10 @@
             try 
             {
                 result = wsMethod.invoke(payload, smooksRequestMapper);
+                if(wsMethod.getMethod().getAnnotation(Oneway.class) != null) {
+                	// Nulling the result for OneWays.  See WSMethodIsOneWayAspect.
+                	result = new InvocationResult(null, null, Collections.EMPTY_MAP);
+                }
             } 
             catch (final WiseException e) 
             {



More information about the jboss-svn-commits mailing list