diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/DefaultTransactionBootstrap.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/DefaultTransactionBootstrap.java
deleted file mode 100644
index 7974d47..0000000
--- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/DefaultTransactionBootstrap.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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 java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
-
-import br.gov.frameworkdemoiselle.transaction.Transaction;
-import br.gov.frameworkdemoiselle.util.Reflections;
-
-//public class DefaultTransactionBootstrap extends AbstractVetoBootstrap {
-public class DefaultTransactionBootstrap implements Extension {
-
- private static void x() {
- try {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Class> clClass = cl.getClass();
-
- while (clClass != ClassLoader.class) {
- clClass = clClass.getSuperclass();
- }
-
- Field field = clClass.getDeclaredField("classes");
-
- field.setAccessible(true);
- @SuppressWarnings("unchecked")
- // Vector> classes = (Vector>) field.get(cl);
- List> classes = new ArrayList>((List>) field.get(cl));
- // List> classes = (List>) field.get(cl);
- field.setAccessible(false);
-
- // for (Iterator> iter = classes.iterator(); iter.hasNext();) {
- // Class> clazz = iter.next();
- //
- // if (Reflections.isOfType(clazz, Transaction.class)) {
- // System.out.println("......... " + clazz);
- // }
- // }
-
- for (Class> clazz : classes) {
- if (Reflections.isOfType(clazz, Transaction.class)) {
- // if (Transaction.class.isAssignableFrom(clazz) && clazz != Transaction.class) {
- System.out.println("......... " + clazz);
- }
- }
-
- } catch (Exception cause) {
- cause.printStackTrace();
- }
- }
-
- // private static Class> cache;
-
- public void beforeBeanDiscovery(@Observes final ProcessAnnotatedType> event) {
-
-// public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event) {
-
- x();
- System.out.println();
-
-// ClassLoader cl
-
- // private static ProcessAnnotatedType> cachedEvent;
- //
- // protected void processAnnotatedType(@Observes final ProcessAnnotatedType event) {
- // Class> annotated = event.getAnnotatedType().getJavaClass();
- //
- // if (Reflections.isOfType(annotated, Transaction.class)) {
- //
- // if(cachedEvent == null) {
- // cachedEvent = event;
- //
- // } else {
- // Class> cachedClass = cachedEvent.getAnnotatedType().getJavaClass();
- //
- // if (getPriority(annotated) > getPriority(cachedClass)) {
- // cachedEvent.veto();
- // cachedEvent = event;
- //
- // } else {
- // event.veto();
- // }
- // }
- // }
- // }
- //
- // private int getPriority(Class> type) {
- // int priority = Priority.MAX_PRIORITY;
- //
- // if (type == null) {
- // priority = Priority.MIN_PRIORITY;
- //
- // } else if (type.isAnnotationPresent(Priority.class)) {
- // Priority annotation = type.getAnnotation(Priority.class);
- // priority = annotation.value();
- // }
- //
- // return priority;
- }
-
-}
diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java
index 68612be..1a4a8c1 100644
--- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java
+++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java
@@ -54,17 +54,12 @@ public class TransactionBootstrap extends AbstractBootstrap {
public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event) {
selected = loadSelected();
-
- if (selected == null) {
- selected = DefaultTransaction.class;
- }
-
}
public void processAnnotatedType(@Observes final ProcessAnnotatedType event) {
- Class> annotated = event.getAnnotatedType().getJavaClass();
+ Class annotated = event.getAnnotatedType().getJavaClass();
- if (Reflections.isOfType(annotated, Transaction.class) && annotated != loadSelected()) {
+ if (Reflections.isOfType(annotated, Transaction.class) && annotated != selected) {
event.veto();
}
}
--
libgit2 0.21.2