Class LuteceConnectionService
- java.lang.Object
-
- fr.paris.lutece.util.pool.service.LuteceConnectionService
-
- All Implemented Interfaces:
ConnectionService
public class LuteceConnectionService extends Object implements ConnectionService
Lutece Connection Service
-
-
Field Summary
-
Fields inherited from interface fr.paris.lutece.util.pool.service.ConnectionService
INFO_NOT_AVAILABLE
-
-
Constructor Summary
Constructors Constructor Description LuteceConnectionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfreeConnection(Connection conn)Free the connectionConnectiongetConnection()Get a connectionConnectionPoolgetConnectionPool()Returns the connection poolintgetCurrentConnections()Gets the number of opened connectionsDataSourcegetDataSource()Get datasourceorg.apache.logging.log4j.LoggergetLogger()Gets the pool loggerintgetMaxConnections()Gets the max connectionsStringgetPoolName()Returns the pool nameStringgetPoolProvider()Gets the pool manager providervoidinit(Map<String,String> htParamsConnectionPool)Initializes the connection poolvoidrelease()Release the poolvoidsetLogger(org.apache.logging.log4j.Logger logger)Sets the loggervoidsetPoolName(String strPoolName)Sets the pool name
-
-
-
Method Detail
-
setPoolName
public void setPoolName(String strPoolName)
Sets the pool name- Specified by:
setPoolNamein interfaceConnectionService- Parameters:
strPoolName- The pool name
-
getPoolName
public String getPoolName()
Returns 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 pool logger- Specified by:
getLoggerin interfaceConnectionService- Returns:
- The logger
-
init
public void init(Map<String,String> htParamsConnectionPool)
Initializes the connection pool- Specified by:
initin interfaceConnectionService- Parameters:
htParamsConnectionPool- Pool parameters
-
getConnection
public Connection getConnection()
Get a connection- Specified by:
getConnectionin interfaceConnectionService- Returns:
- A connection
-
freeConnection
public void freeConnection(Connection conn)
Free the connection- Specified by:
freeConnectionin interfaceConnectionService- Parameters:
conn- The connection to release
-
release
public void release()
Release the pool- Specified by:
releasein interfaceConnectionService
-
getConnectionPool
public ConnectionPool getConnectionPool()
Returns the connection pool- Returns:
- the connection pool
-
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
-
-