Commit b62e37a3d5dfa50a78961e4c7f306d234621bd5d
Exists in
master
Merge branch '2.4.0' of git@github.com:demoiselle/framework.git into 2.4.0
Showing
11 changed files
with
21 additions
and
27 deletions
Show diff stats
documentation/reference/pt-BR/properties.xml
| @@ -276,28 +276,28 @@ | @@ -276,28 +276,28 @@ | ||
| 276 | </thead> | 276 | </thead> |
| 277 | <tbody> | 277 | <tbody> |
| 278 | <row valign="top"> | 278 | <row valign="top"> |
| 279 | - <entry role="">frameworkdemoiselle.​management.​jmx.​mbean.​domain</entry> | 279 | + <entry role="">frameworkdemoiselle.​management.​mbean.​domain</entry> |
| 280 | <entry> | 280 | <entry> |
| 281 | <para>Define o domínio padrão onde classes anotadas com <emphasis>@ManagementController</emphasis> serão registradas no MBeanServer.</para> | 281 | <para>Define o domínio padrão onde classes anotadas com <emphasis>@ManagementController</emphasis> serão registradas no MBeanServer.</para> |
| 282 | <para>Na especificação JMX, um MBean é registrado no MBeanServer com um nome no formato <emphasis>domain:name=MBeanName</emphasis> | 282 | <para>Na especificação JMX, um MBean é registrado no MBeanServer com um nome no formato <emphasis>domain:name=MBeanName</emphasis> |
| 283 | - (ex: <emphasis>br.​gov.​frameworkdemoiselle.​jmx.​name=NotificationBroadcaster</emphasis>). Esse parâmetro controla a porção <emphasis>domain</emphasis> | 283 | + (ex: <emphasis>br.​gov.​frameworkdemoiselle:​name=NotificationBroadcaster</emphasis>). Esse parâmetro controla a porção <emphasis>domain</emphasis> |
| 284 | desse formato.</para> | 284 | desse formato.</para> |
| 285 | </entry> | 285 | </entry> |
| 286 | <entry>O pacote da classe anotada com <emphasis>@Management​Controller</emphasis></entry> | 286 | <entry>O pacote da classe anotada com <emphasis>@Management​Controller</emphasis></entry> |
| 287 | </row> | 287 | </row> |
| 288 | <row valign="top"> | 288 | <row valign="top"> |
| 289 | - <entry colsep="1">frameworkdemoiselle.​management.​jmx.​notification.​domain</entry> | 289 | + <entry colsep="1">frameworkdemoiselle.​management.​notification.​domain</entry> |
| 290 | <entry colsep="1"> | 290 | <entry colsep="1"> |
| 291 | - <para>O mesmo que <emphasis>frameworkdemoiselle.​management.​jmx.​mbean.​domain</emphasis>, mas apenas para o domínio do | ||
| 292 | - MBean <emphasis role="bold">br.​gov.​frameworkdemoiselle.​jmx.​internal.​NotificationBroadcaster</emphasis>. Esse MBean é automaticamente | 291 | + <para>O mesmo que <emphasis>frameworkdemoiselle.​management.​mbean.​domain</emphasis>, mas apenas para o domínio do |
| 292 | + MBean <emphasis role="bold">br.​gov.​frameworkdemoiselle.​internal.​NotificationBroadcaster</emphasis>. Esse MBean é automaticamente | ||
| 293 | registrado para receber notificações enviadas usando a classe <emphasis role="bold">br.​gov.​frameworkdemoiselle.​management.​NotificationManager</emphasis></para> | 293 | registrado para receber notificações enviadas usando a classe <emphasis role="bold">br.​gov.​frameworkdemoiselle.​management.​NotificationManager</emphasis></para> |
| 294 | </entry> | 294 | </entry> |
| 295 | <entry>br.​gov.​frameworkdemoiselle.​jmx</entry> | 295 | <entry>br.​gov.​frameworkdemoiselle.​jmx</entry> |
| 296 | </row> | 296 | </row> |
| 297 | <row valign="top"> | 297 | <row valign="top"> |
| 298 | - <entry>frameworkdemoiselle.​management.​jmx.​notification.​name</entry> | 298 | + <entry>frameworkdemoiselle.​management.​notification.​name</entry> |
| 299 | <entry> | 299 | <entry> |
| 300 | - <para>O nome usado para registrar a classe <emphasis role="bold">br.​gov.​frameworkdemoiselle.​jmx.​internal.​NotificationBroadcaster</emphasis> como MBean.</para> | 300 | + <para>O nome usado para registrar a classe <emphasis role="bold">br.​gov.​frameworkdemoiselle.​internal.​NotificationBroadcaster</emphasis> como MBean.</para> |
| 301 | </entry> | 301 | </entry> |
| 302 | <entry>Notification​Broadcaster</entry> | 302 | <entry>Notification​Broadcaster</entry> |
| 303 | </row> | 303 | </row> |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/CustomContextBootstrap.java
| @@ -6,6 +6,7 @@ import java.util.List; | @@ -6,6 +6,7 @@ import java.util.List; | ||
| 6 | import javax.enterprise.event.Observes; | 6 | import javax.enterprise.event.Observes; |
| 7 | import javax.enterprise.inject.spi.AfterBeanDiscovery; | 7 | import javax.enterprise.inject.spi.AfterBeanDiscovery; |
| 8 | import javax.enterprise.inject.spi.Extension; | 8 | import javax.enterprise.inject.spi.Extension; |
| 9 | +import javax.enterprise.inject.spi.ProcessAnnotatedType; | ||
| 9 | 10 | ||
| 10 | import br.gov.frameworkdemoiselle.context.CustomContext; | 11 | import br.gov.frameworkdemoiselle.context.CustomContext; |
| 11 | import br.gov.frameworkdemoiselle.context.StaticContext; | 12 | import br.gov.frameworkdemoiselle.context.StaticContext; |
| @@ -26,6 +27,13 @@ public class CustomContextBootstrap implements Extension{ | @@ -26,6 +27,13 @@ public class CustomContextBootstrap implements Extension{ | ||
| 26 | 27 | ||
| 27 | private List<CustomContext> contexts; | 28 | private List<CustomContext> contexts; |
| 28 | 29 | ||
| 30 | + public <T extends CustomContext> void vetoCustomContexts(@Observes ProcessAnnotatedType<T> event){ | ||
| 31 | + //Veta os subtipos de CustomContext, para que não conflitem com o produtor de contextos personalizados. | ||
| 32 | + if( CustomContext.class.isAssignableFrom( event.getAnnotatedType().getJavaClass() )){ | ||
| 33 | + event.veto(); | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 29 | public void initializeContexts(@Observes AfterBeanDiscovery event){ | 37 | public void initializeContexts(@Observes AfterBeanDiscovery event){ |
| 30 | //Cadastra os contextos contidos no demoiselle-core | 38 | //Cadastra os contextos contidos no demoiselle-core |
| 31 | if (contexts==null || contexts.isEmpty()){ | 39 | if (contexts==null || contexts.isEmpty()){ |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/StaticContextImpl.java
| @@ -48,8 +48,6 @@ | @@ -48,8 +48,6 @@ | ||
| 48 | */ | 48 | */ |
| 49 | package br.gov.frameworkdemoiselle.internal.context; | 49 | package br.gov.frameworkdemoiselle.internal.context; |
| 50 | 50 | ||
| 51 | -import javax.enterprise.inject.Alternative; | ||
| 52 | - | ||
| 53 | import br.gov.frameworkdemoiselle.annotation.Priority; | 51 | import br.gov.frameworkdemoiselle.annotation.Priority; |
| 54 | import br.gov.frameworkdemoiselle.annotation.StaticScoped; | 52 | import br.gov.frameworkdemoiselle.annotation.StaticScoped; |
| 55 | import br.gov.frameworkdemoiselle.context.StaticContext; | 53 | import br.gov.frameworkdemoiselle.context.StaticContext; |
| @@ -63,7 +61,6 @@ import br.gov.frameworkdemoiselle.context.StaticContext; | @@ -63,7 +61,6 @@ import br.gov.frameworkdemoiselle.context.StaticContext; | ||
| 63 | * | 61 | * |
| 64 | */ | 62 | */ |
| 65 | @Priority(Priority.MIN_PRIORITY) | 63 | @Priority(Priority.MIN_PRIORITY) |
| 66 | -@Alternative | ||
| 67 | public class StaticContextImpl extends AbstractStaticContext implements StaticContext { | 64 | public class StaticContextImpl extends AbstractStaticContext implements StaticContext { |
| 68 | 65 | ||
| 69 | public StaticContextImpl() { | 66 | public StaticContextImpl() { |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/TemporaryConversationContextImpl.java
| @@ -49,7 +49,6 @@ | @@ -49,7 +49,6 @@ | ||
| 49 | package br.gov.frameworkdemoiselle.internal.context; | 49 | package br.gov.frameworkdemoiselle.internal.context; |
| 50 | 50 | ||
| 51 | import javax.enterprise.context.ConversationScoped; | 51 | import javax.enterprise.context.ConversationScoped; |
| 52 | -import javax.enterprise.inject.Alternative; | ||
| 53 | 52 | ||
| 54 | import br.gov.frameworkdemoiselle.annotation.Priority; | 53 | import br.gov.frameworkdemoiselle.annotation.Priority; |
| 55 | import br.gov.frameworkdemoiselle.context.ConversationContext; | 54 | import br.gov.frameworkdemoiselle.context.ConversationContext; |
| @@ -65,7 +64,6 @@ import br.gov.frameworkdemoiselle.context.ConversationContext; | @@ -65,7 +64,6 @@ import br.gov.frameworkdemoiselle.context.ConversationContext; | ||
| 65 | * | 64 | * |
| 66 | */ | 65 | */ |
| 67 | @Priority(Priority.MIN_PRIORITY) | 66 | @Priority(Priority.MIN_PRIORITY) |
| 68 | -@Alternative | ||
| 69 | public class TemporaryConversationContextImpl extends AbstractStaticContext implements ConversationContext { | 67 | public class TemporaryConversationContextImpl extends AbstractStaticContext implements ConversationContext { |
| 70 | 68 | ||
| 71 | public TemporaryConversationContextImpl() { | 69 | public TemporaryConversationContextImpl() { |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/TemporaryRequestContextImpl.java
| @@ -49,7 +49,6 @@ | @@ -49,7 +49,6 @@ | ||
| 49 | package br.gov.frameworkdemoiselle.internal.context; | 49 | package br.gov.frameworkdemoiselle.internal.context; |
| 50 | 50 | ||
| 51 | import javax.enterprise.context.RequestScoped; | 51 | import javax.enterprise.context.RequestScoped; |
| 52 | -import javax.enterprise.inject.Alternative; | ||
| 53 | 52 | ||
| 54 | import br.gov.frameworkdemoiselle.annotation.Priority; | 53 | import br.gov.frameworkdemoiselle.annotation.Priority; |
| 55 | import br.gov.frameworkdemoiselle.context.RequestContext; | 54 | import br.gov.frameworkdemoiselle.context.RequestContext; |
| @@ -65,7 +64,6 @@ import br.gov.frameworkdemoiselle.context.RequestContext; | @@ -65,7 +64,6 @@ import br.gov.frameworkdemoiselle.context.RequestContext; | ||
| 65 | * | 64 | * |
| 66 | */ | 65 | */ |
| 67 | @Priority(Priority.MIN_PRIORITY) | 66 | @Priority(Priority.MIN_PRIORITY) |
| 68 | -@Alternative | ||
| 69 | public class TemporaryRequestContextImpl extends AbstractThreadLocalContext implements RequestContext { | 67 | public class TemporaryRequestContextImpl extends AbstractThreadLocalContext implements RequestContext { |
| 70 | 68 | ||
| 71 | public TemporaryRequestContextImpl() { | 69 | public TemporaryRequestContextImpl() { |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/TemporarySessionContextImpl.java
| @@ -49,7 +49,6 @@ | @@ -49,7 +49,6 @@ | ||
| 49 | package br.gov.frameworkdemoiselle.internal.context; | 49 | package br.gov.frameworkdemoiselle.internal.context; |
| 50 | 50 | ||
| 51 | import javax.enterprise.context.SessionScoped; | 51 | import javax.enterprise.context.SessionScoped; |
| 52 | -import javax.enterprise.inject.Alternative; | ||
| 53 | 52 | ||
| 54 | import br.gov.frameworkdemoiselle.annotation.Priority; | 53 | import br.gov.frameworkdemoiselle.annotation.Priority; |
| 55 | import br.gov.frameworkdemoiselle.context.SessionContext; | 54 | import br.gov.frameworkdemoiselle.context.SessionContext; |
| @@ -66,7 +65,6 @@ import br.gov.frameworkdemoiselle.context.SessionContext; | @@ -66,7 +65,6 @@ import br.gov.frameworkdemoiselle.context.SessionContext; | ||
| 66 | * | 65 | * |
| 67 | */ | 66 | */ |
| 68 | @Priority(Priority.MIN_PRIORITY) | 67 | @Priority(Priority.MIN_PRIORITY) |
| 69 | -@Alternative | ||
| 70 | public class TemporarySessionContextImpl extends AbstractStaticContext implements SessionContext { | 68 | public class TemporarySessionContextImpl extends AbstractStaticContext implements SessionContext { |
| 71 | 69 | ||
| 72 | public TemporarySessionContextImpl() { | 70 | public TemporarySessionContextImpl() { |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/context/TemporaryViewContextImpl.java
| @@ -48,8 +48,6 @@ | @@ -48,8 +48,6 @@ | ||
| 48 | */ | 48 | */ |
| 49 | package br.gov.frameworkdemoiselle.internal.context; | 49 | package br.gov.frameworkdemoiselle.internal.context; |
| 50 | 50 | ||
| 51 | -import javax.enterprise.inject.Alternative; | ||
| 52 | - | ||
| 53 | import br.gov.frameworkdemoiselle.annotation.Priority; | 51 | import br.gov.frameworkdemoiselle.annotation.Priority; |
| 54 | import br.gov.frameworkdemoiselle.annotation.ViewScoped; | 52 | import br.gov.frameworkdemoiselle.annotation.ViewScoped; |
| 55 | import br.gov.frameworkdemoiselle.context.ViewContext; | 53 | import br.gov.frameworkdemoiselle.context.ViewContext; |
| @@ -65,7 +63,6 @@ import br.gov.frameworkdemoiselle.context.ViewContext; | @@ -65,7 +63,6 @@ import br.gov.frameworkdemoiselle.context.ViewContext; | ||
| 65 | * | 63 | * |
| 66 | */ | 64 | */ |
| 67 | @Priority(Priority.MIN_PRIORITY) | 65 | @Priority(Priority.MIN_PRIORITY) |
| 68 | -@Alternative | ||
| 69 | public class TemporaryViewContextImpl extends AbstractThreadLocalContext implements ViewContext { | 66 | public class TemporaryViewContextImpl extends AbstractThreadLocalContext implements ViewContext { |
| 70 | 67 | ||
| 71 | public TemporaryViewContextImpl() { | 68 | public TemporaryViewContextImpl() { |
impl/extension/jmx/src/main/java/br/gov/frameworkdemoiselle/internal/configuration/JMXConfig.java
| @@ -65,7 +65,7 @@ import br.gov.frameworkdemoiselle.stereotype.ManagementController; | @@ -65,7 +65,7 @@ import br.gov.frameworkdemoiselle.stereotype.ManagementController; | ||
| 65 | * @author serpro | 65 | * @author serpro |
| 66 | * | 66 | * |
| 67 | */ | 67 | */ |
| 68 | -@Configuration(prefix = "frameworkdemoiselle.management.jmx") | 68 | +@Configuration(prefix = "frameworkdemoiselle.management") |
| 69 | public class JMXConfig { | 69 | public class JMXConfig { |
| 70 | 70 | ||
| 71 | @Name("mbean.domain") | 71 | @Name("mbean.domain") |
impl/extension/jmx/src/test/java/management/tests/basic/DynamicMBeanProxyTest.java
| @@ -105,7 +105,7 @@ public class DynamicMBeanProxyTest { | @@ -105,7 +105,7 @@ public class DynamicMBeanProxyTest { | ||
| 105 | 105 | ||
| 106 | ObjectName name = null; | 106 | ObjectName name = null; |
| 107 | try { | 107 | try { |
| 108 | - name = new ObjectName("br.gov.frameworkdemoiselle.jmx.domain:name=ManagedTest"); | 108 | + name = new ObjectName("br.gov.frameworkdemoiselle.domain:name=ManagedTest"); |
| 109 | } catch (MalformedObjectNameException e) { | 109 | } catch (MalformedObjectNameException e) { |
| 110 | Assert.fail(); | 110 | Assert.fail(); |
| 111 | } | 111 | } |
| @@ -125,7 +125,7 @@ public class DynamicMBeanProxyTest { | @@ -125,7 +125,7 @@ public class DynamicMBeanProxyTest { | ||
| 125 | 125 | ||
| 126 | ObjectName name = null; | 126 | ObjectName name = null; |
| 127 | try { | 127 | try { |
| 128 | - name = new ObjectName("br.gov.frameworkdemoiselle.jmx.domain:name=ManagedTest"); | 128 | + name = new ObjectName("br.gov.frameworkdemoiselle.domain:name=ManagedTest"); |
| 129 | } catch (MalformedObjectNameException e) { | 129 | } catch (MalformedObjectNameException e) { |
| 130 | Assert.fail(); | 130 | Assert.fail(); |
| 131 | } | 131 | } |
| @@ -149,7 +149,7 @@ public class DynamicMBeanProxyTest { | @@ -149,7 +149,7 @@ public class DynamicMBeanProxyTest { | ||
| 149 | 149 | ||
| 150 | ObjectName name = null; | 150 | ObjectName name = null; |
| 151 | try { | 151 | try { |
| 152 | - name = new ObjectName("br.gov.frameworkdemoiselle.jmx.domain:name=ManagedTest"); | 152 | + name = new ObjectName("br.gov.frameworkdemoiselle.domain:name=ManagedTest"); |
| 153 | } catch (MalformedObjectNameException e) { | 153 | } catch (MalformedObjectNameException e) { |
| 154 | Assert.fail(); | 154 | Assert.fail(); |
| 155 | } | 155 | } |
| @@ -172,7 +172,7 @@ public class DynamicMBeanProxyTest { | @@ -172,7 +172,7 @@ public class DynamicMBeanProxyTest { | ||
| 172 | 172 | ||
| 173 | ObjectName name = null; | 173 | ObjectName name = null; |
| 174 | try { | 174 | try { |
| 175 | - name = new ObjectName("br.gov.frameworkdemoiselle.jmx.domain:name=ManagedTest"); | 175 | + name = new ObjectName("br.gov.frameworkdemoiselle.domain:name=ManagedTest"); |
| 176 | } catch (MalformedObjectNameException e) { | 176 | } catch (MalformedObjectNameException e) { |
| 177 | Assert.fail(); | 177 | Assert.fail(); |
| 178 | } | 178 | } |
impl/extension/jmx/src/test/resources/configuration/demoiselle.properties
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/context/FacesViewContextImpl.java
| @@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.context; | @@ -38,7 +38,6 @@ package br.gov.frameworkdemoiselle.internal.context; | ||
| 38 | 38 | ||
| 39 | import java.util.Map; | 39 | import java.util.Map; |
| 40 | 40 | ||
| 41 | -import javax.enterprise.inject.Alternative; | ||
| 42 | import javax.faces.component.UIViewRoot; | 41 | import javax.faces.component.UIViewRoot; |
| 43 | import javax.faces.context.FacesContext; | 42 | import javax.faces.context.FacesContext; |
| 44 | 43 | ||
| @@ -57,7 +56,6 @@ import br.gov.frameworkdemoiselle.util.Faces; | @@ -57,7 +56,6 @@ import br.gov.frameworkdemoiselle.util.Faces; | ||
| 57 | * | 56 | * |
| 58 | */ | 57 | */ |
| 59 | @Priority(Priority.L2_PRIORITY) | 58 | @Priority(Priority.L2_PRIORITY) |
| 60 | -@Alternative | ||
| 61 | public class FacesViewContextImpl extends AbstractCustomContext implements ViewContext { | 59 | public class FacesViewContextImpl extends AbstractCustomContext implements ViewContext { |
| 62 | 60 | ||
| 63 | public FacesViewContextImpl() { | 61 | public FacesViewContextImpl() { |