Commit 8daf2764ad94625af5f2f1e37de89c53b868ce22

Authored by Cleverson Sacramento
1 parent 46d86bd6
Exists in master

Exclusão da anotação experimental @Priority já que os conflitos serão

resolvidos pelo demoiselle.properties.
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Priority.java
@@ -1,74 +0,0 @@ @@ -1,74 +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.annotation;  
38 -  
39 -import static java.lang.annotation.ElementType.FIELD;  
40 -import static java.lang.annotation.ElementType.METHOD;  
41 -import static java.lang.annotation.ElementType.PARAMETER;  
42 -import static java.lang.annotation.ElementType.TYPE;  
43 -import static java.lang.annotation.RetentionPolicy.RUNTIME;  
44 -  
45 -import java.lang.annotation.Inherited;  
46 -import java.lang.annotation.Retention;  
47 -import java.lang.annotation.Target;  
48 -  
49 -@Inherited  
50 -@Retention(RUNTIME)  
51 -@Target({ TYPE, FIELD, METHOD, PARAMETER })  
52 -public @interface Priority {  
53 -  
54 - /**  
55 - * Most important priority value.  
56 - */  
57 - public static int MAX_PRIORITY = Integer.MIN_VALUE;  
58 -  
59 - /**  
60 - * Less important priority value.  
61 - */  
62 - public static int MIN_PRIORITY = Integer.MAX_VALUE;  
63 -  
64 - /**  
65 - * Less important priority value.  
66 - */  
67 - public static int MID_PRIORITY = (MIN_PRIORITY - MAX_PRIORITY) / 2;  
68 -  
69 - /**  
70 - * An integer value defines method execution order (i.e., priority).  
71 - */  
72 - int value() default MIN_PRIORITY;  
73 -  
74 -}  
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/AbstractVetoBootstrap.java
@@ -1,84 +0,0 @@ @@ -1,84 +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 br.gov.frameworkdemoiselle.annotation.Priority;  
43 -import br.gov.frameworkdemoiselle.util.Reflections;  
44 -  
45 -public abstract class AbstractVetoBootstrap<T, S> extends AbstractBootstrap {  
46 -  
47 - private Class<T> type;  
48 -  
49 - private Class<S> subclass;  
50 -  
51 - protected <A> void processAnnotatedType(@Observes final ProcessAnnotatedType<A> event) {  
52 - Class<?> annotated = event.getAnnotatedType().getJavaClass();  
53 -  
54 - if (Reflections.isOfType(annotated, getType()) && annotated != getSubclass()  
55 - && getPriority(getSubclass()) < getPriority(annotated)) {  
56 - event.veto();  
57 - }  
58 - }  
59 -  
60 - private int getPriority(Class<?> type) {  
61 - int priority = Priority.MAX_PRIORITY;  
62 -  
63 - if (type.isAnnotationPresent(Priority.class)) {  
64 - Priority annotation = type.getAnnotation(Priority.class);  
65 - priority = annotation.value();  
66 - }  
67 -  
68 - return priority;  
69 - }  
70 -  
71 - protected Class<T> getType() {  
72 - if (this.type == null) {  
73 - this.type = Reflections.getGenericTypeArgument(this.getClass(), 0);  
74 - }  
75 - return this.type;  
76 - }  
77 -  
78 - protected Class<S> getSubclass() {  
79 - if (this.subclass == null) {  
80 - this.subclass = Reflections.getGenericTypeArgument(this.getClass(), 1);  
81 - }  
82 - return this.subclass;  
83 - }  
84 -}  
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/DefaultTransaction.java
@@ -36,12 +36,9 @@ @@ -36,12 +36,9 @@
36 */ 36 */
37 package br.gov.frameworkdemoiselle.internal.implementation; 37 package br.gov.frameworkdemoiselle.internal.implementation;
38 38
39 -import static br.gov.frameworkdemoiselle.annotation.Priority.MIN_PRIORITY;  
40 -  
41 import javax.enterprise.context.RequestScoped; 39 import javax.enterprise.context.RequestScoped;
42 40
43 import br.gov.frameworkdemoiselle.DemoiselleException; 41 import br.gov.frameworkdemoiselle.DemoiselleException;
44 -import br.gov.frameworkdemoiselle.annotation.Priority;  
45 import br.gov.frameworkdemoiselle.transaction.Transaction; 42 import br.gov.frameworkdemoiselle.transaction.Transaction;
46 import br.gov.frameworkdemoiselle.transaction.Transactional; 43 import br.gov.frameworkdemoiselle.transaction.Transactional;
47 44
@@ -52,7 +49,6 @@ import br.gov.frameworkdemoiselle.transaction.Transactional; @@ -52,7 +49,6 @@ import br.gov.frameworkdemoiselle.transaction.Transactional;
52 * @see Transaction 49 * @see Transaction
53 */ 50 */
54 @RequestScoped 51 @RequestScoped
55 -@Priority(MIN_PRIORITY)  
56 public class DefaultTransaction implements Transaction { 52 public class DefaultTransaction implements Transaction {
57 53
58 private static final long serialVersionUID = 1L; 54 private static final long serialVersionUID = 1L;
impl/extension/jpa/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/JPATransactionBootstrap.java
@@ -1,44 +0,0 @@ @@ -1,44 +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 br.gov.frameworkdemoiselle.transaction.JPATransaction;  
40 -import br.gov.frameworkdemoiselle.transaction.Transaction;  
41 -  
42 -public class JPATransactionBootstrap extends AbstractVetoBootstrap<Transaction, JPATransaction> {  
43 -  
44 -}  
impl/extension/jpa/src/main/java/br/gov/frameworkdemoiselle/transaction/JPATransaction.java
@@ -36,8 +36,6 @@ @@ -36,8 +36,6 @@
36 */ 36 */
37 package br.gov.frameworkdemoiselle.transaction; 37 package br.gov.frameworkdemoiselle.transaction;
38 38
39 -import static br.gov.frameworkdemoiselle.annotation.Priority.MID_PRIORITY;  
40 -  
41 import java.util.Collection; 39 import java.util.Collection;
42 40
43 import javax.enterprise.context.RequestScoped; 41 import javax.enterprise.context.RequestScoped;
@@ -45,7 +43,6 @@ import javax.inject.Inject; @@ -45,7 +43,6 @@ import javax.inject.Inject;
45 import javax.persistence.EntityManager; 43 import javax.persistence.EntityManager;
46 import javax.persistence.EntityTransaction; 44 import javax.persistence.EntityTransaction;
47 45
48 -import br.gov.frameworkdemoiselle.annotation.Priority;  
49 import br.gov.frameworkdemoiselle.internal.producer.EntityManagerProducer; 46 import br.gov.frameworkdemoiselle.internal.producer.EntityManagerProducer;
50 47
51 /** 48 /**
@@ -55,7 +52,6 @@ import br.gov.frameworkdemoiselle.internal.producer.EntityManagerProducer; @@ -55,7 +52,6 @@ import br.gov.frameworkdemoiselle.internal.producer.EntityManagerProducer;
55 * @see Transaction 52 * @see Transaction
56 */ 53 */
57 @RequestScoped 54 @RequestScoped
58 -@Priority(MID_PRIORITY)  
59 public class JPATransaction implements Transaction { 55 public class JPATransaction implements Transaction {
60 56
61 private static final long serialVersionUID = 1L; 57 private static final long serialVersionUID = 1L;
impl/extension/jta/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/JTATransactionBootstrap.java
@@ -1,44 +0,0 @@ @@ -1,44 +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 br.gov.frameworkdemoiselle.transaction.JTATransaction;  
40 -import br.gov.frameworkdemoiselle.transaction.Transaction;  
41 -  
42 -public class JTATransactionBootstrap extends AbstractVetoBootstrap<Transaction, JTATransaction> {  
43 -  
44 -}  
impl/extension/jta/src/main/java/br/gov/frameworkdemoiselle/transaction/JTATransaction.java
@@ -36,18 +36,14 @@ @@ -36,18 +36,14 @@
36 */ 36 */
37 package br.gov.frameworkdemoiselle.transaction; 37 package br.gov.frameworkdemoiselle.transaction;
38 38
39 -import static br.gov.frameworkdemoiselle.annotation.Priority.MAX_PRIORITY;  
40 -  
41 import javax.enterprise.context.RequestScoped; 39 import javax.enterprise.context.RequestScoped;
42 import javax.transaction.Status; 40 import javax.transaction.Status;
43 import javax.transaction.SystemException; 41 import javax.transaction.SystemException;
44 import javax.transaction.UserTransaction; 42 import javax.transaction.UserTransaction;
45 43
46 -import br.gov.frameworkdemoiselle.annotation.Priority;  
47 import br.gov.frameworkdemoiselle.util.Beans; 44 import br.gov.frameworkdemoiselle.util.Beans;
48 45
49 @RequestScoped 46 @RequestScoped
50 -@Priority(MAX_PRIORITY)  
51 public class JTATransaction implements Transaction { 47 public class JTATransaction implements Transaction {
52 48
53 private static final long serialVersionUID = 1L; 49 private static final long serialVersionUID = 1L;