Previous section   Next section
ProviderConnectionFactory javax.xml.messaging

JAXM 1.1; JWSDP 1.0
public abstract class ProviderConnectionFactory {
// Public Constructors
    public ProviderConnectionFactory(  ); 
// Public Class Methods
    public static ProviderConnectionFactory newInstance( ) throws JAXMException; 
// Public Instance Methods
    public abstract ProviderConnection createConnection( ) throws JAXMException; 
}

ProviderConnectionFactory is an abstract class that can be used to create ProviderConnection objects for the purpose of obtaining a connection to a JAXM provider. In a container-based environment, a JAXM client uses a JNDI lookup to obtain a preconfigured ProviderConnectionFactory that results in the message that it subsequently created being sent to a JAXM provider chosen by an administrator.

An alternative way to obtain an instance of this class is to call the static newInstance( ) method. This method locates a concrete implementation of ProviderConnectionFactory as follows, stopping when a suitable class is found:

  1. Looks in the system properties for a property called javax.xml.messaging.ProviderConnectionFactory. If this property is defined, its value is assumed to be the class name of a concrete implementation of ProviderConnectionFactory.

  2. Looks for the same property in a file called ${JAVA_HOME}/lib/jaxm.properties. If the property is found, its value is assumed to be the required class name.

  3. Looks for a resource called META-INF/services/javax.xml.messaging.ProviderConnectionFactory in the classpath. If such a resource exists, it is opened and a single line is read from it. If the line is not empty, it is used as the required class name.

  4. Finally, an implementation-dependent default class is used. In the case of the reference implementation, this class is called com.sun.xml.messaging.jaxm.client.remote.ProviderConnectionFactoryImpl.

The createConnection( ) method returns a ProviderConnection object that allows a client to communicate with a JAXM provider. The means by which the provider is located is implementation-dependent. In the case of the reference implementation, the provider's address is configured in a file called client.xml, which must be accessible as a resource in the classpath of the client. For a description of the content of this file, refer to Chapter 4.

Returned By

ProviderConnectionFactory.newInstance( )


  Previous section   Next section