public abstract class BaseWrapperManagedConnectionFactory extends Object implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ValidatingManagedConnectionFactory, javax.resource.spi.ResourceAdapterAssociation, Statistics, Serializable
Modifier and Type | Field and Description |
---|---|
protected static AdaptersBundle |
bundle
The bundle
|
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 boolean |
doQueryTimeout
Query timeout enabled
|
protected Boolean |
isTransactionQueryTimeout
Transaction query timeout
|
protected AdaptersLogger |
log
The logger
|
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
The password
|
protected boolean |
poolValidationLoggingEnabled |
protected Integer |
preparedStatementCacheSize
The prepared statement cache size
|
protected Integer |
queryTimeout
Query timeout
|
protected Boolean |
sharePS
Whether to share cached prepared statements
|
protected StaleConnectionChecker |
staleConnectionChecker
The instance of the stale connection checker
|
protected Properties |
staleConnectionCheckerProps
The properties injected in the stale connection checker
|
static String |
TRACK_STATEMENTS_FALSE
Track statements - false
|
static int |
TRACK_STATEMENTS_FALSE_INT
Track statements - false
|
static String |
TRACK_STATEMENTS_NOWARN
Track statements - no warning
|
static int |
TRACK_STATEMENTS_NOWARN_INT
Track statements - no warning
|
static 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 String |
urlDelimiter
The variable
urlDelimiter holds the url delimiter
information to be used for HA DS configuration . |
protected String |
urlSelectorStrategyClassName
URL selector strategy class name
|
protected String |
userName
The user name
|
protected String |
validConnectionCheckerClassName
The classname used to check whether a connection is valid
|
protected 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 |
---|---|
Object |
createConnectionFactory() |
Object |
createConnectionFactory(javax.resource.spi.ConnectionManager cm) |
String |
getCheckValidConnectionSQL()
Get the check valid connection SQL statement
|
ClassLoaderPlugin |
getClassLoaderPlugin()
Get the clPlugin.
|
String |
getConnectionListenerClassName()
Get connection listener class name
|
String |
getConnectionListenerProperties()
Get connection listener properties
|
protected Properties |
getConnectionProperties(Properties connectionProps,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Gets full set of connection properties, i.e.
|
ClassLoader |
getExceptionSorterClassLoader()
Get the exception sorter module name
|
String |
getExceptionSorterClassName()
Get the exception sorter class name
|
String |
getExceptionSorterProperties()
Get the exceptionSorterProperties.
|
Properties |
getExceptionSorterProps()
Get the exceptionSorterProps.
|
Set<BaseWrapperManagedConnection> |
getInvalidConnections(Set connectionSet)
Get the invalid connections
|
String |
getJndiName()
Get the jndi name value
|
PrintWriter |
getLogWriter() |
String |
getNewConnectionSQL()
Get the new connection SQL statement
|
String |
getPassword()
Get the password
|
Integer |
getPreparedStatementCacheSize()
Get the prepared statement cache size
|
Integer |
getQueryTimeout()
Get the query timeout
|
Boolean |
getReauthEnabled()
Get reauth enabled
|
String |
getReauthPluginClassName()
Get reauth plugin class name
|
String |
getReauthPluginProperties()
Get reauth plugin properties
|
javax.resource.spi.ResourceAdapter |
getResourceAdapter() |
Boolean |
getSharePreparedStatements()
Get the prepared statement share status
|
Boolean |
getSpy()
Get the spy value
|
String |
getStaleConnectionCheckerClassName()
Get the stale connection checker class name
|
String |
getStaleConnectionCheckerProperties()
Get the staleConnectionCheckerProperties.
|
Properties |
getStaleConnectionCheckerProps()
Get the staleConnectionCheckerProps.
|
ClassLoader |
getStaleConnectionClassLoader()
Get the stale connection checker module name
|
JdbcStatisticsPlugin |
getStatistics()
Get the statistics plugin
|
String |
getTrackStatements()
Get the track statement value
|
String |
getTransactionIsolation()
Get the transaction isolation level
|
String |
getURLDelimiter()
Get the url delimiter
|
String |
getUrlSelectorStrategyClassName()
Get the url selector strategy class name
|
String |
getUserName()
Get the user name
|
Integer |
getUseTryLock()
Get the use try lock value
|
ClassLoader |
getValidConnectionCheckerClassLoader()
Get the valid connection checker class loader
|
String |
getValidConnectionCheckerClassName()
Get the valid connection checker class name
|
String |
getValidConnectionCheckerProperties()
Get the validConnectionCheckerProperties.
|
Properties |
getValidConnectionCheckerProps()
Get the validConnectionCheckerProps.
|
boolean |
isDoLocking()
Are we doing locking
|
boolean |
isExceptionFatal(SQLException e)
Is the exception fatal
|
Boolean |
isJTA()
Get the JTA status
|
Boolean |
isTransactionQueryTimeout()
Is transaction query timeout set
|
void |
setCheckValidConnectionSQL(String checkValidConnectionSQL)
Set the check valid connection SQL statement
|
void |
setClassLoaderPlugin(ClassLoaderPlugin clPlugin)
Set the clPlugin.
|
void |
setConnectionListenerClassName(String v)
Set connection listener class name
|
void |
setConnectionListenerProperties(String v)
Set connection listener properties
|
void |
setExceptionSorterClassLoader(ClassLoader exceptionSorterClassLoader)
Set the exception sorter module name
|
void |
setExceptionSorterClassName(String exceptionSorterClassName)
Set the exception sorter class name
|
void |
setExceptionSorterProperties(String exceptionSorterProperties)
Set the exceptionSorterProperties.
|
void |
setJndiName(String v)
Set the jndi name value
|
void |
setJTA(Boolean v)
Set the JTA status
|
void |
setLogWriter(PrintWriter v) |
void |
setNewConnectionSQL(String newConnectionSQL)
Set the new connection SQL statement
|
void |
setOriginalTCCLn(ClassLoader cl)
Set the originalTCCL.
|
void |
setPassword(String password)
Set the password
|
void |
setPoolValidationLoggingEnabled(boolean poolValidationLoggingEnabled) |
void |
setPreparedStatementCacheSize(Integer size)
Set the prepared statement cache size
|
void |
setQueryTimeout(Integer timeout)
Set the query timeout
|
void |
setReauthEnabled(Boolean v)
Set reauth enabled
|
void |
setReauthPluginClassName(String v)
Set reauth plugin class name
|
void |
setReauthPluginProperties(String v)
Set reauth plugin properties
|
void |
setResourceAdapter(javax.resource.spi.ResourceAdapter ra) |
void |
setSharePreparedStatements(Boolean sharePS)
Set the prepared statement share status
|
void |
setSpy(Boolean v)
Set the spy value
|
void |
setStaleConnectionCheckerClassLoader(ClassLoader staleConnectionCheckerClassLoader)
Set the stale connection checker module name
|
void |
setStaleConnectionCheckerClassName(String staleConnectionCheckerClassName)
Set the stale connection checker class name
|
void |
setStaleConnectionCheckerProperties(String staleConnectionCheckerProperties)
Set the staleConnectionCheckerProperties.
|
void |
setTrackStatements(String value)
Set the track statement value
|
void |
setTransactionIsolation(String transactionIsolation)
Set the transaction isolation level
|
void |
setTransactionQueryTimeout(Boolean value)
Set transaction query timeout
|
void |
setURLDelimiter(String urlDelimiter)
Set the url delimiter.
|
void |
setUrlSelectorStrategyClassName(String urlSelectorStrategyClassName)
Set the url selector strategy class name
|
void |
setUserName(String userName)
Set the user name
|
void |
setUseTryLock(Integer useTryLock)
Set the use try lock value
|
void |
setValidConnectionCheckerClassLoader(ClassLoader validConnectionCheckerClassLoader)
Set the valid connection checker class name
|
void |
setValidConnectionCheckerClassName(String validConnectionCheckerClassName)
Set the valid connection checker class name
|
void |
setValidConnectionCheckerProperties(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 String TRACK_STATEMENTS_FALSE
public static final String TRACK_STATEMENTS_TRUE
public static final String TRACK_STATEMENTS_NOWARN
protected final AdaptersLogger log
protected static AdaptersBundle bundle
protected String userName
protected String password
protected int transactionIsolation
protected Integer preparedStatementCacheSize
protected boolean doQueryTimeout
protected boolean poolValidationLoggingEnabled
protected String newConnectionSQL
newConnectionSQL
holds an SQL
statement which if not null is executed when a new Connection is
obtained for a new ManagedConnection.protected 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 String validConnectionCheckerClassName
protected final Properties validConnectionCheckerProps
protected ValidConnectionChecker connectionChecker
protected StaleConnectionChecker staleConnectionChecker
protected final Properties staleConnectionCheckerProps
protected int trackStatements
protected Boolean sharePS
protected Boolean isTransactionQueryTimeout
protected Integer queryTimeout
protected String urlDelimiter
urlDelimiter
holds the url delimiter
information to be used for HA DS configuration .protected String urlSelectorStrategyClassName
public BaseWrapperManagedConnectionFactory()
public javax.resource.spi.ResourceAdapter getResourceAdapter()
getResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
public void setResourceAdapter(javax.resource.spi.ResourceAdapter ra)
setResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
public PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public void setLogWriter(PrintWriter v) throws javax.resource.ResourceException
setLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public Object createConnectionFactory(javax.resource.spi.ConnectionManager cm) throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public Object createConnectionFactory() throws javax.resource.ResourceException
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public String getUserName()
public void setUserName(String userName)
userName
- The valuepublic String getPassword()
public void setPassword(String password)
password
- The valuepublic Integer getPreparedStatementCacheSize()
public void setPreparedStatementCacheSize(Integer size)
size
- The valuepublic Boolean getSharePreparedStatements()
public void setSharePreparedStatements(Boolean sharePS)
sharePS
- The valuepublic String getTransactionIsolation()
public void setTransactionIsolation(String transactionIsolation)
transactionIsolation
- The valuepublic String getNewConnectionSQL()
public void setNewConnectionSQL(String newConnectionSQL)
newConnectionSQL
- The valuepublic String getCheckValidConnectionSQL()
public void setCheckValidConnectionSQL(String checkValidConnectionSQL)
checkValidConnectionSQL
- The valuepublic String getStaleConnectionCheckerClassName()
public void setStaleConnectionCheckerClassName(String staleConnectionCheckerClassName)
staleConnectionCheckerClassName
- The staleConnectionCheckerClassNamepublic ClassLoader getStaleConnectionClassLoader()
public void setStaleConnectionCheckerClassLoader(ClassLoader staleConnectionCheckerClassLoader)
staleConnectionCheckerClassLoader
- The staleConnectionCheckerModuleNamepublic String getTrackStatements()
public void setTrackStatements(String value)
value
- The valuepublic String getExceptionSorterClassName()
public void setExceptionSorterClassName(String exceptionSorterClassName)
exceptionSorterClassName
- The valuepublic ClassLoader getExceptionSorterClassLoader()
public void setExceptionSorterClassLoader(ClassLoader exceptionSorterClassLoader)
exceptionSorterClassLoader
- The valuepublic String getValidConnectionCheckerClassName()
public void setValidConnectionCheckerClassName(String validConnectionCheckerClassName)
validConnectionCheckerClassName
- The valuepublic ClassLoader getValidConnectionCheckerClassLoader()
public void setValidConnectionCheckerClassLoader(ClassLoader validConnectionCheckerClassLoader)
validConnectionCheckerClassLoader
- The valuepublic Boolean isTransactionQueryTimeout()
public void setTransactionQueryTimeout(Boolean value)
value
- The valuepublic Integer getQueryTimeout()
public void setQueryTimeout(Integer timeout)
timeout
- The valuepublic Integer getUseTryLock()
public void setUseTryLock(Integer useTryLock)
useTryLock
- The valuepublic boolean isDoLocking()
true
if locking, otherwise false
public void setSpy(Boolean v)
v
- The valuepublic Boolean getSpy()
public void setJndiName(String v)
v
- The valuepublic String getJndiName()
public Boolean getReauthEnabled()
public void setReauthEnabled(Boolean v)
v
- The valuepublic String getReauthPluginClassName()
public void setReauthPluginClassName(String v)
v
- The valuepublic String getReauthPluginProperties()
public void setReauthPluginProperties(String v)
v
- The valuepublic String getConnectionListenerClassName()
public void setConnectionListenerClassName(String v)
v
- The valuepublic String getConnectionListenerProperties()
public void setConnectionListenerProperties(String v)
v
- The valuepublic String getURLDelimiter()
public void setURLDelimiter(String urlDelimiter)
urlDelimiter
- The valuepublic String getUrlSelectorStrategyClassName()
public void setUrlSelectorStrategyClassName(String urlSelectorStrategyClassName)
urlSelectorStrategyClassName
- The valuepublic JdbcStatisticsPlugin getStatistics()
getStatistics
in interface Statistics
public Boolean isJTA()
public void setJTA(Boolean v)
v
- The valuepublic Set<BaseWrapperManagedConnection> getInvalidConnections(Set connectionSet) throws javax.resource.ResourceException
getInvalidConnections
in interface javax.resource.spi.ValidatingManagedConnectionFactory
connectionSet
- The connection setjavax.resource.ResourceException
- Thrown if an error occursprotected Properties getConnectionProperties(Properties connectionProps, 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 boolean isExceptionFatal(SQLException e)
e
- The exceptionpublic void setPoolValidationLoggingEnabled(boolean poolValidationLoggingEnabled)
public final Properties getValidConnectionCheckerProps()
public final Properties getStaleConnectionCheckerProps()
public final Properties getExceptionSorterProps()
public final String getValidConnectionCheckerProperties()
public final void setValidConnectionCheckerProperties(String validConnectionCheckerProperties)
validConnectionCheckerProperties
- The validConnectionCheckerProperties to set.public final String getStaleConnectionCheckerProperties()
public final void setStaleConnectionCheckerProperties(String staleConnectionCheckerProperties)
staleConnectionCheckerProperties
- The staleConnectionCheckerProperties to set.public final String getExceptionSorterProperties()
public final void setExceptionSorterProperties(String exceptionSorterProperties)
exceptionSorterProperties
- The exceptionSorterProperties to set.public final ClassLoaderPlugin getClassLoaderPlugin()
public final void setClassLoaderPlugin(ClassLoaderPlugin clPlugin)
clPlugin
- The clPlugin to set.public final void setOriginalTCCLn(ClassLoader cl)
cl
- The clPlugin to set.Copyright © 2021 JBoss by Red Hat. All rights reserved.