org.infinispan.loaders.jdbc.connectionfactory
Class ManagedConnectionFactory

java.lang.Object
  extended by org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory
      extended by org.infinispan.loaders.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
ManagedConnectionFactory()
           
 
Method Summary
 Connection getConnection()
          Fetches a connection from the factory.
 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

ManagedConnectionFactory

public ManagedConnectionFactory()
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

Google Analytics

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