ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1733702 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/ axiom-api/src/main/java/org/apache/axiom/attachments...
Date Sat, 05 Mar 2016 11:40:39 GMT
Author: veithen
Date: Sat Mar  5 11:40:38 2016
New Revision: 1733702

URL: http://svn.apache.org/viewvc?rev=1733702&view=rev
Log:
Remove the OMAttachmentAccessor interface.

Removed:
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMAttachmentAccessor.java
Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java
    webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/NamespaceURIInterningXMLStreamReaderWrapper.java
Sat Mar  5 11:40:38 2016
@@ -18,7 +18,6 @@
  */
 package org.apache.axiom.om.impl.common;
 
-import javax.activation.DataHandler;
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLStreamReader;
 
@@ -57,10 +56,6 @@ public final class NamespaceURIInterning
         return intern(super.getNamespaceURI(prefix));
     }
 
-    public DataHandler getDataHandler(String blobcid) {
-        return ((OMXMLStreamReader)getParent()).getDataHandler(blobcid);
-    }
-
     public NamespaceContext getNamespaceContext() {
         NamespaceContext namespaceContext = super.getNamespaceContext();
         if (namespaceContextWrapper == null || namespaceContextWrapper.getParent() != namespaceContext)
{

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
Sat Mar  5 11:40:38 2016
@@ -18,20 +18,14 @@
  */
 package org.apache.axiom.om.impl.common.serializer.pull;
 
-import java.io.IOException;
-
-import javax.activation.DataHandler;
 import javax.xml.stream.util.StreamReaderDelegate;
 
 import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.om.impl.OMXMLStreamReaderEx;
 import org.apache.axiom.util.stax.xop.ContentIDGenerator;
 import org.apache.axiom.util.stax.xop.OptimizationPolicy;
 import org.apache.axiom.util.stax.xop.XOPEncodingStreamReader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * Adapter that adds the {@link OMXMLStreamReaderEx} interface to a {@link PullSerializer}.
@@ -40,8 +34,6 @@ import org.apache.commons.logging.LogFac
  * {@link OMXMLStreamReader} are deprecated.
  */
 public class OMXMLStreamReaderExAdapter extends StreamReaderDelegate implements OMXMLStreamReaderEx
{
-    private static final Log log = LogFactory.getLog(OMXMLStreamReaderExAdapter.class);
-    
     private final PullSerializer serializer;
     private XOPEncodingStreamReader xopEncoder;
     
@@ -75,27 +67,6 @@ public class OMXMLStreamReaderExAdapter
         }
     }
 
-    public DataHandler getDataHandler(String contentID) {
-        if (contentID.startsWith("cid:")) {
-            log.warn("Invalid usage of OMStAXWrapper#getDataHandler(String): the argument
must " +
-            		"be a content ID, not an href; see OMAttachmentAccessor.");
-            contentID = contentID.substring(4);
-        }
-        
-        if (xopEncoder == null) {
-            throw new IllegalStateException("The wrapper is in inlineMTOM=true mode");
-        }
-        if (xopEncoder.getContentIDs().contains(contentID)) {
-            try {
-                return xopEncoder.getDataHandler(contentID);
-            } catch (IOException ex) {
-                throw new OMException(ex);
-            }
-        } else {
-            return null;
-        }
-    }
-    
     public OMDataSource getDataSource() {
         return serializer.getDataSource();
     }

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
(original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
Sat Mar  5 11:40:38 2016
@@ -27,7 +27,6 @@ import org.apache.axiom.blob.WritableBlo
 import org.apache.axiom.blob.WritableBlobFactory;
 import org.apache.axiom.ext.activation.SizeAwareDataSource;
 import org.apache.axiom.mime.ContentType;
-import org.apache.axiom.om.OMAttachmentAccessor;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.MTOMConstants;
 
@@ -41,7 +40,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.Map;
 
-public class Attachments implements OMAttachmentAccessor {
+public class Attachments {
     private final AttachmentsDelegate delegate;
    
     /**

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java (original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMContainer.java Sat
Mar  5 11:40:38 2016
@@ -27,7 +27,6 @@ import javax.xml.transform.sax.SAXResult
 import javax.xml.transform.sax.SAXSource;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
-import org.apache.axiom.util.stax.xop.XOPEncodingStreamReader;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.DTDHandler;
 import org.xml.sax.ext.DeclHandler;
@@ -327,40 +326,6 @@ public interface OMContainer extends OMS
      * <p>
      * The caller MUST NOT make any other assumption about the returned reader, in particular
about
      * its runtime type.
-     * <p>
-     * <b>Note</b> (non normative): For various reasons, existing code based
on Axiom versions
-     * prior to 1.2.9 makes assumptions on the returned reader that should no longer be considered
-     * valid:
-     * <ul>
-     * <li>Some code uses the {@link OMXMLStreamReader} interface of the returned reader
to switch
-     * off MTOM inlining using {@link OMXMLStreamReader#setInlineMTOM(boolean)}. This has
now been
-     * deprecated and it is recommended to use
-     * {@link XOPEncodingStreamReader} instead.</li>
-     * <li>Some existing code uses the {@link OMAttachmentAccessor} interface of the
returned
-     * reader to fetch attachments using {@link OMAttachmentAccessor#getDataHandler(String)}.
There
-     * is no reason anymore to do so:
-     * <ul>
-     * <li>When {@link OMXMLStreamReader#setInlineMTOM(boolean)} is used to disable
MTOM inlining,
-     * {@link OMAttachmentAccessor#getDataHandler(String)} must be used to retrieve the binary
-     * content. The fact that this method is deprecated removes the need for this.</li>
-     * <li>In Axiom versions prior to 1.2.9, the sequence of events was inconsistent
if the
-     * underlying stream is XOP encoded and caching is disabled (see AXIOM-255). This made
it
-     * necessary for the caller to (partially) handle the XOP processing and to use
-     * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve the binary content.
Starting
-     * with 1.2.9 this is no longer be the case: as specified above, the sequence of events
is
-     * independent of the state of the object model and the value of the <code>cache</code>
-     * parameter, and all binary content is reported through the
-     * {@link DataHandlerReader} extension.</li>
-     * <li>Finally, it should be noted that {@link OMAttachmentAccessor#getDataHandler(String)}
-     * doesn't give access to the attachments in the SwA case (neither in 1.2.9 nor in previous
-     * versions).</li>
-     * </ul>
-     * </li>
-     * </ul>
-     * <p>
-     * Code making any of these assumptions should be fixed, so that only {@link XMLStreamReader}
-     * and {@link DataHandlerReader} are used (and if
-     * necessary, {@link XOPEncodingStreamReader}).
      * 
      * @param cache
      *            indicates if caching should be enabled

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java
(original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMXMLStreamReader.java
Sat Mar  5 11:40:38 2016
@@ -23,7 +23,7 @@ import javax.xml.stream.XMLStreamReader;
 /**
  * Objects returned by OMElement.getXMLStreamReader may implement this interface
  */
-public interface OMXMLStreamReader extends XMLStreamReader, OMAttachmentAccessor {
+public interface OMXMLStreamReader extends XMLStreamReader {
     
     /**
      * By default, an OMText item that has an MTOM datahandler 

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java
(original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/util/OMXMLStreamReaderValidator.java
Sat Mar  5 11:40:38 2016
@@ -21,8 +21,6 @@ package org.apache.axiom.om.util;
 import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.util.stax.debug.XMLStreamReaderValidator;
 
-import javax.activation.DataHandler;
-
 /**
  * Subclass of {@link XMLStreamReaderValidator} that also implements {@link OMXMLStreamReader}.
  *
@@ -37,11 +35,6 @@ public class OMXMLStreamReaderValidator
         super(delegate, throwExceptions);
     }
 
-    public DataHandler getDataHandler(String blobcid) {
-        return ((OMXMLStreamReader)getParent()).getDataHandler(blobcid);
-    }
-
-
     public boolean isInlineMTOM() {
         return ((OMXMLStreamReader)getParent()).isInlineMTOM();
     }

Modified: webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md?rev=1733702&r1=1733701&r2=1733702&view=diff
==============================================================================
--- webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md (original)
+++ webservices/axiom/trunk/src/site/markdown/release-notes/1.3.0.md Sat Mar  5 11:40:38 2016
@@ -145,4 +145,7 @@ Changes in this release
     been processed. That means that after completion, nodes created by a builder
     will be indistinguishable from programmatically created nodes.
 
+*   The `OMAttachmentAccessor` interface has been removed because all if its
+    usages were already deprecated in 1.2.x.
+
 [AXIOM-474]: https://issues.apache.org/jira/browse/AXIOM-474



Mime
View raw message