SAAJMetaFactory (Java SE 9 & JDK 9 )
Keywords: javax.xml.soap.SAAJMetaFactory class

Module java.xml.ws
Package javax.xml.soap

## Class SAAJMetaFactory

- java.lang.Object
- - javax.xml.soap.SAAJMetaFactory

-     public abstract class SAAJMetaFactory
      extends Object

  The access point for the implementation classes of the factories defined in the SAAJ API. The `newInstance` methods defined on factories `SOAPFactory` and `MessageFactory` in SAAJ 1.3 defer to instances of this class to do the actual object creation. The implementations of `newInstance()` methods (in `SOAPFactory` and `MessageFactory`) that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2 defined lookup fails to locate the Factory implementation class name.

  SAAJMetaFactory is a service provider interface and it uses similar lookup mechanism as other SAAJ factories to get actual instance:

  - If a system property with name `javax.xml.soap.SAAJMetaFactory` exists then its value is assumed to be the fully qualified name of the implementation class. This phase of the look up enables per-JVM override of the SAAJ implementation.
  - If a system property with name `javax.xml.soap.MetaFactory` exists then its value is assumed to be the fully qualified name of the implementation class. This property, defined by previous specifications (up to 1.3), is still supported, but it is strongly recommended to migrate to new property `javax.xml.soap.SAAJMetaFactory`.
  - Use the configuration file "jaxm.properties". The file is in standard `Properties` format and typically located in the `conf` directory of the Java installation. It contains the fully qualified name of the implementation class with key `javax.xml.soap.SAAJMetaFactory`. If no such property is defined, again, property with key `javax.xml.soap.MetaFactory` is used. It is strongly recommended to migrate to new property `javax.xml.soap.SAAJMetaFactory`.
  - Use the service-provider loading facilities, defined by the `ServiceLoader` class, to attempt to locate and load an implementation of the service using the default loading mechanism.
  - Finally, if all the steps above fail, platform default implementation is used.

  There are no public methods on this class.

  Since:
    1.6, SAAJ 1.3

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `SAAJMetaFactory​()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract MessageFactory` | `newMessageFactory​(String protocol)` | Creates a `MessageFactory` object for the given `String` protocol.
    `protected abstract SOAPFactory` | `newSOAPFactory​(String protocol)` | Creates a `SOAPFactory` object for the given `String` protocol.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SAAJMetaFactory

          protected SAAJMetaFactory​()

  - ### Method Detail

    - #### newMessageFactory

          protected abstract MessageFactory newMessageFactory​(String protocol)
                                                       throws SOAPException

      Creates a `MessageFactory` object for the given `String` protocol.
      Parameters:
        `protocol` - a `String` indicating the protocol
      Returns:
        a `MessageFactory`, not null
      Throws:
        `SOAPException` - if there is an error in creating the MessageFactory
      See Also:
        `SOAPConstants.SOAP_1_1_PROTOCOL`, `SOAPConstants.SOAP_1_2_PROTOCOL`, `SOAPConstants.DYNAMIC_SOAP_PROTOCOL`

    - #### newSOAPFactory

          protected abstract SOAPFactory newSOAPFactory​(String protocol)
                                                 throws SOAPException

      Creates a `SOAPFactory` object for the given `String` protocol.
      Parameters:
        `protocol` - a `String` indicating the protocol
      Returns:
        a `SOAPFactory`, not null
      Throws:
        `SOAPException` - if there is an error in creating the SOAPFactory
      See Also:
        `SOAPConstants.SOAP_1_1_PROTOCOL`, `SOAPConstants.SOAP_1_2_PROTOCOL`, `SOAPConstants.DYNAMIC_SOAP_PROTOCOL`