<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 1:54 PM, John D. Ament <span dir="ltr">&lt;<a href="mailto:john.d.ament@gmail.com" target="_blank">john.d.ament@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">That sounds like a separate issue.</div></blockquote><div><br></div><div>It is technically indeed, but the new context controller is the closest thing to date that I&#39;ve seen. It&#39;s *almost* there.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">We want all of the app servers to behave the same way, I wouldn&#39;t expect this change to fix that, or even to make it so that libraries could fix that.<br><div class="gmail_quote"><div><br></div><div>Maybe there&#39;s a missing TCK assertion?</div></div></div></blockquote><div><br></div><div>Root problem is the JSR 196 spec is silent on this. I would have likely been doing the work for a JSR 196 MR that would clarify this by about now, but then the entire &quot;resource problem&quot; situation started, and even though I would practically be doing all the work, this MR never got off the ground.</div><div><br></div><div>Another option though is to add it to the CDI spec, as that one currently references all the other specs for which the build-in scopes should be active. E.g. in 6.7.1 it now says: </div><div><br></div><div>&quot;during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener or AsyncListener,&quot;</div><div><br></div><div>This should become something like:</div><div><br></div><div>&quot;during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener, AsyncListener or ServerAuthContext,&quot;</div><div><br></div><div>To make it extra clear, but slightly longer:</div><div><br></div><div>&quot;during the service() method of any servlet in the web application, during the doFilter() method of any servlet filter and when the container calls any ServletRequestListener, AsyncListener or ServerAuthContex (and by extension therefor its embedded ServerAuthModules, if any) for the Servlet Container Profile,&quot;</div><div><br></div><div>Thoughts?</div><div><br></div><div>Kind regards,</div><div>Arjan Tijms</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Kind regards,</div><div>Arjan Tijms</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">In addition, I think you&#39;re looking for the equivalent of Context.isActive. Part of me even wonders if swapping around the impl to be Context.activate() and Context.deactivate() may be better from a domain standpoint. <br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">What I&#39;m looking for is a way to start contexts possibly earlier than a specific container implementation normally starts them, and stop them possibly later. If the context is started earlier in say a request, then eventually the container will also start that same context later in the request. If that will throw an exception the request will not proceed, which is of course not intended.<br>Likewise, when the container stops the context this will thus be too early.<br>With a wrapped context controller, the startContexts and stopContexts calls can be ignored for those contexts the application (extension/library) wanted to start earlier and stop later. This does of course assume that the container itself will also use this context controller instead of the current proprietary code.<br>Additionally, the PR does not contain the check anymore to see if the context is already active or already stopped. Is that still intended to be added? This would be particularly useful for code that needs to be portable between different containers, where one container may already have started the context at a given point, where another container has not (catching the exception would be an alternative here but is obviously not so nice).<br>Another point, what about letting the caller of the startContexts method optionally pass in the objects (or a lambda to obtain them) on which that context primarily depends (if any). E.g. for the request scope, pass in an HttpServletRequest instance.</blockquote></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Would it be an idea to set a wrapped (or decorated) context controller?<br></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"></blockquote></div><div dir="ltr"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Sun, May 15, 2016 at 6:33 PM, John D. Ament <span dir="ltr">&lt;<a href="mailto:john.d.ament@gmail.com" target="_blank">john.d.ament@gmail.com</a>&gt;</span> wrote:</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">All,</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I&#39;ve started a PR for API changes to support starting/stopping the built in contexts, which you can find here: <a href="https://github.com/cdi-spec/cdi/pull/291/files" target="_blank">https://github.com/cdi-spec/cdi/pull/291/files</a></blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">It&#39;s visibly based on what is in DeltaSpike&#39;s CDI Ctrl plus some of the external stuff (e.g. <a href="https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/api/src/main/java/org/apache/deltaspike/scheduler/api/Scheduled.java#L40" target="_blank">https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/api/src/main/java/org/apache/deltaspike/scheduler/api/Scheduled.java#L40</a> ) so I&#39;d like to get some input.</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I don&#39;t suspect that this will be an SE only feature, today I use programmatic context starting even while on an app server.  Even though I&#39;m not using whats provided in DS, it was identified as a clear cross cutting concern hence why there&#39;s an interceptor as well.</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">John</blockquote></div></blockquote></div><div dir="ltr"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">_______________________________________________</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
cdi-dev mailing list</blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a></blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></blockquote></div><div class="gmail_extra"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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" rel="noreferrer" 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.</blockquote></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote></div></div></blockquote><div class="gmail_extra"><br></div></div>
</blockquote></span></div></div>
</blockquote></div><br></div></div>