[cdi-dev] API to chain Decorators programmatically?

arjan tijms arjan.tijms at gmail.com
Sat May 28 17:36:49 EDT 2016


On Sat, May 28, 2016 at 11:24 PM, Ondrej Mihályi <ondrej.mihalyi at gmail.com>

> I think it would make sense to be able to apply decorators to a bean at
> runtime.

This sounds quite close to Mark Struberg's proposal regarding proxies. It's
not just at inject time that you may wish to have a decorator applied, but
also e.g. from a producer or the create() method of a Bean<T>.

I'm also seeing a use case here for applying interceptors to classes that
are not your own. E.g. currently a decorator is typically your own class
that can be applied to classes that are not your own, and an interceptor is
often not your class that can be applied to classes that are your own.

It would be useful to make this more flexible, so that if a library
provides interceptor A and another library provides a bean X, an
application can easily say that interceptor A should be applied to bean X
(class level, or one of more methods).

Similarly for decorators that could be provided as alternatives by a
library and then on demand applied by the application to certain beans.

Kind regards,
Arjan Tijms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20160528/de842c9f/attachment.html 

More information about the cdi-dev mailing list