Class OMAbstractFactory
- java.lang.Object
-
- org.apache.axiom.om.OMAbstractFactory
-
public class OMAbstractFactory extends Object
Provides default instances for object model and meta factories.The
getMetaFactory()method returns the defaultOMMetaFactoryinstance. See the Javadoc of thegetMetaFactory()method for details about how this instance is determined.The
getOMFactory(),getSOAP11Factory()andgetSOAP12Factory()methods return default instances for plain XML, SOAP 1.1 and SOAP 1.2 object model factories. They are convenience methods callinggetMetaFactory()and then delegating to the returnedOMMetaFactory.Note that while
getMetaFactory()always returns the same instance, the other methods may return new instances on every invocation, depending on theOMMetaFactoryimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETA_FACTORY_NAME_PROPERTY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OMMetaFactorygetMetaFactory()Get the default meta factory instance.static OMFactorygetOMFactory()Get the default OM factory instance.static SOAPFactorygetSOAP11Factory()Get the default SOAP 1.1 OM factory instance.static SOAPFactorygetSOAP12Factory()Get the default SOAP 1.2 OM factory instance.static voidsetMetaFactory(OMMetaFactory newMetaFactory)Explicitly set a meta factory instance.
-
-
-
Field Detail
-
META_FACTORY_NAME_PROPERTY
public static final String META_FACTORY_NAME_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
setMetaFactory
public static void setMetaFactory(OMMetaFactory newMetaFactory)
Explicitly set a meta factory instance. The new instance will be returned by all subsequent calls togetMetaFactory(). Note that this is an application wide setting. More precisely, the configured meta factory will be used by all classes loaded from the class loader where Axiom is deployed and all its child class loaders. Therefore this method should be used with care and only be invoked during the initialization of the application.When Axiom is deployed as a bundle in an OSGi environment, this method will be used to inject the meta factory instance from the implementation bundle.
- Parameters:
newMetaFactory- the new meta factory instance, ornullto revert to the default meta factory instance determined by theorg.apache.axiom.om.OMMetaFactorysystem property
-
getMetaFactory
public static OMMetaFactory getMetaFactory()
Get the default meta factory instance. The default instance is determined using the following algorithm:- If an instance has been set using
setMetaFactory(OMMetaFactory), then that instance is returned. Note that this will be the case in an OSGi runtime, wheresetMetaFactory(OMMetaFactory)is invoked by a helper component that is part of Axiom. - If no instance has been set using
setMetaFactory(OMMetaFactory), then the implementation class is determined by theorg.apache.axiom.om.OMMetaFactorysystem property. - If the
org.apache.axiom.om.OMMetaFactorysystem property is not set, the meta factory for the LLOM implementation is returned.
System.getProperty(String)to determine the value of theorg.apache.axiom.om.OMMetaFactorysystem property. ASecurityExceptionthrown by this method is simply ignored and the default factory implementation is used.- 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
- If an instance has been set using
-
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
-
-