Class TomcatConnectionService
- java.lang.Object
-
- fr.paris.lutece.util.pool.service.TomcatConnectionService
-
- All Implemented Interfaces:
ConnectionService
public class TomcatConnectionService extends Object implements 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 Constructor Description TomcatConnectionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfreeConnection(Connection conn)Release the connectionConnectiongetConnection()Get a connectionintgetCurrentConnections()Gets the number of opened connectionsDataSourcegetDataSource()Get datasourceorg.apache.logging.log4j.LoggergetLogger()Gets the loggerintgetMaxConnections()Gets the max connectionsStringgetPoolName()Gets the pool nameStringgetPoolProvider()Gets the pool manager providervoidinit(Map<String,String> htParamsConnectionPool)Initialize pool parametersvoidrelease()Free all connectionsvoidsetLogger(org.apache.logging.log4j.Logger logger)Sets the loggervoidsetPoolName(String strPoolName)Define the pool name
-
-
-
Method Detail
-
getConnection
public Connection getConnection()
Get a connection- Specified by:
getConnectionin interfaceConnectionService- Returns:
- A database connection
-
freeConnection
public void freeConnection(Connection conn)
Release the connection- Specified by:
freeConnectionin interfaceConnectionService- Parameters:
conn- The connection to release
-
init
public void init(Map<String,String> htParamsConnectionPool)
Initialize pool parameters- Specified by:
initin interfaceConnectionService- Parameters:
htParamsConnectionPool- Parameters
-
setPoolName
public void setPoolName(String strPoolName)
Define the pool name- Specified by:
setPoolNamein interfaceConnectionService- Parameters:
strPoolName- The pool name
-
getPoolName
public String 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
public String getPoolProvider()
Gets the pool manager provider- Specified by:
getPoolProviderin interfaceConnectionService- Returns:
- The pool manager
-
getDataSource
public DataSource getDataSource()
Get datasource- Specified by:
getDataSourcein interfaceConnectionService- Returns:
- A data source object
-
-