Package org.jboss.jca.adapters.jdbc
Class BaseWrapperManagedConnectionFactory
java.lang.Object
org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory
- All Implemented Interfaces:
jakarta.resource.spi.ManagedConnectionFactory,jakarta.resource.spi.ResourceAdapterAssociation,jakarta.resource.spi.ValidatingManagedConnectionFactory,Serializable,Statistics
- Direct Known Subclasses:
LocalManagedConnectionFactory,XAManagedConnectionFactory
public abstract class BaseWrapperManagedConnectionFactory
extends Object
implements jakarta.resource.spi.ManagedConnectionFactory, jakarta.resource.spi.ValidatingManagedConnectionFactory, jakarta.resource.spi.ResourceAdapterAssociation, Statistics, Serializable
BaseWrapperManagedConnectionFactory
- Author:
- David Jencks, Adrian Brock, Weston Price, Jesper Pedersen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static AdaptersBundleThe bundleprotected StringThe variablecheckValidConnectionSQLholds an sql statement that may be executed whenever a managed connection is removed from the pool, to check that it is still valid.protected ValidConnectionCheckerThe instance of the valid connection checkerprotected booleanQuery timeout enabledprotected BooleanTransaction query timeoutprotected final AdaptersLoggerThe loggerprotected StringThe variablenewConnectionSQLholds an SQL statement which if not null is executed when a new Connection is obtained for a new ManagedConnection.protected StringThe passwordprotected booleanprotected IntegerThe prepared statement cache sizeprotected IntegerQuery timeoutprotected BooleanWhether to share cached prepared statementsprotected StaleConnectionCheckerThe instance of the stale connection checkerprotected final PropertiesThe properties injected in the stale connection checkerstatic final StringTrack statements - falsestatic final intTrack statements - falsestatic final StringTrack statements - no warningstatic final intTrack statements - no warningstatic final StringTrack statements - truestatic final intTrack statements - trueprotected intTrack statementprotected intThe transaction isolation levelprotected StringThe variableurlDelimiterholds the url delimiter information to be used for HA DS configuration .protected StringURL selector strategy class nameprotected StringThe user nameprotected StringThe classname used to check whether a connection is validprotected final PropertiesThe properties injected in the class used to check whether a connection is valid -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateConnectionFactory(jakarta.resource.spi.ConnectionManager cm) Get the check valid connection SQL statementfinal ClassLoaderPluginGet the clPlugin.Get connection listener class nameGet connection listener propertiesprotected PropertiesgetConnectionProperties(Properties connectionProps, Subject subject, jakarta.resource.spi.ConnectionRequestInfo cri) Gets full set of connection properties, i.e.Get the exception sorter module nameGet the exception sorter class namefinal StringGet the exceptionSorterProperties.final PropertiesGet the exceptionSorterProps.getInvalidConnections(Set connectionSet) Get the invalid connectionsGet the jndi name valueGet the new connection SQL statementGet the passwordGet the prepared statement cache sizeGet the query timeoutGet reauth enabledGet reauth plugin class nameGet reauth plugin propertiesjakarta.resource.spi.ResourceAdapterGet the prepared statement share statusgetSpy()Get the spy valueGet the stale connection checker class namefinal StringGet the staleConnectionCheckerProperties.final PropertiesGet the staleConnectionCheckerProps.Get the stale connection checker module nameGet the statistics pluginGet the track statement valueGet the transaction isolation levelGet the url delimiterGet the url selector strategy class nameGet the user nameGet the use try lock valueGet the valid connection checker class loaderGet the valid connection checker class namefinal StringGet the validConnectionCheckerProperties.final PropertiesGet the validConnectionCheckerProps.booleanAre we doing lockingbooleanIs the exception fatalisJTA()Get the JTA statusIs transaction query timeout setvoidsetCheckValidConnectionSQL(String checkValidConnectionSQL) Set the check valid connection SQL statementfinal voidsetClassLoaderPlugin(ClassLoaderPlugin clPlugin) Set the clPlugin.voidSet connection listener class namevoidSet connection listener propertiesvoidsetExceptionSorterClassLoader(ClassLoader exceptionSorterClassLoader) Set the exception sorter module namevoidsetExceptionSorterClassName(String exceptionSorterClassName) Set the exception sorter class namefinal voidsetExceptionSorterProperties(String exceptionSorterProperties) Set the exceptionSorterProperties.voidSet the jndi name valuevoidSet the JTA statusvoidvoidsetNewConnectionSQL(String newConnectionSQL) Set the new connection SQL statementfinal voidSet the originalTCCL.voidsetPassword(String password) Set the passwordvoidsetPoolValidationLoggingEnabled(boolean poolValidationLoggingEnabled) voidSet the prepared statement cache sizevoidsetQueryTimeout(Integer timeout) Set the query timeoutvoidSet reauth enabledvoidSet reauth plugin class namevoidSet reauth plugin propertiesvoidsetResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) voidsetSharePreparedStatements(Boolean sharePS) Set the prepared statement share statusvoidSet the spy valuevoidsetStaleConnectionCheckerClassLoader(ClassLoader staleConnectionCheckerClassLoader) Set the stale connection checker module namevoidsetStaleConnectionCheckerClassName(String staleConnectionCheckerClassName) Set the stale connection checker class namefinal voidsetStaleConnectionCheckerProperties(String staleConnectionCheckerProperties) Set the staleConnectionCheckerProperties.voidsetTrackStatements(String value) Set the track statement valuevoidsetTransactionIsolation(String transactionIsolation) Set the transaction isolation levelvoidSet transaction query timeoutvoidsetURLDelimiter(String urlDelimiter) Set the url delimiter.voidsetUrlSelectorStrategyClassName(String urlSelectorStrategyClassName) Set the url selector strategy class namevoidsetUserName(String userName) Set the user namevoidsetUseTryLock(Integer useTryLock) Set the use try lock valuevoidsetValidConnectionCheckerClassLoader(ClassLoader validConnectionCheckerClassLoader) Set the valid connection checker class namevoidsetValidConnectionCheckerClassName(String validConnectionCheckerClassName) Set the valid connection checker class namefinal voidsetValidConnectionCheckerProperties(String validConnectionCheckerProperties) Set the validConnectionCheckerProperties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.resource.spi.ManagedConnectionFactory
createManagedConnection, equals, hashCode, matchManagedConnections
-
Field Details
-
TRACK_STATEMENTS_FALSE_INT
public static final int TRACK_STATEMENTS_FALSE_INTTrack statements - false- See Also:
-
TRACK_STATEMENTS_TRUE_INT
public static final int TRACK_STATEMENTS_TRUE_INTTrack statements - true- See Also:
-
TRACK_STATEMENTS_NOWARN_INT
public static final int TRACK_STATEMENTS_NOWARN_INTTrack statements - no warning- See Also:
-
TRACK_STATEMENTS_FALSE
Track statements - false- See Also:
-
TRACK_STATEMENTS_TRUE
Track statements - true- See Also:
-
TRACK_STATEMENTS_NOWARN
Track statements - no warning- See Also:
-
log
The logger -
bundle
The bundle -
userName
The user name -
password
The password -
transactionIsolation
protected int transactionIsolationThe transaction isolation level -
preparedStatementCacheSize
The prepared statement cache size -
doQueryTimeout
protected boolean doQueryTimeoutQuery timeout enabled -
poolValidationLoggingEnabled
protected boolean poolValidationLoggingEnabled -
newConnectionSQL
The variablenewConnectionSQLholds an SQL statement which if not null is executed when a new Connection is obtained for a new ManagedConnection. -
checkValidConnectionSQL
The variablecheckValidConnectionSQLholds 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
The classname used to check whether a connection is valid -
validConnectionCheckerProps
The properties injected in the class used to check whether a connection is valid -
connectionChecker
The instance of the valid connection checker -
staleConnectionChecker
The instance of the stale connection checker -
staleConnectionCheckerProps
The properties injected in the stale connection checker -
trackStatements
protected int trackStatementsTrack statement -
isTransactionQueryTimeout
Transaction query timeout -
queryTimeout
Query timeout -
urlDelimiter
The variableurlDelimiterholds the url delimiter information to be used for HA DS configuration . -
urlSelectorStrategyClassName
URL selector strategy class name
-
-
Constructor Details
-
BaseWrapperManagedConnectionFactory
public BaseWrapperManagedConnectionFactory()Constructor
-
-
Method Details
-
getResourceAdapter
public jakarta.resource.spi.ResourceAdapter getResourceAdapter()- Specified by:
getResourceAdapterin interfacejakarta.resource.spi.ResourceAdapterAssociation
-
setResourceAdapter
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) - Specified by:
setResourceAdapterin interfacejakarta.resource.spi.ResourceAdapterAssociation
-
getLogWriter
- Specified by:
getLogWriterin interfacejakarta.resource.spi.ManagedConnectionFactory- Throws:
jakarta.resource.ResourceException
-
setLogWriter
- Specified by:
setLogWriterin interfacejakarta.resource.spi.ManagedConnectionFactory- Throws:
jakarta.resource.ResourceException
-
createConnectionFactory
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cm) throws jakarta.resource.ResourceException - Specified by:
createConnectionFactoryin interfacejakarta.resource.spi.ManagedConnectionFactory- Throws:
jakarta.resource.ResourceException
-
createConnectionFactory
- Specified by:
createConnectionFactoryin interfacejakarta.resource.spi.ManagedConnectionFactory- Throws:
jakarta.resource.ResourceException
-
getUserName
Get the user name- Returns:
- The value
-
setUserName
Set the user name- Parameters:
userName- The value
-
getPassword
Get the password- Returns:
- The value
-
setPassword
Set the password- Parameters:
password- The value
-
getPreparedStatementCacheSize
Get the prepared statement cache size- Returns:
- The value
-
setPreparedStatementCacheSize
Set the prepared statement cache size- Parameters:
size- The value
-
getTransactionIsolation
Get the transaction isolation level- Returns:
- The value
-
setTransactionIsolation
Set the transaction isolation level- Parameters:
transactionIsolation- The value
-
getNewConnectionSQL
Get the new connection SQL statement- Returns:
- The value
-
setNewConnectionSQL
Set the new connection SQL statement- Parameters:
newConnectionSQL- The value
-
getCheckValidConnectionSQL
Get the check valid connection SQL statement- Returns:
- The value
-
setCheckValidConnectionSQL
Set the check valid connection SQL statement- Parameters:
checkValidConnectionSQL- The value
-
getStaleConnectionCheckerClassName
Get the stale connection checker class name- Returns:
- The value
-
setStaleConnectionCheckerClassName
Set the stale connection checker class name- Parameters:
staleConnectionCheckerClassName- The staleConnectionCheckerClassName
-
getStaleConnectionClassLoader
Get the stale connection checker module name- Returns:
- The value
-
setStaleConnectionCheckerClassLoader
Set the stale connection checker module name- Parameters:
staleConnectionCheckerClassLoader- The staleConnectionCheckerModuleName
-
getTrackStatements
Get the track statement value- Returns:
- The value
-
setTrackStatements
Set the track statement value- Parameters:
value- The value
-
getExceptionSorterClassName
Get the exception sorter class name- Returns:
- The value
-
setExceptionSorterClassName
Set the exception sorter class name- Parameters:
exceptionSorterClassName- The value
-
getExceptionSorterClassLoader
Get the exception sorter module name- Returns:
- The value
-
setExceptionSorterClassLoader
Set the exception sorter module name- Parameters:
exceptionSorterClassLoader- The value
-
getValidConnectionCheckerClassName
Get the valid connection checker class name- Returns:
- The value
-
setValidConnectionCheckerClassName
Set the valid connection checker class name- Parameters:
validConnectionCheckerClassName- The value
-
getValidConnectionCheckerClassLoader
Get the valid connection checker class loader- Returns:
- The value
-
setValidConnectionCheckerClassLoader
Set the valid connection checker class name- Parameters:
validConnectionCheckerClassLoader- The value
-
isTransactionQueryTimeout
Is transaction query timeout set- Returns:
- The value
-
setTransactionQueryTimeout
Set transaction query timeout- Parameters:
value- The value
-
getQueryTimeout
Get the query timeout- Returns:
- The value
-
setQueryTimeout
Set the query timeout- Parameters:
timeout- The value
-
getUseTryLock
Get the use try lock value- Returns:
- The value
-
setUseTryLock
Set the use try lock value- Parameters:
useTryLock- The value
-
isDoLocking
public boolean isDoLocking()Are we doing locking- Returns:
trueif locking, otherwisefalse
-
setSpy
Set the spy value- Parameters:
v- The value
-
getSpy
Get the spy value- Returns:
- The value
-
setJndiName
Set the jndi name value- Parameters:
v- The value
-
getJndiName
Get the jndi name value- Returns:
- The value
-
getReauthEnabled
Get reauth enabled- Returns:
- The value
-
setReauthEnabled
Set reauth enabled- Parameters:
v- The value
-
getReauthPluginClassName
Get reauth plugin class name- Returns:
- The value
-
setReauthPluginClassName
Set reauth plugin class name- Parameters:
v- The value
-
getReauthPluginProperties
Get reauth plugin properties- Returns:
- The value
-
setReauthPluginProperties
Set reauth plugin properties- Parameters:
v- The value
-
getConnectionListenerClassName
Get connection listener class name- Returns:
- The value
-
setConnectionListenerClassName
Set connection listener class name- Parameters:
v- The value
-
getConnectionListenerProperties
Get connection listener properties- Returns:
- The value
-
setConnectionListenerProperties
Set connection listener properties- Parameters:
v- The value
-
getURLDelimiter
Get the url delimiter- Returns:
- The value
-
setURLDelimiter
Set the url delimiter.- Parameters:
urlDelimiter- The value
-
getUrlSelectorStrategyClassName
Get the url selector strategy class name- Returns:
- The value
-
setUrlSelectorStrategyClassName
Set the url selector strategy class name- Parameters:
urlSelectorStrategyClassName- The value
-
getStatistics
Get the statistics plugin- Specified by:
getStatisticsin interfaceStatistics- Returns:
- The value
-
isJTA
Get the JTA status- Returns:
- The value
-
setJTA
Set the JTA status- Parameters:
v- The value
-
getInvalidConnections
public Set<BaseWrapperManagedConnection> getInvalidConnections(Set connectionSet) throws jakarta.resource.ResourceException Get the invalid connections- Specified by:
getInvalidConnectionsin interfacejakarta.resource.spi.ValidatingManagedConnectionFactory- Parameters:
connectionSet- The connection set- Returns:
- The invalid connections
- Throws:
jakarta.resource.ResourceException- Thrown if an error occurs
-
getConnectionProperties
protected Properties getConnectionProperties(Properties connectionProps, Subject subject, jakarta.resource.spi.ConnectionRequestInfo cri) throws jakarta.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".
- Parameters:
connectionProps- The connection propertiessubject- The subjectcri- The connection request info- Returns:
- The properties
- Throws:
jakarta.resource.ResourceException- Thrown if an error occurs
-
isExceptionFatal
Is the exception fatal- Parameters:
e- The exception- Returns:
- True if fatal; otherwise false
-
setPoolValidationLoggingEnabled
public void setPoolValidationLoggingEnabled(boolean poolValidationLoggingEnabled) -
getValidConnectionCheckerProps
Get the validConnectionCheckerProps.- Returns:
- the validConnectionCheckerProps.
-
getStaleConnectionCheckerProps
Get the staleConnectionCheckerProps.- Returns:
- the staleConnectionCheckerProps.
-
getExceptionSorterProps
Get the exceptionSorterProps.- Returns:
- the exceptionSorterProps.
-
getValidConnectionCheckerProperties
Get the validConnectionCheckerProperties.- Returns:
- the validConnectionCheckerProperties.
-
setValidConnectionCheckerProperties
Set the validConnectionCheckerProperties.- Parameters:
validConnectionCheckerProperties- The validConnectionCheckerProperties to set.
-
getStaleConnectionCheckerProperties
Get the staleConnectionCheckerProperties.- Returns:
- the staleConnectionCheckerProperties.
-
setStaleConnectionCheckerProperties
Set the staleConnectionCheckerProperties.- Parameters:
staleConnectionCheckerProperties- The staleConnectionCheckerProperties to set.
-
getExceptionSorterProperties
Get the exceptionSorterProperties.- Returns:
- the exceptionSorterProperties.
-
setExceptionSorterProperties
Set the exceptionSorterProperties.- Parameters:
exceptionSorterProperties- The exceptionSorterProperties to set.
-
getClassLoaderPlugin
Get the clPlugin.- Returns:
- the clPlugin.
-
setClassLoaderPlugin
Set the clPlugin.- Parameters:
clPlugin- The clPlugin to set.
-
setOriginalTCCLn
Set the originalTCCL.- Parameters:
cl- The clPlugin to set.
-