axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r490302 - in /webservices/axis2/trunk/java/modules: saaj-api/src/javax/xml/soap/ saaj/src/org/apache/axis2/saaj/
Date Tue, 26 Dec 2006 14:26:38 GMT
Author: dims
Date: Tue Dec 26 06:26:37 2006
New Revision: 490302

URL: http://svn.apache.org/viewvc?view=rev&rev=490302
Log:
Add SAAJMetaFactoryImpl and get rid of setSOAPVersion hack (won't work if someone uses sun's
saaj-api jar)

Added:
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SAAJMetaFactoryImpl.java
Modified:
    webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/MessageFactory.java
    webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SAAJMetaFactory.java
    webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SOAPFactory.java

Modified: webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/MessageFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/MessageFactory.java?view=diff&rev=490302&r1=490301&r2=490302
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/MessageFactory.java (original)
+++ webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/MessageFactory.java Tue
Dec 26 06:26:37 2006
@@ -170,20 +170,7 @@
 
     public static MessageFactory newInstance(String s)
             throws SOAPException {
-        MessageFactory factory = newInstance();
-        if(factory.getClass().getName().equals(DEFAULT_MESSAGE_FACTORY)){
-            try {
-                Method m = factory.getClass().getMethod("setSOAPVersion", new Class[]{String.class});
-                m.invoke(factory, new Object[]{s});
-            } catch (IllegalAccessException e) {
-                throw new SOAPException(e);
-            } catch (InvocationTargetException e) {
-                throw new SOAPException(e);
-            } catch (NoSuchMethodException e) {
-                throw new SOAPException(e);
-            }
-        }
-        return factory;
+        return SAAJMetaFactory.getInstance().newMessageFactory(s);
     }
 
     private static final String DEFAULT_MESSAGE_FACTORY =

Modified: webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SAAJMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SAAJMetaFactory.java?view=diff&rev=490302&r1=490301&r2=490302
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SAAJMetaFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SAAJMetaFactory.java
Tue Dec 26 06:26:37 2006
@@ -22,7 +22,7 @@
             throws SOAPException {
         if (instance == null) {
             try {
-                instance = (SAAJMetaFactory) FactoryFinder.find("javax.xml.soap.MetaFactory",
"org.apache.axis2.soap.SAAJMetaFactoryImpl");
+                instance = (SAAJMetaFactory) FactoryFinder.find("javax.xml.soap.MetaFactory",
"org.apache.axis2.saaj.SAAJMetaFactoryImpl");
             } catch (Exception exception) {
                 throw new SOAPException(exception.getMessage());
             }

Modified: webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SOAPFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SOAPFactory.java?view=diff&rev=490302&r1=490301&r2=490302
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SOAPFactory.java (original)
+++ webservices/axis2/trunk/java/modules/saaj-api/src/javax/xml/soap/SOAPFactory.java Tue
Dec 26 06:26:37 2006
@@ -148,20 +148,7 @@
     }
 
     public static SOAPFactory newInstance(String s) throws SOAPException {
-        SOAPFactory factory = newInstance();
-        if (factory.getClass().getName().equals(DEFAULT_SF)) {
-            try {
-                Method m = factory.getClass().getMethod("setSOAPVersion", new Class[]{String.class});
-                m.invoke(factory, new Object[]{s});
-            } catch (IllegalAccessException e) {
-                throw new SOAPException(e);
-            } catch (InvocationTargetException e) {
-                throw new SOAPException(e);
-            } catch (NoSuchMethodException e) {
-                throw new SOAPException(e);
-            }
-        }
-        return factory;
+        return SAAJMetaFactory.getInstance().newSOAPFactory(s);
     }
 
     public SOAPElement createElement(org.w3c.dom.Element element)

Added: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SAAJMetaFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SAAJMetaFactoryImpl.java?view=auto&rev=490302
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SAAJMetaFactoryImpl.java
(added)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SAAJMetaFactoryImpl.java
Tue Dec 26 06:26:37 2006
@@ -0,0 +1,20 @@
+package org.apache.axis2.saaj;
+
+import javax.xml.soap.SAAJMetaFactory;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+public class SAAJMetaFactoryImpl extends SAAJMetaFactory {
+    protected MessageFactory newMessageFactory(String s) throws SOAPException {
+        MessageFactoryImpl factory = new  MessageFactoryImpl();
+        factory.setSOAPVersion(s);
+        return factory;
+    }
+
+    protected SOAPFactory newSOAPFactory(String s) throws SOAPException {
+        SOAPFactoryImpl factory = new SOAPFactoryImpl();
+        factory.setSOAPVersion(s);
+        return factory;
+    }
+}



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


Mime
View raw message