org.jboss.resource.adapter.jdbc
Class BaseWrapperManagedConnectionFactory

java.lang.Object
  extended by org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory
All Implemented Interfaces:
Serializable, javax.resource.spi.ManagedConnectionFactory
Direct Known Subclasses:
LocalManagedConnectionFactory, XAManagedConnectionFactory

public abstract class BaseWrapperManagedConnectionFactory
extends Object
implements javax.resource.spi.ManagedConnectionFactory, Serializable

BaseWrapperManagedConnectionFactory

Version:
$Revision: 1.16.2.10 $
Author:
David Jencks, Adrian Brock
See Also:
Serialized Form

Field Summary
protected  String checkValidConnectionSQL
          The variable checkValidConnectionSQL holds an sql statement that may be executed whenever a managed connection is removed from the pool, to check that it is still valid.
protected  ValidConnectionChecker connectionChecker
          The instance of the valid connection checker
protected  Properties connectionProps
           
protected  boolean doQueryTimeout
           
protected  boolean isTransactionQueryTimeout
           
protected  org.jboss.logging.Logger log
           
protected  String newConnectionSQL
          The variable newConnectionSQL holds an SQL statement which if not null is executed when a new Connection is obtained for a new ManagedConnection.
protected  String password
           
protected  int preparedStatementCacheSize
           
protected  int queryTimeout
           
protected  boolean sharePS
          Whether to cached share prepared statements
static String TRACK_STATEMENTS_FALSE
           
static int TRACK_STATEMENTS_FALSE_INT
           
static String TRACK_STATEMENTS_NOWARN
           
static int TRACK_STATEMENTS_NOWARN_INT
           
static String TRACK_STATEMENTS_TRUE
           
static int TRACK_STATEMENTS_TRUE_INT
           
protected  int trackStatements
           
protected  int transactionIsolation
           
protected  String userName
           
protected  String validConnectionCheckerClassName
          The classname used to check whether a connection is valid
 
Constructor Summary
BaseWrapperManagedConnectionFactory()
           
 
Method Summary
 Object createConnectionFactory()
           
 Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
           
 String getCheckValidConnectionSQL()
           
protected  Properties getConnectionProperties(Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
          Gets full set of connection properties, i.e.
 String getExceptionSorterClassName()
           
 PrintWriter getLogWriter()
           
 String getNewConnectionSQL()
           
 String getPassword()
           
 int getPreparedStatementCacheSize()
           
 int getQueryTimeout()
           
 boolean getSharePreparedStatements()
           
 String getTrackStatements()
           
 String getTransactionIsolation()
           
 String getUserName()
           
 String getValidConnectionCheckerClassName()
           
 boolean isTransactionQueryTimeout()
           
 void setCheckValidConnectionSQL(String checkValidConnectionSQL)
           
 void setExceptionSorterClassName(String exceptionSorterClassName)
           
 void setLogWriter(PrintWriter param1)
           
 void setNewConnectionSQL(String newConnectionSQL)
           
 void setPassword(String password)
           
 void setPreparedStatementCacheSize(int size)
           
 void setQueryTimeout(int timeout)
           
 void setSharePreparedStatements(boolean sharePS)
           
 void setTrackStatements(String value)
           
 void setTransactionIsolation(String transactionIsolation)
           
 void setTransactionQueryTimeout(boolean value)
           
 void setUserName(String userName)
           
 void setValidConnectionCheckerClassName(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
createManagedConnection, equals, hashCode, matchManagedConnections
 

Field Detail

TRACK_STATEMENTS_FALSE_INT

public static final int TRACK_STATEMENTS_FALSE_INT
See Also:
Constant Field Values

TRACK_STATEMENTS_TRUE_INT

public static final int TRACK_STATEMENTS_TRUE_INT
See Also:
Constant Field Values

TRACK_STATEMENTS_NOWARN_INT

public static final int TRACK_STATEMENTS_NOWARN_INT
See Also:
Constant Field Values

TRACK_STATEMENTS_FALSE

public static final String TRACK_STATEMENTS_FALSE
See Also:
Constant Field Values

TRACK_STATEMENTS_TRUE

public static final String TRACK_STATEMENTS_TRUE
See Also:
Constant Field Values

TRACK_STATEMENTS_NOWARN

public static final String TRACK_STATEMENTS_NOWARN
See Also:
Constant Field Values

log

protected final org.jboss.logging.Logger log

userName

protected String userName

password

protected String password

connectionProps

protected final Properties connectionProps

transactionIsolation

protected int transactionIsolation

preparedStatementCacheSize

protected int preparedStatementCacheSize

doQueryTimeout

protected boolean doQueryTimeout

newConnectionSQL

protected String newConnectionSQL
The variable newConnectionSQL holds an SQL statement which if not null is executed when a new Connection is obtained for a new ManagedConnection.


checkValidConnectionSQL

protected String checkValidConnectionSQL
The variable checkValidConnectionSQL holds an sql statement that may be executed whenever a managed connection is removed from the pool, to check that it is still valid. This requires setting up an mbean to execute it when notified by the ConnectionManager.


validConnectionCheckerClassName

protected String validConnectionCheckerClassName
The classname used to check whether a connection is valid


connectionChecker

protected ValidConnectionChecker connectionChecker
The instance of the valid connection checker


trackStatements

protected int trackStatements

sharePS

protected boolean sharePS
Whether to cached share prepared statements


isTransactionQueryTimeout

protected boolean isTransactionQueryTimeout

queryTimeout

protected int queryTimeout
Constructor Detail

BaseWrapperManagedConnectionFactory

public BaseWrapperManagedConnectionFactory()
Method Detail

getLogWriter

public PrintWriter getLogWriter()
                         throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(PrintWriter param1)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

createConnectionFactory

public Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
                               throws javax.resource.ResourceException
Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

createConnectionFactory

public Object createConnectionFactory()
                               throws javax.resource.ResourceException
Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

getUserName

public String getUserName()

setUserName

public void setUserName(String userName)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getPreparedStatementCacheSize

public int getPreparedStatementCacheSize()

setPreparedStatementCacheSize

public void setPreparedStatementCacheSize(int size)

getSharePreparedStatements

public boolean getSharePreparedStatements()

setSharePreparedStatements

public void setSharePreparedStatements(boolean sharePS)

getTransactionIsolation

public String getTransactionIsolation()

setTransactionIsolation

public void setTransactionIsolation(String transactionIsolation)

getNewConnectionSQL

public String getNewConnectionSQL()

setNewConnectionSQL

public void setNewConnectionSQL(String newConnectionSQL)

getCheckValidConnectionSQL

public String getCheckValidConnectionSQL()

setCheckValidConnectionSQL

public void setCheckValidConnectionSQL(String checkValidConnectionSQL)

getTrackStatements

public String getTrackStatements()

setTrackStatements

public void setTrackStatements(String value)

getExceptionSorterClassName

public String getExceptionSorterClassName()

setExceptionSorterClassName

public void setExceptionSorterClassName(String exceptionSorterClassName)

getValidConnectionCheckerClassName

public String getValidConnectionCheckerClassName()

setValidConnectionCheckerClassName

public void setValidConnectionCheckerClassName(String value)

isTransactionQueryTimeout

public boolean isTransactionQueryTimeout()

setTransactionQueryTimeout

public void setTransactionQueryTimeout(boolean value)

getQueryTimeout

public int getQueryTimeout()

setQueryTimeout

public void setQueryTimeout(int timeout)

getConnectionProperties

protected Properties getConnectionProperties(Subject subject,
                                             javax.resource.spi.ConnectionRequestInfo cri)
                                      throws javax.resource.ResourceException
Gets full set of connection properties, i.e. whatever is provided in config plus "user" and "password" from subject/cri.

Note that the set is used to match connections to datasources as well as to create new managed connections.

In fact, we have a problem here. Theoretically, there is a possible name collision between config properties and "user"/"password".

Throws:
javax.resource.ResourceException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.