public interface ConnectionFactory extends java.io.Serializable, Referenceable
ConnectionFactory
provides an interface for getting
connection to an EIS instance. An implementation of ConnectionFactory
interface is provided by a resource adapter.
Application code looks up a ConnectionFactory instance from JNDI namespace and uses it to get EIS connections.
An implementation class for ConnectionFactory is required to
implement java.io.Serializable
and
jakarta.resource.Referenceable
interfaces to support
JNDI registration.
Connection
,
Referenceable
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Gets a connection to an EIS instance.
|
Connection |
getConnection(ConnectionSpec properties)
Gets a connection to an EIS instance.
|
ResourceAdapterMetaData |
getMetaData()
Gets metadata for the Resource Adapter.
|
RecordFactory |
getRecordFactory()
Gets a RecordFactory instance.
|
setReference
Connection getConnection() throws ResourceException
ResourceException
- Failed to get a connection to
the EIS instance. Examples of
error cases are:
Connection getConnection(ConnectionSpec properties) throws ResourceException
It is important to note that the properties passed through the getConnection method should be client-specific (example: username, password, language) and not related to the configuration of a target EIS instance (example: port number, server name). The ManagedConnectionFactory instance is configured with complete set of properties required for the creation of a connection to an EIS instance.
properties
- Connection parameters and security
information specified as
ConnectionSpec instanceResourceException
- Failed to get a connection to
the EIS instance. Examples of
error cases are:
ConnectionSpec
RecordFactory getRecordFactory() throws ResourceException
ResourceException
- Failed to create a RecordFactoryNotSupportedException
- Operation not supportedResourceAdapterMetaData getMetaData() throws ResourceException
ResourceException
- Failed to get metadata information
about the resource adapter