[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by Jens Schumann (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
Jens Schumann commented on CDI-370:
-----------------------------------
While the current CDI spec maintains a strong relationship between RequestScoped and HTTP i would not assume that RequestScoped is strictly bound to HTTP. The RequestScope spec/javadoc lists 4 use cases with one being bound to HTTP and another one that may hint a dependency to HTTP (because of JAX-RS, JAX-WS doesn't require HTTP). Especially the availability in EJB method invocations and @PostConstruct tells me: RequestScopes lives without HTTP just perfectly.
So RequestScoped should be available for WebSocket message delivery similar to the current JMS/@Asynchronous support.
Personally I believe the sections "6.7.x {scope} context lifecycle" are already too verbose. I have no profound knowledge of the Java EE specification process, nevertheless I believe the scope lifecycle should be better covered by the Java EE umbrella spec similar to security and transactions (Java Platform, Enterprise Edition (Java EE) Specification, v7 and later). This way you can expanded the supported platform specs without touching the CDI spec again.
Same applies to "2.4.1 Built-in scope types". The current wording "The @RequestScoped, @ApplicationScoped and @SessionScoped annotations defined in Section 6.7 represent the standard scopes defined by the Java Servlets specification." does not cover all supported use cases in 6.7.x and should relaxed (in a CDI 1.1 maintenance release i guess).
> 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
11 years, 10 months
[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by Romain Manni-Bucau (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
Romain Manni-Bucau commented on CDI-370:
----------------------------------------
Guys, this is a real issue of CDI.
RequestScoped => http request (+ few cases). So it means if you need a clean bean by thread (for thread safety for instance) you'll use it but your code will not be usable in a context without web front.
> 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
11 years, 10 months
[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-370:
--------------------------------
Agreed, this isn't a CDI spec issue. This is definitely a web socket spec issue.
> 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
11 years, 10 months
[JBoss JIRA] (CDI-31) Asynchronous events
by Gerhard Petracek (JIRA)
[ https://issues.jboss.org/browse/CDI-31?page=com.atlassian.jira.plugin.sys... ]
Gerhard Petracek edited comment on CDI-31 at 5/7/13 6:12 AM:
-------------------------------------------------------------
i haven't said that it is spec compliment or portable or supports every use-case. currently it only works with owb.
was (Author: gpetracek):
i haven't said that it is spec compliment or portable or supports every use-case. (it's tested with owb as well as tomee)
> Asynchronous events
> -------------------
>
> Key: CDI-31
> URL: https://issues.jboss.org/browse/CDI-31
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Events
> Affects Versions: 1.0
> Reporter: Nicklas Karlsson
> Fix For: TBD
>
>
> Consider including asynchronous events as their were specified in one of the previous drafts.
--
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
11 years, 10 months
[JBoss JIRA] (CDI-31) Asynchronous events
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-31?page=com.atlassian.jira.plugin.sys... ]
Martin Kouba commented on CDI-31:
---------------------------------
Gerhard, I don't think your {{AsyncInterceptor}} impl is quite correct and portable. Firstly the interceptors spec states: "Around-invoke and around-timeout interceptor methods run in the same Java thread as the associated target method.". So if there's some associated interceptor to be invoked after {{AsyncInterceptor}} this spec rule is violated. Furthermore I don't think it's legal/portable to invoke {{InvocationContext.proceed()}} in a different thread...
> Asynchronous events
> -------------------
>
> Key: CDI-31
> URL: https://issues.jboss.org/browse/CDI-31
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Events
> Affects Versions: 1.0
> Reporter: Nicklas Karlsson
> Fix For: TBD
>
>
> Consider including asynchronous events as their were specified in one of the previous drafts.
--
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
11 years, 10 months
[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by Jens Schumann (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
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
11 years, 10 months
[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by Jens Schumann (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
Jens Schumann commented on CDI-370:
-----------------------------------
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
11 years, 10 months
[JBoss JIRA] (CDI-370) Expand @RequestScoped and @SessionScoped to account for WebSocket
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-370?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-370:
--------------------------------
IMHO, RequestScoped isn't appropriate here. TransactionScoped is appropriate, assuming that the method is properly annotated for transaction scoped.
> 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
11 years, 10 months