[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný updated WELD-2609 Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Change By: Matěj Novotný Status: Pull Request Sent Resolved Resolution: Done Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Issue was automatically transitioned when Matěj Novotný created pull request #1977 in GitHub Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Change By: Matěj Novotný Status: Open Pull Request Sent Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný updated an issue Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Change By: Matěj Novotný Git Pull Request: https://github.com/weld/core/pull/1977 Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný assigned an issue to Matěj Novotný Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Change By: Matěj Novotný Assignee: Matěj Novotný Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Björn Kautler commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback Well, you don't have to supply the bean at that time. Two alternatives that could both be supported are read(Method, BeanConfigurator) to say "call that method as observer on the bean generated by that bean configurator" and read(Method, Supplier) where the supplier can provide the bean to use after the set of beans has settled down, or maybe read(Method, Object) where the second parameter has to have some producer for the right type, so that you can get things injected to calculate the correct bean or similar Actually with your help in WELD-2608 I don't need this anymore for my current use-case, but it could still be useful imho. Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback Supplying the bean is tricky - remember that when you are doing this, you are still in the process of adding beans. You may or may not see the whole set of beans in the deployment as other extensions might be fiddling with it as well. There are limitations to what operations can be done at what time, this part of spec can give you a picture of that (since you would usually use BM to do it anyway). Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Björn Kautler edited a comment on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback Hm, for my use-case it is.But you might be right about the general case.If it cannot be deducted automatically, maybe some helpers can be added though?Like a ` {{ read ` }} call which you also give the bean or the ` {{ BeanConfigurator ` }} or some way to find the bean.It cannot really be the intention that you have to manually reprogram the parameter injection logic if you have a method that would work perfectly fine if you added the bean the "traditional" way. Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Björn Kautler commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback Yeah, I understood that from Martin already, but how about my suggestion to have some helper method or observer method invocation wrapper or whatever. Something where you just have to supply the bean and the method and the magic like parameter injection and so on is done automatically and does not need to be reimplemented. Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný updated an issue Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Change By: Matěj Novotný Fix Version/s: 3.1.4.Final Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Matěj Novotný commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback The async bit is totally a bug we should fix. As for notify callback; in order to call an observer method, you need to know what bean it belongs to because you then need to retrieve the respective bean from context (or create it) and invoke it. The information we get from reading the method is insufficient for that. If we try to get the bean based on just class we might blow up with ambig. or unsatisfied dep. The bean can be @Typed or can have qualifiers or you can simply be looking not for this bean but some other extending it. Therefore, you as a programmer are the only person who really knows what callback to invoke for sure. It might be worth a spec issue to improve the docs in this regard - to specifically state that callback must be set even if you do read(). Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Björn Kautler commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback Hm, for my use-case it is. But you might be right about the general case. If it cannot be deducted automatically, maybe some helpers can be added though? Like a `read` call which you also give the bean or the `BeanConfigurator` or some way to find the bean. It cannot really be the intention that you have to manually reprogram the parameter injection logic if you have a method that would work perfectly fine if you added the bean the "traditional" way. Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Martin Kouba commented on WELD-2609 Re: ObserverMethodConfigurator#read methods do not set async and notify callback I think that the absence of the async property is a bug. However, the the notify callback is not something you can reliably deduct from a method, ie. the annotatedBeanType.javaClass might not be enough to find the correct bean instance. Therefore, I suppose that the original intent was to always require a callback to be manually set. Add Comment This message was sent by Atlassian Jira (v7.13.8#713008-sha1:1606a5c) ___ weld-issues mailing list weld-issues@lists.jboss.org https://lists.jboss.org/mailman/listinfo/weld-issues
[weld-issues] [JBoss JIRA] (WELD-2609) ObserverMethodConfigurator#read methods do not set async and notify callback
Title: Message Title Björn Kautler created an issue Weld / WELD-2609 ObserverMethodConfigurator#read methods do not set async and notify callback Issue Type: Bug Affects Versions: 3.1.3.Final Assignee: Unassigned Created: 14/Dec/19 9:05 PM Priority: Major Reporter: Björn Kautler As described in WELD-2608, I'm adding some beans manually using AfterBeanDiscovery. As the observer methods of those beans are not registered automatically (currently if that issue is valid and not expected), I thought it should be easy to also register the observer methods like I registered the beans. So as I registered the beans using this: afterBeanDiscovery .addBean() .read(annotatedBeanType) .alternative(false) I assumed adding the observer methods should be similar simple. My naive first approach was this, assuming all necessary information is determined by read as was the case for the bean: annotatedBeanType .methods .findAll { it.parameters.any { it.isAnnotationPresent(Observes) || it.isAnnotationPresent(ObservesAsync) } } .each { method -> afterBeanDiscovery .addObserverMethod() .read(method) } But I found two problems with this, namely the async property and the the notify callback are not set. So what I