Class TomcatConnectionService
java.lang.Object
fr.paris.lutece.util.pool.service.TomcatConnectionService
- All Implemented Interfaces:
ConnectionService
This class provides a ConnectionService based on Tomcat
-
Field Summary
Fields inherited from interface fr.paris.lutece.util.pool.service.ConnectionService
INFO_NOT_AVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeConnection(Connection conn) Release the connectionGet a connectionintGets the number of opened connectionsGet datasourceorg.apache.logging.log4j.LoggerGets the loggerintGets the max connectionsGets the pool nameGets the pool manager providervoidInitialize pool parametersvoidrelease()Free all connectionsvoidsetLogger(org.apache.logging.log4j.Logger logger) Sets the loggervoidsetPoolName(String strPoolName) Define the pool name
-
Constructor Details
-
TomcatConnectionService
public TomcatConnectionService()
-
-
Method Details
-
getConnection
Get a connection- Specified by:
getConnectionin interfaceConnectionService- Returns:
- A database connection
-
freeConnection
Release the connection- Specified by:
freeConnectionin interfaceConnectionService- Parameters:
conn- The connection to release
-
init
Initialize pool parameters- Specified by:
initin interfaceConnectionService- Parameters:
htParamsConnectionPool- Parameters
-
setPoolName
Define the pool name- Specified by:
setPoolNamein interfaceConnectionService- Parameters:
strPoolName- The pool name
-
getPoolName
Gets the pool name- Specified by:
getPoolNamein interfaceConnectionService- Returns:
- The pool name
-
setLogger
public void setLogger(org.apache.logging.log4j.Logger logger) Sets the logger- Specified by:
setLoggerin interfaceConnectionService- Parameters:
logger- The logger
-
getLogger
public org.apache.logging.log4j.Logger getLogger()Gets the logger- Specified by:
getLoggerin interfaceConnectionService- Returns:
- The logger
-
release
public void release()Free all connections- Specified by:
releasein interfaceConnectionService
-
getCurrentConnections
public int getCurrentConnections()Gets the number of opened connections- Specified by:
getCurrentConnectionsin interfaceConnectionService- Returns:
- The current connections count
-
getMaxConnections
public int getMaxConnections()Gets the max connections- Specified by:
getMaxConnectionsin interfaceConnectionService- Returns:
- The max connections count
-
getPoolProvider
Gets the pool manager provider- Specified by:
getPoolProviderin interfaceConnectionService- Returns:
- The pool manager
-
getDataSource
Get datasource- Specified by:
getDataSourcein interfaceConnectionService- Returns:
- A data source object
-