[windup-dev] GraphContext in CDI?
Lincoln Baxter, III
lincolnbaxter at gmail.com
Thu Feb 19 10:47:13 EST 2015
I think as we discussed on IRC, using a @CurrentExecution or @Inject
@Current GraphContext would be a possible solution, so that it's clear
which context is being injected.
On Mon, Feb 16, 2015 at 9:41 AM, Ondrej Zizka <ozizka at redhat.com> wrote:
> It would be useful in aligning the rules API - currently we have a mix of
> static classes, "event", 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.
> Not necessary though. (Necessary is a fuzzy, subjective and relative term
> anyway :)
>
> Ondra
>
>
>
> On 16.2.2015 04:28, Lincoln Baxter, III wrote:
>
> 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.
>
> Not sure we've really seen a need to inject it again yet at this point.
>
> On Sat, Feb 14, 2015 at 10:39 PM, Jess Sightler <jsightle at redhat.com>
> wrote:
>
>> It is not currently possible to inject the current GraphContext.
>>
>> On 02/13/2015 11:30 PM, Ondrej Zizka wrote:
>> > Hi,
>> >
>> > I was playing with CDI, trying to inject GraphContext into
>> > ArchiveIdentificationGraphChangedListener.
>> >
>> > The original way to get it there is through constructor param.
>> > So I changed is so it is passed by setter, for the purpose of this
>> > experiment.
>> >
>> > When I added @Inject GraphContext grCtx; it is injected something
>> > different than what the setter gets. I.e. different instances.
>> > So I conclude that this in GraphContextImpl
>> >
>> > @Produces
>> > @ApplicationScoped
>> > public GraphContext produceGraphContext()
>> >
>> > is not really giving something application scoped.
>> >
>> > Why?
>> > I know there's GraphContextFactory, but still - @Inject'ing
>> > GraphContext, in the current setup, should IMO return the same
>> > GraphContext - or not?
>> >
>> > Thanks,
>> > Ondra
>> >
>> > _______________________________________________
>> > windup-dev mailing list
>> > windup-dev at lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/windup-dev
>>
>> --
>> Calendar Free/Busy:
>> https://www.google.com/calendar/embed?src=jsightle%40redhat.com&ctz=America/New_York
>>
>> _______________________________________________
>> windup-dev mailing list
>> windup-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/windup-dev
>>
>
>
>
> --
> Lincoln Baxter, III
> http://ocpsoft.org
> "Simpler is better."
>
>
> _______________________________________________
> windup-dev mailing listwindup-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/windup-dev
>
>
>
> _______________________________________________
> windup-dev mailing list
> windup-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/windup-dev
>
--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/windup-dev/attachments/20150219/f4056ba7/attachment.html
More information about the windup-dev
mailing list