站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 connector API Documentation 英文版文档

BaseWrapperManagedConnectionFactory (JBoss Connector API) - JBoss 4.0.1 sp1 connector API Documentation 英文版文档


org.jboss.resource.adapter.jdbc
Class BaseWrapperManagedConnectionFactory

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

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

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

Version:
$Revision: 1.16.6.1 $
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  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
           
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()
          Get the CheckValidConnectionSQL value.
protected  Properties getConnectionProperties(Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
          Gets full set of connection properties, i.e.
 String getExceptionSorterClassName()
          Get the ExceptionSorterClassname value.
 PrintWriter getLogWriter()
           
 String getNewConnectionSQL()
          Get the NewConnectionSQL value.
 String getPassword()
          Get the value of password.
 int getPreparedStatementCacheSize()
           
 String getTrackStatements()
          Whether to track statements
 String getTransactionIsolation()
          Gets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object
 boolean getTxQueryTimeout()
           
 String getUserName()
          Get the value of userName.
 String getValidConnectionCheckerClassName()
          Get the valid connection checker class name
 void setCheckValidConnectionSQL(String checkValidConnectionSQL)
          Set the CheckValidConnectionSQL value.
 void setExceptionSorterClassName(String exceptionSorterClassName)
          Set the ExceptionSorterClassname value.
 void setLogWriter(PrintWriter param1)
           
 void setNewConnectionSQL(String newConnectionSQL)
          Set the NewConnectionSQL value.
 void setPassword(String password)
          Set the value of password.
 void setPreparedStatementCacheSize(int size)
           
 void setTrackStatements(String value)
          Set the track statements value.
 void setTransactionIsolation(String transactionIsolation)
          Sets the TransactionIsolation attribute of the JDBCManagedConnectionFactory object
 void setTxQueryTimeout(boolean qt)
           
 void setUserName(String userName)
          Set the value of userName.
 void setValidConnectionCheckerClassName(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
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
Constructor Detail

BaseWrapperManagedConnectionFactory

public BaseWrapperManagedConnectionFactory()
Method Detail

getLogWriter

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

setLogWriter

public void setLogWriter(PrintWriter param1)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
param1 -
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
Parameters:
cm -
Returns:
Throws:
javax.resource.ResourceException -

createConnectionFactory

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

getUserName

public String getUserName()
Get the value of userName.

Returns:
value of userName.

setUserName

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

Parameters:
userName - Value to assign to userName.

getPassword

public String getPassword()
Get the value of password.

Returns:
value of password.

setPassword

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

Parameters:
password - Value to assign to password.

getPreparedStatementCacheSize

public int getPreparedStatementCacheSize()

setPreparedStatementCacheSize

public void setPreparedStatementCacheSize(int size)

getTxQueryTimeout

public boolean getTxQueryTimeout()

setTxQueryTimeout

public void setTxQueryTimeout(boolean qt)

getTransactionIsolation

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

Returns:
The TransactionIsolation value

setTransactionIsolation

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

Parameters:
transactionIsolation - The new TransactionIsolation value

getNewConnectionSQL

public String getNewConnectionSQL()
Get the NewConnectionSQL value.

Returns:
the NewConnectionSQL value.

setNewConnectionSQL

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

Parameters:
newConnectionSQL - The new NewConnectionSQL value.

getCheckValidConnectionSQL

public String getCheckValidConnectionSQL()
Get the CheckValidConnectionSQL value.

Returns:
the CheckValidConnectionSQL value.

setCheckValidConnectionSQL

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

Parameters:
checkValidConnectionSQL - The new CheckValidConnectionSQL value.

getTrackStatements

public String getTrackStatements()
Whether to track statements

Returns:
true when tracking statements

setTrackStatements

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

Parameters:
value - true to track statements.

getExceptionSorterClassName

public String getExceptionSorterClassName()
Get the ExceptionSorterClassname value.

Returns:
the ExceptionSorterClassname value.

setExceptionSorterClassName

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

Parameters:
exceptionSorterClassName - The new ExceptionSorterClassName value.

getValidConnectionCheckerClassName

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

Returns:
the class name

setValidConnectionCheckerClassName

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

Parameters:
value - the class name

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.