Commit 049fee27b3e13e4890cd9d70db5aca8b3909fc68
1 parent
3d521f08
Exists in
master
Correção de bug na ativação dos contextos para o Shutdown
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/bootstrap/ShutdownBootstrap.java
@@ -67,6 +67,8 @@ public class ShutdownBootstrap extends AbstractBootstrap { | @@ -67,6 +67,8 @@ public class ShutdownBootstrap extends AbstractBootstrap { | ||
67 | private static final Class<? extends Annotation> annotationClass = Shutdown.class; | 67 | private static final Class<? extends Annotation> annotationClass = Shutdown.class; |
68 | 68 | ||
69 | private static final List<CustomContext> tempContexts = new ArrayList<CustomContext>(); | 69 | private static final List<CustomContext> tempContexts = new ArrayList<CustomContext>(); |
70 | + | ||
71 | + private static AfterBeanDiscovery abdEvent; | ||
70 | 72 | ||
71 | @SuppressWarnings("rawtypes") | 73 | @SuppressWarnings("rawtypes") |
72 | private static final List<ShutdownProcessor> processors = Collections | 74 | private static final List<ShutdownProcessor> processors = Collections |
@@ -97,10 +99,7 @@ public class ShutdownBootstrap extends AbstractBootstrap { | @@ -97,10 +99,7 @@ public class ShutdownBootstrap extends AbstractBootstrap { | ||
97 | tempContexts.add(new ThreadLocalContext(SessionScoped.class, false)); | 99 | tempContexts.add(new ThreadLocalContext(SessionScoped.class, false)); |
98 | tempContexts.add(new ThreadLocalContext(ConversationScoped.class)); | 100 | tempContexts.add(new ThreadLocalContext(ConversationScoped.class)); |
99 | tempContexts.add(new ThreadLocalContext(RequestScoped.class)); | 101 | tempContexts.add(new ThreadLocalContext(RequestScoped.class)); |
100 | - | ||
101 | - for (CustomContext tempContext : tempContexts) { | ||
102 | - addContext(tempContext, event); | ||
103 | - } | 102 | + abdEvent = event; |
104 | } | 103 | } |
105 | 104 | ||
106 | /** | 105 | /** |
@@ -114,6 +113,10 @@ public class ShutdownBootstrap extends AbstractBootstrap { | @@ -114,6 +113,10 @@ public class ShutdownBootstrap extends AbstractBootstrap { | ||
114 | Collections.sort(processors); | 113 | Collections.sort(processors); |
115 | Throwable failure = null; | 114 | Throwable failure = null; |
116 | 115 | ||
116 | + for (CustomContext tempContext : tempContexts) { | ||
117 | + addContext(tempContext, abdEvent); | ||
118 | + } | ||
119 | + | ||
117 | for (Iterator<ShutdownProcessor> iter = processors.iterator(); iter.hasNext();) { | 120 | for (Iterator<ShutdownProcessor> iter = processors.iterator(); iter.hasNext();) { |
118 | ShutdownProcessor processor = iter.next(); | 121 | ShutdownProcessor processor = iter.next(); |
119 | 122 |