Commit 84dfc0c57c5b5483d238b90e2e1f3487e5139f04

Authored by Cleverson Sacramento
1 parent 5d8915eb
Exists in master

Remoção do Bootstrap de transação experimental anterior

impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java
@@ -1,90 +0,0 @@ @@ -1,90 +0,0 @@
1 -/*  
2 - * Demoiselle Framework  
3 - * Copyright (C) 2010 SERPRO  
4 - * ----------------------------------------------------------------------------  
5 - * This file is part of Demoiselle Framework.  
6 - *  
7 - * Demoiselle Framework is free software; you can redistribute it and/or  
8 - * modify it under the terms of the GNU Lesser General Public License version 3  
9 - * as published by the Free Software Foundation.  
10 - *  
11 - * This program is distributed in the hope that it will be useful,  
12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
14 - * GNU General Public License for more details.  
15 - *  
16 - * You should have received a copy of the GNU Lesser General Public License version 3  
17 - * along with this program; if not, see <http://www.gnu.org/licenses/>  
18 - * or write to the Free Software Foundation, Inc., 51 Franklin Street,  
19 - * Fifth Floor, Boston, MA 02110-1301, USA.  
20 - * ----------------------------------------------------------------------------  
21 - * Este arquivo é parte do Framework Demoiselle.  
22 - *  
23 - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou  
24 - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação  
25 - * do Software Livre (FSF).  
26 - *  
27 - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA  
28 - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou  
29 - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português  
30 - * para maiores detalhes.  
31 - *  
32 - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título  
33 - * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>  
34 - * ou escreva para a Fundação do Software Livre (FSF) Inc.,  
35 - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.  
36 - */  
37 -package br.gov.frameworkdemoiselle.internal.bootstrap;  
38 -  
39 -import javax.enterprise.event.Observes;  
40 -import javax.enterprise.inject.spi.ProcessAnnotatedType;  
41 -  
42 -import org.apache.commons.configuration.Configuration;  
43 -import org.apache.commons.configuration.PropertiesConfiguration;  
44 -  
45 -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;  
46 -import br.gov.frameworkdemoiselle.internal.implementation.DefaultTransaction;  
47 -import br.gov.frameworkdemoiselle.transaction.Transaction;  
48 -  
49 -public class TransactionBootstrap extends AbstractBootstrap {  
50 -  
51 - private static Class<Transaction> selected;  
52 -  
53 - public <T> void processAnnotatedType(@Observes final ProcessAnnotatedType<T> event) {  
54 - Class<?> annotated = event.getAnnotatedType().getJavaClass();  
55 -  
56 - if (Transaction.class.isAssignableFrom(annotated) && annotated != Transaction.class  
57 - && !annotated.equals(getSelected())) {  
58 - event.veto();  
59 - }  
60 - }  
61 -  
62 - @SuppressWarnings("unchecked")  
63 - private synchronized static Class<Transaction> getSelected() {  
64 - if (selected == null) {  
65 - String canonicalName = null;  
66 -  
67 - try {  
68 - Configuration config = new PropertiesConfiguration("demoiselle.properties");  
69 - canonicalName = config.getString("frameworkdemoiselle.transaction.class",  
70 - DefaultTransaction.class.getCanonicalName());  
71 -  
72 - ClassLoader classLoader = Thread.currentThread().getContextClassLoader();  
73 - selected = (Class<Transaction>) Class.forName(canonicalName, false, classLoader);  
74 - selected.asSubclass(Transaction.class);  
75 -  
76 - } catch (org.apache.commons.configuration.ConfigurationException cause) {  
77 - throw new ConfigurationException(getBundle().getString("file-not-found", "demoiselle.properties"));  
78 -  
79 - } catch (ClassNotFoundException cause) {  
80 - throw new ConfigurationException(getBundle().getString("transaction-class-not-found", canonicalName));  
81 -  
82 - } catch (ClassCastException cause) {  
83 - throw new ConfigurationException(getBundle().getString("transaction-class-must-be-of-type",  
84 - canonicalName, Transaction.class.getCanonicalName()));  
85 - }  
86 - }  
87 -  
88 - return selected;  
89 - }  
90 -}  
impl/core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
1 br.gov.frameworkdemoiselle.internal.bootstrap.CoreBootstrap 1 br.gov.frameworkdemoiselle.internal.bootstrap.CoreBootstrap
2 br.gov.frameworkdemoiselle.internal.bootstrap.ConfigurationBootstrap 2 br.gov.frameworkdemoiselle.internal.bootstrap.ConfigurationBootstrap
3 -br.gov.frameworkdemoiselle.internal.bootstrap.TransactionBootstrap  
4 br.gov.frameworkdemoiselle.internal.bootstrap.StartupBootstrap 3 br.gov.frameworkdemoiselle.internal.bootstrap.StartupBootstrap
5 br.gov.frameworkdemoiselle.internal.bootstrap.ShutdownBootstrap 4 br.gov.frameworkdemoiselle.internal.bootstrap.ShutdownBootstrap