Skip to content

Instantly share code, notes, and snippets.

@dilnei
Created August 5, 2014 05:51
Show Gist options
  • Save dilnei/208c9ead95d578a92b44 to your computer and use it in GitHub Desktop.
Save dilnei/208c9ead95d578a92b44 to your computer and use it in GitHub Desktop.
Interceptor para a transação
package br.com.weblog.interceptor;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.interceptor.InterceptorBinding;
/**
*
* @author Dilnei
*
* Tratamos a transação sempre antes de executar uma lógica e depois da
* renderização da View, a idéia é a mesma do filtro no entanto ganhamos a
* integração da Injeção de Dependências do CDI, esta annotation indica quem
* sera interceptado.
*/
@InterceptorBinding
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Transactional {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment