diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Ignore.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Ignore.java index 498742f..d83e0e9 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Ignore.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/Ignore.java @@ -42,7 +42,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; -@Target(FIELD) +@Target(FIELD) @Retention(RUNTIME) public @interface Ignore { } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedOperation.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedOperation.java index f31e2dc..2c28e1c 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedOperation.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedOperation.java @@ -47,24 +47,28 @@ import javax.enterprise.util.Nonbinding; import br.gov.frameworkdemoiselle.DemoiselleException; /** - *
Indicates that a method is a managed operation, meaning you can manage some aspect of the application by calling it from a external management client.
- *This annotation can't be used together with {@link ManagedProperty}, doing so will throw a {@link DemoiselleException}.
+ *+ * Indicates that a method is a managed operation, meaning you can manage some aspect of the application by + * calling it from a external management client. + *
+ *+ * This annotation can't be used together with {@link ManagedProperty}, doing so will throw a + * {@link DemoiselleException}. + *
* * @author SERPRO - * */ @Documented -@Target({ElementType.METHOD}) +@Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface ManagedOperation { - + /** - * Description that will be used to publish the operation to clients. - * Defaults to an empty description. + * Description that will be used to publish the operation to clients. Defaults to an empty description. */ @Nonbinding String description() default ""; - + /** * Type of operation. Defaults to {@link OperationType#UNKNOWN}. */ diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedProperty.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedProperty.java index 7589345..4d46eb0 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedProperty.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/ManagedProperty.java @@ -45,57 +45,65 @@ import java.lang.annotation.Target; import javax.enterprise.util.Nonbinding; /** - *Indicates that a field must be exposed as a property to management clients.
- *The property will be writable if there's a public setter method - * declared for the field and readable if there's a getter method. You can override this behaviour by passing a value - * to the {@link #accessLevel()} property.
- *It's a runtime error to annotate a field with no getter and no setter method.
- *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 operation using the {@link ManagedOperation} annotation.
+ *+ * Indicates that a field must be exposed as a property to management clients. + *
+ *+ * The property will be writable if there's a public setter method declared for the field and readable if there's a + * getter method. You can override this behaviour by passing a value to the {@link #accessLevel()} property. + *
+ *+ * It's a runtime error to annotate a field with no getter and no setter method. + *
+ *+ * 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 + * operation using the {@link ManagedOperation} annotation. + *
* * @author SERPRO - * */ @Documented -@Target({ElementType.FIELD}) +@Target({ ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface ManagedProperty { - + /** * @return The description of this property exposed to management clients. */ @Nonbinding String description() default ""; - + @Nonbinding ManagedPropertyAccess accessLevel() default ManagedPropertyAccess.DEFAULT; - + /** - *Access level of a managed property.
- * - *These values only affect access via external management clients, the application is still able to inject and use the normal visibility of the property - * by Java standards.
+ *+ * Access level of a managed property. + *
+ *+ * These values only affect access via external management clients, the application is still able to inject and use + * the normal visibility of the property by Java standards. + *
* * @author serpro - * */ - enum ManagedPropertyAccess{ - + enum ManagedPropertyAccess { + /** * Restricts a property to be only readable even if a setter method exists. */ READ_ONLY - + /** * Restricts a property to be only writeable even if a getter method exists. */ - ,WRITE_ONLY - + , WRITE_ONLY + /** - * Says that the read or write access will - * be determined by the presence of a getter method(getProperty())
or setter method (setProperty(propertyValue))
for a property.
+ * Says that the read or write access will be determined by the presence of a getter method
+ * (getProperty())
or setter method (setProperty(propertyValue))
for a property.
*/
- ,DEFAULT;
+ , DEFAULT;
}
}
diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationParameter.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationParameter.java
index c010568..b35e6c8 100644
--- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationParameter.java
+++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationParameter.java
@@ -45,29 +45,31 @@ import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
/**
- * Optional annotation to write additional detail about an operation's parameter.
- *This annotation is ignored for non-operation methods.
+ *+ * Optional annotation to write additional detail about an operation's parameter. + *
+ *+ * This annotation is ignored for non-operation methods. + *
* * @author SERPRO - * */ @Documented -@Target({ElementType.PARAMETER}) +@Target({ ElementType.PARAMETER }) @Retention(RetentionPolicy.RUNTIME) public @interface OperationParameter { - + /** * Name that will be used to publish this operation's parameter to clients. */ @Nonbinding String name(); - + /** - * Optional description that will be used to publish this operation's parameter to clients. - * Defaults to an empty description. + * Optional description that will be used to publish this operation's parameter to clients. Defaults to an empty + * description. */ @Nonbinding String description() default ""; - } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationType.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationType.java index 2df9ea4..f6d257c 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationType.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/annotation/OperationType.java @@ -38,52 +38,50 @@ package br.gov.frameworkdemoiselle.annotation; import javax.management.MBeanOperationInfo; - /** - *Define the operation type for an operation inside a ManagementController class.
- * - *This is an optional annotation and it's significanse will change based on the management extension - * used. Most extensions will just publish this information to the client so it can better show to the user the inner - * workings of the annotated operation.
- * + *+ * Define the operation type for an operation inside a ManagementController class. + *
+ *+ * This is an optional annotation and it's significanse will change based on the management extension used. Most + * extensions will just publish this information to the client so it can better show to the user the inner workings of + * the annotated operation. + *
* * @author SERPRO - * */ public enum OperationType { - + /** - * ManagedOperation is write-only, it causes the application - * to change some of it's behaviour but doesn't return any kind of information + * ManagedOperation is write-only, it causes the application to change some of it's behaviour but doesn't return any + * kind of information */ - ACTION(MBeanOperationInfo.ACTION) - , + ACTION(MBeanOperationInfo.ACTION), /** * ManagedOperation is read-only, it will operate over data provided by the application and return some information, * but will not change the application in any way. */ - INFO(MBeanOperationInfo.INFO) - , + INFO(MBeanOperationInfo.INFO), /** - * ManagedOperation is read-write, it will both change the way the application work and return some information regarding - * the result of the operation. + * ManagedOperation is read-write, it will both change the way the application work and return some information + * regarding the result of the operation. */ - ACTION_INFO(MBeanOperationInfo.ACTION_INFO) - , + ACTION_INFO(MBeanOperationInfo.ACTION_INFO), /** - * The effect of calling this operation is unknown. This is the default type and if this type is assigned to an operation, - * the user must rely on the {@link ManagedOperation#description()} attribute to learn about how the operation works. + * The effect of calling this operation is unknown. This is the default type and if this type is assigned to an + * operation, the user must rely on the {@link ManagedOperation#description()} attribute to learn about how the + * operation works. */ UNKNOWN(MBeanOperationInfo.UNKNOWN); - + private int operationTypeValue; - - private OperationType(int type){ + + private OperationType(int type) { this.operationTypeValue = type; } - - public int getValue(){ + + public int getValue() { return operationTypeValue; } - + } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/configuration/ConfigType.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/configuration/ConfigType.java index 648cf91..1091c5a 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/configuration/ConfigType.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/configuration/ConfigType.java @@ -57,5 +57,5 @@ public enum ConfigType { * Configuration loaded on properties resources. */ PROPERTIES; - + } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/exception/ExceptionHandlerInterceptor.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/exception/ExceptionHandlerInterceptor.java index c9abc6b..5253a33 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/exception/ExceptionHandlerInterceptor.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/exception/ExceptionHandlerInterceptor.java @@ -52,9 +52,9 @@ import javax.interceptor.InvocationContext; import org.slf4j.Logger; import br.gov.frameworkdemoiselle.DemoiselleException; -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; -import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; import br.gov.frameworkdemoiselle.stereotype.Controller; +import br.gov.frameworkdemoiselle.util.Beans; +import br.gov.frameworkdemoiselle.util.NameQualifier; import br.gov.frameworkdemoiselle.util.ResourceBundle; @Interceptor @@ -63,9 +63,9 @@ public class ExceptionHandlerInterceptor implements Serializable { private static final long serialVersionUID = 1L; - private static ResourceBundle bundle; + private static transient ResourceBundle bundle; - private static Logger logger; + private static transient Logger logger; private final Map@@ -105,9 +106,9 @@ public class ContextManager { } ContextManager.getLogger().trace( - ContextManager.getBundle().getString("bootstrap-context-added", - context.getClass().getCanonicalName(), context.getScope().getCanonicalName())); - + ContextManager.getBundle().getString("bootstrap-context-added", context.getClass().getCanonicalName(), + context.getScope().getCanonicalName())); + context.setActive(false); event.addContext(context); contexts.add(new CustomContextCounter(context)); @@ -194,8 +195,10 @@ public class ContextManager { } /** - *
This method should be called when the application is shutting down, usually by observing - * the {@link BeforeShutdown} event.
+ *+ * This method should be called when the application is shutting down, usually by observing the + * {@link BeforeShutdown} event. + *
*/ public static synchronized void shutdown() { for (CustomContextCounter context : contexts) { @@ -252,7 +255,7 @@ class CustomContextCounter { public CustomContext getInternalContext() { return this.context; } - + public void setInternalContext(CustomContext context) { this.context = context; } @@ -261,19 +264,14 @@ class CustomContextCounter { try { BeanManager beanManager = Beans.getReference(BeanManager.class); Context c = beanManager.getContext(context.getScope()); - - + if (c == context) { activationCounter++; - } - else{ + } else { ContextManager.getLogger().trace( ContextManager.getBundle().getString("custom-context-already-activated", - context.getClass().getCanonicalName() - ,c.getScope().getCanonicalName() - ,c.getClass().getCanonicalName() - ) - ); + context.getClass().getCanonicalName(), c.getScope().getCanonicalName(), + c.getClass().getCanonicalName())); } } catch (ContextNotActiveException ce) { context.setActive(true); @@ -299,10 +297,10 @@ class CustomContextCounter { } catch (ContextNotActiveException ce) { } } - + public synchronized void shutdown() { context.setActive(false); - context=null; - activationCounter=0; + context = null; + activationCounter = 0; } } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ManagedContext.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ManagedContext.java index e07590c..404069e 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ManagedContext.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ManagedContext.java @@ -5,14 +5,13 @@ import javax.enterprise.context.RequestScoped; import br.gov.frameworkdemoiselle.stereotype.ManagementController; /** - * Context that stores {@link RequestScoped} beans during client calls to {@link ManagementController} classes. - * This context is only activated when no other context is active for {@link RequestScoped}. + * Context that stores {@link RequestScoped} beans during client calls to {@link ManagementController} classes. This + * context is only activated when no other context is active for {@link RequestScoped}. * * @author serpro - * */ public class ManagedContext extends ThreadLocalContext { - + /** * Constructs a new context. */ diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ThreadLocalContext.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ThreadLocalContext.java index 11ac567..b47bb60 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ThreadLocalContext.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/ThreadLocalContext.java @@ -51,10 +51,9 @@ package br.gov.frameworkdemoiselle.internal.context; import java.lang.annotation.Annotation; /** - * Base context that has a separated store for each thread + * Base context that has a separated store for each thread * * @author serpro - * */ public class ThreadLocalContext extends AbstractCustomContext { diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionContextImpl.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionContextImpl.java index 22953bb..55be8bc 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionContextImpl.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionContextImpl.java @@ -55,7 +55,8 @@ public class TransactionContextImpl implements TransactionContext { private Transaction transaction; - private Transaction getTransaction() { + @Override + public Transaction getCurrentTransaction() { if (this.transaction == null) { Class extends Transaction> clazz = getConfig().getTransactionClass(); @@ -69,11 +70,6 @@ public class TransactionContextImpl implements TransactionContext { return this.transaction; } - @Override - public Transaction getCurrentTransaction() { - return getTransaction(); - } - private TransactionConfig getConfig() { return Beans.getReference(TransactionConfig.class); } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java index 2bced44..1d318e0 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/ExceptionHandlerInterceptor.java @@ -57,7 +57,7 @@ public class ExceptionHandlerInterceptor extends br.gov.frameworkdemoiselle.exce @Inject private Logger logger; - + @Override @AroundInvoke public Object manage(InvocationContext ic) throws Exception { @@ -65,4 +65,3 @@ public class ExceptionHandlerInterceptor extends br.gov.frameworkdemoiselle.exce return super.manage(ic); } } - diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/Slf4jLoggerProxy.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/Slf4jLoggerProxy.java index 504da1c..30e4c64 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/Slf4jLoggerProxy.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/Slf4jLoggerProxy.java @@ -61,12 +61,12 @@ public class Slf4jLoggerProxy implements Logger, Serializable { private transient Logger delegate; private final Class> type; - + private Logger getDelegate() { - if(delegate == null) { + if (delegate == null) { delegate = LoggerFactory.getLogger(type); } - + return delegate; } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/ManagementExtension.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/ManagementExtension.java index ed8abf7..afe0cc8 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/ManagementExtension.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/ManagementExtension.java @@ -42,34 +42,36 @@ import br.gov.frameworkdemoiselle.internal.management.ManagedType; import br.gov.frameworkdemoiselle.stereotype.ManagementController; /** - * - *Interface defining the lifecycle of a management extension, an extension - * capable of exposing {@link ManagementController}'s to external clients in one - * of the available management technologies, such as JMX or SNMP.
- * - *To include a management extension into the management lifecycle, it just needs - * to implement this interface and be a CDI bean (have a beans.xml file inside - * the META-INF folder of it's java package). The Demoiselle Core lifecycle controller - * will call the {@link #initialize(List managedTypes)} and {@link #shutdown(List managedTypes)} methods at the apropriate times.
+ *+ * Interface defining the lifecycle of a management extension, an extension capable of exposing + * {@link ManagementController}'s to external clients in one of the available management technologies, such as JMX or + * SNMP. + *
+ *+ * To include a management extension into the management lifecycle, it just needs to implement this interface and be a + * CDI bean (have a beans.xml file inside the META-INF folder of it's java package). The Demoiselle Core + * lifecycle controller will call the {@link #initialize(List managedTypes)} and {@link #shutdown(List managedTypes)} + * methods at the apropriate times. + *
* * @author serpro - * */ public interface ManagementExtension { /** - * This method is called during the application initialization process for each concrete - * implementation of this interface. + * This method is called during the application initialization process for each concrete implementation of this + * interface. * - * @param managedTypes The list of discovered {@link ManagementController} classes. + * @param managedTypes + * The list of discovered {@link ManagementController} classes. */ void initialize(List*
+ * *** public class Finalizer { * - * @Shutdown + * @Shutdown * @Priority(5) * public void finalize() { * ... * } * } * + * *+ * *
* diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Startup.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Startup.java index 1994f35..53cf974 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Startup.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/lifecycle/Startup.java @@ -48,17 +48,20 @@ import java.lang.annotation.Target; * Take a look at the following usage sample: *
*
+ * *** public class Finalizer { * - * @Startup + * @Startup * @Priority(1) * public void init() { * ... * } * } * + * *+ * *
* diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/Pagination.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/Pagination.java index a5b36cf..f16847c 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/Pagination.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/Pagination.java @@ -88,5 +88,5 @@ public interface Pagination { * Sets the position for the first record and hence calculates current page according to page size. */ void setFirstResult(int firstResult); - + } diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/PaginationContext.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/PaginationContext.java index f6e4519..e027abb 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/PaginationContext.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/pagination/PaginationContext.java @@ -51,7 +51,8 @@ public interface PaginationContext { /** * Retrieves the pagination according to the class type specified. * - * @param clazz a {@code Class} type + * @param clazz + * a {@code Class} type * @return Pagination */ Pagination getPagination(Class> clazz); @@ -60,8 +61,10 @@ public interface PaginationContext { * Retrieves the pagination according to the class type specified. If not existing, creates the pagination whenever * {@code create} parameter is true. * - * @param clazz a {@code Class} type - * @param create determines whether pagination must always be returned + * @param clazz + * a {@code Class} type + * @param create + * determines whether pagination must always be returned * @return Pagination */ Pagination getPagination(Class> clazz, boolean create); diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/Authenticator.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/Authenticator.java index 2ed232f..c803975 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/Authenticator.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/Authenticator.java @@ -49,7 +49,8 @@ public interface Authenticator extends Serializable { /** * Executes the necessary steps to authenticate an user. * - * @throws AuthenticationException When the authentication process fails, this exception is thrown. + * @throws AuthenticationException + * When the authentication process fails, this exception is thrown. */ void authenticate() throws AuthenticationException; diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredPermissionInterceptor.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredPermissionInterceptor.java index 188d2ae..0b674a7 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredPermissionInterceptor.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredPermissionInterceptor.java @@ -46,9 +46,8 @@ import javax.interceptor.InvocationContext; import org.slf4j.Logger; import br.gov.frameworkdemoiselle.annotation.Name; -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; -import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; import br.gov.frameworkdemoiselle.util.Beans; +import br.gov.frameworkdemoiselle.util.NameQualifier; import br.gov.frameworkdemoiselle.util.ResourceBundle; import br.gov.frameworkdemoiselle.util.Strings; @@ -63,9 +62,9 @@ public class RequiredPermissionInterceptor implements Serializable { private static final long serialVersionUID = 1L; - private static ResourceBundle bundle; + private static transient ResourceBundle bundle; - private static Logger logger; + private static transient Logger logger; /** * Gets the values for both resource and operation properties of {@code @RequiredPermission}. Delegates to @@ -168,7 +167,7 @@ public class RequiredPermissionInterceptor implements Serializable { private static ResourceBundle getBundle() { if (bundle == null) { - bundle = ResourceBundleProducer.create("demoiselle-core-bundle"); + bundle = Beans.getReference(ResourceBundle.class, new NameQualifier("demoiselle-core-bundle")); } return bundle; @@ -176,7 +175,7 @@ public class RequiredPermissionInterceptor implements Serializable { private static Logger getLogger() { if (logger == null) { - logger = LoggerProducer.create(RequiredPermissionInterceptor.class); + logger = Beans.getReference(Logger.class, new NameQualifier(RequiredPermissionInterceptor.class.getName())); } return logger; diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredRoleInterceptor.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredRoleInterceptor.java index e0da1d7..cfeabcb 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredRoleInterceptor.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/RequiredRoleInterceptor.java @@ -47,9 +47,8 @@ import javax.interceptor.InvocationContext; import org.slf4j.Logger; -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer; -import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer; import br.gov.frameworkdemoiselle.util.Beans; +import br.gov.frameworkdemoiselle.util.NameQualifier; import br.gov.frameworkdemoiselle.util.ResourceBundle; /** @@ -63,9 +62,9 @@ public class RequiredRoleInterceptor implements Serializable { private static final long serialVersionUID = 1L; - private static ResourceBundle bundle; + private static transient ResourceBundle bundle; - private static Logger logger; + private static transient Logger logger; /** * Gets the value property of {@code @RequiredRole}. Delegates to {@code SecurityContext} check role. If the user @@ -102,7 +101,6 @@ public class RequiredRoleInterceptor implements Serializable { .error(getBundle().getString("does-not-have-role", getSecurityContext().getCurrentUser().getName(), roles)); - // AuthorizationException a = new AuthorizationException(null); throw new AuthorizationException(getBundle().getString("does-not-have-role-ui", roles)); } @@ -139,7 +137,7 @@ public class RequiredRoleInterceptor implements Serializable { private static ResourceBundle getBundle() { if (bundle == null) { - bundle = ResourceBundleProducer.create("demoiselle-core-bundle"); + bundle = Beans.getReference(ResourceBundle.class, new NameQualifier("demoiselle-core-bundle")); } return bundle; @@ -147,7 +145,7 @@ public class RequiredRoleInterceptor implements Serializable { private static Logger getLogger() { if (logger == null) { - logger = LoggerProducer.create(RequiredRoleInterceptor.class); + logger = Beans.getReference(Logger.class, new NameQualifier(RequiredRoleInterceptor.class.getName())); } return logger; diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/User.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/User.java index 5280eb1..c191663 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/User.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/security/User.java @@ -41,7 +41,7 @@ import java.security.Principal; /** * @author SERPRO - * @deprecated + * @deprecated */ public interface User extends Principal, Serializable { diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/stereotype/ManagementController.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/stereotype/ManagementController.java index 89ff9b8..521545b 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/stereotype/ManagementController.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/stereotype/ManagementController.java @@ -49,17 +49,23 @@ import javax.enterprise.inject.Stereotype; import javax.enterprise.util.Nonbinding; /** - *
Identifies a management controller bean. What it means is that an external client can manage the application - * this class is in by reading or writing it's attributes and calling it's operations.
*- * Only fields annotated with {@link br.gov.frameworkdemoiselle.annotation.ManagedProperty} or - * methods annotated with {@link br.gov.frameworkdemoiselle.annotation.ManagedOperation} will be exposed - * to clients.
- *Only bean implementations (concrete classes) can be management controllers. It's a runtime error to mark an interface - * or abstract class with this annotation.
- *This stereotype only defines a class as managed, you need to choose an extension that will expose this managed class + * Identifies a management controller bean. What it means is that an external client can manage the application + * this class is in by reading or writing it's attributes and calling it's operations. + *
+ *+ * Only fields annotated with {@link br.gov.frameworkdemoiselle.annotation.ManagedProperty} or methods annotated with + * {@link br.gov.frameworkdemoiselle.annotation.ManagedOperation} will be exposed to clients. + *
+ *+ * Only bean implementations (concrete classes) can be management controllers. It's a runtime error to mark an interface + * or abstract class with this annotation. + *
+ *+ * This stereotype only defines a class as managed, you need to choose an extension that will expose this managed class * to external clients using any technology available. One example is the Demoiselle JMX extension, that will expose - * managed classes as MBeans.
+ * managed classes as MBeans. + * * * @author SERPRO */ @@ -71,7 +77,7 @@ import javax.enterprise.util.Nonbinding; @Retention(RUNTIME) @Target({ TYPE }) public @interface ManagementController { - + /** * @return Human readable description of this managed class. */ diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/Crud.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/Crud.java index 9966e9b..3a39fd4 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/Crud.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/Crud.java @@ -43,16 +43,18 @@ import java.util.List; * Interface containing basic methods for creating, updating and deleting entities (the CRUD design pattern). * * @author serpro - * - * @param