org.infinispan.loaders.jdbc.connectionfactory
Class PooledConnectionFactory

java.lang.Object
  extended by org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory
      extended by org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory

public class PooledConnectionFactory
extends ConnectionFactory

Pooled connection factory based on C3P0. For a complete configuration reference, look here. The connection pool can be configured in various ways, as described here. The simplest way is by having an c3p0.properties file in the classpath. If no such file is found, default, hardcoded values will be used.

Author:
Mircea.Markus@jboss.com

Constructor Summary
PooledConnectionFactory()
           
 
Method Summary
 Connection getConnection()
          Fetches a connection from the factory.
 com.mchange.v2.c3p0.ComboPooledDataSource getPooledDataSource()
           
 void releaseConnection(Connection conn)
          Destroys a connection.
 void start(ConnectionFactoryConfig config)
          Starts the connection factory.
 void stop()
          Closes the connection factory, including all allocated connections etc.
 
Methods inherited from class org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory
getConnectionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PooledConnectionFactory

public PooledConnectionFactory()
Method Detail

start

public void start(ConnectionFactoryConfig config)
           throws CacheLoaderException
Description copied from class: ConnectionFactory
Starts the connection factory. A pooled factory might be create connections here.

Specified by:
start in class ConnectionFactory
Throws:
CacheLoaderException

stop

public void stop()
Description copied from class: ConnectionFactory
Closes the connection factory, including all allocated connections etc.

Specified by:
stop in class ConnectionFactory

getConnection

public Connection getConnection()
                         throws CacheLoaderException
Description copied from class: ConnectionFactory
Fetches a connection from the factory.

Specified by:
getConnection in class ConnectionFactory
Throws:
CacheLoaderException

releaseConnection

public void releaseConnection(Connection conn)
Description copied from class: ConnectionFactory
Destroys a connection. Important: null might be passed in, as an valid argument.

Specified by:
releaseConnection in class ConnectionFactory

getPooledDataSource

public com.mchange.v2.c3p0.ComboPooledDataSource getPooledDataSource()

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.