<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello Arjan,<br>
<br>
On 03/12/14 19:44, arjan tijms wrote:<br>
</div>
<blockquote
cite="mid:CAE=-AhA9Xejxo1aOZ9f=DtScuK-+Zdd_+Cws4iztFC972oFbbQ@mail.gmail.com"
type="cite">Hi,<br>
<br>
On Wednesday, December 3, 2014, Pavel Bucek <<a
moz-do-not-send="true" href="mailto:pavel.bucek@oracle.com">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>
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>
</body>
</html>