You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/07/28 15:13:06 UTC
svn commit: r426496 - in /webservices/axis2/trunk/java/modules:
addressing/src/org/apache/axis2/handlers/addressing/
core/src/org/apache/axis2/transport/http/ core/src/org/apache/axis2/util/
Author: dims
Date: Fri Jul 28 06:13:05 2006
New Revision: 426496
URL: http://svn.apache.org/viewvc?rev=426496&view=rev
Log:
Standardize the options of flags for setProperty ("true"/"false" OR Boolean.TRUE/Boolean.FALSE)
Modified:
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=426496&r1=426495&r2=426496&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Fri Jul 28 06:13:05 2006
@@ -27,6 +27,7 @@
import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
+import org.apache.axis2.util.JavaUtils;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.addressing.RelatesTo;
@@ -50,16 +51,15 @@
String namespace = addressingNamespace;
// it should be able to disable addressing by some one.
- Boolean
- property = (Boolean) msgContext.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+ Object property = msgContext.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
if (property == null && msgContext.getOperationContext() != null) {
// check in the IN message context, if available
MessageContext inMsgCtxt = msgContext.getOperationContext().getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
if (inMsgCtxt != null) {
- property = (Boolean) inMsgCtxt.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
+ property = inMsgCtxt.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
}
}
- if (property != null && property.booleanValue()) {
+ if (property != null && JavaUtils.isTrueExplicitly(property)) {
log.debug("Addressing is disabled .....");
return;
}
@@ -113,8 +113,8 @@
// headers if there are any (this was the case so far).
Object replaceHeadersParam = msgContext.getProperty(REPLACE_ADDRESSING_HEADERS);
boolean replaceHeaders = false;
- if (replaceHeadersParam != null && replaceHeadersParam instanceof Boolean) {
- replaceHeaders = ((Boolean) replaceHeadersParam).booleanValue();
+ if (replaceHeadersParam != null) {
+ replaceHeaders = JavaUtils.isTrueExplicitly(replaceHeadersParam);
}
// processing WSA To
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?rev=426496&r1=426495&r2=426496&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Fri Jul 28 06:13:05 2006
@@ -27,6 +27,7 @@
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.util.Utils;
+import org.apache.axis2.util.JavaUtils;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HeaderElement;
@@ -613,8 +614,8 @@
protected HttpClient getHttpClient(MessageContext msgContext) {
HttpClient httpClient = null;
- Boolean reuse = (Boolean) msgContext.getOptions().getProperty(HTTPConstants.REUSE_HTTP_CLIENT);
- if (reuse != null && reuse.booleanValue()) {
+ Object reuse = msgContext.getOptions().getProperty(HTTPConstants.REUSE_HTTP_CLIENT);
+ if (reuse != null && JavaUtils.isTrueExplicitly(reuse)) {
httpClient = (HttpClient) msgContext.getConfigurationContext().getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
if (httpClient == null) {
MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java?rev=426496&r1=426495&r2=426496&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/SOAPOverHTTPSender.java Fri Jul 28 06:13:05 2006
@@ -22,6 +22,7 @@
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
+import org.apache.axis2.util.JavaUtils;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.i18n.Messages;
import org.apache.commons.httpclient.Header;
@@ -195,8 +196,8 @@
}
public void writeRequest(OutputStream out) throws IOException {
- Boolean gzip = (Boolean) msgCtxt.getOptions().getProperty(HTTPConstants.MC_GZIP_REQUEST);
- if(gzip != null && gzip.booleanValue() && chunked) {
+ Object gzip = msgCtxt.getOptions().getProperty(HTTPConstants.MC_GZIP_REQUEST);
+ if(gzip != null && JavaUtils.isTrueExplicitly(gzip) && chunked) {
out = new GZIPOutputStream(out);
}
try {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=426496&r1=426495&r2=426496&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Fri Jul 28 06:13:05 2006
@@ -395,11 +395,8 @@
}
public static boolean isExplicitlyTrue(MessageContext messageContext, String propertyName) {
- Boolean flag = (Boolean) messageContext.getProperty(propertyName);
- if (flag != null) {
- return flag.booleanValue();
- }
- return false;
+ Object flag = messageContext.getProperty(propertyName);
+ return JavaUtils.isTrueExplicitly(flag);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org