Hi there,<br><br>On Thursday, December 4, 2014, Pavel Bucek &lt;<a href="mailto:pavel.bucek@oracle.com">pavel.bucek@oracle.com</a>&gt; 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,<br>
      <br>
      On 03/12/14 19:44, arjan tijms wrote:<br>
    </div>
    <blockquote type="cite">Hi,<br>
      <br>
      On Wednesday, December 3, 2014, Pavel Bucek &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;pavel.bucek@oracle.com&#39;);" target="_blank">pavel.bucek@oracle.com</a>&gt;
      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&#39;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 &quot;standard&quot; 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&#39;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.</div><div text="#000000" bgcolor="#FFFFFF"></div></blockquote><div> </div><div>Okay, so in a more broader application than just WebSocket it could be defined somewhere lower in the spec hierarchy. If it&#39;s specific to HTTP upgrades as you mention, then Servlet may be the next candidate to consider.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"> 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. </div><div text="#000000" bgcolor="#FFFFFF"></div></blockquote><div><br></div><div>But some of these may not actually belong there. They may have been put there originally since as a new spec that had yet to be proven, CDI could not right away ask other specs to support it.</div><div><br></div><div>There are discussions going on to move some of the Servlet things from CDI to Servlet.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"> 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&#39;t think that Servlet spec
    should introduce similar dependency just because of new scope.</div></blockquote><div><br></div><div>There are plenty of other reasons too ;) For Servlet I expect the dependencies to be optional. Servlet in a EE environment will then provide scope X &amp; Y, and producers for types Q &amp; R, but it will continue to run standalone without needing any CDI. In short, it would provides things for CDI then but in its core wouldn&#39;t need CDI.</div><div><br></div><div>Just my 2 cents ;)</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><br>
    <br>
    Thanks,<br>
    Pavel<br>
    <br>
  </div></blockquote><div><br></div><div> </div>