Class ManagedConnectionFactory
- java.lang.Object
-
- org.infinispan.persistence.jdbc.connectionfactory.ConnectionFactory
-
- org.infinispan.persistence.jdbc.connectionfactory.ManagedConnectionFactory
-
public class ManagedConnectionFactory extends ConnectionFactory
Connection factory that can be used when on managed environments, like application servers. It knows how to look into the JNDI tree at a certain location (configurable) and delegate connection management to the DataSource. In order to enable it one should set the following two properties in any Jdbc cache store:- Author:
- Mircea.Markus@jboss.com
-
-
Constructor Summary
Constructors Constructor Description ManagedConnectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getConnection()
Fetches a connection from the factory.void
releaseConnection(Connection conn)
Destroys a connection.void
start(ConnectionFactoryConfiguration factoryConfiguration, ClassLoader classLoader)
Starts the connection factory.void
stop()
Closes the connection factory, including all allocated connections etc.-
Methods inherited from class org.infinispan.persistence.jdbc.connectionfactory.ConnectionFactory
getConnectionFactory, getConnectionFactory
-
-
-
-
Method Detail
-
start
public void start(ConnectionFactoryConfiguration factoryConfiguration, ClassLoader classLoader) throws org.infinispan.persistence.spi.PersistenceException
Description copied from class:ConnectionFactory
Starts the connection factory. A pooled factory might be create connections here.- Specified by:
start
in classConnectionFactory
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
stop
public void stop()
Description copied from class:ConnectionFactory
Closes the connection factory, including all allocated connections etc.- Specified by:
stop
in classConnectionFactory
-
getConnection
public Connection getConnection() throws org.infinispan.persistence.spi.PersistenceException
Description copied from class:ConnectionFactory
Fetches a connection from the factory.- Specified by:
getConnection
in classConnectionFactory
- Throws:
org.infinispan.persistence.spi.PersistenceException
-
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 classConnectionFactory
-
-