Hi,
On Sat, May 28, 2016 at 11:24 PM, Ondrej Mihályi <ondrej.mihalyi(a)gmail.com>
wrote:
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