|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
javax.resource.Referenceable
interfaces to support
JNDI registration.
Connection
,
Referenceable
Method Summary | |
Connection |
getConnection()
Gets a connection to an EIS instance. |
Connection |
getConnection(ConnectionSpec properties)
Gets a connection to an EIS instance. |
java.io.PrintWriter |
getLogWriter()
Gets the log writer for the ConnectionFactory instance. |
ResourceAdapterMetaData |
getMetaData()
Gets metadata for the Resource Adapter. |
RecordFactory |
getRecordFactory()
Gets a RecordFactory instance. |
int |
getTimeout()
Gets the maximum time in milliseconds that this connection factory can wait while attempting to connect to an EIS. |
void |
setLogWriter(java.io.PrintWriter out)
Sets the log writer for the ConnectionFactory instance. |
void |
setTimeout(int milliseconds)
Sets the maximum time in milliseconds that this connection factory will wait while attempting to connect to an EIS. |
Methods inherited from interface javax.resource.Referenceable |
setReference |
Methods inherited from interface javax.naming.Referenceable |
getReference |
Method Detail |
public Connection getConnection() throws ResourceException
ResourceException
- Failed to get a connection to
the EIS instancepublic 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 instanceConnectionSpec
public RecordFactory getRecordFactory() throws ResourceException
ResourceException
- public ResourceAdapterMetaData getMetaData() throws ResourceException
ResourceException
- Failed to get information about
the resource adapter.public void setLogWriter(java.io.PrintWriter out) throws ResourceException
The log writer is a character output stream to which all logging and tracing messages for the Connectionfactory instance will be printed.
When a ConnectionFactory object is created the log writer is initially null, in other words, logging is disabled. Once a log writer is associated with a ConnectionFactory, logging and tracing for ConnectionFactory instance is enabled.
A Connection instance resulting from a ConnectionFactory inherits the log writer set on the ConnectionFactory.
out
- Log writer associated with the ConnectionFactoryResourceException
- Failed to set log writer for the
ConnectionFactorypublic java.io.PrintWriter getLogWriter() throws ResourceException
The log writer is a character output stream to which all logging and tracing messages for this connection factory instance will be printed. When a ConnectionFactory object is created the log writer is initially null meaning that logging is disabled.
ResourceException
- Failed to get the log writer for the
ConnectionFactorypublic void setTimeout(int milliseconds) throws ResourceException
A value of zero specifies that the timeout is the default system timeout if there is one; otherwise it specifies that there is no timeout. When a ConnectionFactory object is created the timeout is initially zero.
milliseconds
- connection establishment timeout in
millisecondsResourceException
- Failed to set timeout for the
ConnectionFactorypublic int getTimeout() throws ResourceException
ResourceException
- Failed to get timeout for the
ConnectionFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |