javax.xml.registry
Class ConnectionFactory
java.lang.Object
|
+--javax.xml.registry.ConnectionFactory
- public abstract class ConnectionFactory
- extends java.lang.Object
This is the abstract base class for factory classes for creating a JAXR connection.
A JAXR ConnectionFactory object is configured in a provider-specific way to create connections with registry providers.
Looking Up a ConnectionFactory in JNDI
The preferred way for a client to look up a JAXR ConnectionFactory is within Java Naming and Directory InterfaceTM (JNDI).
A ConnectionFactory object is registered with a naming service in a provider specific way, such as one based on Java Naming and Directory InterfaceTM (JNDI) technology. This registration associates the ConnectionFactory object with a logical name. When an application wants to establish a connection with the provider associated with that ConnectionFactory object, it does a lookup, providing the logical name. The application can then use the ConnectionFactory object that is returned to create a connection to the messaging provider.
Looking Up a ConnectionFactory without JNDI
The JAXR API provides an alternative way to look up a JAXR ConnectionFactory that does not require use of JNDI. This is done using the newInstance static method on the abstract class ConnectionFactory provided in the JAXR API. The newInstance methods return a JAXR ConnectionFactory. The client may indicate which factory class should be instantiated by the newInstance method by defining the system property javax.xml.registry.ConnectionFactoryClass.
In the event that this property is not set, the JAXR provider must return a default ConnectionFactory instance.
- See Also:
Connection
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionFactory
public ConnectionFactory()
setProperties
public abstract void setProperties(java.util.Properties properties)
throws JAXRException
- Sets the Properties used during createConnection
and createFederation calls.
- Capability Level: 0
- Parameters:
properties
- configuration properties that are either
specified by JAXR or provider specific.
getProperties
public abstract java.util.Properties getProperties()
throws JAXRException
- Gets the Properties used during createConnection
and createFederation calls.
- Capability Level: 0
createConnection
public abstract Connection createConnection()
throws JAXRException
- Create a named connection. Such a connection can be used to
communicate with a JAXR provider.
- Capability Level: 0
createFederation
public abstract Federation createFederation(java.util.Collection connections)
throws JAXRException
- Create a Federation.
- Capability Level: 0 (optional)
- Parameters:
connections
- Is a Collection of Connection objects. Note that
Connection objects may also be Federation objects.
newInstance
public static ConnectionFactory newInstance()
throws JAXRException
- Creates a default
ConnectionFactory
object.
- Returns:
- a new instance of a
ProviderConnectionFactory
- Throws:
JAXRException
- if there was an error creating the
default ConnectionFactory