[JBoss JIRA] (CDI-452) Specify that web scoped (request, session, application) beans are injectable in async servlets
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-452?page=com.atlassian.jira.plugin.sy... ]
John Ament updated CDI-452:
---------------------------
Component/s: Contexts
> Specify that web scoped (request, session, application) beans are injectable in async servlets
> ----------------------------------------------------------------------------------------------
>
> Key: CDI-452
> URL: https://issues.jboss.org/browse/CDI-452
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Contexts, Java EE integration
> Affects Versions: 1.0
> Reporter: Ed Burns
> Assignee: John Ament
> Priority: Trivial
> Fix For: 2.0 (discussion)
>
>
> Consider this code based on this blog post: < https://weblogs.java.net/blog/swchan2/archive/2013/06/06/asynchronous-ser... >.
> {code}
> @WebServlet(urlPatterns="/test2", asyncSupported=true)
> public class TestAsyncMESServlet extends HttpServlet {
> @Resource
> private ManagedExecutorService managedExecutorService;
> @Inject
> MyRunnableImpl myRunnableImpl;
> @Override
> protected void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
> final AsyncContext asyncContext = req.startAsync();
> final PrintWriter writer = res.getWriter();
> managedExecutorService.submit(myRunnableImpl);
> }
> public static class MyRunnableImpl implements Runnable {
> @Inject
> Bean bean; // Bean is @RequestScoped
> @Override
> public void run() {
> writer.println("Done");
> asyncContext.complete();
> }
> }
> }
> {code}
> According to Jozef Hartzinger, this currently does not work, because only @Dependent and @ApplicationScoped beans are propagated to the new thread. To keep CDI relevant in light of the reactive programming movement and the popularity of node.js, we need to make this work.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (CDI-452) Specify that web scoped (request, session, application) beans are injectable in async servlets
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-452?page=com.atlassian.jira.plugin.sy... ]
John Ament updated CDI-452:
---------------------------
Priority: Major (was: Trivial)
> Specify that web scoped (request, session, application) beans are injectable in async servlets
> ----------------------------------------------------------------------------------------------
>
> Key: CDI-452
> URL: https://issues.jboss.org/browse/CDI-452
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Contexts, Java EE integration
> Affects Versions: 1.0
> Reporter: Ed Burns
> Assignee: John Ament
> Fix For: 2.0 (discussion)
>
>
> Consider this code based on this blog post: < https://weblogs.java.net/blog/swchan2/archive/2013/06/06/asynchronous-ser... >.
> {code}
> @WebServlet(urlPatterns="/test2", asyncSupported=true)
> public class TestAsyncMESServlet extends HttpServlet {
> @Resource
> private ManagedExecutorService managedExecutorService;
> @Inject
> MyRunnableImpl myRunnableImpl;
> @Override
> protected void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
> final AsyncContext asyncContext = req.startAsync();
> final PrintWriter writer = res.getWriter();
> managedExecutorService.submit(myRunnableImpl);
> }
> public static class MyRunnableImpl implements Runnable {
> @Inject
> Bean bean; // Bean is @RequestScoped
> @Override
> public void run() {
> writer.println("Done");
> asyncContext.complete();
> }
> }
> }
> {code}
> According to Jozef Hartzinger, this currently does not work, because only @Dependent and @ApplicationScoped beans are propagated to the new thread. To keep CDI relevant in light of the reactive programming movement and the popularity of node.js, we need to make this work.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (CDI-452) Specify that web scoped (request, session, application) beans are injectable in async servlets
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-452?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-452:
--------------------------------
[~edburns] I just want to confirm. Your expectation here is that you can bridge the existing request context/session context from the servlet request in to the new async thread, allowing the same instances of the beans (and in turn, their data) to be accessed in both threads.
If so, what synchronization would you expect, if any, to be provided by the CDI container? Or would you prefer to leave it to the developer to handle synchronization concerns?
> Specify that web scoped (request, session, application) beans are injectable in async servlets
> ----------------------------------------------------------------------------------------------
>
> Key: CDI-452
> URL: https://issues.jboss.org/browse/CDI-452
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Java EE integration
> Affects Versions: 1.0
> Reporter: Ed Burns
> Priority: Trivial
> Fix For: 2.0 (discussion)
>
>
> Consider this code based on this blog post: < https://weblogs.java.net/blog/swchan2/archive/2013/06/06/asynchronous-ser... >.
> {code}
> @WebServlet(urlPatterns="/test2", asyncSupported=true)
> public class TestAsyncMESServlet extends HttpServlet {
> @Resource
> private ManagedExecutorService managedExecutorService;
> @Inject
> MyRunnableImpl myRunnableImpl;
> @Override
> protected void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
> final AsyncContext asyncContext = req.startAsync();
> final PrintWriter writer = res.getWriter();
> managedExecutorService.submit(myRunnableImpl);
> }
> public static class MyRunnableImpl implements Runnable {
> @Inject
> Bean bean; // Bean is @RequestScoped
> @Override
> public void run() {
> writer.println("Done");
> asyncContext.complete();
> }
> }
> }
> {code}
> According to Jozef Hartzinger, this currently does not work, because only @Dependent and @ApplicationScoped beans are propagated to the new thread. To keep CDI relevant in light of the reactive programming movement and the popularity of node.js, we need to make this work.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (CDI-452) Specify that web scoped (request, session, application) beans are injectable in async servlets
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-452?page=com.atlassian.jira.plugin.sy... ]
John Ament reassigned CDI-452:
------------------------------
Assignee: John Ament
> Specify that web scoped (request, session, application) beans are injectable in async servlets
> ----------------------------------------------------------------------------------------------
>
> Key: CDI-452
> URL: https://issues.jboss.org/browse/CDI-452
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Java EE integration
> Affects Versions: 1.0
> Reporter: Ed Burns
> Assignee: John Ament
> Priority: Trivial
> Fix For: 2.0 (discussion)
>
>
> Consider this code based on this blog post: < https://weblogs.java.net/blog/swchan2/archive/2013/06/06/asynchronous-ser... >.
> {code}
> @WebServlet(urlPatterns="/test2", asyncSupported=true)
> public class TestAsyncMESServlet extends HttpServlet {
> @Resource
> private ManagedExecutorService managedExecutorService;
> @Inject
> MyRunnableImpl myRunnableImpl;
> @Override
> protected void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
> final AsyncContext asyncContext = req.startAsync();
> final PrintWriter writer = res.getWriter();
> managedExecutorService.submit(myRunnableImpl);
> }
> public static class MyRunnableImpl implements Runnable {
> @Inject
> Bean bean; // Bean is @RequestScoped
> @Override
> public void run() {
> writer.println("Done");
> asyncContext.complete();
> }
> }
> }
> {code}
> According to Jozef Hartzinger, this currently does not work, because only @Dependent and @ApplicationScoped beans are propagated to the new thread. To keep CDI relevant in light of the reactive programming movement and the popularity of node.js, we need to make this work.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
CDI-30 F2F meeting summary
by Antoine Sabot-Durand
Hi all,
Just to sum up the meeting we had today about CDI-30 and John's PR.
If I forgot something, the attendee (John, Matej and Werner) can of course
correct or add content.
While we agreed that this feature is very important, it's obvious that each
of us has a different way of seeing it.
To try to get out of the current dead end, the idea was to split the
problem in 2 goal :
1. Provide low level SPI for framework and spec developers to reuse cdi
built in scope. Roughly it consist of giving the possibility to activate
and deactivate context programmatically. If it's possible this should be
done without adding new interface to keep the SPI as simple as possible
2. Provide a mean for standard (yet advanced) developers to
activate/deactivate built-in contexts at will (probably thru interceptors)
Goal 1 is mandatory for EDR2 while goal 2 is a nice to have.
John start the work on goal 1 in the coming days.
For goal 2 it would be nice that each of us think about one or more real
life use case that this context activation could allow to check if the
design SPI fits the need.
Antoine
8 years, 6 months
[JBoss JIRA] (CDI-619) Simple for developers approach to starting contexts
by John Ament (JIRA)
John Ament created CDI-619:
------------------------------
Summary: Simple for developers approach to starting contexts
Key: CDI-619
URL: https://issues.jboss.org/browse/CDI-619
Project: CDI Specification Issues
Issue Type: Feature Request
Components: Contexts
Affects Versions: 2.0-EDR1
Reporter: John Ament
As an application developer, I can leverage a cross-functional feature in CDI to start a context for the duration of an invocation.
This should be safe enough that if this given context is already active, it does not get reactivated.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (CDI-618) I can associate an existing context to another thread
by John Ament (JIRA)
John Ament created CDI-618:
------------------------------
Summary: I can associate an existing context to another thread
Key: CDI-618
URL: https://issues.jboss.org/browse/CDI-618
Project: CDI Specification Issues
Issue Type: Feature Request
Components: Contexts
Affects Versions: 2.0-EDR1
Reporter: John Ament
As a framework developer, when I start a new thread, or associate a new task to an existing thread, I can temporarily associate a context associated with another thread with the new thread.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
Re: [cdi-dev] Tomorrow's meeting recording
by Werner Keil
>...too high
>risk of something written on a wall ending up on video.
So much for transparency;-|
Werner
On Fri, Jun 24, 2016 at 2:59 PM, <cdi-dev-request(a)lists.jboss.org> wrote:
> Send cdi-dev mailing list submissions to
> cdi-dev(a)lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> or, via email, send a message with subject or body 'help' to
> cdi-dev-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> cdi-dev-owner(a)lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of cdi-dev digest..."
>
>
> Today's Topics:
>
> 1. Re: Tomorrow's meeting recording (John D. Ament)
> 2. Re: Tomorrow's meeting recording (Martin Kouba)
> 3. Re: Tomorrow's meeting recording (Antoine Sabot-Durand)
> 4. Re: Please review PR 290 (bootstrap se) (Michael Remijan)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 23 Jun 2016 23:24:43 +0000
> From: "John D. Ament" <john.d.ament(a)gmail.com>
> Subject: Re: [cdi-dev] Tomorrow's meeting recording
> To: Antoine Sabot-Durand <antoine(a)sabot-durand.net>, cdi-dev
> <cdi-dev(a)lists.jboss.org>
> Message-ID:
> <
> CAOqetn-DCJ17cvKxBuc_BM14gBxub3gMvRZKEhKovM3z06snMw(a)mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Unfortunately, I won't be able to do video if its being recorded, too high
> risk of something written on a wall ending up on video.
>
> John
>
> On Thu, Jun 23, 2016 at 4:38 PM Antoine Sabot-Durand <
> antoine(a)sabot-durand.net> wrote:
>
> > Hi all,
> >
> > As all of us won't be able to attend the meeting, it will be recorder for
> > further reference. Hence the meeting will take place on redhat Bluejeans
> > meeting service.
> > II've just added the url to the invitation.
> > If you want to attend and are not on the list please tell me and I'll add
> > you.
> >
> > Antoine
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
> > Note that for all code provided on this list, the provider licenses the
> > code under the Apache License, Version 2 (
> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> > provided on this list, the provider waives all patent and other
> > intellectual property rights inherent in such information.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/cdi-dev/attachments/20160623/57308212/at...
>
> ------------------------------
>
> Message: 2
> Date: Fri, 24 Jun 2016 09:06:16 +0200
> From: Martin Kouba <mkouba(a)redhat.com>
> Subject: Re: [cdi-dev] Tomorrow's meeting recording
> To: "John D. Ament" <john.d.ament(a)gmail.com>, Antoine Sabot-Durand
> <antoine(a)sabot-durand.net>, cdi-dev <cdi-dev(a)lists.jboss.org>
> Message-ID: <576CDBE8.1040506(a)redhat.com>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> I should admit that it was my idea because I will not be able to attend
> the meeting and would really like to see/hear the discussion and arguments.
>
> Also I belive the recording should only be available to CDI EG memebers.
>
> Martin
>
> Dne 24.6.2016 v 01:24 John D. Ament napsal(a):
> > Unfortunately, I won't be able to do video if its being recorded, too
> > high risk of something written on a wall ending up on video.
> >
> > John
> >
> > On Thu, Jun 23, 2016 at 4:38 PM Antoine Sabot-Durand
> > <antoine(a)sabot-durand.net <mailto:antoine@sabot-durand.net>> wrote:
> >
> > Hi all,
> >
> > As all of us won't be able to attend the meeting, it will be
> > recorder for further reference. Hence the meeting will take place on
> > redhat Bluejeans meeting service.
> > II've just added the url to the invitation.
> > If you want to attend and are not on the list please tell me and
> > I'll add you.
> >
> > Antoine
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev(a)lists.jboss.org <mailto:cdi-dev@lists.jboss.org>
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
> > Note that for all code provided on this list, the provider licenses
> > the code under the Apache License, Version 2
> > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other
> > ideas provided on this list, the provider waives all patent and
> > other intellectual property rights inherent in such information.
> >
> >
> >
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
> > Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
> >
>
> --
> Martin Kouba
> Software Engineer
> Red Hat, Czech Republic
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 24 Jun 2016 08:33:06 +0000
> From: Antoine Sabot-Durand <antoine(a)sabot-durand.net>
> Subject: Re: [cdi-dev] Tomorrow's meeting recording
> To: Martin Kouba <mkouba(a)redhat.com>, "John D. Ament"
> <john.d.ament(a)gmail.com>, cdi-dev <cdi-dev(a)lists.jboss.org>
> Message-ID:
> <
> CABu-YBTCfCkH6Xf7E0GgghK1agXDmq2sRK05LSeUV4pfpKkVVw(a)mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> It will have restricted access and will be destroyed with the merge of
> CDI-30 ;)
>
> Le ven. 24 juin 2016 ? 09:06, Martin Kouba <mkouba(a)redhat.com> a ?crit :
>
> > I should admit that it was my idea because I will not be able to attend
> > the meeting and would really like to see/hear the discussion and
> arguments.
> >
> > Also I belive the recording should only be available to CDI EG memebers.
> >
> > Martin
> >
> > Dne 24.6.2016 v 01:24 John D. Ament napsal(a):
> > > Unfortunately, I won't be able to do video if its being recorded, too
> > > high risk of something written on a wall ending up on video.
> > >
> > > John
> > >
> > > On Thu, Jun 23, 2016 at 4:38 PM Antoine Sabot-Durand
> > > <antoine(a)sabot-durand.net <mailto:antoine@sabot-durand.net>> wrote:
> > >
> > > Hi all,
> > >
> > > As all of us won't be able to attend the meeting, it will be
> > > recorder for further reference. Hence the meeting will take place
> on
> > > redhat Bluejeans meeting service.
> > > II've just added the url to the invitation.
> > > If you want to attend and are not on the list please tell me and
> > > I'll add you.
> > >
> > > Antoine
> > > _______________________________________________
> > > cdi-dev mailing list
> > > cdi-dev(a)lists.jboss.org <mailto:cdi-dev@lists.jboss.org>
> > > https://lists.jboss.org/mailman/listinfo/cdi-dev
> > >
> > > Note that for all code provided on this list, the provider licenses
> > > the code under the Apache License, Version 2
> > > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other
> > > ideas provided on this list, the provider waives all patent and
> > > other intellectual property rights inherent in such information.
> > >
> > >
> > >
> > > _______________________________________________
> > > cdi-dev mailing list
> > > cdi-dev(a)lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/cdi-dev
> > >
> > > Note that for all code provided on this list, the provider licenses the
> > code under the Apache License, Version 2 (
> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> > provided on this list, the provider waives all patent and other
> > intellectual property rights inherent in such information.
> > >
> >
> > --
> > Martin Kouba
> > Software Engineer
> > Red Hat, Czech Republic
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/cdi-dev/attachments/20160624/660a43b7/at...
>
> ------------------------------
>
> Message: 4
> Date: Fri, 24 Jun 2016 12:58:07 +0000 (UTC)
> From: Michael Remijan <mjremijan(a)yahoo.com>
> Subject: Re: [cdi-dev] Please review PR 290 (bootstrap se)
> To: Antoine Sabot-Durand <antoine(a)sabot-durand.net>, "John D. Ament"
> <john.d.ament(a)gmail.com>, cdi-dev <cdi-dev(a)lists.jboss.org>
> Message-ID:
> <2064584222.725169.1466773087613.JavaMail.yahoo(a)mail.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
>
> Is a build available yet to test the new Bootstrap? I'd like to upgrade
> from 3.0.0.Alpha15
>
>
>
> On Thursday, June 23, 2016 6:47 AM, Antoine Sabot-Durand <
> antoine(a)sabot-durand.net> wrote:
>
>
> Error corrected. You can review the PR
> Thx John
> Le?jeu. 23 juin 2016 ??13:06, Antoine Sabot-Durand <
> antoine(a)sabot-durand.net> a ?crit?:
>
> OMG you're right. Javadoc has suffered from renaming refactoring :-(. Let
> me correct this
> Le?jeu. 23 juin 2016 ??12:09, John D. Ament <john.d.ament(a)gmail.com> a
> ?crit?:
>
> Antoine,
> Did you go a little too deep in renaming container -> bootstrap? Looks
> like many references to an EE container were changed.? Intentional?
> John
> On Thu, Jun 23, 2016 at 6:06 AM Antoine Sabot-Durand <
> antoine(a)sabot-durand.net> wrote:
>
> Hi all,
> After integration of feedback, the new bootstrap API is in its final
> form.Please review it carefully to find the possible last errors [1].
> Generated spec doc can also be read here [2]
> Thanks for your help to integrate this very expected feature.
>
> Antoine
>
>
> [1] https://github.com/cdi-spec/cdi/pull/290
> [2] https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html#bootstrap-se
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/cdi-dev/attachments/20160624/d48fb094/at...
>
> ------------------------------
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
> End of cdi-dev Digest, Vol 67, Issue 18
> ***************************************
>
8 years, 6 months