You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by th...@apache.org on 2006/10/15 14:58:31 UTC

svn commit: r464163 - in /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom: attachments/ om/impl/builder/ soap/impl/builder/

Author: thilina
Date: Sun Oct 15 05:58:30 2006
New Revision: 464163

URL: http://svn.apache.org/viewvc?view=rev&rev=464163
Log:
Introducing XOPBuilder interface...
Builder hierachy is getting too complicated... we need to do something fast :(

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPBuilder.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPAwareStAXOMBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/MTOMStAXSOAPModelBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java?view=diff&rev=464163&r1=464162&r2=464163
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java Sun Oct 15 05:58:30 2006
@@ -332,14 +332,17 @@
 	 * @throws IllegalStateException
 	 *             if application has alreadt started using Part's directly
 	 */
-    public IncomingAttachmentStreams getIncomingAttachmentStreams() throws IllegalStateException {
-    	if (partsRequested) {
-    		throw new IllegalStateException("The attachments stream can only be accessed once; either by using the IncomingAttachmentStreams class or by getting a collection of AttachmentPart objects. They cannot both be called within the life time of the same service request.");
-    	}
-    	if (noStreams)
-    	{
-    		throw new IllegalStateException("The attachments map was created programatically. No streams are available.");
-    	}
+    public IncomingAttachmentStreams getIncomingAttachmentStreams()
+			throws IllegalStateException {
+		if (partsRequested) {
+			throw new IllegalStateException(
+					"The attachments stream can only be accessed once; either by using the IncomingAttachmentStreams class or by getting a " +
+					"collection of AttachmentPart objects. They cannot both be called within the life time of the same service request.");
+		}
+		if (noStreams) {
+			throw new IllegalStateException(
+					"The attachments map was created programatically. No streams are available.");
+		}
 
     	streamsRequested = true;
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPAwareStAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPAwareStAXOMBuilder.java?view=diff&rev=464163&r1=464162&r2=464163
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPAwareStAXOMBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPAwareStAXOMBuilder.java Sun Oct 15 05:58:30 2006
@@ -37,7 +37,7 @@
 
 import sun.misc.GC.LatencyRequest;
 
-public class XOPAwareStAXOMBuilder extends StAXOMBuilder {
+public class XOPAwareStAXOMBuilder extends StAXOMBuilder implements XOPBuilder{
 
 	/**
 	 * <code>Attachments</code> handles deferred parsing of incoming MIME

Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPBuilder.java?view=auto&rev=464163
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPBuilder.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/XOPBuilder.java Sun Oct 15 05:58:30 2006
@@ -0,0 +1,12 @@
+package org.apache.axiom.om.impl.builder;
+
+import javax.activation.DataHandler;
+
+import org.apache.axiom.om.OMException;
+
+public interface XOPBuilder {
+
+	public abstract DataHandler getDataHandler(String blobContentID)
+			throws OMException;
+
+}
\ No newline at end of file

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/MTOMStAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/MTOMStAXSOAPModelBuilder.java?view=diff&rev=464163&r1=464162&r2=464163
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/MTOMStAXSOAPModelBuilder.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/soap/impl/builder/MTOMStAXSOAPModelBuilder.java Sun Oct 15 05:58:30 2006
@@ -24,6 +24,7 @@
 import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axiom.om.impl.OMNodeEx;
+import org.apache.axiom.om.impl.builder.XOPBuilder;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -34,7 +35,7 @@
 import java.net.URLDecoder;
 
 public class MTOMStAXSOAPModelBuilder extends StAXSOAPModelBuilder implements
-		MTOMConstants {
+		MTOMConstants, XOPBuilder {
 
 	/**
 	 * <code>Attachments</code> handles deferred parsing of incoming MIME
@@ -96,6 +97,9 @@
 		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.apache.axiom.soap.impl.builder.XOPBuilder#getDataHandler(java.lang.String)
+	 */
 	public DataHandler getDataHandler(String blobContentID) throws OMException {
 		DataHandler dataHandler = attachments.getDataHandler(blobContentID);
 		if (dataHandler == null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org