fr.paris.lutece.util.pool.service
Class C3p0ConnectionService

java.lang.Object
  extended by fr.paris.lutece.util.pool.service.C3p0ConnectionService
All Implemented Interfaces:
ConnectionService

public class C3p0ConnectionService
extends Object
implements ConnectionService

C3P0 connection service


Field Summary
 
Fields inherited from interface fr.paris.lutece.util.pool.service.ConnectionService
INFO_NOT_AVAILABLE
 
Constructor Summary
C3p0ConnectionService()
           
 
Method Summary
 void freeConnection(Connection conn)
          Release the connection
 Connection getConnection()
          Get a connection
 int getCurrentConnections()
          Gets the number of opened connections
 DataSource getDataSource()
          Get datasource
 org.apache.log4j.Logger getLogger()
          Gets the logger
 int getMaxConnections()
          Gets the max connections
 String getPoolName()
          Gets the pool name
 String getPoolProvider()
          Gets the pool manager provider
 void init(Hashtable<String,String> htParamsConnectionPool)
          Initialize pool parameters
 void release()
          Free all connections
 void setLogger(org.apache.log4j.Logger log)
          Define the logger
 void setPoolName(String poolName)
          Define the pool name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C3p0ConnectionService

public C3p0ConnectionService()
Method Detail

init

public void init(Hashtable<String,String> htParamsConnectionPool)
Initialize pool parameters

Specified by:
init in interface ConnectionService
Parameters:
htParamsConnectionPool - Parameters

getConnection

public Connection getConnection()
Get a connection

Specified by:
getConnection in interface ConnectionService
Returns:
A database connection

freeConnection

public void freeConnection(Connection conn)
Release the connection

Specified by:
freeConnection in interface ConnectionService
Parameters:
conn - The connection to release

setPoolName

public void setPoolName(String poolName)
Define the pool name

Specified by:
setPoolName in interface ConnectionService
Parameters:
poolName - The pool name

getPoolName

public String getPoolName()
Gets the pool name

Specified by:
getPoolName in interface ConnectionService
Returns:
The pool name

setLogger

public void setLogger(org.apache.log4j.Logger log)
Define the logger

Specified by:
setLogger in interface ConnectionService
Parameters:
log - The logger

getLogger

public org.apache.log4j.Logger getLogger()
Gets the logger

Specified by:
getLogger in interface ConnectionService
Returns:
The logger

release

public void release()
Free all connections

Specified by:
release in interface ConnectionService

getCurrentConnections

public int getCurrentConnections()
Gets the number of opened connections

Specified by:
getCurrentConnections in interface ConnectionService
Returns:
The current connections count

getMaxConnections

public int getMaxConnections()
Gets the max connections

Specified by:
getMaxConnections in interface ConnectionService
Returns:
The max connections count

getPoolProvider

public String getPoolProvider()
Gets the pool manager provider

Specified by:
getPoolProvider in interface ConnectionService
Returns:
The pool manager

getDataSource

public DataSource getDataSource()
Get datasource

Specified by:
getDataSource in interface ConnectionService
Returns:
A data source object


Copyright © 2014 Mairie de Paris. All Rights Reserved.