org.jboss.resource.adapter.jdbc
Class BaseWrapperManagedConnectionFactory

java.lang.Object
  extended byorg.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory
All Implemented Interfaces:
ManagedConnectionFactory (src) , java.io.Serializable
Direct Known Subclasses:
LocalManagedConnectionFactory (src) , XAManagedConnectionFactory (src)

public abstract class BaseWrapperManagedConnectionFactory
extends java.lang.Object
implements ManagedConnectionFactory (src) , java.io.Serializable

BaseWrapperManagedConnectionFactory.java Created: Fri Apr 19 13:33:08 2002

See Also:
Serialized Form

Field Summary
protected  java.lang.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 (src) connectionChecker
          The instance of the valid connection checker
protected  java.util.Properties connectionProps
           
protected  boolean doQueryTimeout
           
protected  Logger (src) log
           
protected  java.lang.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  java.lang.String password
           
protected  int preparedStatementCacheSize
           
protected  boolean sharePS
          Whether to cached share prepared statements
static java.lang.String TRACK_STATEMENTS_FALSE
           
static int TRACK_STATEMENTS_FALSE_INT
           
static java.lang.String TRACK_STATEMENTS_NOWARN
           
static int TRACK_STATEMENTS_NOWARN_INT
           
static java.lang.String TRACK_STATEMENTS_TRUE
           
static int TRACK_STATEMENTS_TRUE_INT
           
protected  int trackStatements
           
protected  int transactionIsolation
           
protected  java.lang.String userName
           
protected  java.lang.String validConnectionCheckerClassName
          The classname used to check whether a connection is valid
 
Constructor Summary
BaseWrapperManagedConnectionFactory()
           
 
Method Summary
 java.lang.Object createConnectionFactory()
          Creates a connection factory instance.
 java.lang.Object createConnectionFactory(ConnectionManager (src)  cm)
          Creates a connection factory instance.
 java.lang.String getCheckValidConnectionSQL()
          Get the CheckValidConnectionSQL value.
protected  java.util.Properties getConnectionProperties(javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cri)
          Gets full set of connection properties, i.e.
 java.lang.String getExceptionSorterClassName()
          Get the ExceptionSorterClassname value.
 java.io.PrintWriter getLogWriter()
          Gets the logwriter for this instance.
 java.lang.String getNewConnectionSQL()
          Get the NewConnectionSQL value.
 java.lang.String getPassword()
          Get the value of password.
 int getPreparedStatementCacheSize()
           
 boolean getSharePreparedStatements()
           
 java.lang.String getTrackStatements()
          Whether to track statements
 java.lang.String getTransactionIsolation()
          Gets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object
 boolean getTxQueryTimeout()
           
 java.lang.String getUserName()
          Get the value of userName.
 java.lang.String getValidConnectionCheckerClassName()
          Get the valid connection checker class name
 void setCheckValidConnectionSQL(java.lang.String checkValidConnectionSQL)
          Set the CheckValidConnectionSQL value.
 void setExceptionSorterClassName(java.lang.String exceptionSorterClassName)
          Set the ExceptionSorterClassname value.
 void setLogWriter(java.io.PrintWriter param1)
          Sets the logwriter for this instance.
 void setNewConnectionSQL(java.lang.String newConnectionSQL)
          Set the NewConnectionSQL value.
 void setPassword(java.lang.String password)
          Set the value of password.
 void setPreparedStatementCacheSize(int size)
           
 void setSharePreparedStatements(boolean sharePS)
           
 void setTrackStatements(java.lang.String value)
          Set the track statements value.
 void setTransactionIsolation(java.lang.String transactionIsolation)
          Sets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object
 void setTxQueryTimeout(boolean qt)
           
 void setUserName(java.lang.String userName)
          Set the value of userName.
 void setValidConnectionCheckerClassName(java.lang.String value)
          Set the valid connection checker class name
 
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 (src)
createManagedConnection, equals, hashCode, matchManagedConnections
 

Field Detail

TRACK_STATEMENTS_FALSE_INT

public static final int TRACK_STATEMENTS_FALSE_INT
See Also:
Constant Field Values (src)

TRACK_STATEMENTS_TRUE_INT

public static final int TRACK_STATEMENTS_TRUE_INT
See Also:
Constant Field Values (src)

TRACK_STATEMENTS_NOWARN_INT

public static final int TRACK_STATEMENTS_NOWARN_INT
See Also:
Constant Field Values (src)

TRACK_STATEMENTS_FALSE

public static final java.lang.String TRACK_STATEMENTS_FALSE
See Also:
Constant Field Values (src)

TRACK_STATEMENTS_TRUE

public static final java.lang.String TRACK_STATEMENTS_TRUE
See Also:
Constant Field Values (src)

TRACK_STATEMENTS_NOWARN

public static final java.lang.String TRACK_STATEMENTS_NOWARN
See Also:
Constant Field Values (src)

log

protected final Logger (src)  log

userName

protected java.lang.String userName

password

protected java.lang.String password

connectionProps

protected final java.util.Properties connectionProps

transactionIsolation

protected int transactionIsolation

preparedStatementCacheSize

protected int preparedStatementCacheSize

doQueryTimeout

protected boolean doQueryTimeout

newConnectionSQL

protected java.lang.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 java.lang.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 java.lang.String validConnectionCheckerClassName
The classname used to check whether a connection is valid


connectionChecker

protected ValidConnectionChecker (src)  connectionChecker
The instance of the valid connection checker


trackStatements

protected int trackStatements

sharePS

protected boolean sharePS
Whether to cached share prepared statements

Constructor Detail

BaseWrapperManagedConnectionFactory

public BaseWrapperManagedConnectionFactory()
Method Detail

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws ResourceException (src) 
Description copied from interface: ManagedConnectionFactory (src)
Gets the logwriter for this instance.

Specified by:
getLogWriter in interface ManagedConnectionFactory (src)
Returns:
Throws:
ResourceException (src) -

setLogWriter

public void setLogWriter(java.io.PrintWriter param1)
                  throws ResourceException (src) 
Description copied from interface: ManagedConnectionFactory (src)
Sets the logwriter for this instance.

Specified by:
setLogWriter in interface ManagedConnectionFactory (src)
Parameters:
param1 -
Throws:
ResourceException (src) -

createConnectionFactory

public java.lang.Object createConnectionFactory(ConnectionManager (src)  cm)
                                         throws ResourceException (src) 
Description copied from interface: ManagedConnectionFactory (src)
Creates a connection factory instance. the connection manager is provided by the application server

Specified by:
createConnectionFactory in interface ManagedConnectionFactory (src)
Parameters:
cm -
Returns:
Throws:
ResourceException (src) -

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws ResourceException (src) 
Description copied from interface: ManagedConnectionFactory (src)
Creates a connection factory instance. The connection manager is provided by the resource adapter.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory (src)
Returns:
Throws:
ResourceException (src) -

getUserName

public java.lang.String getUserName()
Get the value of userName.

Returns:
value of userName.

setUserName

public void setUserName(java.lang.String userName)
Set the value of userName.

Parameters:
userName - Value to assign to userName.

getPassword

public java.lang.String getPassword()
Get the value of password.

Returns:
value of password.

setPassword

public void setPassword(java.lang.String password)
Set the value of password.

Parameters:
password - Value to assign to password.

getPreparedStatementCacheSize

public int getPreparedStatementCacheSize()

setPreparedStatementCacheSize

public void setPreparedStatementCacheSize(int size)

getSharePreparedStatements

public boolean getSharePreparedStatements()

setSharePreparedStatements

public void setSharePreparedStatements(boolean sharePS)

getTxQueryTimeout

public boolean getTxQueryTimeout()

setTxQueryTimeout

public void setTxQueryTimeout(boolean qt)

getTransactionIsolation

public java.lang.String getTransactionIsolation()
Gets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object

Returns:
The TransactionIsolation value

setTransactionIsolation

public void setTransactionIsolation(java.lang.String transactionIsolation)
Sets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object

Parameters:
transactionIsolation - The new TransactionIsolation value

getNewConnectionSQL

public java.lang.String getNewConnectionSQL()
Get the NewConnectionSQL value.

Returns:
the NewConnectionSQL value.

setNewConnectionSQL

public void setNewConnectionSQL(java.lang.String newConnectionSQL)
Set the NewConnectionSQL value.

Parameters:
newConnectionSQL - The new NewConnectionSQL value.

getCheckValidConnectionSQL

public java.lang.String getCheckValidConnectionSQL()
Get the CheckValidConnectionSQL value.

Returns:
the CheckValidConnectionSQL value.

setCheckValidConnectionSQL

public void setCheckValidConnectionSQL(java.lang.String checkValidConnectionSQL)
Set the CheckValidConnectionSQL value.

Parameters:
checkValidConnectionSQL - The new CheckValidConnectionSQL value.

getTrackStatements

public java.lang.String getTrackStatements()
Whether to track statements

Returns:
true when tracking statements

setTrackStatements

public void setTrackStatements(java.lang.String value)
Set the track statements value.

Parameters:
value - true to track statements.

getExceptionSorterClassName

public java.lang.String getExceptionSorterClassName()
Get the ExceptionSorterClassname value.

Returns:
the ExceptionSorterClassname value.

setExceptionSorterClassName

public void setExceptionSorterClassName(java.lang.String exceptionSorterClassName)
Set the ExceptionSorterClassname value.

Parameters:
exceptionSorterClassName - The new ExceptionSorterClassName value.

getValidConnectionCheckerClassName

public java.lang.String getValidConnectionCheckerClassName()
Get the valid connection checker class name

Returns:
the class name

setValidConnectionCheckerClassName

public void setValidConnectionCheckerClassName(java.lang.String value)
Set the valid connection checker class name

Parameters:
value - the class name

getConnectionProperties

protected java.util.Properties getConnectionProperties(javax.security.auth.Subject subject,
                                                       ConnectionRequestInfo (src)  cri)
                                                throws ResourceException (src) 
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:
ResourceException (src)