<div dir="ltr">I think as we discussed on IRC, using a @CurrentExecution or @Inject @Current GraphContext would be a possible solution, so that it&#39;s clear which context is being injected.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 16, 2015 at 9:41 AM, Ondrej Zizka <span dir="ltr">&lt;<a href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    It would be useful in aligning the rules API - currently we have a
    mix of static classes, &quot;event&quot;, and some CDI possibilities. So if I
    need to get something in a CDI-instantiated object, I have to either
    grab it from somewhere in a constructor, or use a setter in the
    place it is injected to. Which seems anti-standard, anti-pattern,
    anti-CDI and bad practice.<br>
    Not necessary though. (Necessary is a fuzzy, subjective and relative
    term anyway :)<br>
    <br>
    Ondra<div><div class="h5"><br>
    <br>
    <br>
    <div>On 16.2.2015 04:28, Lincoln Baxter, III
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Yeah, this is not something that is currently
        supported. It *used* to be injectable many months ago, but we
        removed that because there were a number of bugs with the lazy
        initialization and I remember thinking at the time that it were
        safer to remove and re-introduce later if necessary/beneficial.
        <div><br>
        </div>
        <div>Not sure we&#39;ve really seen a need to inject it again yet at
          this point.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, Feb 14, 2015 at 10:39 PM, Jess
          Sightler <span dir="ltr">&lt;<a href="mailto:jsightle@redhat.com" target="_blank">jsightle@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is not
            currently possible to inject the current GraphContext.<br>
            <div>
              <div><br>
                On 02/13/2015 11:30 PM, Ondrej Zizka wrote:<br>
                &gt; Hi,<br>
                &gt;<br>
                &gt; I was playing with CDI, trying to inject
                GraphContext into<br>
                &gt; ArchiveIdentificationGraphChangedListener.<br>
                &gt;<br>
                &gt; The original way to get it there is through
                constructor param.<br>
                &gt; So I changed is so it is passed by setter, for the
                purpose of this<br>
                &gt; experiment.<br>
                &gt;<br>
                &gt; When I added @Inject GraphContext grCtx; it is
                injected something<br>
                &gt; different than what the setter gets. I.e. different
                instances.<br>
                &gt; So I conclude that this in GraphContextImpl<br>
                &gt;<br>
                &gt; @Produces<br>
                &gt; @ApplicationScoped<br>
                &gt; public GraphContext produceGraphContext()<br>
                &gt;<br>
                &gt; is not really giving something application scoped.<br>
                &gt;<br>
                &gt; Why?<br>
                &gt; I know there&#39;s GraphContextFactory, but still -
                @Inject&#39;ing<br>
                &gt; GraphContext, in the current setup, should IMO
                return the same<br>
                &gt; GraphContext - or not?<br>
                &gt;<br>
                &gt; Thanks,<br>
                &gt; Ondra<br>
                &gt;<br>
                &gt; _______________________________________________<br>
                &gt; windup-dev mailing list<br>
                &gt; <a href="mailto:windup-dev@lists.jboss.org" target="_blank">windup-dev@lists.jboss.org</a><br>
                &gt; <a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a><br>
                <br>
              </div>
            </div>
            <span><font color="#888888">--<br>
                Calendar Free/Busy: <a href="https://www.google.com/calendar/embed?src=jsightle%40redhat.com&amp;ctz=America/New_York" target="_blank">https://www.google.com/calendar/embed?src=jsightle%40redhat.com&amp;ctz=America/New_York</a><br>
              </font></span>
            <div>
              <div><br>
                _______________________________________________<br>
                windup-dev mailing list<br>
                <a href="mailto:windup-dev@lists.jboss.org" target="_blank">windup-dev@lists.jboss.org</a><br>
                <a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div>Lincoln Baxter, III<br>
          <a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>
          &quot;Simpler is better.&quot;</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
windup-dev mailing list
<a href="mailto:windup-dev@lists.jboss.org" target="_blank">windup-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a></pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
windup-dev mailing list<br>
<a href="mailto:windup-dev@lists.jboss.org">windup-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/windup-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/windup-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;</div>
</div>