Package jakarta.xml.messaging
Class ProviderConnectionFactory
- java.lang.Object
-
- jakarta.xml.messaging.ProviderConnectionFactory
-
@Deprecated public abstract class ProviderConnectionFactory extends java.lang.ObjectDeprecated.since 6.2, will be removed without replacementA factory for creating connections to a particular messaging provider. AProviderConnectionFactoryobject can be obtained in two different ways.- Call the
ProviderConnectionFactory.newInstancemethod to get an instance of the defaultProviderConnectionFactoryobject.
This instance can be used to create aProviderConnectionobject that connects to the default provider implementation.ProviderConnectionFactory pcf = ProviderConnectionFactory.newInstance(); ProviderConnection con = pcf.createConnection();
- Retrieve a
ProviderConnectionFactoryobject that has been registered with a naming service based on Java Naming and Directory InterfaceTM (JNDI) technology.
In this case, theProviderConnectionFactoryobject is an administered object that was created by a container (a servlet or Enterprise JavaBeansTM container). TheProviderConnectionFactoryobject was configured in an implementation- specific way, and the connections it creates will be to the specified messaging provider.
Registering a
ProviderConnectionFactoryobject with a JNDI naming service associates it with a logical name. When an application wants to establish a connection with the provider associated with thatProviderConnectionFactoryobject, it does a lookup, providing the logical name. The application can then use theProviderConnectionFactoryobject that is returned to create a connection to the messaging provider. The first two lines of the following code fragment use JNDI methods to retrieve aProviderConnectionFactoryobject. The third line uses the returned object to create a connection to the JAXM provider that was registered with "ProviderXYZ" as its logical name.Context ctx = new InitialContext(); ProviderConnectionFactory pcf = (ProviderConnectionFactory) ctx.lookup("ProviderXYZ"); ProviderConnection con = pcf.createConnection();
- Call the
-
-
Constructor Summary
Constructors Constructor Description ProviderConnectionFactory()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract ProviderConnectioncreateConnection()Deprecated.Creates aProviderConnectionobject to the messaging provider that is associated with thisProviderConnectionFactoryobject.static ProviderConnectionFactorynewInstance()Deprecated.Creates a defaultProviderConnectionFactoryobject.
-
-
-
Method Detail
-
createConnection
public abstract ProviderConnection createConnection() throws JAXMException
Deprecated.Creates aProviderConnectionobject to the messaging provider that is associated with thisProviderConnectionFactoryobject.- Returns:
- a
ProviderConnectionobject that represents a connection to the provider associated with thisProviderConnectionFactoryobject - Throws:
JAXMException- if there is an error in creating the connection
-
newInstance
public static ProviderConnectionFactory newInstance() throws JAXMException
Deprecated.Creates a defaultProviderConnectionFactoryobject.- Returns:
- a new instance of a
ProviderConnectionFactory - Throws:
JAXMException- if there was an error creating the defaultProviderConnectionFactory
-
-