org.riotfamily.common.web.transaction
Class TransactionalHandlerInterceptor

java.lang.Object
  extended by org.riotfamily.common.web.transaction.TransactionalHandlerInterceptor
All Implemented Interfaces:
HandlerInterceptor

public class TransactionalHandlerInterceptor
extends Object
implements HandlerInterceptor

HandlerInterceptor that executes the handler within a transactional context.

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
TransactionalHandlerInterceptor(PlatformTransactionManager tm)
           
 
Method Summary
 void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
           
 void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
           
 boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
           
 void setTransactionAttribute(TransactionAttribute transactionAttribute)
          Sets the TransactionAttribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalHandlerInterceptor

public TransactionalHandlerInterceptor(PlatformTransactionManager tm)
Method Detail

setTransactionAttribute

public void setTransactionAttribute(TransactionAttribute transactionAttribute)
Sets the TransactionAttribute. If not set, a DefaultTransactionAttribute with TransactionDefinition.PROPAGATION_REQUIRED is used.


preHandle

public boolean preHandle(HttpServletRequest request,
                         HttpServletResponse response,
                         Object handler)
                  throws Exception
Specified by:
preHandle in interface HandlerInterceptor
Throws:
Exception

postHandle

public void postHandle(HttpServletRequest request,
                       HttpServletResponse response,
                       Object handler,
                       ModelAndView modelAndView)
                throws Exception
Specified by:
postHandle in interface HandlerInterceptor
Throws:
Exception

afterCompletion

public void afterCompletion(HttpServletRequest request,
                            HttpServletResponse response,
                            Object handler,
                            Exception ex)
                     throws Exception
Specified by:
afterCompletion in interface HandlerInterceptor
Throws:
Exception