Top Description Fields Constructors Methods
javax.xml.registry

public abstract Class ConnectionFactory

extends Object
Class Inheritance
Imports
java.util.*, java.io.*

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 Using the JNDI API

The preferred way for a client to look up a JAXR ConnectionFactory is within the Java Naming and Directory InterfaceTM (JNDI) API. A ConnectionFactory object is registered with a naming service in a provider specific way, such as one based on the JNDI API. 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 Using the JNDI API

The JAXR API provides an alternative way to look up a JAXR ConnectionFactory that does not require the use of the JNDI API. This is done using the newInstance static method on the abstract class ConnectionFactory provided in the JAXR API. The newInstance method returns 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. If this property is not set, the JAXR provider must return a default ConnectionFactory instance.
Author
Farrukh S. Najmi
See Also
Connection

Field Summary

Modifier and TypeField and Description
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Connection

Returns:

the Connection created by this call
createConnection
()

Create a named connection.

public abstract FederatedConnection

Returns:

the FederatedConnection created by this call
createFederatedConnection
(Collection<E>
Is a Collection of Connection objects. Note that Connection objects may also be FederatedConnection objects.
connections
)

Create a FederatedConnection.

pack-priv static Object

Returns:

the Class object of the specified message factory; may not be null
find
(String
the name of the factory to find, which is a system property
factoryId
,
String
the implementation class name, which is to be used only if nothing else is found; null to indicate that there is no fallback class name
fallbackClassName
)

Finds the implementation Class object for the given factory name, or if that fails, finds the Class object for the given fallback class name.

public abstract Properties

Returns:

the Properties defined for this object
getProperties
()

Gets the Properties used during createConnection and createFederatedConnection calls.

public static ConnectionFactory

Returns:

a new instance of a ConnectionFactory
newInstance
()

Creates a default ConnectionFactory object.

private static Object
newInstance(String className, ClassLoader classLoader)

public abstract void
setProperties(Properties
configuration properties that are either specified by JAXR specification or are provider specific.
properties
)

Sets the Properties used during createConnection and createFederatedConnection calls.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONNECTION_FACTORY_CLASSback to summary
private static final String CONNECTION_FACTORY_CLASS
DEFAULT_CONNECTION_FACTORYback to summary
private static final String DEFAULT_CONNECTION_FACTORY

Constructor Detail

ConnectionFactoryback to summary
public ConnectionFactory()

Method Detail

createConnectionback to summary
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
Returns:Connection

the Connection created by this call

Exceptions
JAXRException:
If the JAXR provider encounters an internal error
createFederatedConnectionback to summary
public abstract FederatedConnection createFederatedConnection(Collection<E> connections) throws JAXRException

Create a FederatedConnection.

Capability Level: 0 (optional)
Parameters
connections:Collection<E>

Is a Collection of Connection objects. Note that Connection objects may also be FederatedConnection objects.

Returns:FederatedConnection

the FederatedConnection created by this call

Exceptions
JAXRException:
If the JAXR provider encounters an internal error
findback to summary
pack-priv static Object find(String factoryId, String fallbackClassName) throws JAXRException

Finds the implementation Class object for the given factory name, or if that fails, finds the Class object for the given fallback class name. The arguments supplied must be used in order. If using the first argument is successful, the second one will not be used.

This method is package private so that this code can be shared.

Parameters
factoryId:String

the name of the factory to find, which is a system property

fallbackClassName:String

the implementation class name, which is to be used only if nothing else is found; null to indicate that there is no fallback class name

Returns:Object

the Class object of the specified message factory; may not be null

Exceptions
JAXRException:
If the JAXR provider encounters an internal error
getPropertiesback to summary
public abstract Properties getProperties() throws JAXRException

Gets the Properties used during createConnection and createFederatedConnection calls.

Capability Level: 0
Returns:Properties

the Properties defined for this object

Exceptions
JAXRException:
If the JAXR provider encounters an internal error
newInstanceback to summary
public static ConnectionFactory newInstance() throws JAXRException

Creates a default ConnectionFactory object.

Returns:ConnectionFactory

a new instance of a ConnectionFactory

Exceptions
JAXRException:
If the JAXR provider encounters an internal error
newInstanceback to summary
private static Object newInstance(String className, ClassLoader classLoader) throws JAXRException
setPropertiesback to summary
public abstract void setProperties(Properties properties) throws JAXRException

Sets the Properties used during createConnection and createFederatedConnection calls.

Standard Connection Properties:
javax.xml.registry.queryManagerURL - URL String for the query manager service within the target registry provider
javax.xml.registry.lifeCycleManagerURL - URL String for the life cycle manager service within the target registry provider. If unspecified, must default to value of the queryManagerURL described above
javax.xml.registry.semanticEquivalences - String that allows specification of semantic equivalences
javax.xml.registry.security.authenticationMethod - string that provides a hint to the JAXR provider on the authentication method to be used when authenticating with the registry provider. Possible value include but are not limited to "UDDI_GET_AUTHTOKEN", "HTTP_BASIC", "CLIENT_CERTIFICATE", "MS_PASSPORT"
javax.xml.registry.uddi.maxRows - integer that specifies the maximum number of rows to be returned for find operations. This property is specific for UDDI providers
javax.xml.registry.postalAddressScheme - String that specifies the id of a ClassificationScheme that is used as the default postal address scheme for this connection

Capability Level: 0
Parameters
properties:Properties

configuration properties that are either specified by JAXR specification or are provider specific.

Exceptions
JAXRException:
If the JAXR provider encounters an internal error