public abstract class BaseWrapperManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ValidatingManagedConnectionFactory, org.jboss.jca.core.spi.statistics.Statistics, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
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 |
connectionChecker
The instance of the valid connection checker
|
protected boolean |
doQueryTimeout
Query timeout enabled
|
protected java.lang.Boolean |
isTransactionQueryTimeout
Transaction query timeout
|
protected org.jboss.logging.Logger |
log
The logger
|
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
The password
|
protected java.lang.Integer |
preparedStatementCacheSize
The prepared statement cache size
|
protected java.lang.Integer |
queryTimeout
Query timeout
|
protected java.lang.Boolean |
sharePS
Whether to share cached prepared statements
|
protected StaleConnectionChecker |
staleConnectionChecker
The instance of the stale connection checker
|
protected java.util.Properties |
staleConnectionCheckerProps
The properties injected in the stale connection checker
|
static java.lang.String |
TRACK_STATEMENTS_FALSE
Track statements - false
|
static int |
TRACK_STATEMENTS_FALSE_INT
Track statements - false
|
static java.lang.String |
TRACK_STATEMENTS_NOWARN
Track statements - no warning
|
static int |
TRACK_STATEMENTS_NOWARN_INT
Track statements - no warning
|
static java.lang.String |
TRACK_STATEMENTS_TRUE
Track statements - true
|
static int |
TRACK_STATEMENTS_TRUE_INT
Track statements - true
|
protected int |
trackStatements
Track statement
|
protected int |
transactionIsolation
The transaction isolation level
|
protected java.lang.String |
urlDelimiter
The variable
urlDelimiter holds the url delimiter
information to be used for HA DS configuration . |
protected java.lang.String |
urlSelectorStrategyClassName
URL selector strategy class name
|
protected java.lang.String |
userName
The user name
|
protected java.lang.String |
validConnectionCheckerClassName
The classname used to check whether a connection is valid
|
protected java.util.Properties |
validConnectionCheckerProps
The properties injected in the class used to check whether a connection is valid
|
Constructor and Description |
---|
BaseWrapperManagedConnectionFactory()
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createConnectionFactory() |
java.lang.Object |
createConnectionFactory(javax.resource.spi.ConnectionManager cm) |
java.lang.String |
getCheckValidConnectionSQL()
Get the check valid connection SQL statement
|
ClassLoaderPlugin |
getClassLoaderPlugin()
Get the clPlugin.
|
java.lang.String |
getConnectionListenerClassName()
Get connection listener class name
|
java.lang.String |
getConnectionListenerProperties()
Get connection listener properties
|
protected java.util.Properties |
getConnectionProperties(java.util.Properties connectionProps,
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Gets full set of connection properties, i.e.
|
java.lang.String |
getExceptionSorterClassName()
Get the exception sorter class name
|
java.lang.String |
getExceptionSorterProperties()
Get the exceptionSorterProperties.
|
java.util.Properties |
getExceptionSorterProps()
Get the exceptionSorterProps.
|
java.util.Set<BaseWrapperManagedConnection> |
getInvalidConnections(java.util.Set connectionSet)
Get the invalid connections
|
java.lang.String |
getJndiName()
Get the jndi name value
|
java.io.PrintWriter |
getLogWriter() |
java.lang.String |
getNewConnectionSQL()
Get the new connection SQL statement
|
java.lang.String |
getPassword()
Get the password
|
java.lang.Integer |
getPreparedStatementCacheSize()
Get the prepared statement cache size
|
java.lang.Integer |
getQueryTimeout()
Get the query timeout
|
java.lang.Boolean |
getReauthEnabled()
Get reauth enabled
|
java.lang.String |
getReauthPluginClassName()
Get reauth plugin class name
|
java.lang.String |
getReauthPluginProperties()
Get reauth plugin properties
|
java.lang.Boolean |
getSharePreparedStatements()
Get the prepared statement share status
|
java.lang.Boolean |
getSpy()
Get the spy value
|
java.lang.String |
getStaleConnectionCheckerClassName()
Get the stale connection checker class name
|
java.lang.String |
getStaleConnectionCheckerProperties()
Get the staleConnectionCheckerProperties.
|
java.util.Properties |
getStaleConnectionCheckerProps()
Get the staleConnectionCheckerProps.
|
JdbcStatisticsPlugin |
getStatistics()
Get the statistics plugin
|
java.lang.String |
getTrackStatements()
Get the track statement value
|
java.lang.String |
getTransactionIsolation()
Get the transaction isolation level
|
protected javax.transaction.TransactionSynchronizationRegistry |
getTransactionSynchronizationRegistry()
Get the transaction synchronization registry
|
java.lang.String |
getURLDelimiter()
Get the url delimiter
|
java.lang.String |
getUrlSelectorStrategyClassName()
Get the url selector strategy class name
|
java.lang.String |
getUserName()
Get the user name
|
protected javax.transaction.UserTransaction |
getUserTransaction()
Get the user transaction
|
java.lang.String |
getUserTransactionJndiName()
Get the user transaction JNDI name
|
java.lang.Integer |
getUseTryLock()
Get the use try lock value
|
java.lang.Boolean |
getValidateOnMatch()
Get the validate on match value
|
java.lang.String |
getValidConnectionCheckerClassName()
Get the valid connection checker class name
|
java.lang.String |
getValidConnectionCheckerProperties()
Get the validConnectionCheckerProperties.
|
java.util.Properties |
getValidConnectionCheckerProps()
Get the validConnectionCheckerProps.
|
java.lang.Boolean |
isJTA()
Get the JTA status
|
java.lang.Boolean |
isTransactionQueryTimeout()
Is transaction query timeout set
|
void |
setCheckValidConnectionSQL(java.lang.String checkValidConnectionSQL)
Set the check valid connection SQL statement
|
void |
setClassLoaderPlugin(ClassLoaderPlugin clPlugin)
Set the clPlugin.
|
void |
setConnectionListenerClassName(java.lang.String v)
Set connection listener class name
|
void |
setConnectionListenerProperties(java.lang.String v)
Set connection listener properties
|
void |
setExceptionSorterClassName(java.lang.String exceptionSorterClassName)
Set the exception sorter class name
|
void |
setExceptionSorterProperties(java.lang.String exceptionSorterProperties)
Set the exceptionSorterProperties.
|
void |
setJndiName(java.lang.String v)
Set the jndi name value
|
void |
setJTA(java.lang.Boolean v)
Set the JTA status
|
void |
setLogWriter(java.io.PrintWriter v) |
void |
setNewConnectionSQL(java.lang.String newConnectionSQL)
Set the new connection SQL statement
|
void |
setPassword(java.lang.String password)
Set the password
|
void |
setPreparedStatementCacheSize(java.lang.Integer size)
Set the prepared statement cache size
|
void |
setQueryTimeout(java.lang.Integer timeout)
Set the query timeout
|
void |
setReauthEnabled(java.lang.Boolean v)
Set reauth enabled
|
void |
setReauthPluginClassName(java.lang.String v)
Set reauth plugin class name
|
void |
setReauthPluginProperties(java.lang.String v)
Set reauth plugin properties
|
void |
setSharePreparedStatements(java.lang.Boolean sharePS)
Set the prepared statement share status
|
void |
setSpy(java.lang.Boolean v)
Set the spy value
|
void |
setStaleConnectionCheckerClassName(java.lang.String value)
Set the stale connection checker class name
|
void |
setStaleConnectionCheckerProperties(java.lang.String staleConnectionCheckerProperties)
Set the staleConnectionCheckerProperties.
|
void |
setTrackStatements(java.lang.String value)
Set the track statement value
|
void |
setTransactionIsolation(java.lang.String transactionIsolation)
Set the transaction isolation level
|
void |
setTransactionQueryTimeout(java.lang.Boolean value)
Set transaction query timeout
|
protected void |
setTransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry v)
Set the transaction synchronization registry
|
void |
setURLDelimiter(java.lang.String urlDelimiter)
Set the url delimiter.
|
void |
setUrlSelectorStrategyClassName(java.lang.String urlSelectorStrategyClassName)
Set the url selector strategy class name
|
void |
setUserName(java.lang.String userName)
Set the user name
|
protected void |
setUserTransaction(javax.transaction.UserTransaction v)
Set the user transaction
|
void |
setUserTransactionJndiName(java.lang.String v)
Set the user transaction JNDI name
|
void |
setUseTryLock(java.lang.Integer useTryLock)
Set the use try lock value
|
void |
setValidateOnMatch(java.lang.Boolean validateOnMatch)
Set the validate on match value
|
void |
setValidConnectionCheckerClassName(java.lang.String value)
Set the valid connection checker class name
|
void |
setValidConnectionCheckerProperties(java.lang.String validConnectionCheckerProperties)
Set the validConnectionCheckerProperties.
|
public static final int TRACK_STATEMENTS_FALSE_INT
public static final int TRACK_STATEMENTS_TRUE_INT
public static final int TRACK_STATEMENTS_NOWARN_INT
public static final java.lang.String TRACK_STATEMENTS_FALSE
public static final java.lang.String TRACK_STATEMENTS_TRUE
public static final java.lang.String TRACK_STATEMENTS_NOWARN
protected final org.jboss.logging.Logger log
protected java.lang.String userName
protected java.lang.String password
protected int transactionIsolation
protected java.lang.Integer preparedStatementCacheSize
protected boolean doQueryTimeout
protected java.lang.String newConnectionSQL
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 checkValidConnectionSQL
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.protected java.lang.String validConnectionCheckerClassName
protected final java.util.Properties validConnectionCheckerProps
protected ValidConnectionChecker connectionChecker
protected StaleConnectionChecker staleConnectionChecker
protected final java.util.Properties staleConnectionCheckerProps
protected int trackStatements
protected java.lang.Boolean sharePS
protected java.lang.Boolean isTransactionQueryTimeout
protected java.lang.Integer queryTimeout
protected java.lang.String urlDelimiter
urlDelimiter
holds the url delimiter
information to be used for HA DS configuration .protected java.lang.String urlSelectorStrategyClassName
public BaseWrapperManagedConnectionFactory()
public java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public void setLogWriter(java.io.PrintWriter v) throws javax.resource.ResourceException
setLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm) throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public java.lang.Object createConnectionFactory() throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- The valuepublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The valuepublic java.lang.Integer getPreparedStatementCacheSize()
public void setPreparedStatementCacheSize(java.lang.Integer size)
size
- The valuepublic java.lang.Boolean getSharePreparedStatements()
public void setSharePreparedStatements(java.lang.Boolean sharePS)
sharePS
- The valuepublic java.lang.String getTransactionIsolation()
public void setTransactionIsolation(java.lang.String transactionIsolation)
transactionIsolation
- The valuepublic java.lang.String getNewConnectionSQL()
public void setNewConnectionSQL(java.lang.String newConnectionSQL)
newConnectionSQL
- The valuepublic java.lang.String getCheckValidConnectionSQL()
public void setCheckValidConnectionSQL(java.lang.String checkValidConnectionSQL)
checkValidConnectionSQL
- The valuepublic java.lang.String getStaleConnectionCheckerClassName()
public void setStaleConnectionCheckerClassName(java.lang.String value)
value
- The valuepublic java.lang.String getTrackStatements()
public void setTrackStatements(java.lang.String value)
value
- The valuepublic java.lang.Boolean getValidateOnMatch()
public void setValidateOnMatch(java.lang.Boolean validateOnMatch)
validateOnMatch
- The valuepublic java.lang.String getExceptionSorterClassName()
public void setExceptionSorterClassName(java.lang.String exceptionSorterClassName)
exceptionSorterClassName
- The valuepublic java.lang.String getValidConnectionCheckerClassName()
public void setValidConnectionCheckerClassName(java.lang.String value)
value
- The valuepublic java.lang.Boolean isTransactionQueryTimeout()
public void setTransactionQueryTimeout(java.lang.Boolean value)
value
- The valuepublic java.lang.Integer getQueryTimeout()
public void setQueryTimeout(java.lang.Integer timeout)
timeout
- The valuepublic java.lang.Integer getUseTryLock()
public void setUseTryLock(java.lang.Integer useTryLock)
useTryLock
- The valuepublic void setSpy(java.lang.Boolean v)
v
- The valuepublic java.lang.Boolean getSpy()
public void setJndiName(java.lang.String v)
v
- The valuepublic java.lang.String getJndiName()
public java.lang.Boolean getReauthEnabled()
public void setReauthEnabled(java.lang.Boolean v)
v
- The valuepublic java.lang.String getReauthPluginClassName()
public void setReauthPluginClassName(java.lang.String v)
v
- The valuepublic java.lang.String getReauthPluginProperties()
public void setReauthPluginProperties(java.lang.String v)
v
- The valuepublic java.lang.String getConnectionListenerClassName()
public void setConnectionListenerClassName(java.lang.String v)
v
- The valuepublic java.lang.String getConnectionListenerProperties()
public void setConnectionListenerProperties(java.lang.String v)
v
- The valuepublic java.lang.String getURLDelimiter()
public void setURLDelimiter(java.lang.String urlDelimiter)
urlDelimiter
- The valuepublic java.lang.String getUrlSelectorStrategyClassName()
public void setUrlSelectorStrategyClassName(java.lang.String urlSelectorStrategyClassName)
urlSelectorStrategyClassName
- The valuepublic java.lang.String getUserTransactionJndiName()
public void setUserTransactionJndiName(java.lang.String v)
v
- The valueprotected javax.transaction.UserTransaction getUserTransaction()
protected void setUserTransaction(javax.transaction.UserTransaction v)
v
- The valueprotected javax.transaction.TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()
protected void setTransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry v)
v
- The valuepublic JdbcStatisticsPlugin getStatistics()
getStatistics
in interface org.jboss.jca.core.spi.statistics.Statistics
public java.lang.Boolean isJTA()
public void setJTA(java.lang.Boolean v)
v
- The valuepublic java.util.Set<BaseWrapperManagedConnection> getInvalidConnections(java.util.Set connectionSet) throws javax.resource.ResourceException
getInvalidConnections
in interface javax.resource.spi.ValidatingManagedConnectionFactory
connectionSet
- The connection setjavax.resource.ResourceException
- Thrown if an error occursprotected java.util.Properties getConnectionProperties(java.util.Properties connectionProps, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
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".
connectionProps
- The connection propertiessubject
- The subjectcri
- The connection request infojavax.resource.ResourceException
- Thrown if an error occurspublic final java.util.Properties getValidConnectionCheckerProps()
public final java.util.Properties getStaleConnectionCheckerProps()
public final java.util.Properties getExceptionSorterProps()
public final java.lang.String getValidConnectionCheckerProperties()
public final void setValidConnectionCheckerProperties(java.lang.String validConnectionCheckerProperties)
validConnectionCheckerProperties
- The validConnectionCheckerProperties to set.public final java.lang.String getStaleConnectionCheckerProperties()
public final void setStaleConnectionCheckerProperties(java.lang.String staleConnectionCheckerProperties)
staleConnectionCheckerProperties
- The staleConnectionCheckerProperties to set.public final java.lang.String getExceptionSorterProperties()
public final void setExceptionSorterProperties(java.lang.String exceptionSorterProperties)
exceptionSorterProperties
- The exceptionSorterProperties to set.public final ClassLoaderPlugin getClassLoaderPlugin()
public final void setClassLoaderPlugin(ClassLoaderPlugin clPlugin)
clPlugin
- The clPlugin to set.Copyright © 2013 IronJacamar (http://www.ironjacamar.org)