[cdi-dev] [JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket

Jens Schumann (JIRA) jira-events at lists.jboss.org
Mon May 6 16:15:54 EDT 2013


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

Jens Schumann edited comment on CDI-370 at 5/6/13 4:14 PM:
-----------------------------------------------------------

I don't think this is an CDI spec issue at all. The cdi spec doesn't cover JAX-RS or JAX-WS calls either. This should be part of the web socket spec or the enclosing Java EE 7 umbrella.

TX scope is fine if marked appropriately. Request scope should be available in any case, I have no idea whether session and/or conversation scoped are required. 

(I always felt that it would be good to have conversation and session scope support for jax-rs, nevertheless it breaks the stateless contract of restful services).
                
      was (Author: french_c):
    I don't think this is an CDI issue at all. The cdi spec doesn't cover JAX-RS or JAX-WS calls either. This should be part of the web socket spec or the enclosing Java EE 7 umbrella.

TX scope is fine if marked appropriately. Request scope should be available in any case, I have no idea whether session and/or conversation scoped are required. 

(I always felt that it would be good to have conversation and session scope support for jax-rs, nevertheless it breaks the stateless contract of restful services).
                  
> Expand @RequestScoped and @SessionScoped to account for WebSocket
> -----------------------------------------------------------------
>
>                 Key: CDI-370
>                 URL: https://issues.jboss.org/browse/CDI-370
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Joseph Snyder
>
> We've been testing injection into a WebSocket endpoint.
> @ReqestScoped objects are usable within the @OnOpen callback. This is because this object is executed within a valid request scope.
> However if you try to use the injected object from within the @OnMessage callback you get a Weld error:
> SEVERE:   org.jboss.weld.context.ContextNotActiveException:
> WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
> Can the definition of when @RequestScoped is active be expanded to include a WebSocket @OnMessage callback?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list