br.com.caelum.vraptor.util.jpa
Class JPATransactionInterceptor

java.lang.Object
  extended by br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor
All Implemented Interfaces:
br.com.caelum.vraptor.interceptor.Interceptor

@Component
@Intercepts
public class JPATransactionInterceptor
extends Object
implements br.com.caelum.vraptor.interceptor.Interceptor

An interceptor that manages Entity Manager Transaction. All requests are intercepted and a transaction is created before execution. If the request has no erros, the transaction will commited, or a rollback occurs otherwise.

Author:
Lucas Cavalcanti

Constructor Summary
JPATransactionInterceptor(javax.persistence.EntityManager manager, br.com.caelum.vraptor.Validator validator)
           
 
Method Summary
 boolean accepts(br.com.caelum.vraptor.resource.ResourceMethod method)
           
 void intercept(br.com.caelum.vraptor.core.InterceptorStack stack, br.com.caelum.vraptor.resource.ResourceMethod method, Object instance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPATransactionInterceptor

public JPATransactionInterceptor(javax.persistence.EntityManager manager,
                                 br.com.caelum.vraptor.Validator validator)
Method Detail

intercept

public void intercept(br.com.caelum.vraptor.core.InterceptorStack stack,
                      br.com.caelum.vraptor.resource.ResourceMethod method,
                      Object instance)
Specified by:
intercept in interface br.com.caelum.vraptor.interceptor.Interceptor

accepts

public boolean accepts(br.com.caelum.vraptor.resource.ResourceMethod method)
Specified by:
accepts in interface br.com.caelum.vraptor.interceptor.Interceptor


Copyright © 2013 Caelum. All Rights Reserved.