Commit 59d68134f982a86fe8d162fe14b9bbb28945d60f
Exists in
master
Merge branch '2.3' of git@github.com:demoiselle/framework.git into 2.3
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 | 67 | private static final Class<? extends Annotation> annotationClass = Shutdown.class; |
| 68 | 68 | |
| 69 | 69 | private static final List<CustomContext> tempContexts = new ArrayList<CustomContext>(); |
| 70 | + | |
| 71 | + private static AfterBeanDiscovery abdEvent; | |
| 70 | 72 | |
| 71 | 73 | @SuppressWarnings("rawtypes") |
| 72 | 74 | private static final List<ShutdownProcessor> processors = Collections |
| ... | ... | @@ -97,10 +99,7 @@ public class ShutdownBootstrap extends AbstractBootstrap { |
| 97 | 99 | tempContexts.add(new ThreadLocalContext(SessionScoped.class, false)); |
| 98 | 100 | tempContexts.add(new ThreadLocalContext(ConversationScoped.class)); |
| 99 | 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 | 113 | Collections.sort(processors); |
| 115 | 114 | Throwable failure = null; |
| 116 | 115 | |
| 116 | + for (CustomContext tempContext : tempContexts) { | |
| 117 | + addContext(tempContext, abdEvent); | |
| 118 | + } | |
| 119 | + | |
| 117 | 120 | for (Iterator<ShutdownProcessor> iter = processors.iterator(); iter.hasNext();) { |
| 118 | 121 | ShutdownProcessor processor = iter.next(); |
| 119 | 122 | ... | ... |