Author: hemapani Date: Wed Jan 5 07:48:44 2011 New Revision: 1055338 URL: http://svn.apache.org/viewvc?rev=1055338&view=rev Log: fixing https://issues.apache.org/jira/browse/AXIS2-4196
Modified: axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/MessageContextChangeTest.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/MessageContext.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Modified: axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/MessageContextChangeTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/MessageContextChangeTest.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/MessageContextChangeTest.java (original) +++ axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/MessageContextChangeTest.java Wed Jan 5 07:48:44 2011 @@ -56,7 +56,7 @@ public class MessageContextChangeTest ex new FieldDescription("java.lang.String", "TRANSPORT_SUCCEED"), new FieldDescription("java.lang.String", "DEFAULT_CHAR_SET_ENCODING"), new FieldDescription("int", "FLOW"), - new FieldDescription("java.lang.String", "TRANSPORT_NON_BLOCKING"), + new FieldDescription("java.lang.String", "CLIENT_API_NON_BLOCKING"), new FieldDescription("java.lang.String", "DISABLE_ASYNC_CALLBACK_ON_TRANSPORT_ERROR"), new FieldDescription("boolean", "processingFault"), new FieldDescription("boolean", "paused"), Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/MessageContext.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/MessageContext.java Wed Jan 5 07:48:44 2011 @@ -235,11 +235,15 @@ public class MessageContext extends Abst public int FLOW = IN_FLOW; /** - * To invoke fireAndforget method we have to hand over transport sending logic to a thread - * other wise user has to wait till it get transport response (in the case of HTTP its HTTP - * 202) + * To invoke fireAndforget method we have to hand over transport sending logic to a thread + * other wise user has to wait till it get transport response (in the case of HTTP its HTTP + * 202) + * 202). This was eariler named TRANSPORT_NON_BLOCKING, but that name is wrong as transport non blocking is NIO, + * which has nothing to do with this property. See https://issues.apache.org/jira/browse/AXIS2-4196. + * Renaming this to CLIENT_API_NON_BLOCKING instead. + * */ - public static final String TRANSPORT_NON_BLOCKING = "transportNonBlocking"; + public static final String CLIENT_API_NON_BLOCKING = "ClientApiNonBlocking"; /** * This property allows someone (e.g. RM) to disable an async callback from Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java Wed Jan 5 07:48:44 2011 @@ -307,7 +307,7 @@ class OutInAxisOperationClient extends O } //if we don't do this , this guy will wait till it gets HTTP 202 in the HTTP case - mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE); + mc.setProperty(MessageContext.CLIENT_API_NON_BLOCKING, Boolean.TRUE); mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc); AxisEngine.send(mc); if (internalCallback != null) { Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Wed Jan 5 07:48:44 2011 @@ -46,10 +46,13 @@ import org.apache.axis2.transport.Transp import org.apache.axis2.util.CallbackReceiver; import org.apache.axis2.util.LoggingControl; import org.apache.axis2.util.MessageContextBuilder; +import org.apache.axis2.util.Utils; import org.apache.axis2.wsdl.WSDLConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + + /** * There is one engine for the Server and the Client. the send() and receive() * Methods are the basic operations the Sync, Async messageing are build on top. @@ -433,10 +436,7 @@ public class AxisEngine { // This boolean property only used in client side fireAndForget invocation //It will set a property into message context and if some one has set the //property then transport sender will invoke in a diffrent thread - Object isTransportNonBlocking = msgContext.getProperty( - MessageContext.TRANSPORT_NON_BLOCKING); - if (isTransportNonBlocking != null && - ((Boolean) isTransportNonBlocking).booleanValue()) { + if (Utils.isClientThreadNonBlockingPropertySet(msgContext)) { msgContext.getConfigurationContext().getThreadPool().execute( new TransportNonBlockingInvocationWorker(msgContext, sender)); } else { Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java Wed Jan 5 07:48:44 2011 @@ -799,4 +799,22 @@ public class Utils { return serviceObject == null ? null : serviceObject.getClass(); } } + + /** + * this is to make is backward compatible. Get rid of this at the next major release. + * @param messageContext + * @return + */ + + public static boolean isClientThreadNonBlockingPropertySet(MessageContext messageContext){ + Object val = messageContext.getProperty( + MessageContext.CLIENT_API_NON_BLOCKING); + if(val != null && ((Boolean)val).booleanValue()){ + return true; + }else{ + //put the string inline as this is to be removed + val = messageContext.getProperty("transportNonBlocking"); + return val != null && ((Boolean)val).booleanValue(); + } + } } Modified: axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java?rev=1055338&r1=1055337&r2=1055338&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java (original) +++ axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java Wed Jan 5 07:48:44 2011 @@ -298,12 +298,11 @@ public class HTTPSender extends Abstract processResponse(method, msgContext); } - Object isTransportNonBlocking = msgContext.getProperty( - MessageContext.TRANSPORT_NON_BLOCKING); - if (isTransportNonBlocking != null && (Boolean)isTransportNonBlocking) { - throw new AxisFault(Messages.getMessage("transportError", - String.valueOf(statusCode), - method.getStatusText())); + + if (org.apache.axis2.util.Utils.isClientThreadNonBlockingPropertySet(msgContext)) { + throw new AxisFault(Messages.getMessage("transportError", + String.valueOf(statusCode), + method.getStatusText())); } } else { throw new AxisFault(Messages.getMessage("transportError",