svn commit: r1184808 - in /axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2: datasource/jaxb/JAXBAttachmentMarshaller.java jaxws/message/impl/XMLSpineImpl.java

2011-10-16 Thread veithen
Author: veithen
Date: Sun Oct 16 12:14:49 2011
New Revision: 1184808

URL: http://svn.apache.org/viewvc?rev=1184808&view=rev
Log:
AXIS2-4902: Removed remaining references to Axiom LLOM implementation classes 
in jaxws.

Modified:

axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java

axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java?rev=1184808&r1=1184807&r2=1184808&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
 Sun Oct 16 12:14:49 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/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?rev=1184808&r1=1184807&r2=1184808&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
 Sun Oct 16 12:14:49 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();

svn commit: r1184810 - in /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json: AbstractJSONDataSource.java AbstractJSONMessageFormatter.java AbstractJSONOMBuilder.java JSONOMBuilder.jav

2011-10-16 Thread veithen
Author: veithen
Date: Sun Oct 16 12:25:02 2011
New Revision: 1184810

URL: http://svn.apache.org/viewvc?rev=1184810&view=rev
Log:
AXIS2-4902: Removed illegal references to Axiom implementation classes.

Modified:

axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java

axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java

axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java

axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java

Modified: 
axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java?rev=1184810&r1=1184809&r2=1184810&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
 Sun Oct 16 12:25:02 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/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java?rev=1184810&r1=1184809&r2=1184810&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
 Sun Oct 16 12:25:02 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 w

svn commit: r1184816 - in /axis/axis2/java/core/trunk/modules: fastinfoset/pom.xml integration/itest-build.xml kernel/pom.xml

2011-10-16 Thread veithen
Author: veithen
Date: Sun Oct 16 13:12:57 2011
New Revision: 1184816

URL: http://svn.apache.org/viewvc?rev=1184816&view=rev
Log:
AXIS2-4902: Changed the scope of the axiom-impl dependency to runtime in order 
to avoid introduction of new code that references Axiom implementation classes 
directly.

Modified:
axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml
axis/axis2/java/core/trunk/modules/integration/itest-build.xml
axis/axis2/java/core/trunk/modules/kernel/pom.xml

Modified: axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml?rev=1184816&r1=1184815&r2=1184816&view=diff
==
--- axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/fastinfoset/pom.xml Sun Oct 16 13:12:57 
2011
@@ -202,7 +202,7 @@
 
 
 
-
+
 
 
 

Modified: axis/axis2/java/core/trunk/modules/integration/itest-build.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/integration/itest-build.xml?rev=1184816&r1=1184815&r2=1184816&view=diff
==
--- axis/axis2/java/core/trunk/modules/integration/itest-build.xml (original)
+++ axis/axis2/java/core/trunk/modules/integration/itest-build.xml Sun Oct 16 
13:12:57 2011
@@ -29,7 +29,7 @@



-   
+   




Modified: axis/axis2/java/core/trunk/modules/kernel/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/pom.xml?rev=1184816&r1=1184815&r2=1184816&view=diff
==
--- axis/axis2/java/core/trunk/modules/kernel/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/kernel/pom.xml Sun Oct 16 13:12:57 2011
@@ -39,6 +39,7 @@
 
 org.apache.ws.commons.axiom
 axiom-impl
+runtime
 
 
 org.apache.geronimo.specs




svn commit: r1184857 - in /axis/axis2/java/core/trunk/modules/adb: pom.xml src/org/apache/axis2/databinding/utils/BeanUtil.java

2011-10-16 Thread veithen
Author: veithen
Date: Sun Oct 16 16:13:37 2011
New Revision: 1184857

URL: http://svn.apache.org/viewvc?rev=1184857&view=rev
Log:
AXIS2-4902: Eliminated a couple of direct references to the Axiom DOOM 
implementation.

Modified:
axis/axis2/java/core/trunk/modules/adb/pom.xml

axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java

Modified: axis/axis2/java/core/trunk/modules/adb/pom.xml
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/pom.xml?rev=1184857&r1=1184856&r2=1184857&view=diff
==
--- axis/axis2/java/core/trunk/modules/adb/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/adb/pom.xml Sun Oct 16 16:13:37 2011
@@ -46,6 +46,7 @@
 
 org.apache.ws.commons.axiom
 axiom-dom
+runtime
 
 
 org.apache.geronimo.specs

Modified: 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=1184857&r1=1184856&r2=1184857&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
 Sun Oct 16 16:13:37 2011
@@ -56,8 +56,6 @@ import javax.xml.stream.XMLStreamReader;
 
 import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
-import org.apache.axiom.om.impl.dom.DocumentImpl;
 import org.apache.axiom.om.util.Base64;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.classloader.BeanInfoCache;
@@ -1327,9 +1325,10 @@ public class BeanUtil {
 * @return the DOOM document
 */
public static OMDocument convertOMtoDOM(OMContainer omElement) {
-   // use AXIOM DOOMAbstractFactory to get org.w3c.dom.Document
-   OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
-   StAXOMBuilder doomBuilder = new StAXOMBuilder(doomFactory,
+   // use an Axiom meta factory with feature "dom" to get 
org.w3c.dom.Document
+   OMFactory doomFactory = OMAbstractFactory.getMetaFactory(
+   OMAbstractFactory.FEATURE_DOM).getOMFactory();
+   OMXMLParserWrapper doomBuilder = 
OMXMLBuilderFactory.createStAXOMBuilder(doomFactory,
omElement.getXMLStreamReader());
OMDocument domElement = doomBuilder.getDocument();
return domElement;
@@ -1344,7 +1343,7 @@ public class BeanUtil {
 */
public static OMElement convertDOMtoOM(OMFactory fac, Object document) {

-   
if(DocumentImpl.class.getName().equals(document.getClass().getName())) {
+   if (document instanceof OMDocument) {
return ((OMDocument)document).getOMDocumentElement();

} else {




svn commit: r1184865 - /axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java

2011-10-16 Thread veithen
Author: veithen
Date: Sun Oct 16 16:44:56 2011
New Revision: 1184865

URL: http://svn.apache.org/viewvc?rev=1184865&view=rev
Log:
Eliminated an invalid reference to an Axiom LLOM implementation class.

Modified:

axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java

Modified: 
axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java?rev=1184865&r1=1184864&r2=1184865&view=diff
==
--- 
axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java
 (original)
+++ 
axis/axis2/java/transports/trunk/modules/xmpp/src/org/apache/axis2/transport/xmpp/util/XMPPPacketListener.java
 Sun Oct 16 16:44:56 2011
@@ -28,10 +28,10 @@ import java.util.concurrent.Executor;
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
@@ -285,7 +285,7 @@ public class XMPPPacketListener implemen
msgCtx.setServerSide(true);

//TODO : need to support SOAP12 as well
-   SOAPFactory soapFactory = new SOAP11Factory();
+   SOAPFactory soapFactory = 
OMAbstractFactory.getSOAP11Factory();
envelope = BuilderUtil.buildsoapMessage(msgCtx, 
parameterMap,
 soapFactory);
//TODO : improve error handling & messages