On the subject of serializable. We fail one of the comments in the MP Spec (but not in the TCK!) our injected Config class is *not* serializable. But for that to work, all config sources and all converters must be serializable.
On Tue, Aug 8, 2017 at 6:57 AM Mark Struberg <[email protected]> wrote: > 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 > >> > > > >
