org.apache.axiom.om
Class OMAbstractFactory

java.lang.Object
  extended by org.apache.axiom.om.OMAbstractFactory

public class OMAbstractFactory
extends Object

Provides default instances for plain XML, SOAP 1.1 and SOAP 1.2 object model factories.

The implementation class for each object model type is determined by a specific system property. If the system property is not set, a default implementation class is chosen. The following table summarizes the system properties and default implementation used:

Object model Method System property Default implementation
Plain XML getOMFactory() om.factory OMLinkedListImplFactory
SOAP 1.1 getSOAP11Factory() soap11.factory SOAP11Factory
SOAP 1.2 getSOAP12Factory() soap12.factory SOAP12Factory

The methods in this class assume that OMFactory instances are stateless and return the same instance on every invocation, i.e. the factory for each OM type is instantiated only once. Configuring the system properties with factory implementation that are not stateless will lead to unexpected results. It should be noted that the factories provided by the DOOM implementation are not stateless and should therefore never be used as default factories.

Each method in this class uses System.getProperty(String) to determine the value of the relevant system property. A SecurityException thrown by this method is simply ignored and the default factory implementation is used.


Field Summary
static String OM_FACTORY_NAME_PROPERTY
           
static String SOAP11_FACTORY_NAME_PROPERTY
           
static String SOAP12_FACTORY_NAME_PROPERTY
           
 
Method Summary
static OMFactory getOMFactory()
          Get the default OM factory instance.
static SOAPFactory getSOAP11Factory()
          Get the default SOAP 1.1 OM factory instance.
static SOAPFactory getSOAP12Factory()
          Get the default SOAP 1.2 OM factory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OM_FACTORY_NAME_PROPERTY

public static final String OM_FACTORY_NAME_PROPERTY
See Also:
Constant Field Values

SOAP11_FACTORY_NAME_PROPERTY

public static final String SOAP11_FACTORY_NAME_PROPERTY
See Also:
Constant Field Values

SOAP12_FACTORY_NAME_PROPERTY

public static final String SOAP12_FACTORY_NAME_PROPERTY
See Also:
Constant Field Values
Method Detail

getOMFactory

public static OMFactory getOMFactory()
Get the default OM factory instance.

Returns:
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

getSOAP11Factory

public static SOAPFactory getSOAP11Factory()
Get the default SOAP 1.1 OM factory instance.

Returns:
the default SOAP 1.1 OM factory instance
Throws:
OMException - if the factory's implementation class can't be found or if the class can't be instantiated

getSOAP12Factory

public static SOAPFactory getSOAP12Factory()
Get the default SOAP 1.2 OM factory instance.

Returns:
the default SOAP 1.2 OM factory instance
Throws:
OMException - if the factory's implementation class can't be found or if the class can't be instantiated


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.