Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.dao.engine.impl
Class StandardDaoManager  view StandardDaoManager download StandardDaoManager.java

java.lang.Object
  extended bycom.ibatis.dao.engine.impl.StandardDaoManager
All Implemented Interfaces:
com.ibatis.dao.client.DaoManager

public class StandardDaoManager
extends java.lang.Object
implements com.ibatis.dao.client.DaoManager


Field Summary
private  java.lang.ThreadLocal contextInTransactionList
           
private static java.lang.String DAO_EXPLICIT_TX
           
private  java.util.Map daoImplMap
           
private  java.util.Map idContextMap
           
private  java.lang.ThreadLocal transactionMode
           
private  java.util.Map typeContextMap
           
 
Constructor Summary
StandardDaoManager()
           
 
Method Summary
 void addContext(DaoContext context)
           
 void addContextInTransaction(DaoContext ctx)
           
 void commitTransaction()
          Commits all transactions currently started for all DAO contexts managed by this DaoManager.
 void endTransaction()
          Ends all transactions currently started for all DAO contexts managed by this DaoManager.
private  java.util.List getContextInTransactionList()
           
 com.ibatis.dao.client.Dao getDao(java.lang.Class iface)
          Gets a Dao instance for the requested interface type.
 com.ibatis.dao.client.Dao getDao(java.lang.Class iface, java.lang.String contextId)
          Gets a Dao instance for the requested interface type registered under the context with the specified id.
 com.ibatis.dao.client.DaoTransaction getTransaction(com.ibatis.dao.client.Dao dao)
          Gets the transaction that the provided Dao is currently working under.
 boolean isExplicitTransaction()
           
 void startTransaction()
          Starts a transaction scope managed by this DaoManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAO_EXPLICIT_TX

private static final java.lang.String DAO_EXPLICIT_TX
See Also:
Constant Field Values

transactionMode

private java.lang.ThreadLocal transactionMode

contextInTransactionList

private java.lang.ThreadLocal contextInTransactionList

idContextMap

private java.util.Map idContextMap

typeContextMap

private java.util.Map typeContextMap

daoImplMap

private java.util.Map daoImplMap
Constructor Detail

StandardDaoManager

public StandardDaoManager()
Method Detail

addContext

public void addContext(DaoContext context)

getDao

public com.ibatis.dao.client.Dao getDao(java.lang.Class iface)
Description copied from interface: com.ibatis.dao.client.DaoManager
Gets a Dao instance for the requested interface type.

Specified by:
getDao in interface com.ibatis.dao.client.DaoManager

getDao

public com.ibatis.dao.client.Dao getDao(java.lang.Class iface,
                                        java.lang.String contextId)
Description copied from interface: com.ibatis.dao.client.DaoManager
Gets a Dao instance for the requested interface type registered under the context with the specified id.

Specified by:
getDao in interface com.ibatis.dao.client.DaoManager

startTransaction

public void startTransaction()
Description copied from interface: com.ibatis.dao.client.DaoManager
Starts a transaction scope managed by this DaoManager. If this method isn't called, then all DAO methods use "autocommit" semantics.

Specified by:
startTransaction in interface com.ibatis.dao.client.DaoManager

commitTransaction

public void commitTransaction()
Description copied from interface: com.ibatis.dao.client.DaoManager
Commits all transactions currently started for all DAO contexts managed by this DaoManager.

Specified by:
commitTransaction in interface com.ibatis.dao.client.DaoManager

endTransaction

public void endTransaction()
Description copied from interface: com.ibatis.dao.client.DaoManager
Ends all transactions currently started for all DAO contexts managed by this DaoManager. If any transactions have not been successfully committed, then those remaining will be rolled back.

Specified by:
endTransaction in interface com.ibatis.dao.client.DaoManager

getTransaction

public com.ibatis.dao.client.DaoTransaction getTransaction(com.ibatis.dao.client.Dao dao)
Description copied from interface: com.ibatis.dao.client.DaoManager
Gets the transaction that the provided Dao is currently working under. If there is no current transaction in scope, one will be started.

Specified by:
getTransaction in interface com.ibatis.dao.client.DaoManager

isExplicitTransaction

public boolean isExplicitTransaction()

addContextInTransaction

public void addContextInTransaction(DaoContext ctx)

getContextInTransactionList

private java.util.List getContextInTransactionList()