Author: veithen Date: Mon Oct 17 20:47:17 2011 New Revision: 1185366 URL: http://svn.apache.org/viewvc?rev=1185366&view=rev Log: AXIS2-4902: Merged r1184808, r1184810 and r1184816 to the 1.6 branch.
Modified: axis/axis2/java/core/branches/1_6/ (props changed) axis/axis2/java/core/branches/1_6/modules/fastinfoset/pom.xml axis/axis2/java/core/branches/1_6/modules/integration/itest-build.xml axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java axis/axis2/java/core/branches/1_6/modules/kernel/pom.xml Propchange: axis/axis2/java/core/branches/1_6/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Oct 17 20:47:17 2011 @@ -1 +1 @@ -/axis/axis2/java/core/trunk:1068985,1069659,1069898,1070439,1072077,1072271,1072296,1072499,1072510,1075057,1078242,1081563,1081587,1081590,1082316,1082322,1082600,1082702,1082726,1082738,1083180,1083192,1083379,1083381,1083425,1083433,1083446,1084753,1085157,1085173,1085514,1085889,1085927,1085931,1087073,1088239,1088248-1088249,1088251,1088268,1088730,1088904,1089225,1089989,1090429,1090457,1091178,1091191,1094117,1096530,1096557,1099385,1099389,1100628,1101037,1103013,1103336,1103606,1103760,1128580,1128584,1128618,1128645,1130590,1131425,1134438,1134616,1136156,1136159,1136177,1137153,1137159,1138144,1138203,1139448,1139484,1147485,1149224,1149491,1149578,1150055,1154615,1156305,1156382,1157211,1157265,1157373,1157415,1157424,1157501,1157517,1157522,1157535,1163389,1166038,1166040,1167045,1174618 +/axis/axis2/java/core/trunk:1068985,1069659,1069898,1070439,1072077,1072271,1072296,1072499,1072510,1075057,1078242,1081563,1081587,1081590,1082316,1082322,1082600,1082702,1082726,1082738,1083180,1083192,1083379,1083381,1083425,1083433,1083446,1084753,1085157,1085173,1085514,1085889,1085927,1085931,1087073,1088239,1088248-1088249,1088251,1088268,1088730,1088904,1089225,1089989,1090429,1090457,1091178,1091191,1094117,1096530,1096557,1099385,1099389,1100628,1101037,1103013,1103336,1103606,1103760,1128580,1128584,1128618,1128645,1130590,1131425,1134438,1134616,1136156,1136159,1136177,1137153,1137159,1138144,1138203,1139448,1139484,1147485,1149224,1149491,1149578,1150055,1154615,1156305,1156382,1157211,1157265,1157373,1157415,1157424,1157501,1157517,1157522,1157535,1163389,1166038,1166040,1167045,1174618,1184808,1184810,1184816 Modified: axis/axis2/java/core/branches/1_6/modules/fastinfoset/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/fastinfoset/pom.xml?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/fastinfoset/pom.xml (original) +++ axis/axis2/java/core/branches/1_6/modules/fastinfoset/pom.xml Mon Oct 17 20:47:17 2011 @@ -202,7 +202,7 @@ <property name="axis2.home" value="${basedir}/target" /> <path id="maven.dependency.classpath"> - <path refid="maven.compile.classpath" /> + <path refid="maven.runtime.classpath" /> </path> <!-- compiling some custom wsdl files --> <property name="wsdl.source.dir" value="test-resources/wsdl" /> Modified: axis/axis2/java/core/branches/1_6/modules/integration/itest-build.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/integration/itest-build.xml?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/integration/itest-build.xml (original) +++ axis/axis2/java/core/branches/1_6/modules/integration/itest-build.xml Mon Oct 17 20:47:17 2011 @@ -29,7 +29,7 @@ <property name="axis2.home" value="${basedir}/target" /> <property name="maven.junit.jvmargs" value="" /> <path id="maven.dependency.classpath"> - <path refid="maven.compile.classpath" /> + <path refid="maven.runtime.classpath" /> </path> <!-- compiling some custom wsdl files --> <property name="wsdl.source.dir" value="test-resources/wsdl" /> Modified: axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java (original) +++ axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java Mon Oct 17 20:47:17 2011 @@ -20,9 +20,8 @@ package org.apache.axis2.datasource.jaxb; import org.apache.axiom.om.OMException; -import org.apache.axiom.om.OMText; import org.apache.axiom.om.impl.MTOMXMLStreamWriter; -import org.apache.axiom.om.impl.llom.OMTextImpl; +import org.apache.axiom.util.UIDGenerator; import org.apache.axis2.Constants; import org.apache.axis2.Constants.Configuration; import org.apache.axis2.context.MessageContext; @@ -191,7 +190,6 @@ public class JAXBAttachmentMarshaller ex */ private String addDataHandler(DataHandler dh, boolean isSWA) { String cid = null; - OMText textNode = null; // If this is an MTOMXMLStreamWriter then inform the writer // that it must write out this attachment (I guess we should do this @@ -200,22 +198,19 @@ public class JAXBAttachmentMarshaller ex if (log.isDebugEnabled()){ log.debug("adding DataHandler for SWA"); } - textNode = new OMTextImpl(dh, null); // If old SWA attachments, get the ID and add the attachment to message - cid = textNode.getContentID(); + cid = UIDGenerator.generateContentId(); addDataHandler(dh, cid); } else { if (log.isDebugEnabled()){ log.debug("adding DataHandler for MTOM"); } if (writer instanceof MTOMXMLStreamWriter) { - textNode = new OMTextImpl(dh, null); - if(((MTOMXMLStreamWriter) writer).isOptimizedThreshold(textNode)){ + cid = ((MTOMXMLStreamWriter)writer).prepareDataHandler(dh); + if (cid != null) { if (log.isDebugEnabled()){ log.debug("The MTOM attachment is written as an attachment part."); } - cid = textNode.getContentID(); - ((MTOMXMLStreamWriter) writer).writeOptimized(textNode); // Remember the attachment on the message. addDataHandler(dh, cid); } else { Modified: axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java (original) +++ axis/axis2/java/core/branches/1_6/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java Mon Oct 17 20:47:17 2011 @@ -19,6 +19,7 @@ package org.apache.axis2.jaxws.message.impl; +import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMNamespace; @@ -34,8 +35,6 @@ import org.apache.axiom.soap.SOAPFault; import org.apache.axiom.soap.SOAPFaultDetail; import org.apache.axiom.soap.SOAPHeader; import org.apache.axiom.soap.SOAPHeaderBlock; -import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory; -import org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory; import org.apache.axis2.jaxws.ExceptionFactory; import org.apache.axis2.jaxws.i18n.Messages; import org.apache.axis2.jaxws.message.Block; @@ -707,13 +706,13 @@ class XMLSpineImpl implements XMLSpine { private static SOAPFactory _getFactory(Protocol protocol) { SOAPFactory soapFactory; if (protocol == Protocol.soap11) { - soapFactory = new SOAP11Factory(); + soapFactory = OMAbstractFactory.getSOAP11Factory(); } else if (protocol == Protocol.soap12) { - soapFactory = new SOAP12Factory(); + soapFactory = OMAbstractFactory.getSOAP12Factory(); } else if (protocol == Protocol.rest) { // For REST, create a SOAP 1.1 Envelope to contain the message // This is consistent with Axis2. - soapFactory = new SOAP11Factory(); + soapFactory = OMAbstractFactory.getSOAP11Factory(); } else { throw ExceptionFactory .makeWebServiceException(Messages.getMessage("RESTIsNotSupported"), null); Modified: axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java (original) +++ axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java Mon Oct 17 20:47:17 2011 @@ -35,7 +35,7 @@ import java.io.BufferedReader; /** * JSONDataSource keeps the JSON String inside and consumes it when needed. This is to be kept in - * the OMSourcedElementImpl and can be used either to expand the tree or get the JSON String + * the OMSourcedElement and can be used either to expand the tree or get the JSON String * directly without expanding. This uses the "Mapped" JSON convention. */ Modified: axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java (original) +++ axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java Mon Oct 17 20:47:17 2011 @@ -22,8 +22,7 @@ package org.apache.axis2.json; import org.apache.axiom.om.OMDataSource; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMOutputFormat; -import org.apache.axiom.om.impl.llom.OMElementImpl; -import org.apache.axiom.om.impl.llom.OMSourcedElementImpl; +import org.apache.axiom.om.OMSourcedElement; import org.apache.axiom.soap.SOAPFault; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; @@ -66,7 +65,7 @@ public abstract class AbstractJSONMessag } /** - * Gives the JSON message as an array of bytes. If the payload is an OMSourcedElementImpl and + * Gives the JSON message as an array of bytes. If the payload is an OMSourcedElement and * it contains a JSONDataSource with a correctly formatted JSON String, gets it directly from * the DataSource and returns as a byte array. If not, the OM tree is expanded and it is * serialized into the output stream and byte array is returned. @@ -81,12 +80,12 @@ public abstract class AbstractJSONMessag public byte[] getBytes(MessageContext msgCtxt, OMOutputFormat format) throws AxisFault { OMElement element = msgCtxt.getEnvelope().getBody().getFirstElement(); - //if the element is an OMSourcedElementImpl and it contains a JSONDataSource with + //if the element is an OMSourcedElement and it contains a JSONDataSource with //correct convention, directly get the JSON string. - if (element instanceof OMSourcedElementImpl && - getStringToWrite(((OMSourcedElementImpl)element).getDataSource()) != null) { - String jsonToWrite = getStringToWrite(((OMSourcedElementImpl)element).getDataSource()); + if (element instanceof OMSourcedElement && + getStringToWrite(((OMSourcedElement)element).getDataSource()) != null) { + String jsonToWrite = getStringToWrite(((OMSourcedElement)element).getDataSource()); return jsonToWrite.getBytes(); //otherwise serialize the OM by expanding the tree } else { @@ -139,7 +138,7 @@ public abstract class AbstractJSONMessag /** * Writes the JSON message to the output stream with the correct convention. If the payload is - * an OMSourcedElementImpl and it contains a JSONDataSource with a correctly formatted JSON + * an OMSourcedElement and it contains a JSONDataSource with a correctly formatted JSON * String, gets it directly from the DataSource and writes to the output stream. If not, the OM * tree is expanded and it is serialized into the output stream. * * @@ -159,14 +158,14 @@ public abstract class AbstractJSONMessag //Mapped format cannot handle element with namespaces.. So cannot handle Faults if (element instanceof SOAPFault) { SOAPFault fault = (SOAPFault)element; - OMElement element2 = new OMElementImpl("Fault", null, element.getOMFactory()); + OMElement element2 = element.getOMFactory().createOMElement("Fault", null); element2.setText(fault.toString()); element = element2; } - if (element instanceof OMSourcedElementImpl && - getStringToWrite(((OMSourcedElementImpl)element).getDataSource()) != null) { + if (element instanceof OMSourcedElement && + getStringToWrite(((OMSourcedElement)element).getDataSource()) != null) { String jsonToWrite = - getStringToWrite(((OMSourcedElementImpl)element).getDataSource()); + getStringToWrite(((OMSourcedElement)element).getDataSource()); out.write(jsonToWrite.getBytes()); } else { @@ -198,9 +197,9 @@ public abstract class AbstractJSONMessag && Constants.Configuration.HTTP_METHOD_GET.equalsIgnoreCase(httpMethod)) { try { String jsonString; - if (dataOut instanceof OMSourcedElementImpl && getStringToWrite( - ((OMSourcedElementImpl) dataOut).getDataSource()) != null) { - jsonString = getStringToWrite(((OMSourcedElementImpl) + if (dataOut instanceof OMSourcedElement && getStringToWrite( + ((OMSourcedElement) dataOut).getDataSource()) != null) { + jsonString = getStringToWrite(((OMSourcedElement) dataOut).getDataSource()); } else { StringWriter out = new StringWriter(); Modified: axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java (original) +++ axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java Mon Oct 17 20:47:17 2011 @@ -23,7 +23,6 @@ import org.apache.axiom.om.OMAbstractFac import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; -import org.apache.axiom.om.impl.llom.OMSourcedElementImpl; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; import org.apache.axis2.addressing.EndpointReference; @@ -38,7 +37,7 @@ import java.io.Reader; import java.io.StringReader; import java.io.UnsupportedEncodingException; -/** Makes the OMSourcedElementImpl object with the JSONDataSource inside. */ +/** Makes the OMSourcedElement object with the JSONDataSource inside. */ public abstract class AbstractJSONOMBuilder implements Builder { @@ -47,12 +46,12 @@ public abstract class AbstractJSONOMBuil } /** - * gives the OMSourcedElementImpl using the incoming JSON stream + * gives the OMSourcedElement using the incoming JSON stream * * @param inputStream - incoming message as an input stream * @param contentType - content type of the message (eg: application/json) * @param messageContext - inflow message context - * @return OMSourcedElementImpl with JSONDataSource inside + * @return OMSourcedElement with JSONDataSource inside * @throws AxisFault */ @@ -146,7 +145,7 @@ public abstract class AbstractJSONOMBuil throw AxisFault.makeFault(e); } AbstractJSONDataSource jsonDataSource = getDataSource(reader, prefix, localName); - return new OMSourcedElementImpl(localName, ns, factory, jsonDataSource); + return factory.createOMElement(jsonDataSource, localName, ns); } protected abstract AbstractJSONDataSource getDataSource(Reader Modified: axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java (original) +++ axis/axis2/java/core/branches/1_6/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java Mon Oct 17 20:47:17 2011 @@ -21,7 +21,7 @@ package org.apache.axis2.json; import java.io.Reader; -/** Makes the OMSourcedElementImpl object with the JSONDataSource inside. */ +/** Makes the OMSourcedElement object with the JSONDataSource inside. */ public class JSONOMBuilder extends AbstractJSONOMBuilder { @Override Modified: axis/axis2/java/core/branches/1_6/modules/kernel/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/kernel/pom.xml?rev=1185366&r1=1185365&r2=1185366&view=diff ============================================================================== --- axis/axis2/java/core/branches/1_6/modules/kernel/pom.xml (original) +++ axis/axis2/java/core/branches/1_6/modules/kernel/pom.xml Mon Oct 17 20:47:17 2011 @@ -39,6 +39,7 @@ <dependency> <groupId>org.apache.ws.commons.axiom</groupId> <artifactId>axiom-impl</artifactId> + <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId>