[jboss-svn-commits] JBL Code SVN: r37460 - in labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap: src/main/java/org/jboss/soa/esb/actions/soap/wise and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Sep 8 17:35:51 EDT 2011
Author: tcunning
Date: 2011-09-08 17:35:50 -0400 (Thu, 08 Sep 2011)
New Revision: 37460
Added:
labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/ContinueOnFaultThreadLocal.java
Modified:
labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodInvokeAspect.java
labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
Log:
JBESB-3678
Remove use of system property, use ThreadLocal variable instead to
store the flag for whether a message continues after SOAP Fault.
Modified: labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodInvokeAspect.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodInvokeAspect.java 2011-09-08 18:27:24 UTC (rev 37459)
+++ labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/aop/java/org/jboss/internal/soa/esb/soap/wise/WSMethodInvokeAspect.java 2011-09-08 21:35:50 UTC (rev 37460)
@@ -1,3 +1,24 @@
+/*
+ * 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 it.javalinux.wise.core.client.InvocationResult;
@@ -5,6 +26,7 @@
import it.javalinux.wise.core.client.WSMethod;
import it.javalinux.wise.core.mapper.WiseMapper;
import it.javalinux.wise.core.exceptions.WiseException;
+import org.jboss.soa.esb.actions.soap.wise.ContinueOnFaultThreadLocal;
import java.util.Map;
@@ -29,8 +51,7 @@
final WSMethod wsMethod = (WSMethod)invocation.getTargetObject();
- boolean continueOnSOAPFault = Boolean.parseBoolean(System.getProperty("ContinueOnSOAPFault"));
- if (!continueOnSOAPFault) {
+ if (!ContinueOnFaultThreadLocal.get().booleanValue()) {
try {
return (InvocationResult) invocation.invokeNext();
} catch (Throwable t) {
Added: labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/ContinueOnFaultThreadLocal.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/ContinueOnFaultThreadLocal.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/ContinueOnFaultThreadLocal.java 2011-09-08 21:35:50 UTC (rev 37460)
@@ -0,0 +1,44 @@
+/*
+ * 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.soa.esb.actions.soap.wise;
+
+/**
+ * ThreadLocal helper for storing whether to continue on a SOAP Fault.
+ *
+ * @author tcunning
+ */
+public class ContinueOnFaultThreadLocal {
+
+ public static final ThreadLocal<Boolean> continueThreadLocal = new ThreadLocal();
+
+ public static void set (boolean bool) {
+ continueThreadLocal.set(new Boolean(bool));
+ }
+
+ public static void set (Boolean bool) {
+ continueThreadLocal.set(bool);
+ }
+
+ public static Boolean get() {
+ return continueThreadLocal.get();
+ }
+}
Modified: labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2011-09-08 18:27:24 UTC (rev 37459)
+++ labs/jbossesb/branches/JBESB_4_10_CP/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/wise/SOAPClient.java 2011-09-08 21:35:50 UTC (rev 37460)
@@ -43,6 +43,7 @@
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.publish.Publish;
+import org.jboss.soa.esb.actions.soap.wise.ContinueOnFaultThreadLocal;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
import org.jboss.soa.esb.actions.ActionProcessingException;
@@ -183,7 +184,7 @@
private final List<String> customHandlers = new ArrayList<String>();
private final MessagePayloadProxy payloadProxy;
private boolean loggingEnabled = false;
- private boolean continueOnSOAPFault = false;
+ private boolean continueOnFault = false;
private WSDynamicClient client;
@@ -201,7 +202,7 @@
username = config.getAttribute("username");
password = config.getAttribute("password");
loggingEnabled = Boolean.parseBoolean(config.getAttribute("LoggingMessages"));
- continueOnSOAPFault = Boolean.parseBoolean(config.getAttribute("ContinueOnSOAPFault"));
+ continueOnFault = Boolean.parseBoolean(config.getAttribute("ContinueOnSOAPFault"));
logger.debug("loggingEnabled:" + loggingEnabled);
@@ -261,7 +262,7 @@
InvocationResult result;
try
{
- System.setProperty("ContinueOnSOAPFault", "" + continueOnSOAPFault);
+ ContinueOnFaultThreadLocal.set(continueOnFault);
result = wsMethod.invoke(payload, smooksRequestMapper);
}
catch (final WiseException e)
More information about the jboss-svn-commits
mailing list