<div dir="ltr">Hi <div><br></div><div>FYI we are hoping to have no Servlet related topics in the CDI 2.0 specification. The idea is for other specifications to use CDI to create their own scope (@ViewScoped/@FlowScoped in JSF, but also @TransactionScoped in JTA). Following this logic, the @UpgradeScoped would make sense in the WebSocket spec.</div><div><br></div><div>Antonio</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 4, 2014 at 9:28 AM, Pavel Bucek <span dir="ltr"><<a href="mailto:pavel.bucek@oracle.com" target="_blank">pavel.bucek@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hello Arjan,<span><br>
<br>
On 03/12/14 19:44, arjan tijms wrote:<br>
</span></div><span>
<blockquote type="cite">Hi,<br>
<br>
On Wednesday, December 3, 2014, Pavel Bucek <<a href="mailto:pavel.bucek@oracle.com" target="_blank">pavel.bucek@oracle.com</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I'm trying to figure out how to solve issue in JSR 356 - Java
API for<br>
WebSocket, related to CDI scope usable from WebSocket endpoints.
Problem<br>
is, that "standard" scopes do not apply, because there is no<br>
@RequestScoped (http response is already sent), HttpSession does
not<br>
need to be created and the rest does not seem to be applicable,
...<br>
<br>
I believe that CDI specification should define @UpgradeScoped,
which<br>
would cover usages of HttpUpgradeHandler from Servlet API.
(Similarly as<br>
it does for @RequestScoped, @SessionScoped, ... )</blockquote>
<div><br>
</div>
Wouldn't it be a better option to have WebSocket define that
scope, using CDI to implement it? <br>
</blockquote>
<br></span>
That is one possibility, but @UpgradeScoped would be more general
than just for WebSocket - it would apply for all HTTP/1.1+ Upgrade
applications. In my eyes, it is something which was forgotten to do
in Java EE 7 release, since HttpUpgradeHandler was introduced in it.<br>
<br>
Also please note, that other Servlet related scopes are already in
CDI spec, so it seems like it belongs there more than anywhere else.
This might have multiple reasons - for example, you can easily
define relationship between @UpgradeScoped and others, already
existing ones. In this sense, CDI specification now depends on
Servlet API (it references some of the classes defined in it), but
Servlet does not do that for CDI. I don't think that Servlet spec
should introduce similar dependency just because of new scope.<br>
<br>
Thanks,<br>
Pavel<br>
<br>
</div>
<br>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Antonio Goncalves <br>Software architect, Java Champion and Pluralsight author<br><br><a href="http://www.antoniogoncalves.org" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://pluralsight.com/training/Authors/Details/antonio-goncalves" target="_blank">Pluralsight</a> | <a href="http://www.parisjug.org" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr" target="_blank">Devoxx France</a></div></div>
</div></div>