com.sas.net.jca
Interface ConnectionFactory


public interface ConnectionFactory
extends java.io.Serializable

A connection factory provides an interface to get a connection to an EIS instance.


Method Summary
 Connection getConnection()
          Get a connection from this factory.
 Connection getConnection(long timeout)
          Get a connection from this factory.
 Connection getConnection(java.lang.String userName, java.lang.String password, long timeout)
          Get a connection from this factory.
 java.io.PrintWriter getLogWriter()
           
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
           
 void setLogWriter(java.io.PrintWriter logWriter)
           
 

Method Detail

getConnection

public Connection getConnection()
                         throws javax.resource.ResourceException
Get a connection from this factory.
Returns:
a connection
Throws:
javax.resource.ResourceException - if there are no connections available in this factory and a new connection cannot be created.

getConnection

public Connection getConnection(long timeout)
                         throws javax.resource.ResourceException
Get a connection from this factory.
Parameters:
timeout - specifies how long the caller is willing to wait for a connection to become available. If the value, T, is greater than 0, then the call will block for T milliseconds or until a connection is available, whichever is shorter. If a connection does not become available in T milliseconds, then an exception will be thrown. If the value is 0, then the call will block until a connection becomes available. If the value is less than 0, then the call will either return a connection immediately or throw an exception if no connections are available.

Note that time for new connections to be created is not included in the time spent waiting. The timeout value only applies when a connection pool has created the maximum number of connections that it allowed to create, and a call to this method must wait for another user to return a connection to the pool.

Returns:
a connection
Throws:
javax.resource.ResourceException - if there are no connections available in this factory and a new connection cannot be created.

getConnection

public Connection getConnection(java.lang.String userName,
                                java.lang.String password,
                                long timeout)
                         throws javax.resource.ResourceException
Get a connection from this factory.
Parameters:
userName - an identity to bind to the connection. This is often the distinguished name of a Person object in an LDAP server.
password - a password that authenticates userName.
timeout - specifies how long the caller is willing to wait for a connection to become available. If the value, T, is greater than 0, then the call will block for T milliseconds or until a connection is available, whichever is shorter. If a connection does not become available in T milliseconds, then an exception will be thrown. If the value is 0, then the call will block until a connection becomes available. If the value is less than 0, then the call will either return a connection immediately or throw an exception if no connections are available.

Note that time for new connections to be created is not included in the time spent waiting. The timeout value only applies when a connection pool has created the maximum number of connections that it allowed to create, and a call to this method must wait for another user to return a connection to the pool.

Returns:
a connection
Throws:
javax.resource.ResourceException - if there are no connections available in this factory and a new connection cannot be created.

getLogWriter

public java.io.PrintWriter getLogWriter()

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()

setLogWriter

public void setLogWriter(java.io.PrintWriter logWriter)