Author: veithen
Date: Wed Aug 24 22:08:05 2011
New Revision: 1161302
URL: http://svn.apache.org/viewvc?rev=1161302&view=rev
Log:
AXIOM-377: Resolved an old TODO item that would prevent streaming of MTOM
messages with multiple attachments.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OptimizationPolicyImpl.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OptimizationPolicyImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OptimizationPolicyImpl.java?rev=1161302&r1=1161301&r2=1161302&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OptimizationPolicyImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OptimizationPolicyImpl.java
Wed Aug 24 22:08:05 2011
@@ -81,10 +81,11 @@ class OptimizationPolicyImpl implements
if (!optimize) {
return false;
+ } else if (format.getOptimizedThreshold() == 0) {
+ // If no threshold is set, return the result immediately and avoid
the call to
+ // DataHandlerProvider#getDataHandler(), which would force loading
the data handler.
+ return true;
} else {
- // TODO: this is suboptimal because it forces loading of the data
handler;
- // note that it is strictly the same logic as was applied in
the old
- // MTOMXMLStreamWriter#isOptimizedThreshold method
return isOptimized(dataHandlerProvider.getDataHandler(), optimize);
}
}