diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Priority.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Priority.java
new file mode 100644
index 0000000..02ca7fb
--- /dev/null
+++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Priority.java
@@ -0,0 +1,74 @@
+/*
+ * Demoiselle Framework
+ * Copyright (C) 2010 SERPRO
+ * ----------------------------------------------------------------------------
+ * This file is part of Demoiselle Framework.
+ *
+ * Demoiselle Framework is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License version 3
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License version 3
+ * along with this program; if not, see
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301, USA.
+ * ----------------------------------------------------------------------------
+ * Este arquivo é parte do Framework Demoiselle.
+ *
+ * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
+ * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
+ * do Software Livre (FSF).
+ *
+ * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
+ * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
+ * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
+ * para maiores detalhes.
+ *
+ * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
+ * "LICENCA.txt", junto com esse programa. Se não, acesse
+ * ou escreva para a Fundação do Software Livre (FSF) Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+package br.gov.frameworkdemoiselle.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Inherited
+@Retention(RUNTIME)
+@Target({ TYPE, FIELD, METHOD, PARAMETER })
+public @interface Priority {
+
+ /**
+ * Most important priority value.
+ */
+ public static int MAX_PRIORITY = Integer.MIN_VALUE;
+
+ /**
+ * Less important priority value.
+ */
+ public static int MIN_PRIORITY = Integer.MAX_VALUE;
+
+ /**
+ * Less important priority value.
+ */
+ public static int MID_PRIORITY = (MIN_PRIORITY - MAX_PRIORITY) / 2;
+
+ /**
+ * An integer value defines method execution order (i.e., priority).
+ */
+ int value() default MIN_PRIORITY;
+
+}
diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AbstractTransactionBootstrap.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AbstractTransactionBootstrap.java
new file mode 100644
index 0000000..03b58cb
--- /dev/null
+++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AbstractTransactionBootstrap.java
@@ -0,0 +1,76 @@
+/*
+ * Demoiselle Framework
+ * Copyright (C) 2010 SERPRO
+ * ----------------------------------------------------------------------------
+ * This file is part of Demoiselle Framework.
+ *
+ * Demoiselle Framework is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License version 3
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License version 3
+ * along with this program; if not, see
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301, USA.
+ * ----------------------------------------------------------------------------
+ * Este arquivo é parte do Framework Demoiselle.
+ *
+ * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
+ * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
+ * do Software Livre (FSF).
+ *
+ * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
+ * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
+ * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
+ * para maiores detalhes.
+ *
+ * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
+ * "LICENCA.txt", junto com esse programa. Se não, acesse
+ * ou escreva para a Fundação do Software Livre (FSF) Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+package br.gov.frameworkdemoiselle.internal.bootstrap;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+import br.gov.frameworkdemoiselle.annotation.Priority;
+import br.gov.frameworkdemoiselle.transaction.Transaction;
+import br.gov.frameworkdemoiselle.util.Reflections;
+
+public abstract class AbstractTransactionBootstrap extends AbstractBootstrap {
+
+ private Class transactionClass;
+
+ protected void processAnnotatedType(@Observes final ProcessAnnotatedType event) {
+ Class> annotated = event.getAnnotatedType().getJavaClass();
+
+ if (Reflections.isOfType(annotated, Transaction.class) && annotated != getTransactionClass()
+ && getPriority(getTransactionClass()) < getPriority(annotated)) {
+ event.veto();
+ }
+ }
+
+ private int getPriority(Class> type) {
+ int priority = Priority.MAX_PRIORITY;
+
+ if (type.isAnnotationPresent(Priority.class)) {
+ Priority annotation = type.getAnnotation(Priority.class);
+ priority = annotation.value();
+ }
+
+ return priority;
+ }
+
+ protected Class getTransactionClass() {
+ if (this.transactionClass == null) {
+ this.transactionClass = Reflections.getGenericTypeArgument(this.getClass(), 0);
+ }
+ return this.transactionClass;
+ }
+}
--
libgit2 0.21.2