Commit 6e8622065a97f42c198b88f112933290319f50bf
1 parent
0c481320
Exists in
master
Movendo as anotações @Startup e @Shutdown para o novo pacote lifecycle
já removendo os atributos depreciados
Showing
4 changed files
with
140 additions
and
210 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Shutdown.java
| ... | ... | @@ -1,105 +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.METHOD; | |
| 40 | -import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 41 | - | |
| 42 | -import java.lang.annotation.Retention; | |
| 43 | -import java.lang.annotation.Target; | |
| 44 | - | |
| 45 | -/** | |
| 46 | - * Identifies a method eligible to be executed automatically during <b>application finalization</b>. | |
| 47 | - * <p> | |
| 48 | - * Take a look at the following usage sample: | |
| 49 | - * <p> | |
| 50 | - * <blockquote> | |
| 51 | - * | |
| 52 | - * <pre> | |
| 53 | - * public class Finalizer { | |
| 54 | - * | |
| 55 | - * @Shutdown | |
| 56 | - * @Priority(5) | |
| 57 | - * public void finalize() { | |
| 58 | - * ... | |
| 59 | - * } | |
| 60 | - * } | |
| 61 | - * | |
| 62 | - * | |
| 63 | - * | |
| 64 | - * | |
| 65 | - * </pre> | |
| 66 | - * | |
| 67 | - * </blockquote> | |
| 68 | - * <p> | |
| 69 | - * The <code>@Shutdown</code> annotation allows an integer value to be defined, which stands for the method execution | |
| 70 | - * priority when several finalizer classes are available in the application. | |
| 71 | - * | |
| 72 | - * @author SERPRO | |
| 73 | - */ | |
| 74 | -@Target(METHOD) | |
| 75 | -@Retention(RUNTIME) | |
| 76 | -public @interface Shutdown { | |
| 77 | - | |
| 78 | - /** | |
| 79 | - * Most important priority value. | |
| 80 | - * | |
| 81 | - * @deprecated | |
| 82 | - * @see Priority | |
| 83 | - */ | |
| 84 | - @Deprecated | |
| 85 | - public static int MAX_PRIORITY = Integer.MIN_VALUE; | |
| 86 | - | |
| 87 | - /** | |
| 88 | - * Less important priority value. | |
| 89 | - * | |
| 90 | - * @deprecated | |
| 91 | - * @see Priority | |
| 92 | - */ | |
| 93 | - @Deprecated | |
| 94 | - public static int MIN_PRIORITY = Integer.MAX_VALUE; | |
| 95 | - | |
| 96 | - /** | |
| 97 | - * An integer value defines method execution order (i.e., priority). | |
| 98 | - * | |
| 99 | - * @deprecated | |
| 100 | - * @see Priority | |
| 101 | - */ | |
| 102 | - @Deprecated | |
| 103 | - int priority() default MIN_PRIORITY; | |
| 104 | - | |
| 105 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Startup.java
| ... | ... | @@ -1,105 +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.METHOD; | |
| 40 | -import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 41 | - | |
| 42 | -import java.lang.annotation.Retention; | |
| 43 | -import java.lang.annotation.Target; | |
| 44 | - | |
| 45 | -/** | |
| 46 | - * Identifies a method eligible to be executed automatically during <b>application initialization</b>. | |
| 47 | - * <p> | |
| 48 | - * Take a look at the following usage sample: | |
| 49 | - * <p> | |
| 50 | - * <blockquote> | |
| 51 | - * | |
| 52 | - * <pre> | |
| 53 | - * public class Initializer { | |
| 54 | - * | |
| 55 | - * @Startup | |
| 56 | - * @Priority(1) | |
| 57 | - * public void initialize() { | |
| 58 | - * ... | |
| 59 | - * } | |
| 60 | - * } | |
| 61 | - * | |
| 62 | - * | |
| 63 | - * | |
| 64 | - * | |
| 65 | - * </pre> | |
| 66 | - * | |
| 67 | - * </blockquote> | |
| 68 | - * <p> | |
| 69 | - * The <code>@Startup</code> annotation allows an integer value to be defined, which stands for the method execution | |
| 70 | - * priority when several initializer classes are available in the application. | |
| 71 | - * | |
| 72 | - * @author SERPRO | |
| 73 | - */ | |
| 74 | -@Target(METHOD) | |
| 75 | -@Retention(RUNTIME) | |
| 76 | -public @interface Startup { | |
| 77 | - | |
| 78 | - /** | |
| 79 | - * Most important priority value. | |
| 80 | - * | |
| 81 | - * @deprecated | |
| 82 | - * @see Priority | |
| 83 | - */ | |
| 84 | - @Deprecated | |
| 85 | - public static int MAX_PRIORITY = Integer.MIN_VALUE; | |
| 86 | - | |
| 87 | - /** | |
| 88 | - * Less important priority value. | |
| 89 | - * | |
| 90 | - * @deprecated | |
| 91 | - * @see Priority | |
| 92 | - */ | |
| 93 | - @Deprecated | |
| 94 | - public static int MIN_PRIORITY = Integer.MAX_VALUE; | |
| 95 | - | |
| 96 | - /** | |
| 97 | - * An integer value defines method execution order (i.e., priority). | |
| 98 | - * | |
| 99 | - * @deprecated | |
| 100 | - * @see Priority | |
| 101 | - */ | |
| 102 | - @Deprecated | |
| 103 | - int priority() default MIN_PRIORITY; | |
| 104 | - | |
| 105 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Shutdown.java
0 → 100644
| ... | ... | @@ -0,0 +1,70 @@ |
| 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.lifecycle; | |
| 38 | + | |
| 39 | +import static java.lang.annotation.ElementType.METHOD; | |
| 40 | +import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 41 | + | |
| 42 | +import java.lang.annotation.Retention; | |
| 43 | +import java.lang.annotation.Target; | |
| 44 | + | |
| 45 | +/** | |
| 46 | + * Identifies a method eligible to be executed automatically during <b>application finalization</b>. | |
| 47 | + * <p> | |
| 48 | + * Take a look at the following usage sample: | |
| 49 | + * <p> | |
| 50 | + * <blockquote> | |
| 51 | + * <pre> | |
| 52 | + * public class Finalizer { | |
| 53 | + * | |
| 54 | + * @Shutdown | |
| 55 | + * @Priority(5) | |
| 56 | + * public void finalize() { | |
| 57 | + * ... | |
| 58 | + * } | |
| 59 | + * } | |
| 60 | + * | |
| 61 | + * </pre> | |
| 62 | + * </blockquote> | |
| 63 | + * <p> | |
| 64 | + * | |
| 65 | + * @author SERPRO | |
| 66 | + */ | |
| 67 | +@Target(METHOD) | |
| 68 | +@Retention(RUNTIME) | |
| 69 | +public @interface Shutdown { | |
| 70 | +} | ... | ... |
impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Startup.java
0 → 100644
| ... | ... | @@ -0,0 +1,70 @@ |
| 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.lifecycle; | |
| 38 | + | |
| 39 | +import static java.lang.annotation.ElementType.METHOD; | |
| 40 | +import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 41 | + | |
| 42 | +import java.lang.annotation.Retention; | |
| 43 | +import java.lang.annotation.Target; | |
| 44 | + | |
| 45 | +/** | |
| 46 | + * Identifies a method eligible to be executed automatically during <b>application initialization</b>. | |
| 47 | + * <p> | |
| 48 | + * Take a look at the following usage sample: | |
| 49 | + * <p> | |
| 50 | + * <blockquote> | |
| 51 | + * <pre> | |
| 52 | + * public class Finalizer { | |
| 53 | + * | |
| 54 | + * @Startup | |
| 55 | + * @Priority(1) | |
| 56 | + * public void init() { | |
| 57 | + * ... | |
| 58 | + * } | |
| 59 | + * } | |
| 60 | + * | |
| 61 | + * </pre> | |
| 62 | + * </blockquote> | |
| 63 | + * <p> | |
| 64 | + * | |
| 65 | + * @author SERPRO | |
| 66 | + */ | |
| 67 | +@Target(METHOD) | |
| 68 | +@Retention(RUNTIME) | |
| 69 | +public @interface Startup { | |
| 70 | +} | ... | ... |