|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.velocityweb.context.AppContext
application context, use this to replace need of ThreadLocal. contains resources used for each web request, or each single background timer task. Resources in it including: JDBC connection(will passed to DAO), resource bundle(will passed to web process layer), transaction layer(support design pattern named as TRANSACTION_PER_REQUEST).
Constructor Summary | |
AppContext(java.lang.Object dataSource,
int transactionIsolation,
java.util.ResourceBundle resourceBundle,
Controller controller)
contructor |
Method Summary | |
protected void |
closeConnection()
class JDBC connection |
void |
commitAndClose()
commit and close JDBC connection, normally after a success operation. |
long |
getBeginTime()
get start time of web request/background task |
java.sql.Connection |
getConnection()
get JDBC Connection, each AppContext object contains one Connection |
Controller |
getController()
get controller |
java.util.ResourceBundle |
getResourceBundle()
get resource bundle |
int |
getTransactionIsolation()
get transaction isolation level |
void |
rollbackAndClose()
roll back and close JDBC connection, normally after a failure operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AppContext(java.lang.Object dataSource, int transactionIsolation, java.util.ResourceBundle resourceBundle, Controller controller)
dataSource
- data source, use ConnectionPoolDataSource will be bettertransactionIsolation
- transaction isolation levelresourceBundle
- resource bundleMethod Detail |
public java.sql.Connection getConnection()
public long getBeginTime()
protected void closeConnection()
java.sql.SQLException
public void commitAndClose() throws java.sql.SQLException
java.sql.SQLException
public void rollbackAndClose()
java.sql.SQLException
java.sql.SQLException
public java.util.ResourceBundle getResourceBundle()
public int getTransactionIsolation()
public Controller getController()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |