[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdi-dev] What is the purpose of @Priority on Producers?
|
In short, allowing @Priority on producer methods makes producer methods equally powerful than defining beans by classes.
I’m not sure if Priority plays role in the order of beans, maybe it impacts the order of beans returned from the iterator if an injected Instance.
But Priority has a very important side-effect on beans marked as @Alternative - it enables them automatically, without adding them to beans.xml. And it also automatically enables interceptors without adding them to beans.xml, besides ordering them.
Both alternative beans and interceptors can be produced by a producer. Then you are able to enable them (and order them in case of multiple interceptors) in the same way as if they are defined by a class.
Ondro
For example, if the same interface with different implement, we can identify them with qualifiers. Two producers for this case with @
Priority
is meaningless.
And the beans instantation ordering can be detected by the dependencies.
Is there a simple example to demonstrate it resolves the current issue?
_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev