Commit 93c20a20604d18d50bebf5f138e04590c42b395d
1 parent
509e9461
Exists in
master
FWK-217: Movendo as anotações do Managment para o pacote correto
Task-Url: https://demoiselle.atlassian.net/browse/FWK-217
Showing
10 changed files
with
340 additions
and
462 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedOperation.java
@@ -1,78 +0,0 @@ | @@ -1,78 +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 java.lang.annotation.Documented; | ||
40 | -import java.lang.annotation.ElementType; | ||
41 | -import java.lang.annotation.Retention; | ||
42 | -import java.lang.annotation.RetentionPolicy; | ||
43 | -import java.lang.annotation.Target; | ||
44 | - | ||
45 | -import javax.enterprise.util.Nonbinding; | ||
46 | - | ||
47 | -import br.gov.frameworkdemoiselle.DemoiselleException; | ||
48 | - | ||
49 | -/** | ||
50 | - * <p> | ||
51 | - * Indicates that a method is a <b>managed operation</b>, meaning you can manage some aspect of the application by | ||
52 | - * calling it from a external management client. | ||
53 | - * </p> | ||
54 | - * <p> | ||
55 | - * This annotation can't be used together with {@link ManagedProperty}, doing so will throw a | ||
56 | - * {@link DemoiselleException}. | ||
57 | - * </p> | ||
58 | - * | ||
59 | - * @author SERPRO | ||
60 | - */ | ||
61 | -@Documented | ||
62 | -@Target({ ElementType.METHOD }) | ||
63 | -@Retention(RetentionPolicy.RUNTIME) | ||
64 | -public @interface ManagedOperation { | ||
65 | - | ||
66 | - /** | ||
67 | - * Description that will be used to publish the operation to clients. Defaults to an empty description. | ||
68 | - */ | ||
69 | - @Nonbinding | ||
70 | - String description() default ""; | ||
71 | - | ||
72 | - /** | ||
73 | - * Type of operation. Defaults to {@link OperationType#UNKNOWN}. | ||
74 | - */ | ||
75 | - @Nonbinding | ||
76 | - OperationType type() default OperationType.UNKNOWN; | ||
77 | - | ||
78 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedProperty.java
@@ -1,109 +0,0 @@ | @@ -1,109 +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 java.lang.annotation.Documented; | ||
40 | -import java.lang.annotation.ElementType; | ||
41 | -import java.lang.annotation.Retention; | ||
42 | -import java.lang.annotation.RetentionPolicy; | ||
43 | -import java.lang.annotation.Target; | ||
44 | - | ||
45 | -import javax.enterprise.util.Nonbinding; | ||
46 | - | ||
47 | -/** | ||
48 | - * <p> | ||
49 | - * Indicates that a field must be exposed as a property to management clients. | ||
50 | - * </p> | ||
51 | - * <p> | ||
52 | - * The property will be writable if there's a public setter method declared for the field and readable if there's a | ||
53 | - * getter method. You can override this behaviour by passing a value to the {@link #accessLevel()} property. | ||
54 | - * </p> | ||
55 | - * <p> | ||
56 | - * It's a runtime error to annotate a field with no getter and no setter method. | ||
57 | - * </p> | ||
58 | - * <p> | ||
59 | - * It's also a runtime error to declare a field as a property and one or both of it's getter and setter methods as an | ||
60 | - * operation using the {@link ManagedOperation} annotation. | ||
61 | - * </p> | ||
62 | - * | ||
63 | - * @author SERPRO | ||
64 | - */ | ||
65 | -@Documented | ||
66 | -@Target({ ElementType.FIELD }) | ||
67 | -@Retention(RetentionPolicy.RUNTIME) | ||
68 | -public @interface ManagedProperty { | ||
69 | - | ||
70 | - /** | ||
71 | - * @return The description of this property exposed to management clients. | ||
72 | - */ | ||
73 | - @Nonbinding | ||
74 | - String description() default ""; | ||
75 | - | ||
76 | - @Nonbinding | ||
77 | - ManagedPropertyAccess accessLevel() default ManagedPropertyAccess.DEFAULT; | ||
78 | - | ||
79 | - /** | ||
80 | - * <p> | ||
81 | - * Access level of a managed property. | ||
82 | - * </p> | ||
83 | - * <p> | ||
84 | - * These values only affect access via external management clients, the application is still able to inject and use | ||
85 | - * the normal visibility of the property by Java standards. | ||
86 | - * </p> | ||
87 | - * | ||
88 | - * @author serpro | ||
89 | - */ | ||
90 | - enum ManagedPropertyAccess { | ||
91 | - | ||
92 | - /** | ||
93 | - * Restricts a property to be only readable even if a setter method exists. | ||
94 | - */ | ||
95 | - READ_ONLY | ||
96 | - | ||
97 | - /** | ||
98 | - * Restricts a property to be only writeable even if a getter method exists. | ||
99 | - */ | ||
100 | - , WRITE_ONLY | ||
101 | - | ||
102 | - /** | ||
103 | - * Says that the read or write access will be determined by the presence of a getter method | ||
104 | - * <code>(getProperty())</code> or setter method <code>(setProperty(propertyValue))</code> for a property. | ||
105 | - */ | ||
106 | - , DEFAULT; | ||
107 | - } | ||
108 | - | ||
109 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationParameter.java
@@ -1,75 +0,0 @@ | @@ -1,75 +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 java.lang.annotation.Documented; | ||
40 | -import java.lang.annotation.ElementType; | ||
41 | -import java.lang.annotation.Retention; | ||
42 | -import java.lang.annotation.RetentionPolicy; | ||
43 | -import java.lang.annotation.Target; | ||
44 | - | ||
45 | -import javax.enterprise.util.Nonbinding; | ||
46 | - | ||
47 | -/** | ||
48 | - * <p> | ||
49 | - * Optional annotation to write additional detail about an operation's parameter. | ||
50 | - * </p> | ||
51 | - * <p> | ||
52 | - * This annotation is ignored for non-operation methods. | ||
53 | - * </p> | ||
54 | - * | ||
55 | - * @author SERPRO | ||
56 | - */ | ||
57 | -@Documented | ||
58 | -@Target({ ElementType.PARAMETER }) | ||
59 | -@Retention(RetentionPolicy.RUNTIME) | ||
60 | -public @interface OperationParameter { | ||
61 | - | ||
62 | - /** | ||
63 | - * AmbiguousQualifier that will be used to publish this operation's parameter to clients. | ||
64 | - */ | ||
65 | - @Nonbinding | ||
66 | - String name(); | ||
67 | - | ||
68 | - /** | ||
69 | - * Optional description that will be used to publish this operation's parameter to clients. Defaults to an empty | ||
70 | - * description. | ||
71 | - */ | ||
72 | - @Nonbinding | ||
73 | - String description() default ""; | ||
74 | - | ||
75 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationType.java
@@ -1,78 +0,0 @@ | @@ -1,78 +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 | - | ||
40 | -/** | ||
41 | - * <p> | ||
42 | - * Define the operation type for an operation inside a ManagementController class. | ||
43 | - * </p> | ||
44 | - * <p> | ||
45 | - * This is an optional annotation and it's significanse will change based on the management extension used. Most | ||
46 | - * extensions will just publish this information to the client so it can better show to the user the inner workings of | ||
47 | - * the annotated operation. | ||
48 | - * </p> | ||
49 | - * | ||
50 | - * @author SERPRO | ||
51 | - */ | ||
52 | -public enum OperationType { | ||
53 | - | ||
54 | - /** | ||
55 | - * ManagedOperation is write-only, it causes the application to change some of it's behaviour but doesn't return any | ||
56 | - * kind of information | ||
57 | - */ | ||
58 | - ACTION, | ||
59 | - | ||
60 | - /** | ||
61 | - * ManagedOperation is read-only, it will operate over data provided by the application and return some information, | ||
62 | - * but will not change the application in any way. | ||
63 | - */ | ||
64 | - INFO, | ||
65 | - | ||
66 | - /** | ||
67 | - * ManagedOperation is read-write, it will both change the way the application work and return some information | ||
68 | - * regarding the result of the operation. | ||
69 | - */ | ||
70 | - ACTION_INFO, | ||
71 | - | ||
72 | - /** | ||
73 | - * The effect of calling this operation is unknown. This is the default type and if this type is assigned to an | ||
74 | - * operation, the user must rely on the {@link ManagedOperation#description()} attribute to learn about how the | ||
75 | - * operation works. | ||
76 | - */ | ||
77 | - UNKNOWN | ||
78 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/StaticScoped.java
@@ -1,61 +0,0 @@ | @@ -1,61 +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.TYPE; | ||
42 | -import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
43 | - | ||
44 | -import java.lang.annotation.Inherited; | ||
45 | -import java.lang.annotation.Retention; | ||
46 | -import java.lang.annotation.Target; | ||
47 | - | ||
48 | -import javax.enterprise.context.NormalScope; | ||
49 | - | ||
50 | -/** | ||
51 | - *This scope stores the classes just as if it was a static attribute. | ||
52 | - * | ||
53 | - * @author SERPRO | ||
54 | - */ | ||
55 | -@Inherited | ||
56 | -@Target({ METHOD, TYPE, FIELD }) | ||
57 | -@Retention(RUNTIME) | ||
58 | -@NormalScope | ||
59 | -public @interface StaticScoped { | ||
60 | - | ||
61 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ViewScoped.java
@@ -1,61 +0,0 @@ | @@ -1,61 +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.TYPE; | ||
42 | -import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
43 | - | ||
44 | -import java.lang.annotation.Inherited; | ||
45 | -import java.lang.annotation.Retention; | ||
46 | -import java.lang.annotation.Target; | ||
47 | - | ||
48 | -import javax.enterprise.context.NormalScope; | ||
49 | - | ||
50 | -/** | ||
51 | - * This scope maintains the context for viewed page; when the viewed page change, the data will be lost. | ||
52 | - * | ||
53 | - * @author SERPRO | ||
54 | - */ | ||
55 | -@Inherited | ||
56 | -@Target({ METHOD, TYPE, FIELD }) | ||
57 | -@Retention(RUNTIME) | ||
58 | -@NormalScope(passivating = true) | ||
59 | -public @interface ViewScoped { | ||
60 | - | ||
61 | -} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/management/ManagedOperation.java
0 → 100644
@@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
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.management; | ||
38 | + | ||
39 | +import java.lang.annotation.Documented; | ||
40 | +import java.lang.annotation.ElementType; | ||
41 | +import java.lang.annotation.Retention; | ||
42 | +import java.lang.annotation.RetentionPolicy; | ||
43 | +import java.lang.annotation.Target; | ||
44 | + | ||
45 | +import javax.enterprise.util.Nonbinding; | ||
46 | + | ||
47 | +import br.gov.frameworkdemoiselle.DemoiselleException; | ||
48 | + | ||
49 | +/** | ||
50 | + * <p> | ||
51 | + * Indicates that a method is a <b>managed operation</b>, meaning you can manage some aspect of the application by | ||
52 | + * calling it from a external management client. | ||
53 | + * </p> | ||
54 | + * <p> | ||
55 | + * This annotation can't be used together with {@link ManagedProperty}, doing so will throw a | ||
56 | + * {@link DemoiselleException}. | ||
57 | + * </p> | ||
58 | + * | ||
59 | + * @author SERPRO | ||
60 | + */ | ||
61 | +@Documented | ||
62 | +@Target({ ElementType.METHOD }) | ||
63 | +@Retention(RetentionPolicy.RUNTIME) | ||
64 | +public @interface ManagedOperation { | ||
65 | + | ||
66 | + /** | ||
67 | + * Description that will be used to publish the operation to clients. Defaults to an empty description. | ||
68 | + */ | ||
69 | + @Nonbinding | ||
70 | + String description() default ""; | ||
71 | + | ||
72 | + /** | ||
73 | + * Type of operation. Defaults to {@link OperationType#UNKNOWN}. | ||
74 | + */ | ||
75 | + @Nonbinding | ||
76 | + OperationType type() default OperationType.UNKNOWN; | ||
77 | + | ||
78 | +} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/management/ManagedProperty.java
0 → 100644
@@ -0,0 +1,109 @@ | @@ -0,0 +1,109 @@ | ||
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.management; | ||
38 | + | ||
39 | +import java.lang.annotation.Documented; | ||
40 | +import java.lang.annotation.ElementType; | ||
41 | +import java.lang.annotation.Retention; | ||
42 | +import java.lang.annotation.RetentionPolicy; | ||
43 | +import java.lang.annotation.Target; | ||
44 | + | ||
45 | +import javax.enterprise.util.Nonbinding; | ||
46 | + | ||
47 | +/** | ||
48 | + * <p> | ||
49 | + * Indicates that a field must be exposed as a property to management clients. | ||
50 | + * </p> | ||
51 | + * <p> | ||
52 | + * The property will be writable if there's a public setter method declared for the field and readable if there's a | ||
53 | + * getter method. You can override this behaviour by passing a value to the {@link #accessLevel()} property. | ||
54 | + * </p> | ||
55 | + * <p> | ||
56 | + * It's a runtime error to annotate a field with no getter and no setter method. | ||
57 | + * </p> | ||
58 | + * <p> | ||
59 | + * It's also a runtime error to declare a field as a property and one or both of it's getter and setter methods as an | ||
60 | + * operation using the {@link ManagedOperation} annotation. | ||
61 | + * </p> | ||
62 | + * | ||
63 | + * @author SERPRO | ||
64 | + */ | ||
65 | +@Documented | ||
66 | +@Target({ ElementType.FIELD }) | ||
67 | +@Retention(RetentionPolicy.RUNTIME) | ||
68 | +public @interface ManagedProperty { | ||
69 | + | ||
70 | + /** | ||
71 | + * @return The description of this property exposed to management clients. | ||
72 | + */ | ||
73 | + @Nonbinding | ||
74 | + String description() default ""; | ||
75 | + | ||
76 | + @Nonbinding | ||
77 | + ManagedPropertyAccess accessLevel() default ManagedPropertyAccess.DEFAULT; | ||
78 | + | ||
79 | + /** | ||
80 | + * <p> | ||
81 | + * Access level of a managed property. | ||
82 | + * </p> | ||
83 | + * <p> | ||
84 | + * These values only affect access via external management clients, the application is still able to inject and use | ||
85 | + * the normal visibility of the property by Java standards. | ||
86 | + * </p> | ||
87 | + * | ||
88 | + * @author serpro | ||
89 | + */ | ||
90 | + enum ManagedPropertyAccess { | ||
91 | + | ||
92 | + /** | ||
93 | + * Restricts a property to be only readable even if a setter method exists. | ||
94 | + */ | ||
95 | + READ_ONLY | ||
96 | + | ||
97 | + /** | ||
98 | + * Restricts a property to be only writeable even if a getter method exists. | ||
99 | + */ | ||
100 | + , WRITE_ONLY | ||
101 | + | ||
102 | + /** | ||
103 | + * Says that the read or write access will be determined by the presence of a getter method | ||
104 | + * <code>(getProperty())</code> or setter method <code>(setProperty(propertyValue))</code> for a property. | ||
105 | + */ | ||
106 | + , DEFAULT; | ||
107 | + } | ||
108 | + | ||
109 | +} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/management/OperationParameter.java
0 → 100644
@@ -0,0 +1,75 @@ | @@ -0,0 +1,75 @@ | ||
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.management; | ||
38 | + | ||
39 | +import java.lang.annotation.Documented; | ||
40 | +import java.lang.annotation.ElementType; | ||
41 | +import java.lang.annotation.Retention; | ||
42 | +import java.lang.annotation.RetentionPolicy; | ||
43 | +import java.lang.annotation.Target; | ||
44 | + | ||
45 | +import javax.enterprise.util.Nonbinding; | ||
46 | + | ||
47 | +/** | ||
48 | + * <p> | ||
49 | + * Optional annotation to write additional detail about an operation's parameter. | ||
50 | + * </p> | ||
51 | + * <p> | ||
52 | + * This annotation is ignored for non-operation methods. | ||
53 | + * </p> | ||
54 | + * | ||
55 | + * @author SERPRO | ||
56 | + */ | ||
57 | +@Documented | ||
58 | +@Target({ ElementType.PARAMETER }) | ||
59 | +@Retention(RetentionPolicy.RUNTIME) | ||
60 | +public @interface OperationParameter { | ||
61 | + | ||
62 | + /** | ||
63 | + * AmbiguousQualifier that will be used to publish this operation's parameter to clients. | ||
64 | + */ | ||
65 | + @Nonbinding | ||
66 | + String name(); | ||
67 | + | ||
68 | + /** | ||
69 | + * Optional description that will be used to publish this operation's parameter to clients. Defaults to an empty | ||
70 | + * description. | ||
71 | + */ | ||
72 | + @Nonbinding | ||
73 | + String description() default ""; | ||
74 | + | ||
75 | +} |
impl/core/src/main/java/br/gov/frameworkdemoiselle/management/OperationType.java
0 → 100644
@@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
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.management; | ||
38 | + | ||
39 | + | ||
40 | +/** | ||
41 | + * <p> | ||
42 | + * Define the operation type for an operation inside a ManagementController class. | ||
43 | + * </p> | ||
44 | + * <p> | ||
45 | + * This is an optional annotation and it's significanse will change based on the management extension used. Most | ||
46 | + * extensions will just publish this information to the client so it can better show to the user the inner workings of | ||
47 | + * the annotated operation. | ||
48 | + * </p> | ||
49 | + * | ||
50 | + * @author SERPRO | ||
51 | + */ | ||
52 | +public enum OperationType { | ||
53 | + | ||
54 | + /** | ||
55 | + * ManagedOperation is write-only, it causes the application to change some of it's behaviour but doesn't return any | ||
56 | + * kind of information | ||
57 | + */ | ||
58 | + ACTION, | ||
59 | + | ||
60 | + /** | ||
61 | + * ManagedOperation is read-only, it will operate over data provided by the application and return some information, | ||
62 | + * but will not change the application in any way. | ||
63 | + */ | ||
64 | + INFO, | ||
65 | + | ||
66 | + /** | ||
67 | + * ManagedOperation is read-write, it will both change the way the application work and return some information | ||
68 | + * regarding the result of the operation. | ||
69 | + */ | ||
70 | + ACTION_INFO, | ||
71 | + | ||
72 | + /** | ||
73 | + * The effect of calling this operation is unknown. This is the default type and if this type is assigned to an | ||
74 | + * operation, the user must rely on the {@link ManagedOperation#description()} attribute to learn about how the | ||
75 | + * operation works. | ||
76 | + */ | ||
77 | + UNKNOWN | ||
78 | +} |