Commit e753ae509ceba600cdc3fb02a13ae453d77c80d7
1 parent
dbc9dcc2
Exists in
master
Criação de mais um método no seletor de estratégias para detectar as
implementações automaticamente.
Showing
5 changed files
with
1 additions
and
174 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AuthenticatorBootstrap.java
| @@ -1,56 +0,0 @@ | @@ -1,56 +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 org.slf4j.Logger; | ||
| 40 | - | ||
| 41 | -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; | ||
| 42 | -import br.gov.frameworkdemoiselle.security.Authenticator; | ||
| 43 | - | ||
| 44 | -public class AuthenticatorBootstrap extends AbstractStrategyBootstrap<Authenticator> { | ||
| 45 | - | ||
| 46 | - private Logger logger; | ||
| 47 | - | ||
| 48 | - @Override | ||
| 49 | - protected Logger getLogger() { | ||
| 50 | - if (logger == null) { | ||
| 51 | - logger = LoggerProducer.create(AuthenticatorBootstrap.class); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - return logger; | ||
| 55 | - } | ||
| 56 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AuthorizerBootstrap.java
| @@ -1,56 +0,0 @@ | @@ -1,56 +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 org.slf4j.Logger; | ||
| 40 | - | ||
| 41 | -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; | ||
| 42 | -import br.gov.frameworkdemoiselle.security.Authorizer; | ||
| 43 | - | ||
| 44 | -public class AuthorizerBootstrap extends AbstractStrategyBootstrap<Authorizer> { | ||
| 45 | - | ||
| 46 | - private Logger logger; | ||
| 47 | - | ||
| 48 | - @Override | ||
| 49 | - protected Logger getLogger() { | ||
| 50 | - if (logger == null) { | ||
| 51 | - logger = LoggerProducer.create(AuthorizerBootstrap.class); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - return logger; | ||
| 55 | - } | ||
| 56 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/TransactionBootstrap.java
| @@ -1,56 +0,0 @@ | @@ -1,56 +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 org.slf4j.Logger; | ||
| 40 | - | ||
| 41 | -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; | ||
| 42 | -import br.gov.frameworkdemoiselle.transaction.Transaction; | ||
| 43 | - | ||
| 44 | -public class TransactionBootstrap extends AbstractStrategyBootstrap<Transaction> { | ||
| 45 | - | ||
| 46 | - private Logger logger; | ||
| 47 | - | ||
| 48 | - @Override | ||
| 49 | - protected Logger getLogger() { | ||
| 50 | - if (logger == null) { | ||
| 51 | - logger = LoggerProducer.create(TransactionBootstrap.class); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - return logger; | ||
| 55 | - } | ||
| 56 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionContextImpl.java
| @@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.implementation; | @@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.implementation; | ||
| 38 | 38 | ||
| 39 | import javax.inject.Named; | 39 | import javax.inject.Named; |
| 40 | 40 | ||
| 41 | -import br.gov.frameworkdemoiselle.internal.bootstrap.TransactionBootstrap; | ||
| 42 | import br.gov.frameworkdemoiselle.internal.configuration.TransactionConfig; | 41 | import br.gov.frameworkdemoiselle.internal.configuration.TransactionConfig; |
| 43 | import br.gov.frameworkdemoiselle.transaction.Transaction; | 42 | import br.gov.frameworkdemoiselle.transaction.Transaction; |
| 44 | import br.gov.frameworkdemoiselle.transaction.TransactionContext; | 43 | import br.gov.frameworkdemoiselle.transaction.TransactionContext; |
| @@ -58,11 +57,10 @@ public class TransactionContextImpl implements TransactionContext { | @@ -58,11 +57,10 @@ public class TransactionContextImpl implements TransactionContext { | ||
| 58 | 57 | ||
| 59 | private Transaction getTransaction() { | 58 | private Transaction getTransaction() { |
| 60 | if (this.transaction == null) { | 59 | if (this.transaction == null) { |
| 61 | - TransactionBootstrap bootstrap = Beans.getReference(TransactionBootstrap.class); | ||
| 62 | Class<? extends Transaction> clazz = getConfig().getTransactionClass(); | 60 | Class<? extends Transaction> clazz = getConfig().getTransactionClass(); |
| 63 | 61 | ||
| 64 | if (clazz == null) { | 62 | if (clazz == null) { |
| 65 | - clazz = StrategySelector.selectClass(Transaction.class, bootstrap.getCache()); | 63 | + clazz = StrategySelector.selectClass(Transaction.class); |
| 66 | } | 64 | } |
| 67 | 65 | ||
| 68 | this.transaction = Beans.getReference(clazz); | 66 | this.transaction = Beans.getReference(clazz); |
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.AuthenticatorBootstrap | ||
| 5 | -br.gov.frameworkdemoiselle.internal.bootstrap.AuthorizerBootstrap | ||
| 6 | br.gov.frameworkdemoiselle.internal.bootstrap.ManagementBootstrap | 3 | br.gov.frameworkdemoiselle.internal.bootstrap.ManagementBootstrap |
| 7 | br.gov.frameworkdemoiselle.internal.bootstrap.StartupBootstrap | 4 | br.gov.frameworkdemoiselle.internal.bootstrap.StartupBootstrap |
| 8 | br.gov.frameworkdemoiselle.internal.bootstrap.ShutdownBootstrap | 5 | br.gov.frameworkdemoiselle.internal.bootstrap.ShutdownBootstrap |