Another thing I noticed: While using a Lambda as impl for Provider is very elegant, it still misses an important functionality: it is not Serializable, and thus injecting a @ConfigProperty Provider<String> into a @SessionScoped bean would blow up at runtime.
LieGrue, strub > Am 08.08.2017 um 12:35 schrieb Mark Struberg <[email protected]>: > > I fear that's exactly not possible. CDI resolves with type + qualifier. Since > the type is not unique (mulitple Provider<String>) you would need to make the > Qualifier unique. Means for each of them you need to dynamically create a new > binding ConfigProperty Implementation. > There are 2 problems: > a.) I have no clue how you can dynamically remove the @Nonbinding from the > ConfigProperty annotation. > b.) you have to register tons of such qualifiers, which makes the whole > resolving slower again. You just moved the effort from the Bean#create to > BeanManager#getBeans, that's all > > LieGrue, > strub > >> Am 08.08.2017 um 12:16 schrieb Romain Manni-Bucau <[email protected]>: >> >> b.) the default naming (name="") would break it anyway. You again would need >> to create dynamic qualifiers for each of those injection points. >> >> Not true since you handle it in the extension precomputing it >> >
