[cdi-dev] [JBoss JIRA] (CDI-587) Propose a way to propagate an existing context

Emily Jiang (JIRA) issues at jboss.org
Tue Jul 17 17:16:00 EDT 2018


    [ https://issues.jboss.org/browse/CDI-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13607132#comment-13607132 ] 

Emily Jiang commented on CDI-587:
---------------------------------

I vote for this issue. I also would like to see the contexts for SessionScoped, ConversationScoped are also propagated. I came up with the similar design as Romain. The default should be 'false' for context propagation so that the existing apps remain unaffected.

> Propose a way to propagate an existing context
> ----------------------------------------------
>
>                 Key: CDI-587
>                 URL: https://issues.jboss.org/browse/CDI-587
>             Project: CDI Specification Issues
>          Issue Type: Epic
>          Components: Contexts
>    Affects Versions: 1.2.Final
>            Reporter: Romain Manni-Bucau
>
> The overall idea is to ensure that it is not cause the code becomes asynchronous/reactive/... that we loose the instances or get another context.
> An example is starting an AsyncContext in a servlet.
> One proposal is to add a flag to ask for propagation of the context in async managed threads: @RequestScoped(inherited = true) which would reuse the same instances for these "new" threads.
> Note however this issue is not only bound to servlets even if it is the easiest example.
> The original thread disucssion on the list: http://cdi-development-mailing-list.1064426.n5.nabble.com/RequestScope-Life-Cycle-td5712701.html



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the cdi-dev mailing list