@Deprecated public abstract class OpenTopiaTransactionInterceptor extends com.opensymphony.xwork2.interceptor.AbstractInterceptor
The aim of this Interceptor is to manage a transaction all along
a action which implements TopiaTransactionAware contract.
Technicaly, the action will receive only a proxy of a transaction and a real transaction will only be created as soon as a method will be asked on it.
The interceptor is abstract and let user to implement the way how to open a
new transaction via the method beginTransaction().
Note that the transaction pushed in the action can be limited using a list
of methods to exclude on it. The list of methods to forbid can be customized
using the interceptor parameter excludeMethods.
Note also that the transaction is not commited nor closed.
If you want the transaction to be closed, you may use
CloseTopiaTransactionFilter by adding
it to your web.xml file.
This interceptor, as it provides connection to database should be in the
interceptor stack before any other interceptor requiring access to database.
For example, it is a common behaviour to do such calls in a prepare method,
so make sure to place this interceptor before the prepare interceptor.
Interceptor parameters:
DEFAULT_EXCLUDE_METHODS.
| Modifier and Type | Class and Description |
|---|---|
class |
OpenTopiaTransactionInterceptor.TopiaTransactionProxyInvocationHandler
Deprecated.
Handler of a proxy on a
TopiaPersistenceContext. |
| Modifier and Type | Field and Description |
|---|---|
static String[] |
DEFAULT_EXCLUDE_METHODS
Deprecated.
|
protected Set<String> |
excludeMethods
Deprecated.
names of methods to forbid access while using proxy.
|
static String |
TOPIA_TRANSACTION_REQUEST_ATTRIBUTE
Deprecated.
|
| Constructor and Description |
|---|
OpenTopiaTransactionInterceptor()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.nuiton.topia.persistence.TopiaPersistenceContext |
beginTransaction()
Deprecated.
Method to open a new transaction.
|
Set<String> |
getExcludeMethods()
Deprecated.
|
void |
init()
Deprecated.
|
String |
intercept(com.opensymphony.xwork2.ActionInvocation invocation)
Deprecated.
|
void |
setExcludeMethods(String excludeMethods)
Deprecated.
|
public static final String TOPIA_TRANSACTION_REQUEST_ATTRIBUTE
public static final String[] DEFAULT_EXCLUDE_METHODS
public OpenTopiaTransactionInterceptor()
public void setExcludeMethods(String excludeMethods)
protected abstract org.nuiton.topia.persistence.TopiaPersistenceContext beginTransaction()
throws org.nuiton.topia.persistence.TopiaException
org.nuiton.topia.persistence.TopiaException - if any problem while opening a new transactionpublic void init()
init in interface com.opensymphony.xwork2.interceptor.Interceptorinit in class com.opensymphony.xwork2.interceptor.AbstractInterceptorpublic String intercept(com.opensymphony.xwork2.ActionInvocation invocation) throws Exception
intercept in interface com.opensymphony.xwork2.interceptor.Interceptorintercept in class com.opensymphony.xwork2.interceptor.AbstractInterceptorExceptionCopyright © 2010–2017 CodeLutin. All rights reserved.