Class OMAbstractFactory
The getMetaFactory()
method returns the OMMetaFactory
instance for the default
Axiom implementation. The getMetaFactory(String)
method locates a OMMetaFactory
instance for an Axiom implementation with a given feature. The following features are predefined
by the Axiom API:
FEATURE_DEFAULT
- Identifies the default Axiom implementation. An implementation with that feature is expected to provide a full implementation of the Axiom API.
FEATURE_DOM
- Used by Axiom implementations that implement DOM in addition to the Axiom API.
Axiom discovers implementations by looking for META-INF/axiom.xml
resources. They
specify the OMMetaFactory
implementation as well as the set of features that each
implementation supports. If multiple implementations with the same feature are found, then Axiom
will select the one with the highest priority. The priority for a given feature is also declared
in META-INF/axiom.xml
. This algorithm is used both in non OSGi and OSGi environments.
In a non OSGi environment, the default Axiom implementation can be overridden using the system
property specified by META_FACTORY_NAME_PROPERTY
.
The getOMFactory()
, getSOAP11Factory()
and getSOAP12Factory()
methods return default instances for plain XML, SOAP 1.1 and SOAP 1.2 object model factories.
They are convenience methods calling getMetaFactory()
and then delegating to the
returned OMMetaFactory
.
Note that while getMetaFactory()
always returns the same instance, the other methods
may return new instances on every invocation, depending on the OMMetaFactory
implementation.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Feature for Axiom implementations that can be used as default implementations.static final String
Feature for Axiom implementations that implement DOM in addition to the Axiom API.static final String
The name of the system property that allows to override the default Axiom implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic OMMetaFactory
Get the meta factory instance for the default Axiom implementation.static OMMetaFactory
getMetaFactory
(String feature) Get the meta factory instance for the Axiom implementation with a given feature.static OMFactory
Get the default OM factory instance.static SOAPFactory
Get the default SOAP 1.1 OM factory instance.static SOAPFactory
Get the default SOAP 1.2 OM factory instance.static void
Explicitly set a meta factory locator.
-
Field Details
-
META_FACTORY_NAME_PROPERTY
The name of the system property that allows to override the default Axiom implementation. The value must be the fully qualified name of a class implementingOMMetaFactory
and that is visible to the class loader from which theaxiom-api
library is loaded. An instance of this class will be returned bygetMetaFactory()
.Note that this system property is not supported in an OSGi environment.
- See Also:
-
FEATURE_DEFAULT
Feature for Axiom implementations that can be used as default implementations.- See Also:
-
FEATURE_DOM
Feature for Axiom implementations that implement DOM in addition to the Axiom API. TheOMMetaFactory
for such an Axiom implementation must implementDOMMetaFactory
. See the documentation ofDOMMetaFactory
for more information about the requirements and constraints that apply to Axiom implementations that support this feature.- See Also:
-
-
Method Details
-
setMetaFactoryLocator
Explicitly set a meta factory locator. The new locator will be used by all subsequent calls togetMetaFactory()
andgetMetaFactory(String)
to locate the appropriate meta factory. Note that the meta factory locator is an application wide setting. More precisely, the configured locator 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 instances from the deployed implementation bundles.
- Parameters:
locator
- the new meta factory locator, ornull
to revert to the default meta factory locator
-
getMetaFactory
Get the meta factory instance for the default Axiom implementation. This method is equivalent togetMetaFactory(String)
withFEATURE_DEFAULT
as parameter.- Returns:
- the meta factory instance for the default Axiom implementation
- Throws:
OMException
- if no Axiom implementation withFEATURE_DEFAULT
could be located
-
getMetaFactory
Get the meta factory instance for the Axiom implementation with a given feature. If multiple Axiom implementations declare the same feature, then the method will return the meta factory for the implementation that declares the highest priority for that feature in itsMETA-INF/axiom.xml
descriptor.- Parameters:
feature
- the requested feature- Returns:
- the meta factory instance for the Axiom implementation with the given feature.
- Throws:
OMException
- if no Axiom implementation with the requested feature could be located
-
getOMFactory
Get the default OM factory instance. This method has the same effect as callingOMMetaFactory.getOMFactory()
on theOMMetaFactory
instance returned bygetMetaFactory()
.- 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
Get the default SOAP 1.1 OM factory instance. This method has the same effect as callingOMMetaFactory.getSOAP11Factory()
on theOMMetaFactory
instance returned bygetMetaFactory()
.- 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
Get the default SOAP 1.2 OM factory instance. This method has the same effect as callingOMMetaFactory.getSOAP12Factory()
on theOMMetaFactory
instance returned bygetMetaFactory()
.- 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
-