|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.xwork.interceptors.XWorkTransactionInterceptor
public abstract class XWorkTransactionInterceptor
Manages two separate database transactions around the action execution and result execution in XWork, using the Spring PlatformTransactionManager.
The first transaction begins as soon as this interceptor executes. It is committed in aPreResultListener which runs just before the result executes. The second transaction is opened
in the same listener. The second transaction is committed when control returns to the interceptor
after the action and result executions are both complete.
The active transaction will be rolled back if an exception is caught by this interceptor during
the execution of either the action or the result.
Implementations should override getTransactionManager() to provide the Spring transaction
manager, and shouldIntercept(ActionInvocation) to configure when transactions should be
applied to actions.
| Constructor Summary | |
|---|---|
XWorkTransactionInterceptor()
|
|
| Method Summary | |
|---|---|
static org.springframework.transaction.TransactionStatus |
currentTransactionStatus()
Deprecated. since atlassian-xwork 1.1 - you should really use Spring directly for this sort of thing |
void |
destroy()
|
abstract org.springframework.transaction.PlatformTransactionManager |
getTransactionManager()
Template method for retrieving the transaction manager for the current application. |
void |
init()
|
java.lang.String |
intercept(com.opensymphony.xwork.ActionInvocation invocation)
|
protected abstract boolean |
shouldIntercept(com.opensymphony.xwork.ActionInvocation invocation)
Determine if a certain action should be wrapped in a transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XWorkTransactionInterceptor()
| Method Detail |
|---|
public abstract org.springframework.transaction.PlatformTransactionManager getTransactionManager()
protected abstract boolean shouldIntercept(com.opensymphony.xwork.ActionInvocation invocation)
invocation - the action being invoked
public void destroy()
destroy in interface com.opensymphony.xwork.interceptor.Interceptorpublic void init()
init in interface com.opensymphony.xwork.interceptor.Interceptor
public java.lang.String intercept(com.opensymphony.xwork.ActionInvocation invocation)
throws java.lang.Exception
intercept in interface com.opensymphony.xwork.interceptor.Interceptorjava.lang.Exception
public static org.springframework.transaction.TransactionStatus currentTransactionStatus()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the invocation cannot be found, because the method was invoked
outside an AOP invocation context
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||