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 ve...@apache.org on 2009/03/03 22:55:51 UTC

svn commit: r749780 - in /webservices/commons/trunk/modules/axiom: modules/axiom-api/src/main/java/org/apache/axiom/injection/ modules/axiom-api/src/main/java/org/apache/axiom/om/ modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/ mo...

Author: veithen
Date: Tue Mar  3 21:55:51 2009
New Revision: 749780

URL: http://svn.apache.org/viewvc?rev=749780&view=rev
Log:
- Added a getMetaFactory() method to OMAbstractFactory that returns the default OMMetaFactory instance as specified by the "org.apache.axiom.om.OMMetaFactory" system property (defaults to LLOM).
- Changed getOMFactory, getSOAP11Factory and getSOAP12Factory to use getMetaFactory and to delegate to the OMMetaFactory instance.
- Changed the OSGi support to inject only the OMMetaFactory component.

In addition to simplifying the code and providing a way to get the default OMMetaFactory, these changes have two implications:
- The system properties "om.factory", "soap11.factory" and "soap12.factory" are no longer supported. Added appropriate documentation for this in the Maven site. Note that we could easily add code that ensures backward compatibility if this is really needed.
- They solve the issue that OMFactory and SOAPFactory objects may be stateful: OMAbstractFactory now delegates to the default OMMetaFactory instance which can decide to return a new factory instance every time. This was not possible with the old implementation.

Added:
    webservices/commons/trunk/modules/axiom/src/site/apt/changes.apt
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/injection/FactoryInjectionComponent.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-osgi/axiom-osgi-build/src/main/java/org/apache/axiom/test/ServiceTest.java
    webservices/commons/trunk/modules/axiom/src/site/site.xml

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/injection/FactoryInjectionComponent.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/injection/FactoryInjectionComponent.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/injection/FactoryInjectionComponent.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/injection/FactoryInjectionComponent.java Tue Mar  3 21:55:51 2009
@@ -21,16 +21,13 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.om.OMMetaFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
  * @scr.component name="factoryinjection.component" immediate="true"
- * @scr.reference name="omfactory" interface="org.apache.axiom.om.OMFactory" cardinality="0..n" policy="dynamic" bind="setOMFactory" unbind="unsetOMFactory"
- * @scr.reference name="soap12factory" interface="org.apache.axiom.soap.SOAPFactory" target="(axiom.soapVersion=*soap12*)" cardinality="0..n" policy="dynamic" bind="setSOAP12Factory" unbind="unsetSOAP12Factory"
- * @scr.reference name="soap11factory" interface="org.apache.axiom.soap.SOAPFactory" target="(axiom.soapVersion=*soap11*)" cardinality="0..n" policy="dynamic" bind="setSOAP11Factory" unbind="unsetSOAP11Factory"
+ * @scr.reference name="metafactory" interface="org.apache.axiom.om.OMMetaFactory" cardinality="0..n" policy="dynamic" bind="setMetaFactory" unbind="unsetMetaFactory"
  */
 public class FactoryInjectionComponent {
 
@@ -43,108 +40,38 @@
 		}
 	}
 
-	private static List omFactories = null;
-	private static OMFactory currentOMFactory = null;
+	private static List metaFactories = null;
+	private static OMMetaFactory currentMetaFactory = null;
 	
-	private static List soap11Factories = null;
-	private static SOAPFactory currentSOAP11Factory = null;
-	
-	private static List soap12Factories = null;
-	private static SOAPFactory currentSOAP12Factory = null;
-
-	protected void setOMFactory(OMFactory omfactory) {
-		synchronized (FactoryInjectionComponent.class) {
-			if (omFactories == null) {
-				omFactories = new ArrayList();
-			}
-			// Special case llom - it's the default
-			if (omfactory.getClass().toString().contains("llom")) {
-				omFactories.add(0, omfactory);
-			} else {
-				omFactories.add(omfactory);
-			}
-			currentOMFactory = (OMFactory) omFactories.get(0);
-		}
-	}
-
-	protected void unsetOMFactory(OMFactory omfactory) {
-		synchronized (FactoryInjectionComponent.class) {
-			if (omFactories != null) {
-				omFactories.remove(omfactory);
-			}
-			if (omFactories.size() == 0) {
-				omFactories = null;
-			} else {
-				currentOMFactory = (OMFactory) omFactories.get(0);
-			}
-		}
-	}
-
-	public static OMFactory getOMFactory() {
-		return currentOMFactory;
-	}
-
-	protected void setSOAP12Factory(SOAPFactory soapfactory) {
+	protected void setMetaFactory(OMMetaFactory metafactory) {
 		synchronized (FactoryInjectionComponent.class) {
-			if (soap12Factories == null) {
-				soap12Factories = new ArrayList();
+			if (metaFactories == null) {
+			    metaFactories = new ArrayList();
 			}
 			// Special case llom - it's the default
-			if (soapfactory.getClass().toString().contains("llom")) {
-				soap12Factories.add(0, soapfactory);
+			if (metafactory.getClass().toString().contains("llom")) {
+				metaFactories.add(0, metafactory);
 			} else {
-				soap12Factories.add(soapfactory);
+				metaFactories.add(metafactory);
 			}
-			currentSOAP12Factory = (SOAPFactory) soap12Factories.get(0);
+			currentMetaFactory = (OMMetaFactory) metaFactories.get(0);
 		}
 	}
 
-	protected void unsetSOAP12Factory(SOAPFactory soapfactory) {
-		synchronized (FactoryInjectionComponent.class) {
-			if (soap12Factories != null) {
-				soap12Factories.remove(soapfactory);
-			}
-			if (soap12Factories.size() == 0) {
-				soap12Factories = null;
-			} else {
-				currentSOAP12Factory = (SOAPFactory) soap12Factories.get(0);
-			}
-		}
-	}
-	
-	public static SOAPFactory getSOAP12Factory() {
-		return currentSOAP12Factory;
-	}
-
-	protected void setSOAP11Factory(SOAPFactory soapfactory) {
+	protected void unsetMetaFactory(OMMetaFactory metafactory) {
 		synchronized (FactoryInjectionComponent.class) {
-			if (soap11Factories == null) {
-				soap11Factories = new ArrayList();
+			if (metaFactories != null) {
+			    metaFactories.remove(metafactory);
 			}
-			// Special case llom - it's the default
-			if (soapfactory.getClass().toString().contains("llom")) {
-				soap11Factories.add(0, soapfactory);
+			if (metaFactories.size() == 0) {
+			    metaFactories = null;
 			} else {
-				soap11Factories.add(soapfactory);
+				currentMetaFactory = (OMMetaFactory) metaFactories.get(0);
 			}
-			currentSOAP11Factory = (SOAPFactory) soap11Factories.get(0);
 		}
 	}
 
-	protected void unsetSOAP11Factory(SOAPFactory soapfactory) {
-		synchronized (FactoryInjectionComponent.class) {
-			if (soap11Factories != null) {
-				soap11Factories.remove(soapfactory);
-			}
-			if (soap11Factories.size() == 0) {
-				soap11Factories = null;
-			} else {
-				currentSOAP11Factory = (SOAPFactory) soap11Factories.get(0);
-			}
-		}
-	}
-	
-	public static SOAPFactory getSOAP11Factory() {
-		return currentSOAP11Factory;
+	public static OMMetaFactory getMetaFactory() {
+		return currentMetaFactory;
 	}
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java Tue Mar  3 21:55:51 2009
@@ -66,52 +66,44 @@
  * and the default factory implementation is used.</p> 
  */
 public class OMAbstractFactory {
-    public static final String OM_FACTORY_NAME_PROPERTY = "om.factory";
-    public static final String SOAP11_FACTORY_NAME_PROPERTY = "soap11.factory";
-    public static final String SOAP12_FACTORY_NAME_PROPERTY = "soap12.factory";
-
-    private static final String DEFAULT_OM_FACTORY_CLASS_NAME =
-            "org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory";
-    private static final String DEFAULT_SOAP11_FACTORY_CLASS_NAME =
-            "org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory";
-    private static final String DEFAULT_SOAP12_FACTORY_CLASS_NAME =
-            "org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory";
-
-    private static OMFactory defaultOMFactory = null;
-    private static SOAPFactory defaultSOAP11OMFactory = null;
-    private static SOAPFactory defaultSOAP12OMFactory = null;
+    public static final String META_FACTORY_NAME_PROPERTY = "org.apache.axiom.om.OMMetaFactory";
+
+    private static final String DEFAULT_META_FACTORY_CLASS_NAME =
+            "org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory";
+
+    private static OMMetaFactory defaultMetaFactory;
 
     private OMAbstractFactory() {}
 
     /**
-     * Get the default OM factory instance.
+     * Get the default meta factory instance.
      *
      * @return the default OM factory instance
      * @throws OMException if the factory's implementation class can't be found
      *                     or if the class can't be instantiated
      */
-    public static OMFactory getOMFactory() {
-        OMFactory of = FactoryInjectionComponent.getOMFactory();
+    public static OMMetaFactory getMetaFactory() {
+        OMMetaFactory of = FactoryInjectionComponent.getMetaFactory();
         if(of!=null){
-        	return of;
+            return of;
         }
-    	
-    	if (defaultOMFactory != null) {
-            return defaultOMFactory;
+        
+        if (defaultMetaFactory != null) {
+            return defaultMetaFactory;
         }
         
         String omFactory;
         try {
-            omFactory = System.getProperty(OM_FACTORY_NAME_PROPERTY);
+            omFactory = System.getProperty(META_FACTORY_NAME_PROPERTY);
             if (omFactory == null || "".equals(omFactory)) {
-                omFactory = DEFAULT_OM_FACTORY_CLASS_NAME;
+                omFactory = DEFAULT_META_FACTORY_CLASS_NAME;
             }
         } catch (SecurityException e) {
-            omFactory = DEFAULT_OM_FACTORY_CLASS_NAME;
+            omFactory = DEFAULT_META_FACTORY_CLASS_NAME;
         }
 
         try {
-            defaultOMFactory = (OMFactory) Class.forName(omFactory).newInstance();
+            defaultMetaFactory = (OMMetaFactory) Class.forName(omFactory).newInstance();
         } catch (InstantiationException e) {
             throw new OMException(e);
         } catch (IllegalAccessException e) {
@@ -119,7 +111,18 @@
         } catch (ClassNotFoundException e) {
             throw new OMException(e);
         }
-        return defaultOMFactory;
+        return defaultMetaFactory;
+    }
+    
+    /**
+     * Get the default OM factory instance.
+     *
+     * @return the default OM factory instance
+     * @throws OMException if the factory's implementation class can't be found
+     *                     or if the class can't be instantiated
+     */
+    public static OMFactory getOMFactory() {
+        return getMetaFactory().getOMFactory();
     }
 
 
@@ -131,35 +134,7 @@
      *                     or if the class can't be instantiated
      */
     public static SOAPFactory getSOAP11Factory() {
-        SOAPFactory sf = FactoryInjectionComponent.getSOAP11Factory();
-        if(sf != null){
-        	return sf;
-        }
-        
-        if (defaultSOAP11OMFactory != null) {
-            return defaultSOAP11OMFactory;
-        }
-        
-        String omFactory;
-        try {
-            omFactory = System.getProperty(SOAP11_FACTORY_NAME_PROPERTY);
-            if (omFactory == null || "".equals(omFactory)) {
-                omFactory = DEFAULT_SOAP11_FACTORY_CLASS_NAME;
-            }
-        } catch (SecurityException e) {
-            omFactory = DEFAULT_SOAP11_FACTORY_CLASS_NAME;
-        }
-        
-        try {
-            defaultSOAP11OMFactory = (SOAPFactory) Class.forName(omFactory).newInstance();
-        } catch (InstantiationException e) {
-            throw new OMException(e);
-        } catch (IllegalAccessException e) {
-            throw new OMException(e);
-        } catch (ClassNotFoundException e) {
-            throw new OMException(e);
-        }
-        return defaultSOAP11OMFactory;
+        return getMetaFactory().getSOAP11Factory();
     }
 
 
@@ -171,34 +146,6 @@
      *                     or if the class can't be instantiated
      */
     public static SOAPFactory getSOAP12Factory() {
-        SOAPFactory sf = FactoryInjectionComponent.getSOAP12Factory();
-        if(sf != null){
-        	return sf;
-        }
-        
-    	if (defaultSOAP12OMFactory != null) {
-            return defaultSOAP12OMFactory;
-        }
-        
-        String omFactory;
-        try {
-            omFactory = System.getProperty(SOAP12_FACTORY_NAME_PROPERTY);
-            if (omFactory == null || "".equals(omFactory)) {
-                omFactory = DEFAULT_SOAP12_FACTORY_CLASS_NAME;
-            }
-        } catch (SecurityException e) {
-            omFactory = DEFAULT_SOAP12_FACTORY_CLASS_NAME;
-        }
-        
-        try {
-            defaultSOAP12OMFactory = (SOAPFactory) Class.forName(omFactory).newInstance();
-        } catch (InstantiationException e) {
-            throw new OMException(e);
-        } catch (IllegalAccessException e) {
-            throw new OMException(e);
-        } catch (ClassNotFoundException e) {
-            throw new OMException(e);
-        }
-        return defaultSOAP12OMFactory;
+        return getMetaFactory().getSOAP12Factory();
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java Tue Mar  3 21:55:51 2009
@@ -75,10 +75,6 @@
  *       not be used in conjunction with {@link OMAbstractFactory}. In particular,
  *       the <tt>om.factory</tt> system property must not be set to this class.</li> 
  * </ul>
- * 
- * @scr.component name="om.dom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.om.OMFactory"
- * @scr.property name="implementationName" type="String" value="dom"
  */
 public class OMDOMFactory implements OMFactory {
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java Tue Mar  3 21:55:51 2009
@@ -31,6 +31,10 @@
  * As explained in {@link OMDOMFactory}, OM factories for DOOM are not stateless.
  * Therefore {@link #getOMFactory()}, {@link #getSOAP11Factory()} and
  * {@link #getSOAP12Factory()} will return a new instance on every invocation.
+ * 
+ * @scr.component name="metafactory.dom.component" immediate="true"
+ * @scr.service interface="org.apache.axiom.om.OMMetaFactory"
+ * @scr.property name="implementationName" type="String" value="doom"
  */
 public class OMDOMMetaFactory implements OMMetaFactory {
     public OMFactory getOMFactory() {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11Factory.java Tue Mar  3 21:55:51 2009
@@ -45,10 +45,6 @@
 import org.apache.axiom.soap.impl.dom.factory.DOMSOAPFactory;
 
 /**
- * @scr.component name="soap11factory.doom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.soap.SOAPFactory" 
- * @scr.property name="axiom.soapVersion" type="String" value="soap11"
- * @scr.property name="implementationName" type="String" value="doom"
  */
 public class SOAP11Factory extends DOMSOAPFactory {
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12Factory.java Tue Mar  3 21:55:51 2009
@@ -44,10 +44,6 @@
 import org.apache.axiom.soap.impl.dom.factory.DOMSOAPFactory;
 
 /**
- * @scr.component name="soap12factory.doom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.soap.SOAPFactory" 
- * @scr.property name="axiom.soapVersion" type="String" value="soap12"
- * @scr.property name="implementationName" type="String" value="doom"
  */
 public class SOAP12Factory extends DOMSOAPFactory {
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java Tue Mar  3 21:55:51 2009
@@ -48,9 +48,6 @@
 import java.util.Map;
 
 /** Class OMLinkedListImplFactory
- * @scr.component name="om.llom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.om.OMFactory"
- * @scr.property name="implementationName" type="String" value="llom"
  */
 public class OMLinkedListImplFactory implements OMFactory {
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java Tue Mar  3 21:55:51 2009
@@ -31,6 +31,10 @@
  * Since all OM factories for LLOM are stateless, {@link #getOMFactory()},
  * {@link #getSOAP11Factory()} and {@link #getSOAP12Factory()} will return the
  * same instance on every invocation.
+ * 
+ * @scr.component name="metafactory.llom.component" immediate="true"
+ * @scr.service interface="org.apache.axiom.om.OMMetaFactory"
+ * @scr.property name="implementationName" type="String" value="llom"
  */
 public class OMLinkedListMetaFactory implements OMMetaFactory {
     private final OMFactory omFactory = new OMLinkedListImplFactory();

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java Tue Mar  3 21:55:51 2009
@@ -47,10 +47,6 @@
 import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
 
 /**
- * @scr.component name="soap11factory.llom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.soap.SOAPFactory"
- * @scr.property name="implementationName" type="String" value="llom"
- * @scr.property name="axiom.soapVersion" type="String" value="soap11"
  */
 public class SOAP11Factory extends OMLinkedListImplFactory implements SOAPFactory {
     /** Eran Chinthaka (chinthaka@apache.org) */

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java Tue Mar  3 21:55:51 2009
@@ -47,10 +47,6 @@
 import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
 
 /**
- * @scr.component name="soap12factory.llom.component" immediate="true"
- * @scr.service interface="org.apache.axiom.soap.SOAPFactory"
- * @scr.property name="implementationName" type="String" value="llom"
- * @scr.property name="axiom.soapVersion" type="String" value="soap12"
  */
 public class SOAP12Factory extends OMLinkedListImplFactory implements SOAPFactory {
     /** Eran Chinthaka (chinthaka@apache.org) */

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-osgi/axiom-osgi-build/src/main/java/org/apache/axiom/test/ServiceTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-osgi/axiom-osgi-build/src/main/java/org/apache/axiom/test/ServiceTest.java?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-osgi/axiom-osgi-build/src/main/java/org/apache/axiom/test/ServiceTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-osgi/axiom-osgi-build/src/main/java/org/apache/axiom/test/ServiceTest.java Tue Mar  3 21:55:51 2009
@@ -18,63 +18,22 @@
  */
 package org.apache.axiom.test;
 
-import org.apache.axiom.soap.SOAPFactory;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.osgi.framework.ServiceReference;
 
 public class ServiceTest extends OSGiTestCase {
 	
-	public void testLLOMOMFactoryServicePresent() throws Exception {
+	public void testLLOMMetaFactoryServicePresent() throws Exception {
 		ServiceReference[] omfactRefs = context
-				.getServiceReferences("org.apache.axiom.om.OMFactory", "(implementationName=llom)");
+				.getServiceReferences("org.apache.axiom.om.OMMetaFactory", "(implementationName=llom)");
 		assertNotNull(omfactRefs);
-		assertEquals(3, omfactRefs.length);
+		assertEquals(1, omfactRefs.length);
 	}
 	
-	public void testDOOMOMFactoryServicePresent() throws Exception {
+	public void testDOOMMetaFactoryServicePresent() throws Exception {
 		ServiceReference[] omfactRefs = context
-				.getServiceReferences("org.apache.axiom.om.OMFactory", "(implementationName=llom)");
+				.getServiceReferences("org.apache.axiom.om.OMMetaFactory", "(implementationName=doom)");
 		assertNotNull(omfactRefs);
-		assertEquals(3, omfactRefs.length);
-	}
-	
-	public void testLLOMSOAP11FactoryServicePresent() throws Exception {
-		ServiceReference[] soapfactRefs = context.getServiceReferences(
-				"org.apache.axiom.soap.SOAPFactory", "(&(axiom.soapVersion=soap11)(implementationName=llom))");
-
-		assertNotNull(soapfactRefs);
-		assertEquals(1, soapfactRefs.length);
-		SOAPFactory sf = (SOAPFactory) context.getService(soapfactRefs[0]);
-		assertEquals("http://schemas.xmlsoap.org/soap/envelope/",sf.createSOAPEnvelope().getNamespace().getNamespaceURI());
-	}
-	
-	public void testDOOMSOAP11FactoryServicePresent() throws Exception {
-		ServiceReference[] soapfactRefs = context.getServiceReferences(
-				"org.apache.axiom.soap.SOAPFactory", "(&(axiom.soapVersion=soap11)(implementationName=doom))");
-
-		assertNotNull(soapfactRefs);
-		assertEquals(1, soapfactRefs.length);
-		SOAPFactory sf = (SOAPFactory) context.getService(soapfactRefs[0]);
-		assertEquals("http://schemas.xmlsoap.org/soap/envelope/",sf.createSOAPEnvelope().getNamespace().getNamespaceURI());
-	}
-	
-	public void testLLOMSOAP12FactoryServicePresent() throws Exception {
-		ServiceReference[] soapfactRefs = context.getServiceReferences(
-				"org.apache.axiom.soap.SOAPFactory", "(&(axiom.soapVersion=soap12)(implementationName=doom))");
-
-		assertNotNull(soapfactRefs);
-		assertEquals(1, soapfactRefs.length);
-		SOAPFactory sf = (SOAPFactory) context.getService(soapfactRefs[0]);
-		assertEquals("http://www.w3.org/2003/05/soap-envelope",sf.createSOAPEnvelope().getNamespace().getNamespaceURI());
-	}
-	
-	public void testDOOMSOAP12FactoryServicePresent() throws Exception {
-		ServiceReference[] soapfactRefs = context.getServiceReferences(
-				"org.apache.axiom.soap.SOAPFactory", "(&(axiom.soapVersion=soap12)(implementationName=llom))");
-
-		assertNotNull(soapfactRefs);
-		assertEquals(1, soapfactRefs.length);
-		SOAPFactory sf = (SOAPFactory) context.getService(soapfactRefs[0]);
-		assertEquals("http://www.w3.org/2003/05/soap-envelope",sf.createSOAPEnvelope().getNamespace().getNamespaceURI());
+		assertEquals(1, omfactRefs.length);
 	}
 }

Added: webservices/commons/trunk/modules/axiom/src/site/apt/changes.apt
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/src/site/apt/changes.apt?rev=749780&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/site/apt/changes.apt (added)
+++ webservices/commons/trunk/modules/axiom/src/site/apt/changes.apt Tue Mar  3 21:55:51 2009
@@ -0,0 +1,32 @@
+Axiom 1.2.9
+
+* System properties used by <<<OMAbstractFactory>>>
+
+  Prior to Axiom 1.2.9, <<<OMAbstractFactory>>> used system properties as defined in the following
+  table to determine the factory implementations to use:
+
+*-------------------+--------------------------+----------------------+---------------------------------------------------------------------+
+| <<Object model >> | <<Method>>               | <<System property>>  | <<Default>>                                                         |
+*-------------------+--------------------------+----------------------+---------------------------------------------------------------------+
+| Plain XML         | <<<getOMFactory()>>>     | <<<om.factory>>>     | <<<org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory>>> |
+*-------------------+--------------------------+----------------------+---------------------------------------------------------------------+
+| SOAP 1.1          | <<<getSOAP11Factory()>>> | <<<soap11.factory>>> | <<<org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory>>>          |
+*-------------------+--------------------------+----------------------+---------------------------------------------------------------------+
+| SOAP 1.2          | <<<getSOAP12Factory()>>> | <<<soap12.factory>>> | <<<org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory>>>          |
+*-------------------+--------------------------+----------------------+---------------------------------------------------------------------+
+
+  This in principle allowed to mix default factory implementations from different implementations
+  of the Axiom API (e.g. an OMFactory from the LLOM implementation and SOAP factories from DOOM).
+  This however doesn't make sense. The system properties as described above are no longer
+  supported in 1.2.9 and the default Axiom implementation is chosen using the new
+  <<<org.apache.axiom.om.OMMetaFactory>>> system property. For LLOM, you should set:
+  
+-----------------------------------------------------------------------------------------------
+org.apache.axiom.om.OMMetaFactory=org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory
+-----------------------------------------------------------------------------------------------
+
+  This is the default and is equivalent to the defaults in 1.2.8. For DOOM, you should set:
+
+---------------------------------------------------------------------------------------
+org.apache.axiom.om.OMMetaFactory=org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory
+---------------------------------------------------------------------------------------

Modified: webservices/commons/trunk/modules/axiom/src/site/site.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/src/site/site.xml?rev=749780&r1=749779&r2=749780&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/site/site.xml (original)
+++ webservices/commons/trunk/modules/axiom/src/site/site.xml Tue Mar  3 21:55:51 2009
@@ -37,6 +37,7 @@
                 <item name="Source Code" href="source-repository.html"/>
             </item>
             <item name="Documentation">
+                <item name="Changes" href="changes.html"/>
                 <item name="OM Tutorial" href="OMTutorial.html"/>
                 <item name="Javadocs" href="/apidocs/index.html"/>
                 <item name="View Source" href="http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/?root=Apache-SVN"/>