com.github.drinkjava2.jtransactions.jfinal
Class JFinalTxConnectionManager

java.lang.Object
  extended by com.github.drinkjava2.jtransactions.jfinal.JFinalTxConnectionManager
All Implemented Interfaces:
ConnectionManager

public class JFinalTxConnectionManager
extends Object
implements ConnectionManager

JFinalConnectionManager is the implementation of ConnectionManager, get connection and release connection from jFinal environment

Since:
1.0.0
Author:
Yong Zhu

Field Summary
protected  Method getConfigMethod
           
protected  Method getConnectionMethod
           
protected  Method isInTransactionMethod
           
protected  Method releaseConnectionMethod
           
 
Constructor Summary
JFinalTxConnectionManager()
           
 
Method Summary
 Connection getConnection(DataSource dataSource)
          A ConnectionManager implementation determine how to get connection from DataSource or ThreadLocal or from Spring or JTA or some container...
static JFinalTxConnectionManager instance()
           
 boolean isInTransaction(DataSource ds)
          Check if a connection already be get from given dataSource and be cached as it started a Transaction
 void releaseConnection(Connection conn, DataSource dataSource)
          A ConnectionManager implementation determine how to close connection or return connection to ThreadLocal or return to Spring or JTA or some container...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getConfigMethod

protected final Method getConfigMethod

getConnectionMethod

protected final Method getConnectionMethod

releaseConnectionMethod

protected final Method releaseConnectionMethod

isInTransactionMethod

protected final Method isInTransactionMethod
Constructor Detail

JFinalTxConnectionManager

public JFinalTxConnectionManager()
Method Detail

instance

public static final JFinalTxConnectionManager instance()
Returns:
A singleton

getConnection

public Connection getConnection(DataSource dataSource)
Description copied from interface: ConnectionManager
A ConnectionManager implementation determine how to get connection from DataSource or ThreadLocal or from Spring or JTA or some container...

Specified by:
getConnection in interface ConnectionManager

releaseConnection

public void releaseConnection(Connection conn,
                              DataSource dataSource)
Description copied from interface: ConnectionManager
A ConnectionManager implementation determine how to close connection or return connection to ThreadLocal or return to Spring or JTA or some container...

Specified by:
releaseConnection in interface ConnectionManager

isInTransaction

public boolean isInTransaction(DataSource ds)
Description copied from interface: ConnectionManager
Check if a connection already be get from given dataSource and be cached as it started a Transaction

Specified by:
isInTransaction in interface ConnectionManager


Copyright © 2018. All rights reserved.